@@ -304,6 +304,8 @@ public class CraftBlock implements Block {
|
||||
return new CraftBanner(this);
|
||||
case FLOWER_POT:
|
||||
return new CraftFlowerPot(this);
|
||||
case STRUCTURE_BLOCK:
|
||||
return new CraftStructureBlock(this);
|
||||
default:
|
||||
return new CraftBlockState(this);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityStructure;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
|
||||
public class CraftStructureBlock extends CraftBlockState {
|
||||
|
||||
private final TileEntityStructure structure;
|
||||
|
||||
public CraftStructureBlock(Block block) {
|
||||
super(block);
|
||||
|
||||
this.structure = (TileEntityStructure) ((CraftWorld) block.getWorld()).getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public CraftStructureBlock(Material material, TileEntityStructure structure) {
|
||||
super(material);
|
||||
|
||||
this.structure = structure;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user