Update JEI, more overrides

This commit is contained in:
Vincent Lee committed 2016-03-27 12:05:19 -05:00
1 parent c8531fde67
commit bcd00dbba3
8 files changed
+97 -44

No files matched your search

@@ -198,27 +198,6 @@ public final class ModelHandler {
? new ModelResourceLocation("botania:infiniteFruitBoot", "inventory")
: new ModelResourceLocation("botania:infiniteFruit", "inventory")));
registerItemModel(magnetRing);
registerItemModel(magnetRingGreater);
ModelLoader.registerItemVariants(manaGun,
new ModelResourceLocation("botania:manaGun", "inventory"),
new ModelResourceLocation("botania:manaGunClip", "inventory"),
new ModelResourceLocation("botania:desuGun", "inventory"),
new ModelResourceLocation("botania:desuGunClip", "inventory"));
ModelLoader.setCustomMeshDefinition(manaGun, MesherWrapper.of(stack -> {
String name = ((ItemManaGun) manaGun).isSugoiKawaiiDesuNe(stack) ? "botania:desuGun" : "botania:manaGun";
return new ModelResourceLocation(name + (ItemManaGun.hasClip(stack) ? "Clip" : ""), "inventory");
}));
ModelLoader.registerItemVariants(tornadoRod,
new ModelResourceLocation("botania:tornadoRod", "inventory"),
new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
ModelLoader.setCustomMeshDefinition(tornadoRod, MesherWrapper.of(stack ->
((ItemTornadoRod) ModItems.tornadoRod).isFlying(stack)
? new ModelResourceLocation("botania:tornadoRod_flying", "inventory")
: new ModelResourceLocation("botania:tornadoRod", "inventory")));
ModelLoader.registerItemVariants(manaCookie,
new ModelResourceLocation("botania:manaCookie", "inventory"),
new ModelResourceLocation("botania:totalBiscuit", "inventory"));
@@ -226,25 +205,6 @@ public final class ModelHandler {
stack.getDisplayName().toLowerCase().equals("totalbiscuit")
? new ModelResourceLocation("botania:totalBiscuit", "inventory")
: new ModelResourceLocation("botania:manaCookie", "inventory")));
registerItemModel(manasteelSword);
registerItemModel(spawnerMover);
ModelLoader.registerItemVariants(terraPick,
new ModelResourceLocation("botania:terraPick", "inventory"),
new ModelResourceLocation("botania:terraPickEnabled", "inventory"),
new ModelResourceLocation("botania:terraPickTipped", "inventory"),
new ModelResourceLocation("botania:terraPickTippedEnabled", "inventory"));
ModelLoader.setCustomMeshDefinition(terraPick, MesherWrapper.of(stack -> {
String name = "botania:terraPick";
if (ItemTerraPick.isTipped(stack)) {
name += "Tipped";
}
if (ItemTerraPick.isEnabled(stack)) {
name += "Enabled";
}
return new ModelResourceLocation(name, "inventory");
}));
}
private static void registerSubtiles() {
@@ -401,6 +361,14 @@ public final class ModelHandler {
}
private static void registerStandardItems() {
registerItemModel(manasteelSword);
registerItemModel(spawnerMover);
registerItemModel(terraPick);
registerItemModel(magnetRing);
registerItemModel(magnetRingGreater);
registerItemModel(manaGun);
registerItemModel(tornadoRod);
registerItemModel(twigWand);
registerItemModel(pestleAndMortar);
registerItemModel(blackLotus);
@@ -16,9 +16,11 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
@@ -26,6 +28,7 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
@@ -72,6 +75,18 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
RecipeSorter.register("botania:manaGunLens", ManaGunLensRecipe.class, Category.SHAPELESS, "");
RecipeSorter.register("botania:manaGunRemoveLens", ManaGunRemoveLensRecipe.class, Category.SHAPELESS, "");
RecipeSorter.register("botania:manaGunClip", ManaGunClipRecipe.class, Category.SHAPELESS, "");
addPropertyOverride(new ResourceLocation("botania", "clip"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack itemStack, World world, EntityLivingBase entityLivingBase) {
return hasClip(itemStack) ? 1 : 0;
}
});
addPropertyOverride(new ResourceLocation("botania", "desu"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack itemStack, World world, EntityLivingBase entityLivingBase) {
return isSugoiKawaiiDesuNe(itemStack) ? 1 : 0;
}
});
}
@Override
@@ -17,8 +17,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Enchantments;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -74,6 +76,18 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_PICK);
GameRegistry.addRecipe(new TerraPickTippingRecipe());
RecipeSorter.register("botania:terraPickTipping", TerraPickTippingRecipe.class, Category.SHAPELESS, "");
addPropertyOverride(new ResourceLocation("botania", "tipped"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack itemStack, World world, EntityLivingBase entityLivingBase) {
return isTipped(itemStack) ? 1 : 0;
}
});
addPropertyOverride(new ResourceLocation("botania", "enabled"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack itemStack, World world, EntityLivingBase entityLivingBase) {
return isEnabled(itemStack) ? 1 : 0;
}
});
}
@Override
@@ -13,8 +13,10 @@ package vazkii.botania.common.item.rod;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
@@ -53,6 +55,12 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
setMaxDamage(MAX_DAMAGE);
setUnlocalizedName(LibItemNames.TORNADO_ROD);
setMaxStackSize(1);
addPropertyOverride(new ResourceLocation("botania", "flying"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack itemStack, World world, EntityLivingBase entityLivingBase) {
return isFlying(itemStack) ? 1 : 0;
}
});
}
@Override