breakinblocks / Plonk

A Minecraft mod that lets you place items down anywhere https://www.curseforge.com/minecraft/mc-mods/plonk https://modrinth.com/mod/plonk
MIT License
3 stars 4 forks source link

Cant rotate individual items in already existing world #14

Closed agr21 closed 3 years ago

agr21 commented 3 years ago

Cant rotate individual items,but can rotate the whole tile. only in an already existing world, new one works fine. 1.16.4, 1.16.5-9.0.7 plonk version. cant really attach a report, because there is nothing in it

BlueAgent commented 3 years ago

Maybe you could upload a copy of the world?

agr21 commented 3 years ago

sure, but where? its pretty massive, 500mb

BlueAgent commented 3 years ago

Oooh I got an idea. Make sure to do a world backup! Maybe you could try temporarily disabling all mods except Plonk and see if it still happens. Just to rule out a mod interaction preventing the Shift + RC (empty hand) going through.

If it happens then, maybe you could send a game log of you opening the world, trying a bunch of stuff to rotate items and then exiting the game. Also use the command /data get block <x> <y> <z> on some placed items. Then send the file ./logs/debug.log. Maybe it'll have something like an exception happening. I don't really have logging in Plonk. Although I could add in a "debug" mode for the mod perhaps that does more logging? Then restore the world backup after, or make a copy in the first place. If it didn't happen with just Plonk then to the above instead with your full modpack.

As for the upload anywhere that supports 500mb e.g. Google Drive, OneDrive, DropBox, mega.nz. Make sure to make it public or unlisted then share link here. Maybe put the mods and configs in the zip too if it only happens with mods and not Plonk alone.

agr21 commented 3 years ago

alright, thanks, i will try it as soon as i can! will get back

agr21 commented 3 years ago

okay so here we go: i cant start the world with mods removed. duh. but, both this world(where it doesnt work) and any other world(where it does work) has the same mods and config and datapacks. i did the data get block thing you said, and also the whole world +mods+configs here. first debug log is for the world which doesnt work, its around line 38707. second one is where it works, around line 89663 (in notepad++). im sorry not being able to load it with just plonk. might worth to note i tried it on 2 computers and still cant rotate them individually

https://drive.google.com/drive/folders/1-nCg8zUo8Uwd8GTY9oKGGPXwU_flGj2_?usp=sharing

BlueAgent commented 3 years ago

Okay I'll take a look at this when I can. Thanks a bunch! :3

BlueAgent commented 3 years ago

Aaaah, it turns out it's because you're holding the rabbit's foot in your offhand. Can you test without holding anything in the offhand to it to see if it works for you? I do think I will change the code to ignore the offhand however, but all I'm doing is using the onBlockActivated method.

Edit: Okay so it seems like the method isn't being raised at all, apparantly that's because items by default don't pass right clicks to the underlying block when sneaking. This is done so that you can e.g. hold shift to place a block against a chest or other inventory. Not really sure what to do here... Hmm. Perhaps I could listen in on the PlayerInteractEvent and allow right click to pass through for offhand. But then people might what to have a block in their offhand or something and then sneak to place it agaist some placed items but not picking up the items. I feel like I should have gone with copying the item frame interaction method tbh. Where you left click to pick up the items and right clicking rotates. Might be a bit too late to change that though.

agr21 commented 3 years ago

omg. such a small thing, i could have never thought about it. thank you!

BlueAgent commented 3 years ago

No worries :P

Now... I'm not 100% sure how to address this. I think for now I will just add information to the mod page about it haha. Since "fixing" it would be a bit more involved and not really sure the best way to do it. Closing this as it is resolved.

Will let you know if I ever sort out a way to ignore the offhand.