mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-12-01 07:03:52 +01:00
Fix rotation
fixes rotation for signs, banners and nbt data
This commit is contained in:
parent
f13c01a177
commit
3c371d2eb1
@ -78,11 +78,19 @@ public class BlockTransformExtent extends AbstractDelegateExtent {
|
||||
}
|
||||
|
||||
private final BaseBlock transformFast(BaseBlock block) {
|
||||
return BLOCK_TRANSFORM[FaweCache.getCombined(block)];
|
||||
BaseBlock newBlock = BLOCK_TRANSFORM[FaweCache.getCombined(block)];
|
||||
if (block.hasNbtData()) {
|
||||
newBlock.setNbtData(block.getNbtData());
|
||||
}
|
||||
return newBlock;
|
||||
}
|
||||
|
||||
private final BaseBlock transformFastInverse(BaseBlock block) {
|
||||
return BLOCK_TRANSFORM_INVERSE[FaweCache.getCombined(block)];
|
||||
BaseBlock newBlock = BLOCK_TRANSFORM_INVERSE[FaweCache.getCombined(block)];
|
||||
if (block.hasNbtData()) {
|
||||
newBlock.setNbtData(block.getNbtData());
|
||||
}
|
||||
return newBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.worldedit.session;
|
||||
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
|
||||
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
|
||||
@ -97,7 +96,6 @@ public class PasteBuilder {
|
||||
extent = new BlockTransformExtent(extent, transform, targetWorldData.getBlockRegistry());
|
||||
}
|
||||
ForwardExtentCopy copy = new ForwardExtentCopy(extent, clipboard.getRegion(), clipboard.getOrigin(), targetExtent, to);
|
||||
System.out.println(clipboard.getRegion());
|
||||
copy.setTransform(transform);
|
||||
if (ignoreAirBlocks) {
|
||||
copy.setSourceMask(new ExistingBlockMask(clipboard));
|
||||
|
@ -114,6 +114,33 @@ public class BundledBlockData {
|
||||
if (bot != null && bot.getDirection() == null) {
|
||||
bot.setDirection(new Vector(0, -1, 0));
|
||||
}
|
||||
} else {
|
||||
FaweState dir = entry.states.get("rotation");
|
||||
if (dir != null && dir.values != null) {
|
||||
Vector[] dirs = new Vector[]{new Vector(0, 0, -1),
|
||||
new Vector(0.5, 0, -1),
|
||||
new Vector(1, 0, -1),
|
||||
new Vector(1, 0, -0.5),
|
||||
new Vector(1, 0, 0),
|
||||
new Vector(1, 0, 0.5),
|
||||
new Vector(1, 0, 1),
|
||||
new Vector(0.5, 0, 1),
|
||||
new Vector(0, 0, 1),
|
||||
new Vector(-0.5, 0, 1),
|
||||
new Vector(-1, 0, 1),
|
||||
new Vector(-1, 0, 0.5),
|
||||
new Vector(-1, 0, 0),
|
||||
new Vector(-1, 0, -0.5),
|
||||
new Vector(-1, 0, -1),
|
||||
new Vector(-0.5, 0, -1)};
|
||||
int len = dir.values.size();
|
||||
int increment = 16 / len;
|
||||
int index = 0;
|
||||
for (Map.Entry<String, FaweStateValue> valuesEntry : dir.values.entrySet()) {
|
||||
valuesEntry.getValue().setDirection(dirs[index]);
|
||||
index += increment;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user