Fix bow models

This commit is contained in:
Vincent Lee committed 2016-03-24 13:47:58 -05:00
1 parent ab618923df
commit ecb0f8a4be
14 files changed
+271 -97

No files matched your search

@@ -19,8 +19,8 @@ public final class ClientMethodHandles {
renderPosX_getter, renderPosY_getter, renderPosZ_getter, // RenderManager
farPlaneDistance_getter,
hurtCameraEffect, setupViewBobbing, getFOVModifier,
enableLightmap, disableLightmap, // EntityRenderer
prevEquippedProgress_getter, equippedProgress_getter; // ItemRenderer
enableLightmap, disableLightmap; // EntityRenderer
//prevEquippedProgress_getter, equippedProgress_getter; // ItemRenderer
static {
try {
@@ -60,15 +60,16 @@ public final class ClientMethodHandles {
m.setAccessible(true);
getFOVModifier = MethodHandles.publicLookup().unreflect(m);
f = ReflectionHelper.findField(ItemRenderer.class, LibObfuscation.PREV_EQUIPPED_PROGRESS);
f.setAccessible(true);
prevEquippedProgress_getter = MethodHandles.publicLookup().unreflectGetter(f);
f = ReflectionHelper.findField(ItemRenderer.class, LibObfuscation.EQUIPPED_PROGRESS);
f.setAccessible(true);
equippedProgress_getter = MethodHandles.publicLookup().unreflectGetter(f);
// f = ReflectionHelper.findField(ItemRenderer.class, LibObfuscation.PREV_EQUIPPED_PROGRESS);
// f.setAccessible(true);
// prevEquippedProgress_getter = MethodHandles.publicLookup().unreflectGetter(f);
//
// f = ReflectionHelper.findField(ItemRenderer.class, LibObfuscation.EQUIPPED_PROGRESS);
// f.setAccessible(true);
// equippedProgress_getter = MethodHandles.publicLookup().unreflectGetter(f);
} catch (IllegalAccessException e) {
FMLLog.severe("[Botania]: Couldn't initialize client methodhandles! Things will be broken!");
e.printStackTrace();
throw Throwables.propagate(e);
}
}
@@ -36,7 +36,7 @@ public class RenderLexicon {
@SubscribeEvent
public void renderItem(RenderHandEvent evt) {
Minecraft mc = Minecraft.getMinecraft();
if(!ConfigHandler.lexicon3dModel || mc.gameSettings.thirdPersonView != 0 || !PlayerHelper.hasHeldItem(mc.thePlayer, ModItems.lexicon))
if(true || !ConfigHandler.lexicon3dModel || mc.gameSettings.thirdPersonView != 0 || !PlayerHelper.hasHeldItem(mc.thePlayer, ModItems.lexicon))
return;
evt.setCanceled(true);
@@ -102,8 +102,8 @@ public class RenderLexicon {
private void renderItemInFirstPerson() throws Throwable {
// Cherry picked from ItemRenderer.renderItemInFirstPerson
float prevEquippedProgress = ((float) ClientMethodHandles.prevEquippedProgress_getter.invokeExact(Minecraft.getMinecraft().getItemRenderer()));
float equippedProgress = ((float) ClientMethodHandles.equippedProgress_getter.invokeExact(Minecraft.getMinecraft().getItemRenderer()));
float prevEquippedProgress = 0;//((float) ClientMethodHandles.prevEquippedProgress_getter.invokeExact(Minecraft.getMinecraft().getItemRenderer()));
float equippedProgress = 0;//((float) ClientMethodHandles.equippedProgress_getter.invokeExact(Minecraft.getMinecraft().getItemRenderer()));
float f = 1.0F - (prevEquippedProgress + (equippedProgress - prevEquippedProgress) * ClientTickHandler.partialTicks);
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
float f1 = player.getSwingProgress(ClientTickHandler.partialTicks);
@@ -408,6 +408,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
} catch (Throwable t) {
t.printStackTrace();
return;
}
@@ -18,6 +18,7 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArrow;
import net.minecraft.item.ItemBow;
@@ -57,7 +58,20 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem {
setUnlocalizedName(name);
setMaxDamage(500);
setFull3D();
addPropertyOverride(new ResourceLocation("minecraft:pull"), (stack, worldIn, entityIn) -> (stack.getMaxItemUseDuration() - entityIn.getItemInUseCount()) * chargeVelocityMultiplier() / 20.0F);
addPropertyOverride(new ResourceLocation("minecraft:pull"), new IItemPropertyGetter() {
@Override
public float apply(ItemStack stack, World worldIn, EntityLivingBase entityIn) {
if (entityIn == null)
{
return 0.0F;
}
else
{
ItemStack itemstack = entityIn.getActiveItemStack();
return itemstack != null && itemstack.getItem() instanceof ItemLivingwoodBow ? (float)(stack.getMaxItemUseDuration() - entityIn.getItemInUseCount()) * chargeVelocityMultiplier() / 20.0F : 0.0F;
}
}
});
}
@Override
@@ -4,15 +4,61 @@
"layer0": "botania:items/crystalBow0"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
},
"overrides": [
{
"predicate": {
"minecraft:pulling": 1
},
"model": "botania:item/crystalBow_pulling_1"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.35
},
"model": "botania:item/crystalBow_pulling_2"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.65
},
"model": "botania:item/crystalBow_pulling_3"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.8
},
"model": "botania:item/crystalBow_pulling_4"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.9
},
"model": "botania:item/crystalBow_pulling_5"
}
]
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/crystalBow1"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/crystalBow2"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/crystalBow3"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/crystalBow4"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/crystalBow5"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,47 @@
"layer0": "botania:items/livingwoodBow0"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
},
"overrides": [
{
"predicate": {
"minecraft:pulling": 1
},
"model": "botania:item/livingwoodBow_pulling_1"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.65
},
"model": "botania:item/livingwoodBow_pulling_2"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.9
},
"model": "botania:item/livingwoodBow_pulling_3"
}
]
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/livingwoodBow1"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/livingwoodBow2"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}
@@ -4,15 +4,25 @@
"layer0": "botania:items/livingwoodBow3"
},
"display": {
"thirdperson": {
"rotation": [ 5, 80, -45 ],
"translation": [ 0.75, 0, 0.25 ],
"scale": [ 1, 1, 1 ]
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
}
}