2
0
Fork 0

cabbage and onion crop textures dont register, planting an onion or cabbage causes crash

frozen
KeyLime17 2 years ago
parent 023886c3c5
commit ba15d0fc49

@ -125,8 +125,8 @@ public class CinderLoE {
public static Item onion; public static Item onion;
public static Item cabbage; public static Item cabbage;
public static Item pelmen; public static Item pelmen;
// public static Item spice; public static Item spice;
// public static Item spicedHam; public static Item spicedHam;
public static Item lightStew; public static Item lightStew;
// Misc // Misc
@ -423,13 +423,14 @@ public class CinderLoE {
e.printStackTrace(); e.printStackTrace();
} }
// Food // Food
onion = new ItemSeedFood(3, 0.3f, CinderLoE.onionCrop, Blocks.farmland).setUnlocalizedName("lotr:onion").setTextureName("lotr:onion"); // onion = new ItemSeedFood(3, 0.3f, CinderLoE.onionCrop, Blocks.farmland).setUnlocalizedName("lotr:onion").setTextureName("lotr:onion");
cabbage = new ItemSeedFood(3, 0.3f, CinderLoE.cabbageCrop, Blocks.farmland).setUnlocalizedName("lotr:cabbage").setTextureName("lotr:cabbage");; //cabbage = new ItemSeedFood(3, 0.3f, CinderLoE.cabbageCrop, Blocks.farmland).setUnlocalizedName("lotr:cabbage").setTextureName("lotr:cabbage");;
// spice = new CinderItemFood(1, 0.0f, false).setdamageAmount(2).setPotionEffect(Potion.moveSpeed.id, 10,0,100).setUnlocalizedName("lotr:spice"); spice = new CinderItemFood(1, 0.0f, false).setdamageAmount(2).setPotionEffect(Potion.moveSpeed.id, 10,0,100).setUnlocalizedName("lotr:spice").setTextureName("lotr:spice");
// spicedHam = new CinderItemFood(9, 0.6f, true).setdamageAmount(2).setPotionEffect(Potion.moveSpeed.id, 60, 0, 100).setUnlocalizedName("lotr:spicedHam"); spicedHam = new CinderItemFood(9, 0.6f, true).setdamageAmount(2).setPotionEffect(Potion.moveSpeed.id, 60, 0, 100).setUnlocalizedName("lotr:spicedHam").setTextureName("lotr:spicedHam");
// spice = new LOTRItemFood(1, 0.0f, false).setPotionEffect(Potion.moveSpeed.id, 10,0,100).setUnlocalizedName("lotr:spice");
pelmen = new LOTRItemFood(6, 1.0f, true).setUnlocalizedName("lotr:pelmen").setTextureName("lotr:pelmen"); pelmen = new LOTRItemFood(6, 1.0f, true).setUnlocalizedName("lotr:pelmen").setTextureName("lotr:pelmen");
// onion = new LOTRItemFood(6, 1.0f, false).setUnlocalizedName("lotr:onion").setTextureName("lotr:onion"); onion = new LOTRItemFood(6, 1.0f, false).setUnlocalizedName("lotr:onion").setTextureName("lotr:onion");
// cabbage = new LOTRItemFood(6, 1.0f, false).setUnlocalizedName("lotr:cabbage").setTextureName("lotr:cabbage"); cabbage = new LOTRItemFood(6, 1.0f, false).setUnlocalizedName("lotr:cabbage").setTextureName("lotr:cabbage");
lightStew = new LOTRItemStew(6, 0.7f, false).setPotionEffect(Potion.damageBoost.id, 60, 0, 100).setUnlocalizedName("lotr:lightStew").setTextureName("lotr:lightStew"); lightStew = new LOTRItemStew(6, 0.7f, false).setPotionEffect(Potion.damageBoost.id, 60, 0, 100).setUnlocalizedName("lotr:lightStew").setTextureName("lotr:lightStew");
// Red Dwarf Spawns // Red Dwarf Spawns
redDwarfWarriorSpawnEgg = new CinderLoESpawnEgg(RedDwarfWarrior.class).setTextureName("lotr:spawn_egg"); redDwarfWarriorSpawnEgg = new CinderLoESpawnEgg(RedDwarfWarrior.class).setTextureName("lotr:spawn_egg");
@ -490,8 +491,8 @@ public class CinderLoE {
ItemRegistration.registerItem(cabbage, "cabbage", 90); ItemRegistration.registerItem(cabbage, "cabbage", 90);
ItemRegistration.registerItem(pelmen, "pelmen", 91); ItemRegistration.registerItem(pelmen, "pelmen", 91);
ItemRegistration.registerItem(lightStew, "lightStew", 92); ItemRegistration.registerItem(lightStew, "lightStew", 92);
// ItemRegistration.registerItem(spice, "spice", 93); ItemRegistration.registerItem(spice, "spice", 93);
// ItemRegistration.registerItem(spicedHam, "spicedHam", 94); ItemRegistration.registerItem(spicedHam, "spicedHam", 94);
// ==Red Dwarf Eggs== // ==Red Dwarf Eggs==
ItemRegistration.registerItem(redDwarfWarriorSpawnEgg, "redDwarfWarriorSpawnEgg", 0); ItemRegistration.registerItem(redDwarfWarriorSpawnEgg, "redDwarfWarriorSpawnEgg", 0);
@ -906,8 +907,8 @@ public class CinderLoE {
// == Food Items == // == Food Items ==
CinderCore.registerItemFallback(Item.getIdFromItem(onion), Item.getIdFromItem(LOTRMod.turnip), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Item.getIdFromItem(onion), Item.getIdFromItem(LOTRMod.turnip), "cinder_loe", "1.2.1");
CinderCore.registerItemFallback(Item.getIdFromItem(cabbage), Item.getIdFromItem(LOTRMod.lettuce), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Item.getIdFromItem(cabbage), Item.getIdFromItem(LOTRMod.lettuce), "cinder_loe", "1.2.1");
// CinderCore.registerItemFallback(Item.getIdFromItem(spice), Item.getIdFromItem(LOTRMod.dye), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Item.getIdFromItem(spice), Item.getIdFromItem(LOTRMod.dye), "cinder_loe", "1.2.1");
// CinderCore.registerItemFallback(Item.getIdFromItem(spicedHam), Item.getIdFromItem(LOTRMod.gammon), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Item.getIdFromItem(spicedHam), Item.getIdFromItem(LOTRMod.gammon), "cinder_loe", "1.2.1");
CinderCore.registerItemFallback(Item.getIdFromItem(pelmen), Item.getIdFromItem(LOTRMod.cram), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Item.getIdFromItem(pelmen), Item.getIdFromItem(LOTRMod.cram), "cinder_loe", "1.2.1");
CinderCore.registerItemFallback(Item.getIdFromItem(lightStew), Item.getIdFromItem(LOTRMod.leekSoup), "cinder_loe", "1.2.1"); CinderCore.registerItemFallback(Item.getIdFromItem(lightStew), Item.getIdFromItem(LOTRMod.leekSoup), "cinder_loe", "1.2.1");

@ -20,25 +20,25 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.world.World; import net.minecraft.world.World;
public class CinderItemFood extends ItemFood { public class CinderItemFood extends LOTRItemFood {
private int damageAmount;
public CinderItemFood(int healAmount, float saturation, boolean canWolfEat) { public CinderItemFood(int healAmount, float saturation, boolean canWolfEat) {
super(healAmount, saturation, canWolfEat); super(healAmount, saturation, canWolfEat);
this.setCreativeTab(LOTRCreativeTabs.tabFood);
} }
private int damageAmount;
public CinderItemFood setdamageAmount(int i) { public CinderItemFood setdamageAmount(int i) {
this.damageAmount = i; this.damageAmount = i;
return this; return this;
} }
@Override
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
if (!world.isRemote && this == LOTRMod.maggotyBread) {
LOTRLevelData.getData(entityplayer).addAchievement(LOTRAchievement.eatMaggotyBread);
}
if (this.damageAmount > 0) { if (this.damageAmount > 0) {
entityplayer.attackEntityFrom(DamageSource.magic, (float)this.damageAmount); entityplayer.attackEntityFrom(DamageSource.onFire, (float)this.damageAmount);
} }
return super.onEaten(itemstack, world, entityplayer); return super.onEaten(itemstack, world, entityplayer);
} }
}
}
Loading…
Cancel
Save