Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Not really no. I did something like this a long while back, but you can't fiddle with that property. You have to fiddle with whatever you can do with the available methods. e.g. you can return an empty voxel shape from getCollisionShape which does allow you to check what the player has or is.
  2. Because of how Capabilities work.
  3. No, that's how its supposed to work. Forge injects the value to non-null at runtime. You still need to register the capability. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/FarmingBase.java#L189
  4. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/FarmingBase.java#L86-L87 Pretty sure this hasn't changed.
  5. No, you would create your own class that implements MySavedIntegerStorage<MySavedIntegerInterface> https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/entities/capabilities/MilkStorage.java
  6. No! Bad modder! Put client side code in a client side event subscriber! Do not hide exceptions.
  7. Or read the depreciation comment.
  8. Its called a SRG name. Its an automatically assigned identifier by the decompilation process so that even as obfuscated names get shuffled and changed every time Mojang updates the game, the SRG names stay constant. But it means that when major versions happen the SRG -> MCP name identification and mapping needs to be rediscovered.
  9. Yes, you have marked a method with @Override but are not actually overriding a method. You need to correct the method signature so that you are overriding a method.
  10. Your class, CzechVoiceControl, is referencing the Minecraft class directly. You can't do this from common code.
  11. Why does your static class have a constructor?
  12. Check what value the parameter is and compare it against a desired value.
  13. BlockItemBase is an antipattern. There is already a base BlockItem class, it is called BlockItem. Ditto ItemBase. It's called Item. Code Style #4
  14. End portals are special and can be located via the same code that ender eyes use. But in a more generic sense, no, there is no built-in method of locating the nearest block. As the only way to do that would be to literally examine 30,000,000,000 blocks one by one. The reason you can locate end portal frames is because those generate naturally, there are only three strong holds, and the game knows where those three strong holds are.
  15. World#getBlockState
  16. Vanilla code, go find the MilkBucketItem
  17. Yes, it is. It is still badly named, even if you didn't name it. Have you tried to figure out what it does?
  18. This is a parameter. It is badly named. Maybe this value means something?
  19. you need to show more code to resolve this.
  20. You're looking at the right thing, the problem is that you're seeing SRG names (automated consistent naming between versions) and not human readable (MCP) names (which are a community sourced project that takes a while to identify methods and update the names). Either you need to update your mappings or you have to wait for new mappings to be available.
  21. You can't without getting into doing java bytecode modification. A thing that if you don't already know how to do, we will not help you do, because if you don't do it right, and the game crashes users will report it as a bug to the wrong person.
  22. Probably the wrong bus. But I'd go with D7's suggestion of the player logged in event.
  23. That's what container items are for. Vanilla does this with buckets of milk, for example. This is not handled by the crafting recipe json, but the item's class. You need slots that only accept specific items. As an example: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/inventory/SaltSlotHandler.java Used: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/entity/TannerTileEntity.java#L56
  24. You need to wait until after tags have been read and generated. There's an event for that too, but I'm blanking on its name. IIRC it doesn't happen until after you start or load a save though.
  25. Why not use the debugger and set a breakpoint at the desired location and inspect the variable?
×
×
  • Create New...

Important Information

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