geforkt von Mirrors/FastAsyncWorldEdit
Fix inventory mode + nbt
Dieser Commit ist enthalten in:
Ursprung
00ac111e46
Commit
f07dfbfeff
@ -5,9 +5,12 @@ import com.boydti.fawe.object.exception.FaweException;
|
|||||||
import com.boydti.fawe.util.ReflectionUtils;
|
import com.boydti.fawe.util.ReflectionUtils;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.Tag;
|
import com.sk89q.jnbt.Tag;
|
||||||
|
import com.sk89q.worldedit.Vector;
|
||||||
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||||
import com.sk89q.worldedit.extent.inventory.BlockBagException;
|
import com.sk89q.worldedit.extent.inventory.BlockBagException;
|
||||||
import com.sk89q.worldedit.extent.inventory.UnplaceableBlockException;
|
import com.sk89q.worldedit.extent.inventory.UnplaceableBlockException;
|
||||||
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
@ -68,9 +71,19 @@ public class BlockBagChangeSet extends AbstractDelegateChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(int x, int y, int z, int combinedFrom, int combinedTo) {
|
public void add(Vector loc, BlockStateHolder from, BlockStateHolder to) {
|
||||||
BlockType typeFrom = BlockTypes.getFromStateId(combinedFrom);
|
int x = loc.getBlockX();
|
||||||
BlockType typeTo = BlockTypes.getFromStateId(combinedTo);
|
int y = loc.getBlockY();
|
||||||
|
int z = loc.getBlockZ();
|
||||||
|
add(x, y, z, from, to);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(int x, int y, int z, BlockStateHolder from, BlockStateHolder to) {
|
||||||
|
check(from.getBlockType(), to.getBlockType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void check(BlockType typeFrom, BlockType typeTo) {
|
||||||
if (!typeTo.getMaterial().isAir()) {
|
if (!typeTo.getMaterial().isAir()) {
|
||||||
try {
|
try {
|
||||||
blockBag.fetchPlacedBlock(typeTo.getDefaultState());
|
blockBag.fetchPlacedBlock(typeTo.getDefaultState());
|
||||||
@ -89,6 +102,13 @@ public class BlockBagChangeSet extends AbstractDelegateChangeSet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(int x, int y, int z, int combinedFrom, int combinedTo) {
|
||||||
|
BlockType typeFrom = BlockTypes.getFromStateId(combinedFrom);
|
||||||
|
BlockType typeTo = BlockTypes.getFromStateId(combinedTo);
|
||||||
|
check(typeFrom, typeTo);
|
||||||
super.add(x, y, z, combinedFrom, combinedTo);
|
super.add(x, y, z, combinedFrom, combinedTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren