Clarify how getBlockState arguments are used

This commit is contained in:
TrollyLoki 2023-10-27 12:23:59 -04:00
parent 0f340abc21
commit 26254e31ea

View File

@ -5,16 +5,17 @@ Subject: [PATCH] Add raw byte block state serialization
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index e3b07d623cd64de9645f2372f1e08757edc1a9ed..c55969167cdb30a926158756c1ac21e489cde7e9 100644
index e3b07d623cd64de9645f2372f1e08757edc1a9ed..0046a230aa1331736f7e282c872528d19796fc17 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -231,13 +231,17 @@ public final class CraftBlockStates {
@@ -231,13 +231,18 @@ public final class CraftBlockStates {
return CraftBlockStates.getBlockState(block, true);
}
public static BlockState getBlockState(Block block, boolean useSnapshot) {
+ return CraftBlockStates.getBlockState(block, useSnapshot, null, null);
+ }
+ // customTileEntity is ignored if customBlockData is null
+ // if customBlockData is null, customTileEntity is ignored and the state is populated from the world
+ // otherwise, the state is populated using the values of customBlockData and customTileEntity, ignoring the current state of the world
+ public static BlockState getBlockState(Block block, boolean useSnapshot, net.minecraft.world.level.block.state.BlockState customBlockData, BlockEntity customTileEntity) {
// Paper end
Preconditions.checkNotNull(block, "block is null");