Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Added a legacy type id system to CUI.
Selection types can send fallback typeids and information now, for older WECUI versions to use.
Dieser Commit ist enthalten in:
Ursprung
0b5c8748b5
Commit
45655e1189
@ -570,6 +570,10 @@ public class LocalSession {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final String legacyTypeId = selector.getLegacyTypeId();
|
||||||
|
if (legacyTypeId != null) {
|
||||||
|
player.dispatchCUIEvent(new SelectionShapeEvent(legacyTypeId));
|
||||||
|
}
|
||||||
player.dispatchCUIEvent(new SelectionShapeEvent(selector.getTypeId()));
|
player.dispatchCUIEvent(new SelectionShapeEvent(selector.getTypeId()));
|
||||||
|
|
||||||
if (selector instanceof CUIPointBasedRegion) {
|
if (selector instanceof CUIPointBasedRegion) {
|
||||||
|
@ -177,6 +177,10 @@ public class CuboidRegionSelector implements RegionSelector, CUIPointBasedRegion
|
|||||||
return "cuboid";
|
return "cuboid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLegacyTypeId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void describeCUI(LocalPlayer player) {
|
public void describeCUI(LocalPlayer player) {
|
||||||
if (pos1 != null) {
|
if (pos1 != null) {
|
||||||
player.dispatchCUIEvent(new SelectionPointEvent(0, pos1, getArea()));
|
player.dispatchCUIEvent(new SelectionPointEvent(0, pos1, getArea()));
|
||||||
|
@ -178,6 +178,10 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIPointBasedR
|
|||||||
return "polygon2d";
|
return "polygon2d";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLegacyTypeId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public int getArea() {
|
public int getArea() {
|
||||||
return region.getArea();
|
return region.getArea();
|
||||||
}
|
}
|
||||||
|
@ -132,12 +132,19 @@ public interface RegionSelector {
|
|||||||
public String getTypeName();
|
public String getTypeName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a lowecase space-less ID.
|
* Get a lowercase space-less ID.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getTypeId();
|
public String getTypeId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an alternative ID, for which this region selector also sends data.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getLegacyTypeId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get lines of information about the selection.
|
* Get lines of information about the selection.
|
||||||
*
|
*
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren