Describe the bug
ClaimModifiedEvent is unreliable
|
private void onClaimResize(ClaimModifiedEvent event) { |
relies on getTo and getFrom data from ClaimModifiedEvent
however ClaimModifiedEvent can be fired with "invalid" data:
https://github.com/GriefPrevention/GriefPrevention/blob/5b3215c3e58bd987b6a77e87070a624bd8424e6b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java#L1232
as it's fired before checking if claims are overlapping:
https://github.com/GriefPrevention/GriefPrevention/blob/5b3215c3e58bd987b6a77e87070a624bd8424e6b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java#L1305
this could trick GPFlags to check and apply flag data for coordinates it should, for example allowing players to fly in wilderness, etc...
To reproduce
claim1 = Claim of Player1
claim2 = Claim of Player2
Steps to Reproduce:
Step1: Create claim1 next to claim2 and enable /claimflag ownermemberfly or /claimflag ownerfly in claim1.
Step2: Use the claim stick to view the corners of claim1 (shown as "glowstone"). Make sure one of the glowstone corners is near the glowstone corner of claim2.
Step3: Use the golden shovel and right-click the glowstone (to resize the claim). Then, select a block in the wilderness (unclaimed area) next to the glowstone of claim2.
The claim1 does not actually resize due to the existence of claim2. However, the game thinks it has been resized, which allows you to fly in the wilderness.
Expected behavior
Not sure, possibly using claim reference and loading claim bounds from claim data 1 tick after claim was resized?
Screenshots, videos, or logs
N/A
Configs and console errors
N/A
Versions
gpflags debug
[11:24:27 INFO]: [GPFlags] Server version: Sakura 1.21.8-DEV-eace2ab (MC: 1.21.8)
[11:24:27 INFO]: [GPFlags] GP version: 17.0.0-58-g03ef2d8-dirty
[11:24:27 INFO]: [GPFlags] GPF version: 5.13.8.153
[11:24:27 INFO]: [GPFlags] Dependent plugins: SurvivalPlus GSit
Describe the bug
ClaimModifiedEvent is unreliable
GPFlags/src/main/java/me/ryanhamshire/GPFlags/listener/ClaimModifiedListener.java
Line 17 in e8f7ffb
relies on getTo and getFrom data from ClaimModifiedEvent
however ClaimModifiedEvent can be fired with "invalid" data:
https://github.com/GriefPrevention/GriefPrevention/blob/5b3215c3e58bd987b6a77e87070a624bd8424e6b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java#L1232
as it's fired before checking if claims are overlapping:
https://github.com/GriefPrevention/GriefPrevention/blob/5b3215c3e58bd987b6a77e87070a624bd8424e6b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java#L1305
this could trick GPFlags to check and apply flag data for coordinates it should, for example allowing players to fly in wilderness, etc...
To reproduce
claim1 = Claim of Player1
claim2 = Claim of Player2
Steps to Reproduce:
Step1: Create claim1 next to claim2 and enable /claimflag ownermemberfly or /claimflag ownerfly in claim1.
Step2: Use the claim stick to view the corners of claim1 (shown as "glowstone"). Make sure one of the glowstone corners is near the glowstone corner of claim2.
Step3: Use the golden shovel and right-click the glowstone (to resize the claim). Then, select a block in the wilderness (unclaimed area) next to the glowstone of claim2.
The claim1 does not actually resize due to the existence of claim2. However, the game thinks it has been resized, which allows you to fly in the wilderness.
Expected behavior
Not sure, possibly using claim reference and loading claim bounds from claim data 1 tick after claim was resized?
Screenshots, videos, or logs
N/A
Configs and console errors
N/A
Versions