mirror of
https://github.com/YouHaveTrouble/BlockEdit.git
synced 2026-06-29 21:46:19 +00:00
experiments for clipboard
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
package me.youhavetrouble.blockedit.util;
|
||||||
|
|
||||||
|
import org.bukkit.block.BlockState;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Clipboard {
|
||||||
|
|
||||||
|
private HashMap<RelativeLocation, BlockState> blocks = new HashMap<>();
|
||||||
|
|
||||||
|
public Clipboard() {}
|
||||||
|
|
||||||
|
public void setBlocks(HashMap<RelativeLocation, BlockState> newClipboard) {
|
||||||
|
this.blocks = newClipboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<RelativeLocation, BlockState> getBlocks() {
|
||||||
|
return Collections.unmodifiableMap(this.blocks);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
this.blocks.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return this.blocks.isEmpty();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package me.youhavetrouble.blockedit.util;
|
||||||
|
|
||||||
|
public class RelativeLocation {
|
||||||
|
|
||||||
|
private double x, y, z;
|
||||||
|
|
||||||
|
public RelativeLocation(double x, double y, double z) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setX(double x) {
|
||||||
|
this.x = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setY(double y) {
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getZ() {
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZ(double z) {
|
||||||
|
this.z = z;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user