Steal the transforms from Psi :P

This commit is contained in:
Vincent Lee committed 2016-06-05 15:11:17 -05:00
1 parent 9897d3ed80
commit 85eef6c461
3 files changed
+47 -59

No files matched your search

@@ -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<BakedQuad> 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<ItemStack> lenses = ItemManaGun.getAllLens(stack);
}
}
}
}
@@ -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);
@@ -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 ]
}
}
}