Skip to content

Commit

Permalink
Upload my Code Changes/Format/imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander committed Feb 16, 2014
1 parent 5bcdb7c commit 5d4e38c
Show file tree
Hide file tree
Showing 264 changed files with 4,031 additions and 3,989 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -27,4 +27,5 @@ version.properties
#eclipse stuffs
/.classpath
/.project
/.settings/
/.settings/
/debug/
5 changes: 0 additions & 5 deletions src/api/java/mcp/mobius/waila/api/IWailaBlock.java
Expand Up @@ -2,12 +2,7 @@

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public interface IWailaBlock
{
Expand Down
3 changes: 0 additions & 3 deletions src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java
@@ -1,10 +1,7 @@
package mcp.mobius.waila.api;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
Expand Down
17 changes: 7 additions & 10 deletions src/api/java/mods/battlegear2/api/IDyable.java
@@ -1,31 +1,28 @@
package mods.battlegear2.api;


import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

//This is a tempory fix until we get the heradry system up and running
public interface IDyable {
public interface IDyable
{

/**
* Return whether the specified armor ItemStack has a color.
*/
public boolean hasColor(ItemStack par1ItemStack);

public boolean hasColor (ItemStack par1ItemStack);

/**
* Return the color for the specified armor ItemStack.
*/
public int getColor(ItemStack par1ItemStack);
public int getColor (ItemStack par1ItemStack);

public void setColor(ItemStack dyable, int rgb);
public void setColor (ItemStack dyable, int rgb);

/**
* Remove the color from the specified armor ItemStack.
*/
public void removeColor(ItemStack par1ItemStack);

public int getDefaultColor(ItemStack par1ItemStack);
public void removeColor (ItemStack par1ItemStack);

public int getDefaultColor (ItemStack par1ItemStack);

}
15 changes: 7 additions & 8 deletions src/api/java/mods/battlegear2/api/IShield.java
@@ -1,10 +1,10 @@
package mods.battlegear2.api;


import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;

public interface IShield {
public interface IShield
{

/**
* Gets the decay rate for the stamina bar when the shield is in use.
Expand All @@ -14,7 +14,7 @@ public interface IShield {
* @param shield The {@link #ItemStack} representing the shield
* @return a value between 0 & 1 representing the decay rate per tick
*/
public float getDecayRate(ItemStack shield);
public float getDecayRate (ItemStack shield);

/**
* Returns true if the current shield can and should block the given damage source
Expand All @@ -23,7 +23,7 @@ public interface IShield {
* @param source The {@link #DamageSource} representing the current damage
* @return true if the shield can block the given damage type
*/
public boolean canBlock(ItemStack shield, DamageSource source);
public boolean canBlock (ItemStack shield, DamageSource source);

/**
* Gets the extra decay rate to the stamina bar when the shield is damaged
Expand All @@ -32,7 +32,7 @@ public interface IShield {
* @param amount The amount of damage the shield has absorbed
* @return a value between 0 & 1 representing the decay rate
*/
public float getDamageDecayRate(ItemStack shield, float amount);
public float getDamageDecayRate (ItemStack shield, float amount);

/**
* Returns the block angle in degrees that the shield can block.
Expand All @@ -41,14 +41,13 @@ public interface IShield {
* @param shield The {@link #ItemStack} representing the shield
* @return The maximum angle the shield should be able to block at
*/
public float getBlockAngle(ItemStack shield);

public float getBlockAngle (ItemStack shield);

/**
* Returns the time a shield bash should take to be preformed. A shield bash will disallow actions
* for the number of ticks given and will knockback an oponent at time/2
*
* @return The amount of ticks the shield bash animation will play
*/
public int getBashTimer(ItemStack shield);
public int getBashTimer (ItemStack shield);
}
23 changes: 14 additions & 9 deletions src/api/java/mods/battlegear2/api/PlayerEventChild.java
Expand Up @@ -2,27 +2,32 @@

import net.minecraftforge.event.entity.player.PlayerEvent;

public class PlayerEventChild extends PlayerEvent{
public class PlayerEventChild extends PlayerEvent
{

public PlayerEvent parent;
public PlayerEvent parent;

public PlayerEventChild(PlayerEvent parent) {
super(parent.entityPlayer);
this.parent = parent;
}
public PlayerEventChild(PlayerEvent parent)
{
super(parent.entityPlayer);
this.parent = parent;
}

public void setCancelParentEvent(boolean cancel) {
public void setCancelParentEvent (boolean cancel)
{
parent.setCanceled(cancel);
}

@Override
public void setCanceled(boolean cancel) {
public void setCanceled (boolean cancel)
{
super.setCanceled(cancel);
parent.setCanceled(cancel);
}

@Override
public void setResult(Result value) {
public void setResult (Result value)
{
super.setResult(value);
parent.setResult(value);
}
Expand Down
31 changes: 16 additions & 15 deletions src/api/java/mods/battlegear2/api/quiver/IArrowContainer2.java
Expand Up @@ -5,45 +5,45 @@
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public interface IArrowContainer2 {
public interface IArrowContainer2
{

/**
* Returns the maximum amout of slots in the arrow container
* @param container {@link #ItemStack} representing this item
* @return the amount of slots
*/
public int getSlotCount(ItemStack container);
public int getSlotCount (ItemStack container);

/**
* Returns the currently selected slot in the arrow container
* @param container {@link #ItemStack} representing this item
* @return the currently selected slot
*/
public int getSelectedSlot(ItemStack container);
public int getSelectedSlot (ItemStack container);

/**
* Sets the currently selected slot to the given value
* @param container {@link #ItemStack} representing this item
* @param newSlot the new slot index
*/
public void setSelectedSlot(ItemStack container, int newSlot);
public void setSelectedSlot (ItemStack container, int newSlot);

/**
* Returns the itemStack in the currently selected slot
* @param container The {@link #ItemStack} representing this item
* @param slot the slot index
* @return The {@link #ItemStack} in the given slot.
*/
public ItemStack getStackInSlot(ItemStack container, int slot);
public ItemStack getStackInSlot (ItemStack container, int slot);

/**
* Sets places the given item stack in the give slot
* @param container {@link #ItemStack} representing this item
* @param slot the slot index
* @param container {@link #ItemStack} representing the new stack
*/
public void setStackInSlot(ItemStack container, int slot, ItemStack stack);

public void setStackInSlot (ItemStack container, int slot, ItemStack stack);

/**
*
Expand All @@ -52,7 +52,7 @@ public interface IArrowContainer2 {
* @param player The {@link #EntityPlayer} using the bow
* @return true if the item contains at least one arrow in the selected slot
*/
public boolean hasArrowFor(ItemStack container, ItemStack bow, EntityPlayer player, int slot);
public boolean hasArrowFor (ItemStack container, ItemStack bow, EntityPlayer player, int slot);

/**
* The arrow spawned when bow is used with this non empty container equipped
Expand All @@ -62,7 +62,8 @@ public interface IArrowContainer2 {
* @param world
* @return the arrow entity to spawn when bow is used
*/
public EntityArrow getArrowType(ItemStack container, World world, EntityPlayer player, float charge);
public EntityArrow getArrowType (ItemStack container, World world, EntityPlayer player, float charge);

/**
* Action to take after an arrow has been fired
* Usually equal to removing an arrow from the container
Expand All @@ -72,28 +73,28 @@ public interface IArrowContainer2 {
* @param bow The bow which fired
* @param arrow the arrow fired
*/
public void onArrowFired(World world, EntityPlayer player, ItemStack container, ItemStack bow, EntityArrow arrow);
public void onArrowFired (World world, EntityPlayer player, ItemStack container, ItemStack bow, EntityArrow arrow);

/**
* Called before the arrow is fired from this container
* @param arrowEvent Used to decide bow damage, bow sound and arrow enchantment
*/
public void onPreArrowFired(QuiverArrowEvent arrowEvent);
public void onPreArrowFired (QuiverArrowEvent arrowEvent);

/**
* Called when the container is put on a crafting bench with other items
* @param container The {@link #ItemStack} representing this item
* @param arrowStack The {@link #ItemStack} representing other items
* @return True to receive {@link #addArrows(ItemStack, ItemStack)}
*/
public boolean isCraftableWithArrows(ItemStack contaner, ItemStack arrowStack);
public boolean isCraftableWithArrows (ItemStack contaner, ItemStack arrowStack);

/**
* Crafts the item with the items from {@link #isCraftableWithArrows(ItemStack, ItemStack)}
* @param container The {@link #ItemStack} representing this item
* @param arrows Another valid item on the crafting bench
* @return Number of arrows that couldn't fit in
*/
public ItemStack addArrows(ItemStack container, ItemStack newStack);


public ItemStack addArrows (ItemStack container, ItemStack newStack);

}
40 changes: 20 additions & 20 deletions src/api/java/mods/battlegear2/api/quiver/QuiverArrowEvent.java
@@ -1,30 +1,30 @@
package mods.battlegear2.api.quiver;

import mods.battlegear2.api.PlayerEventChild;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;

public class QuiverArrowEvent extends PlayerEventChild{
public class QuiverArrowEvent extends PlayerEventChild
{

public int bowDamage = 1;
public float bowSoundVolume = 1.0F;
public boolean addEnchantments = true;
public ArrowLooseEvent event;
public int bowDamage = 1;
public float bowSoundVolume = 1.0F;
public boolean addEnchantments = true;
public ArrowLooseEvent event;

public QuiverArrowEvent(ArrowLooseEvent parent) {
super(parent);
this.event = parent;
}
public QuiverArrowEvent(ArrowLooseEvent parent)
{
super(parent);
this.event = parent;
}

public ItemStack getBow()
{
return event.bow;
}
public int getCharge()
{
return event.charge;
}
public ItemStack getBow ()
{
return event.bow;
}

public int getCharge ()
{
return event.charge;
}
}
41 changes: 25 additions & 16 deletions src/api/java/mods/battlegear2/api/quiver/QuiverArrowRegistry.java
@@ -1,43 +1,52 @@
package mods.battlegear2.api.quiver;

import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;

public class QuiverArrowRegistry {
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class QuiverArrowRegistry
{

private static Map<ItemStack, Class<? extends EntityArrow>> map = new TreeMap<ItemStack, Class<? extends EntityArrow>>(new StackComparator());
private static Map<ItemStack, Class<? extends EntityArrow>> map = new TreeMap<ItemStack, Class<? extends EntityArrow>>(new StackComparator());

public static void addArrowToRegistry(Item i, int itemMetadata, Class<? extends EntityArrow> entityArrow){
public static void addArrowToRegistry (Item i, int itemMetadata, Class<? extends EntityArrow> entityArrow)
{
ItemStack stack = new ItemStack(i, 1, itemMetadata);
map.put(stack, entityArrow);
}

public static Class<? extends EntityArrow> getArrowClass(ItemStack stack){
public static Class<? extends EntityArrow> getArrowClass (ItemStack stack)
{
return map.get(stack);
}

static class StackComparator implements Comparator<ItemStack> {
static class StackComparator implements Comparator<ItemStack>
{
@Override
public int compare(ItemStack stack, ItemStack stack2) {
public int compare (ItemStack stack, ItemStack stack2)
{

if(stack == stack2){
if (stack == stack2)
{
return 0;
}else{
}
else
{

int idDiff =0;//COMMENTED TO SHUT UP IDE= stack.itemID - stack2.itemID;
if(idDiff != 0){
int idDiff = 0;//COMMENTED TO SHUT UP IDE= stack.itemID - stack2.itemID;
if (idDiff != 0)
{
return idDiff;
}else
}
else
return stack.getItemDamage() - stack2.getItemDamage();
}

}
}


}

0 comments on commit 5d4e38c

Please sign in to comment.