Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. New versions don't make the need for packets to magically go away.
  2. Capabilities store "arbitrary data." If your magic system isn't "arbitrary data" then something is very wrong indeed.
  3. Use data packs. Your mod is also a data pack.
  4. Capabilities.
  5. By "doesn't burn" do you mean that it does not provide fuel for a furnace? Because that's automatic. Or do you mean that when dropped into the world it isn't destroyed by fire or lava? Or do you mean something else?
  6. You see this? https://github.com/LukasSchikirianski/JungleAddonsMod/blob/master/Jungle Addons - 1.16.1/src/main/java/com/lukas/jungle_addons/JungleAddons.java#L30 You see how it says bus=Bus.MOD? That's the wrong bus for those events.
  7. Complain to Optifine for not being compatible with Forge.
  8. That's called Reaching Across Sides and won't work. If the client and sever are running on different machines, how do you think the server knows about the gui change? (a) use the loot system and get the block's drops (b) pickBlock()
  9. Do not use this, this uses the vanilla IInventory system. You should use ItemStackHandler for inventory instead. Why the fuck do you have THREE local variables storing the same block state? blockstate, newBlockstate, and blockRemoved are literally all the same thing and can never be anything else at this point in the code. If you are interested in doing something with these variables, but not with this value, don't assign a value here. Yeah. Like that...why didn't you just assign newBlockstate to AIR to begin with? And for that matter why do you even need this variable anyway? What. Why are you passing a public static field to a private non-static method? What. This is not how you get an ItemStack from a block. This won't work for a whole host of blocks, from piston heads, to cake, to redstone wire, to crops. Mmm yep. This is why ItemStackHandler exists. *Suspicion*
  10. I don't know. Where are you calling destroyBlock from? What's that code look like?
  11. ReflectionObfuscationHelper if I remember the class's name correctly. You call getPrivateValue and pass in the SRG name of the field you want.
  12. Let me pop my IDE open here and... Well, the POWERED value and the dataManager are both private, so.... Reflection.
  13. Don't serialize/deserialize entities to change their field values. That's disgusting.
  14. Report the crash to the mod author.
  15. They're bit flags. You bit-wise OR the values together. 1 | 2 (aka "3") 4 | 8 (aka "12") 1 | 2 | 8 (aka "11") This will create weird effects that you almost certainly do not want.
  16. Item has methods for onRightClick and onEntityInteract (you'll have to poke around for exact method names). Just override them and put your functionality there.
  17. No. Also:
  18. Don't compare strings. Use instanceof. You already use a cast later down. Why are you performing this particular check twice? Use an early return here like you did with a null player. "Refuel." And finally: Why are you bothering with R keypresses? Why not use the systems Minecraft already has in place (right clicking with a stack)? Then you don't need this key press handler at all and can put this logic inside your item (where it belongs) and don't need to deal with custom packets.
  19. Read the javadoc.
  20. Well you have a world.isRemote check there, but I can't tell if you're checking for true or false. And you have another line above it that looks suspicious. But you posted your code as an image rather than text showing a tooltip that is patently useless for solving the problem and hiding code I might actually be interested in. Also, there's nothing wrong with world.setBlockState, provided you pay attention to the FLAG parameter. world.destroyBlock should also work (it will drop the block's loot). world.removeBlock should just be a wrapper around world.setBlockState(Blocks.AIR)
  21. Ah yes, you are correct. Normally this sort of issue is caused by people putting data in the Item class. Anyway, in order to make the cooldown stack based not player based, the answer is still Capabilities.
  22. I only had to spell things out for you. Twice.
  23. You can't do this. Use Capabilities.
  24. None of those. The tile entity already has a world field. You even found it. Fucking use it.
×
×
  • Create New...

Important Information

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