Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. java.util.Optional was added in Java 8. If you're targeting an earlier version of Java (the default set by ForgeGradle is Java 6, the same as Minecraft), you can't use it since it won't be present in that version. You could use com.google.common.base.Optional (from Guava) as an alternative, but my updated bow doesn't actually use Optional at all. nockArrow now returns an ActionResult<ItemStack> like Item#onItemRightClick . You can see the updated code here, but the bows and other projectile launchers are still a WIP.
  2. Always post the crash report when asking for help with a crash.
  3. Override Item#getColorFromItemStack . If your model inherits from builtin/generated , the renderPass argument of this method is the texture index (i.e. the layer0 texture is renderPass 0). If your model inherits from a different model or manually specifies its elements, the renderPass argument is the tintindex property of an element's face (look at assets/minecraft/models/block/grass.json to see how it specifies the tintindex property for the face that uses a greyscale texture).
  4. This is not true. When called on the server side, EntityPlayer#openGUI sends a packet to the player's client that opens the appropriate GuiScreen . Calling it on the client side will open the GuiScreen , but this will be replaced as soon as the packet is received from the server.
  5. Ok, so is better if inside Container#detectAndSendChanges I get the message from the tile (if it is changed) and send it to crafter (checking if is a player) ? Yes, that should work.
  6. Container#crafters is a list of ICrafting objects, it may contain implementations of ICrafting other than EntityPlayerMP . It's not safe to cast to EntityPlayerMP without checking. Every player with the GUI open will have their own Container on the client and server, so Container#crafters will usually contain 0 players on the client and 1 player on the server. Your TileEntity shouldn't interact with your Container directly, it certainly shouldn't be storing an instance of it.
  7. This should probably be done from your override of Container#detectAndSendChanges . Look at how ContainerFurnace uses this to send progress updates for the burn/cook time.
  8. Pull Request. You can see the guidelines for contributing to Forge here. It looks like Lex just made this change himself, so there's no need for a PR now.
  9. @NetworkCheckHandler is probably what you want.
  10. The class name you specified for the client proxy in your @SidedProxy annotation doesn't exist. Make sure the package and class name specified in the annotation are exactly the same as the actual class.
  11. I'm not sure exactly what your issue is, but I do see some potential problems in your code: Render classes are generic in 1.8.8+, so don't use raw types ( RenderTerrakon should extend RenderLiving<EntityTerrakon> instead of RenderLiving ) Always use the @Override annotation on override methods
  12. You can tell Gradle to compile your code with Java 8 compatibility by adding these two lines to build.gradle. You may still need to set the compatibility level of your IDE project manually. Compiling a mod with Java 8 compatibility shouldn't interfere with any other mods.
  13. It looks like a Pneumatic Tube is throwing an error while trying to insert into a Buffer. I suggest you report this to the BluePower author(s). In the meantime, either restore from a backup or use something like MCEdit/NBTExplorer to remove the Multipart block (containing a Pneumatic Tube) at 833, 60, -262.
  14. I suggest looking at Forge's patch to EntityFishHook#getFishingResult to see how it uses the Lure and Luck of the Sea enchantment levels to determine which loot category to select from.
  15. Try overriding TileEntitySpecialRenderer#func_181055_a ( isGlobal in 1.9) to return true like TileEntityBeaconRenderer does.
  16. I never told you to use the assignment ( = ) operator or create a new ItemStack . To check the Item and metadata of an ItemStack , you need to do three things: Check that the ItemStack isn't null Check that the return value of ItemStack#getItem is equal to ( == ) the right Item Check that the return value of ItemStack#getMetadata is equal to ( == ) the right metadata Do not call either overload of Item#getMetadata yourself. Item#getMetadata(int) is used to determine the block metadata to place, Item#getMetadata(ItemStack) is used by ItemStack#getMetadata to determine the stack's metadata.
  17. Looking at TileEntityBeaconRenderer , I think you need to override TileEntitySpecialRenderer#isGlobalRenderer to return true .
  18. If an inventory slot is empty, IInventory#getStackInSlot will return null . You need to check that the returned ItemStack isn't null before you can safely call methods on it.
  19. Dependencies are never shaded (included in your JAR) by default, you always need to specify that they should be. For CodeChickenLib, I'd recommend have it auto-download like ChickenBones does: Include the DepLoader class from CodeChickenCore in your code, call it from an IFMLLoadingPlugin specified in your manifest and include a dependencies.info file that specifies CodeChickenLib as a dependency. For examples, search GitHub for DepLoader and limit the search to Java code. For Mantle, don't shade it all. Tinkers' Construct doesn't include it, neither should you. For MySQL Connector, you can shade it using this technique or using a proper shading plugin like shadow.
  20. IChatComponent became ITextComponent , ChatComponentText became TextComponentString . Every other ChatComponent was also renamed to TextComponent .
  21. This is a basic Java error. == checks reference equality, i.e. whether the operands are the same object. An ItemStack from an inventory will never be the same object as an ItemStack you just created. Some classes override Object#equals to check value equality, i.e. whether the two operands represent the same value. ItemStack does not do this, so itemStack1.equals(itemStack2) still checks reference equality. You need to get the Item and metadata from the ItemStack using the appropriate getter methods and compare those to the values you want to check. If you already had two ItemStack s and wanted to check if they were equal, the ItemStack class provides several static and non-static methods to check various forms of equality (e.g. Item and metadata; Item , metadata and NBT). In general, you shouldn't call these if you have to create the second ItemStack at the time of the call. Don't bump your threads. It will only annoy the people who can help you, it won't hasten their response.
  22. Skulls are rendered using TileEntitySkullRenderer both as blocks in the world and items in inventories. This uses the texture of the skull's entity type, so overriding that with a resource pack should change the texture of the entity and its skull. How did you manage to change the model and texture of the block form but not the item form?
  23. The bug being mentioned is this one, which states that chests opening with slabs, stairs, etc over them is a bug. And while Mojang says its not a bug, Lex, not wanting to do more coding work than needed, is deciding to treat it as a bug. So this means Forge will continue to make it so chests cannot be opened when slabs, stairs, etc are over them. But as Lex mentioned in this thread, chests are only supposed to check if the bottom of the block is solid. Placing a slab in the upper half of a block or upside-down stairs shouldn't prevent chests from opening.
  24. I believe this is intentional, see this thread and the threads linked in it.
  25. MCP data from ForgeGradle 2.x (Minecraft 1.8+) workspaces can be found in ~/.gradle/caches/minecraft/de/oceanlabs/mcp/<mappings_channel>/<mappings_version> (replace ~ with %USERPROFILE% on Windows).
×
×
  • Create New...

Important Information

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