Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload my Code Changes/Format/imports
- Loading branch information
Alexander
committed
Feb 16, 2014
1 parent
5bcdb7c
commit 5d4e38c
Showing
264 changed files
with
4,031 additions
and
3,989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,5 @@ version.properties | |
#eclipse stuffs | ||
/.classpath | ||
/.project | ||
/.settings/ | ||
/.settings/ | ||
/debug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 20 additions & 20 deletions
40
src/api/java/mods/battlegear2/api/quiver/QuiverArrowEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
41
src/api/java/mods/battlegear2/api/quiver/QuiverArrowRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.