mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 11:26:42 +00:00
Further BaseBlock modernisation
This commit is contained in:
@ -20,8 +20,6 @@
|
||||
package com.sk89q.worldedit.world;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
@ -34,7 +32,6 @@ import com.sk89q.worldedit.function.mask.BlockMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
import com.sk89q.worldedit.util.TreeGenerator.TreeType;
|
||||
|
||||
import java.util.PriorityQueue;
|
||||
|
||||
@ -53,32 +50,6 @@ public abstract class AbstractWorld implements World {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean setBlockType(Vector position, int type) {
|
||||
try {
|
||||
return setBlock(position, new BaseBlock(type));
|
||||
} catch (WorldEditException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setBlockData(Vector position, int data) {
|
||||
try {
|
||||
setBlock(position, new BaseBlock(getLazyBlock(position).getType().getLegacyId(), data));
|
||||
} catch (WorldEditException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean setTypeIdAndData(Vector position, int type, int data) {
|
||||
try {
|
||||
return setBlock(position, new BaseBlock(type, data));
|
||||
} catch (WorldEditException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean setBlock(Vector pt, BaseBlock block) throws WorldEditException {
|
||||
return setBlock(pt, block, true);
|
||||
@ -89,17 +60,6 @@ public abstract class AbstractWorld implements World {
|
||||
return getMaximumPoint().getBlockY();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidBlockType(int type) {
|
||||
return BlockType.fromID(type) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesBlockData(int type) {
|
||||
// We future proof here by assuming all unknown blocks use data
|
||||
return BlockType.usesData(type) || BlockType.fromID(type) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mask createLiquidMask() {
|
||||
return new BlockMask(this,
|
||||
@ -124,7 +84,7 @@ public abstract class AbstractWorld implements World {
|
||||
if (stack != null) {
|
||||
final int amount = stack.getAmount();
|
||||
if (amount > 1) {
|
||||
dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getData()), amount);
|
||||
dropItem(pt, new BaseItemStack(stack.getType(), stack.getNbtData(), 1), amount);
|
||||
} else {
|
||||
dropItem(pt, stack, amount);
|
||||
}
|
||||
@ -137,31 +97,6 @@ public abstract class AbstractWorld implements World {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException {
|
||||
return generateTree(TreeType.TREE, editSession, pt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateBigTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException {
|
||||
return generateTree(TreeType.BIG_TREE, editSession, pt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateBirchTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException {
|
||||
return generateTree(TreeType.BIRCH, editSession, pt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException {
|
||||
return generateTree(TreeType.REDWOOD, editSession, pt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException {
|
||||
return generateTree(TreeType.TALL_REDWOOD, editSession, pt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkLoadedChunk(Vector pt) {
|
||||
}
|
||||
|
Reference in New Issue
Block a user