diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-08-22 19:54:41 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-08-22 19:54:41 -0400 |
| commit | c918a1b6d8008773e9beebb48ba1a770405aee20 (patch) | |
| tree | 7588d9e570addc61d2f318697662e6f2156fa04e /YWD/src/main/java/fyresmodjam/items | |
| parent | 3eb8c7a8fca3f22475d53e30f0b90a6737f313fa (diff) | |
Bulk update back to sanity
Diffstat (limited to 'YWD/src/main/java/fyresmodjam/items')
7 files changed, 172 insertions, 400 deletions
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemCrystal.java b/YWD/src/main/java/fyresmodjam/items/ItemCrystal.java index ee4a6e8..4c28d4a 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemCrystal.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemCrystal.java @@ -19,16 +19,10 @@ public class ItemCrystal extends ItemBlock { public IIcon texture;
- public static String[] names = new String[] {
- "Shining", "Void", "Firey"
- };
- public static String[] particleNames = new String[] {
- "spell", "portal", "flame"
- };
- public static Color[] colors = new Color[] {
- new Color(255, 255, 173), new Color(33, 0, 73),
- new Color(255, 55, 0)
- };
+ public static String[] names = new String[] { "Shining", "Void", "Firey" };
+ public static String[] particleNames = new String[] { "spell", "portal", "flame" };
+ public static Color[] colors = new Color[] { new Color(255, 255, 173), new Color(33, 0, 73),
+ new Color(255, 55, 0) };
public ItemCrystal() {
super(ModjamMod.crystal);
@@ -37,31 +31,27 @@ public class ItemCrystal extends ItemBlock { }
@Override
- public void getSubItems(Item id, CreativeTabs creativeTab,
- List list) {
+ public void getSubItems(Item id, CreativeTabs creativeTab, List list) {
for (int i = 0; i < names.length; i++) {
list.add(new ItemStack(id, 1, i));
}
}
public String getItemDisplayName(ItemStack itemStack) {
- return names[itemStack.getItemDamage() % names.length]
- + " Crystal";
+ return names[itemStack.getItemDamage() % names.length] + " Crystal";
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
- texture = iconRegister
- .registerIcon("fyresmodjam:crystal_item");
+ texture = iconRegister.registerIcon("fyresmodjam:crystal_item");
itemIcon = texture;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int i) {
- return colors[itemStack.getItemDamage() % colors.length]
- .getRGB();
+ return colors[itemStack.getItemDamage() % colors.length].getRGB();
}
@Override
@@ -77,8 +67,7 @@ public class ItemCrystal extends ItemBlock { }
@Override
- public ItemStack onItemRightClick(ItemStack par1ItemStack,
- World par2World, EntityPlayer par3EntityPlayer) {
+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
// int value =
// (!par3EntityPlayer.getEntityData().hasKey("equippedCrystal")
@@ -88,23 +77,18 @@ public class ItemCrystal extends ItemBlock { // par1ItemStack.getItemDamage() : -1;
/*
- * if(par2World.isRemote) {
- * PacketDispatcher.sendPacketToServer(PacketHandler.
- * newPacket( PacketHandler.UPDATE_STAT, new Object[]
- * {"equippedCrystal", "int",
+ * if(par2World.isRemote) { PacketDispatcher.sendPacketToServer(PacketHandler.
+ * newPacket( PacketHandler.UPDATE_STAT, new Object[] {"equippedCrystal", "int",
* par1ItemStack.getItemDamage()})); } else {
- * PacketDispatcher.sendPacketToPlayer(PacketHandler.
- * newPacket( PacketHandler.UPDATE_STAT, new Object[]
- * {"equippedCrystal", "int",
- * par1ItemStack.getItemDamage()}), (Player)
- * par3EntityPlayer); }
+ * PacketDispatcher.sendPacketToPlayer(PacketHandler. newPacket(
+ * PacketHandler.UPDATE_STAT, new Object[] {"equippedCrystal", "int",
+ * par1ItemStack.getItemDamage()}), (Player) par3EntityPlayer); }
*/
/*
- * if(par2World.isRemote) {
- * par3EntityPlayer.openGui(ModjamMod.instance, 1,
- * par2World, (int) par3EntityPlayer.posX, (int)
- * par3EntityPlayer.posY, (int) par3EntityPlayer.posZ); }
+ * if(par2World.isRemote) { par3EntityPlayer.openGui(ModjamMod.instance, 1,
+ * par2World, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int)
+ * par3EntityPlayer.posZ); }
*/
return par1ItemStack;
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemMysteryMushroom.java b/YWD/src/main/java/fyresmodjam/items/ItemMysteryMushroom.java index f38d488..d4e9b2f 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemMysteryMushroom.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemMysteryMushroom.java @@ -28,16 +28,13 @@ public class ItemMysteryMushroom extends Item { @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
- icon = par1IconRegister
- .registerIcon("fyresmodjam:mushroom");
- overlay = par1IconRegister.registerIcon(
- "fyresmodjam:mushroom_overlay");
+ icon = par1IconRegister.registerIcon("fyresmodjam:mushroom");
+ overlay = par1IconRegister.registerIcon("fyresmodjam:mushroom_overlay");
itemIcon = icon;
}
@Override
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
- List par3List) {
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int i = 0; i < 13; i++) {
par3List.add(new ItemStack(par1, 1, i));
}
@@ -45,10 +42,8 @@ public class ItemMysteryMushroom extends Item { @Override
@SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack par1ItemStack,
- int par2) {
- return NewPacketHandler.mushroomColors[par1ItemStack
- .getItemDamage() % 13][par2 % 2];
+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
+ return NewPacketHandler.mushroomColors[par1ItemStack.getItemDamage() % 13][par2 % 2];
}
@Override
@@ -64,20 +59,14 @@ public class ItemMysteryMushroom extends Item { }
@Override
- public boolean onItemUse(ItemStack par1ItemStack,
- EntityPlayer par2EntityPlayer, World par3World,
- int par4, int par5, int par6, int par7, float par8,
- float par9, float par10) {
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
+ int par5, int par6, int par7, float par8, float par9, float par10) {
Block i1 = par3World.getBlock(par4, par5, par6);
- if (i1 == Blocks.snow && (par3World.getBlockMetadata(par4,
- par5, par6) & 7) < 1) {
+ if (i1 == Blocks.snow && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) {
par7 = 1;
- } else if (i1 != Blocks.vine && i1 != Blocks.tallgrass
- && i1 != Blocks.deadbush
- && (i1 == null || !i1.isReplaceable(
- par3World, par4, par5,
- par6))) {
+ } else if (i1 != Blocks.vine && i1 != Blocks.tallgrass && i1 != Blocks.deadbush
+ && (i1 == null || !i1.isReplaceable(par3World, par4, par5, par6))) {
if (par7 == 0) {
--par5;
}
@@ -105,36 +94,22 @@ public class ItemMysteryMushroom extends Item { if (par1ItemStack.stackSize == 0) {
return false;
- } else if (!par2EntityPlayer.canPlayerEdit(par4, par5,
- par6, par7, par1ItemStack)) {
+ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
return false;
- } else if (par5 == 255 && ModjamMod.mysteryMushroomBlock
- .getMaterial().isSolid()) {
+ } else if (par5 == 255 && ModjamMod.mysteryMushroomBlock.getMaterial().isSolid()) {
return false;
- } else if (par3World.canPlaceEntityOnSide(
- ModjamMod.mysteryMushroomBlock, par4, par5,
- par6, false, par7, par2EntityPlayer,
- par1ItemStack)) {
+ } else if (par3World.canPlaceEntityOnSide(ModjamMod.mysteryMushroomBlock, par4, par5, par6, false, par7,
+ par2EntityPlayer, par1ItemStack)) {
Block block = ModjamMod.mysteryMushroomBlock;
int j1 = par1ItemStack.getItemDamage();
- int k1 = ModjamMod.mysteryMushroomBlock
- .onBlockPlaced(par3World, par4,
- par5, par6, par7,
- par8, par9, par10,
- j1);
-
- if (onItemUseFirst(par1ItemStack, par2EntityPlayer,
- par3World, par4, par5, par6, par7,
- par8, par9, par10, k1)) {
- par3World.playSoundEffect(par4 + 0.5F,
- par5 + 0.5F, par6 + 0.5F,
- block.stepSound.func_150496_b(),
- (block.stepSound.getVolume()
- + 1.0F)
- / 2.0F,
- block.stepSound.getPitch()
- * 0.8F);
+ int k1 = ModjamMod.mysteryMushroomBlock.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10,
+ j1);
+
+ if (onItemUseFirst(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10,
+ k1)) {
+ par3World.playSoundEffect(par4 + 0.5F, par5 + 0.5F, par6 + 0.5F, block.stepSound.func_150496_b(),
+ (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
--par1ItemStack.stackSize;
}
@@ -144,21 +119,15 @@ public class ItemMysteryMushroom extends Item { }
}
- public boolean onItemUseFirst(ItemStack stack, EntityPlayer player,
- World world, int x, int y, int z, int side,
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ, int metadata) {
- if (!world.setBlock(x, y, z,
- ModjamMod.mysteryMushroomBlock, metadata,
- 3)) {
+ if (!world.setBlock(x, y, z, ModjamMod.mysteryMushroomBlock, metadata, 3)) {
return false;
}
- if (world.getBlock(x, y,
- z) == ModjamMod.mysteryMushroomBlock) {
- ModjamMod.mysteryMushroomBlock.onBlockPlacedBy(
- world, x, y, z, player, stack);
- ModjamMod.mysteryMushroomBlock.onPostBlockPlaced(
- world, x, y, z, metadata);
+ if (world.getBlock(x, y, z) == ModjamMod.mysteryMushroomBlock) {
+ ModjamMod.mysteryMushroomBlock.onBlockPlacedBy(world, x, y, z, player, stack);
+ ModjamMod.mysteryMushroomBlock.onPostBlockPlaced(world, x, y, z, metadata);
}
return true;
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemMysteryPotion.java b/YWD/src/main/java/fyresmodjam/items/ItemMysteryPotion.java index 8df424e..febb02a 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemMysteryPotion.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemMysteryPotion.java @@ -38,12 +38,8 @@ public class ItemMysteryPotion extends Item { icons = new IIcon[26];
for (int i = 0; i < 13; i++) {
- icons[i] = par1IconRegister.registerIcon(
- "fyresmodjam:mysteryPotion_"
- + (i + 1));
- icons[i + 13] = par1IconRegister.registerIcon(
- "fyresmodjam:mysteryPotionThrowable_"
- + (i + 1));
+ icons[i] = par1IconRegister.registerIcon("fyresmodjam:mysteryPotion_" + (i + 1));
+ icons[i + 13] = par1IconRegister.registerIcon("fyresmodjam:mysteryPotionThrowable_" + (i + 1));
}
itemIcon = icons[0];
@@ -56,8 +52,7 @@ public class ItemMysteryPotion extends Item { }
@Override
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
- List par3List) {
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int i = 0; i < 13; i++) {
par3List.add(new ItemStack(par1, 1, i));
}
@@ -74,22 +69,14 @@ public class ItemMysteryPotion extends Item { if (damage < 12) {
if (Minecraft.getMinecraft().thePlayer != null
- && Minecraft.getMinecraft().thePlayer
- .getEntityData()
- .hasKey("PotionKnowledge")) {
- if (Minecraft.getMinecraft().thePlayer
- .getEntityData()
- .getIntArray("PotionKnowledge")[damage] != -1) {
+ && Minecraft.getMinecraft().thePlayer.getEntityData().hasKey("PotionKnowledge")) {
+ if (Minecraft.getMinecraft().thePlayer.getEntityData().getIntArray("PotionKnowledge")[damage] != -1) {
Potion potion = Potion.potionTypes[NewPacketHandler.potionValues[damage]];
- name = StatCollector
- .translateToLocal(
- potion.getName())
- + " Potion";
+ name = StatCollector.translateToLocal(potion.getName()) + " Potion";
if (!potion.isInstant()) {
int time = NewPacketHandler.potionDurations[damage];
- name += " (" + time
- + " seconds)";
+ name += " (" + time + " seconds)";
}
}
}
@@ -97,8 +84,7 @@ public class ItemMysteryPotion extends Item { name = "Wildcard Potion";
}
- if (FMLCommonHandler.instance().getSide() == Side.CLIENT
- && hasBlessing("Alchemist")) {
+ if (FMLCommonHandler.instance().getSide() == Side.CLIENT && hasBlessing("Alchemist")) {
name = "\u00A7k" + name;
}
@@ -107,49 +93,33 @@ public class ItemMysteryPotion extends Item { @Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
- return par1ItemStack.getItemDamage() < 13
- ? EnumAction.drink
- : super.getItemUseAction(par1ItemStack);
+ return par1ItemStack.getItemDamage() < 13 ? EnumAction.drink : super.getItemUseAction(par1ItemStack);
}
@Override
- public ItemStack onItemRightClick(ItemStack par1ItemStack,
- World par2World, EntityPlayer par3EntityPlayer) {
+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (par1ItemStack.getItemDamage() < 13) {
- par3EntityPlayer.setItemInUse(par1ItemStack,
- getMaxItemUseDuration(
- par1ItemStack));
+ par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
} else {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
par1ItemStack.stackSize--;
}
- par2World.playSoundAtEntity(par3EntityPlayer,
- "random.bow", 0.5F,
- 0.4F / (itemRand.nextFloat() * 0.4F
- + 0.8F));
+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F,
+ 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote) {
int value = 0;
- if (par1ItemStack.getItemDamage()
- % 13 >= 12) {
- value = ModjamMod.r.nextInt(
- Potion.potionTypes.length);
+ if (par1ItemStack.getItemDamage() % 13 >= 12) {
+ value = ModjamMod.r.nextInt(Potion.potionTypes.length);
while (Potion.potionTypes[value] == null) {
- value = ModjamMod.r
- .nextInt(Potion.potionTypes.length);
+ value = ModjamMod.r.nextInt(Potion.potionTypes.length);
}
} else {
- value = CommonTickHandler.worldData.potionValues[par1ItemStack
- .getItemDamage()
- % 13];
+ value = CommonTickHandler.worldData.potionValues[par1ItemStack.getItemDamage() % 13];
}
- par2World.spawnEntityInWorld(
- new EntityMysteryPotion(
- par2World,
- par3EntityPlayer,
- par1ItemStack));
+ par2World.spawnEntityInWorld(new EntityMysteryPotion(par2World, par3EntityPlayer, par1ItemStack));
}
}
@@ -158,127 +128,74 @@ public class ItemMysteryPotion extends Item { @Override
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
- return par1ItemStack.getItemDamage() < 13 ? 32
- : super.getMaxItemUseDuration(
- par1ItemStack);
+ return par1ItemStack.getItemDamage() < 13 ? 32 : super.getMaxItemUseDuration(par1ItemStack);
}
@Override
- public ItemStack onEaten(ItemStack par1ItemStack, World par2World,
- EntityPlayer par3EntityPlayer) {
+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
--par1ItemStack.stackSize;
}
int damage = par1ItemStack.getItemDamage() % 13;
- if (!BlessingUtils.hasBlessing(par3EntityPlayer,
- "BlessingAlchemist") && damage < 12) {
+ if (!BlessingUtils.hasBlessing(par3EntityPlayer, "BlessingAlchemist") && damage < 12) {
if (!par2World.isRemote) {
int value = CommonTickHandler.worldData.potionValues[damage];
- if (!Potion.potionTypes[value]
- .isInstant()) {
- par3EntityPlayer.addPotionEffect(
- new PotionEffect(
- value,
- CommonTickHandler.worldData.potionDurations[damage]
- * 20,
- 1,
- false));
+ if (!Potion.potionTypes[value].isInstant()) {
+ par3EntityPlayer.addPotionEffect(new PotionEffect(value,
+ CommonTickHandler.worldData.potionDurations[damage] * 20, 1, false));
} else {
- Potion.potionTypes[value]
- .affectEntity(par3EntityPlayer,
- par3EntityPlayer,
- 1,
- 1);
+ Potion.potionTypes[value].affectEntity(par3EntityPlayer, par3EntityPlayer, 1, 1);
}
- if (!par3EntityPlayer.getEntityData()
- .hasKey("PotionKnowledge")) {
- par3EntityPlayer.getEntityData()
- .setIntArray("PotionKnowledge",
- new int[] {
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1
- });
+ if (!par3EntityPlayer.getEntityData().hasKey("PotionKnowledge")) {
+ par3EntityPlayer.getEntityData().setIntArray("PotionKnowledge",
+ new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 });
}
- if (par3EntityPlayer.getEntityData()
- .getIntArray("PotionKnowledge")[damage] == -1) {
- par3EntityPlayer.getEntityData()
- .getIntArray("PotionKnowledge")[damage] = 1;
+ if (par3EntityPlayer.getEntityData().getIntArray("PotionKnowledge")[damage] == -1) {
+ par3EntityPlayer.getEntityData().getIntArray("PotionKnowledge")[damage] = 1;
- NewPacketHandler.UPDATE_POTION_KNOWLEDGE
- .sendToPlayer(par3EntityPlayer,
- par3EntityPlayer.getEntityData()
- .getIntArray("PotionKnowledge"));
+ NewPacketHandler.UPDATE_POTION_KNOWLEDGE.sendToPlayer(par3EntityPlayer,
+ par3EntityPlayer.getEntityData().getIntArray("PotionKnowledge"));
Potion potion = Potion.potionTypes[CommonTickHandler.worldData.potionValues[damage]];
- String name = StatCollector
- .translateToLocal(
- potion.getName())
- + " Potion";
+ String name = StatCollector.translateToLocal(potion.getName()) + " Potion";
if (!potion.isInstant()) {
int time = CommonTickHandler.worldData.potionDurations[damage];
- name += " (" + time
- + " seconds)";
+ name += " (" + time + " seconds)";
}
- NewPacketHandler.SEND_MESSAGE
- .sendToPlayer(par3EntityPlayer,
- "\u00A7oYou learnt Mystery Potion #"
- + (damage + 1)
- + " was a "
- + name
- + "!");
+ NewPacketHandler.SEND_MESSAGE.sendToPlayer(par3EntityPlayer,
+ "\u00A7oYou learnt Mystery Potion #" + (damage + 1) + " was a " + name + "!");
}
}
} else if (!par2World.isRemote) {
- int value = ModjamMod.r.nextInt(
- Potion.potionTypes.length);
+ int value = ModjamMod.r.nextInt(Potion.potionTypes.length);
while (Potion.potionTypes[value] == null) {
- value = ModjamMod.r.nextInt(
- Potion.potionTypes.length);
+ value = ModjamMod.r.nextInt(Potion.potionTypes.length);
}
int time = 5 + ModjamMod.r.nextInt(26);
if (!Potion.potionTypes[value].isInstant()) {
- par3EntityPlayer.addPotionEffect(
- new PotionEffect(value,
- time * 20,
- 1, false));
+ par3EntityPlayer.addPotionEffect(new PotionEffect(value, time * 20, 1, false));
} else {
- Potion.potionTypes[value].affectEntity(
- par3EntityPlayer,
- par3EntityPlayer, 1, 1);
+ Potion.potionTypes[value].affectEntity(par3EntityPlayer, par3EntityPlayer, 1, 1);
}
Potion potion = Potion.potionTypes[value];
- String name = StatCollector.translateToLocal(
- potion.getName()) + " Potion";
+ String name = StatCollector.translateToLocal(potion.getName()) + " Potion";
if (!potion.isInstant()) {
name += " (" + time + " seconds)";
}
- NewPacketHandler.SEND_MESSAGE.sendToPlayer(
- par3EntityPlayer,
- "\u00A7oYou drank a " + name
- + ".");
+ NewPacketHandler.SEND_MESSAGE.sendToPlayer(par3EntityPlayer, "\u00A7oYou drank a " + name + ".");
}
return par1ItemStack;
@@ -287,16 +204,12 @@ public class ItemMysteryPotion extends Item { @SideOnly(Side.CLIENT)
public boolean hasBlessing(String bless) {
return (Minecraft.getMinecraft().thePlayer != null
- && BlessingUtils.hasBlessing(Minecraft
- .getMinecraft().thePlayer,
- bless));
+ && BlessingUtils.hasBlessing(Minecraft.getMinecraft().thePlayer, bless));
}
@Override
- public boolean onItemUse(ItemStack par1ItemStack,
- EntityPlayer par2EntityPlayer, World par3World,
- int par4, int par5, int par6, int par7, float par8,
- float par9, float par10) {
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
+ int par5, int par6, int par7, float par8, float par9, float par10) {
return false;
}
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemObsidianSceptre.java b/YWD/src/main/java/fyresmodjam/items/ItemObsidianSceptre.java index f1c179e..9bb5050 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemObsidianSceptre.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemObsidianSceptre.java @@ -22,16 +22,13 @@ public class ItemObsidianSceptre extends Item { @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
- icon = par1IconRegister.registerIcon(
- "fyresmodjam:unenchantedSceptre");
- icon2 = par1IconRegister.registerIcon(
- "fyresmodjam:enchantedSceptre");
+ icon = par1IconRegister.registerIcon("fyresmodjam:unenchantedSceptre");
+ icon2 = par1IconRegister.registerIcon("fyresmodjam:enchantedSceptre");
itemIcon = icon;
}
@Override
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
- List par3List) {
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int i = 0; i < 2; i++) {
par3List.add(new ItemStack(par1, 1, i));
}
@@ -40,10 +37,7 @@ public class ItemObsidianSceptre extends Item { @Override
@SideOnly(Side.CLIENT)
public String getItemStackDisplayName(ItemStack par1ItemStack) {
- return (par1ItemStack.getItemDamage() == 0 ? ""
- : "Infused ")
- + super.getItemStackDisplayName(
- par1ItemStack);
+ return (par1ItemStack.getItemDamage() == 0 ? "" : "Infused ") + super.getItemStackDisplayName(par1ItemStack);
}
@Override
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemPillar.java b/YWD/src/main/java/fyresmodjam/items/ItemPillar.java index 3f47f15..29f41d8 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemPillar.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemPillar.java @@ -27,25 +27,20 @@ public class ItemPillar extends Item { }
@Override
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
- List par3List) {
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
if (ConfigData.showAllPillarsInCreative) {
- for (Blessing bless : BlessingUtils.playerBlessings
- .values()) {
- par3List.add(new ItemStack(par1, 1,
- bless.ordinal));
+ for (Blessing bless : BlessingUtils.playerBlessings.values()) {
+ par3List.add(new ItemStack(par1, 1, bless.ordinal));
}
} else {
- super.getSubItems(par1, par2CreativeTabs,
- par3List);
+ super.getSubItems(par1, par2CreativeTabs, par3List);
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
- itemIcon = par1IconRegister
- .registerIcon("fyresmodjam:itemPillar");
+ itemIcon = par1IconRegister.registerIcon("fyresmodjam:itemPillar");
}
@Override
@@ -53,34 +48,26 @@ public class ItemPillar extends Item { public String getItemStackDisplayName(ItemStack par1ItemStack) {
String blessingName = "Unknown";
- for (Blessing bless : BlessingUtils.playerBlessings
- .values()) {
- if (bless.ordinal == par1ItemStack.getItemDamage()
- - 1) {
+ for (Blessing bless : BlessingUtils.playerBlessings.values()) {
+ if (bless.ordinal == par1ItemStack.getItemDamage() - 1) {
blessingName = bless.customName();
}
}
String blessing = " ( " + blessingName + ")";
- return super.getItemStackDisplayName(par1ItemStack)
- + (par1ItemStack.getItemDamage() == 0 ? ""
- : blessing);
+ return super.getItemStackDisplayName(par1ItemStack) + (par1ItemStack.getItemDamage() == 0 ? "" : blessing);
}
@Override
- public boolean onItemUse(ItemStack par1ItemStack,
- EntityPlayer par2EntityPlayer, World par3World,
- int par4, int par5, int par6, int par7, float par8,
- float par9, float par10) {
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
+ int par5, int par6, int par7, float par8, float par9, float par10) {
Block block = ModjamMod.blockPillar;
if (par7 == 0) {
par5 -= 2;
}
- if (par7 == 1 && !par3World.getBlock(par4, par5, par6)
- .isReplaceable(par3World, par4, par5,
- par6)) {
+ if (par7 == 1 && !par3World.getBlock(par4, par5, par6).isReplaceable(par3World, par4, par5, par6)) {
++par5;
}
if (par7 == 2) {
@@ -100,24 +87,15 @@ public class ItemPillar extends Item { return false;
} else {
par3World.setBlock(par4, par5, par6, block);
- par3World.setBlockMetadataWithNotify(par4, par5,
- par6, 0, 0);
+ par3World.setBlockMetadataWithNotify(par4, par5, par6, 0, 0);
par3World.setBlock(par4, par5 + 1, par6, block);
- par3World.setBlockMetadataWithNotify(par4,
- par5 + 1, par6, 1, 0);
+ par3World.setBlockMetadataWithNotify(par4, par5 + 1, par6, 1, 0);
if (par1ItemStack.getItemDamage() != 0) {
- for (Map.Entry<String, Blessing> bless : BlessingUtils.playerBlessings
- .entrySet()) {
- if (bless.getValue().ordinal == par1ItemStack
- .getItemDamage()
- - 1) {
- ((TileEntityPillar) par3World
- .getTileEntity(par4,
- par5,
- par6)).blessing = bless
- .getKey();
+ for (Map.Entry<String, Blessing> bless : BlessingUtils.playerBlessings.entrySet()) {
+ if (bless.getValue().ordinal == par1ItemStack.getItemDamage() - 1) {
+ ((TileEntityPillar) par3World.getTileEntity(par4, par5, par6)).blessing = bless.getKey();
}
}
}
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemScroll.java b/YWD/src/main/java/fyresmodjam/items/ItemScroll.java index 5b1046d..8fda744 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemScroll.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemScroll.java @@ -20,31 +20,25 @@ import net.minecraft.world.World; public class ItemScroll extends Item {
- public static String[][] scrollText = new String[][] {
- {
- "Unkown Adventurer",
- "Codex #1: Adventurer's Log",
- "This morning I fell out of the sky. I am unsure of where I am, or for what purpose, but I've begun construction of a small shelter for the time being.",
- "I've now spent days scouting the nearby area with no luck. Still alone, I'm made my decision to set out further.",
- "I've discovered an ancient stronghold. Writtings of end times cover the walls. What could it mean? Who built this place? Why was it here? And I have an unsettling feeling that I'm being watched..."
- }, {
- "Village Elder",
- "Codex #2: An Elders Warning",
+ public static String[][] scrollText = new String[][] { { "Unkown Adventurer", "Codex #1: Adventurer's Log",
+ "This morning I fell out of the sky. I am unsure of where I am, or for what purpose, but I've begun construction of a small shelter for the time being.",
+ "I've now spent days scouting the nearby area with no luck. Still alone, I'm made my decision to set out further.",
+ "I've discovered an ancient stronghold. Writtings of end times cover the walls. What could it mean? Who built this place? Why was it here? And I have an unsettling feeling that I'm being watched..." },
+ { "Village Elder", "Codex #2: An Elders Warning",
"For thousands of years, we have lived peacefully. As stories of the distant past began to fade in time, the elders became tasked with remembering. I now join their ranks, but still I see there are those who choose to forget.",
- "The lines between worlds begin to blur once again. In the deepest caverns, we can see in to their world, and theirs in to ours. The end returns, yet no other will listen. It's clear I must find the crystal alone."
- }, {
- "Pigman Warrior",
- "Codex #3: The Warriors Spirit",
+ "The lines between worlds begin to blur once again. In the deepest caverns, we can see in to their world, and theirs in to ours. The end returns, yet no other will listen. It's clear I must find the crystal alone." },
+ { "Pigman Warrior", "Codex #3: The Warriors Spirit",
"We fight through the fires of this realm, thinking as one. It is the only way to survive this wretched landscape. Hurt one and the horde will know.",
"Strangers enter our realm through even stranger portals. They seek the crystal which bonds our world. We refuse, we fight, but many die. Our numbers begin dwindle, but the crystal will stay ours.",
- "We can see the void seeping through the cracks of our realm, reanimating the dead. Empty husks of our fallen push back the intruders. But they too are affected by the void's forces."
- }, {
- "Enderman Urchin",
- "Codex #4: From the Shadows",
- "The darkness shall consume all, below each of the worlds it boils. We now wait for our time to return, watching through the cracks of space and time. Us children of the Ender will reclaim what was once ours."
- } /*
- * , {"Author", "Codex #5" , "Words"}
- */
+ "We can see the void seeping through the cracks of our realm, reanimating the dead. Empty husks of our fallen push back the intruders. But they too are affected by the void's forces." },
+ { "Enderman Urchin", "Codex #4: From the Shadows",
+ "The darkness shall consume all, below each of the worlds it boils. We now wait for our time to return, watching through the cracks of space and time. Us children of the Ender will reclaim what was once ours." } /*
+ * ,
+ * {"Author",
+ * "Codex #5"
+ * ,
+ * "Words"}
+ */
};
public IIcon texture;
@@ -63,39 +57,26 @@ public class ItemScroll extends Item { }
@Override
- public void onUpdate(ItemStack stack, World world, Entity entity,
- int par1, boolean b) {
+ public void onUpdate(ItemStack stack, World world, Entity entity, int par1, boolean b) {
if (!world.isRemote) {
if (!stack.hasTagCompound()) {
stack.stackTagCompound = new NBTTagCompound();
}
- if (!stack.getTagCompound().hasKey("initialized")
- || !stack.getTagCompound()
- .getBoolean("initialized")) {
- stack.getTagCompound().setBoolean(
- "initialized", true);
+ if (!stack.getTagCompound().hasKey("initialized") || !stack.getTagCompound().getBoolean("initialized")) {
+ stack.getTagCompound().setBoolean("initialized", true);
- ItemStack book = new ItemStack(
- Items.written_book, 1, 0);
+ ItemStack book = new ItemStack(Items.written_book, 1, 0);
NBTTagList pages = new NBTTagList();
- for (int i = 2; i < scrollText[stack
- .getItemDamage()
- % scrollText.length].length; i++) {
- pages.appendTag(new NBTTagString(
- scrollText[stack.getItemDamage()
- % scrollText.length][i]));
+ for (int i = 2; i < scrollText[stack.getItemDamage() % scrollText.length].length; i++) {
+ pages.appendTag(new NBTTagString(scrollText[stack.getItemDamage() % scrollText.length][i]));
}
book.setTagInfo("pages", pages);
- book.setTagInfo("author", new NBTTagString(
- scrollText[stack.getItemDamage()
- % scrollText.length][0]));
- book.setTagInfo("title", new NBTTagString(
- scrollText[stack.getItemDamage()
- % scrollText.length][1]));
+ book.setTagInfo("author", new NBTTagString(scrollText[stack.getItemDamage() % scrollText.length][0]));
+ book.setTagInfo("title", new NBTTagString(scrollText[stack.getItemDamage() % scrollText.length][1]));
NBTTagCompound bookTag = new NBTTagCompound();
book.writeToNBT(bookTag);
@@ -105,38 +86,29 @@ public class ItemScroll extends Item { }
@Override
- public void getSubItems(Item id, CreativeTabs creativeTab,
- List list) {
+ public void getSubItems(Item id, CreativeTabs creativeTab, List list) {
for (int i = 0; i < scrollText.length; i++) {
list.add(new ItemStack(id, 1, i));
}
}
@Override
- public ItemStack onItemRightClick(ItemStack par1ItemStack,
- World par2World, EntityPlayer par3EntityPlayer) {
- NBTTagCompound bookTag = par1ItemStack.getTagCompound()
- .getCompoundTag("book");
+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
+ NBTTagCompound bookTag = par1ItemStack.getTagCompound().getCompoundTag("book");
if (bookTag != null) {
- par3EntityPlayer.displayGUIBook(ItemStack
- .loadItemStackFromNBT(bookTag));
+ par3EntityPlayer.displayGUIBook(ItemStack.loadItemStackFromNBT(bookTag));
}
return par1ItemStack;
}
@Override
public String getItemStackDisplayName(ItemStack par1ItemStack) {
- return scrollText[par1ItemStack.getItemDamage()
- % scrollText.length][1];
+ return scrollText[par1ItemStack.getItemDamage() % scrollText.length][1];
}
@Override
@SideOnly(Side.CLIENT)
- public void addInformation(ItemStack par1ItemStack,
- EntityPlayer par2EntityPlayer, List par3List,
- boolean par4) {
- par3List.add(EnumChatFormatting.GRAY
- + scrollText[par1ItemStack.getItemDamage()
- % scrollText.length][0]);
+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
+ par3List.add(EnumChatFormatting.GRAY + scrollText[par1ItemStack.getItemDamage() % scrollText.length][0]);
}
}
diff --git a/YWD/src/main/java/fyresmodjam/items/ItemTrap.java b/YWD/src/main/java/fyresmodjam/items/ItemTrap.java index 8cf856e..b66c0f9 100755 --- a/YWD/src/main/java/fyresmodjam/items/ItemTrap.java +++ b/YWD/src/main/java/fyresmodjam/items/ItemTrap.java @@ -24,17 +24,14 @@ public class ItemTrap extends Item { private static final IBehaviorDispenseItem dispenseTrap = new BehaviorDispenseTrap();
- public IIcon[] icons;
- public static String[] iconLocations = new String[] {
- "fyresmodjam:itemTrap", "fyresmodjam:trap2",
- "fyresmodjam:trap3"
- };
+ public IIcon[] icons;
+ public static String[] iconLocations = new String[] { "fyresmodjam:itemTrap", "fyresmodjam:trap2",
+ "fyresmodjam:trap3" };
public ItemTrap() {
super();
setHasSubtypes(true);
- BlockDispenser.dispenseBehaviorRegistry.putObject(this,
- dispenseTrap);
+ BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenseTrap);
}
@Override
@@ -42,30 +39,25 @@ public class ItemTrap extends Item { public void registerIcons(IIconRegister par1IconRegister) {
icons = new IIcon[iconLocations.length];
for (int i = 0; i < iconLocations.length; i++) {
- icons[i] = par1IconRegister
- .registerIcon(iconLocations[i]);
+ icons[i] = par1IconRegister.registerIcon(iconLocations[i]);
}
itemIcon = icons[0];
}
@Override
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
- List par3List) {
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for (int i = 0; i < BlockTrap.trapTypes; i++) {
par3List.add(new ItemStack(par1, 1, i));
}
}
- public static String[] names = {
- "Spike Trap", "Flame Trap", "Smoke Trap"
- };
+ public static String[] names = { "Spike Trap", "Flame Trap", "Smoke Trap" };
@Override
@SideOnly(Side.CLIENT)
public String getItemStackDisplayName(ItemStack par1ItemStack) {
- return names[par1ItemStack.getItemDamage()
- % BlockTrap.trapTypes];
+ return names[par1ItemStack.getItemDamage() % BlockTrap.trapTypes];
}
@Override
@@ -75,20 +67,14 @@ public class ItemTrap extends Item { }
@Override
- public boolean onItemUse(ItemStack par1ItemStack,
- EntityPlayer par2EntityPlayer, World par3World,
- int par4, int par5, int par6, int par7, float par8,
- float par9, float par10) {
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
+ int par5, int par6, int par7, float par8, float par9, float par10) {
Block i1 = par3World.getBlock(par4, par5, par6);
- if (i1 == Blocks.snow && (par3World.getBlockMetadata(par4,
- par5, par6) & 7) < 1) {
+ if (i1 == Blocks.snow && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) {
par7 = 1;
- } else if (i1 != Blocks.vine && i1 != Blocks.tallgrass
- && i1 != Blocks.deadbush
- && (i1 == null || !i1.isReplaceable(
- par3World, par4, par5,
- par6))) {
+ } else if (i1 != Blocks.vine && i1 != Blocks.tallgrass && i1 != Blocks.deadbush
+ && (i1 == null || !i1.isReplaceable(par3World, par4, par5, par6))) {
if (par7 == 0) {
--par5;
}
@@ -111,34 +97,20 @@ public class ItemTrap extends Item { if (par1ItemStack.stackSize == 0) {
return false;
- } else if (!par2EntityPlayer.canPlayerEdit(par4, par5,
- par6, par7, par1ItemStack)) {
+ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
return false;
- } else if (par5 == 255 && ModjamMod.blockTrap.getMaterial()
- .isSolid()) {
+ } else if (par5 == 255 && ModjamMod.blockTrap.getMaterial().isSolid()) {
return false;
- } else if (par3World.canPlaceEntityOnSide(
- ModjamMod.blockTrap, par4, par5, par6,
- false, par7, par2EntityPlayer,
+ } else if (par3World.canPlaceEntityOnSide(ModjamMod.blockTrap, par4, par5, par6, false, par7, par2EntityPlayer,
par1ItemStack)) {
Block block = ModjamMod.blockTrap;
- int j1 = getMetadata(
- par1ItemStack.getItemDamage());
- int k1 = ModjamMod.blockTrap.onBlockPlaced(
- par3World, par4, par5, par6, par7,
- par8, par9, par10, j1);
-
- if (placeBlockAt(par1ItemStack, par2EntityPlayer,
- par3World, par4, par5, par6, par7,
- par8, par9, par10, k1)) {
- par3World.playSoundEffect(par4 + 0.5F,
- par5 + 0.5F, par6 + 0.5F,
- block.stepSound.func_150496_b(),
- (block.stepSound.getVolume()
- + 1.0F)
- / 2.0F,
- block.stepSound.getPitch()
- * 0.8F);
+ int j1 = getMetadata(par1ItemStack.getItemDamage());
+ int k1 = ModjamMod.blockTrap.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, j1);
+
+ if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10,
+ k1)) {
+ par3World.playSoundEffect(par4 + 0.5F, par5 + 0.5F, par6 + 0.5F, block.stepSound.func_150496_b(),
+ (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
--par1ItemStack.stackSize;
}
@@ -149,19 +121,14 @@ public class ItemTrap extends Item { }
@SideOnly(Side.CLIENT)
- public boolean canPlaceItemBlockOnSide(World par1World, int par2,
- int par3, int par4, int par5,
- EntityPlayer par6EntityPlayer,
- ItemStack par7ItemStack) {
+ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5,
+ EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) {
Block i1 = par1World.getBlock(par2, par3, par4);
if (i1 == Blocks.snow) {
par5 = 1;
- } else if (i1 != Blocks.vine && i1 != Blocks.tallgrass
- && i1 != Blocks.deadbush
- && (i1 == null || !i1.isReplaceable(
- par1World, par2, par3,
- par4))) {
+ } else if (i1 != Blocks.vine && i1 != Blocks.tallgrass && i1 != Blocks.deadbush
+ && (i1 == null || !i1.isReplaceable(par1World, par2, par3, par4))) {
if (par5 == 0) {
--par3;
}
@@ -182,24 +149,19 @@ public class ItemTrap extends Item { }
}
- return par1World.canPlaceEntityOnSide(ModjamMod.blockTrap,
- par2, par3, par4, false, par5,
- (Entity) null, par7ItemStack);
+ return par1World.canPlaceEntityOnSide(ModjamMod.blockTrap, par2, par3, par4, false, par5, (Entity) null,
+ par7ItemStack);
}
- public boolean placeBlockAt(ItemStack stack, EntityPlayer player,
- World world, int x, int y, int z, int side,
+ public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ, int metadata) {
- if (!world.setBlock(x, y, z, ModjamMod.blockTrap, metadata,
- 3)) {
+ if (!world.setBlock(x, y, z, ModjamMod.blockTrap, metadata, 3)) {
return false;
}
if (world.getBlock(x, y, z) == ModjamMod.blockTrap) {
- ModjamMod.blockTrap.onBlockPlacedBy(world, x, y, z,
- player, stack);
- ModjamMod.blockTrap.onPostBlockPlaced(world, x, y,
- z, metadata);
+ ModjamMod.blockTrap.onBlockPlacedBy(world, x, y, z, player, stack);
+ ModjamMod.blockTrap.onPostBlockPlaced(world, x, y, z, metadata);
}
return true;
|
