Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. As far as I can see, there's no specific Entity method that's called when the entity is unloaded. Entity#setDead will be called, but that's also called any other time the entity is killed/removed (e.g. if it falls out of the world or is killed with /kill ). Is there a specific reason you need this?
  2. One of your mods has added an item ( WeightedRandomChestContent ) to the loot table for the dungeon chest with the minimum quantity set higher than the maximum quantity. You'll have to remove any mods that add dungeon loot one-by-one until you can find the one causing the issue. You could use an IDE's debugger to find the item with the invalid values, but that won't be very easy to do unless you have programming experience.
  3. PART is a PropertyEnum of EnumPartType , but you're trying to assign an int value to it ( this.part ).
  4. If you look at the stacktrace, it's being called from PlayerControllerMP#onPlayerDestroyBlock ; so it's likely the block's breaking sound that's causing the issue. Updating ForgeGradle or following my previous debugging instructions should provide further information as to what the issue is.
  5. RenderGlobal#playAusSFX (called from World#playAuxSFXAtEntity ) is throwing an exception, but a NullPointerException was thrown while generating the crash report. Put a breakpoint in the catch block of World#playAuxSFXAtEntity and run Minecraft in debug mode. When it hits the breakpoint, the throwable variable will contain the exception that was thrown.
  6. 3.4028235E37F is equivalent to Float.MAX_VALUE / 10 , so multiplying it by 10.0F produces Float.MAX_VALUE . Anything larger than that would overflow. I'm not entirely sure why it's multiplied by 10 before rounding to an integer or why it doesn't use a double instead of a float to store the pre-rounded value.
  7. I meant post the crash report, though having the code on Gist makes it a bit easier to read. The exception type and stack trace should tell you what went wrong even if the message doesn't.
  8. The crash report should tell you exactly what went wrong. If you can't figure it out, upload it to Gist and link it here.
  9. To store multiple values in your metadata, you need to use bitwise operations to combine the values into a single integer. The problem here is that metadata is restricted to 4 bits, but the 10 possible values of EnumRailDirection require 4 bits to store and the 3 possible values of EnumPartType require 2 bits to store. This means that you can't store both values in the metadata, you may need to store the PART property in your TileEntity instead. You can still have it as a property of the BlockState (and thus decide the model based on its value), just override Block#getActualState to return an IBlockState with the PART property's value retrieved from the TileEntity at the provided location. Look at BlockFlowerPot for an example of an enum property stored in a TileEntity instead of the metadata. Edit: I didn't realise you were using separate instances. Either use separate instances or store the PART property in the TileEntity . Like GotoLink said, there's no need to do both.
  10. Do you understand how the code works? You have an instance of your ItemQuinqueCase class stored in a static field of some class (e.g. TokyoGhoulMod or ModItems ), return a new ItemStack of this Item instance from ItemQuinqueDoujima#onItemRightClick . Do the same in ItemQuinqueCase#onItemRightClick , except return an ItemStack of the sword instead of the case. You don't need the ItemQuinqueCase field if the result of the swap is hardcoded, I just used that to demonstrate two items that use the same class swapping to each other.
  11. If the model's shape is working, it's an issue with the texture being invalid or missing. If the block is appearing as a cube, it's an issue with the model being invalid or missing. Which is it? If you're using the vanilla blockstates format, you need to define the model for every possible combination of property values. The ones that are listed as missing are the ones you haven't defined a model for. You can also use Forge's blockstates format, which lets you specify how each value affects the model instead of defining the model for every combination of values.
  12. Override Item#onItemRightClick to check if the player is sneaking ( Entity#isSneaking ). If they are, return an ItemStack of the other Item ; else return the result of the super method. You can see a basic example of this here.
  13. There should be some errors in the log telling you what went wrong. The Grey Ghost has a guide to troubleshooting block and item rendering here.
  14. Yes. I'd recommend creating a separate class each for your blocks and items and using those classes to instantiate, register and store your Block / Item instances. You can see an example of what I'm talking about here. You should keep the registration out of the constructor, that way you can more easily use the same class for multiple block/item types.
  15. You've created a recipe for an ItemStack with a null Item . This is because you've registered your recipes before instantiating and registering your blocks. You should instantiate and register your items and blocks in preInit (don't instantiate them in field initialisers) and then add recipes in init.
  16. Forge's Blockstates format can reduce the number of individual models you need to write.
  17. RenderingRegistry.addNewArmourRendererPrefix is an alternative to overriding Item#getArmorTexture . You can call it with the prefix of your textures and pass the returned int to the ItemArmor constructor so it's assigned to the ItemArmor#renderIndex field, the prefix will then be used for your item's armour texture. Look at RenderBiped.getArmorResource to see how it's used. I didn't know about this beforehand, I just used my IDE to look at the source of RenderingRegistry.addNewArmourRendererPrefix and find usages of the array it populates. You're better off overriding Item#getArmorTexture instead of using RenderingRegistry.addNewArmourRendererPrefix , since the former allows you to specify the resource domain of your textures instead of requiring them to be in the minecraft domain.
  18. You're calling a method ( RenderingRegistry.addNewArmourRendererPrefix ) that references a client-only class ( RenderBiped ) on the server. All rendering-related stuff should only be registered from your client proxy, that way it's only called on the client. In your base proxy type, create a method called something like init or registerRenderers (the name doesn't really matter) and then override it in your client proxy to call RenderingRegistry.addNewArmourRendererPrefix and any other client-only stuff that should be called in the same phase. Call this method on your proxy instance from your FMLInitializationEvent method (i.e. MainRegistry.load ).
  19. To get the source code from a built mod, you'll have to use BON or BON2 to deobfuscate the mod and then use a Java decompiler to decompile it into source code. I list some decompilers and explain how to use BON in this thread. Keep in mind that most closed source licenses don't allow you to use the code in your own mod.
  20. You've done something wrong. Post the latest versions of the ItemHSteelHelmet and HSteelArmor classes. Every item class must directly or indirectly extend Item . The inheritance chain for your armour classes should be something like ItemHSteelHelmet -> HSteelArmor -> ItemArmor -> Item (where -> means "extends from").
  21. There are two types of events in Forge: Events that extend FMLEvent and are handled by a method with the @Mod.EventHandler annotation in your @Mod class (e.g. FMLPreInitializationEvent , FMLMissingMappingsEvent ) Events that extend Event and are handled by a method with the @SubscribeEvent annotation in a class registered on the appropriate event bus (e.g. BlockEvent.HarvestDropsEvent , PlayerEvent.ItemSmeltedEvent ) You're trying to handle an FMLEvent like it's an Event .
  22. ItemHSteelHelmet , etc. should extend HSteelArmor instead of extending ItemArmor . This is what diesieben07 is telling you. If you look at line 236 of CraftingManager , you'll see that it's calling ItemStack#copy on the result of HashMap#get (the HashMap maps each character to its corresponding ingredient ItemStack ); get is returning null , causing the exception. This means that you passed null as an ingredient to GameRegistry.addRecipe on line 124 of MainRegistry . You should instantiate and register your items/blocks in preInit and add recipes in init. You shouldn't be doing anything in the constructor of your main class.
  23. If you look at the usages of the playerLocation field you'll see it's only used for sleeping, it's not usually set to the player's current position. To get an Entity 's position as a BlockPos , use Entity#getPosition or the BlockPos(Entity) constructor.
  24. setTextureName is the deobfuscated (MCP) name of the method, which is only used in the development environment. In the normal client, it has an obfuscated (SRG) name instead. You need to build your mod using the build Gradle task (either from the command line or IDEA's Gradle window), this compiles and reobfuscates the mod so it uses SRG names instead of MCP names. The built mod will be in the build/libs folder of your project.
  25. Custom Main Menu is the mod causing the crash. Mods will usually say on their download page if they're client-only.
×
×
  • Create New...

Important Information

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