diff --git a/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b b/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b index 559ba3090..beca45b50 100644 --- a/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b +++ b/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b @@ -1,2 +1,3 @@ -// 1.19.2 2024-05-28T14:53:16.653667 Tags for minecraft:item +// 1.19.2 2025-01-20T07:59:27.474151 Tags for minecraft:item +de4b4f45ec18b2b1f0db1c36882981042e20ee23 data/advancedperipherals/tags/items/p2p_attunements/cable_p2p_tunnel.json 72eba3b11f69e16c87488f7c4ba7cfdad42c378e data/advancedperipherals/tags/items/smart_glasses.json diff --git a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index e9f92dc08..2cb09adb4 100644 --- a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.19.2 2025-01-16T15:59:34.693839 Languages: en_us -d0fe3ab5a88d6b925369860038c76f23d9910143 assets/advancedperipherals/lang/en_us.json +// 1.19.2 2025-01-20T07:50:09.44057 Languages: en_us +ebf2194b8fece940adb61f1ae317f68799bd498f assets/advancedperipherals/lang/en_us.json diff --git a/src/generated/resources/assets/advancedperipherals/lang/en_us.json b/src/generated/resources/assets/advancedperipherals/lang/en_us.json index 014212826..ef080ec50 100644 --- a/src/generated/resources/assets/advancedperipherals/lang/en_us.json +++ b/src/generated/resources/assets/advancedperipherals/lang/en_us.json @@ -34,6 +34,7 @@ "block.advancedperipherals.rs_bridge": "RS Bridge", "curios.identifier.glasses": "Glasses", "entity.minecraft.villager.advancedperipherals.computer_scientist": "Computer Scientist", + "item.advancedperipherals.cable_p2p_tunnel": "Cable P2P Tunnel", "item.advancedperipherals.chunk_controller": "Chunk Controller", "item.advancedperipherals.computer_tool": "Computer Tool", "item.advancedperipherals.end_automata_core": "End Automata Core", diff --git a/src/generated/resources/data/advancedperipherals/tags/items/p2p_attunements/cable_p2p_tunnel.json b/src/generated/resources/data/advancedperipherals/tags/items/p2p_attunements/cable_p2p_tunnel.json new file mode 100644 index 000000000..7fc8269c3 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/tags/items/p2p_attunements/cable_p2p_tunnel.json @@ -0,0 +1,7 @@ +{ + "values": [ + "computercraft:cable", + "computercraft:wired_modem", + "computercraft:wired_modem_full" + ] +} \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java index 615c49195..8f7a80ffd 100644 --- a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java +++ b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java @@ -1,6 +1,7 @@ package de.srendi.advancedperipherals; import de.srendi.advancedperipherals.common.addons.APAddons; +import de.srendi.advancedperipherals.common.addons.ae2.AE2Registries; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.network.APNetworking; import de.srendi.advancedperipherals.common.setup.APRegistration; @@ -11,6 +12,7 @@ import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; @@ -35,6 +37,7 @@ public AdvancedPeripherals() { APConfig.register(ModLoadingContext.get()); modBus.addListener(this::commonSetup); + modBus.addListener(this::onLoadComplete); APRegistration.register(); MinecraftForge.EVENT_BUS.register(this); new APAddons(); @@ -67,4 +70,11 @@ public void commonSetup(FMLCommonSetupEvent event) { }); } + public void onLoadComplete(FMLLoadCompleteEvent event) { + event.enqueueWork(() -> { + if (APAddons.appliedEnergisticsLoaded) { + AE2Registries.finishRegister(); + } + }); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java index 6f00434c1..2c9948e2a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java @@ -23,38 +23,51 @@ @Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class APAddons { - public static final String CURIOS_MODID = "curios"; - public static final String REFINEDSTORAGE_MODID = "refinedstorage"; + public static final String AE_ADDITIONS_MODID = "ae2additions"; public static final String AE_THINGS_MODID = "ae2things"; public static final String APPLIEDENERGISTICS_MODID = "ae2"; - public static final String MEKANISM_MODID = "mekanism"; - public static final String AE_ADDITIONS_MODID = "ae2additions"; public static final String APP_MEKANISTICS_MODID = "appmek"; + public static final String BOTANIA_MODID = "botania"; + public static final String CREATE_MODID = "create"; + public static final String CURIOS_MODID = "curios"; + public static final String DIMSTORAGE_MODID = "dimstorage"; + public static final String MEKANISM_MODID = "mekanism"; + public static final String POWAH_MODID = "powah"; + public static final String REFINEDSTORAGE_MODID = "refinedstorage"; public static final String VALKYRIEN_SKIES_MODID = "valkyrienskies"; - public static boolean curiosLoaded; - public static boolean refinedStorageLoaded; + public static boolean aeAdditionsLoaded; public static boolean aeThingsLoaded; + public static boolean appMekLoaded; public static boolean appliedEnergisticsLoaded; + public static boolean botaniaLoaded; + public static boolean createLoaded; + public static boolean curiosLoaded; + public static boolean dimstorageLoaded; public static boolean mekanismLoaded; - public static boolean aeAdditionsLoaded; - public static boolean appMekLoaded; + public static boolean powahLoaded; + public static boolean refinedStorageLoaded; public static boolean vs2Loaded; // Use static so these checks run as early as possible, so we can use them for our registries static { ModList modList = ModList.get(); - curiosLoaded = modList.isLoaded(CURIOS_MODID); - refinedStorageLoaded = modList.isLoaded(REFINEDSTORAGE_MODID); - appliedEnergisticsLoaded = modList.isLoaded(APPLIEDENERGISTICS_MODID); - mekanismLoaded = modList.isLoaded(MEKANISM_MODID); - aeThingsLoaded = modList.isLoaded(AE_THINGS_MODID); aeAdditionsLoaded = modList.isLoaded(AE_ADDITIONS_MODID); + aeThingsLoaded = modList.isLoaded(AE_THINGS_MODID); appMekLoaded = modList.isLoaded(APP_MEKANISTICS_MODID); + appliedEnergisticsLoaded = modList.isLoaded(APPLIEDENERGISTICS_MODID); + botaniaLoaded = modList.isLoaded(BOTANIA_MODID); + createLoaded = modList.isLoaded(CREATE_MODID); + curiosLoaded = modList.isLoaded(CURIOS_MODID); + dimstorageLoaded = modList.isLoaded(DIMSTORAGE_MODID); + mekanismLoaded = modList.isLoaded(MEKANISM_MODID); + powahLoaded = modList.isLoaded(POWAH_MODID); + refinedStorageLoaded = modList.isLoaded(REFINEDSTORAGE_MODID); vs2Loaded = modList.isLoaded(VALKYRIEN_SKIES_MODID); - if (refinedStorageLoaded) + if (refinedStorageLoaded) { RefinedStorage.instance = new RefinedStorage(); + } } @SubscribeEvent diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/AE2Registries.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/AE2Registries.java new file mode 100644 index 000000000..b4759df1d --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/AE2Registries.java @@ -0,0 +1,42 @@ +package de.srendi.advancedperipherals.common.addons.ae2; + +import appeng.api.features.P2PTunnelAttunement; +import appeng.api.parts.IPart; +import appeng.api.parts.IPartItem; +import appeng.api.parts.PartModels; +import appeng.items.parts.PartItem; +import appeng.items.parts.PartModelsHelper; +import dan200.computercraft.shared.Registry.ModItems; +import de.srendi.advancedperipherals.common.setup.APRegistration; +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import net.minecraftforge.registries.RegistryObject; + +import java.util.function.Function; + +public final class AE2Registries { + private AE2Registries() {} + + public static final RegistryObject> CABLE_P2P_TUNNEL = registerPart("cable_p2p_tunnel", WiredCableP2PTunnelPart.class, WiredCableP2PTunnelPart::new); + + private static RegistryObject> registerPart(String id, Class clazz, Function, T> factory) { + PartModels.registerModels(PartModelsHelper.createModels(clazz)); + return APRegistration.ITEMS.register(id, () -> new PartItem<>(new Item.Properties(), clazz, factory)); + } + + public static void finishRegister() { + P2PTunnelAttunement.registerAttunementTag(CABLE_P2P_TUNNEL.get()); + } + + public static TagKey getCableP2PTag() { + return P2PTunnelAttunement.getAttunementTag(CABLE_P2P_TUNNEL.get()); + } + + public static void registerTags(Function, TagsProvider.TagAppender> tagger) { + tagger.apply(getCableP2PTag()) + .add(ModItems.CABLE.get()) + .add(ModItems.WIRED_MODEM.get()) + .add(ModItems.WIRED_MODEM_FULL.get()); + } +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/AppEngApi.java similarity index 99% rename from src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java rename to src/main/java/de/srendi/advancedperipherals/common/addons/ae2/AppEngApi.java index fbd53e35b..4ba53c7e5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/AppEngApi.java @@ -1,4 +1,4 @@ -package de.srendi.advancedperipherals.common.addons.appliedenergistics; +package de.srendi.advancedperipherals.common.addons.ae2; import appeng.api.crafting.IPatternDetails; import appeng.api.inventories.InternalInventory; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/CraftJob.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/CraftJob.java similarity index 98% rename from src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/CraftJob.java rename to src/main/java/de/srendi/advancedperipherals/common/addons/ae2/CraftJob.java index c7a0b6c95..e113ed21d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/CraftJob.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/CraftJob.java @@ -1,4 +1,4 @@ -package de.srendi.advancedperipherals.common.addons.appliedenergistics; +package de.srendi.advancedperipherals.common.addons.ae2; import appeng.api.networking.IGrid; import appeng.api.networking.IGridNode; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeBridgeEntityListener.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeBridgeEntityListener.java similarity index 90% rename from src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeBridgeEntityListener.java rename to src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeBridgeEntityListener.java index 10cc242fb..009b6e8df 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeBridgeEntityListener.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeBridgeEntityListener.java @@ -1,4 +1,4 @@ -package de.srendi.advancedperipherals.common.addons.appliedenergistics; +package de.srendi.advancedperipherals.common.addons.ae2; import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNodeListener; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeFluidHandler.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeFluidHandler.java similarity index 96% rename from src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeFluidHandler.java rename to src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeFluidHandler.java index 6f10b6be9..4eb75c853 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeFluidHandler.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeFluidHandler.java @@ -1,4 +1,4 @@ -package de.srendi.advancedperipherals.common.addons.appliedenergistics; +package de.srendi.advancedperipherals.common.addons.ae2; import appeng.api.config.Actionable; import appeng.api.networking.security.IActionSource; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeItemHandler.java similarity index 96% rename from src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java rename to src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeItemHandler.java index a3542cda3..1c5655f70 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/MeItemHandler.java @@ -1,4 +1,4 @@ -package de.srendi.advancedperipherals.common.addons.appliedenergistics; +package de.srendi.advancedperipherals.common.addons.ae2; import appeng.api.config.Actionable; import appeng.api.networking.security.IActionSource; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/WiredCableP2PTunnelPart.java b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/WiredCableP2PTunnelPart.java new file mode 100644 index 000000000..596ce5e62 --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/ae2/WiredCableP2PTunnelPart.java @@ -0,0 +1,174 @@ +package de.srendi.advancedperipherals.common.addons.ae2; + +import appeng.api.networking.IGridNodeListener; +import appeng.api.parts.IPartItem; +import appeng.api.parts.IPartModel; +import appeng.items.parts.PartModels; +import appeng.parts.p2p.CapabilityP2PTunnelPart; +import appeng.parts.p2p.P2PModels; +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.network.wired.IWiredElement; +import dan200.computercraft.api.network.wired.IWiredNetworkChange; +import dan200.computercraft.api.network.wired.IWiredNode; +import dan200.computercraft.shared.Capabilities; +import de.srendi.advancedperipherals.AdvancedPeripherals; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.phys.Vec3; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.annotation.Nonnull; + +public class WiredCableP2PTunnelPart extends CapabilityP2PTunnelPart { + private static final P2PModels MODELS = new P2PModels(AdvancedPeripherals.getRL("part/p2p/p2p_tunnel_cable")); + + private final IWiredElement element = new P2PWiredElement(); + private final IWiredElement outElement = new P2PWiredElement(); + private final IWiredNode node = this.element.getNode(); + private Set connected = new HashSet<>(); + private boolean activated = false; + + public WiredCableP2PTunnelPart(IPartItem partItem) { + super(partItem, Capabilities.CAPABILITY_WIRED_ELEMENT); + this.inputHandler = outElement; + this.outputHandler = outElement; + this.emptyHandler = null; // should never used + } + + @PartModels + public static List getModels() { + return MODELS.getModels(); + } + + @Override + public IPartModel getStaticModels() { + return MODELS.getModel(this.isPowered(), this.isActive()); + } + + @Override + public void onTunnelConfigChange() { + super.onTunnelConfigChange(); + this.connectionsChanged(); + } + + @Override + public void onTunnelNetworkChange() { + super.onTunnelNetworkChange(); + this.connectionsChanged(); + } + + protected void connectionsChanged() { + if (this.isClientSide()) { + return; + } + if (!this.isActive()) { + return; + } + if (!this.activated) { + this.activated = true; + this.node.connectTo(this.outElement.getNode()); + } + + Stream nodeStream = this.getOutputStream().filter(out -> out != this); + WiredCableP2PTunnelPart in = this.getInput(); + if (in != null && in != this) { + nodeStream = Stream.concat(nodeStream, Stream.of(in)); + } + Set nodes = nodeStream.collect(Collectors.toCollection(HashSet::new)); + + for (WiredCableP2PTunnelPart part : this.connected.stream().filter(n -> !nodes.contains(n)).collect(Collectors.toList())) { + if (part.connected.contains(this)) { + this.node.disconnectFrom(part.node); + part.connected.remove(this); + } + this.connected.remove(part); + } + + for (WiredCableP2PTunnelPart part : nodes) { + if (!this.connected.contains(part)) { + this.node.connectTo(part.node); + this.connected.add(part); + part.connected.add(this); + } + } + } + + @Override + protected void onMainNodeStateChanged(IGridNodeListener.State reason) { + super.onMainNodeStateChanged(reason); + if (reason == IGridNodeListener.State.GRID_BOOT) { + return; + } + if (this.isActive()) { + if (!this.getMainNode().hasGridBooted()) { + return; + } + this.connectionsChanged(); + this.refreshConnection(); + } else if (this.activated) { + this.activated = false; + this.node.remove(); + this.connected.clear(); + } + } + + protected BlockPos getFacingPos() { + return this.getHost().getLocation().getPos().relative(this.getSide()); + } + + protected void refreshConnection() { + BlockEntity cable = this.getLevel().getBlockEntity(this.getFacingPos()); + IWiredElement elem = cable == null ? null : cable.getCapability(Capabilities.CAPABILITY_WIRED_ELEMENT, this.getSide().getOpposite()).orElse(null); + if (elem == null) { + return; + } + elem.getNode().connectTo(this.outElement.getNode()); + } + + @Override + public void onNeighborChanged(BlockGetter level, BlockPos pos, BlockPos neighbor) { + if (!this.getFacingPos().equals(neighbor)) { + return; + } + if (this.activated) { + this.refreshConnection(); + } + } + + private class P2PWiredElement implements IWiredElement { + private final IWiredNode node = ComputerCraftAPI.createWiredNodeForElement(this); + + @Nonnull + @Override + public IWiredNode getNode() { + return node; + } + + @Nonnull + @Override + public String getSenderID() { + return "p2p"; + } + + @Nonnull + @Override + public Level getLevel() { + return WiredCableP2PTunnelPart.this.getLevel(); + } + + @Nonnull + @Override + public Vec3 getPosition() { + return Vec3.atCenterOf(WiredCableP2PTunnelPart.this.getBlockEntity().getBlockPos()); + } + + @Override + public void networkChanged(IWiredNetworkChange change) {} + } +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/IntegrationPeripheralProvider.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/IntegrationPeripheralProvider.java index b3a9d8e7a..eaf6cda03 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/IntegrationPeripheralProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/IntegrationPeripheralProvider.java @@ -3,6 +3,7 @@ import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.api.peripheral.IPeripheralProvider; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.util.Platform; import de.srendi.advancedperipherals.lib.integrations.IPeripheralIntegration; import de.srendi.advancedperipherals.lib.peripherals.BlockEntityIntegrationPeripheral; @@ -23,7 +24,14 @@ public class IntegrationPeripheralProvider implements IPeripheralProvider { - private static final String[] SUPPORTED_MODS = new String[]{"botania", "create", "mekanism", "powah", "dimstorage", "valkyrienskies"}; + private static final String[] SUPPORTED_MODS = new String[]{ + APAddons.BOTANIA_MODID, + APAddons.CREATE_MODID, + APAddons.MEKANISM_MODID, + APAddons.POWAH_MODID, + APAddons.DIMSTORAGE_MODID, + APAddons.VALKYRIEN_SKIES_MODID, + }; private static final PriorityQueue integrations = new PriorityQueue<>(Comparator.comparingInt(IPeripheralIntegration::getPriority)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MeBridgePeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MeBridgePeripheral.java index f0b70c70e..6d028fefb 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MeBridgePeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MeBridgePeripheral.java @@ -16,10 +16,10 @@ import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.core.apis.TableHelper; import dan200.computercraft.core.computer.ComputerSide; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.AppEngApi; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.CraftJob; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.MeFluidHandler; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.MeItemHandler; +import de.srendi.advancedperipherals.common.addons.ae2.AppEngApi; +import de.srendi.advancedperipherals.common.addons.ae2.CraftJob; +import de.srendi.advancedperipherals.common.addons.ae2.MeFluidHandler; +import de.srendi.advancedperipherals.common.addons.ae2.MeItemHandler; import de.srendi.advancedperipherals.common.addons.computercraft.owner.BlockEntityPeripheralOwner; import de.srendi.advancedperipherals.common.blocks.blockentities.MeBridgeEntity; import de.srendi.advancedperipherals.common.configuration.APConfig; diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/MeBridgeEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/MeBridgeEntity.java index a828fd45d..d7d857cb1 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/MeBridgeEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/MeBridgeEntity.java @@ -12,9 +12,9 @@ import appeng.api.stacks.AEItemKey; import appeng.api.storage.StorageHelper; import appeng.api.util.AECableType; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.AppEngApi; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.CraftJob; -import de.srendi.advancedperipherals.common.addons.appliedenergistics.MeBridgeEntityListener; +import de.srendi.advancedperipherals.common.addons.ae2.AppEngApi; +import de.srendi.advancedperipherals.common.addons.ae2.CraftJob; +import de.srendi.advancedperipherals.common.addons.ae2.MeBridgeEntityListener; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.MeBridgePeripheral; import de.srendi.advancedperipherals.common.blocks.base.IInventoryBlock; import de.srendi.advancedperipherals.common.blocks.base.PeripheralBlockEntity; diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java index 9627a4912..1e874d486 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java @@ -57,6 +57,8 @@ private void addItems() { addItem(APItems.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE, "Overpowered Husbandry Automata Core"); addItem(APItems.OVERPOWERED_WEAK_AUTOMATA_CORE, "Overpowered Weak Automata Core"); addItem(APItems.WEAK_AUTOMATA_CORE, "Weak Automata Core"); + + addItem(APItems.CABLE_P2P_TUNNEL, "Cable P2P Tunnel"); } private void addBlocks() { diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/ItemTagsProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/ItemTagsProvider.java index 8cd142217..b3b9d4520 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/ItemTagsProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/ItemTagsProvider.java @@ -1,6 +1,7 @@ package de.srendi.advancedperipherals.common.data; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.addons.ae2.AE2Registries; import de.srendi.advancedperipherals.common.setup.APItems; import de.srendi.advancedperipherals.common.setup.APTags; import net.minecraft.core.Registry; @@ -18,6 +19,9 @@ protected ItemTagsProvider(DataGenerator generator, @Nullable ExistingFileHelper @Override protected void addTags() { - tag(APTags.Items.SMART_GLASSES).add(APItems.SMART_GLASSES.get()).add(APItems.SMART_GLASSES_NETHERITE.get()); + tag(APTags.Items.SMART_GLASSES) + .add(APItems.SMART_GLASSES.get()) + .add(APItems.SMART_GLASSES_NETHERITE.get()); + AE2Registries.registerTags(this::tag); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/APItems.java b/src/main/java/de/srendi/advancedperipherals/common/setup/APItems.java index 36c5378e4..57d45b1e3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/APItems.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/APItems.java @@ -1,5 +1,7 @@ package de.srendi.advancedperipherals.common.setup; +import de.srendi.advancedperipherals.common.addons.APAddons; +import de.srendi.advancedperipherals.common.addons.ae2.AE2Registries; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.items.APItem; import de.srendi.advancedperipherals.common.items.MemoryCardItem; @@ -15,6 +17,7 @@ public class APItems { + public static final RegistryObject CABLE_P2P_TUNNEL = APAddons.appliedEnergisticsLoaded ? (RegistryObject) (RegistryObject) AE2Registries.CABLE_P2P_TUNNEL : null; public static final RegistryObject CHUNK_CONTROLLER = APRegistration.ITEMS.register("chunk_controller", () -> new APItem(new Item.Properties().stacksTo(16), APConfig.PERIPHERALS_CONFIG.enableChunkyTurtle)); public static final RegistryObject COMPUTER_TOOL = APRegistration.ITEMS.register("computer_tool", () -> new APItem(new Item.Properties().stacksTo(1), () -> true)); public static final RegistryObject END_AUTOMATA_CORE = APRegistration.ITEMS.register("end_automata_core", () -> new APItem(new Item.Properties().stacksTo(1), APConfig.METAPHYSICS_CONFIG.enableEndAutomataCore)); diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index f4a652f24..5ff034ed1 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,7 +1,7 @@ modLoader = "javafml" loaderVersion = "[${loader_version},)" -license = "All rights reserved" -issueTrackerURL = "https://github.com/Seniorendi/AdvancedPeripherals/issues" +license = "Apache-2.0" +issueTrackerURL = "https://github.com/IntelligenceModding/AdvancedPeripherals/issues" logoFile = "pack.png" [[mods]] modId = "${mod_id}" diff --git a/src/main/resources/assets/advancedperipherals/models/item/cable_p2p_tunnel.json b/src/main/resources/assets/advancedperipherals/models/item/cable_p2p_tunnel.json new file mode 100644 index 000000000..334ded781 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/item/cable_p2p_tunnel.json @@ -0,0 +1,6 @@ +{ + "parent": "ae2:item/p2p_tunnel_base", + "textures": { + "type": "computercraft:block/wired_modem_face" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/part/p2p/p2p_tunnel_cable.json b/src/main/resources/assets/advancedperipherals/models/part/p2p/p2p_tunnel_cable.json new file mode 100644 index 000000000..6baaf6042 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/part/p2p/p2p_tunnel_cable.json @@ -0,0 +1,6 @@ +{ + "parent": "ae2:part/p2p/p2p_tunnel_base", + "textures": { + "type": "computercraft:block/wired_modem_face" + } +}