mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
SPIGOT-5886: Missing BlockData
This commit is contained in:
parent
32acc26217
commit
89c0a5c34d
@ -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 New Issue
Block a user