├── src ├── generated │ └── resources │ │ ├── data │ │ ├── c │ │ │ └── tags │ │ │ │ └── item │ │ │ │ └── tools │ │ │ │ └── wrench.json │ │ └── moderndynamics │ │ │ ├── attachment_upgrades │ │ │ ├── bucket.json │ │ │ ├── cauldron.json │ │ │ ├── repeater.json │ │ │ ├── sticky_piston.json │ │ │ ├── comparator.json │ │ │ ├── hopper.json │ │ │ ├── ae2 │ │ │ │ ├── fuzzy_card.json │ │ │ │ ├── capacity_card.json │ │ │ │ └── speed_card.json │ │ │ ├── indrev │ │ │ │ ├── circuit_mk3.json │ │ │ │ ├── circuit_mk1.json │ │ │ │ ├── circuit_mk2.json │ │ │ │ └── speed_enhancer.json │ │ │ ├── refinedstorage │ │ │ │ ├── upgrade.json │ │ │ │ ├── regulator_upgrade.json │ │ │ │ ├── stack_upgrade.json │ │ │ │ └── speed_upgrade.json │ │ │ ├── mekanism │ │ │ │ ├── elite_control_circuit.json │ │ │ │ ├── basic_control_circuit.json │ │ │ │ ├── upgrade_speed.json │ │ │ │ └── advanced_control_circuit.json │ │ │ ├── immersiveengineering │ │ │ │ ├── fluid_pipe.json │ │ │ │ ├── conveyor_basic.json │ │ │ │ ├── conveyor_extract.json │ │ │ │ └── component_electronic.json │ │ │ ├── modern_industrialization │ │ │ │ ├── robot_arm.json │ │ │ │ ├── motor.json │ │ │ │ ├── pump.json │ │ │ │ └── analog_circuit.json │ │ │ └── techreborn │ │ │ │ ├── electronic_circuit.json │ │ │ │ ├── overclocker_upgrade.json │ │ │ │ └── advanced_circuit.json │ │ │ ├── structure │ │ │ └── empty.nbt │ │ │ ├── recipe │ │ │ ├── item_pipe.json │ │ │ ├── fluid_pipe.json │ │ │ ├── inhibitor.json │ │ │ ├── cable │ │ │ │ ├── lv_from_mi.json │ │ │ │ ├── hv_from_mi.json │ │ │ │ ├── mv_from_mi.json │ │ │ │ ├── ev_from_mi.json │ │ │ │ ├── lv_to_mi.json │ │ │ │ ├── hv_to_mi.json │ │ │ │ ├── mv_to_mi.json │ │ │ │ ├── superconductor_from_mi.json │ │ │ │ ├── ev_to_mi.json │ │ │ │ └── superconductor_to_mi.json │ │ │ ├── wrench.json │ │ │ ├── machine_extender.json │ │ │ ├── extractor.json │ │ │ ├── filter.json │ │ │ └── attractor.json │ │ │ ├── loot_table │ │ │ └── blocks │ │ │ │ ├── ev_cable.json │ │ │ │ ├── hv_cable.json │ │ │ │ ├── item_pipe.json │ │ │ │ ├── lv_cable.json │ │ │ │ ├── mv_cable.json │ │ │ │ ├── fluid_pipe.json │ │ │ │ ├── machine_extender.json │ │ │ │ └── superconductor_cable.json │ │ │ └── advancement │ │ │ └── recipes │ │ │ ├── tools │ │ │ └── wrench.json │ │ │ └── transportation │ │ │ ├── filter.json │ │ │ ├── extractor.json │ │ │ ├── item_pipe.json │ │ │ ├── fluid_pipe.json │ │ │ ├── attractor.json │ │ │ ├── inhibitor.json │ │ │ └── machine_extender.json │ │ └── assets │ │ ├── moderndynamics │ │ ├── models │ │ │ ├── item │ │ │ │ ├── ev_cable.json │ │ │ │ ├── hv_cable.json │ │ │ │ ├── item_pipe.json │ │ │ │ ├── lv_cable.json │ │ │ │ ├── mv_cable.json │ │ │ │ ├── fluid_pipe.json │ │ │ │ ├── machine_extender.json │ │ │ │ ├── superconductor_cable.json │ │ │ │ ├── filter.json │ │ │ │ ├── wrench.json │ │ │ │ ├── attractor.json │ │ │ │ ├── debug_tool.json │ │ │ │ ├── extractor.json │ │ │ │ └── inhibitor.json │ │ │ ├── block │ │ │ │ ├── ev_cable.json │ │ │ │ ├── fluid_pipe.json │ │ │ │ ├── hv_cable.json │ │ │ │ ├── item_pipe.json │ │ │ │ ├── lv_cable.json │ │ │ │ ├── mv_cable.json │ │ │ │ ├── superconductor_cable.json │ │ │ │ ├── machine_extender_normal.json │ │ │ │ └── machine_extender_top.json │ │ │ ├── pipe │ │ │ │ ├── ev_cable │ │ │ │ │ ├── straight.json │ │ │ │ │ └── connector.json │ │ │ │ ├── hv_cable │ │ │ │ │ ├── straight.json │ │ │ │ │ └── connector.json │ │ │ │ ├── lv_cable │ │ │ │ │ ├── straight.json │ │ │ │ │ └── connector.json │ │ │ │ ├── mv_cable │ │ │ │ │ ├── straight.json │ │ │ │ │ └── connector.json │ │ │ │ ├── fluid_pipe │ │ │ │ │ ├── straight.json │ │ │ │ │ └── connector.json │ │ │ │ ├── item_pipe │ │ │ │ │ ├── connector.json │ │ │ │ │ └── straight.json │ │ │ │ └── superconductor_cable │ │ │ │ │ ├── connector.json │ │ │ │ │ └── straight.json │ │ │ └── attachment │ │ │ │ ├── filter.json │ │ │ │ ├── attractor.json │ │ │ │ ├── extractor.json │ │ │ │ ├── inhibitor.json │ │ │ │ ├── attractor_stuffed.json │ │ │ │ └── extractor_stuffed.json │ │ └── blockstates │ │ │ ├── ev_cable.json │ │ │ ├── hv_cable.json │ │ │ ├── item_pipe.json │ │ │ ├── lv_cable.json │ │ │ ├── mv_cable.json │ │ │ ├── fluid_pipe.json │ │ │ ├── superconductor_cable.json │ │ │ └── machine_extender.json │ │ └── minecraft │ │ └── atlases │ │ └── blocks.json └── main │ ├── resources │ ├── assets │ │ └── moderndynamics │ │ │ ├── mdlogo.png │ │ │ ├── textures │ │ │ ├── gui │ │ │ │ ├── icons.png │ │ │ │ ├── attachment.png │ │ │ │ └── tab_right.png │ │ │ ├── item │ │ │ │ ├── filter.png │ │ │ │ ├── relay.png │ │ │ │ ├── wrench.png │ │ │ │ ├── attractor.png │ │ │ │ ├── extractor.png │ │ │ │ ├── inhibitor.png │ │ │ │ └── debug_tool.png │ │ │ ├── base │ │ │ │ └── energy │ │ │ │ │ ├── lead.png │ │ │ │ │ ├── invar.png │ │ │ │ │ ├── electrum.png │ │ │ │ │ ├── enderium.png │ │ │ │ │ └── signalum.png │ │ │ ├── attachment │ │ │ │ ├── filter.png │ │ │ │ ├── attractor.png │ │ │ │ ├── extractor.png │ │ │ │ ├── inhibitor.png │ │ │ │ ├── attractor_stuffed.png │ │ │ │ └── extractor_stuffed.png │ │ │ ├── pipe │ │ │ │ ├── ev_cable │ │ │ │ │ ├── base.png │ │ │ │ │ ├── connector.png │ │ │ │ │ └── straight.png │ │ │ │ ├── hv_cable │ │ │ │ │ ├── base.png │ │ │ │ │ ├── connector.png │ │ │ │ │ └── straight.png │ │ │ │ ├── item_pipe │ │ │ │ │ ├── base.png │ │ │ │ │ ├── connector.png │ │ │ │ │ └── straight.png │ │ │ │ ├── lv_cable │ │ │ │ │ ├── base.png │ │ │ │ │ ├── connector.png │ │ │ │ │ └── straight.png │ │ │ │ ├── mv_cable │ │ │ │ │ ├── base.png │ │ │ │ │ ├── connector.png │ │ │ │ │ └── straight.png │ │ │ │ ├── fluid_pipe │ │ │ │ │ ├── base.png │ │ │ │ │ ├── straight.png │ │ │ │ │ └── connector.png │ │ │ │ └── superconductor_cable │ │ │ │ │ ├── base.png │ │ │ │ │ ├── straight.png │ │ │ │ │ └── connector.png │ │ │ └── block │ │ │ │ ├── machine_extender_end.png │ │ │ │ ├── machine_extender_column.png │ │ │ │ ├── machine_extender_side.png │ │ │ │ └── machine_extender_side_top.png │ │ │ └── models │ │ │ └── base │ │ │ ├── straight.json │ │ │ ├── connector.json │ │ │ ├── straight_transparent.json │ │ │ └── connector_transparent.json │ ├── moderndynamics.mixins.json │ └── META-INF │ │ ├── neoforge.mods.toml │ │ └── accesstransformer.cfg │ └── java │ └── dev │ └── technici4n │ └── moderndynamics │ ├── attachment │ ├── settings │ │ ├── FilterNbtMode.java │ │ ├── FilterInversionMode.java │ │ ├── FilterModMode.java │ │ ├── FilterDamageMode.java │ │ ├── FilterSimilarMode.java │ │ ├── OversendingMode.java │ │ ├── RoutingMode.java │ │ └── RedstoneMode.java │ ├── IoAttachmentType.java │ ├── attached │ │ ├── AttachedInhibitor.java │ │ └── FluidCachedFilter.java │ ├── InhibitorAttachmentItem.java │ ├── AttachmentItem.java │ ├── RenderedAttachment.java │ └── Setting.java │ ├── client │ ├── screen │ │ ├── CycleSetting.java │ │ └── PlusMinusButton.java │ ├── compat │ │ ├── jei │ │ │ └── UpgradeDisplay.java │ │ └── rei │ │ │ └── UpgradeDisplay.java │ ├── ClientProxy.java │ ├── GeometryHelper.java │ └── model │ │ ├── PipeModelLoader.java │ │ └── MdModels.java │ ├── network │ ├── item │ │ ├── StartTravelCallback.java │ │ ├── MaxParticipant.java │ │ ├── FailedInsertStrategy.java │ │ ├── SimulatedInsertionTargets.java │ │ └── sync │ │ │ └── ClientTravelingItem.java │ ├── Network.java │ ├── energy │ │ ├── SimpleEnergyStorage.java │ │ └── EnergyPipeTier.java │ ├── mienergy │ │ └── MICableTier.java │ ├── fluid │ │ └── ConnectedFluidStorage.java │ ├── TickHelper.java │ └── HostAdjacentCaps.java │ ├── util │ ├── ExtendedMenuProvider.java │ ├── MdId.java │ ├── UnsidedPacketHandler.java │ ├── TransferUtil.java │ ├── ShapeHelper.java │ ├── FluidRenderUtil.java │ ├── DropHelper.java │ └── MdItemGroup.java │ ├── init │ ├── MdTags.java │ ├── MdAttachments.java │ └── MdMenus.java │ ├── thirdparty │ └── fabric │ │ ├── RenderContext.java │ │ └── Renderer.java │ ├── gui │ └── menu │ │ ├── ItemConfigSlot.java │ │ ├── FluidConfigSlot.java │ │ ├── UpgradePanel.java │ │ ├── ConfigSlot.java │ │ └── UpgradeSlot.java │ ├── Constants.java │ ├── pipe │ ├── NyiPipeBlockEntity.java │ ├── FluidPipeBlockEntity.java │ ├── ItemPipeBlockEntity.java │ ├── MIEnergyCableBlockEntity.java │ └── EnergyPipeBlockEntity.java │ ├── compat │ ├── mi │ │ ├── MIProxy.java │ │ └── MIAbsentProxy.java │ └── jade │ │ └── MdJadePlugin.java │ ├── packets │ ├── SetInt.java │ ├── SetEnum.java │ ├── SetItemVariant.java │ ├── SetFluidVariant.java │ └── SetAttachmentUpgrades.java │ ├── test │ └── MdGameTest.java │ ├── MdProxy.java │ ├── data │ ├── ItemTagsProvider.java │ ├── PipeModelLoaderBuilder.java │ └── DataGenerators.java │ └── model │ ├── PipeModelData.java │ └── AttachmentModelData.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── docs └── ITEMS.md ├── license_header.java ├── .github └── workflows │ ├── build.yml │ └── release.yml ├── gradle.properties └── README.md /src/generated/resources/data/c/tags/item/tools/wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "moderndynamics:wrench" 4 | ] 5 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/ev_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/ev_cable" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/hv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/hv_cable" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/item_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/item_pipe" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/lv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/lv_cable" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/mv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/mv_cable" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/fluid_pipe" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/machine_extender.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/machine_extender_normal" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/superconductor_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:block/superconductor_cable" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/bucket.json: -------------------------------------------------------------------------------- 1 | { 2 | "addFluidTransfer": 1, 3 | "item": "minecraft:bucket", 4 | "slotLimit": 3 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/mdlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/mdlogo.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/ev_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "ev_cable", 4 | "transparent": false 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "fluid_pipe", 4 | "transparent": true 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/hv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "hv_cable", 4 | "transparent": false 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/item_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "item_pipe", 4 | "transparent": true 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/lv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "lv_cable", 4 | "transparent": false 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/mv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "mv_cable", 4 | "transparent": false 5 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/cauldron.json: -------------------------------------------------------------------------------- 1 | { 2 | "item": "minecraft:cauldron", 3 | "multiplyFluidTransfer": 1, 4 | "slotLimit": 1 5 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/repeater.json: -------------------------------------------------------------------------------- 1 | { 2 | "addItemTransferFrequency": 1, 3 | "item": "minecraft:repeater", 4 | "slotLimit": 3 5 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/sticky_piston.json: -------------------------------------------------------------------------------- 1 | { 2 | "addItemSpeed": 1, 3 | "item": "minecraft:sticky_piston", 4 | "slotLimit": 1 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/ev_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/ev_cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/hv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/hv_cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/item_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/item_pipe" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/lv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/lv_cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/mv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/mv_cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/comparator.json: -------------------------------------------------------------------------------- 1 | { 2 | "enableAdvancedBehavior": true, 3 | "item": "minecraft:comparator", 4 | "slotLimit": 1 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/fluid_pipe" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/structure/empty.nbt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/generated/resources/data/moderndynamics/structure/empty.nbt -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/gui/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/gui/icons.png -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/hopper.json: -------------------------------------------------------------------------------- 1 | { 2 | "addFilterSlots": 2, 3 | "addItemCount": 5, 4 | "item": "minecraft:hopper", 5 | "slotLimit": 6 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/filter.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/relay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/relay.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/wrench.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "moderndynamics:item/filter" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "moderndynamics:item/wrench" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/gui/attachment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/gui/attachment.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/gui/tab_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/gui/tab_right.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/attractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/attractor.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/extractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/extractor.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/inhibitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/inhibitor.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/superconductor_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "loader": "moderndynamics:pipe", 3 | "pipeType": "superconductor_cable", 4 | "transparent": false 5 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/attractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "moderndynamics:item/attractor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/debug_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "moderndynamics:item/debug_tool" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/extractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "moderndynamics:item/extractor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/item/inhibitor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "moderndynamics:item/inhibitor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/base/energy/lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/base/energy/lead.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/item/debug_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/item/debug_tool.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/superconductor_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "moderndynamics:block/superconductor_cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/attachment/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/attachment/filter.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/base/energy/invar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/base/energy/invar.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/ev_cable/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/ev_cable/base.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/hv_cable/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/hv_cable/base.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/item_pipe/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/item_pipe/base.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/lv_cable/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/lv_cable/base.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/mv_cable/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/mv_cable/base.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/attachment/attractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/attachment/attractor.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/attachment/extractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/attachment/extractor.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/attachment/inhibitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/attachment/inhibitor.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/base/energy/electrum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/base/energy/electrum.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/base/energy/enderium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/base/energy/enderium.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/base/energy/signalum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/base/energy/signalum.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/fluid_pipe/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/fluid_pipe/base.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/ev_cable/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight", 3 | "textures": { 4 | "0": "moderndynamics:pipe/ev_cable/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/hv_cable/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight", 3 | "textures": { 4 | "0": "moderndynamics:pipe/hv_cable/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/lv_cable/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight", 3 | "textures": { 4 | "0": "moderndynamics:pipe/lv_cable/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/mv_cable/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight", 3 | "textures": { 4 | "0": "moderndynamics:pipe/mv_cable/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/ev_cable/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/ev_cable/connector.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/ev_cable/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/ev_cable/straight.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/fluid_pipe/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/fluid_pipe/straight.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/hv_cable/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/hv_cable/connector.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/hv_cable/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/hv_cable/straight.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/item_pipe/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/item_pipe/connector.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/item_pipe/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/item_pipe/straight.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/lv_cable/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/lv_cable/connector.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/lv_cable/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/lv_cable/straight.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/mv_cable/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/mv_cable/connector.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/mv_cable/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/mv_cable/straight.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/attachment/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:attachment/filter" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/ev_cable/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector", 3 | "textures": { 4 | "0": "moderndynamics:pipe/ev_cable/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/hv_cable/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector", 3 | "textures": { 4 | "0": "moderndynamics:pipe/hv_cable/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/lv_cable/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector", 3 | "textures": { 4 | "0": "moderndynamics:pipe/lv_cable/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/mv_cable/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector", 3 | "textures": { 4 | "0": "moderndynamics:pipe/mv_cable/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/block/machine_extender_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/block/machine_extender_end.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/fluid_pipe/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/fluid_pipe/connector.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/attachment/attractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:attachment/attractor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/attachment/extractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:attachment/extractor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/attachment/inhibitor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:attachment/inhibitor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/attachment/attractor_stuffed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/attachment/attractor_stuffed.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/attachment/extractor_stuffed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/attachment/extractor_stuffed.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/block/machine_extender_column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/block/machine_extender_column.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/block/machine_extender_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/block/machine_extender_side.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/fluid_pipe/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight_transparent", 3 | "textures": { 4 | "0": "moderndynamics:pipe/fluid_pipe/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/item_pipe/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:pipe/item_pipe/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/item_pipe/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight_transparent", 3 | "textures": { 4 | "0": "moderndynamics:pipe/item_pipe/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/block/machine_extender_side_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/block/machine_extender_side_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/superconductor_cable/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/superconductor_cable/base.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/fluid_pipe/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:pipe/fluid_pipe/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/superconductor_cable/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/superconductor_cable/straight.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/attachment/attractor_stuffed.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:attachment/attractor_stuffed" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/attachment/extractor_stuffed.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector_transparent", 3 | "textures": { 4 | "0": "moderndynamics:attachment/extractor_stuffed" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/superconductor_cable/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/connector", 3 | "textures": { 4 | "0": "moderndynamics:pipe/superconductor_cable/connector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/pipe/superconductor_cable/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "moderndynamics:base/straight", 3 | "textures": { 4 | "0": "moderndynamics:pipe/superconductor_cable/straight" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/textures/pipe/superconductor_cable/connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Technici4n/Modern-Dynamics/HEAD/src/main/resources/assets/moderndynamics/textures/pipe/superconductor_cable/connector.png -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/machine_extender_normal.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_column", 3 | "textures": { 4 | "end": "moderndynamics:block/machine_extender_column", 5 | "side": "moderndynamics:block/machine_extender_side" 6 | } 7 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/ae2/fuzzy_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "ae2" 6 | } 7 | ], 8 | "enableAdvancedBehavior": true, 9 | "item": "ae2:fuzzy_card", 10 | "slotLimit": 1 11 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/blockstates/machine_extender.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "top=false": { 4 | "model": "moderndynamics:block/machine_extender_normal" 5 | }, 6 | "top=true": { 7 | "model": "moderndynamics:block/machine_extender_top" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/indrev/circuit_mk3.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "indrev" 6 | } 7 | ], 8 | "enableAdvancedBehavior": true, 9 | "item": "indrev:circuit_mk3", 10 | "slotLimit": 1 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/refinedstorage/upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "refinedstorage" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "item": "refinedstorage:upgrade", 10 | "slotLimit": 6 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/indrev/circuit_mk1.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "indrev" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addItemCount": 10, 10 | "item": "indrev:circuit_mk1", 11 | "slotLimit": 6 12 | } -------------------------------------------------------------------------------- /src/main/resources/moderndynamics.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "dev.technici4n.moderndynamics.mixins", 5 | "compatibilityLevel": "JAVA_8", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | "TextureAtlasMixin" 10 | ], 11 | "injectors": { 12 | "defaultRequire": 1 13 | } 14 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/minecraft/atlases/blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "sources": [ 3 | { 4 | "type": "minecraft:directory", 5 | "prefix": "pipe/", 6 | "source": "pipe" 7 | }, 8 | { 9 | "type": "minecraft:directory", 10 | "prefix": "attachment/", 11 | "source": "attachment" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/mekanism/elite_control_circuit.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "mekanism" 6 | } 7 | ], 8 | "enableAdvancedBehavior": true, 9 | "item": "mekanism:elite_control_circuit", 10 | "slotLimit": 1 11 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/moderndynamics/models/block/machine_extender_top.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_bottom_top", 3 | "textures": { 4 | "bottom": "moderndynamics:block/machine_extender_column", 5 | "side": "moderndynamics:block/machine_extender_side_top", 6 | "top": "moderndynamics:block/machine_extender_end" 7 | } 8 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/immersiveengineering/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "immersiveengineering" 6 | } 7 | ], 8 | "addFluidTransfer": 1, 9 | "item": "immersiveengineering:fluid_pipe", 10 | "slotLimit": 3 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/immersiveengineering/conveyor_basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "immersiveengineering" 6 | } 7 | ], 8 | "addItemCount": 4, 9 | "item": "immersiveengineering:conveyor_basic", 10 | "slotLimit": 32 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/modern_industrialization/robot_arm.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "modern_industrialization" 6 | } 7 | ], 8 | "addItemCount": 16, 9 | "item": "modern_industrialization:robot_arm", 10 | "slotLimit": 10 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/refinedstorage/regulator_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "refinedstorage" 6 | } 7 | ], 8 | "enableAdvancedBehavior": true, 9 | "item": "refinedstorage:regulator_upgrade", 10 | "slotLimit": 1 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/ae2/capacity_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "ae2" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addFluidTransfer": 1, 10 | "addItemCount": 10, 11 | "item": "ae2:capacity_card", 12 | "slotLimit": 6 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/mekanism/basic_control_circuit.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "mekanism" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addItemCount": 10, 10 | "item": "mekanism:basic_control_circuit", 11 | "slotLimit": 6 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/techreborn/electronic_circuit.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "techreborn" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addItemCount": 10, 10 | "item": "techreborn:electronic_circuit", 11 | "slotLimit": 6 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/ae2/speed_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "ae2" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "ae2:speed_card", 11 | "multiplyFluidTransfer": 1, 12 | "slotLimit": 3 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/indrev/circuit_mk2.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "indrev" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addFluidTransfer": 1, 10 | "addItemCount": 20, 11 | "item": "indrev:circuit_mk2", 12 | "slotLimit": 6 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/refinedstorage/stack_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "refinedstorage" 6 | } 7 | ], 8 | "addFluidTransfer": 2, 9 | "addItemCount": 16, 10 | "item": "refinedstorage:stack_upgrade", 11 | "slotLimit": 4 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/indrev/speed_enhancer.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "indrev" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "indrev:speed_enhancer", 11 | "multiplyFluidTransfer": 1, 12 | "slotLimit": 3 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/modern_industrialization/motor.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "modern_industrialization" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "modern_industrialization:motor", 11 | "slotLimit": 5 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/modern_industrialization/pump.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "modern_industrialization" 6 | } 7 | ], 8 | "addFluidTransfer": 1, 9 | "item": "modern_industrialization:pump", 10 | "multiplyFluidTransfer": 1, 11 | "slotLimit": 9 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/mekanism/upgrade_speed.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "mekanism" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "mekanism:upgrade_speed", 11 | "multiplyFluidTransfer": 1, 12 | "slotLimit": 3 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/immersiveengineering/conveyor_extract.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "immersiveengineering" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "immersiveengineering:conveyor_extract", 11 | "slotLimit": 3 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/mekanism/advanced_control_circuit.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "mekanism" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addFluidTransfer": 1, 10 | "addItemCount": 20, 11 | "item": "mekanism:advanced_control_circuit", 12 | "slotLimit": 6 13 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .gradle/ 4 | build/ 5 | out/ 6 | classes/ 7 | 8 | # eclipse 9 | 10 | *.launch 11 | 12 | # idea 13 | 14 | .idea/ 15 | *.iml 16 | *.ipr 17 | *.iws 18 | 19 | # vscode 20 | 21 | .settings/ 22 | .vscode/ 23 | bin/ 24 | .classpath 25 | .project 26 | 27 | # macos 28 | 29 | *.DS_Store 30 | 31 | # fabric 32 | 33 | run/ 34 | logs/ 35 | src/generated/resources/.cache 36 | -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/immersiveengineering/component_electronic.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "immersiveengineering" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "enableAdvancedBehavior": true, 10 | "item": "immersiveengineering:component_electronic", 11 | "slotLimit": 6 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/modern_industrialization/analog_circuit.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "modern_industrialization" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "enableAdvancedBehavior": true, 10 | "item": "modern_industrialization:analog_circuit", 11 | "slotLimit": 6 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/refinedstorage/speed_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "refinedstorage" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "refinedstorage:speed_upgrade", 11 | "multiplyFluidTransfer": 1, 12 | "slotLimit": 3 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/techreborn/overclocker_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "techreborn" 6 | } 7 | ], 8 | "addItemSpeed": 1, 9 | "addItemTransferFrequency": 1, 10 | "item": "techreborn:overclocker_upgrade", 11 | "multiplyFluidTransfer": 1, 12 | "slotLimit": 3 13 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/attachment_upgrades/techreborn/advanced_circuit.json: -------------------------------------------------------------------------------- 1 | { 2 | "neoforge:conditions": [ 3 | { 4 | "type": "neoforge:mod_loaded", 5 | "modid": "techreborn" 6 | } 7 | ], 8 | "addFilterSlots": 2, 9 | "addFluidTransfer": 1, 10 | "addItemCount": 10, 11 | "enableAdvancedBehavior": true, 12 | "item": "techreborn:advanced_circuit", 13 | "slotLimit": 6 14 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/item_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "g": { 6 | "item": "minecraft:glass" 7 | }, 8 | "i": { 9 | "item": "minecraft:iron_ingot" 10 | } 11 | }, 12 | "pattern": [ 13 | "igi" 14 | ], 15 | "result": { 16 | "count": 8, 17 | "id": "moderndynamics:item_pipe" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "g": { 6 | "item": "minecraft:glass" 7 | }, 8 | "i": { 9 | "item": "minecraft:copper_ingot" 10 | } 11 | }, 12 | "pattern": [ 13 | "igi" 14 | ], 15 | "result": { 16 | "count": 8, 17 | "id": "moderndynamics:fluid_pipe" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/inhibitor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "m": { 6 | "item": "minecraft:iron_ingot" 7 | }, 8 | "n": { 9 | "item": "minecraft:iron_nugget" 10 | } 11 | }, 12 | "pattern": [ 13 | "mnm" 14 | ], 15 | "result": { 16 | "count": 4, 17 | "id": "moderndynamics:inhibitor" 18 | } 19 | } -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | mavenCentral() 5 | } 6 | plugins { 7 | id 'net.neoforged.moddev' version '2.0.30-beta' 8 | id 'com.diffplug.spotless' version '6.25.0' 9 | id 'com.matthewprenger.cursegradle' version '1.4.0' 10 | id "com.modrinth.minotaur" version "2.+" 11 | } 12 | } 13 | 14 | rootProject.name = "Modern-Dynamics" 15 | -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/lv_from_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "modern_industrialization:tin_cable" 6 | } 7 | ], 8 | "result": { 9 | "id": "moderndynamics:lv_cable", 10 | "count": 4 11 | }, 12 | "neoforge:conditions": [ 13 | { 14 | "modid": "modern_industrialization", 15 | "type": "neoforge:mod_loaded" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "equipment", 4 | "key": { 5 | "i": { 6 | "item": "minecraft:iron_ingot" 7 | }, 8 | "l": { 9 | "item": "minecraft:lapis_lazuli" 10 | } 11 | }, 12 | "pattern": [ 13 | " i ", 14 | "lii", 15 | "il " 16 | ], 17 | "result": { 18 | "count": 1, 19 | "id": "moderndynamics:wrench" 20 | } 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/hv_from_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "modern_industrialization:aluminum_cable" 6 | } 7 | ], 8 | "result": { 9 | "id": "moderndynamics:hv_cable", 10 | "count": 4 11 | }, 12 | "neoforge:conditions": [ 13 | { 14 | "modid": "modern_industrialization", 15 | "type": "neoforge:mod_loaded" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/mv_from_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "modern_industrialization:electrum_cable" 6 | } 7 | ], 8 | "result": { 9 | "id": "moderndynamics:mv_cable", 10 | "count": 4 11 | }, 12 | "neoforge:conditions": [ 13 | { 14 | "modid": "modern_industrialization", 15 | "type": "neoforge:mod_loaded" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/ev_from_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "modern_industrialization:annealed_copper_cable" 6 | } 7 | ], 8 | "result": { 9 | "id": "moderndynamics:ev_cable", 10 | "count": 4 11 | }, 12 | "neoforge:conditions": [ 13 | { 14 | "modid": "modern_industrialization", 15 | "type": "neoforge:mod_loaded" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/models/base/straight.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "elements": [ 4 | { 5 | "from": [5, 5, 0], 6 | "to": [11, 11, 16], 7 | "faces": { 8 | "east": {"uv": [16, 5, 0, 11], "texture": "#0"}, 9 | "west": {"uv": [16, 11, 0, 5], "texture": "#0"}, 10 | "up": {"uv": [0, 5, 16, 11], "rotation": 90, "texture": "#0"}, 11 | "down": {"uv": [0, 11, 16, 5], "rotation": 90, "texture": "#0"} 12 | } 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/lv_to_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "cc", 5 | "cc" 6 | ], 7 | "key": { 8 | "c": { 9 | "item": "moderndynamics:lv_cable" 10 | } 11 | }, 12 | "result": { 13 | "id": "modern_industrialization:tin_cable" 14 | }, 15 | "neoforge:conditions": [ 16 | { 17 | "modid": "modern_industrialization", 18 | "type": "neoforge:mod_loaded" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/hv_to_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "cc", 5 | "cc" 6 | ], 7 | "key": { 8 | "c": { 9 | "item": "moderndynamics:hv_cable" 10 | } 11 | }, 12 | "result": { 13 | "id": "modern_industrialization:aluminum_cable" 14 | }, 15 | "neoforge:conditions": [ 16 | { 17 | "modid": "modern_industrialization", 18 | "type": "neoforge:mod_loaded" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/mv_to_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "cc", 5 | "cc" 6 | ], 7 | "key": { 8 | "c": { 9 | "item": "moderndynamics:mv_cable" 10 | } 11 | }, 12 | "result": { 13 | "id": "modern_industrialization:electrum_cable" 14 | }, 15 | "neoforge:conditions": [ 16 | { 17 | "modid": "modern_industrialization", 18 | "type": "neoforge:mod_loaded" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/superconductor_from_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "modern_industrialization:superconductor_cable" 6 | } 7 | ], 8 | "result": { 9 | "id": "moderndynamics:superconductor_cable", 10 | "count": 4 11 | }, 12 | "neoforge:conditions": [ 13 | { 14 | "modid": "modern_industrialization", 15 | "type": "neoforge:mod_loaded" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/ev_to_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "cc", 5 | "cc" 6 | ], 7 | "key": { 8 | "c": { 9 | "item": "moderndynamics:ev_cable" 10 | } 11 | }, 12 | "result": { 13 | "id": "modern_industrialization:annealed_copper_cable" 14 | }, 15 | "neoforge:conditions": [ 16 | { 17 | "modid": "modern_industrialization", 18 | "type": "neoforge:mod_loaded" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/cable/superconductor_to_mi.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "cc", 5 | "cc" 6 | ], 7 | "key": { 8 | "c": { 9 | "item": "moderndynamics:superconductor_cable" 10 | } 11 | }, 12 | "result": { 13 | "id": "modern_industrialization:superconductor_cable" 14 | }, 15 | "neoforge:conditions": [ 16 | { 17 | "modid": "modern_industrialization", 18 | "type": "neoforge:mod_loaded" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/ev_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:ev_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/ev_cable" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/hv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:hv_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/hv_cable" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/item_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:item_pipe" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/item_pipe" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/lv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:lv_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/lv_cable" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/mv_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:mv_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/mv_cable" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/machine_extender.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "b": { 6 | "item": "minecraft:iron_bars" 7 | }, 8 | "f": { 9 | "item": "moderndynamics:fluid_pipe" 10 | }, 11 | "i": { 12 | "item": "moderndynamics:item_pipe" 13 | } 14 | }, 15 | "pattern": [ 16 | "bbb", 17 | "ibf", 18 | "bbb" 19 | ], 20 | "result": { 21 | "count": 4, 22 | "id": "moderndynamics:machine_extender" 23 | } 24 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:fluid_pipe" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/fluid_pipe" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/machine_extender.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:machine_extender" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/machine_extender" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/loot_table/blocks/superconductor_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "moderndynamics:superconductor_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ], 20 | "random_sequence": "moderndynamics:blocks/superconductor_cable" 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/extractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "h": { 6 | "item": "minecraft:hopper" 7 | }, 8 | "m": { 9 | "item": "minecraft:iron_ingot" 10 | }, 11 | "p": { 12 | "item": "minecraft:paper" 13 | }, 14 | "r": { 15 | "item": "minecraft:redstone" 16 | } 17 | }, 18 | "pattern": [ 19 | " h ", 20 | "mrm", 21 | " p " 22 | ], 23 | "result": { 24 | "count": 1, 25 | "id": "moderndynamics:extractor" 26 | } 27 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "l": { 6 | "item": "minecraft:lapis_lazuli" 7 | }, 8 | "m": { 9 | "item": "minecraft:iron_ingot" 10 | }, 11 | "p": { 12 | "item": "minecraft:paper" 13 | }, 14 | "r": { 15 | "item": "minecraft:redstone" 16 | } 17 | }, 18 | "pattern": [ 19 | " l ", 20 | "mrm", 21 | " p " 22 | ], 23 | "result": { 24 | "count": 1, 25 | "id": "moderndynamics:filter" 26 | } 27 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/recipe/attractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "e": { 6 | "item": "minecraft:ender_pearl" 7 | }, 8 | "m": { 9 | "item": "minecraft:iron_ingot" 10 | }, 11 | "p": { 12 | "item": "minecraft:paper" 13 | }, 14 | "r": { 15 | "item": "minecraft:redstone" 16 | } 17 | }, 18 | "pattern": [ 19 | " e ", 20 | "mrm", 21 | " p " 22 | ], 23 | "result": { 24 | "count": 1, 25 | "id": "moderndynamics:attractor" 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/models/base/connector.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "elements": [ 4 | { 5 | "from": [4, 4, 0], 6 | "to": [12, 12, 4], 7 | "faces": { 8 | "north": {"uv": [8, 0, 12, 4], "texture": "#0"}, 9 | "east": {"uv": [8, 4, 12, 6], "rotation": 90, "texture": "#0"}, 10 | "south": {"uv": [4, 0, 8, 4], "texture": "#0"}, 11 | "west": {"uv": [12, 4, 8, 6], "rotation": 270, "texture": "#0"}, 12 | "up": {"uv": [12, 4, 8, 6], "texture": "#0"}, 13 | "down": {"uv": [8, 4, 12, 6], "rotation": 180, "texture": "#0"} 14 | } 15 | } 16 | ], 17 | "display": {} 18 | } -------------------------------------------------------------------------------- /src/main/resources/META-INF/neoforge.mods.toml: -------------------------------------------------------------------------------- 1 | modLoader="javafml" 2 | loaderVersion="[1,)" 3 | issueTrackerURL="https://github.com/Technici4n/Modern-Dynamics" 4 | displayURL="https://www.curseforge.com/minecraft/mc-mods/modern-dynamics" 5 | logoFile="assets/moderndynamics/mdlogo.png" 6 | authors="Technici4n" 7 | license="LGPLv3" 8 | 9 | [[mods]] 10 | modId="moderndynamics" 11 | version="${version}" 12 | displayName="Modern Dynamics" 13 | description="Modern item, fluid and energy transport Minecraft mod." 14 | 15 | [[mixins]] 16 | config="moderndynamics.mixins.json" 17 | 18 | [[dependencies.moderndynamics]] 19 | modId="neoforge" 20 | type="REQUIRED" 21 | versionRange="[21.1.169,)" 22 | ordering="NONE" 23 | side="BOTH" 24 | -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/tools/wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_iron": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "minecraft:iron_ingot" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:wrench" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_iron" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:wrench" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_lapis": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "minecraft:lapis_lazuli" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:filter" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_lapis" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:filter" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/extractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_hopper": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "minecraft:hopper" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:extractor" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_hopper" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:extractor" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/item_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_ingot": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "minecraft:iron_ingot" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:item_pipe" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_ingot" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:item_pipe" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/fluid_pipe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_ingot": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "minecraft:copper_ingot" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:fluid_pipe" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_ingot" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:fluid_pipe" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/attractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_ender_pearl": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "minecraft:ender_pearl" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:attractor" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_ender_pearl" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:attractor" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/inhibitor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_item_pipe": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "moderndynamics:item_pipe" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "moderndynamics:inhibitor" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_the_recipe", 24 | "has_item_pipe" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "moderndynamics:inhibitor" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /docs/ITEMS.md: -------------------------------------------------------------------------------- 1 | # Plans for MTr item transfer 2 | 3 | ## Simulated inventory 4 | Will need to simulate pending operations for an `IItemHandler`, and handle cases where the simulated operation fails later gracefully. 5 | 6 | ## Graph operations 7 | I assume a Dijkstra from the source to collect all targets by distance will be enough. 8 | That can be cached, I assume. 9 | 10 | ## Items travelling through the network 11 | The only complex bit! 12 | List of corner cases that must be dealt with: 13 | * Pipe is broken with the item inside. 14 | * Pipe in the path is broken, so the item will not be able to enter it later. 15 | * Part of the network is unloaded. 16 | * Target is broken. 17 | * Insertion into the target fails. 18 | * Pipe connection (to a connected pipe or inventory) is broken with an item inside. 19 | 20 | -------------------------------------------------------------------------------- /license_header.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: checkout repository 14 | uses: actions/checkout@v2 15 | 16 | - name: Set up JDK 17 17 | uses: actions/setup-java@v3 18 | with: 19 | distribution: 'microsoft' 20 | java-version: '17' 21 | 22 | - name: Setup Gradle 23 | uses: gradle/gradle-build-action@v2 24 | with: 25 | cache-read-only: ${{ github.ref != 'refs/heads/master' }} 26 | 27 | - name: build 28 | run: ./gradlew build --stacktrace 29 | - name: capture build artifacts 30 | uses: actions/upload-artifact@v4 31 | with: 32 | name: Artifacts 33 | path: build/libs/ 34 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/FilterNbtMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum FilterNbtMode { 22 | RESPECT_NBT, 23 | IGNORE_NBT 24 | } 25 | -------------------------------------------------------------------------------- /src/generated/resources/data/moderndynamics/advancement/recipes/transportation/machine_extender.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_fluid_pipe": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": "moderndynamics:fluid_pipe" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_item_pipe": { 15 | "conditions": { 16 | "items": [ 17 | { 18 | "items": "moderndynamics:item_pipe" 19 | } 20 | ] 21 | }, 22 | "trigger": "minecraft:inventory_changed" 23 | }, 24 | "has_the_recipe": { 25 | "conditions": { 26 | "recipe": "moderndynamics:machine_extender" 27 | }, 28 | "trigger": "minecraft:recipe_unlocked" 29 | } 30 | }, 31 | "requirements": [ 32 | [ 33 | "has_the_recipe", 34 | "has_item_pipe", 35 | "has_fluid_pipe" 36 | ] 37 | ], 38 | "rewards": { 39 | "recipes": [ 40 | "moderndynamics:machine_extender" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/IoAttachmentType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment; 20 | 21 | public enum IoAttachmentType { 22 | ATTRACTOR, 23 | EXTRACTOR, 24 | FILTER, 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/FilterInversionMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum FilterInversionMode { 22 | WHITELIST, 23 | BLACKLIST, 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/FilterModMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum FilterModMode { 22 | IGNORE_MOD, 23 | INCLUDE_ALL_OF_MOD 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/FilterDamageMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum FilterDamageMode { 22 | RESPECT_DAMAGE, 23 | IGNORE_DAMAGE 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/FilterSimilarMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum FilterSimilarMode { 22 | IGNORE_SIMILAR, 23 | INCLUDE_SIMILAR 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/OversendingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum OversendingMode { 22 | PREVENT_OVERSENDING, 23 | ALLOW_OVERSENDING 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/RoutingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | public enum RoutingMode { 22 | CLOSEST, 23 | FURTHEST, 24 | RANDOM, 25 | ROUND_ROBIN, 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | # used for pipe outline rendering 2 | public net.minecraft.client.renderer.LevelRenderer renderShape(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;Lnet/minecraft/world/phys/shapes/VoxelShape;DDDFFFF)V 3 | 4 | # fluid slot rendering 5 | public-f net.minecraft.client.gui.screens.inventory.AbstractContainerScreen renderSlot(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/world/inventory/Slot;)V 6 | 7 | # access server resource manager 8 | public net.minecraft.server.MinecraftServer$ReloadableResources 9 | 10 | # access game test info 11 | public net.minecraft.gametest.framework.GameTestHelper testInfo 12 | 13 | public net.minecraft.data.models.BlockModelGenerators blockStateOutput 14 | public net.minecraft.data.models.BlockModelGenerators modelOutput 15 | public net.minecraft.data.models.BlockModelGenerators delegateItemModel(Lnet/minecraft/world/level/block/Block;Lnet/minecraft/resources/ResourceLocation;)V 16 | public net.minecraft.data.models.ItemModelGenerators generateFlatItem(Lnet/minecraft/world/item/Item;Lnet/minecraft/data/models/model/ModelTemplate;)V 17 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/screen/CycleSetting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client.screen; 20 | 21 | import net.minecraft.network.chat.Component; 22 | 23 | record CycleSetting(T value, Component tooltip, int spriteX, int spriteY) { 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/models/base/straight_transparent.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "elements": [ 4 | { 5 | "from": [5, 5, 0], 6 | "to": [11, 11, 16], 7 | "faces": { 8 | "east": {"uv": [16, 5, 0, 11], "texture": "#0"}, 9 | "west": {"uv": [16, 11, 0, 5], "texture": "#0"}, 10 | "up": {"uv": [0, 5, 16, 11], "rotation": 90, "texture": "#0"}, 11 | "down": {"uv": [0, 11, 16, 5], "rotation": 90, "texture": "#0"} 12 | } 13 | }, 14 | { 15 | "from": [5, -1, 0], 16 | "to": [11, 5, 16], 17 | "faces": { 18 | "up": {"uv": [16, 11, 0, 5], "rotation": 90, "texture": "#0"} 19 | } 20 | }, 21 | { 22 | "from": [5, 11, 0], 23 | "to": [11, 17, 16], 24 | "faces": { 25 | "down": {"uv": [16, 5, 0, 11], "rotation": 90, "texture": "#0"} 26 | } 27 | }, 28 | { 29 | "from": [11, 5, 0], 30 | "to": [17, 11, 16], 31 | "faces": { 32 | "west": {"uv": [0, 5, 16, 11], "texture": "#0"} 33 | } 34 | }, 35 | { 36 | "from": [-1, 5, 0], 37 | "to": [5, 11, 16], 38 | "faces": { 39 | "east": {"uv": [0, 11, 16, 5], "texture": "#0"} 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/item/StartTravelCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.item; 20 | 21 | import dev.technici4n.moderndynamics.util.ItemVariant; 22 | 23 | public interface StartTravelCallback { 24 | void startTravel(ItemVariant variant, int amount); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/compat/jei/UpgradeDisplay.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client.compat.jei; 20 | 21 | import dev.technici4n.moderndynamics.attachment.upgrade.UpgradeType; 22 | import net.minecraft.world.item.Item; 23 | 24 | public record UpgradeDisplay(Item item, UpgradeType upgradeInfo) { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/ExtendedMenuProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import net.minecraft.network.RegistryFriendlyByteBuf; 22 | import net.minecraft.world.MenuProvider; 23 | 24 | public interface ExtendedMenuProvider extends MenuProvider { 25 | void writeScreenOpeningData(RegistryFriendlyByteBuf buf); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/Network.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network; 20 | 21 | import java.util.List; 22 | 23 | public class Network> { 24 | final List> nodes; 25 | C cache; 26 | 27 | public Network(List> nodes) { 28 | this.nodes = nodes; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/assets/moderndynamics/models/base/connector_transparent.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "elements": [ 4 | { 5 | "from": [4, 4, 0], 6 | "to": [12, 12, 4], 7 | "faces": { 8 | "north": {"uv": [8, 0, 12, 4], "texture": "#0"}, 9 | "east": {"uv": [8, 4, 12, 6], "rotation": 90, "texture": "#0"}, 10 | "south": {"uv": [4, 0, 8, 4], "texture": "#0"}, 11 | "west": {"uv": [12, 4, 8, 6], "rotation": 270, "texture": "#0"}, 12 | "up": {"uv": [12, 4, 8, 6], "texture": "#0"}, 13 | "down": {"uv": [8, 4, 12, 6], "rotation": 180, "texture": "#0"} 14 | } 15 | }, 16 | { 17 | "from": [5, 4, 0], 18 | "to": [11, 4.99, 4], 19 | "faces": { 20 | "up": {"uv": [11.5, 4, 8.5, 6], "texture": "#0"} 21 | } 22 | }, 23 | { 24 | "from": [4, 5, 0], 25 | "to": [4.99, 11, 4], 26 | "faces": { 27 | "east": {"uv": [8.5, 4, 11.5, 6], "rotation": 90, "texture": "#0"} 28 | } 29 | }, 30 | { 31 | "from": [5, 11.001, 0], 32 | "to": [11, 12, 4], 33 | "faces": { 34 | "down": {"uv": [11.5, 6, 8.5, 4], "texture": "#0"} 35 | } 36 | }, 37 | { 38 | "from": [11.001, 5, 0], 39 | "to": [12, 11, 4], 40 | "faces": { 41 | "west": {"uv": [8.5, 6, 11.5, 4], "rotation": 90, "texture": "#0"} 42 | } 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/MdId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import net.minecraft.resources.ResourceLocation; 22 | 23 | public final class MdId { 24 | private MdId() { 25 | } 26 | 27 | public static final String MOD_ID = "moderndynamics"; 28 | 29 | public static ResourceLocation of(String path) { 30 | return ResourceLocation.fromNamespaceAndPath(MOD_ID, path); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/init/MdTags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.init; 20 | 21 | import net.minecraft.core.registries.Registries; 22 | import net.minecraft.resources.ResourceLocation; 23 | import net.minecraft.tags.TagKey; 24 | import net.minecraft.world.item.Item; 25 | 26 | public class MdTags { 27 | public static final TagKey WRENCHES = TagKey.create(Registries.ITEM, ResourceLocation.parse("c:tools/wrench")); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/UnsidedPacketHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import net.minecraft.network.FriendlyByteBuf; 22 | import net.minecraft.world.entity.player.Player; 23 | 24 | /** 25 | * A packet handler that works both client-side and server-side. 26 | */ 27 | @FunctionalInterface 28 | public interface UnsidedPacketHandler { 29 | Runnable handlePacket(Player player, FriendlyByteBuf buf); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/attached/AttachedInhibitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.attached; 20 | 21 | import dev.technici4n.moderndynamics.attachment.InhibitorAttachmentItem; 22 | import net.minecraft.nbt.CompoundTag; 23 | 24 | public class AttachedInhibitor extends AttachedAttachment { 25 | public AttachedInhibitor(InhibitorAttachmentItem item, CompoundTag configTag) { 26 | super(item, configTag); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/thirdparty/fabric/RenderContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.thirdparty.fabric; 20 | 21 | public interface RenderContext { 22 | @FunctionalInterface 23 | public interface QuadTransform { 24 | /** 25 | * Return false to filter out quads from rendering. When more than one transform is in effect, returning false 26 | * means unapplied transforms will not receive the quad. 27 | */ 28 | boolean transform(MutableQuadView quad); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | # Also add exports for google-java-format to work in modern java 3 | org.gradle.jvmargs=-Xmx1G \ 4 | --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ 5 | --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ 6 | --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ 7 | --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ 8 | --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 9 | 10 | org.gradle.caching=true 11 | org.gradle.parallel=true 12 | 13 | minecraft_version=1.21.1 14 | 15 | # Mod Properties 16 | maven_group = dev.technici4n 17 | archives_base_name = Modern-Dynamics 18 | curseforge_project = 552758 19 | modrinth_project = fMpvLrnF 20 | 21 | # Dependencies 22 | neoforge_version=21.1.169 23 | 24 | ######################################################### 25 | # Parchment # 26 | ######################################################### 27 | neoForge.parchment.minecraftVersion=1.21 28 | neoForge.parchment.mappingsVersion=2024.07.07 29 | 30 | # In-dev runtime mods 31 | rei_version=16.0.729 32 | 33 | jei_minecraft_version=1.21.1 34 | jei_version=19.18.3.204 35 | 36 | emi_minecraft_version=1.21.1 37 | emi_version=1.1.13 38 | 39 | # Set to emi, jei, or rei to pick which tooltip mod gets picked at runtime 40 | # for the dev environment. 41 | runtime_itemlist_mod=emi 42 | 43 | jade_file_id=5727431 44 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/item/MaxParticipant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.item; 20 | 21 | public class MaxParticipant { 22 | private int max = 0; 23 | 24 | public void addEntry(int amount, boolean simulate) { 25 | if (amount > max) { 26 | max = amount; 27 | } 28 | } 29 | 30 | public int getMax() { 31 | return max; 32 | } 33 | 34 | protected Integer createSnapshot() { 35 | return max; 36 | } 37 | 38 | protected void readSnapshot(Integer snapshot) { 39 | max = snapshot; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/gui/menu/ItemConfigSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.gui.menu; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.ItemAttachedIo; 22 | import net.minecraft.world.item.ItemStack; 23 | 24 | public class ItemConfigSlot extends ConfigSlot { 25 | public ItemConfigSlot(int x, int y, ItemAttachedIo attachment, int configIdx) { 26 | super(x, y, attachment, configIdx); 27 | } 28 | 29 | @Override 30 | public ItemStack getItem() { 31 | return getAttachment().getFilter(getConfigIdx()).toStack(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/ClientProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client; 20 | 21 | import dev.technici4n.moderndynamics.MdProxy; 22 | import net.minecraft.client.Minecraft; 23 | import net.minecraft.client.gui.screens.Screen; 24 | 25 | public class ClientProxy extends MdProxy { 26 | @Override 27 | public boolean isShiftDown() { 28 | return Screen.hasShiftDown(); 29 | } 30 | 31 | @Override 32 | public boolean isMemoryConnection() { 33 | var listener = Minecraft.getInstance().getConnection(); 34 | return listener != null && listener.getConnection().isMemoryConnection(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics; 20 | 21 | import net.neoforged.neoforge.fluids.FluidType; 22 | 23 | // All the things that should be moved to a config "one day" 24 | public class Constants { 25 | public static class Fluids { 26 | public static final int BASE_IO = FluidType.BUCKET_VOLUME / 50; 27 | public static final int CAPACITY = FluidType.BUCKET_VOLUME; 28 | } 29 | 30 | public static class Items { 31 | public static final double SPEED_IN_PIPES = 0.02; 32 | } 33 | 34 | public static class Upgrades { 35 | public static final int MAX_FILTER = 15; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/pipe/NyiPipeBlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.pipe; 20 | 21 | import dev.technici4n.moderndynamics.network.NodeHost; 22 | import net.minecraft.core.BlockPos; 23 | import net.minecraft.world.level.block.entity.BlockEntityType; 24 | import net.minecraft.world.level.block.state.BlockState; 25 | 26 | public class NyiPipeBlockEntity extends PipeBlockEntity { 27 | public NyiPipeBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { 28 | super(type, pos, state); 29 | } 30 | 31 | @Override 32 | protected NodeHost[] createHosts() { 33 | return new NodeHost[0]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/energy/SimpleEnergyStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.energy; 20 | 21 | import net.neoforged.neoforge.energy.EnergyStorage; 22 | 23 | class SimpleEnergyStorage extends EnergyStorage { 24 | public SimpleEnergyStorage(int capacity, int maxReceive, int maxExtract) { 25 | super(capacity, maxReceive, maxExtract); 26 | } 27 | 28 | public void setEnergy(int energy) { 29 | this.energy = energy; 30 | } 31 | 32 | public void addEnergyStored(int energy) { 33 | this.energy += energy; 34 | } 35 | 36 | public void reduceEnergyStored(int energy) { 37 | this.energy -= energy; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/settings/RedstoneMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.settings; 20 | 21 | import net.minecraft.network.chat.Component; 22 | 23 | public enum RedstoneMode { 24 | IGNORED("gui.moderndynamics.setting.redstone_control.ignored"), 25 | REQUIRES_LOW("gui.moderndynamics.setting.redstone_control.low"), 26 | REQUIRES_HIGH("gui.moderndynamics.setting.redstone_control.high"); 27 | 28 | private final Component component; 29 | 30 | public Component getTranslation() { 31 | return component; 32 | } 33 | 34 | RedstoneMode(String translationKey) { 35 | this.component = Component.translatable(translationKey); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/energy/EnergyPipeTier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.energy; 20 | 21 | public enum EnergyPipeTier { 22 | BASIC(256, 256), 23 | IMPROVED(1024, 1024), 24 | ADVANCED(8192, 8192); 25 | 26 | // TODO: config 27 | private final int capacity; 28 | private final int maxConnectionTransfer; 29 | 30 | EnergyPipeTier(int capacity, int maxConnectionTransfer) { 31 | this.capacity = capacity; 32 | this.maxConnectionTransfer = maxConnectionTransfer; 33 | } 34 | 35 | public int getCapacity() { 36 | return capacity; 37 | } 38 | 39 | public int getMaxConnectionTransfer() { 40 | return maxConnectionTransfer; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/compat/mi/MIProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.compat.mi; 20 | 21 | import dev.technici4n.moderndynamics.network.mienergy.MICableTier; 22 | import net.minecraft.core.Direction; 23 | import net.neoforged.fml.ModList; 24 | import net.neoforged.neoforge.capabilities.BlockCapability; 25 | import net.neoforged.neoforge.energy.IEnergyStorage; 26 | 27 | public interface MIProxy { 28 | String MOD_ID = "modern_industrialization"; 29 | 30 | MIProxy INSTANCE = ModList.get().isLoaded(MOD_ID) ? new MIAvailableProxy() : new MIAbsentProxy(); 31 | 32 | BlockCapability getLookup(); 33 | 34 | boolean canConnect(IEnergyStorage storage, MICableTier tier); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/GeometryHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client; 20 | 21 | import static net.minecraft.core.Direction.*; 22 | 23 | import net.minecraft.core.Direction; 24 | 25 | public final class GeometryHelper { 26 | private GeometryHelper() { 27 | } 28 | 29 | /** 30 | * Vectors to the right of the face, i.e. the X axis in the XY plane of the 31 | * face. 32 | */ 33 | public static Direction[] FACE_RIGHT = new Direction[] { EAST, EAST, WEST, EAST, SOUTH, NORTH, }; 34 | /** 35 | * Vectors to the up of the face, i.e. the Y axis in the XY plane of the face. 36 | */ 37 | public static Direction[] FACE_UP = new Direction[] { SOUTH, NORTH, UP, UP, UP, UP, }; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/InhibitorAttachmentItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.AttachedInhibitor; 22 | import dev.technici4n.moderndynamics.network.NodeHost; 23 | import net.minecraft.core.HolderLookup; 24 | import net.minecraft.nbt.CompoundTag; 25 | 26 | public class InhibitorAttachmentItem extends AttachmentItem { 27 | public InhibitorAttachmentItem(RenderedAttachment attachment) { 28 | super(attachment); 29 | } 30 | 31 | @Override 32 | public AttachedInhibitor createAttached(NodeHost host, CompoundTag configTag, HolderLookup.Provider registries) { 33 | return new AttachedInhibitor(this, configTag); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/gui/menu/FluidConfigSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.gui.menu; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.FluidAttachedIo; 22 | import dev.technici4n.moderndynamics.util.FluidVariant; 23 | import net.minecraft.world.item.ItemStack; 24 | 25 | public class FluidConfigSlot extends ConfigSlot { 26 | public FluidConfigSlot(int x, int y, FluidAttachedIo attachment, int configIdx) { 27 | super(x, y, attachment, configIdx); 28 | } 29 | 30 | @Override 31 | public ItemStack getItem() { 32 | return ItemStack.EMPTY; 33 | } 34 | 35 | public FluidVariant getFilter() { 36 | return getAttachment().getFilter(getConfigIdx()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: 'Release' 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Set up JDK 17 15 | uses: actions/setup-java@v3 16 | with: 17 | distribution: 'microsoft' 18 | java-version: '17' 19 | 20 | - name: Setup Gradle 21 | uses: gradle/gradle-build-action@v2 22 | with: 23 | cache-read-only: ${{ github.ref != 'refs/heads/master' }} 24 | 25 | - name: Build with Gradle 26 | env: 27 | MOD_VERSION: ${{ github.event.release.tag_name }} 28 | run: ./gradlew build 29 | - name: Upload Release Artifact 30 | uses: actions/upload-release-asset@v1.0.1 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | with: 34 | upload_url: ${{ github.event.release.upload_url }} 35 | asset_path: ./build/libs/Modern-Dynamics-${{ github.event.release.tag_name }}.jar 36 | asset_name: moderndynamics-${{ github.event.release.tag_name }}.jar 37 | asset_content_type: application/zip 38 | - name: Upload to Curseforge 39 | env: 40 | MOD_VERSION: ${{ github.event.release.tag_name }} 41 | CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} 42 | run: ./gradlew curseforge552758 43 | - name: Upload to Modrinth 44 | env: 45 | MOD_VERSION: ${{ github.event.release.tag_name }} 46 | MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }} 47 | run: ./gradlew modrinth 48 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/pipe/FluidPipeBlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.pipe; 20 | 21 | import dev.technici4n.moderndynamics.network.NodeHost; 22 | import dev.technici4n.moderndynamics.network.fluid.FluidHost; 23 | import net.minecraft.core.BlockPos; 24 | import net.minecraft.world.level.block.entity.BlockEntityType; 25 | import net.minecraft.world.level.block.state.BlockState; 26 | 27 | public class FluidPipeBlockEntity extends PipeBlockEntity { 28 | public FluidPipeBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { 29 | super(type, pos, state); 30 | } 31 | 32 | @Override 33 | protected NodeHost[] createHosts() { 34 | return new NodeHost[] { new FluidHost(this) }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/pipe/ItemPipeBlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.pipe; 20 | 21 | import dev.technici4n.moderndynamics.network.NodeHost; 22 | import dev.technici4n.moderndynamics.network.item.ItemHost; 23 | import net.minecraft.core.BlockPos; 24 | import net.minecraft.world.level.block.entity.BlockEntityType; 25 | import net.minecraft.world.level.block.state.BlockState; 26 | 27 | public class ItemPipeBlockEntity extends PipeBlockEntity { 28 | public ItemPipeBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { 29 | super(type, pos, state); 30 | } 31 | 32 | @Override 33 | protected NodeHost[] createHosts() { 34 | ItemHost item = new ItemHost(this); 35 | return new NodeHost[] { item }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/AttachmentItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.AttachedAttachment; 22 | import dev.technici4n.moderndynamics.network.NodeHost; 23 | import net.minecraft.core.HolderLookup; 24 | import net.minecraft.nbt.CompoundTag; 25 | import net.minecraft.world.item.Item; 26 | 27 | public abstract class AttachmentItem extends Item { 28 | public final RenderedAttachment attachment; 29 | 30 | public AttachmentItem(RenderedAttachment attachment) { 31 | super(new Properties()); 32 | this.attachment = attachment; 33 | } 34 | 35 | public abstract AttachedAttachment createAttached(NodeHost host, CompoundTag configTag, HolderLookup.Provider registries); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/packets/SetInt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.packets; 20 | 21 | import net.minecraft.network.FriendlyByteBuf; 22 | import net.minecraft.network.codec.ByteBufCodecs; 23 | import net.minecraft.network.codec.StreamCodec; 24 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 25 | 26 | record SetInt(Type type, int syncId, int value) implements CustomPacketPayload { 27 | public static StreamCodec codec(Type type) { 28 | return StreamCodec.composite( 29 | ByteBufCodecs.VAR_INT, 30 | SetInt::syncId, 31 | ByteBufCodecs.VAR_INT, 32 | SetInt::value, 33 | (syncId, value) -> new SetInt(type, syncId, value)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/gui/menu/UpgradePanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.gui.menu; 20 | 21 | /** 22 | * Constants for the upgrade panel 23 | */ 24 | public class UpgradePanel { 25 | public static final int START_LEFT = -24; 26 | public static final int START_TOP = 4; 27 | public static final int HEIGHT = 82; 28 | public static final int WIDTH = 24; 29 | public static final int END_LEFT = START_LEFT + WIDTH; 30 | public static final int END_TOP = START_TOP + HEIGHT; 31 | 32 | public static final int FIRST_SLOT_LEFT = START_LEFT + 6; 33 | public static final int FIRST_SLOT_TOP = START_TOP + 6; 34 | 35 | public static boolean isInside(double x, double y) { 36 | return START_LEFT <= x && x <= END_LEFT && START_TOP <= y && y <= END_TOP; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/test/MdGameTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.test; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.METHOD) 28 | public @interface MdGameTest { 29 | int timeoutTicks() default 100; 30 | 31 | String batch() default "defaultBatch"; 32 | 33 | boolean skyAccess() default false; 34 | 35 | int rotationSteps() default 0; 36 | 37 | long setupTicks() default 0L; 38 | 39 | int attempts() default 1; 40 | 41 | int requiredSuccesses() default 1; 42 | 43 | boolean required() default true; 44 | 45 | boolean manualOnly() default false; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/TransferUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import net.neoforged.neoforge.items.IItemHandler; 22 | import net.neoforged.neoforge.items.ItemHandlerHelper; 23 | 24 | public final class TransferUtil { 25 | private TransferUtil() { 26 | } 27 | 28 | public static int insertItemStacked(IItemHandler handler, ItemVariant variant, int amount) { 29 | return insertItemStacked(handler, variant, amount, false); 30 | } 31 | 32 | public static int insertItemStacked(IItemHandler handler, ItemVariant variant, int amount, boolean simulate) { 33 | var stack = variant.toStack(amount); 34 | 35 | var remainder = ItemHandlerHelper.insertItem(handler, stack, simulate); 36 | return amount - remainder.getCount(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/ShapeHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import net.minecraft.world.phys.AABB; 22 | import net.minecraft.world.phys.Vec3; 23 | import net.minecraft.world.phys.shapes.VoxelShape; 24 | 25 | public class ShapeHelper { 26 | /** 27 | * Return true if the passed shape contains the position, or is on its border. 28 | */ 29 | public static boolean shapeContains(VoxelShape shape, Vec3 posInBlock) { 30 | for (AABB box : shape.toAabbs()) { 31 | // Move slightly toward the center of the box 32 | Vec3 centerDirection = box.getCenter().subtract(posInBlock).normalize().scale(1e-4); 33 | 34 | if (box.contains(posInBlock.add(centerDirection))) { 35 | return true; 36 | } 37 | } 38 | 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/init/MdAttachments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.init; 20 | 21 | import dev.technici4n.moderndynamics.attachment.RenderedAttachment; 22 | 23 | public class MdAttachments { 24 | public static final RenderedAttachment ATTRACTOR = new RenderedAttachment("attractor"); 25 | public static final RenderedAttachment ATTRACTOR_STUFFED = new RenderedAttachment("attractor_stuffed"); 26 | public static final RenderedAttachment EXTRACTOR = new RenderedAttachment("extractor"); 27 | public static final RenderedAttachment EXTRACTOR_STUFFED = new RenderedAttachment("extractor_stuffed"); 28 | public static final RenderedAttachment FILTER = new RenderedAttachment("filter"); 29 | public static final RenderedAttachment INHIBITOR = new RenderedAttachment("inhibitor"); 30 | 31 | public static void init() { 32 | // init static 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/mienergy/MICableTier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.mienergy; 20 | 21 | public enum MICableTier { 22 | LV("lv", 32), 23 | MV("mv", 32 * 4), 24 | HV("hv", 32 * 4 * 8), 25 | EV("ev", 32 * 4 * 8 * 8), 26 | SUPERCONDUCTOR("superconductor", 128000000); 27 | 28 | // Very important that this matches exactly what's used in MIEnergyStorage#canConnect. 29 | private final String tierName; 30 | private final int baseEu; 31 | 32 | MICableTier(String tierName, int baseEu) { 33 | this.tierName = tierName; 34 | this.baseEu = baseEu; 35 | } 36 | 37 | public String getName() { 38 | return this.tierName; 39 | } 40 | 41 | /** 42 | * Max network-wide transfer and max storage in each cable. 43 | */ 44 | public int getMax() { 45 | return baseEu * 8; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/MdProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics; 20 | 21 | import net.neoforged.fml.loading.FMLLoader; 22 | 23 | public class MdProxy { 24 | public static final MdProxy INSTANCE = switch (FMLLoader.getDist()) { 25 | case DEDICATED_SERVER -> new MdProxy(); 26 | case CLIENT -> { 27 | try { 28 | yield (MdProxy) Class.forName("dev.technici4n.moderndynamics.client.ClientProxy").getConstructor().newInstance(); 29 | } catch (Exception exception) { 30 | throw new RuntimeException("Failed to instantiate Modern Dynamics client proxy.", exception); 31 | } 32 | } 33 | }; 34 | 35 | public boolean isShiftDown() { 36 | return false; 37 | } 38 | 39 | /** 40 | * Checks if the current client has a memory connection to the server. 41 | */ 42 | public boolean isMemoryConnection() { 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/item/FailedInsertStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.item; 20 | 21 | public enum FailedInsertStrategy { 22 | DROP("drop"), 23 | SEND_BACK_TO_SOURCE("source"), 24 | BUFFER_IN_TARGET("target"), 25 | ; 26 | 27 | private final String serializedName; 28 | 29 | FailedInsertStrategy(String serializedName) { 30 | this.serializedName = serializedName; 31 | } 32 | 33 | public String getSerializedName() { 34 | return serializedName; 35 | } 36 | 37 | public static FailedInsertStrategy bySerializedName(String serializedName) { 38 | return switch (serializedName) { 39 | case "drop" -> DROP; 40 | case "source" -> SEND_BACK_TO_SOURCE; 41 | case "target" -> BUFFER_IN_TARGET; 42 | default -> throw new RuntimeException("Unknown failed insert strategy: " + serializedName); 43 | }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Modern Dynamics (MD) 2 | Modern item and fluid transport for Neoforge, inspired by Thermal Dynamics. 3 | 4 | Download now from [Curseforge](https://www.curseforge.com/minecraft/mc-mods/modern-dynamics) or [Modrinth](https://modrinth.com/mod/modern-dynamics)! 5 | 6 | ## Status: Released, testing appreciated! 7 | We appreciate people testing out Modern Dynamics, however please expect it to contain bugs and rough edges. 8 | If you want to help, download a build [from GitHub](https://github.com/Technici4n/Modern-Dynamics/releases) and test it out in your world. 9 | If you find any bug or missing feature, please open **one issue per feature/bug** on GitHub, 10 | but **check first that no such issue exists**. 11 | Discussion on [the AE2 discord](https://discord.gg/Zd6t9ka7ne). 12 | 13 | ### Why did you make yet another pipe mod? 14 | * We believe a lot of people are interested in a Thermal Dynamics-like pipe mod. 15 | * I (Technici4n) have written instantaneous pipes for Modern Industrialization, and I want to try doing non-instantaneous pipes now. 16 | It's a lot more complex, which makes it fun. 17 | 18 | ### Why are you copying Thermal Dynamics? 19 | * Reusing TD's concepts allows us to focus on getting the core logic working for now, 20 | but once the mod is working we will revisit some design decisions to further improve the mod. 21 | * Reusing TD's textures (modified) is allowed by TD's license. All code is original. 22 | 23 | ## License 24 | 25 | ### Code 26 | Lesser General Public License v3. 27 | 28 | ### Art and Sound Assets 29 | 30 | [© 2012-2017 Cult of the Full Hub / Team CoFH / CoFH](https://github.com/CoFH/ThermalDynamics) 31 | 32 | Art and sound assets are released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International ([CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)) 33 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/pipe/MIEnergyCableBlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.pipe; 20 | 21 | import dev.technici4n.moderndynamics.network.NodeHost; 22 | import dev.technici4n.moderndynamics.network.mienergy.MICableTier; 23 | import dev.technici4n.moderndynamics.network.mienergy.MIEnergyHost; 24 | import net.minecraft.core.BlockPos; 25 | import net.minecraft.world.level.block.entity.BlockEntityType; 26 | import net.minecraft.world.level.block.state.BlockState; 27 | 28 | public class MIEnergyCableBlockEntity extends PipeBlockEntity { 29 | private final MICableTier tier; 30 | 31 | public MIEnergyCableBlockEntity(BlockEntityType type, BlockPos pos, BlockState state, MICableTier tier) { 32 | super(type, pos, state); 33 | 34 | this.tier = tier; 35 | } 36 | 37 | @Override 38 | protected NodeHost[] createHosts() { 39 | return new NodeHost[] { new MIEnergyHost(this, tier) }; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/compat/mi/MIAbsentProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.compat.mi; 20 | 21 | import dev.technici4n.moderndynamics.network.mienergy.MICableTier; 22 | import dev.technici4n.moderndynamics.util.MdId; 23 | import net.minecraft.core.Direction; 24 | import net.neoforged.neoforge.capabilities.BlockCapability; 25 | import net.neoforged.neoforge.energy.IEnergyStorage; 26 | 27 | public class MIAbsentProxy implements MIProxy { 28 | private static final BlockCapability MISSING_LOOKUP = BlockCapability.createSided( 29 | MdId.of("mi_energy_missing"), 30 | IEnergyStorage.class); 31 | 32 | @Override 33 | public BlockCapability getLookup() { 34 | return MISSING_LOOKUP; 35 | } 36 | 37 | @Override 38 | public boolean canConnect(IEnergyStorage storage, MICableTier tier) { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/init/MdMenus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.init; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.FluidAttachedIo; 22 | import dev.technici4n.moderndynamics.attachment.attached.ItemAttachedIo; 23 | import dev.technici4n.moderndynamics.gui.menu.AttachmentMenuType; 24 | import dev.technici4n.moderndynamics.gui.menu.FluidAttachedIoMenu; 25 | import dev.technici4n.moderndynamics.gui.menu.ItemAttachedIoMenu; 26 | import net.minecraft.world.inventory.MenuType; 27 | 28 | public class MdMenus { 29 | public static final MenuType ITEM_IO = AttachmentMenuType.create("item_io", ItemAttachedIo::new, 30 | ItemAttachedIoMenu::new); 31 | public static final MenuType FLUID_IO = AttachmentMenuType.create("fluid_io", 32 | FluidAttachedIo::new, FluidAttachedIoMenu::new); 33 | 34 | public static void init() { 35 | // init static 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/data/ItemTagsProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.data; 20 | 21 | import dev.technici4n.moderndynamics.init.MdItems; 22 | import dev.technici4n.moderndynamics.init.MdTags; 23 | import dev.technici4n.moderndynamics.util.MdId; 24 | import java.util.concurrent.CompletableFuture; 25 | import net.minecraft.core.HolderLookup; 26 | import net.minecraft.data.PackOutput; 27 | import net.neoforged.neoforge.common.data.ExistingFileHelper; 28 | 29 | public class ItemTagsProvider extends net.minecraft.data.tags.ItemTagsProvider { 30 | public ItemTagsProvider(PackOutput packOutput, CompletableFuture registries, ExistingFileHelper existingFileHelper) { 31 | super(packOutput, registries, CompletableFuture.completedFuture(TagLookup.empty()), MdId.MOD_ID, existingFileHelper); 32 | } 33 | 34 | @Override 35 | protected void addTags(HolderLookup.Provider provider) { 36 | this.tag(MdTags.WRENCHES).add(MdItems.WRENCH); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/compat/jade/MdJadePlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.compat.jade; 20 | 21 | import dev.technici4n.moderndynamics.init.MdBlocks; 22 | import dev.technici4n.moderndynamics.pipe.PipeBlockEntity; 23 | import snownee.jade.api.IWailaClientRegistration; 24 | import snownee.jade.api.IWailaCommonRegistration; 25 | import snownee.jade.api.IWailaPlugin; 26 | import snownee.jade.api.WailaPlugin; 27 | 28 | @WailaPlugin 29 | public class MdJadePlugin implements IWailaPlugin { 30 | @Override 31 | public void register(IWailaCommonRegistration registration) { 32 | registration.registerItemStorage(ItemPipeServerProvider.INSTANCE, PipeBlockEntity.class); 33 | } 34 | 35 | @Override 36 | public void registerClient(IWailaClientRegistration registration) { 37 | registration.registerItemStorageClient(ItemPipeServerProvider.INSTANCE); 38 | for (var pipe : MdBlocks.ALL_PIPES) { 39 | registration.usePickedResult(pipe); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/packets/SetEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.packets; 20 | 21 | import net.minecraft.network.FriendlyByteBuf; 22 | import net.minecraft.network.codec.ByteBufCodecs; 23 | import net.minecraft.network.codec.StreamCodec; 24 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 25 | 26 | record SetEnum>(Type> type, int syncId, T value) implements CustomPacketPayload { 27 | public static > StreamCodec> codec(Type> type, Class enumClass) { 28 | StreamCodec enumCodec = StreamCodec.of( 29 | FriendlyByteBuf::writeEnum, 30 | buf -> buf.readEnum(enumClass)); 31 | 32 | return StreamCodec.composite( 33 | ByteBufCodecs.VAR_INT, 34 | SetEnum::syncId, 35 | enumCodec, 36 | SetEnum::value, 37 | (syncId, value) -> new SetEnum<>(type, syncId, value)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/pipe/EnergyPipeBlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.pipe; 20 | 21 | import dev.technici4n.moderndynamics.network.NodeHost; 22 | import dev.technici4n.moderndynamics.network.energy.EnergyHost; 23 | import dev.technici4n.moderndynamics.network.energy.EnergyPipeTier; 24 | import net.minecraft.core.BlockPos; 25 | import net.minecraft.world.level.block.entity.BlockEntityType; 26 | import net.minecraft.world.level.block.state.BlockState; 27 | 28 | public class EnergyPipeBlockEntity extends PipeBlockEntity { 29 | private final EnergyPipeTier tier; 30 | 31 | public EnergyPipeBlockEntity(BlockEntityType type, EnergyPipeTier tier, BlockPos pos, BlockState state) { 32 | super(type, pos, state); 33 | this.tier = tier; 34 | } 35 | 36 | public EnergyPipeTier getTier() { 37 | return tier; 38 | } 39 | 40 | protected NodeHost[] createHosts() { 41 | EnergyHost energy = new EnergyHost(this, tier); 42 | return new NodeHost[] { energy }; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/gui/menu/ConfigSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.gui.menu; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.AttachedIo; 22 | import net.minecraft.world.SimpleContainer; 23 | import net.minecraft.world.inventory.Slot; 24 | import net.minecraft.world.item.ItemStack; 25 | 26 | public class ConfigSlot extends Slot { 27 | private final T attachment; 28 | private final int configIdx; 29 | 30 | public ConfigSlot(int x, int y, T attachment, int configIdx) { 31 | super(new SimpleContainer(1), 0, x, y); 32 | this.attachment = attachment; 33 | this.configIdx = configIdx; 34 | } 35 | 36 | @Override 37 | public boolean mayPlace(ItemStack stack) { 38 | return false; 39 | } 40 | 41 | @Override 42 | public boolean isActive() { 43 | return configIdx < attachment.getFilterSize(); 44 | } 45 | 46 | public T getAttachment() { 47 | return attachment; 48 | } 49 | 50 | public int getConfigIdx() { 51 | return configIdx; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/attached/FluidCachedFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment.attached; 20 | 21 | import dev.technici4n.moderndynamics.attachment.settings.FilterInversionMode; 22 | import dev.technici4n.moderndynamics.util.FluidVariant; 23 | import java.util.HashSet; 24 | import java.util.List; 25 | import java.util.Set; 26 | 27 | public class FluidCachedFilter { 28 | private final Set listedVariants; 29 | private final FilterInversionMode filterInversion; 30 | 31 | public FluidCachedFilter(List variants, 32 | FilterInversionMode filterInversion) { 33 | this.listedVariants = new HashSet<>(); 34 | this.filterInversion = filterInversion; 35 | 36 | for (var variant : variants) { 37 | if (!variant.isBlank()) { 38 | listedVariants.add(variant); 39 | } 40 | } 41 | } 42 | 43 | public boolean matches(FluidVariant variant) { 44 | return (filterInversion == FilterInversionMode.WHITELIST) == listedVariants.contains(variant); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/fluid/ConnectedFluidStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.fluid; 20 | 21 | import dev.technici4n.moderndynamics.attachment.IoAttachmentType; 22 | import dev.technici4n.moderndynamics.attachment.attached.FluidAttachedIo; 23 | import java.util.function.Function; 24 | import net.neoforged.neoforge.fluids.capability.IFluidHandler; 25 | import org.jetbrains.annotations.Nullable; 26 | 27 | public record ConnectedFluidStorage( 28 | IFluidHandler storage, 29 | @Nullable FluidAttachedIo attachment, 30 | /* 31 | * Rate-limiting version of storage that takes into account the extractor 32 | */ 33 | @Nullable IFluidHandler extractorFilteredStorage) { 34 | 35 | public static Function filterAttractors(boolean allowAttractors) { 36 | return cfs -> { 37 | boolean hasAttractor = cfs.attachment() != null && cfs.attachment().getType() == IoAttachmentType.ATTRACTOR; 38 | 39 | return hasAttractor == allowAttractors ? cfs.storage() : null; 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/TickHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network; 20 | 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | public class TickHelper { 25 | // Start counter way above 0 so that newly placed pipes (with a last tick of 0) always do work on their first tick. 26 | private static long tickCounter = 1000; 27 | private static List delayedActions = new ArrayList<>(); 28 | private static List delayedActions2 = new ArrayList<>(); 29 | 30 | public static long getTickCounter() { 31 | return tickCounter; 32 | } 33 | 34 | public static synchronized void onEndTick() { 35 | tickCounter++; 36 | 37 | List actionsToProcess = delayedActions; 38 | delayedActions = delayedActions2; 39 | delayedActions2 = actionsToProcess; 40 | 41 | for (Runnable runnable : actionsToProcess) { 42 | runnable.run(); 43 | } 44 | 45 | actionsToProcess.clear(); 46 | } 47 | 48 | // TODO: thread safety checks 49 | public static synchronized void runLater(Runnable runnable) { 50 | delayedActions.add(runnable); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/packets/SetItemVariant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.packets; 20 | 21 | import dev.technici4n.moderndynamics.util.ItemVariant; 22 | import dev.technici4n.moderndynamics.util.MdId; 23 | import net.minecraft.network.RegistryFriendlyByteBuf; 24 | import net.minecraft.network.codec.ByteBufCodecs; 25 | import net.minecraft.network.codec.StreamCodec; 26 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 27 | 28 | public record SetItemVariant(int syncId, int configIdx, ItemVariant variant) implements CustomPacketPayload { 29 | 30 | public static final StreamCodec STREAM_CODEC = StreamCodec.composite( 31 | ByteBufCodecs.VAR_INT, 32 | SetItemVariant::syncId, 33 | ByteBufCodecs.VAR_INT, 34 | SetItemVariant::configIdx, 35 | ItemVariant.STREAM_CODEC, 36 | SetItemVariant::variant, 37 | SetItemVariant::new); 38 | public static final Type TYPE = new Type<>(MdId.of("set_item_variant")); 39 | 40 | @Override 41 | public Type type() { 42 | return TYPE; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/compat/rei/UpgradeDisplay.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client.compat.rei; 20 | 21 | import dev.technici4n.moderndynamics.attachment.upgrade.UpgradeType; 22 | import java.util.List; 23 | import me.shedaniel.rei.api.common.category.CategoryIdentifier; 24 | import me.shedaniel.rei.api.common.display.Display; 25 | import me.shedaniel.rei.api.common.entry.EntryIngredient; 26 | import me.shedaniel.rei.api.common.util.EntryIngredients; 27 | import net.minecraft.world.item.Item; 28 | 29 | public class UpgradeDisplay implements Display { 30 | final Item item; 31 | final UpgradeType upgradeInfo; 32 | 33 | public UpgradeDisplay(Item item, UpgradeType upgradeInfo) { 34 | this.item = item; 35 | this.upgradeInfo = upgradeInfo; 36 | } 37 | 38 | @Override 39 | public List getInputEntries() { 40 | return List.of(EntryIngredients.of(item)); 41 | } 42 | 43 | @Override 44 | public List getOutputEntries() { 45 | return List.of(); 46 | } 47 | 48 | @Override 49 | public CategoryIdentifier getCategoryIdentifier() { 50 | return UpgradeCategory.ID; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/packets/SetFluidVariant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.packets; 20 | 21 | import dev.technici4n.moderndynamics.util.FluidVariant; 22 | import dev.technici4n.moderndynamics.util.MdId; 23 | import net.minecraft.network.RegistryFriendlyByteBuf; 24 | import net.minecraft.network.codec.ByteBufCodecs; 25 | import net.minecraft.network.codec.StreamCodec; 26 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 27 | 28 | public record SetFluidVariant(int syncId, int configIdx, FluidVariant variant) implements CustomPacketPayload { 29 | 30 | public static final StreamCodec STREAM_CODEC = StreamCodec.composite( 31 | ByteBufCodecs.VAR_INT, 32 | SetFluidVariant::syncId, 33 | ByteBufCodecs.VAR_INT, 34 | SetFluidVariant::configIdx, 35 | FluidVariant.STREAM_CODEC, 36 | SetFluidVariant::variant, 37 | SetFluidVariant::new); 38 | public static final Type TYPE = new Type<>(MdId.of("set_fluid_variant")); 39 | 40 | @Override 41 | public Type type() { 42 | return TYPE; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/item/SimulatedInsertionTargets.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.item; 20 | 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | import net.minecraft.core.BlockPos; 24 | import net.minecraft.core.Direction; 25 | import net.minecraft.server.level.ServerLevel; 26 | import net.minecraft.world.level.Level; 27 | import net.neoforged.neoforge.capabilities.BlockCapabilityCache; 28 | import net.neoforged.neoforge.capabilities.Capabilities; 29 | 30 | public class SimulatedInsertionTargets { 31 | private static final Map TARGETS = new HashMap<>(); 32 | 33 | record Coord(ServerLevel world, BlockPos pos, Direction direction) { 34 | } 35 | 36 | public static SimulatedInsertionTarget getTarget(Level w, BlockPos pos, Direction side) { 37 | ServerLevel world = (ServerLevel) w; 38 | return TARGETS.computeIfAbsent(new Coord(world, pos, side), coord -> { 39 | var cache = BlockCapabilityCache.create(Capabilities.ItemHandler.BLOCK, world, pos, side); 40 | return new SimulatedInsertionTarget(coord, cache::getCapability); 41 | }); 42 | } 43 | 44 | public static void clear() { 45 | TARGETS.clear(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/RenderedAttachment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment; 20 | 21 | import java.util.ArrayList; 22 | import java.util.HashMap; 23 | import java.util.List; 24 | import java.util.Map; 25 | import java.util.Objects; 26 | 27 | public class RenderedAttachment { 28 | private static final Map REGISTERED_ATTACHMENTS = new HashMap<>(); 29 | 30 | public static List getAttachmentIds() { 31 | return new ArrayList<>(REGISTERED_ATTACHMENTS.keySet()); 32 | } 33 | 34 | public static List getAllAttachments() { 35 | return new ArrayList<>(REGISTERED_ATTACHMENTS.values()); 36 | } 37 | 38 | public final String id; 39 | 40 | public RenderedAttachment(String id) { 41 | this.id = id; 42 | 43 | if (REGISTERED_ATTACHMENTS.put(id, this) != null) { 44 | throw new IllegalStateException("Duplicate attachment registration with id " + id); 45 | } 46 | } 47 | 48 | public RenderedAttachment getStuffed() { 49 | var stuffed = REGISTERED_ATTACHMENTS.get(id + "_stuffed"); 50 | Objects.requireNonNull(stuffed, "Could not find stuffed variant for attachment " + id); 51 | return stuffed; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/model/PipeModelLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client.model; 20 | 21 | import com.google.gson.JsonDeserializationContext; 22 | import com.google.gson.JsonObject; 23 | import com.google.gson.JsonParseException; 24 | import dev.technici4n.moderndynamics.util.MdId; 25 | import java.util.Map; 26 | import net.minecraft.resources.ResourceLocation; 27 | import net.minecraft.util.GsonHelper; 28 | import net.neoforged.neoforge.client.model.geometry.IGeometryLoader; 29 | 30 | public class PipeModelLoader implements IGeometryLoader { 31 | public static final ResourceLocation ID = MdId.of("pipe"); 32 | private final Map attachmentModels; 33 | 34 | public PipeModelLoader(Map attachmentModels) { 35 | this.attachmentModels = attachmentModels; 36 | } 37 | 38 | @Override 39 | public PipeUnbakedModel read(JsonObject jsonObject, JsonDeserializationContext deserializationContext) throws JsonParseException { 40 | var pipeType = GsonHelper.getAsString(jsonObject, "pipeType"); 41 | var transparent = GsonHelper.getAsBoolean(jsonObject, "transparent"); 42 | return new PipeUnbakedModel(pipeType, transparent, attachmentModels); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/FluidRenderUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import net.minecraft.client.Minecraft; 22 | import net.minecraft.client.renderer.texture.TextureAtlasSprite; 23 | import net.minecraft.world.inventory.InventoryMenu; 24 | import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; 25 | 26 | public final class FluidRenderUtil { 27 | private FluidRenderUtil() { 28 | } 29 | 30 | public static TextureAtlasSprite getStillSprite(FluidVariant variant) { 31 | if (variant.isBlank()) { 32 | return null; 33 | } 34 | 35 | var renderProps = IClientFluidTypeExtensions.of(variant.getFluid()); 36 | var stack = variant.toStack(1); 37 | var texture = renderProps.getStillTexture(stack); 38 | if (texture == null) { 39 | return null; 40 | } 41 | 42 | var atlas = Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS); 43 | return atlas.apply(texture); 44 | } 45 | 46 | public static int getTint(FluidVariant variant) { 47 | var renderProps = IClientFluidTypeExtensions.of(variant.getFluid()); 48 | var stack = variant.toStack(1); 49 | return renderProps.getTintColor(stack); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/model/PipeModelData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.model; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.AttachedAttachment; 22 | import net.neoforged.neoforge.client.model.data.ModelProperty; 23 | import org.jetbrains.annotations.Nullable; 24 | 25 | public record PipeModelData(byte pipeConnections, byte inventoryConnections, 26 | @Nullable AttachmentModelData[] attachments) { 27 | 28 | public static ModelProperty PIPE_DATA = new ModelProperty<>(); 29 | 30 | public static final PipeModelData DEFAULT = new PipeModelData((byte) 0, (byte) 0, new AttachmentModelData[6]); 31 | 32 | public PipeModelData(byte pipeConnections, byte inventoryConnections, AttachedAttachment[] attachments) { 33 | this(pipeConnections, inventoryConnections, getAttachmentModelData(attachments)); 34 | } 35 | 36 | private static AttachmentModelData[] getAttachmentModelData(AttachedAttachment[] attachments) { 37 | var result = new AttachmentModelData[attachments.length]; 38 | for (int i = 0; i < result.length; i++) { 39 | if (attachments[i] != null) { 40 | result[i] = attachments[i].getModelData(); 41 | } 42 | } 43 | return result; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/data/PipeModelLoaderBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.data; 20 | 21 | import com.google.gson.JsonObject; 22 | import dev.technici4n.moderndynamics.client.model.PipeModelLoader; 23 | import net.neoforged.neoforge.client.model.generators.CustomLoaderBuilder; 24 | import net.neoforged.neoforge.client.model.generators.ModelBuilder; 25 | import net.neoforged.neoforge.common.data.ExistingFileHelper; 26 | 27 | public class PipeModelLoaderBuilder> extends CustomLoaderBuilder { 28 | private String pipeType; 29 | private boolean transparent; 30 | 31 | public PipeModelLoaderBuilder(T parent, ExistingFileHelper existingFileHelper) { 32 | super(PipeModelLoader.ID, parent, existingFileHelper, false); 33 | } 34 | 35 | public PipeModelLoaderBuilder pipeType(String pipeType) { 36 | this.pipeType = pipeType; 37 | return this; 38 | } 39 | 40 | public PipeModelLoaderBuilder transparent(boolean transparent) { 41 | this.transparent = transparent; 42 | return this; 43 | } 44 | 45 | @Override 46 | public JsonObject toJson(JsonObject json) { 47 | json = super.toJson(json); 48 | json.addProperty("pipeType", pipeType); 49 | json.addProperty("transparent", transparent); 50 | return json; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/model/AttachmentModelData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.model; 20 | 21 | import dev.technici4n.moderndynamics.attachment.RenderedAttachment; 22 | import net.minecraft.core.registries.BuiltInRegistries; 23 | import net.minecraft.nbt.CompoundTag; 24 | import net.minecraft.resources.ResourceLocation; 25 | import net.minecraft.world.item.Item; 26 | import org.jetbrains.annotations.Nullable; 27 | 28 | /** 29 | * Item is also available to make "block picking" work on the client. 30 | */ 31 | public record AttachmentModelData(String modelId, Item item) { 32 | public CompoundTag write(CompoundTag tag) { 33 | tag.putString("model", modelId); 34 | tag.putString("item", BuiltInRegistries.ITEM.getKey(item).toString()); 35 | return tag; 36 | } 37 | 38 | @Nullable 39 | public static AttachmentModelData from(CompoundTag tag) { 40 | var modelId = tag.getString("model"); 41 | var item = BuiltInRegistries.ITEM.get(ResourceLocation.parse(tag.getString("item"))); 42 | if (!modelId.isEmpty()) { 43 | return new AttachmentModelData(modelId, item); 44 | } 45 | return null; 46 | } 47 | 48 | public static AttachmentModelData from(RenderedAttachment rendered, Item item) { 49 | return new AttachmentModelData(rendered.id, item); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/packets/SetAttachmentUpgrades.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.packets; 20 | 21 | import dev.technici4n.moderndynamics.MdProxy; 22 | import dev.technici4n.moderndynamics.attachment.upgrade.LoadedUpgrades; 23 | import dev.technici4n.moderndynamics.util.MdId; 24 | import net.minecraft.network.FriendlyByteBuf; 25 | import net.minecraft.network.codec.StreamCodec; 26 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 27 | import net.neoforged.neoforge.network.handling.IPayloadHandler; 28 | 29 | public record SetAttachmentUpgrades(LoadedUpgrades holder) implements CustomPacketPayload { 30 | public static final StreamCodec STREAM_CODEC = StreamCodec.composite( 31 | LoadedUpgrades.STREAM_CODEC, 32 | SetAttachmentUpgrades::holder, 33 | SetAttachmentUpgrades::new); 34 | public static final Type TYPE = new Type<>(MdId.of("set_attachment_upgrades")); 35 | 36 | @Override 37 | public Type type() { 38 | return TYPE; 39 | } 40 | 41 | public static final IPayloadHandler HANDLER = (payload, context) -> { 42 | if (!MdProxy.INSTANCE.isMemoryConnection()) { 43 | LoadedUpgrades.trySet(payload.holder); 44 | } 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/DropHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import java.util.List; 22 | import java.util.function.Consumer; 23 | import net.minecraft.world.Containers; 24 | import net.minecraft.world.item.ItemStack; 25 | import net.minecraft.world.level.block.entity.BlockEntity; 26 | 27 | public class DropHelper { 28 | public static void dropStacks(BlockEntity blockEntity, List stacks) { 29 | for (ItemStack stack : stacks) { 30 | dropStack(blockEntity, stack); 31 | } 32 | } 33 | 34 | public static void dropStack(BlockEntity blockEntity, ItemStack stack) { 35 | var pos = blockEntity.getBlockPos(); 36 | Containers.dropItemStack(blockEntity.getLevel(), pos.getX(), pos.getY(), pos.getZ(), stack); 37 | } 38 | 39 | public static void dropStack(BlockEntity blockEntity, ItemVariant variant, long amount) { 40 | splitIntoStacks(variant, amount, stack -> dropStack(blockEntity, stack)); 41 | } 42 | 43 | public static void splitIntoStacks(ItemVariant variant, long amount, Consumer stackConsumer) { 44 | while (amount > 0) { 45 | int dropped = (int) Math.min(amount, variant.getMaxStackSize()); 46 | stackConsumer.accept(variant.toStack(dropped)); 47 | amount -= dropped; 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/screen/PlusMinusButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client.screen; 20 | 21 | import com.mojang.blaze3d.systems.RenderSystem; 22 | import net.minecraft.client.gui.GuiGraphics; 23 | import net.minecraft.client.gui.components.Button; 24 | import net.minecraft.client.renderer.GameRenderer; 25 | import net.minecraft.network.chat.Component; 26 | 27 | public class PlusMinusButton extends Button { 28 | private final boolean minus; 29 | 30 | public PlusMinusButton(int x, int y, boolean minus, Runnable click) { 31 | super(x, y, 14, 14, Component.empty(), btn -> click.run(), DEFAULT_NARRATION); 32 | this.minus = minus; 33 | } 34 | 35 | @Override 36 | public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { 37 | RenderSystem.setShader(GameRenderer::getPositionTexShader); 38 | RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, this.alpha); 39 | var x = 216 + (minus ? 0 : width); 40 | var y = 120; 41 | if (!isActive()) { 42 | y += 2 * height; 43 | } else if (isHovered) { 44 | y += height; 45 | } 46 | RenderSystem.enableBlend(); 47 | RenderSystem.defaultBlendFunc(); 48 | RenderSystem.enableDepthTest(); 49 | guiGraphics.blit(ItemAttachedIoScreen.TEXTURE, this.getX(), this.getY(), x, y, width, height); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/data/DataGenerators.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.data; 20 | 21 | import dev.technici4n.moderndynamics.util.MdId; 22 | import net.neoforged.bus.api.SubscribeEvent; 23 | import net.neoforged.fml.common.EventBusSubscriber; 24 | import net.neoforged.neoforge.data.event.GatherDataEvent; 25 | 26 | @EventBusSubscriber(modid = MdId.MOD_ID, bus = EventBusSubscriber.Bus.MOD) 27 | public class DataGenerators { 28 | @SubscribeEvent 29 | public static void onGatherData(GatherDataEvent event) { 30 | var existingFileHelper = event.getExistingFileHelper(); 31 | var registries = event.getLookupProvider(); 32 | var pack = event.getGenerator().getVanillaPack(true); 33 | 34 | pack.addProvider(packOutput -> new ModelsProvider(packOutput, existingFileHelper)); 35 | pack.addProvider(PipeModelsProvider::new); 36 | pack.addProvider(packOutput -> new SpriteSourceProvider(packOutput, registries, existingFileHelper)); 37 | 38 | pack.addProvider(AttachmentUpgradesProvider::new); 39 | pack.addProvider(packOutput -> new ItemTagsProvider(packOutput, registries, existingFileHelper)); 40 | pack.addProvider(packOutput -> LootTablesProvider.create(packOutput, registries)); 41 | pack.addProvider(packOutput -> new RecipesProvider(packOutput, registries)); 42 | 43 | pack.addProvider(EmptyTestStructureGenerator::new); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/client/model/MdModels.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.client.model; 20 | 21 | import com.mojang.math.Axis; 22 | import com.mojang.math.Transformation; 23 | import net.minecraft.client.resources.model.BlockModelRotation; 24 | import net.minecraft.client.resources.model.ModelState; 25 | import net.minecraft.core.Direction; 26 | 27 | public class MdModels { 28 | /** 29 | * The model rotation to rotate a model facing NORTH to the correct facing direction. 30 | * Rotations are indexed by {@link Direction} id. 31 | */ 32 | public static final ModelState[] PIPE_BAKE_SETTINGS = new ModelState[] { 33 | preRotated(BlockModelRotation.X90_Y0, 270), 34 | BlockModelRotation.X270_Y0, 35 | BlockModelRotation.X0_Y0, 36 | preRotated(BlockModelRotation.X0_Y180, 90), 37 | preRotated(BlockModelRotation.X0_Y270, 90), 38 | BlockModelRotation.X0_Y90, 39 | }; 40 | 41 | public static ModelState preRotated(BlockModelRotation rotation, float preAngle) { 42 | Transformation preRotation = new Transformation(null, Axis.ZP.rotationDegrees(preAngle), null, null); 43 | Transformation combined = rotation.getRotation().compose(preRotation); 44 | return new ModelState() { 45 | @Override 46 | public Transformation getRotation() { 47 | return combined; 48 | } 49 | }; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/util/MdItemGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.util; 20 | 21 | import dev.technici4n.moderndynamics.init.MdItems; 22 | import net.minecraft.core.Registry; 23 | import net.minecraft.core.registries.BuiltInRegistries; 24 | import net.minecraft.core.registries.Registries; 25 | import net.minecraft.network.chat.Component; 26 | import net.minecraft.resources.ResourceKey; 27 | import net.minecraft.world.item.CreativeModeTab; 28 | import net.minecraft.world.item.ItemStack; 29 | 30 | public final class MdItemGroup { 31 | public static final ResourceKey KEY = ResourceKey.create(Registries.CREATIVE_MODE_TAB, MdId.of(MdId.MOD_ID)); 32 | 33 | public static void init() { 34 | var tab = CreativeModeTab.builder() 35 | .title(Component.translatable("itemGroup.moderndynamics.moderndynamics")) 36 | .icon(() -> new ItemStack(MdItems.ITEM_PIPE)) 37 | .displayItems((params, output) -> { 38 | for (var item : BuiltInRegistries.ITEM) { // Don't use entrySet(), it doesn't respect the registration order 39 | var key = BuiltInRegistries.ITEM.getKey(item); 40 | if (MdId.MOD_ID.equals(key.getNamespace()) && item != MdItems.DEBUG_TOOL) { 41 | output.accept(item.getDefaultInstance()); 42 | } 43 | } 44 | }) 45 | .build(); 46 | Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, KEY, tab); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/item/sync/ClientTravelingItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network.item.sync; 20 | 21 | import dev.technici4n.moderndynamics.util.ItemVariant; 22 | import net.minecraft.core.Direction; 23 | 24 | public final class ClientTravelingItem { 25 | public final int id; 26 | private final ItemVariant variant; 27 | private final int amount; 28 | public final double totalPathDistance; 29 | public double traveledDistance; 30 | public Direction in; 31 | public Direction out; 32 | final double speed; 33 | public long lastTick; 34 | 35 | public ClientTravelingItem(int id, ItemVariant variant, int amount, double totalPathDistance, double traveledDistance, Direction in, 36 | Direction out, double speed) { 37 | this.id = id; 38 | this.variant = variant; 39 | this.amount = amount; 40 | this.totalPathDistance = totalPathDistance; 41 | this.traveledDistance = traveledDistance; 42 | this.in = in; 43 | this.out = out; 44 | this.speed = speed; 45 | } 46 | 47 | public ItemVariant variant() { 48 | return variant; 49 | } 50 | 51 | public int amount() { 52 | return amount; 53 | } 54 | 55 | public double traveledDistance() { 56 | return traveledDistance; 57 | } 58 | 59 | public Direction in() { 60 | return in; 61 | } 62 | 63 | public Direction out() { 64 | return out; 65 | } 66 | 67 | public double speed() { 68 | return speed; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/attachment/Setting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.attachment; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.ItemAttachedIo; 22 | import java.util.Locale; 23 | import net.minecraft.network.chat.Component; 24 | 25 | public enum Setting { 26 | /** 27 | * @see ItemAttachedIo#setFilterInversion 28 | */ 29 | FILTER_INVERSION, 30 | /** 31 | * @see ItemAttachedIo#setFilterDamage 32 | */ 33 | FILTER_DAMAGE, 34 | /** 35 | * @see ItemAttachedIo#setFilterNbt 36 | */ 37 | FILTER_NBT, 38 | /** 39 | * @see ItemAttachedIo#setFilterSimilar 40 | */ 41 | FILTER_SIMILAR, 42 | /** 43 | * @see ItemAttachedIo#setFilterMod 44 | */ 45 | FILTER_MOD, 46 | /** 47 | * @see ItemAttachedIo#setRoutingMode 48 | */ 49 | ROUTING_MODE, 50 | /** 51 | * @see ItemAttachedIo#setOversendingMode 52 | */ 53 | OVERSENDING_MODE, 54 | /** 55 | * @see ItemAttachedIo#setMaxItemsInInventory 56 | */ 57 | MAX_ITEMS_IN_INVENTORY, 58 | /** 59 | * @see ItemAttachedIo#setMaxItemsExtracted 60 | */ 61 | MAX_ITEMS_EXTRACTED; 62 | 63 | private final Component tooltipName; 64 | 65 | public Component getTooltipName() { 66 | return tooltipName; 67 | } 68 | 69 | public boolean isFilter() { 70 | return name().startsWith("FILTER_"); 71 | } 72 | 73 | Setting() { 74 | this.tooltipName = Component.translatable("gui.moderndynamics.tooltip." 75 | + name().toLowerCase(Locale.ROOT)); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/gui/menu/UpgradeSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.gui.menu; 20 | 21 | import dev.technici4n.moderndynamics.attachment.attached.AttachedIo; 22 | import dev.technici4n.moderndynamics.attachment.upgrade.LoadedUpgrades; 23 | import net.minecraft.world.SimpleContainer; 24 | import net.minecraft.world.inventory.Slot; 25 | import net.minecraft.world.item.ItemStack; 26 | 27 | public class UpgradeSlot extends Slot { 28 | private final AttachedIo io; 29 | private final int slot; 30 | 31 | public UpgradeSlot(AttachedIo io, int slot, int x, int y) { 32 | super(new SimpleContainer(), -1, x, y); 33 | 34 | this.io = io; 35 | this.slot = slot; 36 | } 37 | 38 | @Override 39 | public ItemStack getItem() { 40 | return io.getUpgrade(slot); 41 | } 42 | 43 | @Override 44 | public void set(ItemStack stack) { 45 | io.setUpgrade(slot, stack); 46 | setChanged(); 47 | } 48 | 49 | @Override 50 | public ItemStack remove(int amount) { 51 | return io.removeUpgrade(slot, amount); 52 | } 53 | 54 | @Override 55 | public void setChanged() { 56 | io.onUpgradesChanged(); 57 | } 58 | 59 | @Override 60 | public boolean mayPlace(ItemStack stack) { 61 | return io.mayPlaceUpgrade(slot, stack.getItem()); 62 | } 63 | 64 | @Override 65 | public int getMaxStackSize() { 66 | return getMaxStackSize(getItem()); 67 | } 68 | 69 | @Override 70 | public int getMaxStackSize(ItemStack stack) { 71 | return LoadedUpgrades.getType(stack.getItem()).getSlotLimit(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/network/HostAdjacentCaps.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.network; 20 | 21 | import java.util.Objects; 22 | import net.minecraft.core.Direction; 23 | import net.minecraft.server.level.ServerLevel; 24 | import net.neoforged.neoforge.capabilities.BlockCapability; 25 | import net.neoforged.neoforge.capabilities.BlockCapabilityCache; 26 | import org.jetbrains.annotations.Nullable; 27 | 28 | /** 29 | * Helper class to track capability caches for all 6 adjacent sides of a host, 30 | * and automatically schedule a host update on capability invalidation. 31 | */ 32 | public final class HostAdjacentCaps { 33 | private final NodeHost host; 34 | private final BlockCapability cap; 35 | @SuppressWarnings("unchecked") 36 | private final BlockCapabilityCache[] capCaches = new BlockCapabilityCache[6]; 37 | 38 | public HostAdjacentCaps(NodeHost host, BlockCapability cap) { 39 | this.host = host; 40 | this.cap = cap; 41 | } 42 | 43 | @Nullable 44 | public C getCapability(Direction dir) { 45 | int side = dir.get3DDataValue(); 46 | if (capCaches[side] == null) { 47 | capCaches[side] = BlockCapabilityCache.create( 48 | cap, 49 | (ServerLevel) Objects.requireNonNull(host.pipe.getLevel()), 50 | host.pipe.getBlockPos().relative(dir), 51 | dir.getOpposite(), 52 | () -> !host.pipe.isRemoved(), 53 | host::scheduleUpdate); 54 | } 55 | return capCaches[side].getCapability(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/dev/technici4n/moderndynamics/thirdparty/fabric/Renderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Modern Dynamics 3 | * Copyright (C) 2021 shartte & Technici4n 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program; if not, write to the Free Software Foundation, 17 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | package dev.technici4n.moderndynamics.thirdparty.fabric; 20 | /* 21 | * Copyright (c) 2016, 2017, 2018, 2019 FabricMC 22 | * 23 | * Licensed under the Apache License, Version 2.0 (the "License"); 24 | * you may not use this file except in compliance with the License. 25 | * You may obtain a copy of the License at 26 | * 27 | * http://www.apache.org/licenses/LICENSE-2.0 28 | * 29 | * Unless required by applicable law or agreed to in writing, software 30 | * distributed under the License is distributed on an "AS IS" BASIS, 31 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 32 | * See the License for the specific language governing permissions and 33 | * limitations under the License. 34 | */ 35 | 36 | /** 37 | * Interface for rendering plug-ins that provide enhanced capabilities for model lighting, buffering and rendering. Such 38 | * plug-ins implement the enhanced model rendering interfaces specified by the Fabric API. 39 | */ 40 | public interface Renderer { 41 | /** 42 | * Obtain a new {@link MeshBuilder} instance used to create baked models with enhanced features. 43 | * 44 | *

45 | * Renderer does not retain a reference to returned instances and they should be re-used for multiple models when 46 | * possible to avoid memory allocation overhead. 47 | */ 48 | MeshBuilder meshBuilder(); 49 | 50 | static Renderer getInstance() { 51 | return new Renderer() { 52 | @Override 53 | public MeshBuilder meshBuilder() { 54 | return new MeshBuilderImpl(); 55 | } 56 | }; 57 | } 58 | } 59 | --------------------------------------------------------------------------------