Jump to content

Eternaldoom

Forge Modder
  • Posts

    592
  • Joined

  • Last visited

Everything posted by Eternaldoom

  1. The harvest levels are defined in the item's ToolMaterial. I think they are the first number. The ToolMaterials can be found in Item. Note that the diamond material is called emerald.
  2. I have a problem now. It renders correctly in the inventory, but often has a weird colored background. Any ideas how to fix this? Here is my Item Renderer code: public class ItemRendererCannon implements IItemRenderer{ public static RenderItem renderitem = new RenderItem(); @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { case EQUIPPED: return false; case EQUIPPED_FIRST_PERSON: return false; case ENTITY: return false; case INVENTORY: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type){ case EQUIPPED: break; case EQUIPPED_FIRST_PERSON: break; case ENTITY: break; case INVENTORY: Draw2D(item); break; default: break; } } public void Draw2D(ItemStack item){ IIcon icon = item.getItem().getIcon(item, 0); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); double minU1 = (double)icon.getMinU(); double minV1 = (double)icon.getMinV(); double maxU1 = (double)icon.getMaxU(); double maxV1 = (double)icon.getMaxV(); tessellator.addVertexWithUV(16.0, 16.0, 0.0, minU1, maxV1); tessellator.addVertexWithUV(16.0, 0.0, 0.0, maxU1, maxV1); tessellator.addVertexWithUV( 0.0, 0.0, 0.0, maxU1, minV1); tessellator.addVertexWithUV( 0.0, 16.0, 0.0, minU1, minV1); tessellator.draw(); } } There is a screenshot at https://cloud.githubusercontent.com/assets/6693944/4097725/b5ba9626-2fe0-11e4-91e3-952fcab11ca9.png Note the colored background of the items in the hotbar. Any idea how to fix this? It it caused by messing with the image vertices?
  3. Yes, use SubscribeEvent. It should be pretty similar with mobs.
  4. That worked thanks!
  5. You need to override applyEntityAttributes(). In that method, add this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(some speed);
  6. Get rid of the first Shape5.mirror=true in your model. Btw, does your mod have a github repo? I'd love to contribute
  7. I think you have to use some kind of terrain generation event.
  8. Use EnumChatFormatting.YOURCOLOR + "your string"
  9. https://github.com/Eternaldoom/Realms-of-Chaos/blob/master/com/eternaldoom/realmsofchaos/entity/projectile/EntityHeliotropeArrow.java. Basically I just copied and pasted the vanilla one and changed a few methods.
  10. Use src/main/java as a source folder instead of src.
  11. You mean right when you put on armor? I don't think there is an event for that, but it would be easy to detect.
  12. What part do you not understand? Also, post your code.
  13. After gradlew setupDecompWorkspace run gradlew eclipse. That generates the eclipse project files. That bootstrap class path warning is harmless, I get it all the time.
  14. Look at ModelBiped and the other Model classes. You can use Techne to model it and generate the code. The main problem would be making all of the texture offsets match the new skin layout.
  15. Make your own WorldGenFlowers class that accepts metadata as a parameter. Here is one you can copy and paste: public class ModWorldGenFlowers extends WorldGenerator { private Block flower; private int meta; public ModWorldGenFlowers(Block flower, int metadata) { this.flower = flower; this.meta = metadata; } public boolean generate(World world, Random rand, int i, int j, int k) { for (int var6 = 0; var6 < 64; ++var6) { int var7 = i + rand.nextInt( - rand.nextInt(; int var8 = j + rand.nextInt(4) - rand.nextInt(4); int var9 = k + rand.nextInt( - rand.nextInt(; if (world.isAirBlock(var7, var8, var9) && (!world.provider.hasNoSky || var8 < 255) && this.flower.canBlockStay(world, var7, var8, var9)) { world.setBlock(var7, var8, var9, this.flower, this.meta, 2); } } return true; } }
  16. I don't think that's possible since the Item's damage is actually stored in the ItemStack.
  17. Sorry, I can't seem to make the item stay still. There is probably a way to make the boat drop 5 planks, but I'm not sure how.
  18. Change y in your decorate method to world.getHeightValue(x, z) add the following to your decorate method: new WorldGenFlowers(ModBlocks.plasticFlower).generate(world, random, x, y, z);
  19. get rid of if(type == IItemRenderer.ItemRenderType.ENTITY)
  20. What are the addFlower and plantFlower functions? Are they in BiomeGenBase? If so, just use WorldGenFlowers to generate your flowers. And maybe move your world gen code to a class that implements IWorldGenerator.
  21. Try using a RenderPlayerEvent that checks to see what items are in the player's armor slots. It's probably event.renderer.modelArmor.
  22. Look at https://github.com/Eternaldoom/ChaosBeasts/blob/master/com/chaosmodders/chaosbeasts/items/rendering/ItemRendererLobsterStatue.java
  23. Use NBT data, sort of like a chest but on your item.
  24. Im pretty sure it's a searge name. Maybe look at CommandOp?
×
×
  • Create New...

Important Information

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