Jump to content

Choonster

Moderators
  • Posts

    5125
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. Have you tried opening a copy of your world in 1.8.9 to see if anything breaks? Some 1.8 mods may work in 1.8.9.
  2. Check if the hurt entity is a player. If it is, cast it to EntityPlayer and then check if it's wearing your armour. If you want the effect to apply to any living entity wearing the armour rather than just players, skip the player check and use EntityLivingBase#getEquipmentInSlot to check the armour.
  3. Where are you getting player from? You must get all data from the event itself. LivingHurtEvent#entityLiving is the entity that was hurt. LivingHurtEvent#source is the DamageSource that caused the damage. DamageSource#getEntity will get the Entity that caused the damage, if any (this will be null if the damage wasn't caused by an entity).
  4. Read the tutorial properly, event handler methods can only have a single argument (the event that they handle).
  5. I'm trying to test the new capability system by adding a pig spawner capability that allows items to spawn a pig when right clicked on a block. There are two types of spawner: finite (has charges that are used up when spawning pigs, pigs can't be spawned if there aren't any charges left) and infinite (can always spawn pigs). I've got the actual spawning of pigs working without issue, but now I'm trying to sync the remaining charges of finite pig spawners to the client so that they can be used in rendering (e.g. use the durability/damage bar to display the remaining charge percentage). On the integrated server, the charges seem to be synced to the client thread automatically (even though the client and server have their own ItemStack s and IPigSpawner instances). On the dedicated server, the charges aren't synced to the client. Even when I send a packet to update the value from PlayerInteractEvent (where I handle the spawning), it seems that the slot is overwritten by S2FPacketSetSlot afterwards. Has anyone managed to get something like this working? Logs (everything marked with PIG_SPAWNER is from pig spawner code) Code: Interfaces, Implementations and Capability, Message
  6. Use OreDictionary.WILDCARD_VALUE as the metadata value of a recipe ingredient to ignore metadata.
  7. Loot++ is failing to read its config file and one of your mods has an invalid sounds.json file (the log doesn't say which), but it doesn't look like those are actually stopping the game from working. Can you upload your full FML log (logs/fml-client-latest.log) to Gist and link it here? In future, please use [nobbc]
  8. Specifying the dependency like that only works if the mod is accessible through a Maven/Ivy repository, which you need to add in the repositories block of build.gradle. To my knowledge Baubles isn't hosted in a public Maven repository, but you can access CurseForge downloads through Ivy. Unfortunately it looks like deobfCompile doesn't work with Ivy or local dependencies (the linked issue also shows how to access CurseForge downloads through Ivy). I think your best bet at this point is to download and compile Baubles yourself or deobfuscate it with BON2. Baubles 1.1.3.0 is built for 1.8.9 and may or may not work in 1.8.
  9. For 1.8 and earlier, you can only use deobfuscated/dev builds of mods in the development environment. ForgeGradle can deobfuscate a mod if you add it as a deobfCompile or deobfProvided dependency (see the MDK's build.gradle for examples). In 1.8.9, FML can deobfuscate mods at runtime; allowing you to use regular mods in the development environment.
  10. Look at the various blocks that use PropertyDirection or extend BlockDirectional . Most of them override Block#onBlockPlaced to set their facing property to the opposite of the player's facing (so it faces the player).
  11. FML only calls @EventHandler methods in your @Mod class. Remove the annotation and argument from Recipes.init (neither are needed) and call it from your @Mod class. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page. It's much easier to read code with proper formatting and syntax highlighting.
  12. The src download was renamed to MDK (Mod Development Kit) because it hasn't actually included any source code for a while. This tutorial explains how to set up a development workspace for modern versions of Forge. Once you've set up your workspace and IDE project, you can view the source of Minecraft and Forge classes in your IDE.
  13. You need to refresh your project from IDEA's Gradle window after running setupDecompWorkspace for a new version.
  14. Add it as a dependency through Gradle instead of your IDE, ForgeGradle will add it as a referenced library in your IDE project. These links in the MDK's build.gradle script explain Gradle's dependency system.
  15. Container#inventoryItemStacks is just a cache that stores a copy of the container's contents. To modify the inventory itself you need to iterate through the container's slots ( Container#inventorySlots ), copy the stack in each slot ( Slot#getStack , ItemStack#copy ), modify the copy and then replace the slot's stack with the copy ( Slot#putStack ). Don't directly modify the stack returned from Slot#getStack as the slot may be backed by an IItemHandler , which specifically forbids modifying the stack returned from IItemHandler#getStackInSlot . I don't think that documentation is accurate, since the vanilla Skull item uses NBT to store the skull owner (for player skulls) and can be stacked. If you're modifying the NBT of items not added by your mod, make sure you include your mod ID in the tag names so you don't overwrite other people's data. Storing the infusion count could be a potential use-case for the new capability system.
  16. No, it's only for 1.8 and earlier. Just Enough Items (JEI) is the 1.8.9 replacement for its item list and recipe viewing functionality.
  17. It looks like CodeChickenLib is missing. CodeChickenCore usually downloads it automatically, but you may need to add it as a dependency manually in the development environment.
  18. Subscribe to ItemTooltipEvent and add lines to the list. If NEI is running, this event won't be fired; so you need to implement IContainerTooltipHandler and register it using GuiContainerManager.addTooltipHandler . I don't think JEI messes with this event, so you don't need to work around it like you do with NEI.
  19. Like the error says, your blockstates JSON is malformed. You're missing the closing quotes for the variant keys.
  20. You created a WorldGenMinable with a null Block on line 47 of OreGenerator .
  21. I can see that you're calling setInventorySlotContents , but is the if condition actually met at the time the packet is received? Is the handler being called? Set a breakpoint in Handler#onMessage , run Minecraft in debug mode and step through the code.
  22. You passed a non-positive number to Random#nextInt in OreGenerator#oreGen (line 44). The code in your original post uses 100 as the minimum y position and 60 as the maximum y position, so maxY - minY is negative.
  23. No, you need to send the coordinates so you can modify the TileEntity that already exists there. Is your handler being called? Is the handler calling setInventorySlotContents ?
  24. You don't call the handler yourself, FML should be calling it when the message is received on the server. Have you registered your message and handler using SimpleNetworkWrapper#registerMessage ?
  25. Is your handler being called? Is the handler calling setInventorySlotContents ?
×
×
  • Create New...

Important Information

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