Jump to content

yooksi

Members
  • Posts

    112
  • Joined

  • Last visited

Everything posted by yooksi

  1. Any chance you're going to let us in on the secret if he indeed does contact you?
  2. No you will have to create that method yourself. Alright, good to know. Thanks.
  3. Yes I know, and I can do pretty much the same for HeldEquippment, but is there a specialized method for doing that? Something like InventoryPlayer#hasItemStack which tries to see if an ItemStack instance exits in player's inventory, except returning a boolean it would return an inventory slot position.
  4. Okay, two more additional problem: First: after checking the code, I see I don't actually have direct access to a EntityPlayer instance in the method that is handling the ItemStack in question, although I can remedy this by adding an additional argument to the method. Second: I don't know of an elegant way of finding the ItemStack instance in player's inventory. How would I go about solving the second problem in a most elegant fashion permissible by the newest version of Forge?
  5. That's exactly what I wanted to avoid, but guess in the end it's really no biggie. If that's the proper way of doing it, then that's the way I'll do it. Thanks for the info you two.
  6. I would like to change the item of an ItemStack passed as an argument in the ItemBlock#onUpdate method with another custom item instance. Why? Because I want to replace an item the player is holding in his main hand.
  7. Aren't models suppose to be registered in the pre-initialization phase? The way he was doing it, no. ModelLoader.customModelLocation, yes. Hm, okay, I don't know much about registering models that way. Isn't the use of ModelLoader.setCustomModelResourceLocation over getItemModelMesher().register recommended by Forge conventions? At least I recall reading about that more then once here.
  8. Aren't models suppose to be registered in the pre-initialization phase?
  9. Without knowing the content of the code on line 39, my best bet would be that one of these elements you are accessing are null: location or IceBlock1.
  10. On which line does the error occur? Please paste the content of that line of code. Providing a detailed error log would be nice too.
  11. Until now I've been using ItemStack#setItem to get this job done, but now that it's been recently deprecated, I don't know what to use. What is the best way of accomplishing this task in 1.10.2?
  12. Gimp handles hex values as well. You can copy and paste to that field. Didn't know that HTML notation was actually a hexadecimal value, that's great. Thanks.
  13. Alright, thanks. I think I will stick to the way I posted above, because I personally find it more readable then hex values. I can just open up Gimp, experiment with colours and copy RGB values, and if I were to use hex values I would need to constantly recalculate them.
  14. What exactly is a decimal colour code? I've found a reference to it here, but I still don't understand it. The way I am trying to do it at the moment (and it's working perfect) is like this: import java.awt.Color; Color color = new Color(36, 36, 155); int colorRGB = color.getRGB(); Why is it important to express them in a hex format, is there an advantage over decimal or is it just a matter of readability and convention?
  15. Does anyone know which colour value system Minecraft uses? I've tried entering a simple RGB value like this 171(red)36(green)36(blue) without the braces and info in it of course, just a plain number 1713636. Didn't seem to work. Any ideas?
  16. No. Registry name acquires a "modid:" prefix during its setting. Your bare string is missing that critical piece. My apologies, I did not see that I didn't include a prefix in there. Is it okay to use it if we include it, a string like this "modid:simple_item"?
  17. Can you explain that a bit more? If you would want for the players health to not exceed 5 hearts for example I thought you only need to change it once when the player enters the world.
  18. Is there a more simple way of doing it?
  19. I've tried to create more simple items and subtype them in a separate project and I've managed to make it work. Thank you everyone who contributed to this thread, it made it a lot easier. To help everyone else I've created a dedicated branch in my tutorial project for anyone who wants to learn how to do this. You can see the content of the branch here. Don't worry about additional changes that might come in the future, this link should always display the up-to-date content of the branch.
  20. I think you should have passed the registry name, not a static string. This is what I usually do, this was just a quickly written example. However, isn't it okay to use a string like that if you know the registry name for a fact? Java passes things by value, right? So there shouldn't be any problems from a technical perspective. What exactly are Blockstate variants and how would I go about learning more about them?
  21. That's really cool, which means I can create a bat file to act as a one button updater. Alright, that's what I wanted to know, thanks.
  22. I have the same problem and I think I've done everything this thread suggests. I am trying to register a simple bow that should have one subtype with a different texture. I believe I can just register a new item with a new class, but I would rather do it the right way. Registration in CommonProxy: SimpleItem simpleItem = new SimpleItem(); simpleItem.setUnlocalizedName("simple_item_0"); simpleItem.setRegistryName("simple_item_0"); GameRegistry.register(simpleItem); Registering model locations in ClientProxy: ModelLoader.setCustomModelResourceLocation(ModItems.SIMPLE_ITEM, 0, new ModelResourceLocation("simple_item_0")); ModelLoader.setCustomModelResourceLocation(ModItems.SIMPLE_ITEM, 1, new ModelResourceLocation("simple_item_1)); In SimpleItem class: @Override public String getUnlocalizedName(ItemStack stack) { return stack.getMetadata() == 0 ? "simple_item_0" : simple_item_1; } @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { subItems.add(new ItemStack(this, 1, 1)); } I've got two json files with names "simple_item_0" and "simple_item_1". The problem is that no matter what I change in the second json file (the subtype one) the item is always loaded with the texture set in the first json file. I've setup a recipe that is suppose to craft the subtype, but all I get is the original texture with the damage indicator over it in my inventory. The real class I have is not called like this and I've got things set a lot different, but this is an extrapolated version that should be sufficient for demonstrating my problem. And yes, setHasSubtypes(true) is set in the separate item constructor. It's late now and I am a bit tired so that's why I am definitely missing something, just can't figure out what it is. What's the correct way to do this step by step? Thank you in advance, this has been driving me insane for the last 3 hours.
  23. I don't use Eclipse, I don't know exactly how you refresh your project after updating. Does it work without running the eclipse task? I don't know, I've never tried. So far I've always played it safe and did EXACTLY as the Forge documentation says, and it says this:
  24. Don't run cleanCache , that deletes the entire Gradle cache; just run setupDecompWorkspace and then refresh your IDE project. For IDEA this can be done from the Gradle window, for Eclipse you may or may not need to re-run eclipse . Does this mean that gradlew eclipse is a redundant command in the updating process as well?
  25. I've got an updating question. What is the most conventional way to update Forge? The way I do it now is like this: gradlew cleancache gradlew setupDecompWorkspace gradlew eclipse
×
×
  • Create New...

Important Information

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