-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Mod crashing when run in normal Minecraft, but not when run from IDE.
Draco18s replied to Trigonaut's topic in Modder Support
Well it was, but only as the class that encountered a null as a result of an underlying error (hence the Caused By). -
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.
-
Ok that's fair. But it's still terrible.
-
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.
-
//your code Block b = Blocks.SAND;
-
Ignore that stuff. It's not relevant. This. These are accessible from your code.
-
Ignore the operational code and think about what the class exposes to other classes. What fields and properties does it have?
-
Look at the Blocks class.
-
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)
-
The number you see is in decimal. If you convert it to hexidecimal you will get a familiar 0xAARRGGBB
-
Deferred Registers not Wanting to Work in Forge 1.15.2
Draco18s replied to Justforgames250's topic in Modder Support
Someone missed the board description. -
Sorry, I'm telepathetic, not telepathic. You're going to explain this to your local rubber duck.
-
That makes no sense. Why would you want to clear the data just because the player logged out and logged back in again?
-
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.
-
BreakSpeedEvent
-
[SOLVED][1.16.4] Add extra loot for vanilla mobs
Draco18s replied to theagente00g's topic in Modder Support
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. -
quick way to fill/remove blocks using two BlockPos
Draco18s replied to blinky000's topic in Modder Support
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) -
Why the fuck are you here and not using the "help & support" link in that site's footer?
-
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).
-
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:
-
Look at the SlabBlock to see how it handles becoming a double slab.
-
That sounds like something that should be easy to fix. You add license information to your mcmod.info file.