init包
This commit is contained in:
parent
a8bf4023f7
commit
9c8756ca59
|
|
@ -42,45 +42,35 @@ public final class ModBlocks {
|
|||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_4x = BLOCKS.register(
|
||||
"4x_crafting_accelerator",
|
||||
() -> {
|
||||
var b = new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_4x);
|
||||
b.setBlockEntity(CraftingBlockEntity.class, AEBlockEntities.CRAFTING_UNIT, null, null);
|
||||
return b;
|
||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_4x);
|
||||
}
|
||||
);
|
||||
|
||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_16x = BLOCKS.register(
|
||||
"16x_crafting_accelerator",
|
||||
() -> {
|
||||
var b = new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_16x);
|
||||
b.setBlockEntity(CraftingBlockEntity.class, AEBlockEntities.CRAFTING_UNIT, null, null);
|
||||
return b;
|
||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_16x);
|
||||
}
|
||||
);
|
||||
|
||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_64x = BLOCKS.register(
|
||||
"64x_crafting_accelerator",
|
||||
() -> {
|
||||
var b = new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_64x);
|
||||
b.setBlockEntity(CraftingBlockEntity.class, AEBlockEntities.CRAFTING_UNIT, null, null);
|
||||
return b;
|
||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_64x);
|
||||
}
|
||||
);
|
||||
|
||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_256x = BLOCKS.register(
|
||||
"256x_crafting_accelerator",
|
||||
() -> {
|
||||
var b = new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_256x);
|
||||
b.setBlockEntity(CraftingBlockEntity.class, AEBlockEntities.CRAFTING_UNIT, null, null);
|
||||
return b;
|
||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_256x);
|
||||
}
|
||||
);
|
||||
|
||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_1024x = BLOCKS.register(
|
||||
"1024x_crafting_accelerator",
|
||||
() -> {
|
||||
var b = new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_1024x);
|
||||
b.setBlockEntity(CraftingBlockEntity.class, AEBlockEntities.CRAFTING_UNIT, null, null);
|
||||
return b;
|
||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_1024x);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import net.minecraft.world.inventory.MenuType;
|
|||
import net.minecraft.core.registries.Registries;
|
||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
import net.neoforged.neoforge.common.extensions.IMenuTypeExtension;
|
||||
|
||||
public final class ModMenuTypes {
|
||||
private ModMenuTypes() {}
|
||||
|
|
@ -15,5 +16,5 @@ public final class ModMenuTypes {
|
|||
|
||||
public static final DeferredHolder<MenuType<?>, MenuType<NetworkPatternControllerMenu>> NETWORK_PATTERN_CONTROLLER =
|
||||
MENUS.register("network_pattern_controller",
|
||||
() -> new MenuType<>(NetworkPatternControllerMenu::new));
|
||||
() -> IMenuTypeExtension.create((id, inv, buf) -> new NetworkPatternControllerMenu(id, inv, buf)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,11 +234,14 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
|||
|
||||
// 发送我们自己的 C2S 包:OpenProviderUiC2SPacket
|
||||
try {
|
||||
ModNetwork.CHANNEL.sendToServer(new OpenProviderUiC2SPacket(
|
||||
posLong,
|
||||
new ResourceLocation(dimStr),
|
||||
faceOrd
|
||||
));
|
||||
var dimRl = net.minecraft.resources.ResourceLocation.parse(dimStr);
|
||||
if (dimRl != null) {
|
||||
ModNetwork.CHANNEL.sendToServer(new OpenProviderUiC2SPacket(
|
||||
posLong,
|
||||
dimRl,
|
||||
faceOrd
|
||||
));
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
// 静默失败:不提示玩家
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user