3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 11:30:06 +01:00

add missing block entity type to CraftBlockStates

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-08 17:04:46 -07:00
Ursprung a0a2e7287c
Commit 318a08c1db
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
2 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -39,7 +39,7 @@ index 87c25170fbe8b0591d452612496ee1a627138de7..a2894f02ceb7c58f6eafe055e1ff47b1
private final T tileEntity; private final T tileEntity;
private final T snapshot; private final T snapshot;
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index 17e1131c79ad140c0803a914621ce7924f0f2a6d..d7663b902b768030008b28f9a8f6dd324a30e38f 100644 index 17e1131c79ad140c0803a914621ce7924f0f2a6d..dc8e173ff40c164bf6149db4caedf0ee8dce727b 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
@ -50,7 +50,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..d7663b902b768030008b28f9a8f6dd32
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity; import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
import net.minecraft.world.level.block.entity.BrushableBlockEntity; import net.minecraft.world.level.block.entity.BrushableBlockEntity;
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity; import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
@@ -113,225 +114,61 @@ public final class CraftBlockStates { @@ -113,225 +114,62 @@ public final class CraftBlockStates {
private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) { private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) {
@Override @Override
public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
@ -316,6 +316,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..d7663b902b768030008b28f9a8f6dd32
+ register(BlockEntityType.SCULK_CATALYST, CraftSculkCatalyst.class, CraftSculkCatalyst::new); + register(BlockEntityType.SCULK_CATALYST, CraftSculkCatalyst.class, CraftSculkCatalyst::new);
+ register(BlockEntityType.SCULK_SENSOR, CraftSculkSensor.class, CraftSculkSensor::new); + register(BlockEntityType.SCULK_SENSOR, CraftSculkSensor.class, CraftSculkSensor::new);
+ register(BlockEntityType.SCULK_SHRIEKER, CraftSculkShrieker.class, CraftSculkShrieker::new); + register(BlockEntityType.SCULK_SHRIEKER, CraftSculkShrieker.class, CraftSculkShrieker::new);
+ register(BlockEntityType.CALIBRATED_SCULK_SENSOR, CraftCalibratedSculkSensor.class, CraftCalibratedSculkSensor::new);
+ register(BlockEntityType.SMOKER, CraftSmoker.class, CraftSmoker::new); + register(BlockEntityType.SMOKER, CraftSmoker.class, CraftSmoker::new);
+ register(BlockEntityType.MOB_SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new); + register(BlockEntityType.MOB_SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new);
+ register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new); + register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new);
@ -325,7 +326,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..d7663b902b768030008b28f9a8f6dd32
} }
private static void register(Material blockType, BlockStateFactory<?> factory) { private static void register(Material blockType, BlockStateFactory<?> factory) {
@@ -339,30 +176,33 @@ public final class CraftBlockStates { @@ -339,30 +177,33 @@ public final class CraftBlockStates {
} }
private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register( private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register(
@ -374,7 +375,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..d7663b902b768030008b28f9a8f6dd32
public static Class<? extends CraftBlockState> getBlockStateType(Material material) { public static Class<? extends CraftBlockState> getBlockStateType(Material material) {
Preconditions.checkNotNull(material, "material is null"); Preconditions.checkNotNull(material, "material is null");
return CraftBlockStates.getFactory(material).blockStateType; return CraftBlockStates.getFactory(material).blockStateType;
@@ -378,6 +218,13 @@ public final class CraftBlockStates { @@ -378,6 +219,13 @@ public final class CraftBlockStates {
return null; return null;
} }
@ -388,7 +389,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..d7663b902b768030008b28f9a8f6dd32
public static BlockState getBlockState(Block block) { public static BlockState getBlockState(Block block) {
// Paper start // Paper start
return CraftBlockStates.getBlockState(block, true); return CraftBlockStates.getBlockState(block, true);
@@ -435,7 +282,7 @@ public final class CraftBlockStates { @@ -435,7 +283,7 @@ public final class CraftBlockStates {
if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) { if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) {
factory = CraftBlockStates.DEFAULT_FACTORY; factory = CraftBlockStates.DEFAULT_FACTORY;
} else { } else {

Datei anzeigen

@ -112,10 +112,10 @@ index b9903c29bdea8d1e3b6fce0e97be6bd9493cfdf4..2ed78cf83c0ae66a6ddba1ff307da89a
public static boolean canSetSpawn(Level world) { public static boolean canSetSpawn(Level world) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index d7663b902b768030008b28f9a8f6dd324a30e38f..8666628a7e22e1f9ee9c2a9a56aa075087f24c88 100644 index dc8e173ff40c164bf6149db4caedf0ee8dce727b..f0acbb472830350f803b41f19126f3613d39e322 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -272,6 +272,12 @@ public final class CraftBlockStates { @@ -273,6 +273,12 @@ public final class CraftBlockStates {
BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag); BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag);
return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity); return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity);
} }