mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
Add FaceAttachable interface to handle Grindstone facing in common with Switches
This commit is contained in:
parent
95bd4238fb
commit
3075579f61
@ -0,0 +1,18 @@
|
||||
package org.bukkit.craftbukkit.block.data;
|
||||
|
||||
import org.bukkit.block.data.FaceAttachable;
|
||||
|
||||
public abstract class CraftFaceAttachable extends CraftBlockData implements FaceAttachable {
|
||||
|
||||
private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum("face");
|
||||
|
||||
@Override
|
||||
public AttachedFace getAttachedFace() {
|
||||
return get(ATTACH_FACE, AttachedFace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttachedFace(AttachedFace face) {
|
||||
set(ATTACH_FACE, face);
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftGrindstone extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
|
||||
public final class CraftGrindstone extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Grindstone, org.bukkit.block.data.Directional, org.bukkit.block.data.FaceAttachable {
|
||||
|
||||
public CraftGrindstone() {
|
||||
super();
|
||||
@ -31,4 +31,18 @@ public final class CraftGrindstone extends org.bukkit.craftbukkit.block.data.Cra
|
||||
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
|
||||
return getValues(FACING, org.bukkit.block.BlockFace.class);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftFaceAttachable
|
||||
|
||||
private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum(net.minecraft.server.BlockGrindstone.class, "face");
|
||||
|
||||
@Override
|
||||
public AttachedFace getAttachedFace() {
|
||||
return get(ATTACH_FACE, AttachedFace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttachedFace(AttachedFace face) {
|
||||
set(ATTACH_FACE, face);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftLever extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable {
|
||||
public final class CraftLever extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.FaceAttachable, org.bukkit.block.data.Powerable {
|
||||
|
||||
public CraftLever() {
|
||||
super();
|
||||
@ -46,6 +46,20 @@ public final class CraftLever extends org.bukkit.craftbukkit.block.data.CraftBlo
|
||||
return getValues(FACING, org.bukkit.block.BlockFace.class);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftFaceAttachable
|
||||
|
||||
private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum(net.minecraft.server.BlockLever.class, "face");
|
||||
|
||||
@Override
|
||||
public AttachedFace getAttachedFace() {
|
||||
return get(ATTACH_FACE, AttachedFace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttachedFace(AttachedFace face) {
|
||||
set(ATTACH_FACE, face);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftPowerable
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean POWERED = getBoolean(net.minecraft.server.BlockLever.class, "powered");
|
||||
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftStoneButton extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable {
|
||||
public final class CraftStoneButton extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.FaceAttachable, org.bukkit.block.data.Powerable {
|
||||
|
||||
public CraftStoneButton() {
|
||||
super();
|
||||
@ -46,6 +46,20 @@ public final class CraftStoneButton extends org.bukkit.craftbukkit.block.data.Cr
|
||||
return getValues(FACING, org.bukkit.block.BlockFace.class);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftFaceAttachable
|
||||
|
||||
private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum(net.minecraft.server.BlockStoneButton.class, "face");
|
||||
|
||||
@Override
|
||||
public AttachedFace getAttachedFace() {
|
||||
return get(ATTACH_FACE, AttachedFace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttachedFace(AttachedFace face) {
|
||||
set(ATTACH_FACE, face);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftPowerable
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean POWERED = getBoolean(net.minecraft.server.BlockStoneButton.class, "powered");
|
||||
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftWoodButton extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable {
|
||||
public final class CraftWoodButton extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.FaceAttachable, org.bukkit.block.data.Powerable {
|
||||
|
||||
public CraftWoodButton() {
|
||||
super();
|
||||
@ -46,6 +46,20 @@ public final class CraftWoodButton extends org.bukkit.craftbukkit.block.data.Cra
|
||||
return getValues(FACING, org.bukkit.block.BlockFace.class);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftFaceAttachable
|
||||
|
||||
private static final net.minecraft.server.BlockStateEnum<?> ATTACH_FACE = getEnum(net.minecraft.server.BlockWoodButton.class, "face");
|
||||
|
||||
@Override
|
||||
public AttachedFace getAttachedFace() {
|
||||
return get(ATTACH_FACE, AttachedFace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttachedFace(AttachedFace face) {
|
||||
set(ATTACH_FACE, face);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftPowerable
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean POWERED = getBoolean(net.minecraft.server.BlockWoodButton.class, "powered");
|
||||
|
Loading…
Reference in New Issue
Block a user