mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Also fix CPUOptimizedClipboard
This commit is contained in:
parent
280ade9994
commit
336b90be15
@ -152,10 +152,8 @@ public class CPUOptimizedClipboard extends LinearClipboard {
|
|||||||
@Override
|
@Override
|
||||||
public Collection<CompoundTag> getTileEntities() {
|
public Collection<CompoundTag> getTileEntities() {
|
||||||
convertTilesToIndex();
|
convertTilesToIndex();
|
||||||
for (Map.Entry<Integer, CompoundTag> entry : nbtMapIndex.entrySet()) {
|
nbtMapIndex.replaceAll((index, tag) -> {
|
||||||
int index = entry.getKey();
|
Map<String, Tag> values = new HashMap<>(tag.getValue());
|
||||||
CompoundTag tag = entry.getValue();
|
|
||||||
Map<String, Tag> values = tag.getValue();
|
|
||||||
if (!values.containsKey("x")) {
|
if (!values.containsKey("x")) {
|
||||||
int y = index / getArea();
|
int y = index / getArea();
|
||||||
index -= y * getArea();
|
index -= y * getArea();
|
||||||
@ -164,23 +162,26 @@ public class CPUOptimizedClipboard extends LinearClipboard {
|
|||||||
values.put("x", new IntTag(x));
|
values.put("x", new IntTag(x));
|
||||||
values.put("y", new IntTag(y));
|
values.put("y", new IntTag(y));
|
||||||
values.put("z", new IntTag(z));
|
values.put("z", new IntTag(z));
|
||||||
|
return new CompoundTag(values);
|
||||||
|
} else {
|
||||||
|
return tag;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return nbtMapIndex.values();
|
return nbtMapIndex.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setTile(int x, int y, int z, CompoundTag tag) {
|
public boolean setTile(int x, int y, int z, CompoundTag tag) {
|
||||||
nbtMapLoc.put(new IntTriple(x, y, z), tag);
|
nbtMapLoc.put(new IntTriple(x, y, z), new CompoundTag(tag.getValue()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setTile(int index, CompoundTag tag) {
|
public boolean setTile(int index, CompoundTag tag) {
|
||||||
nbtMapIndex.put(index, tag);
|
final Map<String, Tag> values = new HashMap<>(tag.getValue());
|
||||||
Map<String, Tag> values = tag.getValue();
|
|
||||||
values.remove("x");
|
values.remove("x");
|
||||||
values.remove("y");
|
values.remove("y");
|
||||||
values.remove("z");
|
values.remove("z");
|
||||||
|
nbtMapIndex.put(index, new CompoundTag(values));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user