Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. This is probably why. Why are you doing this? int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(stack, playerIn, worldIn, pos); if (hook != 0) return hook > 0 ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
  2. According to the error you are sending a packet and it is erroring on this line https://github.com/tiffit/TaleCraft/blob/master/src/main/java/talecraft/network/packets/StringNBTCommandPacket.java#L34 With a index out of bounds exception as said in your log at line 1586.
  3. You wouldn't cause blocks are called from both sides. You must call it in your ClientProxy.
  4. Okay, I think this is the last problem. I created this new class, hold an instance of it in the ClientProxy, and just manually call ClientProxy.energyGui.draw() in the event you said above. The outline draws fine now and allows for movement, but the "inner" area (drawRect(...)) doesn't display at all. Would you happen to have any hunches off the top of your head? public class GuiEnergyBarTwo extends Gui { private int xSize = 116, ySize = 17; //size of desired window. Max is 256x256 public void draw(){ TextureManager textureManager = ClientProxy.MINECRAFT.getTextureManager(); textureManager.bindTexture(new ResourceLocation(Test.MODID + ":textures/gui/energybar.png")); GlStateManager.pushMatrix(); //---- inner ---- drawRect(0, 0, getRightCoord(), ySize - 1, 1); //---- outline ---- GlStateManager.enableAlpha(); drawTexturedModalRect(0, 0, 0, 0, xSize, ySize); GlStateManager.popMatrix(); } private int getRightCoord(){ int energyPercent = ClientProxy.clientInfo.getEnergyPercentage(); return xSize * (energyPercent/100); //this returns the needed percentage of the length of the rectangle } } Could you post ClientProxy.clientInfo.getEnergyPercentage();
  5. Most likely in the "toolTip.add()" while the "sneak" key is not pressed it could render "Press " localized.key.name or something, would make it more dynamic Also a localization call.
  6. Slight problem if I change my keybinding of sneaking to ctrl I would have to press ctrl instead of shift as the keybinding applies to different actions not individual keys. What? And only do what I said if the items are not yours, instead use the Item#addInformation(...)
  7. You would have to create and event and the easiest way to get if shift is down is to access the gui object in the Minecraft class.
  8. Have you taken a look at this? http://mcforge.readthedocs.io/en/latest/blockstates/forgeBlockstates/ ?? :'( yes but is missing the information i need. i need real example of using multiple layers in one model. There's more to it than just json. You also need to edit the java in specific way to return ModelLayer.SOLID && ModelLayer.TRANSPARENT something like that . Plus there's something where you can choose which part of the model renders on which layer which is not shown there. there's a part of the json where you can choose something like solid : "model.json" transparent: "water.json" blah blah. none of that is in there. I sortof figured all this myself but I never been successful at it. I just read about how MC renders transparency and I learned there are various layers and saw that forge can actually control which layer to render on based on an oldder forge model spec for version 1 it shows all the functions you can use but no actual example. Final resort if no documentation has been found look through the code that reads the json...yeah sounds like a wonderful idea huh?...I wish you the best of luck if you choose to go down that path.
  9. Have you taken a look at this? http://mcforge.readthedocs.io/en/latest/blockstates/forgeBlockstates/
  10. It is very hard to explain, but basically you have multiple planes overlapping which can be fixed by removing uneccesary planes from the model.
  11. Do you ever actually call ModelLoader.setCustomModelResourceLocation(...)
  12. ok but how to do that (i'm new to guis) Since it is an inventory create a class that extends GuiContainer and a class that extends Container. Then look at vanilla for examples on what the methods do. is this what do you mean? https://github.com/lukas2005/IDEA-Mod/commit/a83ad2a0b48764333f3095d67bca07328d5d04d9 Yes, but you actually need to put information ie slots, slot interaction, etc. You should look into vanilla classes for this.
  13. ok but how to do that (i'm new to guis) Since it is an inventory create a class that extends GuiContainer and a class that extends Container. Then look at vanilla for examples on what the methods do.
  14. Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.
  15. Ah yes, forgot that method existed (I need to go to sleep) . Also assuming that this is your armor this way.
  16. I suggest doing the PR and supplementary until it is implemented you could use PlayerTickEvent.
  17. With the way it is setup each Output has a percentage of appearing and to add a recipe you need to make a new List<OutputWrapper> and add new ItemWrappers to the list, then finally add the recipe using the list.
  18. There are multiple one being your custom methods for getting a recipe look in FurnaceRecipes and return that aswell as look into your own, add yours similarly to FurnaceRecipes, but to your Maps. Or you can add the furnace recipes by looping through them and adding them. Though that wouldn't give you random chance.
  19. I think the forge way of doing entity update cancelation/management would be to use the event canUpdate for all entites deciding if they can update. For only living entities yse LivingUpdateEvent and if they are not supposed to update cancel it.
  20. I think it is quite obvious A Map of ItemStacks and ItemStack arrays and then a map of ItemStack and either integers or floats/doubles.
  21. In preInit event has a Configuration object for your mod that is what you will use to create a config. do you mean FMLPreInitializationEvent#getSuggestedConfigurationFile()? Yes and then i can use normal JavaIO? and configuration file syntax is created by me? or is there a recommended way of doing this? Look into the Configuration methods all syntax/format is defined by it. You have almost no say.
  22. In preInit event has a Configuration object for your mod that is what you will use to create a config. do you mean FMLPreInitializationEvent#getSuggestedConfigurationFile()? Yes
×
×
  • Create New...

Important Information

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