Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent players from getting doors as observers #1488

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

OhPointFive
Copy link
Contributor

Players can place doors in observer mode, and the top half remains client-side due to a desync bug which lets them more easily block glitch around.

PGM has the following code, I believe, to prevent players from acquiring blocks that let them create desyncs to block glitch:

    if (BAD_TYPES.contains(item.getType()) || item.getData() instanceof Door) {
      event.setCancelled(true);
    }

Unfortunately, at least in 1.8, instanceof Door only works on the block materials, not the item materials. I've left it as perhaps it works for higher versions.

I have expanded BAD_TYPES to include all the doors available in 1.8.

For now I've not included modern version doors (e.g. copper), since I'm not sure if this desync bug exists in modern versions, I'm not sure if the existing check gets the doors in modern versions, and I'm not set up to test modern versions.

The existing IRON_DOOR in Materials is an iron door block in 1.8. This is used & needed for some iron door map conversion fix — I tried changing it to the item and it filled maps with barrier blocks upon loading. Thus I have made a new IRON_DOOR_ITEM in Materials and have named the other doors to match, renaming the old WOOD_DOOR.

Some inconsistencies in the door naming in sportpaper:
Material.WOOD_DOOR is the item and Material.WOODEN_DOOR is the block.
Material.IRON_DOOR is the item and Material.IRON_DOOR_BLOCK is the block.
Material.SPRUCE_DOOR_ITEM is the item and Material.SPRUCE_DOOR is the block.
The rest match the spruce door's pattern.

I have not tested this in modern versions yet. I'm going to have it tested soon — please don't merge it before then.

@Pablete1234
Copy link
Member

Pablete1234 commented Feb 3, 2025

I tried changing it to the item and it filled maps with barrier blocks upon loading

Prior to 1.8, the trick to get a "barrier" block was to use half iron doors, because the client did not render them. When migrating from 1.7 to 1.8, pgm was made to replace all half iron doors with barrier blocks, that's the history behind that

I have not tested this in modern versions yet. I'm going to have it tested soon — please don't merge it before then.

Turned the PR into draft, when it's ready to be merged un-draft it

@xRob3
Copy link

xRob3 commented Feb 3, 2025

Don't worry guys this "issue" has been proven to be false rumors spread by the occ lizard cabal in attempt to sow divisiveness in the greater community. There is absolutely no block-glitching occuring with doors, trust me.

@Pablete1234 Pablete1234 marked this pull request as draft February 3, 2025 16:39
@OhPointFive OhPointFive force-pushed the fix-dangerous-item-list branch from 6b09d49 to 1059184 Compare February 3, 2025 22:10
@cswhite2000
Copy link
Member

Couldn't we also just replicate the logic that prevents doors placed in deny regions from glitching out while participating?

Co-authored-by: Pablo Herrera <[email protected]>
Signed-off-by: Half <[email protected]>
@OhPointFive
Copy link
Contributor Author

Couldn't we also just replicate the logic that prevents doors placed in deny regions from glitching out while participating?

This seems like a better solution to me, since that way if people still get a door it won't let them blockglitch. I'll try to figure out how this works for regions once I am able.

@Pablete1234
Copy link
Member

Couldn't we also just replicate the logic that prevents doors placed in deny regions from glitching out while participating?

This seems like a better solution to me, since that way if people still get a door it won't let them blockglitch. I'll try to figure out how this works for regions once I am able.

pretty sure all it does is force-send the block update for the block above where you placed, but i think this is good enough of a fix as it is, it's not like obs need to have doors or that it's some massive downgrade not having them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants