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 cabbage;
public static Item pelmen;
// public static Item spice;
// public static Item spicedHam;
public static Item spice;
public static Item spicedHam;
public static Item lightStew;
// Misc
@ -423,13 +423,14 @@ public class CinderLoE {
e.printStackTrace();
}
// Food
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");;
// spice = new CinderItemFood(1, 0.0f, false).setdamageAmount(2).setPotionEffect(Potion.moveSpeed.id, 10,0,100).setUnlocalizedName("lotr:spice");
// spicedHam = new CinderItemFood(9, 0.6f, true).setdamageAmount(2).setPotionEffect(Potion.moveSpeed.id, 60, 0, 100).setUnlocalizedName("lotr:spicedHam");
// 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");;
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").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");
// 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");
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");
lightStew = new LOTRItemStew(6, 0.7f, false).setPotionEffect(Potion.damageBoost.id, 60, 0, 100).setUnlocalizedName("lotr:lightStew").setTextureName("lotr:lightStew");
// Red Dwarf Spawns
redDwarfWarriorSpawnEgg = new CinderLoESpawnEgg(RedDwarfWarrior.class).setTextureName("lotr:spawn_egg");
@ -490,8 +491,8 @@ public class CinderLoE {
ItemRegistration.registerItem(cabbage, "cabbage", 90);
ItemRegistration.registerItem(pelmen, "pelmen", 91);
ItemRegistration.registerItem(lightStew, "lightStew", 92);
// ItemRegistration.registerItem(spice, "spice", 93);
// ItemRegistration.registerItem(spicedHam, "spicedHam", 94);
ItemRegistration.registerItem(spice, "spice", 93);
ItemRegistration.registerItem(spicedHam, "spicedHam", 94);
// ==Red Dwarf Eggs==
ItemRegistration.registerItem(redDwarfWarriorSpawnEgg, "redDwarfWarriorSpawnEgg", 0);
@ -906,8 +907,8 @@ public class CinderLoE {
// == Food Items ==
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(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(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(pelmen), Item.getIdFromItem(LOTRMod.cram), "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.world.World;
public class CinderItemFood extends ItemFood {
public class CinderItemFood extends LOTRItemFood {
private int damageAmount;
public CinderItemFood(int healAmount, float saturation, boolean canWolfEat) {
super(healAmount, saturation, canWolfEat);
this.setCreativeTab(LOTRCreativeTabs.tabFood);
}
private int damageAmount;
public CinderItemFood setdamageAmount(int i) {
this.damageAmount = i;
return this;
}
@Override
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) {
entityplayer.attackEntityFrom(DamageSource.magic, (float)this.damageAmount);
entityplayer.attackEntityFrom(DamageSource.onFire, (float)this.damageAmount);
}
return super.onEaten(itemstack, world, entityplayer);
}
}
}
Loading…
Cancel
Save