mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-26 02:19:23 +00:00
不对不对
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user