From 51e69e67884725afd3186e2014cd7ca142608cf3 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 24 Aug 2024 07:42:35 +1000 Subject: [PATCH] SPIGOT-7873: Add powered state for skulls By: md_5 --- .../block/impl/CraftPiglinWallSkull.java | 16 +++++++++++++++- .../craftbukkit/block/impl/CraftSkull.java | 16 +++++++++++++++- .../craftbukkit/block/impl/CraftSkullPlayer.java | 16 +++++++++++++++- .../block/impl/CraftSkullPlayerWall.java | 16 +++++++++++++++- .../craftbukkit/block/impl/CraftSkullWall.java | 16 +++++++++++++++- .../craftbukkit/block/impl/CraftWitherSkull.java | 16 +++++++++++++++- .../block/impl/CraftWitherSkullWall.java | 16 +++++++++++++++- 7 files changed, 105 insertions(+), 7 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java index 8e797a09e3..9eec1f4f19 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftPiglinWallSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { +public final class CraftPiglinWallSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { public CraftPiglinWallSkull() { super(); @@ -31,4 +31,18 @@ public final class CraftPiglinWallSkull extends org.bukkit.craftbukkit.block.dat public java.util.Set getFaces() { return getValues(FACING, org.bukkit.block.BlockFace.class); } + + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.PiglinWallSkullBlock.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkull.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkull.java index 255b87af63..c216b26c67 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkull.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkull.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Rotatable { +public final class CraftSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Skull, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rotatable { public CraftSkull() { super(); @@ -13,6 +13,20 @@ public final class CraftSkull extends org.bukkit.craftbukkit.block.data.CraftBlo super(state); } + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.BlockSkull.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } + // org.bukkit.craftbukkit.block.data.CraftRotatable private static final net.minecraft.world.level.block.state.properties.BlockStateInteger ROTATION = getInteger(net.minecraft.world.level.block.BlockSkull.class, "rotation"); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java index 8637b414d1..42398dd641 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Rotatable { +public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Skull, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rotatable { public CraftSkullPlayer() { super(); @@ -13,6 +13,20 @@ public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.Cr super(state); } + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.BlockSkullPlayer.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } + // org.bukkit.craftbukkit.block.data.CraftRotatable private static final net.minecraft.world.level.block.state.properties.BlockStateInteger ROTATION = getInteger(net.minecraft.world.level.block.BlockSkullPlayer.class, "rotation"); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java index 14e5260921..9e8cc352be 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftSkullPlayerWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { +public final class CraftSkullPlayerWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { public CraftSkullPlayerWall() { super(); @@ -31,4 +31,18 @@ public final class CraftSkullPlayerWall extends org.bukkit.craftbukkit.block.dat public java.util.Set getFaces() { return getValues(FACING, org.bukkit.block.BlockFace.class); } + + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.BlockSkullPlayerWall.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java index 74e8f65dab..60f038d628 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftSkullWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { +public final class CraftSkullWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { public CraftSkullWall() { super(); @@ -31,4 +31,18 @@ public final class CraftSkullWall extends org.bukkit.craftbukkit.block.data.Craf public java.util.Set getFaces() { return getValues(FACING, org.bukkit.block.BlockFace.class); } + + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.BlockSkullWall.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java index b44192bf9c..f7dc11eed6 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftWitherSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Rotatable { +public final class CraftWitherSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Skull, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rotatable { public CraftWitherSkull() { super(); @@ -13,6 +13,20 @@ public final class CraftWitherSkull extends org.bukkit.craftbukkit.block.data.Cr super(state); } + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.BlockWitherSkull.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } + // org.bukkit.craftbukkit.block.data.CraftRotatable private static final net.minecraft.world.level.block.state.properties.BlockStateInteger ROTATION = getInteger(net.minecraft.world.level.block.BlockWitherSkull.class, "rotation"); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java index 206012086f..7298580603 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftWitherSkullWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { +public final class CraftWitherSkullWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { public CraftWitherSkullWall() { super(); @@ -31,4 +31,18 @@ public final class CraftWitherSkullWall extends org.bukkit.craftbukkit.block.dat public java.util.Set getFaces() { return getValues(FACING, org.bukkit.block.BlockFace.class); } + + // org.bukkit.craftbukkit.block.data.CraftPowerable + + private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean POWERED = getBoolean(net.minecraft.world.level.block.BlockWitherSkullWall.class, "powered"); + + @Override + public boolean isPowered() { + return get(POWERED); + } + + @Override + public void setPowered(boolean powered) { + set(POWERED, powered); + } }