Jump to content

MultiMote

Forge Modder
  • Posts

    257
  • Joined

  • Last visited

Everything posted by MultiMote

  1. Removing TileEntity has no effect. You should remove the block. ...or find the way to prevent generation.
  2. Extend GuiButton and override function public void func_146113_a(SoundHandler p_146113_1_) { p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); }
  3. For zoom you can use FOVUpdateEvent or set the value of private variable EntityRenderer.cameraZoom using reflection.
  4. Or k = ((EntityLivingBase) event.entity).getRNG().nextInt(4);
  5. Add default constructor to your TileEntity.
  6. Use events. @SideOnly(Side.CLIENT) @SubscribeEvent public void openGui(GuiOpenEvent event) { if (event.gui instanceof GuiMainMenu) { event.gui = new AwesomeMainMenu(); } }
  7. Use ScaledResolution ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); int width = scaledresolution.getScaledWidth(); int height = scaledresolution.getScaledHeight();
  8. Don't use RenderHelper for ENTITY render type.
  9. Use any html color generator. This, for example.
  10. http://up42.ru/u/p/___________________2014-08-15_17_36_32.png[/img] http://up42.ru/u/p/___________________2014-08-15_17_36_40.png[/img] http://up42.ru/u/p/___________________2014-08-15_17_37_081.png[/img] http://up42.ru/u/p/___________________2014-08-15_17_37_39.png[/img] http://up42.ru/u/p/___________________2014-08-15_17_40_28.png[/img] http://up42.ru/u/p/___________________2014-08-15_17_40_47.png[/img] http://up42.ru/u/p/___________________2014-08-15_17_41_06.png[/img]
  11. You don't need to cancel EntityConstructing event.
  12. Maybe something like this? protected void keyTyped(char par1, int par2) { this.text.textboxKeyTyped(par1, par2); if(!( par2== Keyboard.KEY_E && this.text.isFocused())) super.keyTyped(par1, par2); }
  13. I mean closing gui. For number-only textfield... um... you can look at my spinner code https://gist.github.com/MultiMote/479db07ec89ce675c5a6
  14. private GuiTextField text; public void initGui() { this.text = new GuiTextField(this.fontRendererObj, this.width / 2 - 68, this.height/2-46, 137, 20); text.setMaxStringLength(23); text.setText("sample text"); this.text.setFocused(true); } protected void keyTyped(char par1, int par2) { super.keyTyped(par1, par2); this.text.textboxKeyTyped(par1, par2); } public void updateScreen() { super.updateScreen(); this.text.updateCursorCounter(); } public void drawScreen(int par1, int par2, float par3) { this.drawDefaultBackground(); this.text.drawTextBox(); super.drawScreen(par1, par2, par3); } protected void mouseClicked(int x, int y, int btn) { super.mouseClicked(x, y, btn); this.text.mouseClicked(x, y, btn); }
  15. EntityEvent.EntityConstructing or EntityJoinWorldEvent
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.