Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
Improves CUI support.
1. Allows CUI handshake package to overwrite protocol version. 2. Sends the current selection on handshake. 3. Removed redundant SelectionShapeEvents. Conflicts: src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java
Dieser Commit ist enthalten in:
Commit
8d6f5bf335
@ -40,11 +40,8 @@ public class CUIChannelListener implements PluginMessageListener {
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||
LocalSession session = plugin.getSession(player);
|
||||
if (session.hasCUISupport()) { // Already initialized
|
||||
return;
|
||||
}
|
||||
|
||||
String text = new String(message, UTF_8_CHARSET);
|
||||
session.handleCUIInitializationMessage(text);
|
||||
session.describeCUI(plugin.wrapPlayer(player));
|
||||
}
|
||||
}
|
||||
|
@ -625,10 +625,6 @@ public class LocalSession {
|
||||
}
|
||||
|
||||
public void handleCUIInitializationMessage(String text) {
|
||||
if (hasCUISupport()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String[] split = text.split("\\|");
|
||||
if (split.length > 1 && split[0].equalsIgnoreCase("v")) { // enough fields and right message
|
||||
setCUISupport(true);
|
||||
|
@ -206,8 +206,6 @@ public class ConvexPolyhedralRegionSelector extends com.sk89q.worldedit.regions.
|
||||
Collection<Vector> vertices = region.getVertices();
|
||||
Collection<Triangle> triangles = region.getTriangles();
|
||||
|
||||
player.dispatchCUIEvent(new SelectionShapeEvent(getTypeID()));
|
||||
|
||||
Map<Vector, Integer> vertexIds = new HashMap<Vector, Integer>(vertices.size());
|
||||
int lastVertexId = -1;
|
||||
for (Vector vertex : vertices) {
|
||||
@ -234,8 +232,6 @@ public class ConvexPolyhedralRegionSelector extends com.sk89q.worldedit.regions.
|
||||
if (isDefined()) {
|
||||
session.dispatchCUIEvent(player, new SelectionPointEvent(0, region.getMinimumPoint(), getArea()));
|
||||
session.dispatchCUIEvent(player, new SelectionPointEvent(1, region.getMaximumPoint(), getArea()));
|
||||
} else {
|
||||
session.dispatchCUIEvent(player, new SelectionShapeEvent(getLegacyTypeID()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,8 +237,6 @@ public class CylinderRegionSelector extends com.sk89q.worldedit.regions.Cylinder
|
||||
if (isDefined()) {
|
||||
session.dispatchCUIEvent(player, new SelectionPointEvent(0, region.getMinimumPoint(), getArea()));
|
||||
session.dispatchCUIEvent(player, new SelectionPointEvent(1, region.getMaximumPoint(), getArea()));
|
||||
} else {
|
||||
session.dispatchCUIEvent(player, new SelectionShapeEvent(getLegacyTypeID()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren