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-09-04 05:53:03 +08:00
parent 75fb818c40
commit 1c7ce470a1
3 changed files with 6 additions and 26 deletions

View File

@@ -61,9 +61,6 @@ public abstract class AbstractCustomBlock implements CustomBlock {
this.placementFunction = composite(placements);
EntityBlockBehavior entityBlockBehavior = this.behavior.getEntityBehavior();
boolean isEntityBlock = entityBlockBehavior != null;
if (isEntityBlock) {
settings.toBlockEntitySettings();
}
for (Map.Entry<String, BlockStateVariant> entry : variantMapper.entrySet()) {
String nbtString = entry.getKey();
CompoundTag tag = BlockNbtParser.deserialize(this, nbtString);
@@ -82,7 +79,7 @@ public abstract class AbstractCustomBlock implements CustomBlock {
}
// Late init states
ImmutableBlockState state = possibleStates.getFirst();
state.setSettings(isEntityBlock ? blockStateVariant.settings().toBlockEntitySettings() : blockStateVariant.settings());
state.setSettings(blockStateVariant.settings());
state.setVanillaBlockState(BlockRegistryMirror.stateByRegistryId(vanillaStateRegistryId));
state.setCustomBlockState(BlockRegistryMirror.stateByRegistryId(blockStateVariant.internalRegistryId()));
}

View File

@@ -110,13 +110,6 @@ public class BlockSettings {
return newSettings;
}
public BlockSettings toBlockEntitySettings() {
if (!this.pushReaction.allowedForBlockEntity()) {
this.pushReaction = PushReaction.BLOCK;
}
return this;
}
public Set<Key> tags() {
return tags;
}

View File

@@ -1,19 +1,9 @@
package net.momirealms.craftengine.core.block;
public enum PushReaction {
NORMAL(false),
DESTROY(true),
BLOCK(true),
IGNORE(false),
PUSH_ONLY(false);
private final boolean allowedForBlockEntity;
PushReaction(boolean allowedForBlockEntity) {
this.allowedForBlockEntity = allowedForBlockEntity;
}
public boolean allowedForBlockEntity() {
return allowedForBlockEntity;
}
NORMAL,
DESTROY,
BLOCK,
IGNORE,
PUSH_ONLY
}