From 85eef6c461a9b73380e7d64d472b58a067dbc7b6 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sun, 5 Jun 2016 15:11:17 -0500 Subject: [PATCH] Steal the transforms from Psi :P --- .../botania/client/model/ManaGunModel.java | 47 ------------------- .../botania/common/item/ItemManaGun.java | 12 ++--- .../assets/botania/models/item/manaGun.json | 47 +++++++++++++++++-- 3 files changed, 47 insertions(+), 59 deletions(-) delete mode 100644 src/main/java/vazkii/botania/client/model/ManaGunModel.java diff --git a/src/main/java/vazkii/botania/client/model/ManaGunModel.java b/src/main/java/vazkii/botania/client/model/ManaGunModel.java deleted file mode 100644 index 50ce901ba..000000000 --- a/src/main/java/vazkii/botania/client/model/ManaGunModel.java +++ /dev/null @@ -1,47 +0,0 @@ -package vazkii.botania.client.model; - -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import vazkii.botania.common.item.ItemManaGun; - -import java.util.List; - -public class ManaGunModel implements IBakedModel { - - private final ItemHandler itemHandler = new ItemHandler(); - - @Override public List getQuads(IBlockState state, EnumFacing side, long rand) { return null; } - @Override public boolean isAmbientOcclusion() { return true; } - @Override public boolean isGui3d() { return true; } - @Override public boolean isBuiltInRenderer() { return false; } - @Override public TextureAtlasSprite getParticleTexture() { return null; } - @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } - - @Override - public ItemOverrideList getOverrides() { - return itemHandler; - } - - private class ItemHandler extends ItemOverrideList { - private ItemHandler() { - super(ImmutableList.of()); - } - - @Override - public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { - boolean hasClip = ItemManaGun.hasClip(stack); - if (hasClip) { - List lenses = ItemManaGun.getAllLens(stack); - } - } - } -} diff --git a/src/main/java/vazkii/botania/common/item/ItemManaGun.java b/src/main/java/vazkii/botania/common/item/ItemManaGun.java index ca230a47b..2622ea423 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaGun.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaGun.java @@ -14,18 +14,15 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; 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.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.world.World; @@ -75,7 +72,8 @@ 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() { + + /*addPropertyOverride(new ResourceLocation("botania", "clip"), new IItemPropertyGetter() { @Override public float apply(@Nonnull ItemStack itemStack, World world, EntityLivingBase entityLivingBase) { return hasClip(itemStack) ? 1 : 0; @@ -86,7 +84,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable { public float apply(@Nonnull ItemStack itemStack, World world, EntityLivingBase entityLivingBase) { return isSugoiKawaiiDesuNe(itemStack) ? 1 : 0; } - }); + })*/; } @Nonnull @@ -150,8 +148,8 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable { @Override @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par2 == 0) + public int getColorFromItemStack(ItemStack par1ItemStack, int tintIndex) { + if(tintIndex != 1) return 0xFFFFFF; EntityManaBurst burst = getBurst(Minecraft.getMinecraft().thePlayer, par1ItemStack, false); diff --git a/src/main/resources/assets/botania/models/item/manaGun.json b/src/main/resources/assets/botania/models/item/manaGun.json index 16e586c2d..34d3cccff 100644 --- a/src/main/resources/assets/botania/models/item/manaGun.json +++ b/src/main/resources/assets/botania/models/item/manaGun.json @@ -1,5 +1,5 @@ { - "__comment": "", + "__comment": "Author: wiiv", "textures": { "layer0": "botania:items/manaBlaster", "layer1": "botania:items/manaBlasterColor", @@ -131,9 +131,9 @@ "from": [ 9.5, 11.0, 6.0 ], "to": [ 17.5, 12.0, 10.0 ], "faces": { - "north": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ] }, - "east": { "texture": "layer1", "uv": [ 0.0, 0.0, 5.0, 5.0 ] }, - "south": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ] } + "north": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ], "tintindex": 1 }, + "east": { "texture": "layer1", "uv": [ 0.0, 0.0, 5.0, 5.0 ], "tintindex": 1 }, + "south": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ], "tintindex": 1 } } }, { @@ -161,5 +161,42 @@ "down": { "texture": "layer3", "uv": [ 3.0, 0.01, 6.0, 6.5 ], "rotation": 90 } } } - ] + ], + "display": { + "gui": { + "rotation": [ 0, -20, -40 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 2.45, -1.5 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "thirdperson_righthand": { + "rotation": [ 0, -90, 0 ], + "translation": [ 0, 2.45, -1.5 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "firstperson_lefthand": { + "rotation": [ 10, 80, -5 ], + "translation": [ 0.8, 2.5, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + }, + "firstperson_righthand": { + "rotation": [ 10, -80, 5 ], + "translation": [ -1.8, 2.5, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + } + } } \ No newline at end of file