SPIGOT-2679: Add meta for StructureBlock

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-09-18 09:58:54 +10:00
parent 2a63c00f21
commit 40acfc98f2
5 changed files with 42 additions and 5 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}