为状态管理控制器添加方块属性

This commit is contained in:
GaLi 2025-08-30 11:59:05 +08:00
parent 0e90d9825a
commit 45e927cf27
3 changed files with 16 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.network.NetworkHooks;
public class NetworkPatternControllerBlock extends Block implements EntityBlock {
public NetworkPatternControllerBlock(Properties props) {
super(props);
}
@ -30,7 +31,6 @@ public class NetworkPatternControllerBlock extends Block implements EntityBlock
BlockEntity be = level.getBlockEntity(pos);
if (be instanceof MenuProvider provider && player instanceof ServerPlayer sp) {
NetworkHooks.openScreen(sp, provider, pos);
return InteractionResult.CONSUME;
}
}
return InteractionResult.sidedSuccess(level.isClientSide);

View File

@ -0,0 +1,14 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{ "type": "minecraft:item", "name": "extendedae_plus:network_pattern_controller" }
],
"conditions": [
{ "condition": "minecraft:survives_explosion" }
]
}
]
}

View File

@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"extendedae_plus:network_pattern_controller",
"extendedae_plus:wireless_transceiver",
"extendedae_plus:4x_crafting_accelerator",
"extendedae_plus:16x_crafting_accelerator",