Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Well it was, but only as the class that encountered a null as a result of an underlying error (hence the Caused By).
  2. No, why is it's Type Object and not Item? This is why you use instanceof. Sorry, a couple of the links got messed up. And I noticed the forum screwing up my post writing this one (I'll be at the end of a line, make a typo, hit backspace, and the cursor jumps to the middle of the line and deletes a character. I meant this section. You've fixed it, but now you have two checks for null where you could just combine the two blocks and do it once. No sense checking to see if there's a valid object to assign with and then separately checking to see if you assigned anything to it... The two variables are the same type. It's literally pointless. It can never fail in an unexpected way, and if it does, let the program crash, it's not your problem. And I made it simpler and easier to read. public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) { if(!kb.HShift() && !kb.HCtrl() && !tip0.isEmpty()) tooltip.add(new StringTextComponent(tip0)); //if neither pressed, show tip0 (if not empty) if(kb.HCtrl() && !tip2.isEmpty()) tooltip.add(new StringTextComponent(tip2)); //if ctrl, show tip2 (if not empty), do first if(kb.HShift() && !tip1.isEmpty()) tooltip.add(new StringTextComponent(tip1)); //if shift, show tip1 (if not empty) } instanceof. Try-catch is monumentally slow. I've actually tested this. Inadvertently, but I did (that's what happens when you're doing reflection inside bytecode manipulation and discover that the game is running at 20 SPT instead of 20 TPS and fix it by removing the try-catch and just letting your injected method throw an error you know will never actually be thrown and bypass the compiler check for unhandled exceptions). But if course, if you had to ask that question after implementing one over the other because, in your own words, "it was faster" you obviously didn't even bother doing a test to find out if it was actually true.
  3. Ok that's fair. But it's still terrible.
  4. Oh dear god. All of these do fucking nothing. Every single one of those methods is empty. Also, class names start with an UpperCaseLetter. Why the fuck is this Object? You really like Pokemon Exceptions. You don't even need try-catch. That's what instanceof is for. This can't even throw an exception. And apparently you have something against != as well. You aren't even using this value. Do not do pointless logging. fall = falls is too hard? This entire method is a fucking nightmare. Also str.isEmpty(). And I still don't know where you are trying to check the block above, per your original post.
  5. //your code Block b = Blocks.SAND;
  6. Ignore that stuff. It's not relevant. This. These are accessible from your code.
  7. Ignore the operational code and think about what the class exposes to other classes. What fields and properties does it have?
  8. You can't remove an item from a list when you are in a for-each loop. That's why it's throwing a concurrent modification exception. Concurrent with iteration the list was modified. If you need this, either use an Iterator or use an indexed for loop.
  9. Look at the Blocks class.
  10. Whether or not it actually uses the alpha value depends on various other factors. (And of course it accepts 0xffffff: that's a valid integer literal)
  11. The number you see is in decimal. If you convert it to hexidecimal you will get a familiar 0xAARRGGBB
  12. Someone missed the board description.
  13. Sorry, I'm telepathetic, not telepathic. You're going to explain this to your local rubber duck.
  14. That makes no sense. Why would you want to clear the data just because the player logged out and logged back in again?
  15. Create the channel on the server side. When the client connects, if they don't create that same channel, they cannot connect. You don't have to do anything besides create the channel.
  16. The fuck is this class name? https://github.com/GustavoSasaki/Ragnarok-Cards/blob/main/src/main/java/ragnarok_cards/Items/aa.java#L23 Use proper CamelCase naming convention. https://github.com/GustavoSasaki/Ragnarok-Cards/blob/main/src/main/java/ragnarok_cards/Items/aa.java#L77 This condition will never be true. https://github.com/GustavoSasaki/Ragnarok-Cards/blob/main/src/main/java/ragnarok_cards/Items/aa.java#L85 Beyond that I'm not sure, I've not messed with entity loot modifiers myself.
  17. Yes, on like 136 in your code you are returning the wrong thing.
  18. The only way to change a large amount of data is to change each piece of data one at a time. I don't know why you'd think there was a solution to this faster than O(n)
  19. Why the fuck are you here and not using the "help & support" link in that site's footer?
  20. D7 said stop making jar mods, that is, mods that modify the vanilla files directly and are installed by opening up the minecraft.jar in a zip editor. You're free to make Forge mods (this is the Forge forums).
  21. Yeah I have no idea why you're asking on the Forge forums about how to mod with Bukkit. You also appear to be modding for 1.12:
  22. Look at the SlabBlock to see how it handles becoming a double slab.
  23. That sounds like something that should be easy to fix. You add license information to your mcmod.info file.
×
×
  • Create New...

Important Information

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