Some item overrides, fix bow firing

This commit is contained in:
Vincent Lee committed 2016-03-24 14:41:10 -05:00
1 parent ecb0f8a4be
commit 4771ec5bdb
13 files changed
+68 -65

No files matched your search

@@ -233,14 +233,6 @@ public final class ModelHandler {
? new ModelResourceLocation("botania:tornadoRod_flying", "inventory")
: new ModelResourceLocation("botania:tornadoRod", "inventory")));
ModelLoader.registerItemVariants(twigWand,
new ModelResourceLocation("botania:twigWand", "inventory"),
new ModelResourceLocation("botania:twigWand_bind", "inventory"));
ModelLoader.setCustomMeshDefinition(twigWand, MesherWrapper.of(stack -> {
String path = "botania:twigWand";
return new ModelResourceLocation(path + (ItemTwigWand.getBindMode(stack) ? "_bind" : ""), "inventory");
}));
ModelLoader.registerItemVariants(manaCookie,
new ModelResourceLocation("botania:manaCookie", "inventory"),
new ModelResourceLocation("botania:totalBiscuit", "inventory"));
@@ -249,42 +241,6 @@ public final class ModelHandler {
? new ModelResourceLocation("botania:totalBiscuit", "inventory")
: new ModelResourceLocation("botania:manaCookie", "inventory")));
ModelLoader.registerItemVariants(manaweaveBoots,
new ModelResourceLocation("botania:manaweaveBoots", "inventory"),
new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveBoots, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveBoots", "inventory")));
ModelLoader.registerItemVariants(manaweaveChest,
new ModelResourceLocation("botania:manaweaveChest", "inventory"),
new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveChest, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveChest", "inventory")));
ModelLoader.registerItemVariants(manaweaveHelm,
new ModelResourceLocation("botania:manaweaveHelm", "inventory"),
new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveHelm, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveHelm", "inventory")));
ModelLoader.registerItemVariants(manaweaveLegs,
new ModelResourceLocation("botania:manaweaveLegs", "inventory"),
new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveLegs, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveLegs", "inventory")));
ModelLoader.registerItemVariants(manasteelSword,
new ModelResourceLocation("botania:manasteelSword", "inventory"),
new ModelResourceLocation("botania:elucidator", "inventory"));
@@ -469,6 +425,7 @@ public final class ModelHandler {
}
private static void registerStandardItems() {
registerItemModel(twigWand);
registerItemModel(pestleAndMortar);
registerItemModel(blackLotus);
registerItemModel(blackLotus, 1);
@@ -486,6 +443,11 @@ public final class ModelHandler {
registerItemModel(manasteelAxe);
registerItemModel(manasteelShears);
registerItemModel(manaweaveHelm);
registerItemModel(manaweaveChest);
registerItemModel(manaweaveLegs);
registerItemModel(manaweaveBoots);
registerItemModel(elementiumHelm);
registerItemModel(elementiumHelmRevealing);
registerItemModel(elementiumChest);
@@ -17,10 +17,12 @@ import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -59,6 +61,12 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
public ItemTwigWand() {
super(LibItemNames.TWIG_WAND);
setMaxStackSize(1);
addPropertyOverride(new ResourceLocation("botania", "bindmode"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack stack, World worldIn, EntityLivingBase entityIn) {
return getBindMode(stack) ? 1 : 0;
}
});
}
@Override
@@ -13,12 +13,16 @@ package vazkii.botania.common.item.equipment.armor.manaweave;
import java.util.List;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.client.core.proxy.ClientProxy;
import vazkii.botania.client.lib.LibResources;
@@ -35,6 +39,12 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi
public ItemManaweaveArmor(EntityEquipmentSlot type, String name) {
super(type, name, BotaniaAPI.manaweaveArmorMaterial);
addPropertyOverride(new ResourceLocation("botania", "holiday"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack stack, World worldIn, EntityLivingBase entityIn) {
return ClientProxy.jingleTheBells ? 1 : 0;
}
});
}
@Override
@@ -131,6 +131,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem {
if(ammo == null)
ammo = new ItemStack(Items.arrow);
EntityArrow entityarrow = ((ItemArrow) ammo.getItem()).createArrow(world, ammo, shooter);
entityarrow.func_184547_a(shooter, shooter.rotationPitch, shooter.rotationYaw, 0.0F, f * 3.0F, 1.0F);
if(f == 1.0F)
entityarrow.setIsCritical(true);