public void renderRightArm(AbstractClientPlayer clientPlayer) { float f = 1.0F; GlStateManager.color(1.0F, 1.0F, 1.0F); float f1 = 0.0625F; ModelPlayer modelplayer = this.getMainModel(); this.setModelVisibilities(clientPlayer); GlStateManager.enableBlend(); modelplayer.swingProgress = 0.0F; modelplayer.isSneak = false; modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); modelplayer.bipedRightArm.rotateAngleX = 0.0F; modelplayer.bipedRightArm.render(0.0625F); modelplayer.bipedRightArmwear.rotateAngleX = 0.0F; modelplayer.bipedRightArmwear.render(0.0625F); GlStateManager.disableBlend(); }
public void renderLeftArm(AbstractClientPlayer clientPlayer) { float f = 1.0F; GlStateManager.color(1.0F, 1.0F, 1.0F); float f1 = 0.0625F; ModelPlayer modelplayer = this.getMainModel(); this.setModelVisibilities(clientPlayer); GlStateManager.enableBlend(); modelplayer.isSneak = false; modelplayer.swingProgress = 0.0F; modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); modelplayer.bipedLeftArm.rotateAngleX = 0.0F; modelplayer.bipedLeftArm.render(0.0625F); modelplayer.bipedLeftArmwear.rotateAngleX = 0.0F; modelplayer.bipedLeftArmwear.render(0.0625F); GlStateManager.disableBlend(); }
@Override public void renderRightArm(AbstractClientPlayer clientPlayer) { ExtendedPlayer exPlayer = ExtendedPlayerProvider.getExtendedPlayer(clientPlayer); ResourceLocation skin = clientPlayer.getLocationSkin(); if(exPlayer.getPlayerDisguiseUUID() !=null){ ResourceLocation res = DownloadedTextures.getSkin(exPlayer.getPlayerDisguiseUUID()); if(res !=null){ skin = res; } } Minecraft.getMinecraft().getRenderManager().renderEngine.bindTexture(skin); GlStateManager.color(1.0F, 1.0F, 1.0F); ModelPlayer modelplayer = this.getMainModel(); this.setModelVisibilities(clientPlayer); GlStateManager.enableBlend(); modelplayer.swingProgress = 0.0F; modelplayer.isSneak = false; modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); modelplayer.bipedRightArm.rotateAngleX = 0.0F; modelplayer.bipedRightArm.render(0.0625F); modelplayer.bipedRightArmwear.rotateAngleX = 0.0F; modelplayer.bipedRightArmwear.render(0.0625F); GlStateManager.disableBlend(); }
@Override public void renderLeftArm(AbstractClientPlayer clientPlayer) { ExtendedPlayer exPlayer = ExtendedPlayerProvider.getExtendedPlayer(clientPlayer); ResourceLocation skin = clientPlayer.getLocationSkin(); if(exPlayer.getPlayerDisguiseUUID() !=null){ ResourceLocation res = DownloadedTextures.getSkin(exPlayer.getPlayerDisguiseUUID()); if(res !=null){ skin = res; } } Minecraft.getMinecraft().getRenderManager().renderEngine.bindTexture(skin); GlStateManager.color(1.0F, 1.0F, 1.0F); ModelPlayer modelplayer = this.getMainModel(); this.setModelVisibilities(clientPlayer); GlStateManager.enableBlend(); modelplayer.isSneak = false; modelplayer.swingProgress = 0.0F; modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); modelplayer.bipedLeftArm.rotateAngleX = 0.0F; modelplayer.bipedLeftArm.render(0.0625F); modelplayer.bipedLeftArmwear.rotateAngleX = 0.0F; modelplayer.bipedLeftArmwear.render(0.0625F); GlStateManager.disableBlend(); }
@Override public void doRender(M par1Entity, double par2, double par4, double par6, float par8, float par9) { ModelPlayer player = this.getEntityModel(par1Entity); this.mainModel = player; Set<EnumPlayerModelParts> parts = Minecraft.getMinecraft().gameSettings.getModelParts(); player.bipedHeadwear.isHidden = !parts.contains(EnumPlayerModelParts.HAT); player.bipedBodyWear.isHidden = !parts.contains(EnumPlayerModelParts.JACKET); player.bipedLeftLegwear.isHidden = !parts.contains(EnumPlayerModelParts.LEFT_PANTS_LEG); player.bipedRightLegwear.isHidden = !parts.contains(EnumPlayerModelParts.RIGHT_PANTS_LEG); player.bipedLeftArmwear.isHidden = !parts.contains(EnumPlayerModelParts.LEFT_SLEEVE); player.bipedRightArmwear.isHidden = !parts.contains(EnumPlayerModelParts.RIGHT_SLEEVE); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); super.doRender(par1Entity, par2, par4, par6, par8, par9); popAttrib(); pushMatrix(); scale(1.0F, -1.0F, 1.0F); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); super.doRender(par1Entity, par2, par4, par6, par8, par9); popAttrib(); popMatrix(); }
@Override public void doRender(@Patch.Generic("Lnet/minecraft/entity/EntityLivingBase;") AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks) { if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post( new net.minecraftforge.client.event.RenderPlayerEvent.Pre(entity, this, partialTicks, x, y, z))) return; if (!entity.isUser() || renderManager.renderViewEntity == entity || Minecraft.getMinecraft().player == entity) { double ny = y; if (entity.isSneaking() && !(entity instanceof EntityPlayerSP)) ny = y - 0.125D; ModelPlayer modelplayer = getMainModel(); modelplayer.bipedHead.isHidden = false; modelplayer.bipedHeadwear.isHidden = false; GlStateManager.enableBlendProfile(GlStateManager.Profile.PLAYER_SKIN); super.doRender(entity, x, ny, z, entityYaw, partialTicks); GlStateManager.disableBlendProfile(GlStateManager.Profile.PLAYER_SKIN); } net.minecraftforge.common.MinecraftForge.EVENT_BUS.post( new net.minecraftforge.client.event.RenderPlayerEvent.Post(entity, this, partialTicks, x, y, z)); }
private static void replaceEntriesInRenderPlayer(RenderPlayer renderer, ModelPlayer newModel) { if(renderer == null) { return; } //replace relevant fields in RenderPlayer for(Field field : RenderLivingBase.class.getDeclaredFields()) { if(field.getType() == ModelBase.class) { field.setAccessible(true); try { field.set(renderer, newModel); } catch (IllegalAccessException e) { InfinityLib.instance.getLogger().printStackTrace(e); } break; } } }
public RenderPlayer(RenderManager renderManager, boolean useSmallArms) { super(renderManager, new ModelPlayer(0.0F, useSmallArms), 0.5F); this.smallArms = useSmallArms; this.addLayer(new LayerBipedArmor(this)); this.addLayer(new LayerHeldItem(this)); this.addLayer(new LayerArrow(this)); this.addLayer(new LayerDeadmau5Head(this)); this.addLayer(new LayerCape(this)); this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); }
public void renderRightArm(AbstractClientPlayer clientPlayer) { float f = 1.0F; GlStateManager.color(f, f, f); ModelPlayer modelplayer = this.getMainModel(); this.setModelVisibilities(clientPlayer); modelplayer.swingProgress = 0.0F; modelplayer.isSneak = false; modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); modelplayer.renderRightArm(); }
public void renderLeftArm(AbstractClientPlayer clientPlayer) { float f = 1.0F; GlStateManager.color(f, f, f); ModelPlayer modelplayer = this.getMainModel(); this.setModelVisibilities(clientPlayer); modelplayer.isSneak = false; modelplayer.swingProgress = 0.0F; modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); modelplayer.renderLeftArm(); }
public RenderPlayer(RenderManager renderManager, boolean useSmallArms) { super(renderManager, new ModelPlayer(0.0F, useSmallArms), 0.5F); this.smallArms = useSmallArms; this.addLayer(new LayerBipedArmor(this)); this.addLayer(new LayerHeldItem(this)); this.addLayer(new LayerArrow(this)); this.addLayer(new LayerDeadmau5Head(this)); this.addLayer(new LayerCape(this)); this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); this.addLayer(new LayerElytra(this)); }
@Override public ModelPlayer getEntityModel(EntityPonyModel playermodel) { ResourceLocation loc = this.getEntityTexture(playermodel); if (loc == null) { return super.getEntityModel(playermodel); } Pony thePony = MineLittlePony.getInstance().getManager().getPony(loc); // TODO small arms PlayerModel pm = thePony.getModel(true, false); pm.apply(thePony.getMetadata()); return pm.getModel(); }
@Redirect( method = "renderLeftArm(Lnet/minecraft/client/entity/AbstractClientPlayer;)V", at = @At( value = "FIELD", target = "Lnet/minecraft/client/model/ModelPlayer;bipedLeftArm:Lnet/minecraft/client/model/ModelRenderer;", opcode = Opcodes.GETFIELD), require = 2) private ModelRenderer redirectLeftArm(ModelPlayer mr) { return this.playerModel.getModel().steveLeftArm; }
@Redirect( method = "renderLeftArm(Lnet/minecraft/client/entity/AbstractClientPlayer;)V", at = @At( value = "FIELD", target = "Lnet/minecraft/client/model/ModelPlayer;bipedLeftArmwear:Lnet/minecraft/client/model/ModelRenderer;", opcode = Opcodes.GETFIELD), require = 2) private ModelRenderer redirectLeftArmwear(ModelPlayer mr) { return this.playerModel.getModel().steveLeftArmwear; }
@Redirect( method = "renderRightArm(Lnet/minecraft/client/entity/AbstractClientPlayer;)V", at = @At( value = "FIELD", target = "Lnet/minecraft/client/model/ModelPlayer;bipedRightArm:Lnet/minecraft/client/model/ModelRenderer;", opcode = Opcodes.GETFIELD), require = 2) private ModelRenderer redirectRightArm(ModelPlayer mr) { return this.playerModel.getModel().steveRightArm; }
@Redirect( method = "renderRightArm(Lnet/minecraft/client/entity/AbstractClientPlayer;)V", at = @At( value = "FIELD", target = "Lnet/minecraft/client/model/ModelPlayer;bipedRightArmwear:Lnet/minecraft/client/model/ModelRenderer;", opcode = Opcodes.GETFIELD), require = 2) private ModelRenderer redirectRightArmwear(ModelPlayer mr) { return this.playerModel.getModel().steveRightArmwear; }
public static void initializePlayerLayers() { RenderPlayer slim_render = Minecraft.getMinecraft().getRenderManager().getSkinMap().get("slim"); slim_render.addLayer(new AccessoriesLayer(true, (ModelPlayer) slim_render.getMainModel())); RenderPlayer default_render = Minecraft.getMinecraft().getRenderManager().getSkinMap().get("default"); default_render.addLayer(new AccessoriesLayer(false, (ModelPlayer) default_render.getMainModel())); }
public AccessoriesLayer(boolean slimFit, ModelPlayer modelPlayer) { this.modelPlayer = modelPlayer; this.slimFit = slimFit; this.modelWings = new ModelAetherWings(1.0F); this.modelMisc = new ModelBiped(1.0F); this.modelHalo = new ModelHalo(); }
@SubscribeEvent @SuppressWarnings("unused") public void onPlayerRenderCall(RenderPlayerEvent.Pre event) { ModelPlayer model = event.getRenderer().getMainModel(); if(model instanceof ModelPlayerCustomized) { float left = this.getSwingProgress(event.getEntityPlayer(), EnumHand.OFF_HAND, event.getPartialRenderTick()); float right = this.getSwingProgress(event.getEntityPlayer(), EnumHand.MAIN_HAND, event.getPartialRenderTick()); ((ModelPlayerCustomized) model).setSwingProgress(left, right); } }
public static void replaceOldModel() { RenderPlayer renderer = getOldRenderer("default"); if(renderer == null) { InfinityLib.instance.getLogger().debug("Failed overriding left arm swing behaviour"); return; } ModelPlayer oldModel = renderer.getMainModel(); ModelPlayer newModel = null; for(Field field : RenderLivingBase.class.getDeclaredFields()) { if(field.getType() == ModelBase.class) { try { field.setAccessible(true); Object obj = field.get(renderer); if (obj == oldModel) { newModel = MODEL_MAIN; field.set(renderer, newModel); break; } } catch (Exception e) { InfinityLib.instance.getLogger().printStackTrace(e); } } } if(newModel != null) { //replace relevant fields in RenderPlayer replaceEntriesInRenderPlayer(renderer, newModel); replaceEntriesInRenderPlayer(getOldRenderer("slim"), MODEL_SLIM); } }
public CorpseRenderer(RenderManager renderManagerIn) { super(renderManagerIn, new ModelPlayer(0.0F, true), 0.5F); thinArmsModel = (ModelPlayer)this.mainModel; thickArmsModel = new ModelPlayer(0.0F, false); // this.addLayer(new LayerBipedArmor(this)); this.addLayer(new LayerHeldItem(this)); this.addLayer(new LayerArrow(this)); this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); RenderPlayer k; RenderPigZombie j; }
@SubscribeEvent public void holding(RenderLivingEvent.Pre event) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer thePlayer = mc.player; ItemStack stack = thePlayer.getActiveItemStack(); if (!event.isCanceled() && event.getEntity().equals(thePlayer) && stack != null) { if (stack.getItem() instanceof ItemRangedWeapon) { ModelPlayer model = (ModelPlayer) event.getRenderer().getMainModel(); // TODO adapt for left/right handed model.rightArmPose = ArmPose.BOW_AND_ARROW; } } }
private static void registerAll(){ map = new HashMap<EnumNPCModel, ModelBase>(); registerItem(EnumNPCModel.Player, new ModelPlayer(0f, false)); registerItem(EnumNPCModel.Zombie, new ModelZombie()); registerItem(EnumNPCModel.Villager, new ModelVillager(0f)); registerItem(EnumNPCModel.Skeleton, new ModifiedModelSkeleton()); registerItem(EnumNPCModel.Creeper, new ModelCreeper()); registerItem(EnumNPCModel.Pig, new ModelPig(0f)); registerItem(EnumNPCModel.Cow, new ModelCow()); }
@SubscribeEvent public void holding(RenderLivingEvent.Pre event) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer thePlayer = mc.thePlayer; ItemStack stack = thePlayer.getCurrentEquippedItem(); if (!event.isCanceled() && event.entity.equals(thePlayer) && stack != null) { if (stack.getItem() instanceof ItemRangedWeapon) { ModelPlayer model = (ModelPlayer) event.renderer.getMainModel(); model.aimedBow = true; } } }
@SideOnly(Side.CLIENT) @SubscribeEvent public void handlePlayerRender_Post(RenderPlayerEvent.Post event) { ModelPlayer model = event.getRenderer().getMainModel(); setSubModelTextureSize_Main(model, 64, 64); setSubModelTextureSize_Cape(model, 64, 32); }
public static void render(ModelPlayer model, int color, EntityPlayer player, float partialTicks, boolean multiPass) { RenderManager rm = Minecraft.getMinecraft().getRenderManager(); rm.renderEntityStatic(player, partialTicks, false); //rm.doRenderEntity(player, player.posX, player.posY, player.posZ, player.cameraYaw, partialTicks, multiPass); }
public ModelPlayer getMainModel() { return (ModelPlayer)super.getMainModel(); }