Everything posted by Draco18s
-
Mod crashing when run in normal Minecraft, but not when run from IDE.
Well it was, but only as the class that encountered a null as a result of an underlying error (hence the Caused By).
-
Sandblock - Property Question.
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.
-
Sandblock - Property Question.
Ok that's fair. But it's still terrible.
-
Sandblock - Property Question.
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.
-
[1.16.4]Custom Enchantment problem
- Sandblock - Property Question.
//your code Block b = Blocks.SAND;- Sandblock - Property Question.
Ignore that stuff. It's not relevant. This. These are accessible from your code.- Sandblock - Property Question.
Ignore the operational code and think about what the class exposes to other classes. What fields and properties does it have?- Solved : [1.16] Errors related to composite blocks such as doors and beds
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.- Sandblock - Property Question.
Look at the Blocks class.- Sandblock - Property Question.
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)- Sandblock - Property Question.
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
Someone missed the board description.- nbt examples
Sorry, I'm telepathetic, not telepathic. You're going to explain this to your local rubber duck.- nbt examples
That makes no sense. Why would you want to clear the data just because the player logged out and logged back in again?- Find out if a player has loaded the mod
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.- [1.16.4] Edit Vanilla Items e.g. stackSize
BreakSpeedEvent- [SOLVED][1.16.4] Add extra loot for vanilla mobs
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.- [1.15.2] Container Blocks not working on dedicated server when player is not OP
Yes, on like 136 in your code you are returning the wrong thing.- quick way to fill/remove blocks using two BlockPos
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)- a mod i need help with
Why the fuck are you here and not using the "help & support" link in that site's footer?- Modify Minecraft Classes
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).- Totem of Undying Code
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:- Place one block inside another
Look at the SlabBlock to see how it handles becoming a double slab.- Exit Code 1
That sounds like something that should be easy to fix. You add license information to your mcmod.info file. - Sandblock - Property Question.
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.