Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b787aec975
|
|
@ -31,6 +31,7 @@ import net.minecraftforge.client.event.GuiOpenEvent;
|
||||||
import net.minecraftforge.client.event.MouseEvent;
|
import net.minecraftforge.client.event.MouseEvent;
|
||||||
import net.minecraftforge.client.event.RenderHandEvent;
|
import net.minecraftforge.client.event.RenderHandEvent;
|
||||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||||
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
|
@ -262,6 +263,7 @@ public class RenderEvents
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -271,94 +273,98 @@ public class RenderEvents
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPlayerRenderPre(RenderPlayerEvent.Pre event)
|
public void onPlayerRenderPre(RenderPlayerEvent.Pre event)
|
||||||
{
|
{
|
||||||
EntityPlayer player = event.getEntityPlayer();
|
if (!Loader.isModLoaded("mobends")) {
|
||||||
AbstractClientPlayer aplayer = (AbstractClientPlayer) player;
|
|
||||||
ItemStack stack = player.getHeldItemMainhand();
|
|
||||||
ModelPlayer model = event.getRenderer().getMainModel();
|
|
||||||
EntityPlayerSP clientPlayer = Minecraft.getMinecraft().player;
|
|
||||||
|
|
||||||
ResourceLocation skinLoc = DefaultPlayerSkin.getDefaultSkin(player.getPersistentID());
|
EntityPlayer player = event.getEntityPlayer();
|
||||||
|
AbstractClientPlayer aplayer = (AbstractClientPlayer) player;
|
||||||
|
ItemStack stack = player.getHeldItemMainhand();
|
||||||
|
ModelPlayer model = event.getRenderer().getMainModel();
|
||||||
|
EntityPlayerSP clientPlayer = Minecraft.getMinecraft().player;
|
||||||
|
|
||||||
ModelRenderer fakeLeftArm = new ModelRenderer(model, 32, 48);
|
ResourceLocation skinLoc = DefaultPlayerSkin.getDefaultSkin(player.getPersistentID());
|
||||||
ModelRenderer fakeRightArm = new ModelRenderer(model, 40, 16);
|
|
||||||
|
|
||||||
if (!stack.isEmpty() && (stack.getItem() == RegistrationHandler.itemTile && ItemTile.hasTileData(stack)) || (stack.getItem() == RegistrationHandler.itemEntity && ItemEntity.hasEntityData(stack)))
|
ModelRenderer fakeLeftArm = new ModelRenderer(model, 32, 48);
|
||||||
{
|
ModelRenderer fakeRightArm = new ModelRenderer(model, 40, 16);
|
||||||
if (model.bipedBody.childModels != null && !model.bipedBody.childModels.isEmpty())
|
|
||||||
model.bipedBody.childModels.clear();
|
|
||||||
|
|
||||||
Item item = stack.getItem();
|
if (!stack.isEmpty() && (stack.getItem() == RegistrationHandler.itemTile && ItemTile.hasTileData(stack)) || (stack.getItem() == RegistrationHandler.itemEntity && ItemEntity.hasEntityData(stack)))
|
||||||
|
|
||||||
model.bipedLeftArm.isHidden = true;
|
|
||||||
model.bipedRightArm.isHidden = true;
|
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(skinLoc);
|
|
||||||
float rotation = -player.renderYawOffset;
|
|
||||||
if (aplayer.getSkinType().equals("default"))
|
|
||||||
{
|
{
|
||||||
fakeLeftArm.addBox(model.bipedLeftArm.offsetX + 4.2F, model.bipedLeftArm.offsetY, model.bipedLeftArm.offsetZ, 4, 12, 4, .08F);
|
if (model.bipedBody.childModels != null && !model.bipedBody.childModels.isEmpty())
|
||||||
}
|
model.bipedBody.childModels.clear();
|
||||||
else
|
|
||||||
{
|
|
||||||
fakeLeftArm.addBox(model.bipedLeftArm.offsetX + 4.2F, model.bipedLeftArm.offsetY, model.bipedLeftArm.offsetZ, 3, 12, 4, .08F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aplayer.getSkinType().equals("default"))
|
Item item = stack.getItem();
|
||||||
{
|
|
||||||
fakeRightArm.addBox(model.bipedRightArm.offsetX - 7.9F, model.bipedRightArm.offsetY, model.bipedRightArm.offsetZ, 4, 12, 4, .08F);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fakeRightArm.addBox(model.bipedRightArm.offsetX - 7.2F, model.bipedRightArm.offsetY, model.bipedRightArm.offsetZ, 3, 12, 4, .08F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item == RegistrationHandler.itemTile)
|
model.bipedLeftArm.isHidden = true;
|
||||||
{
|
model.bipedRightArm.isHidden = true;
|
||||||
if (!player.isSneaking())
|
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(skinLoc);
|
||||||
|
float rotation = -player.renderYawOffset;
|
||||||
|
if (aplayer.getSkinType().equals("default"))
|
||||||
{
|
{
|
||||||
fakeRightArm.rotateAngleX = -.9F;
|
fakeLeftArm.addBox(model.bipedLeftArm.offsetX + 4.2F, model.bipedLeftArm.offsetY, model.bipedLeftArm.offsetZ, 4, 12, 4, .08F);
|
||||||
fakeLeftArm.rotateAngleX = -.9F;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fakeRightArm.rotateAngleX = -1.4F;
|
fakeLeftArm.addBox(model.bipedLeftArm.offsetX + 4.2F, model.bipedLeftArm.offsetY, model.bipedLeftArm.offsetZ, 3, 12, 4, .08F);
|
||||||
fakeLeftArm.rotateAngleX = -1.4F;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
if (aplayer.getSkinType().equals("default"))
|
||||||
{
|
|
||||||
if (!player.isSneaking())
|
|
||||||
{
|
{
|
||||||
fakeRightArm.rotateAngleX = -1.2F;
|
fakeRightArm.addBox(model.bipedRightArm.offsetX - 7.9F, model.bipedRightArm.offsetY, model.bipedRightArm.offsetZ, 4, 12, 4, .08F);
|
||||||
fakeLeftArm.rotateAngleX = -1.2F;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fakeRightArm.rotateAngleX = -1.7F;
|
fakeRightArm.addBox(model.bipedRightArm.offsetX - 7.2F, model.bipedRightArm.offsetY, model.bipedRightArm.offsetZ, 3, 12, 4, .08F);
|
||||||
fakeLeftArm.rotateAngleX = -1.7F;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fakeRightArm.rotateAngleY = -0.15f;
|
if (item == RegistrationHandler.itemTile)
|
||||||
fakeLeftArm.rotateAngleY = 0.15f;
|
{
|
||||||
|
if (!player.isSneaking())
|
||||||
|
{
|
||||||
|
fakeRightArm.rotateAngleX = -.9F;
|
||||||
|
fakeLeftArm.rotateAngleX = -.9F;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fakeRightArm.rotateAngleX = -1.4F;
|
||||||
|
fakeLeftArm.rotateAngleX = -1.4F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!player.isSneaking())
|
||||||
|
{
|
||||||
|
fakeRightArm.rotateAngleX = -1.2F;
|
||||||
|
fakeLeftArm.rotateAngleX = -1.2F;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fakeRightArm.rotateAngleX = -1.7F;
|
||||||
|
fakeLeftArm.rotateAngleX = -1.7F;
|
||||||
|
}
|
||||||
|
|
||||||
|
fakeRightArm.rotateAngleY = -0.15f;
|
||||||
|
fakeLeftArm.rotateAngleY = 0.15f;
|
||||||
|
|
||||||
|
}
|
||||||
|
model.bipedBody.addChild(fakeLeftArm);
|
||||||
|
model.bipedBody.addChild(fakeRightArm);
|
||||||
|
|
||||||
}
|
}
|
||||||
model.bipedBody.addChild(fakeLeftArm);
|
else
|
||||||
model.bipedBody.addChild(fakeRightArm);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
model.bipedLeftArm.isHidden = false;
|
|
||||||
model.bipedRightArm.isHidden = false;
|
|
||||||
if (model.bipedBody.childModels != null && !model.bipedBody.childModels.isEmpty())
|
|
||||||
{
|
{
|
||||||
model.bipedBody.childModels.clear();
|
model.bipedLeftArm.isHidden = false;
|
||||||
|
model.bipedRightArm.isHidden = false;
|
||||||
|
if (model.bipedBody.childModels != null && !model.bipedBody.childModels.isEmpty())
|
||||||
|
{
|
||||||
|
model.bipedBody.childModels.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (stack.isEmpty() || (stack.getItem() != RegistrationHandler.itemTile && stack.getItem() != RegistrationHandler.itemEntity))
|
if (stack.isEmpty() || (stack.getItem() != RegistrationHandler.itemTile && stack.getItem() != RegistrationHandler.itemEntity))
|
||||||
{
|
{
|
||||||
model.bipedLeftArm.isHidden = false;
|
model.bipedLeftArm.isHidden = false;
|
||||||
model.bipedRightArm.isHidden = false;
|
model.bipedRightArm.isHidden = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user