9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 02:19:23 +00:00

完善含水方块

This commit is contained in:
XiaoMoMi
2025-06-28 19:47:37 +08:00
parent 83bd27e774
commit cb48025194
6 changed files with 109 additions and 8 deletions

View File

@@ -74,8 +74,8 @@ public abstract class AbstractCustomBlock implements CustomBlock {
for (ImmutableBlockState state : this.getPossibleStates(tag)) {
state.setBehavior(this.behavior);
state.setSettings(blockStateVariant.settings());
state.setVanillaBlockState(BlockRegistryMirror.stateByRegistryId(vanillaStateRegistryId));
state.setCustomBlockState(BlockRegistryMirror.stateByRegistryId(blockStateVariant.internalRegistryId()));
state.setVanillaBlockState((BlockStateWrapper.VanillaBlockState) BlockRegistryMirror.stateByRegistryId(vanillaStateRegistryId));
state.setCustomBlockState((BlockStateWrapper.CustomBlockState) BlockRegistryMirror.stateByRegistryId(blockStateVariant.internalRegistryId()));
}
}
// double check if there's any invalid state

View File

@@ -19,9 +19,8 @@ import java.util.List;
public final class ImmutableBlockState extends BlockStateHolder {
private CompoundTag tag;
private BlockStateWrapper customBlockState;
private BlockStateWrapper vanillaBlockState;
private BlockStateWrapper.CustomBlockState customBlockState;
private BlockStateWrapper.VanillaBlockState vanillaBlockState;
private BlockBehavior behavior;
private Integer hashCode;
private BlockSettings settings;
@@ -76,11 +75,11 @@ public final class ImmutableBlockState extends BlockStateHolder {
return this.vanillaBlockState;
}
public void setCustomBlockState(@NotNull BlockStateWrapper customBlockState) {
public void setCustomBlockState(@NotNull BlockStateWrapper.CustomBlockState customBlockState) {
this.customBlockState = customBlockState;
}
public void setVanillaBlockState(@NotNull BlockStateWrapper vanillaBlockState) {
public void setVanillaBlockState(@NotNull BlockStateWrapper.VanillaBlockState vanillaBlockState) {
this.vanillaBlockState = vanillaBlockState;
}