Jump to content

The_SlayerMC

Members
  • Posts

    209
  • Joined

  • Last visited

Everything posted by The_SlayerMC

  1. You're right! Ahaha i really should't have the static modifire.. and with the RenderGameOverlayEvent does it remove all the properties along with just the texture?
  2. The code from this in the model class: public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { setRotationAngles(f, f1, f2, f3, f4, f5, entity); part.render(f5); par1.render(f5); par3.render(f5); } make a new method: public void render(){ float r = 0.0625F; part.render(r); par1.render(r); par3.render(r); } and in the ItemRenderer class that you made float scale = 1.0F; GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 4.0F); switch(type){ case EQUIPPED: scale = 1.5F; GL11.glScalef(scale, scale, scale); GL11.glTranslatef(-0.6F, -1.0F, 0.4F); //Sets where the model is placed (you can mess around with this to suit you) break; case ENTITY: scale = 3.0F; GL11.glScalef(scale, scale, scale); GL11.glTranslatef(0.0F, -1.5F, 0.0F); break; case INVENTORY: scale = 0.8F; GL11.glScalef(scale, scale, scale); GL11.glTranslatef(0.0F, -0.5F, 0.0F); break; case EQUIPPED_FIRST_PERSON: scale = 1.5F; GL11.glScalef(scale, scale, scale); GL11.glTranslatef(0.0F, -1.0F, 0.4F); break; default: break; } new ModelYourBlock().render(); GL11.glPopMatrix(); the switch statement is from my item render code and it goes in this method: @Override public void renderItem(ItemRenderType type, ItemStack i, Object...data) That should be all you need
  3. You also need to render the model. For an item or a block model, i always make a new render(float r) method, then make all the model componates render it, make the r = 0.0652F (i think, thats just off my head) then call that method inside your item renderer
  4. I know how to render a new health GUI but I'm wondering how i would go about removing the current players health and adding my own. I'm assuming that it would have something to do with using IExtendedEntityProperties and this is what i have so far:
  5. Run configurations -> arguments -> program arguements -> Add the arguement: --username=YOUR USERNAME
  6. I do believe that 'Minecraft Comes Alive' is an open src mod, and their mod villages have an inventory very similar to the players one. You could always give that a look!
  7. Hey, this is another basic thing but since the 1.7.2 update, I've never really messed around with mobs and their stats. But i set the mobs speed to be faster than a zombie when using the attributes but their speed when walking towards you is really slow, ive tried boosting this double up but it doesn't change anything. If you need any code (even though its just the same as every other mob) just ask.
  8. They're all getting called when i attack the mob but nothing is happening still
  9. Actually, you're going to need a TileEntitySpecialRenderer and a IItemRenderer, if you have code already done, show us and ill help you, else i could help you anyway
  10. Hey, I know this is really REALLY simple and i'm ashamed for asking this but I had the mob working fine with the attacking system, same as a zombie pigman but without the group attacking you But I felt the code was really repetative so moved it into another Entity class so all mobs that work like that can extend it so i wont have the same code over and over again So I've extended the class with the exact code from the mob class, but it's not attacking anything after it gets attacked EntityPeacefullUntillAttacked And EntityDivineRPGMob if you wanted to see that class aswell As i stated before, this is really simple and probably me being blind to see the problem, but if anyone can help, that would be great
  11. Yeah, that's got nothing to do with it but thanks though
  12. Hey! Uhhh iv'e never had this problem before, but it started happening lately. But my game keeps crashing when i try to load a new world and this is the crash report: and this is the code thats causing it: I know the problem would be inside the generation files itself. But here is the dungeon file(I know its messy, but this is basically the only componant left to clean and rewrite) HERE it is with the rest of the code for anything else you would need Oh and something else to be noted, if I comment out the parts that say i crash with that line, it doest crash, it just doesn't let me into any world... *Sighhh* Any help would be great I can also put the generation code of any file into the onItemUse method in an item, and it generates fine without any problems
  13. This may sound newbish, but how would one register using the other method? I've always used that way!
  14. This is how: http://prntscr.com/3io2fg
  15. The crash reports already there
  16. Hello! I'm just wondering if there is a mob cap? I mean so you can only have a certain amount of mobs in one mod? Because i have plenty of mobs in a mod (more than i would care to count) and im getting a crash if i spawn a mob thats later down the list: CRASH But if i spawn a mob earlier in the tab, it works fine. So yeah, im assuming its got something to do with a entity cap
  17. @SubscribeEvent public void onPlayerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event){ }
  18. Never mind!! I fixed it using this: public void renderTick() { Minecraft mc = Minecraft.getMinecraft(); if(mc.currentScreen instanceof GuiChat) { GuiIngame gig = mc.ingameGUI; FontRenderer f = mc.fontRenderer; ScaledResolution s = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);; int h = s.getScaledHeight(); int w = s.getScaledWidth(); Long time = Long.valueOf(mc.theWorld.provider.getWorldTime()); String t = "TIME: " + formatTime(time); gig.drawString(f, t, w - f.getStringWidth(t) - 10, h - 20, 16777215); } } protected String getTime() { String time = ""; for (int j = 0; j < MinecraftServer.getServer().worldServers.length; j++) { time = StringUtils.ticksToElapsedTime((int)(MinecraftServer.getServer().worldServers[j].getWorldTime())); } return time; } public static String formatTime(Long time) { int hours24 = (int)(time.longValue() / 1000L + 6L) % 24; int hours = hours24 % 12; int minutes = (int)((float)time.longValue() / 16.666666F % 60.0F); String Time = String.format("%02d:%02d %s", new Object[] { Integer.valueOf(hours < 1 ? 12 : hours), Integer.valueOf(minutes), hours24 < 12 ? "AM" : "PM" }); return Time; } Took me a while, but i got it!
  19. I've currently got this: protected String getTime() { String time = ""; for (int j = 0; j < MinecraftServer.getServer().worldServers.length; j++) { time = StringUtils.ticksToElapsedTime((int)(MinecraftServer.getServer().worldServers[j].getWorldTime())); } return time; } Which is giving me this: http://prntscr.com/3fo3mv It seems to work well, but it isnt all that accurate. I type: "/time set 23000" which makes it 6:00AM (according to the MC wiki) but it says its 19:10
  20. Hey, I'm wondering how I get the actual time (in 12 hour time) like the clock, but text instead of a texture. For example, ingame the sun would just be rising, so it would be 7:00AM
  21. I just answered the same question here
  22. I just fixed it, you had ");{" on this line: if(player.inventory.hasItem(ModItems.CastrealmPickaxe) && StorageMiningLevel.get(player).GetLevel() < 5 && !given){ Maybe that will help
  23. You could try: @SubscribeEvent public void onPlayerUpdate(LivingUpdateEvent event) { if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)event.entityLiving; boolean given = false; if(player.inventory.hasItem(ModItems.CastrealmPickaxe) && StorageMiningLevel.get(player).GetLevel() < 5 && !given){ player.inventory.consumeInventoryItem(ModItems.CastrealmPickaxe); player.inventory.addItemStackToInventory(new ItemStack(Items.stick, 2)); player.inventory.addItemStackToInventory(new ItemStack(ModItems.CastrealmIngot, 3)); given = true; } } }
×
×
  • Create New...

Important Information

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