@SideOnly(Side.CLIENT) @Override public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (!Arrays.asList(contributors.uuid).contains(entitylivingbaseIn.getUniqueID().toString())) return; if (!entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE)) return; GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.disableCull(); RenderHelper.disableStandardItemLighting(); if (Minecraft.isAmbientOcclusionEnabled()) { GlStateManager.shadeModel(GL11.GL_SMOOTH); } else { GlStateManager.shadeModel(GL11.GL_FLAT); } GlStateManager.translate(0, -0.015f, 0); if (!entitylivingbaseIn.inventory.armorInventory.get(3).isEmpty()) GlStateManager.translate(0, -0.02f, 0); if (entitylivingbaseIn.isSneaking()) GlStateManager.translate(0, 0.27, 0); GlStateManager.rotate(90, 0, 1, 0); GlStateManager.rotate(180, 1, 0, 0); GlStateManager.rotate(netHeadYaw, 0, -1, 0); GlStateManager.rotate(headPitch, 0, 0, -1); Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); Calendar calendar = Calendar.getInstance(); if (calendar.get(Calendar.MONTH) == Calendar.OCTOBER) { spookyScarySkeletons(); } else if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER) { itsSnowyHere(); } else { Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(ClientProxy.ears_baked, 0.5f, 255, 255, 255); } RenderHelper.enableStandardItemLighting(); GlStateManager.depthMask(true); GlStateManager.popMatrix(); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { int i = 0; this.title = I18n.format("options.skinCustomisation.title", new Object[0]); for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) { this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, enumplayermodelparts)); ++i; } if (i % 2 == 1) { ++i; } this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done", new Object[0]))); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentScreen); } else if (button instanceof GuiCustomizeSkin.ButtonPart) { EnumPlayerModelParts enumplayermodelparts = ((GuiCustomizeSkin.ButtonPart)button).playerModelParts; this.mc.gameSettings.switchModelPartEnabled(enumplayermodelparts); button.displayString = this.func_175358_a(enumplayermodelparts); } } }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { int i = 0; this.title = I18n.format("options.skinCustomisation.title", new Object[0]); for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) { this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, enumplayermodelparts)); ++i; } this.buttonList.add(new GuiOptionButton(199, this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), GameSettings.Options.MAIN_HAND, this.mc.gameSettings.getKeyBinding(GameSettings.Options.MAIN_HAND))); ++i; if (i % 2 == 1) { ++i; } this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done", new Object[0]))); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentScreen); } else if (button.id == 199) { this.mc.gameSettings.setOptionValue(GameSettings.Options.MAIN_HAND, 1); button.displayString = this.mc.gameSettings.getKeyBinding(GameSettings.Options.MAIN_HAND); this.mc.gameSettings.sendSettingsToServer(); } else if (button instanceof GuiCustomizeSkin.ButtonPart) { EnumPlayerModelParts enumplayermodelparts = ((GuiCustomizeSkin.ButtonPart)button).playerModelParts; this.mc.gameSettings.switchModelPartEnabled(enumplayermodelparts); button.displayString = this.getMessage(enumplayermodelparts); } } }
@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(); }
protected void rotateCorpse(T bat, float p_77043_2_, float p_77043_3_, float partialTicks) { GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); if (bat.deathTime > 0) { float f = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F; f = MathHelper.sqrt_float(f); if (f > 1.0F) { f = 1.0F; } GlStateManager.rotate(f * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F); } else { String s = EnumChatFormatting.getTextWithoutFormattingCodes(bat.getName()); if (s != null && (s.equals("Dinnerbone") || s.equals("Grumm")) && (!(bat instanceof EntityPlayer) || ((EntityPlayer)bat).isWearing(EnumPlayerModelParts.CAPE))) { GlStateManager.translate(0.0F, bat.height + 0.1F, 0.0F); GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); } } }
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { if (entitylivingbaseIn.hasPlayerInfo() && !entitylivingbaseIn.isInvisible() && entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE) && entitylivingbaseIn.getLocationCape() != null) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.playerRenderer.bindTexture(entitylivingbaseIn.getLocationCape()); GlStateManager.pushMatrix(); GlStateManager.translate(0.0F, 0.0F, 0.125F); double d0 = entitylivingbaseIn.prevChasingPosX + (entitylivingbaseIn.chasingPosX - entitylivingbaseIn.prevChasingPosX) * (double)partialTicks - (entitylivingbaseIn.prevPosX + (entitylivingbaseIn.posX - entitylivingbaseIn.prevPosX) * (double)partialTicks); double d1 = entitylivingbaseIn.prevChasingPosY + (entitylivingbaseIn.chasingPosY - entitylivingbaseIn.prevChasingPosY) * (double)partialTicks - (entitylivingbaseIn.prevPosY + (entitylivingbaseIn.posY - entitylivingbaseIn.prevPosY) * (double)partialTicks); double d2 = entitylivingbaseIn.prevChasingPosZ + (entitylivingbaseIn.chasingPosZ - entitylivingbaseIn.prevChasingPosZ) * (double)partialTicks - (entitylivingbaseIn.prevPosZ + (entitylivingbaseIn.posZ - entitylivingbaseIn.prevPosZ) * (double)partialTicks); float f = entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks; double d3 = (double)MathHelper.sin(f * (float)Math.PI / 180.0F); double d4 = (double)(-MathHelper.cos(f * (float)Math.PI / 180.0F)); float f1 = (float)d1 * 10.0F; f1 = MathHelper.clamp_float(f1, -6.0F, 32.0F); float f2 = (float)(d0 * d3 + d2 * d4) * 100.0F; float f3 = (float)(d0 * d4 - d2 * d3) * 100.0F; if (f2 < 0.0F) { f2 = 0.0F; } float f4 = entitylivingbaseIn.prevCameraYaw + (entitylivingbaseIn.cameraYaw - entitylivingbaseIn.prevCameraYaw) * partialTicks; f1 = f1 + MathHelper.sin((entitylivingbaseIn.prevDistanceWalkedModified + (entitylivingbaseIn.distanceWalkedModified - entitylivingbaseIn.prevDistanceWalkedModified) * partialTicks) * 6.0F) * 32.0F * f4; if (entitylivingbaseIn.isSneaking()) { f1 += 25.0F; } GlStateManager.rotate(6.0F + f2 / 2.0F + f1, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(f3 / 2.0F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(-f3 / 2.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); this.playerRenderer.getMainModel().renderCape(0.0625F); GlStateManager.popMatrix(); } }
/** * Send a client info packet with settings information to the server */ public void sendSettingsToServer() { if (this.mc.thePlayer != null) { int i = 0; for (EnumPlayerModelParts enumplayermodelparts : this.setModelParts) { i |= enumplayermodelparts.getPartMask(); } this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, i)); } }
public void setModelPartEnabled(EnumPlayerModelParts p_178878_1_, boolean p_178878_2_) { if (p_178878_2_) { this.setModelParts.add(p_178878_1_); } else { this.setModelParts.remove(p_178878_1_); } this.sendSettingsToServer(); }
public void switchModelPartEnabled(EnumPlayerModelParts p_178877_1_) { if (!this.getModelParts().contains(p_178877_1_)) { this.setModelParts.add(p_178877_1_); } else { this.setModelParts.remove(p_178877_1_); } this.sendSettingsToServer(); }
private String func_175358_a(EnumPlayerModelParts playerModelParts) { String s; if (this.mc.gameSettings.getModelParts().contains(playerModelParts)) { s = I18n.format("options.on", new Object[0]); } else { s = I18n.format("options.off", new Object[0]); } return playerModelParts.func_179326_d().getFormattedText() + ": " + s; }
@Override public void onDisable() { wurst.events.remove(UpdateListener.class, this); for(EnumPlayerModelParts part : EnumPlayerModelParts.values()) mc.gameSettings.setModelPartEnabled(part, true); }
@Override public void onUpdate() { if(random.nextInt(4) != 0) return; Set activeParts = mc.gameSettings.getModelParts(); for(EnumPlayerModelParts part : EnumPlayerModelParts.values()) mc.gameSettings.setModelPartEnabled(part, !activeParts.contains(part)); }
/** * Send a client info packet with settings information to the server */ public void sendSettingsToServer() { if (this.mc.thePlayer != null) { int i = 0; for (Object enumplayermodelparts : this.setModelParts) { i |= ((EnumPlayerModelParts)enumplayermodelparts).getPartMask(); } this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, i)); } }
/** * Send a client info packet with settings information to the server */ public void sendSettingsToServer() { if (this.mc.thePlayer != null) { int i = 0; for (Object enumplayermodelparts : this.setModelParts) { i |= ((EnumPlayerModelParts) enumplayermodelparts).getPartMask(); } this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, i)); } }
@Override public boolean isWearing(EnumPlayerModelParts part) { if (m_realPlayer == null) { return super.isWearing(part); } else { syncToRealPlayer(); return m_realPlayer.isWearing(part); } }
@Override public boolean isWearing(EnumPlayerModelParts part) { if (m_realPlayer == null) { return super.isWearing(part); } else { return m_realPlayer.isWearing(part); } }
protected void rotateCorpse(T entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) { GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); if (entityLiving.deathTime > 0) { float f = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F; f = MathHelper.sqrt(f); if (f > 1.0F) { f = 1.0F; } GlStateManager.rotate(f * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F); } else { String s = TextFormatting.getTextWithoutFormattingCodes(entityLiving.getName()); if (s != null && ("Dinnerbone".equals(s) || "Grumm".equals(s)) && (!(entityLiving instanceof EntityPlayer) || ((EntityPlayer)entityLiving).isWearing(EnumPlayerModelParts.CAPE))) { GlStateManager.translate(0.0F, entityLiving.height + 0.1F, 0.0F); GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); } } }
/** * Send a client info packet with settings information to the server */ public void sendSettingsToServer() { if (this.mc.player != null) { int i = 0; for (EnumPlayerModelParts enumplayermodelparts : this.setModelParts) { i |= enumplayermodelparts.getPartMask(); } this.mc.player.connection.sendPacket(new CPacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, i, this.mainHand)); } }
public void setModelPartEnabled(EnumPlayerModelParts modelPart, boolean enable) { if (enable) { this.setModelParts.add(modelPart); } else { this.setModelParts.remove(modelPart); } this.sendSettingsToServer(); }
public void switchModelPartEnabled(EnumPlayerModelParts modelPart) { if (this.getModelParts().contains(modelPart)) { this.setModelParts.remove(modelPart); } else { this.setModelParts.add(modelPart); } this.sendSettingsToServer(); }
private String getMessage(EnumPlayerModelParts playerModelParts) { String s; if (this.mc.gameSettings.getModelParts().contains(playerModelParts)) { s = I18n.format("options.on", new Object[0]); } else { s = I18n.format("options.off", new Object[0]); } return playerModelParts.getName().getFormattedText() + ": " + s; }
protected void rotateCorpse(T entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) { GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); if (entityLiving.deathTime > 0) { float f = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F; f = MathHelper.sqrt_float(f); if (f > 1.0F) { f = 1.0F; } GlStateManager.rotate(f * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F); } else { String s = TextFormatting.getTextWithoutFormattingCodes(entityLiving.getName()); if (s != null && ("Dinnerbone".equals(s) || "Grumm".equals(s)) && (!(entityLiving instanceof EntityPlayer) || ((EntityPlayer)entityLiving).isWearing(EnumPlayerModelParts.CAPE))) { GlStateManager.translate(0.0F, entityLiving.height + 0.1F, 0.0F); GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); } } }