Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. You can't call that code on the server. You can't access a ClientPlayerEntity on the server (it is a CLIENT only class).
  2. More specifically, this post:
  3. Yep, that's the spot. I haven't been in a position to open up my IDE and go poking around, I just knew what to look for. Anyway, sounds like you're on the right track.
  4. Vanilla already has this item. Its called BlockItem or NamedBlockItem (both have slightly different features).
  5. It was kinda late, I fuckered that up. XD Fixed it.
  6. $10 says that you're seeing one get created on the client thread and one on the server thread. getUpdatePacket, getUpdateTag, and onDataPacket
  7. That would be the client side yes. You need to send a packet to the server (all this packet does is say "this button was clicked"!) and the server does the operations neccessary (including checking to make sure that the player is allowed to click the button). Quick "Am I on the Server?" guide: Is it visual? No, you are on the client Is it input related? No, you are on the client Was a world or player object passed to you? Maybe, check world.isRemote (or player.world.isRemote) isRemote returns true? No, you are on the client Did you get your world by calling Minecraft.getInstance()? No, you are on the client. Also don't do this unless you know what you're doing.
  8. Correct. No longer exists. Well, the event exists, but it isn't actually used any more. See this PR. But if you don't want to handle that yourself, find the area of the code where the existing BreakEvent is fired and drops are generated, and see what calls it and call that yourself.
  9. You need a custom slot: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/inventory/SlotDust.java Line 17 is the important one, all you need to do is check for one item. And a sublcass of ItemStackHandler: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/capability/SiftableItemsHandler.java (You won't need onContentsChanged, that's specific to my block, just edit line 15 to be the same logic as the line 17 of your slot class).
  10. Overwrite it using a "blank" recipe: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/minecraft/recipes/sugar.json
  11. That's a good start. As long as you insure that the blockPos you're passing there is one of the adjacent blocks you're trying to break. Second, the event has a canceled property. If the event has been canceled when it gets back to you, you need to not break the block. This is typically done by: if(MinecraftForge.EVENT_BUS.post(event)) { //break the block }
  12. https://cadiboo.github.io/tutorials/1.14.4/forge/ Also what IDE you use is irrelevant. It's like saying "I can't write a letter using OpenOffice, all the tutorials are for Microsoft Word!"
  13. Uh...have you tried fixing that error right there? Also, don't use BlockBase (Code Style #4). You do realize that your item needs to know about your block in order to place it, right?
  14. Yep, his tutorials are garbage. Search the forums for "Harry Talks" and you'll find dozens and dozens of people having issues after following his tutorials. This is also wrong. You want "resources\assets\compparts" (\textures, etc)
  15. Some data json file somewhere has a problem (could be just about anything in the data folder, one of the files you added, could be a tag, recipe, or advancement). When it throws an error ALL data files do not get loaded.
  16. You still need two functional blocks. A top half and a bottom half and you don't have two halves!
  17. What does the upper half of your block sit on top of? Is it farmland? When your crop grows, I don't see it doing anything about setting an upper block. I don't see anything about the block knowing if its an upper or lower block. This is not the two-tall grass block class. This is the one-block grass block class (called "tall grass" because it isn't the grass block that has a green top face and dirt bottom face), which is why: That enum exists. Two tall grass cannot and never is "dead bush."
  18. Use a DeferredRegistry or @ObjectHolder annotations.
  19. Register an event listener for the BlockBreakEvent Inside, check the tool used to see if it has your enchantment If so, modify the adjacent blocks (note: if you intend to break and harvest adjacent blocks, you should either invoke the same pathways that items do, or broadcast the related events yourself, in the event that another mod or effect wants to do anything. For example, a permissions mod that prevents a player from breaking blocks in regions they don't have access to because it is owned by another player. Be aware of recursion!).
×
×
  • Create New...

Important Information

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