Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8adb56496 | ||
|
|
50969e9c26 |
@@ -47,7 +47,7 @@ public class GuiArcaneCraftingTerminal extends MEStorageScreen<ContainerArcaneCr
|
||||
if (cachedAnchorY < 0) {
|
||||
for (var slot : this.menu.slots) {
|
||||
// CRAFTING_RESULT 槽在 style JSON 中 bottom:140
|
||||
if (slot instanceof AppEngCraftingSlot) {
|
||||
if (slot instanceof appeng.menu.slot.AppEngCraftingSlot) {
|
||||
cachedAnchorY = slot.y;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5,22 +5,22 @@ import thaumicenergistics.ThaumicEnergistics;
|
||||
|
||||
/**
|
||||
* 傀儡无线背包皮肤枚举。
|
||||
* 每种皮肤对应一个纹理文件:{@code textures/model/golemBackpack/{texId}.png}。
|
||||
* 每种皮肤对应一个纹理文件:{@code textures/model/golembackpack/{texId}.png}。
|
||||
* 皮肤通过 AE2 Facade 物品右键傀儡来更换。
|
||||
* 对应 1.7.10 的 {@code ItemGolemWirelessBackpack.BackpackSkins}。
|
||||
*/
|
||||
public enum BackpackSkins {
|
||||
|
||||
Thaumium("Thaum"),
|
||||
Stone("Stone"),
|
||||
Straw("Straw"),
|
||||
Wood("Wood"),
|
||||
Flesh("Flesh"),
|
||||
Clay("Clay"),
|
||||
Iron("Iron"),
|
||||
Tallow("Tallow"),
|
||||
Gold("Gold"),
|
||||
Diamond("Diamond");
|
||||
Thaumium("thaum"),
|
||||
Stone("stone"),
|
||||
Straw("straw"),
|
||||
Wood("wood"),
|
||||
Flesh("flesh"),
|
||||
Clay("clay"),
|
||||
Iron("iron"),
|
||||
Tallow("tallow"),
|
||||
Gold("gold"),
|
||||
Diamond("diamond");
|
||||
|
||||
public static final BackpackSkins[] VALUES = values();
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum BackpackSkins {
|
||||
public ResourceLocation getTextureLocation() {
|
||||
if (this.texture == null) {
|
||||
this.texture = ResourceLocation.fromNamespaceAndPath(
|
||||
ThaumicEnergistics.MODID, "textures/model/golemBackpack/" + this.texId + ".png");
|
||||
ThaumicEnergistics.MODID, "textures/model/golembackpack/" + this.texId + ".png");
|
||||
}
|
||||
return this.texture;
|
||||
}
|
||||
|
||||
@@ -383,11 +383,11 @@ public final class RecipeRegistration {
|
||||
return new ItemStack(s.get());
|
||||
}
|
||||
private static ItemStack tc(String name) {
|
||||
return new ItemStack(BuiltInRegistries.ITEM.get(
|
||||
return new ItemStack(net.minecraft.core.registries.BuiltInRegistries.ITEM.get(
|
||||
ResourceLocation.fromNamespaceAndPath("thaumcraft", name)));
|
||||
}
|
||||
private static ItemStack ae(String name) {
|
||||
return new ItemStack(BuiltInRegistries.ITEM.get(
|
||||
return new ItemStack(net.minecraft.core.registries.BuiltInRegistries.ITEM.get(
|
||||
ResourceLocation.fromNamespaceAndPath("ae2", name)));
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class PseudoResearchItem extends ResearchItem {
|
||||
} else {
|
||||
// 最终备选:ThE 研究 tab 图标
|
||||
pseudo = new PseudoResearchItem(pseudoKey, category, column, row,
|
||||
ResourceLocation.fromNamespaceAndPath(ThaumicEnergistics.MODID, "textures/research/tab_icon.png"),
|
||||
ResourceLocation.fromNamespaceAndPath(thaumicenergistics.ThaumicEnergistics.MODID, "textures/research/tab_icon.png"),
|
||||
realKey, realCategory);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ItemEssentiaCell extends Item implements IBasicCellItem {
|
||||
private final int totalTypes;
|
||||
private final double idleDrain;
|
||||
|
||||
public ItemEssentiaCell(Properties props, String tier, int kilobytes, int bytesPerType, int totalTypes, double idleDrain) {
|
||||
public ItemEssentiaCell(Item.Properties props, String tier, int kilobytes, int bytesPerType, int totalTypes, double idleDrain) {
|
||||
super(props.stacksTo(1));
|
||||
this.tier = tier;
|
||||
this.totalBytes = kilobytes * 1024;
|
||||
@@ -77,7 +77,7 @@ public class ItemEssentiaCell extends Item implements IBasicCellItem {
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, appeng.api.stacks.AEKey requestedAddition) {
|
||||
if (requestedAddition instanceof AEssentiaKey) {
|
||||
if (requestedAddition instanceof thaumicenergistics.common.integration.appeng.AEssentiaKey) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -208,19 +208,19 @@ public class ItemEssentiaCell extends Item implements IBasicCellItem {
|
||||
}
|
||||
|
||||
// ===== 工厂方法 =====
|
||||
public static ItemEssentiaCell create1k(Properties props) {
|
||||
public static ItemEssentiaCell create1k(Item.Properties props) {
|
||||
return new ItemEssentiaCell(props, "1k", 1, 8, ThEConfig.CELL_MAX_TYPES, 0.5);
|
||||
}
|
||||
public static ItemEssentiaCell create4k(Properties props) {
|
||||
public static ItemEssentiaCell create4k(Item.Properties props) {
|
||||
return new ItemEssentiaCell(props, "4k", 4, 8, ThEConfig.CELL_MAX_TYPES, 1.0);
|
||||
}
|
||||
public static ItemEssentiaCell create16k(Properties props) {
|
||||
public static ItemEssentiaCell create16k(Item.Properties props) {
|
||||
return new ItemEssentiaCell(props, "16k", 16, 8, ThEConfig.CELL_MAX_TYPES, 1.5);
|
||||
}
|
||||
public static ItemEssentiaCell create64k(Properties props) {
|
||||
public static ItemEssentiaCell create64k(Item.Properties props) {
|
||||
return new ItemEssentiaCell(props, "64k", 64, 8, ThEConfig.CELL_MAX_TYPES, 2.0);
|
||||
}
|
||||
public static ItemEssentiaCell createCreative(Properties props) {
|
||||
public static ItemEssentiaCell createCreative(Item.Properties props) {
|
||||
return new ItemEssentiaCell(props, "creative", Integer.MAX_VALUE / 1024, 8, 63, 0.0);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class ItemGolemWirelessBackpack extends Item {
|
||||
public static final IGridLinkableHandler LINKABLE_HANDLER = new LinkableHandler();
|
||||
|
||||
public ItemGolemWirelessBackpack() {
|
||||
super(new Properties().stacksTo(1).durability(0));
|
||||
super(new Item.Properties().stacksTo(1).durability(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
public class PartItemEssentiaExportBus extends Item implements IPartItem<EssentiaExportBusPart> {
|
||||
|
||||
public static PartItemEssentiaExportBus create() {
|
||||
return new PartItemEssentiaExportBus(new Properties().stacksTo(64));
|
||||
return new PartItemEssentiaExportBus(new Item.Properties().stacksTo(64));
|
||||
}
|
||||
|
||||
public PartItemEssentiaExportBus(Properties properties) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
public class PartItemEssentiaImportBus extends Item implements IPartItem<EssentiaImportBusPart> {
|
||||
|
||||
public static PartItemEssentiaImportBus create() {
|
||||
return new PartItemEssentiaImportBus(new Properties().stacksTo(64));
|
||||
return new PartItemEssentiaImportBus(new Item.Properties().stacksTo(64));
|
||||
}
|
||||
|
||||
public PartItemEssentiaImportBus(Properties properties) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
public class PartItemEssentiaStorageBus extends Item implements IPartItem<EssentiaStorageBusPart> {
|
||||
|
||||
public static PartItemEssentiaStorageBus create() {
|
||||
return new PartItemEssentiaStorageBus(new Properties().stacksTo(64));
|
||||
return new PartItemEssentiaStorageBus(new Item.Properties().stacksTo(64));
|
||||
}
|
||||
|
||||
public PartItemEssentiaStorageBus(Properties properties) {
|
||||
|
||||
@@ -19,8 +19,8 @@ public class TransportPermissions implements IThETransportPermissions {
|
||||
@Override
|
||||
public <T extends BlockEntity> boolean addTileToInject(Class<T> c, int cap) { return tileInject.putIfAbsent(c, cap) == null; }
|
||||
@Override
|
||||
public OptionalLong getCapacityForTile(Class<? extends BlockEntity> c) {
|
||||
Integer v = tileExtract.get(c); return v != null ? OptionalLong.of(v) : OptionalLong.empty();
|
||||
public java.util.OptionalLong getCapacityForTile(Class<? extends BlockEntity> c) {
|
||||
Integer v = tileExtract.get(c); return v != null ? java.util.OptionalLong.of(v) : java.util.OptionalLong.empty();
|
||||
}
|
||||
@Override
|
||||
public boolean canExtract(BlockEntity tile) { return tile != null && tileExtract.containsKey(tile.getClass()); }
|
||||
|
||||
@@ -141,7 +141,7 @@ public class TileArcaneAssembler extends ThETileBase
|
||||
super(ModBlockEntities.ARCANE_ASSEMBLER.get(), pos, state);
|
||||
|
||||
mainNode = GridHelper.createManagedNode(this, nodeListener)
|
||||
.setVisualRepresentation(ModItems.ARCANE_ASSEMBLER_ITEM.get())
|
||||
.setVisualRepresentation(thaumicenergistics.init.ModItems.ARCANE_ASSEMBLER_ITEM.get())
|
||||
.setInWorldNode(true)
|
||||
.setTagName("proxy")
|
||||
.setFlags(GridFlags.REQUIRE_CHANNEL)
|
||||
@@ -514,7 +514,7 @@ public class TileArcaneAssembler extends ThETileBase
|
||||
|
||||
@Override
|
||||
public PatternContainerGroup getCraftingMachineInfo() {
|
||||
ItemStack icon = new ItemStack(ModItems.ARCANE_ASSEMBLER_ITEM.get());
|
||||
ItemStack icon = new ItemStack(thaumicenergistics.init.ModItems.ARCANE_ASSEMBLER_ITEM.get());
|
||||
return new PatternContainerGroup(
|
||||
AEItemKey.of(icon),
|
||||
net.minecraft.network.chat.Component.translatable("block.thaumicenergistics.arcane_assembler"),
|
||||
@@ -577,7 +577,7 @@ public class TileArcaneAssembler extends ThETileBase
|
||||
*/
|
||||
public void onMemoryCardActivate(net.minecraft.world.entity.player.Player player,
|
||||
appeng.api.implementations.items.IMemoryCard memoryCard,
|
||||
ItemStack heldItem) {
|
||||
net.minecraft.world.item.ItemStack heldItem) {
|
||||
Short freq = heldItem.get(appeng.api.ids.AEComponents.EXPORTED_P2P_FREQUENCY);
|
||||
if (freq != null) {
|
||||
// 卡上带 P2P 频率(从 vis_interface shift+右键复制来的)→ 设为 vis 源
|
||||
|
||||
@@ -37,14 +37,14 @@ public class TileEssentiaProvider extends TileProviderBase implements IEssentiaT
|
||||
}
|
||||
|
||||
/** getEssentiaList 短时缓存:TC 管道 suction 每 tick 调 getEssentiaType,避免每 tick 全量遍历。 */
|
||||
private List<IAspectStack> cachedEssentiaList = List.of();
|
||||
private List<IAspectStack> cachedEssentiaList = java.util.List.of();
|
||||
private int essentiaListCacheTimer = 0;
|
||||
private static final int ESSENTIA_LIST_CACHE_TICKS = 20;
|
||||
|
||||
private List<IAspectStack> getCachedEssentiaList() {
|
||||
private List<thaumicenergistics.api.storage.IAspectStack> getCachedEssentiaList() {
|
||||
if (essentiaListCacheTimer <= 0) {
|
||||
essentiaListCacheTimer = ESSENTIA_LIST_CACHE_TICKS;
|
||||
cachedEssentiaList = essentiaGrid != null ? essentiaGrid.getEssentiaList() : List.of();
|
||||
cachedEssentiaList = essentiaGrid != null ? essentiaGrid.getEssentiaList() : java.util.List.of();
|
||||
}
|
||||
return cachedEssentiaList;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public final class ModBlocks {
|
||||
return net.minecraft.world.ItemInteractionResult.SUCCESS;
|
||||
}
|
||||
@Override
|
||||
protected MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
protected net.minecraft.world.MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
TileArcaneAssembler tile = (TileArcaneAssembler) level.getBlockEntity(pos);
|
||||
return new SimpleMenuProvider(
|
||||
(id, inv, p) -> new thaumicenergistics.common.container.ContainerArcaneAssembler(id, inv, tile),
|
||||
@@ -69,7 +69,7 @@ public final class ModBlocks {
|
||||
return net.minecraft.world.ItemInteractionResult.SUCCESS;
|
||||
}
|
||||
@Override
|
||||
protected MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
protected net.minecraft.world.MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
TileKnowledgeInscriber tile = (TileKnowledgeInscriber) level.getBlockEntity(pos);
|
||||
return new SimpleMenuProvider(
|
||||
(id, inv, p) -> new thaumicenergistics.common.container.ContainerKnowledgeInscriber(id, inv, tile),
|
||||
@@ -92,7 +92,7 @@ public final class ModBlocks {
|
||||
return net.minecraft.world.ItemInteractionResult.SUCCESS;
|
||||
}
|
||||
@Override
|
||||
protected MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
protected net.minecraft.world.MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
TileDistillationPatternEncoder tile = (TileDistillationPatternEncoder) level.getBlockEntity(pos);
|
||||
return new SimpleMenuProvider(
|
||||
(id, inv, p) -> new thaumicenergistics.common.container.ContainerDistillationPatternEncoder(id, inv, tile),
|
||||
@@ -110,7 +110,7 @@ public final class ModBlocks {
|
||||
return net.minecraft.world.ItemInteractionResult.SUCCESS;
|
||||
}
|
||||
@Override
|
||||
protected MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
protected net.minecraft.world.MenuProvider getMenuProvider(BlockState state, net.minecraft.world.level.Level level, BlockPos pos) {
|
||||
net.minecraft.world.level.block.entity.BlockEntity be = level.getBlockEntity(pos);
|
||||
if (be instanceof TileEssentiaCellWorkbench workbench) {
|
||||
return new SimpleMenuProvider((id, inv, p) -> new thaumicenergistics.common.container.ContainerEssentiaCellWorkbench(id, inv, workbench),
|
||||
|
||||
@@ -45,11 +45,11 @@ public class ArcaneCraftingTransferInfo
|
||||
|
||||
@Override
|
||||
public List<Slot> getRecipeSlots(ContainerArcaneCraftingTerminal menu, RecipeHolder<CraftingRecipe> recipe) {
|
||||
return menu.getSlots(SlotSemantics.CRAFTING_GRID);
|
||||
return menu.getSlots(appeng.menu.SlotSemantics.CRAFTING_GRID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> getInventorySlots(ContainerArcaneCraftingTerminal menu, RecipeHolder<CraftingRecipe> recipe) {
|
||||
return menu.getSlots(SlotSemantics.PLAYER_INVENTORY);
|
||||
return menu.getSlots(appeng.menu.SlotSemantics.PLAYER_INVENTORY);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user