forked from SteamWar/SteamWar
Update CAALine to CLine
Update CAABox to CWireframe
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
package de.steamwar.core;
|
||||
|
||||
import de.steamwar.entity.CAABox;
|
||||
import de.steamwar.entity.CWireframe;
|
||||
import de.steamwar.entity.REntityServer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
@@ -33,10 +33,10 @@ import java.util.Map;
|
||||
public class WorldEditRendererWrapper20 implements WorldEditRendererWrapper {
|
||||
|
||||
private static final class BoxPair {
|
||||
private CAABox regionBox;
|
||||
private CAABox clipboardBox;
|
||||
private CWireframe regionBox;
|
||||
private CWireframe clipboardBox;
|
||||
|
||||
public CAABox get(boolean clipboard) {
|
||||
public CWireframe get(boolean clipboard) {
|
||||
if (clipboard) {
|
||||
return clipboardBox;
|
||||
} else {
|
||||
@@ -44,7 +44,7 @@ public class WorldEditRendererWrapper20 implements WorldEditRendererWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
public void set(boolean clipboard, CAABox box) {
|
||||
public void set(boolean clipboard, CWireframe box) {
|
||||
if (clipboard) {
|
||||
this.clipboardBox = box;
|
||||
} else {
|
||||
@@ -88,9 +88,9 @@ public class WorldEditRendererWrapper20 implements WorldEditRendererWrapper {
|
||||
BlockData block = material.createBlockData();
|
||||
|
||||
BoxPair boxPair = boxes.computeIfAbsent(player, __ -> new HashMap<>()).computeIfAbsent(owner, __ -> new BoxPair());
|
||||
CAABox box = boxPair.get(clipboard);
|
||||
CWireframe box = boxPair.get(clipboard);
|
||||
if (box == null) {
|
||||
box = new CAABox(server);
|
||||
box = new CWireframe(server);
|
||||
boxPair.set(clipboard, box);
|
||||
}
|
||||
box.setPos1(null).setPos2(null);
|
||||
@@ -112,11 +112,11 @@ public class WorldEditRendererWrapper20 implements WorldEditRendererWrapper {
|
||||
if (owner != null) {
|
||||
BoxPair boxPair = pairs.get(owner);
|
||||
if (boxPair == null) return;
|
||||
CAABox box = boxPair.get(clipboard);
|
||||
CWireframe box = boxPair.get(clipboard);
|
||||
if (box != null) box.hide(hide);
|
||||
} else {
|
||||
pairs.values().forEach(boxPair -> {
|
||||
CAABox box = boxPair.get(clipboard);
|
||||
CWireframe box = boxPair.get(clipboard);
|
||||
if (box != null) box.hide(hide);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user