Jump to content

[Solved][1.8] b1568 - Block with Blockstate doesn't drop the desired block


kreezxil

Recommended Posts

I'll try to be brief. But if you want the long winded version see http://minecraft.curseforge.com/projects/kreezxils-compressed-blocks or https://github.com/kreezxil/Compressed-Blocks-by-Kreezxil. The curseforge site contains my last working version before I went to blockstates  and a deeper description for everything the mod provides.

 

The way the mod works is that you take 9 blocks, say cobblestone, and put them evenly in a crafting table and get one compressed cobblestone back. This scenario progresses 7 more times until you reach octuple compressed cobblestone. I've done this for dirt, gravel, coal to the 4th tier, and sand thus far. That's when I went to block states. While uncrafting is the preferable way to get lower tiered blocks back, I thought it would be clever to have the option to harvest them back as well, so if you mined octuple compressed cobblestone you would get 9 septuple compressed cobblestone.

 

However, that is no longer happening, you can get the vanila item back when you harvest compressed or tier 1 blocks, but the higher tiered blocks are no longer returning the tier below them.

 

I have asked both The_Fireplace and BedrockMiner for help with this, and they are telling me they see nothing wrong with the code, therefore I am bring it back to you guys. :)

Link to comment
Share on other sites

All I see is a potential crash bug: If your hardness varies with state, then getHardness should test if the Block at pos is still your block trying to get properties. (There's a client-side bug in 1.8 that calls getHardness one more time while destroying a block -- *after* the block has been turned into air). It's possible that LexManos just fixed it in a recent build, but then you may be up against consequences of doing destroy block in a new order.

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

All I see is a potential crash bug: If your hardness varies with state, then getHardness should test if the Block at pos is still your block trying to get properties. (There's a client-side bug in 1.8 that calls getHardness one more time while destroying a block -- *after* the block has been turned into air). It's possible that LexManos just fixed it in a recent build, but then you may be up against consequences of doing destroy block in a new order.

 

Check the changelog for build 1568+, Lex caught that in a crash report I made already on this forum in regards to what you are seeing. Now we are left with an issue where the custom blocks don't want to drop custom blocks.

Link to comment
Share on other sites

Technically this is solved, but I don't understand why it is.

 

I solved my problem with the block drops.

 

I reduced my code too far apparently and did something that I thought it was legal, Minecraft felt it wasn't.

 

I put a bunch of variables to the top to make configuring successive new compressed blocks easier, and to make balancing also easier.

 

One of the lines I put up top  was:

 

public static final Block masterBlock = ModBlocks.CompressedFlint;

 

And then I reference 'masterBlock' in the getItemDropped function. Well, Minecraft wouldn't allow that, it wanted me to put ModBlocks.CompressedFlint there. Oddly it accepted all of the other variables.

 

Any idea as to why it behaved like that?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Use the static methods in ResourceLocation to create an instance.
    • So im full into world generation right now, carving shit for a dimension I'm doing. I understand what the CarvingMask is, if i understand correctly, an array of bits that, for each chunk, marks wether the block the bit represent is (1) or isn't (0) carved. But I'm not seeing what uses it can have. Under what circumstances is good to make and keep track of a carvingmask?
    • Yes, it is possible. You should develop the API as a separate project. Wether you want your mod to have the API integrated or have a dependency on it is up to you. I'd say that for testing the API integration, you should have it separated and add it as a dependency to your mod (at least, thats how I've done it in the past).   I recall there is also option to compile different parts of your project on different jars. Either way, thats more of a forgegradle question, if i understand it correctly
    • forge simply won't boot up no matter how many mods are installed, i tried only the 1.20.1 and 1.20.6 versions and the same thing happened: nothing. the only thing that shows up in the logs is this   [14jun.2024 11:07:34.757] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, {MINECRAFT_USERNAME}, --version, 1.20.1, --gameDir, C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\com.modrinth.theseus\profiles\s, --assetsDir, C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\com.modrinth.theseus\meta\assets, --assetIndex, 5, --uuid, {MINECRAFT_UUID}, --accessToken, ????????, --clientId, c4502edb-87c6-40cb-b595-64a280cf8906, --xuid, 0, --userType, msa, --versionType, release, --width, 854, --height, 480, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.17, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [14jun.2024 11:07:34.765] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.11 by Azul Systems, Inc.; OS Windows 10 arch amd64 version 10.0 [14jun.2024 11:07:34.946] [main/WARN] [net.minecraftforge.fml.loading.FMLConfig/CORE]: Configuration file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\com.modrinth.theseus\profiles\s\config\fml.toml is not correct. Correcting [14jun.2024 11:07:34.948] [main/INFO] [net.minecraftforge.fml.loading.FMLConfig/CORE]: Incorrect key [earlyWindowSkipGLVersions] was corrected from null to [] [14jun.2024 11:07:34.948] [main/INFO] [net.minecraftforge.fml.loading.FMLConfig/CORE]: Incorrect key [earlyWindowSquir] was corrected from null to false [14jun.2024 11:07:34.970] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [14jun.2024 11:07:35.208] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6   i tried in two different computers and had the same results help.....
  • Topics

×
×
  • Create New...

Important Information

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