Update configs, and remove unused BlockData methods.

This commit is contained in:
Matthew Miller
2018-07-05 23:22:33 +10:00
parent d33e2e98aa
commit e1c2ea3a3b
13 changed files with 83 additions and 1298 deletions

View File

@ -366,13 +366,11 @@ public class ForgeWorld extends AbstractWorld {
@Override
public BaseBlock getFullBlock(Vector position) {
World world = getWorld();
BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ());
IBlockState state = world.getBlockState(pos);
TileEntity tile = getWorld().getTileEntity(pos);
if (tile != null) {
return new TileEntityBaseBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state), tile);
return new TileEntityBaseBlock(getBlock(position), tile);
} else {
return new BaseBlock(getBlock(position));
}

View File

@ -21,14 +21,14 @@ package com.sk89q.worldedit.forge;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.world.block.BlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public class TileEntityBaseBlock extends BaseBlock implements TileEntityBlock {
public TileEntityBaseBlock(int type, int data, TileEntity tile) {
super(type, data);
setNbtData(NBTConverter.fromNative(copyNbtData(tile)));
public TileEntityBaseBlock(BlockState state, TileEntity tile) {
super(state, NBTConverter.fromNative(copyNbtData(tile)));
}
private static NBTTagCompound copyNbtData(TileEntity tile) {