juancarloscp52 / BedrockIfy

A Minecraft mod that implements some Minecraft Bedrock features into Java edition.
GNU General Public License v3.0
178 stars 38 forks source link

[Bug] BedrockIfy partially breaks cheats in single-player #218

Closed Iristallite closed 1 year ago

Iristallite commented 1 year ago

Log (No mods except BedrockIfy 1.6 and Fabric API were loaded)

BedrockIfy seems to partially break cheats in single-player worlds with cheats enabled; What I mean is that commands like /gamemode,/give, etc work, but interacting with command blocks does nothing, the gamemode switcher (F3+F4) prints an error in chat(1), and the Operator Utilities tab(2) is missing from the Creative Mode inventory.

However, opening the world to LAN fixes all of these issues; my theory is that opening to LAN overrides whatever gets broken by BedrockIfy?

I opened the world to LAN (cheats enabled) after the line [18:13:10] [Render thread/INFO]: [CHAT] <Nordii08> I'm opening to LAN now, and then command blocks, the gamemode switcher (F3+F4), and the Operator Utilities tab(2) started working again

(1) Gamemode switcher error

The exact error, sent in chat:
[Debug]: Unable to open game mode switcher; no permission

(2) Operator Utilities

This tab only shows up if Operator Items Tab is enabled in the Controls settings. ...why is it in the controls settings?

Iristallite commented 1 year ago

Addendum: can confirm BedrockIfy is the cause; spent half an hour (unsuccessfully)googling until I tested vanilla Minecraft, then tested all my mods process-of-elimination style.

Not meaning to be rude by the way! (I never try to be rude in my issue reports but I always fear I could be misinterpreted)

lonefelidae16 commented 1 year ago

It’s due to the PR #207.

https://github.com/juancarloscp52/BedrockIfy/blob/a70989fde4684ede92e4afe385fe3ee061d0c012/src/main/java/me/juancarloscp52/bedrockify/mixin/client/features/useAnimations/ClientPlayerEntityMixin.java#L43-L51

Who chose the Override annotation in ClientPlayerEntityMixin#handleStatus? The Inject annotation should be applied here.

...it’s me, sorry. I will create a new PR for this fix.

However, I’m not sure why opening the world to LAN would fix all of these issues. It looks like maybe ServerPlayerEntity#getPermissionLevel and MinecraftServer#getPermissionLevel are involved, but I don’t really know.

Sorry for the inconvenience.

lonefelidae16 commented 1 year ago

Workaround: to avoid this issue, please turn off the client.features.useAnimations mixin in Mixins tab on BedrockIfy settings screen. edit: Restart required your game after changing configuration.