fix(core): Properly reinit convex CUI selection on primary click (#2313)

Fixes #2312
This commit is contained in:
zml 2023-05-12 23:15:42 -07:00 committed by GitHub
parent 88851b0cc2
commit d320dafc2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@
import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.CUIRegion;
import com.sk89q.worldedit.internal.cui.SelectionPointEvent; import com.sk89q.worldedit.internal.cui.SelectionPointEvent;
import com.sk89q.worldedit.internal.cui.SelectionPolygonEvent; import com.sk89q.worldedit.internal.cui.SelectionPolygonEvent;
import com.sk89q.worldedit.internal.cui.SelectionShapeEvent;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.ConvexPolyhedralRegion; import com.sk89q.worldedit.regions.ConvexPolyhedralRegion;
@ -199,6 +200,7 @@ public void explainPrimarySelection(Actor player, LocalSession session, BlockVec
checkNotNull(session); checkNotNull(session);
checkNotNull(pos); checkNotNull(pos);
session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID()));
session.describeCUI(player); session.describeCUI(player);
player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString()))); player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString())));
@ -219,6 +221,8 @@ public void explainSecondarySelection(Actor player, LocalSession session, BlockV
public void explainRegionAdjust(Actor player, LocalSession session) { public void explainRegionAdjust(Actor player, LocalSession session) {
checkNotNull(player); checkNotNull(player);
checkNotNull(session); checkNotNull(session);
session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID()));
session.describeCUI(player); session.describeCUI(player);
} }