mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
SPIGOT-5886: Missing BlockData
By: md_5 <git@md-5.net>
This commit is contained in:
parent
8b8fc993bd
commit
aef11bebb7
3 changed files with 37 additions and 1 deletions
|
@ -5,10 +5,21 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
|||
|
||||
public abstract class CraftWall extends CraftBlockData implements Wall {
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean UP = getBoolean("up");
|
||||
private static final net.minecraft.server.BlockStateEnum<?>[] HEIGHTS = new net.minecraft.server.BlockStateEnum[]{
|
||||
getEnum("north"), getEnum("east"), getEnum("south"), getEnum("west")
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean isUp() {
|
||||
return get(UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp(boolean up) {
|
||||
set(UP, up);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Height getHeight(org.bukkit.block.BlockFace face) {
|
||||
return get(HEIGHTS[face.ordinal()], Height.class);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftBell extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Bell, org.bukkit.block.data.Directional {
|
||||
public final class CraftBell extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Bell, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable {
|
||||
|
||||
public CraftBell() {
|
||||
super();
|
||||
|
@ -45,4 +45,18 @@ public final class CraftBell extends org.bukkit.craftbukkit.block.data.CraftBloc
|
|||
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
|
||||
return getValues(FACING, org.bukkit.block.BlockFace.class);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftPowerable
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean POWERED = getBoolean(net.minecraft.server.BlockBell.class, "powered");
|
||||
|
||||
@Override
|
||||
public boolean isPowered() {
|
||||
return get(POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPowered(boolean powered) {
|
||||
set(POWERED, powered);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,10 +15,21 @@ public final class CraftCobbleWall extends org.bukkit.craftbukkit.block.data.Cra
|
|||
|
||||
// org.bukkit.craftbukkit.block.data.type.CraftWall
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean UP = getBoolean(net.minecraft.server.BlockCobbleWall.class, "up");
|
||||
private static final net.minecraft.server.BlockStateEnum<?>[] HEIGHTS = new net.minecraft.server.BlockStateEnum[]{
|
||||
getEnum(net.minecraft.server.BlockCobbleWall.class, "north"), getEnum(net.minecraft.server.BlockCobbleWall.class, "east"), getEnum(net.minecraft.server.BlockCobbleWall.class, "south"), getEnum(net.minecraft.server.BlockCobbleWall.class, "west")
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean isUp() {
|
||||
return get(UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp(boolean up) {
|
||||
set(UP, up);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Height getHeight(org.bukkit.block.BlockFace face) {
|
||||
return get(HEIGHTS[face.ordinal()], Height.class);
|
||||
|
|
Loading…
Reference in a new issue