├── .github ├── banner.png └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src └── main │ ├── resources │ ├── assets │ │ └── teckle │ │ │ ├── models │ │ │ ├── item │ │ │ │ ├── tube.item.json │ │ │ │ ├── filter.json │ │ │ │ ├── transposer.json │ │ │ │ ├── retriever.json │ │ │ │ ├── sortingmachine.json │ │ │ │ ├── breaker.json │ │ │ │ ├── placer.json │ │ │ │ └── beamquarry.json │ │ │ └── block │ │ │ │ ├── empty.json │ │ │ │ ├── alloyfurnace.json │ │ │ │ ├── fabricator.json │ │ │ │ ├── filter.json │ │ │ │ ├── tube.item_leg_inside.json │ │ │ │ ├── machineoverlay.json │ │ │ │ ├── tube.item_leg.json │ │ │ │ ├── tube.item_leg_node.json │ │ │ │ ├── tube.item_leg_node_inside.json │ │ │ │ └── tube.item_node.json │ │ │ ├── Logo.png │ │ │ ├── textures │ │ │ ├── gui │ │ │ │ ├── filter.png │ │ │ │ ├── filter.psd │ │ │ │ ├── table.png │ │ │ │ ├── retriever.png │ │ │ │ ├── alloyfurnace.png │ │ │ │ ├── beamquarry.png │ │ │ │ ├── fabricator.png │ │ │ │ └── sortingmachine.png │ │ │ ├── items │ │ │ │ ├── blade.png │ │ │ │ ├── blueprint.png │ │ │ │ ├── elytralogo.png │ │ │ │ ├── nikolite.png │ │ │ │ ├── paintbrush.psd │ │ │ │ ├── ingot_brass.png │ │ │ │ ├── siliconboule.png │ │ │ │ ├── ingot_bluealloy.png │ │ │ │ ├── ingot_redalloy.png │ │ │ │ ├── paintbrush_blue.png │ │ │ │ ├── paintbrush_cyan.png │ │ │ │ ├── paintbrush_gray.png │ │ │ │ ├── paintbrush_lime.png │ │ │ │ ├── paintbrush_pink.png │ │ │ │ ├── paintbrush_red.png │ │ │ │ ├── paintbrush_black.png │ │ │ │ ├── paintbrush_brown.png │ │ │ │ ├── paintbrush_green.png │ │ │ │ ├── paintbrush_orange.png │ │ │ │ ├── paintbrush_purple.png │ │ │ │ ├── paintbrush_silver.png │ │ │ │ ├── paintbrush_white.png │ │ │ │ ├── paintbrush_yellow.png │ │ │ │ ├── siliconwafer_blue.png │ │ │ │ ├── siliconwafer_red.png │ │ │ │ ├── paintbrush_magenta.png │ │ │ │ ├── siliconwafer_plain.png │ │ │ │ ├── paintbrush_light_blue.png │ │ │ │ └── siliconwafer_missingno.png │ │ │ └── blocks │ │ │ │ ├── filterin.png │ │ │ │ ├── filterout.png │ │ │ │ ├── breakerout.png │ │ │ │ ├── breakerside.png │ │ │ │ ├── retrieverin.png │ │ │ │ ├── alloyfurnace.png │ │ │ │ ├── beamquarry_top.png │ │ │ │ ├── breakerfront.png │ │ │ │ ├── breakerside_on.png │ │ │ │ ├── deployer_back.png │ │ │ │ ├── deployer_front.png │ │ │ │ ├── deployer_side.png │ │ │ │ ├── fabricator_top.png │ │ │ │ ├── filtersideoff.png │ │ │ │ ├── filtersideon.png │ │ │ │ ├── itemtube.full.png │ │ │ │ ├── itemtube.node.png │ │ │ │ ├── nikolite_ore.png │ │ │ │ ├── redalloy_block.png │ │ │ │ ├── retrieverout.png │ │ │ │ ├── retrieverside.png │ │ │ │ ├── alloyfurnace_lit.png │ │ │ │ ├── alloyfurnace_top.png │ │ │ │ ├── beamquarry_front.png │ │ │ │ ├── beamquarry_side.png │ │ │ │ ├── bluealloy_block.png │ │ │ │ ├── breakerfront_on.png │ │ │ │ ├── fabricator_side.png │ │ │ │ ├── retrieverside_on.png │ │ │ │ ├── sortingmachinein.png │ │ │ │ ├── transposersideon.png │ │ │ │ ├── alloyfurnace_bottom.png │ │ │ │ ├── alloyfurnace_side.png │ │ │ │ ├── beamquarry_bottom.png │ │ │ │ ├── fabricator_bottom.png │ │ │ │ ├── project_table_side.png │ │ │ │ ├── project_table_top.png │ │ │ │ ├── sortingmachineout.png │ │ │ │ ├── sortingmachineside.png │ │ │ │ ├── transposersideoff.png │ │ │ │ ├── deployer_front_active.png │ │ │ │ ├── itemtube.full.colour.png │ │ │ │ ├── itemtube.node.colour.png │ │ │ │ ├── project_table_bottom.png │ │ │ │ ├── retrieverside_blocked.png │ │ │ │ ├── sortingmachineside_on.png │ │ │ │ ├── beamquarry_top_inactive.png │ │ │ │ ├── beamquarry_front_inactive.png │ │ │ │ └── sortingmachineside_blocked.png │ │ │ ├── recipes │ │ │ ├── blueprint.json │ │ │ ├── alloyfurnace.json │ │ │ ├── blade.json │ │ │ ├── item_tube.json │ │ │ ├── filter.json │ │ │ ├── breaker.json │ │ │ ├── transposer.json │ │ │ ├── fabricator.json │ │ │ └── sorting_machine.json │ │ │ └── blockstates │ │ │ ├── alloyfurnace.json │ │ │ ├── compacted_metal.json │ │ │ ├── retriever.json │ │ │ ├── sortingmachine.json │ │ │ ├── beamquarry.json │ │ │ ├── filter.json │ │ │ ├── transposer.json │ │ │ ├── placer.json │ │ │ └── breaker.json │ └── mcmod.info │ └── java │ └── com │ └── elytradev │ └── teckle │ ├── common │ ├── tile │ │ ├── TilePlacer.java │ │ ├── base │ │ │ ├── IElementProvider.java │ │ │ └── TeckleEnergyStorage.java │ │ ├── retriever │ │ │ └── RetrieverEndpoint.java │ │ ├── inv │ │ │ ├── SlotData.java │ │ │ └── ItemStream.java │ │ ├── sortingmachine │ │ │ ├── SortingMachineEndpoint.java │ │ │ ├── modes │ │ │ │ ├── pullmode │ │ │ │ │ ├── PullModeAuto.java │ │ │ │ │ ├── PullModeSingleStep.java │ │ │ │ │ └── PullMode.java │ │ │ │ └── sortmode │ │ │ │ │ └── SortModeType.java │ │ │ └── NetworkTileSortingMachineInput.java │ │ └── TileLitNetworkMember.java │ ├── exception │ │ └── MissingOreException.java │ ├── network │ │ ├── messages │ │ │ ├── TeckleMessage.java │ │ │ ├── clientbound │ │ │ │ ├── TileUpdateMessage.java │ │ │ │ ├── DebugReceiverMessage.java │ │ │ │ ├── RetrieverSelectorMessage.java │ │ │ │ ├── JamStatusMessage.java │ │ │ │ ├── TileLitMessage.java │ │ │ │ ├── SortingMachineSelectorMessage.java │ │ │ │ ├── AlloyFurnaceMessage.java │ │ │ │ └── TravellerMoveMessage.java │ │ │ └── serverbound │ │ │ │ ├── RetrieverSelectorModeChangeMessage.java │ │ │ │ ├── RetrieverMatchCountMessage.java │ │ │ │ ├── RetrieverColourChangeMessage.java │ │ │ │ ├── SortingMachineDefaultRouteChangeMessage.java │ │ │ │ ├── ToggleQuarryMessage.java │ │ │ │ ├── ChangeQuarryBoundsMessage.java │ │ │ │ ├── FilterColourChangeMessage.java │ │ │ │ ├── SortingMachineColourChangeMessage.java │ │ │ │ ├── FabricatorTemplateMessage.java │ │ │ │ ├── SortingMachinePullModeChangeMessage.java │ │ │ │ └── SortingMachineSortModeChangeMessage.java │ │ ├── BlockPosListMarshaller.java │ │ └── TeckleNetworking.java │ ├── worldnetwork │ │ ├── CommandWorldNetworkStats.java │ │ └── common │ │ │ ├── IDropAction.java │ │ │ ├── DummyWorldNetworkEndpoint.java │ │ │ ├── pathing │ │ │ ├── PathNode.java │ │ │ └── EndpointData.java │ │ │ ├── node │ │ │ ├── WorldNetworkEndpoint.java │ │ │ └── NodeContainer.java │ │ │ └── DropActions.java │ ├── item │ │ ├── ItemBlade.java │ │ ├── ItemCompacted.java │ │ └── ItemBlueprint.java │ ├── helper │ │ ├── CapabilityHelper.java │ │ └── ColourHelper.java │ ├── block │ │ ├── property │ │ │ ├── UnlistedBool.java │ │ │ └── UnlistedEnum.java │ │ ├── BlockNikoliteOre.java │ │ └── BlockCompacted.java │ ├── IBlockUpdateListener.java │ ├── handlers │ │ └── TeckleGuiHandler.java │ ├── TeckleConfiguration.java │ ├── proxy │ │ └── CommonProxy.java │ └── worldgen │ │ └── NikoliteOreGenerator.java │ ├── client │ ├── gui │ │ ├── TeckleGUIFactory.java │ │ ├── base │ │ │ └── GuiTeckleButton.java │ │ └── GuiAlloyFurnace.java │ ├── render │ │ ├── model │ │ │ └── TubeModelLoader.java │ │ └── tile │ │ │ ├── TileRetrieverRender.java │ │ │ ├── TileSortingMachineRender.java │ │ │ └── TileNetworkMemberRenderer.java │ ├── worldnetwork │ │ └── DummyNetworkTraveller.java │ └── MissingOreExceptionClient.java │ ├── compat │ ├── jei │ │ ├── FabricatorBlueprintError.java │ │ ├── AlloyRecipeWrapper.java │ │ ├── TeckleJEIPlugin.java │ │ └── FabricatorRecipeTransferHandler.java │ └── mcmp │ │ └── TeckleMCMPAddon.java │ └── api │ └── capabilities │ ├── IWorldNetworkAssistantHolder.java │ └── impl │ ├── WorldNetworkAssistantHolder.java │ └── NetworkTileTransporter.java ├── .gitignore ├── Jenkinsfile ├── README.md ├── gradle.properties ├── project.gradle └── gradlew.bat /.github/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/.github/banner.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/tube.item.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/tube.item_node" 3 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": { 3 | }, 4 | "elements": [ 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/Logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/filter.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/filter.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/filter.psd -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/table.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/blade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/blade.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/retriever.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/retriever.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/filterin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/filterin.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/filterout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/filterout.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/alloyfurnace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/alloyfurnace.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/beamquarry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/beamquarry.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/fabricator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/fabricator.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/blueprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/blueprint.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/elytralogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/elytralogo.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/nikolite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/nikolite.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush.psd -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/breakerout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/breakerout.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/breakerside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/breakerside.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/retrieverin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/retrieverin.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/gui/sortingmachine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/gui/sortingmachine.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/ingot_brass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/ingot_brass.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/siliconboule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/siliconboule.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/alloyfurnace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/alloyfurnace.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/beamquarry_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/beamquarry_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/breakerfront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/breakerfront.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/breakerside_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/breakerside_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/deployer_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/deployer_back.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/deployer_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/deployer_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/deployer_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/deployer_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/fabricator_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/fabricator_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/filtersideoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/filtersideoff.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/filtersideon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/filtersideon.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/itemtube.full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/itemtube.full.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/itemtube.node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/itemtube.node.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/nikolite_ore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/nikolite_ore.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/redalloy_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/redalloy_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/retrieverout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/retrieverout.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/retrieverside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/retrieverside.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/ingot_bluealloy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/ingot_bluealloy.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/ingot_redalloy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/ingot_redalloy.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_blue.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_cyan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_cyan.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_gray.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_lime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_lime.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_pink.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_red.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/alloyfurnace_lit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/alloyfurnace_lit.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/alloyfurnace_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/alloyfurnace_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/beamquarry_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/beamquarry_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/beamquarry_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/beamquarry_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/bluealloy_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/bluealloy_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/breakerfront_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/breakerfront_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/fabricator_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/fabricator_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/retrieverside_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/retrieverside_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/sortingmachinein.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/sortingmachinein.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/transposersideon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/transposersideon.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_black.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_brown.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_green.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_orange.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_purple.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_silver.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_white.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_yellow.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/siliconwafer_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/siliconwafer_blue.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/siliconwafer_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/siliconwafer_red.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/filter", 3 | "textures": { 4 | "side": "teckle:blocks/filterSideOff" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/alloyfurnace_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/alloyfurnace_bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/alloyfurnace_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/alloyfurnace_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/beamquarry_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/beamquarry_bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/fabricator_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/fabricator_bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/project_table_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/project_table_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/project_table_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/project_table_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/sortingmachineout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/sortingmachineout.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/sortingmachineside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/sortingmachineside.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/transposersideoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/transposersideoff.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_magenta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_magenta.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/siliconwafer_plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/siliconwafer_plain.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/deployer_front_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/deployer_front_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/itemtube.full.colour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/itemtube.full.colour.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/itemtube.node.colour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/itemtube.node.colour.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/project_table_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/project_table_bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/retrieverside_blocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/retrieverside_blocked.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/sortingmachineside_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/sortingmachineside_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/paintbrush_light_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/paintbrush_light_blue.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/items/siliconwafer_missingno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/items/siliconwafer_missingno.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/transposer.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/filter", 3 | "textures": { 4 | "side": "teckle:blocks/transposerSideOff" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/beamquarry_top_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/beamquarry_top_inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/beamquarry_front_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/beamquarry_front_inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/textures/blocks/sortingmachineside_blocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elytra/Teckle/HEAD/src/main/resources/assets/teckle/textures/blocks/sortingmachineside_blocked.png -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/TilePlacer.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile; 2 | 3 | import net.minecraft.tileentity.TileEntity; 4 | 5 | public class TilePlacer extends TileEntity { 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .gradle/ 3 | *.iml 4 | *.ipr 5 | *.iws 6 | .idea/ 7 | out/ 8 | run/ 9 | src/main/resources/assets/teckle/textures/blocks/clrref/ 10 | src/main/java/mcmultipart/ 11 | src/main/resources/assets/mcmultiparttest/ 12 | minecraft/ 13 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/retriever.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/filter", 3 | "textures": { 4 | "side": "teckle:blocks/retrieverside", 5 | "out": "teckle:blocks/retrieverout", 6 | "in": "teckle:blocks/retrieverin" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Mar 25 21:23:47 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | #### Feature description. 8 | 9 | 10 | #### Feature functionality 11 | 12 | 13 | #### Does this feature involve mod compatability, if so, which mods 14 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/sortingmachine.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/filter", 3 | "textures": { 4 | "side": "teckle:blocks/sortingmachineside", 5 | "out": "teckle:blocks/sortingmachineout", 6 | "in": "teckle:blocks/sortingmachinein" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/exception/MissingOreException.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.exception; 2 | 3 | public class MissingOreException extends RuntimeException { 4 | public MissingOreException(String data) { 5 | super("Teckle is missing ores, " + data.replaceAll("\n", "")); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/breaker.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/filter", 3 | "textures": { 4 | "side": "teckle:blocks/breakerside", 5 | "particle": "teckle:blocks/breakerside", 6 | "out": "teckle:blocks/breakerout", 7 | "in": "teckle:blocks/breakerfront" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/placer.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "teckle:block/filter", 3 | "textures": { 4 | "side": "teckle:blocks/deployer_side", 5 | "particle": "teckle:blocks/deployer_side", 6 | "out": "teckle:blocks/deployer_back", 7 | "in": "teckle:blocks/deployer_front" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/alloyfurnace.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/orientable", 3 | "textures": { 4 | "top": "teckle:blocks/alloyfurnace_top", 5 | "front": "teckle:blocks/alloyfurnace", 6 | "side": "teckle:blocks/alloyfurnace_side", 7 | "down": "teckle:blocks/alloyfurnace_bottom" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/gui/TeckleGUIFactory.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.client.gui; 2 | 3 | import com.elytradev.concrete.config.ConcreteGuiFactory; 4 | import com.elytradev.teckle.common.TeckleMod; 5 | 6 | public class TeckleGUIFactory extends ConcreteGuiFactory { 7 | public TeckleGUIFactory() { 8 | super(TeckleMod.CONFIG); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/blueprint.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "type": "forge:ore_dict", 6 | "ore": "paper" 7 | }, 8 | { 9 | "type": "forge:ore_dict", 10 | "ore": "dyeBlue" 11 | } 12 | ], 13 | "result": { 14 | "item": "teckle:blueprint", 15 | "count": 1 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/TeckleMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages; 2 | 3 | import com.elytradev.concrete.network.Message; 4 | import com.elytradev.teckle.common.network.TeckleNetworking; 5 | 6 | public abstract class TeckleMessage extends Message { 7 | public TeckleMessage() { 8 | super(TeckleNetworking.NETWORK); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/alloyfurnace.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "BBB", 5 | "B B", 6 | "BFB" 7 | ], 8 | "key": { 9 | "B": { 10 | "item": "minecraft:brick_block" 11 | }, 12 | "F": { 13 | "item": "minecraft:furnace" 14 | } 15 | }, 16 | "result": { 17 | "item": "teckle:alloyfurnace", 18 | "data": 0 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/blade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "I", 5 | "S" 6 | ], 7 | "key": { 8 | "I": { 9 | "type": "forge:ore_dict", 10 | "ore": "ingotIron" 11 | }, 12 | "S": { 13 | "type": "forge:ore_dict", 14 | "ore": "stickWood" 15 | } 16 | }, 17 | "result": { 18 | "item": "teckle:blade", 19 | "data": 0 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/item_tube.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "BGB" 5 | ], 6 | "key": { 7 | "B": { 8 | "type": "forge:ore_dict", 9 | "ore": "ingotBrass" 10 | }, 11 | "G": { 12 | "type": "forge:ore_dict", 13 | "ore": "blockGlassColorless" 14 | } 15 | }, 16 | "result": { 17 | "item": "teckle:tube.item", 18 | "data": 0 19 | } 20 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | #### Issue Description: 8 | 9 | 10 | #### What happens: 11 | 12 | 13 | #### What you expected to happen: 14 | 15 | 16 | #### How to reproduce: 17 | 18 | 19 | #### Affected Versions (Do *not* use "*latest*"): 20 | 21 | - Teckle: 22 | - Forge: 23 | - Minecraft: 24 | 25 | #### Crash report, if relevent 26 | [pastebin/gist link here] 27 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/fabricator.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube", 3 | "textures": { 4 | "down": "teckle:blocks/fabricator_bottom", 5 | "up": "teckle:blocks/fabricator_top", 6 | "north": "teckle:blocks/fabricator_side", 7 | "south": "teckle:blocks/fabricator_side", 8 | "west": "teckle:blocks/fabricator_side", 9 | "east": "teckle:blocks/fabricator_side", 10 | "particle": "teckle:blocks/fabricator_bottom" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/item/beamquarry.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube", 3 | "textures": { 4 | "particle": "teckle:blocks/beamquarry_top_inactive", 5 | "down": "teckle:blocks/beamquarry_bottom", 6 | "up": "teckle:blocks/beamquarry_top", 7 | "north": "teckle:blocks/beamquarry_front", 8 | "east": "teckle:blocks/beamquarry_side", 9 | "south": "teckle:blocks/beamquarry_side", 10 | "west": "teckle:blocks/beamquarry_side" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | stages { 4 | stage('Build') { 5 | steps { 6 | sh 'rm -f private.gradle' 7 | sh './gradlew setupCiWorkspace clean build' 8 | archiveArtifacts 'build/libs/*.jar' 9 | } 10 | } 11 | stage('Deploy') { 12 | when { 13 | branch '1.12' 14 | } 15 | steps { 16 | withCredentials([file(credentialsId: 'privateGradleNoSnapshotShadow', variable: 'PRIVATEGRADLE')]) { 17 | sh ''' 18 | cp "$PRIVATEGRADLE" private.gradle 19 | ./gradlew uploadShadow 20 | ''' 21 | } 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "CCC", 5 | "GPG", 6 | "CWC" 7 | ], 8 | "key": { 9 | "C": { 10 | "type": "forge:ore_dict", 11 | "ore": "cobblestone" 12 | }, 13 | "G": { 14 | "type": "forge:ore_dict", 15 | "ore": "ingotGold" 16 | }, 17 | "W": { 18 | "item": "teckle:siliconwafer", 19 | "data": 1 20 | }, 21 | "P": { 22 | "item": "minecraft:piston" 23 | } 24 | }, 25 | "result": { 26 | "item": "teckle:filter", 27 | "data": 0 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/breaker.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "CAC", 5 | "CPC", 6 | "CRC" 7 | ], 8 | "key": { 9 | "C": { 10 | "type": "forge:ore_dict", 11 | "ore": "cobblestone" 12 | }, 13 | "A": { 14 | "item": "minecraft:iron_pickaxe", 15 | "data": 0 16 | }, 17 | "R": { 18 | "type": "forge:ore_dict", 19 | "ore": "dustRedstone" 20 | }, 21 | "P": { 22 | "item": "minecraft:piston" 23 | } 24 | }, 25 | "result": { 26 | "item": "teckle:breaker", 27 | "data": 0 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/transposer.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "CCC", 5 | "WPW", 6 | "CRC" 7 | ], 8 | "key": { 9 | "C": { 10 | "type": "forge:ore_dict", 11 | "ore": "cobblestone" 12 | }, 13 | "W": { 14 | "type": "forge:ore_dict", 15 | "ore": "plankWood" 16 | }, 17 | "R": { 18 | "type": "forge:ore_dict", 19 | "ore": "dustRedstone" 20 | }, 21 | "P": { 22 | "item": "minecraft:piston" 23 | } 24 | }, 25 | "result": { 26 | "item": "teckle:transposer", 27 | "data": 0 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/fabricator.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "BBB", 5 | "WCW", 6 | "WRW" 7 | ], 8 | "key": { 9 | "B": { 10 | "type": "forge:ore_dict", 11 | "ore": "ingotBrass" 12 | }, 13 | "C": { 14 | "item": "minecraft:crafting_table" 15 | }, 16 | "W": { 17 | "type": "forge:ore_dict", 18 | "ore": "blockPlanks" 19 | }, 20 | "R": { 21 | "type": "forge:ore_dict", 22 | "ore": "dustRedstone" 23 | } 24 | }, 25 | "result": { 26 | "item": "teckle:fabricator", 27 | "data": 0 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/alloyfurnace.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "teckle:alloyfurnace" 5 | }, 6 | "variants": { 7 | "lit": { 8 | "false": {}, 9 | "true": { 10 | "textures": { 11 | "front": "teckle:blocks/alloyfurnace_lit" 12 | } 13 | } 14 | }, 15 | "facing": { 16 | "north": {}, 17 | "south": { 18 | "y": 180 19 | }, 20 | "west": { 21 | "y": 270 22 | }, 23 | "east": { 24 | "y": 90 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/compacted_metal.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "all": "teckle:blocks/bluealloy_block" 6 | }, 7 | "transform": "forge:default-block", 8 | "model": "cube_all" 9 | }, 10 | "variants": { 11 | "ingot": { 12 | "redalloy": { 13 | "textures": { 14 | "all": "teckle:blocks/redalloy_block" 15 | } 16 | }, 17 | "brass": { 18 | "textures": { 19 | "all": "teckle:blocks/redalloy_block" 20 | } 21 | }, 22 | "bluealloy": { 23 | "textures": { 24 | "all": "teckle:blocks/bluealloy_block" 25 | } 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/recipes/sorting_machine.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "IWI", 5 | "BFB", 6 | "IRI" 7 | ], 8 | "key": { 9 | "W": { 10 | "item": "teckle:siliconwafer", 11 | "data": 2 12 | }, 13 | "R": { 14 | "item": "teckle:siliconwafer", 15 | "data": 1 16 | }, 17 | "I": { 18 | "type": "forge:ore_dict", 19 | "ore": "ingotIron" 20 | }, 21 | "B": { 22 | "type": "forge:ore_dict", 23 | "ore": "ingotBlueAlloy" 24 | }, 25 | "F": { 26 | "item": "teckle:filter", 27 | "data": 0 28 | } 29 | }, 30 | "result": { 31 | "item": "teckle:sortingmachine", 32 | "data": 0 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/CommandWorldNetworkStats.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.worldnetwork; 2 | 3 | import net.minecraft.command.CommandBase; 4 | import net.minecraft.command.CommandException; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.server.MinecraftServer; 7 | 8 | public class CommandWorldNetworkStats extends CommandBase { 9 | @Override 10 | public String getName() { 11 | return "tecklenetwork"; 12 | } 13 | 14 | @Override 15 | public String getUsage(ICommandSender sender) { 16 | return null; 17 | } 18 | 19 | @Override 20 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "teckle", 4 | "name": "Teckle", 5 | "description": "A tech mod that actually updates. Maintained by TheCodedOne", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "darkevilmac (Programming)", 12 | "TheCodedOne (Programming)", 13 | "CyanideX (Textures)", 14 | "unascribed (Textures)", 15 | "Falkreon (Textures)", 16 | "Elytra Team" 17 | ], 18 | "credits": "Some textures from CyanideX's Unity resource pack", 19 | "logoFile": "assets/teckle/Logo.png", 20 | "screenshots": [], 21 | "dependencies": [] 22 | } 23 | ] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Jenkins Status](https://img.shields.io/jenkins/s/https/ci.elytradev.com/job/elytra/job/Teckle/job/1.12.svg)](https://ci.elytradev.com/job/elytra/job/Teckle/job/1.12/) 2 | [![Lines of Code](https://tokei.rs/b1/github/elytra/Teckle?category=code)](https://github.com/elytra/Teckle) 3 | 4 | 5 | ![Logo](https://raw.githubusercontent.com/elytra/Teckle/1.12/.github/banner.png) 6 | 7 | [>> Downloads <<](https://github.com/elytra/Teckle/releases) 8 | *Reviving old ideas since 2017.* 9 | 10 | **This mod is open source and under a permissive license.** All Elytra mods are, 11 | and as such, can be included in any modpack on any platform without prior 12 | permission. We appreciate hearing about people using our mods, but you do not 13 | need to ask to use them. See the [LICENSE file](LICENSE) for more details. 14 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/compat/jei/FabricatorBlueprintError.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.compat.jei; 2 | 3 | import mezz.jei.api.gui.IRecipeLayout; 4 | import mezz.jei.api.recipe.transfer.IRecipeTransferError; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.resources.I18n; 7 | import net.minecraft.util.text.TextFormatting; 8 | 9 | public class FabricatorBlueprintError implements IRecipeTransferError { 10 | @Override 11 | public Type getType() { 12 | return Type.USER_FACING; 13 | } 14 | 15 | @Override 16 | public void showError(Minecraft mc, int mouseX, int mouseY, IRecipeLayout recipeLayout, int recipeX, int recipeY) { 17 | mc.fontRenderer.drawStringWithShadow(TextFormatting.RED + I18n.format("tooltip.teckle.fabricator.missing"), recipeX + 60, recipeY, 0); 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/IDropAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldnetwork.common; 18 | 19 | public interface IDropAction { 20 | 21 | void dropToWorld(WorldNetworkTraveller traveller); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/render/model/TubeModelLoader.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.client.render.model; 2 | 3 | import net.minecraft.client.resources.IResourceManager; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.client.model.ICustomModelLoader; 6 | import net.minecraftforge.client.model.IModel; 7 | 8 | import javax.annotation.Nonnull; 9 | 10 | public class TubeModelLoader implements ICustomModelLoader { 11 | 12 | private static TubeModel tubeModel; 13 | 14 | @Override 15 | public boolean accepts(ResourceLocation location) { 16 | return location.getNamespace().equals("teckle") && location.getPath().endsWith("tube.item"); 17 | } 18 | 19 | @Override 20 | @Nonnull 21 | public IModel loadModel(ResourceLocation modelLocation) throws Exception { 22 | if (tubeModel == null) 23 | tubeModel = new TubeModel(); 24 | return tubeModel; 25 | } 26 | 27 | @Override 28 | public void onResourceManagerReload(IResourceManager resourceManager) { 29 | tubeModel = null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/item/ItemBlade.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.item; 18 | 19 | import net.minecraft.item.Item; 20 | 21 | public class ItemBlade extends Item { 22 | 23 | public ItemBlade() { 24 | setMaxStackSize(1); 25 | setMaxDamage(64); 26 | } 27 | 28 | @Override 29 | public boolean isDamageable() { 30 | return false; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/item/ItemCompacted.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.item; 2 | 3 | import com.elytradev.concrete.resgen.EnumResourceType; 4 | import com.elytradev.concrete.resgen.IResourceHolder; 5 | import com.elytradev.teckle.common.TeckleMod; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.item.ItemColored; 8 | import net.minecraft.util.ResourceLocation; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | public class ItemCompacted extends ItemColored implements IResourceHolder { 13 | public ItemCompacted(Block block, boolean hasSubtypes) { 14 | super(block, hasSubtypes); 15 | } 16 | 17 | @Nullable 18 | @Override 19 | public ResourceLocation getResource(EnumResourceType resourceType, int meta) { 20 | if (resourceType == EnumResourceType.TEXTURE) { 21 | ItemIngot.IngotType ingotType = ItemIngot.IngotType.byMetadata(meta); 22 | if (ingotType == ItemIngot.IngotType.BRASS) ingotType = ItemIngot.IngotType.RED_ALLOY; 23 | return new ResourceLocation(TeckleMod.MOD_ID, "blocks/" + ingotType.getName() + "_block"); 24 | } 25 | return null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/retriever.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "side": "teckle:blocks/retrieverside", 6 | "particle": "teckle:blocks/retrieverside", 7 | "out": "teckle:blocks/retrieverout", 8 | "in": "teckle:blocks/retrieverin" 9 | }, 10 | "uvlock": false, 11 | "transform": "forge:default-block", 12 | "model": "teckle:filter" 13 | }, 14 | "variants": { 15 | "facing": { 16 | "down": { 17 | "x": 180, 18 | "y": 0 19 | }, 20 | "up": { 21 | "x": 0, 22 | "y": 0 23 | }, 24 | "north": { 25 | "x": 90, 26 | "y": 0 27 | }, 28 | "south": { 29 | "x": 90, 30 | "y": 180 31 | }, 32 | "west": { 33 | "x": 90, 34 | "y": 270 35 | }, 36 | "east": { 37 | "x": 90, 38 | "y": 90 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/sortingmachine.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "side": "teckle:blocks/sortingmachineside", 6 | "particle": "teckle:blocks/sortingmachineside", 7 | "out": "teckle:blocks/sortingmachineout", 8 | "in": "teckle:blocks/sortingmachinein" 9 | }, 10 | "uvlock": false, 11 | "transform": "forge:default-block", 12 | "model": "teckle:filter" 13 | }, 14 | "variants": { 15 | "facing": { 16 | "down": { 17 | "x": 180, 18 | "y": 0 19 | }, 20 | "up": { 21 | "x": 0, 22 | "y": 0 23 | }, 24 | "north": { 25 | "x": 90, 26 | "y": 0 27 | }, 28 | "south": { 29 | "x": 90, 30 | "y": 180 31 | }, 32 | "west": { 33 | "x": 90, 34 | "y": 270 35 | }, 36 | "east": { 37 | "x": 90, 38 | "y": 90 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/base/IElementProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.tile.base; 18 | 19 | import net.minecraft.entity.player.EntityPlayer; 20 | import net.minecraftforge.fml.relauncher.Side; 21 | import net.minecraftforge.fml.relauncher.SideOnly; 22 | 23 | 24 | /** 25 | * Used by TeckleGuiHandler to handle tile guis. 26 | */ 27 | public interface IElementProvider { 28 | 29 | Object getServerElement(EntityPlayer player); 30 | 31 | @SideOnly(Side.CLIENT) 32 | Object getClientElement(EntityPlayer player); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/TileUpdateMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.clientbound; 2 | 3 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 4 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | @ReceivedOn(Side.CLIENT) 12 | public class TileUpdateMessage extends TeckleMessage { 13 | 14 | public BlockPos tilePos; 15 | public NBTTagCompound tag; 16 | 17 | public TileUpdateMessage() { 18 | } 19 | 20 | public TileUpdateMessage(World world, BlockPos tilePos) { 21 | this.tilePos = tilePos; 22 | if (world.getTileEntity(tilePos) != null) { 23 | this.tag = world.getTileEntity(tilePos).getUpdateTag(); 24 | } 25 | } 26 | 27 | @Override 28 | protected void handle(EntityPlayer player) { 29 | if (player != null && player.world.getTileEntity(tilePos) != null) { 30 | player.world.getTileEntity(tilePos).handleUpdateTag(tag); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/helper/CapabilityHelper.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.helper; 2 | 3 | import net.minecraft.util.EnumFacing; 4 | import net.minecraftforge.common.capabilities.Capability; 5 | import net.minecraftforge.common.capabilities.CapabilityInject; 6 | import net.minecraftforge.common.capabilities.ICapabilityProvider; 7 | import net.minecraftforge.items.IItemHandler; 8 | 9 | import javax.annotation.Nullable; 10 | 11 | /** 12 | * Contains some helper methods for capabilities to save some space and reduce redundancy. 13 | */ 14 | public class CapabilityHelper { 15 | 16 | @CapabilityInject(IItemHandler.class) 17 | public static Capability ITEM_HANDLER_CAPABILITY; 18 | 19 | public static boolean isItemHandler(@Nullable ICapabilityProvider provider, EnumFacing face) { 20 | if (provider == null) 21 | return false; 22 | return provider.hasCapability(ITEM_HANDLER_CAPABILITY, face); 23 | } 24 | 25 | @Nullable 26 | public static IItemHandler getItemHandler(@Nullable ICapabilityProvider provider, EnumFacing face) { 27 | if (!isItemHandler(provider, face)) 28 | return null; 29 | 30 | return provider.getCapability(ITEM_HANDLER_CAPABILITY, face); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Benjamin K (darkevilmac) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | modGroup=com.elytradev 18 | modVersion=0.6 19 | modBaseName=teckle 20 | forgeVersion=1.12.2-14.23.0.2545 21 | mcpVersion=snapshot_20180731 22 | 23 | #JEI Stuff 24 | mc_version=1.12.2 25 | jei_version=4.8.0.114 26 | #MCMP Stuff 27 | mcmp_version=2.3.4_49 28 | #CT Stuff 29 | ct_version=1.12-4.0.12.323 30 | #Eytra Stuff 31 | pdp_version=MC1.12_ver1.1.1 32 | concrete_version=0.3.3-SNAPSHOT 33 | 34 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 35 | # This is required to provide enough memory for the Minecraft decompilation process. 36 | org.gradle.jvmargs=-Xmx3G 37 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/beamquarry.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "cube", 5 | "textures": { 6 | "particle": "teckle:blocks/beamquarry_top_inactive", 7 | "down": "teckle:blocks/beamquarry_bottom", 8 | "up": "teckle:blocks/beamquarry_top_inactive", 9 | "north": "teckle:blocks/beamquarry_front_inactive", 10 | "east": "teckle:blocks/beamquarry_side", 11 | "south": "teckle:blocks/beamquarry_side", 12 | "west": "teckle:blocks/beamquarry_side" 13 | } 14 | }, 15 | "variants": { 16 | "active": { 17 | "false": {}, 18 | "true": { 19 | "textures": { 20 | "particle": "teckle:blocks/beamquarry_top", 21 | "up": "teckle:blocks/beamquarry_top", 22 | "north": "teckle:blocks/beamquarry_front" 23 | } 24 | } 25 | }, 26 | "facing": { 27 | "north": {}, 28 | "south": { 29 | "y": 180 30 | }, 31 | "west": { 32 | "y": 270 33 | }, 34 | "east": { 35 | "y": 90 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "side": "teckle:blocks/filtersideoff", 6 | "particle": "teckle:blocks/filtersideoff" 7 | }, 8 | "uvlock": false, 9 | "transform": "forge:default-block", 10 | "model": "teckle:filter" 11 | }, 12 | "variants": { 13 | "triggered": { 14 | "true": { 15 | "textures": { 16 | "side": "teckle:blocks/filtersideon" 17 | } 18 | }, 19 | "false": {} 20 | }, 21 | "facing": { 22 | "down": { 23 | "x": 180, 24 | "y": 0 25 | }, 26 | "up": { 27 | "x": 0, 28 | "y": 0 29 | }, 30 | "north": { 31 | "x": 90, 32 | "y": 0 33 | }, 34 | "south": { 35 | "x": 90, 36 | "y": 180 37 | }, 38 | "west": { 39 | "x": 90, 40 | "y": 270 41 | }, 42 | "east": { 43 | "x": 90, 44 | "y": 90 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/retriever/RetrieverEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile.retriever; 2 | 3 | import com.elytradev.teckle.api.IWorldNetwork; 4 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkTraveller; 5 | import com.elytradev.teckle.common.worldnetwork.common.node.WorldNetworkEndpoint; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.math.BlockPos; 9 | 10 | public class RetrieverEndpoint extends WorldNetworkEndpoint { 11 | public RetrieverEndpoint(IWorldNetwork network, BlockPos position, EnumFacing capabilityFace) { 12 | super(network, position, capabilityFace); 13 | } 14 | 15 | @Override 16 | public boolean inject(WorldNetworkTraveller traveller, EnumFacing from) { 17 | NetworkTileRetrieverInput retriever = (NetworkTileRetrieverInput) this.getNetworkTile(); 18 | if (retriever == null) 19 | return false; 20 | ItemStack remaining = retriever.acceptTraveller(traveller); 21 | 22 | if (remaining == null) 23 | return false; 24 | 25 | if (remaining.isEmpty()) 26 | return true; 27 | 28 | traveller.data.setTag("stack", remaining.serializeNBT()); 29 | return false; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/transposer.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "side": "teckle:blocks/transposersideoff", 6 | "particle": "teckle:blocks/transposersideoff" 7 | }, 8 | "uvlock": false, 9 | "transform": "forge:default-block", 10 | "model": "teckle:filter" 11 | }, 12 | "variants": { 13 | "triggered": { 14 | "true": { 15 | "textures": { 16 | "side": "teckle:blocks/transposersideon" 17 | } 18 | }, 19 | "false": {} 20 | }, 21 | "facing": { 22 | "down": { 23 | "x": 180, 24 | "y": 0 25 | }, 26 | "up": { 27 | "x": 0, 28 | "y": 0 29 | }, 30 | "north": { 31 | "x": 90, 32 | "y": 0 33 | }, 34 | "south": { 35 | "x": 90, 36 | "y": 180 37 | }, 38 | "west": { 39 | "x": 90, 40 | "y": 270 41 | }, 42 | "east": { 43 | "x": 90, 44 | "y": 90 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/compat/jei/AlloyRecipeWrapper.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.compat.jei; 2 | 3 | import com.elytradev.teckle.common.TeckleLog; 4 | import com.elytradev.teckle.common.crafting.AlloyRecipe; 5 | import mezz.jei.api.ingredients.IIngredients; 6 | import mezz.jei.api.recipe.IRecipeWrapper; 7 | import mezz.jei.api.recipe.IStackHelper; 8 | import net.minecraft.item.ItemStack; 9 | 10 | import java.util.List; 11 | 12 | public class AlloyRecipeWrapper implements IRecipeWrapper { 13 | 14 | private final AlloyRecipe recipe; 15 | 16 | public AlloyRecipeWrapper(AlloyRecipe recipe) { 17 | this.recipe = recipe; 18 | } 19 | 20 | @Override 21 | public void getIngredients(IIngredients ingredients) { 22 | ItemStack recipeOutput = recipe.getCraftingResult(); 23 | IStackHelper stackHelper = TeckleJEIPlugin.HELPERS.getStackHelper(); 24 | 25 | try { 26 | List> inputLists = stackHelper.expandRecipeItemStackInputs(recipe.getInputs()); 27 | ingredients.setInputLists(ItemStack.class, inputLists); 28 | ingredients.setOutput(ItemStack.class, recipeOutput); 29 | } catch (RuntimeException e) { 30 | TeckleLog.error("Failed to get ingredients for recipe wrapper. {} {}", recipe, e); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/DummyWorldNetworkEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldnetwork.common; 18 | 19 | import com.elytradev.teckle.common.worldnetwork.common.node.WorldNetworkEndpoint; 20 | import net.minecraft.util.EnumFacing; 21 | import net.minecraft.util.math.BlockPos; 22 | 23 | public class DummyWorldNetworkEndpoint extends WorldNetworkEndpoint { 24 | public DummyWorldNetworkEndpoint(WorldNetwork network, BlockPos position) { 25 | super(network, position, null); 26 | } 27 | 28 | @Override 29 | public boolean inject(WorldNetworkTraveller traveller, EnumFacing from) { 30 | return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/base/TeckleEnergyStorage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile.base; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | import net.minecraftforge.common.util.INBTSerializable; 5 | import net.minecraftforge.energy.EnergyStorage; 6 | 7 | public class TeckleEnergyStorage extends EnergyStorage implements INBTSerializable { 8 | public TeckleEnergyStorage(int capacity) { 9 | super(capacity); 10 | } 11 | 12 | public TeckleEnergyStorage(int capacity, int maxTransfer) { 13 | super(capacity, maxTransfer); 14 | } 15 | 16 | public TeckleEnergyStorage(int capacity, int maxReceive, int maxExtract) { 17 | super(capacity, maxReceive, maxExtract); 18 | } 19 | 20 | public TeckleEnergyStorage(int capacity, int maxReceive, int maxExtract, int energy) { 21 | super(capacity, maxReceive, maxExtract, energy); 22 | } 23 | 24 | public void setEnergyStored(int energyStored) { 25 | this.energy = energyStored; 26 | } 27 | 28 | @Override 29 | public NBTTagCompound serializeNBT() { 30 | NBTTagCompound tag = new NBTTagCompound(); 31 | tag.setInteger("energy", getEnergyStored()); 32 | return tag; 33 | } 34 | 35 | @Override 36 | public void deserializeNBT(NBTTagCompound tag) { 37 | this.setEnergyStored(tag.getInteger("energy")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/inv/SlotData.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile.inv; 2 | 3 | import net.minecraft.item.Item; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.items.IItemHandler; 6 | 7 | /** 8 | * A wrapper for items in handlers, reduces the need for use of tuples in a lot of places. 9 | */ 10 | public class SlotData { 11 | 12 | public IItemHandler itemHandler; 13 | public int slot; 14 | 15 | public SlotData(IItemHandler itemHandler, int slot) { 16 | this.itemHandler = itemHandler; 17 | this.slot = slot; 18 | } 19 | 20 | public ItemStack getStack() { 21 | return itemHandler.getStackInSlot(slot); 22 | } 23 | 24 | public int getCount() { 25 | return getStack().getCount(); 26 | } 27 | 28 | public boolean isEmpty() { 29 | return getStack().isEmpty(); 30 | } 31 | 32 | public boolean isItemEqual(ItemStack other) { 33 | return getStack().isItemEqual(other); 34 | } 35 | 36 | public Item getItem() { 37 | return getStack().getItem(); 38 | } 39 | 40 | public boolean canExtractCount(int count) { 41 | return itemHandler.extractItem(slot, count, true).getCount() == count; 42 | } 43 | 44 | public ItemStack extract(Integer count, boolean simulate) { 45 | return itemHandler.extractItem(slot, count, simulate); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/placer.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "side": "teckle:blocks/deployer_side", 6 | "particle": "teckle:blocks/deployer_side", 7 | "out": "teckle:blocks/deployer_back", 8 | "in": "teckle:blocks/deployer_front" 9 | }, 10 | "uvlock": false, 11 | "transform": "forge:default-block", 12 | "model": "teckle:filter" 13 | }, 14 | "variants": { 15 | "triggered": { 16 | "true": { 17 | "textures": { 18 | "in": "teckle:blocks/deployer_front_active" 19 | } 20 | }, 21 | "false": {} 22 | }, 23 | "facing": { 24 | "down": { 25 | "x": 180, 26 | "y": 0 27 | }, 28 | "up": { 29 | "x": 0, 30 | "y": 0 31 | }, 32 | "north": { 33 | "x": 90, 34 | "y": 0 35 | }, 36 | "south": { 37 | "x": 90, 38 | "y": 180 39 | }, 40 | "west": { 41 | "x": 90, 42 | "y": 270 43 | }, 44 | "east": { 45 | "x": 90, 46 | "y": 90 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/RetrieverSelectorModeChangeMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.serverbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 5 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 6 | import com.elytradev.teckle.common.tile.retriever.TileRetriever; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | @ReceivedOn(Side.SERVER) 12 | public class RetrieverSelectorModeChangeMessage extends TeckleMessage { 13 | 14 | public BlockPos pos; 15 | public boolean useSelector; 16 | 17 | public RetrieverSelectorModeChangeMessage(NetworkContext ctx) { 18 | } 19 | 20 | public RetrieverSelectorModeChangeMessage(BlockPos pos, boolean useSelector) { 21 | this.pos = pos; 22 | this.useSelector = useSelector; 23 | } 24 | 25 | @Override 26 | protected void handle(EntityPlayer sender) { 27 | if (sender != null && sender.world != null) { 28 | TileRetriever retriever = (TileRetriever) sender.world.getTileEntity(pos); 29 | if (!retriever.isUsableByPlayer(sender)) 30 | return; 31 | retriever.setUseSelector(useSelector); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/sortingmachine/SortingMachineEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile.sortingmachine; 2 | 3 | import com.elytradev.teckle.api.IWorldNetwork; 4 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkTraveller; 5 | import com.elytradev.teckle.common.worldnetwork.common.node.WorldNetworkEndpoint; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.math.BlockPos; 9 | 10 | public class SortingMachineEndpoint extends WorldNetworkEndpoint { 11 | public SortingMachineEndpoint(IWorldNetwork network, BlockPos position, EnumFacing capabilityFace) { 12 | super(network, position, capabilityFace); 13 | } 14 | 15 | @Override 16 | public boolean inject(WorldNetworkTraveller traveller, EnumFacing from) { 17 | TileSortingMachine sortingMachine = (TileSortingMachine) this.getNetworkTile().getTileEntity(); 18 | if (sortingMachine == null) 19 | return false; 20 | ItemStack remaining = sortingMachine.getSortMode().acceptTraveller((NetworkTileSortingMachineBase) getNetworkTile(), traveller, from); 21 | 22 | if (remaining == null) 23 | return false; 24 | 25 | if (remaining.isEmpty()) 26 | return true; 27 | 28 | traveller.data.setTag("stack", remaining.serializeNBT()); 29 | return false; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/helper/ColourHelper.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.helper; 2 | 3 | import net.minecraft.item.EnumDyeColor; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public class ColourHelper { 8 | 9 | /** 10 | * Cycle a colour through possible values including null. 11 | * 12 | * @param colour the colour to cycle from 13 | * @param reverse whether the cycle is reversed 14 | * @return the cycled colour. 15 | */ 16 | @Nullable 17 | public static EnumDyeColor cycleColour(EnumDyeColor colour, boolean reverse) { 18 | if (!reverse) { 19 | if (colour == null) { 20 | colour = EnumDyeColor.byMetadata(0); 21 | } else { 22 | if (colour.getMetadata() == 15) { 23 | colour = null; 24 | } else { 25 | colour = EnumDyeColor.byMetadata(colour.getMetadata() + 1); 26 | } 27 | } 28 | } else { 29 | if (colour == null) { 30 | colour = EnumDyeColor.byMetadata(15); 31 | } else { 32 | if (colour.getMetadata() == 0) { 33 | colour = null; 34 | } else { 35 | colour = EnumDyeColor.byMetadata(colour.getMetadata() - 1); 36 | } 37 | } 38 | } 39 | return colour; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/RetrieverMatchCountMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.serverbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 5 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 6 | import com.elytradev.teckle.common.tile.retriever.TileRetriever; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | @ReceivedOn(Side.SERVER) 12 | public class RetrieverMatchCountMessage extends TeckleMessage { 13 | 14 | public BlockPos pos; 15 | public boolean matchCount; 16 | 17 | public RetrieverMatchCountMessage() { 18 | } 19 | 20 | public RetrieverMatchCountMessage(NetworkContext ctx) { 21 | } 22 | 23 | public RetrieverMatchCountMessage(BlockPos pos, boolean matchCount) { 24 | this.pos = pos; 25 | this.matchCount = matchCount; 26 | } 27 | 28 | @Override 29 | protected void handle(EntityPlayer sender) { 30 | if (sender != null && sender.world != null) { 31 | TileRetriever retriever = (TileRetriever) sender.world.getTileEntity(pos); 32 | if (!retriever.isUsableByPlayer(sender)) 33 | return; 34 | retriever.setMatchCount(matchCount); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/worldnetwork/DummyNetworkTraveller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.client.worldnetwork; 18 | 19 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkTraveller; 20 | import com.elytradev.teckle.common.worldnetwork.common.pathing.WorldNetworkPath; 21 | import net.minecraft.nbt.NBTTagCompound; 22 | 23 | /** 24 | * Created by darkevilmac on 4/2/2017. 25 | */ 26 | public class DummyNetworkTraveller extends WorldNetworkTraveller { 27 | 28 | public DummyNetworkTraveller(NBTTagCompound data, WorldNetworkPath path) { 29 | super(data); 30 | this.data = data; 31 | this.activePath = path; 32 | } 33 | 34 | @Override 35 | public void update() { 36 | // dont. 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/blockstates/breaker.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "side": "teckle:blocks/breakerside", 6 | "particle": "teckle:blocks/breakerside", 7 | "out": "teckle:blocks/breakerout", 8 | "in": "teckle:blocks/breakerfront" 9 | }, 10 | "uvlock": false, 11 | "transform": "forge:default-block", 12 | "model": "teckle:filter" 13 | }, 14 | "variants": { 15 | "triggered": { 16 | "true": { 17 | "textures": { 18 | "in": "teckle:blocks/breakerfront_on", 19 | "side": "teckle:blocks/breakerside_on" 20 | } 21 | }, 22 | "false": {} 23 | }, 24 | "facing": { 25 | "down": { 26 | "x": 180, 27 | "y": 0 28 | }, 29 | "up": { 30 | "x": 0, 31 | "y": 0 32 | }, 33 | "north": { 34 | "x": 90, 35 | "y": 0 36 | }, 37 | "south": { 38 | "x": 90, 39 | "y": 180 40 | }, 41 | "west": { 42 | "x": 90, 43 | "y": 270 44 | }, 45 | "east": { 46 | "x": 90, 47 | "y": 90 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/DebugReceiverMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.clientbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 5 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.util.text.TextComponentString; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | 12 | import java.util.Objects; 13 | 14 | /** 15 | * Handles debug messages for developers, currently just for me. 16 | */ 17 | @ReceivedOn(Side.CLIENT) 18 | public class DebugReceiverMessage extends TeckleMessage { 19 | 20 | public static boolean ACTIVE; 21 | @MarshalledAs("string") 22 | public String message = ""; 23 | 24 | public DebugReceiverMessage(NetworkContext ctx) { 25 | super(); 26 | } 27 | 28 | public DebugReceiverMessage(String message) { 29 | this.message = message; 30 | } 31 | 32 | @Override 33 | protected void handle(EntityPlayer receiver) { 34 | if (receiver != null && Objects.equals(receiver.getGameProfile().getName(), "darkevilmac") && ACTIVE) { 35 | Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString(message)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/pathing/PathNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldnetwork.common.pathing; 18 | 19 | import com.elytradev.teckle.common.worldnetwork.common.node.WorldNetworkNode; 20 | import net.minecraft.util.EnumFacing; 21 | 22 | /** 23 | * Used to store tagCompound about the usefulness of a node for making a path. 24 | */ 25 | public class PathNode { 26 | public int cost; 27 | public PathNode from; 28 | public EnumFacing faceFrom; 29 | public WorldNetworkNode realNode; 30 | 31 | public PathNode(PathNode from, WorldNetworkNode realNode, EnumFacing faceFrom) { 32 | this.from = from; 33 | this.realNode = realNode; 34 | this.cost = from != null ? from.cost + 1 : 0; 35 | this.faceFrom = faceFrom; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/MissingOreExceptionClient.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.client; 2 | 3 | import net.minecraft.client.gui.FontRenderer; 4 | import net.minecraft.client.gui.GuiErrorScreen; 5 | import net.minecraftforge.fml.client.CustomModLoadingErrorDisplayException; 6 | 7 | public class MissingOreExceptionClient extends CustomModLoadingErrorDisplayException { 8 | 9 | private String title; 10 | private String[] message; 11 | 12 | public MissingOreExceptionClient(String message, Throwable cause) { 13 | super(message, cause); 14 | this.title = "Teckle is missing ores!"; 15 | this.message = new String[4]; 16 | for (int i = 0; i < message.split("\n").length; i++) { 17 | // Split new lines for rendering. 18 | this.message[i] = message.split("\n")[i]; 19 | } 20 | } 21 | 22 | @Override 23 | public void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer) { 24 | } 25 | 26 | @Override 27 | public void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) { 28 | errorScreen.drawCenteredString(errorScreen.mc.fontRenderer, this.title, errorScreen.width / 2, 90, 16777215); 29 | for (int i = 0; i < this.message.length; i++) { 30 | String m = this.message[i]; 31 | errorScreen.drawCenteredString(errorScreen.mc.fontRenderer, m, errorScreen.width / 2, 110 + (i * 10), 16777215); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/RetrieverSelectorMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.clientbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 5 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import com.elytradev.teckle.common.tile.retriever.TileRetriever; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | 12 | @ReceivedOn(Side.CLIENT) 13 | public class RetrieverSelectorMessage extends TeckleMessage { 14 | 15 | @MarshalledAs("i8") 16 | public int selectorPos; 17 | public BlockPos retrieverPos; 18 | 19 | public RetrieverSelectorMessage(NetworkContext ctx) { 20 | } 21 | 22 | public RetrieverSelectorMessage(int selectorPos, BlockPos retrieverPos) { 23 | this.selectorPos = selectorPos; 24 | this.retrieverPos = retrieverPos; 25 | } 26 | 27 | @Override 28 | protected void handle(EntityPlayer sender) { 29 | if (sender != null && sender.world != null) { 30 | TileRetriever retriever = (TileRetriever) sender.world.getTileEntity(retrieverPos); 31 | if (!retriever.isUsableByPlayer(sender)) 32 | return; 33 | 34 | retriever.setSelectorPos(selectorPos); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/JamStatusMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.clientbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 5 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 6 | import com.elytradev.teckle.common.tile.base.TileNetworkMember; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | /** 12 | * Handles jam messages for clients. 13 | */ 14 | @ReceivedOn(Side.CLIENT) 15 | public class JamStatusMessage extends TeckleMessage { 16 | 17 | public boolean isJammed; 18 | public BlockPos networkMemberPos; 19 | 20 | public JamStatusMessage(NetworkContext ctx) { 21 | super(); 22 | } 23 | 24 | public JamStatusMessage(TileNetworkMember networkMember) { 25 | super(); 26 | networkMember.setJammed(networkMember.isJammed() || networkMember.getWorld().isBlockPowered(networkMember.getPos())); 27 | this.isJammed = networkMember.isJammed(); 28 | this.networkMemberPos = networkMember.getPos(); 29 | } 30 | 31 | @Override 32 | protected void handle(EntityPlayer sender) { 33 | if (sender != null && sender.world != null) { 34 | TileNetworkMember networkMember = (TileNetworkMember) sender.world.getTileEntity(networkMemberPos); 35 | networkMember.setJammed(isJammed); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/TileLitMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.clientbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 5 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 6 | import com.elytradev.teckle.common.tile.TileLitNetworkMember; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | /** 12 | * Sends a message to clients whenever a tile lights up, used on the sorting machine and the retriever. 13 | */ 14 | @ReceivedOn(Side.CLIENT) 15 | public class TileLitMessage extends TeckleMessage { 16 | 17 | public boolean isLit; 18 | public BlockPos networkMemberPos; 19 | 20 | public TileLitMessage(NetworkContext ctx) { 21 | } 22 | 23 | public TileLitMessage(TileLitNetworkMember networkMember) { 24 | networkMember.setLit(networkMember.isLit() || networkMember.getWorld().isBlockPowered(networkMember.getPos())); 25 | this.isLit = networkMember.isLit(); 26 | this.networkMemberPos = networkMember.getPos(); 27 | } 28 | 29 | @Override 30 | protected void handle(EntityPlayer sender) { 31 | if (sender != null && sender.world != null) { 32 | TileLitNetworkMember networkMember = (TileLitNetworkMember) sender.world.getTileEntity(networkMemberPos); 33 | networkMember.setLit(isLit); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/render/tile/TileRetrieverRender.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.client.render.tile; 2 | 3 | import com.elytradev.teckle.client.render.model.ModelMachineOverlay; 4 | import com.elytradev.teckle.common.TeckleObjects; 5 | import com.elytradev.teckle.common.block.BlockRetriever; 6 | import com.elytradev.teckle.common.tile.retriever.TileRetriever; 7 | import net.minecraft.block.state.IBlockState; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.util.math.Vec3d; 10 | 11 | public class TileRetrieverRender extends TileNetworkMemberRenderer { 12 | 13 | private ModelMachineOverlay lightOverlay; 14 | 15 | public TileRetrieverRender() { 16 | super(BlockRetriever.FACING, "teckle:blocks/retrievererror"); 17 | } 18 | 19 | @Override 20 | public void render(TileRetriever te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { 21 | super.render(te, x, y, z, partialTicks, destroyStage, alpha); 22 | IBlockState blockState = te.getWorld().getBlockState(te.getPos()); 23 | if (blockState.getBlock() != TeckleObjects.blockRetriever || !te.isLit() && !te.isJammed()) 24 | return; 25 | 26 | EnumFacing pointTo = blockState.getValue(BlockRetriever.FACING); 27 | if (lightOverlay == null) { 28 | lightOverlay = new ModelMachineOverlay(this.getClass(), "teckle:blocks/retrieverside_on", true); 29 | } 30 | lightOverlay.render(getWorld(), new Vec3d(x, y, z), te.getPos(), blockState, pointTo); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/block/property/UnlistedBool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.block.property; 18 | 19 | import net.minecraftforge.common.property.IUnlistedProperty; 20 | 21 | /** 22 | * Created by darkevilmac on 3/30/2017. 23 | */ 24 | public class UnlistedBool implements IUnlistedProperty { 25 | 26 | String name; 27 | 28 | public UnlistedBool(String name) { 29 | this.name = name; 30 | } 31 | 32 | @Override 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | @Override 38 | public boolean isValid(Boolean value) { 39 | return true; 40 | } 41 | 42 | @Override 43 | public Class getType() { 44 | return Boolean.class; 45 | } 46 | 47 | @Override 48 | public String valueToString(Boolean value) { 49 | return value.toString(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/RetrieverColourChangeMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.serverbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 5 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import com.elytradev.teckle.common.tile.retriever.TileRetriever; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.item.EnumDyeColor; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraftforge.fml.relauncher.Side; 12 | 13 | @ReceivedOn(Side.SERVER) 14 | public class RetrieverColourChangeMessage extends TeckleMessage { 15 | 16 | public BlockPos pos; 17 | @MarshalledAs("i8") 18 | public int colour; 19 | 20 | public RetrieverColourChangeMessage(NetworkContext ctx) { 21 | } 22 | 23 | public RetrieverColourChangeMessage(BlockPos pos, EnumDyeColor colour) { 24 | this.pos = pos; 25 | this.colour = colour == null ? -1 : colour.getMetadata(); 26 | } 27 | 28 | @Override 29 | protected void handle(EntityPlayer sender) { 30 | if (sender != null && sender.world != null) { 31 | TileRetriever retriever = (TileRetriever) sender.world.getTileEntity(pos); 32 | if (!retriever.isUsableByPlayer(sender)) 33 | return; 34 | retriever.setColour(this.colour == -1 ? null : EnumDyeColor.byMetadata(this.colour)); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/render/tile/TileSortingMachineRender.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.client.render.tile; 2 | 3 | import com.elytradev.teckle.client.render.model.ModelMachineOverlay; 4 | import com.elytradev.teckle.common.TeckleObjects; 5 | import com.elytradev.teckle.common.block.BlockSortingMachine; 6 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 7 | import net.minecraft.block.state.IBlockState; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.util.math.Vec3d; 10 | 11 | 12 | public class TileSortingMachineRender extends TileNetworkMemberRenderer { 13 | 14 | private ModelMachineOverlay lightOverlay; 15 | 16 | public TileSortingMachineRender() { 17 | super(BlockSortingMachine.FACING, "teckle:blocks/sortingmachineerror"); 18 | } 19 | 20 | @Override 21 | public void render(TileSortingMachine te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { 22 | super.render(te, x, y, z, partialTicks, destroyStage, alpha); 23 | IBlockState blockState = te.getWorld().getBlockState(te.getPos()); 24 | if (blockState.getBlock() != TeckleObjects.blockSortingMachine || !te.isLit() && !te.isJammed()) 25 | return; 26 | 27 | EnumFacing pointTo = blockState.getValue(BlockSortingMachine.FACING); 28 | if (lightOverlay == null) { 29 | lightOverlay = new ModelMachineOverlay(this.getClass(), "teckle:blocks/sortingmachineside_on", true); 30 | } 31 | lightOverlay.render(getWorld(), new Vec3d(x, y, z), te.getPos(), blockState, pointTo); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/SortingMachineSelectorMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.clientbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 5 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | 12 | /** 13 | * Created by darkevilmac on 5/31/17. 14 | */ 15 | @ReceivedOn(Side.CLIENT) 16 | public class SortingMachineSelectorMessage extends TeckleMessage { 17 | 18 | @MarshalledAs("i8") 19 | public int selectorPos; 20 | public BlockPos sortingMachinePos; 21 | 22 | public SortingMachineSelectorMessage(NetworkContext ctx) { 23 | } 24 | 25 | public SortingMachineSelectorMessage(int selectorPos, BlockPos sortingMachinePos) { 26 | this.selectorPos = selectorPos; 27 | this.sortingMachinePos = sortingMachinePos; 28 | } 29 | 30 | @Override 31 | protected void handle(EntityPlayer sender) { 32 | if (sender != null && sender.world != null) { 33 | TileSortingMachine sortingMachine = (TileSortingMachine) sender.world.getTileEntity(sortingMachinePos); 34 | if (!sortingMachine.isUsableByPlayer(sender)) 35 | return; 36 | 37 | sortingMachine.setSelectorPos(selectorPos); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/node/WorldNetworkEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldnetwork.common.node; 18 | 19 | import com.elytradev.teckle.api.IWorldNetwork; 20 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkTraveller; 21 | import net.minecraft.util.EnumFacing; 22 | import net.minecraft.util.math.BlockPos; 23 | 24 | /** 25 | * Created by darkevilmac on 3/26/2017. 26 | */ 27 | public abstract class WorldNetworkEndpoint extends WorldNetworkNode { 28 | 29 | public WorldNetworkEndpoint(IWorldNetwork network, BlockPos position, EnumFacing capabilityFace) { 30 | super(network, position, capabilityFace); 31 | } 32 | 33 | /** 34 | * Inject the traveller into the endpoint. 35 | * 36 | * @param traveller 37 | * @param from 38 | * @return if injection was successful, and no product is remaining. 39 | */ 40 | public abstract boolean inject(WorldNetworkTraveller traveller, EnumFacing from); 41 | 42 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "textures": { 4 | "out": "teckle:blocks/filterout", 5 | "in": "teckle:blocks/filterin" 6 | }, 7 | "elements": [ 8 | { 9 | "from": [0, 0, 0], 10 | "to": [16, 16, 16], 11 | "faces": { 12 | "north": {"uv": [0, 0, 16, 16], "texture": "#side", "rotation": 180}, 13 | "east": {"uv": [0, 0, 16, 16], "texture": "#side", "rotation": 180}, 14 | "south": {"uv": [0, 0, 16, 16], "texture": "#side", "rotation": 180}, 15 | "west": {"uv": [0, 0, 16, 16], "texture": "#side", "rotation": 180}, 16 | "up": {"uv": [0, 0, 16, 16], "texture": "#out"}, 17 | "down": {"uv": [0, 0, 16, 16], "texture": "#in"} 18 | } 19 | } 20 | ], 21 | "display": { 22 | "thirdperson_righthand": { 23 | "scale": [0.375, 0.375, 0.375], 24 | "rotation": [75, 45, 180], 25 | "translation": [0, 2.5, 0] 26 | }, 27 | "thirdperson_lefthand": { 28 | "scale": [0.375, 0.375, 0.375], 29 | "rotation": [75, 45, 180], 30 | "translation": [0, 2.5, 0] 31 | }, 32 | "firstperson_righthand": { 33 | "scale": [0.4, 0.4, 0.4], 34 | "rotation": [0, 45, 180], 35 | "translation": [0, 0, 0] 36 | }, 37 | "firstperson_lefthand": { 38 | "scale": [0.4, 0.4, 0.4], 39 | "rotation": [0, 225, 180], 40 | "translation": [0, 0, 0] 41 | }, 42 | "ground": { 43 | "scale": [0.25, 0.25, 0.25], 44 | "rotation": [0, 0, 180], 45 | "translation": [0, 3, 0] 46 | }, 47 | "fixed": { 48 | "scale": [0.5, 0.5, 0.5], 49 | "rotation": [0, 0, 180], 50 | "translation": [0, 0, 0] 51 | }, 52 | "gui": { 53 | "scale": [0.625, 0.625, 0.625], 54 | "rotation": [30, 225, 180], 55 | "translation": [0, 0, 0] 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /project.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | group = 'com.elytradev' 3 | projectName = 'Teckle' 4 | 5 | useElytraVersionFormat = true 6 | version = project.modVersion 7 | 8 | concreteVersion = project.concrete_version 9 | concreteModules = ['all'] 10 | 11 | coremod = null 12 | miniVersion = null 13 | 14 | language = 'java' 15 | 16 | forge = project.forgeVersion 17 | mappings = project.mcpVersion 18 | 19 | enforceLicenseHeaders = false 20 | 21 | verbose = true 22 | } 23 | 24 | if (!ext.early) { 25 | repositories { 26 | maven { 27 | // Primary JEI Maven 28 | name = "Progwml6 maven" 29 | url = "http://dvs1.progwml6.com/files/maven" 30 | } 31 | maven { 32 | // Fallback JEI Maven 33 | name = "ModMaven" 34 | url = "modmaven.k-4u.nl" 35 | } 36 | maven { 37 | // MCMP Maven 38 | url "http://maven.amadornes.com/" 39 | } 40 | maven { 41 | // CraftTweaker2 Maven 42 | name "Jared" 43 | url "http://maven.blamejared.com/" 44 | } 45 | } 46 | 47 | dependencies { 48 | // Probedata 49 | deobfCompile "com.elytradev:probedataproviderapi:${pdp_version}" 50 | testCompile group: "junit", name: "junit", version: "4.12" 51 | 52 | // JEI 53 | deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api" 54 | runtime "mezz.jei:jei_${mc_version}:${jei_version}" 55 | 56 | // MCMP 57 | deobfCompile "MCMultiPart2:MCMultiPart-exp:${mcmp_version}" 58 | 59 | // CraftTweaker 60 | compile "CraftTweaker2:CraftTweaker2-MC1120-Main:${ct_version}" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/item/ItemBlueprint.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.item; 2 | 3 | import com.elytradev.teckle.common.TeckleObjects; 4 | import com.elytradev.teckle.common.util.BlueprintUtil; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.resources.I18n; 7 | import net.minecraft.client.util.ITooltipFlag; 8 | import net.minecraft.item.Item; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.item.crafting.IRecipe; 11 | import net.minecraft.world.World; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | import net.minecraftforge.fml.relauncher.SideOnly; 14 | 15 | import javax.annotation.Nullable; 16 | import java.util.List; 17 | 18 | public class ItemBlueprint extends Item { 19 | public ItemBlueprint() { 20 | setMaxStackSize(1); 21 | setCreativeTab(TeckleObjects.creativeTab); 22 | } 23 | 24 | @Override 25 | @SideOnly(Side.CLIENT) 26 | public String getItemStackDisplayName(ItemStack stack) { 27 | ItemStack out = BlueprintUtil.getRecipeFromBlueprint(stack, Minecraft.getMinecraft().world) 28 | .map(IRecipe::getRecipeOutput).orElse(ItemStack.EMPTY); 29 | if (out.isEmpty()) 30 | return I18n.format("item.teckle.blueprint.empty.name"); 31 | if (out.getItem() == TeckleObjects.itemBlueprint) 32 | return super.getItemStackDisplayName(stack) + " (" + super.getItemStackDisplayName(out) + ")"; 33 | return super.getItemStackDisplayName(stack) + " (" + out.getDisplayName() + ")"; 34 | } 35 | 36 | @Override 37 | public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { 38 | super.addInformation(stack, worldIn, tooltip, flagIn); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/tube.item_leg_inside.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "0": "teckle:blocks/itemtube.full" 5 | }, 6 | "elements": [ 7 | { 8 | "from": [ 9 | 4, 10 | 8, 11 | 12 12 | ], 13 | "to": [ 14 | 12, 15 | 16, 16 | 12 17 | ], 18 | "faces": { 19 | "north": { 20 | "texture": "#0" 21 | } 22 | } 23 | }, 24 | { 25 | "from": [ 26 | 4, 27 | 8, 28 | 4 29 | ], 30 | "to": [ 31 | 12, 32 | 16, 33 | 4 34 | ], 35 | "faces": { 36 | "south": { 37 | "texture": "#0" 38 | } 39 | } 40 | }, 41 | { 42 | "from": [ 43 | 4, 44 | 8, 45 | 4 46 | ], 47 | "to": [ 48 | 4, 49 | 16, 50 | 12 51 | ], 52 | "faces": { 53 | "east": { 54 | "texture": "#0" 55 | } 56 | } 57 | }, 58 | { 59 | "from": [ 60 | 12, 61 | 8, 62 | 4 63 | ], 64 | "to": [ 65 | 12, 66 | 16, 67 | 12 68 | ], 69 | "faces": { 70 | "west": { 71 | "texture": "#0" 72 | } 73 | } 74 | } 75 | ] 76 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/SortingMachineDefaultRouteChangeMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.serverbound; 2 | 3 | import com.elytradev.concrete.network.NetworkContext; 4 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 5 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | 12 | /** 13 | * Handles any change of the default route colour for the sorting machine on the server. 14 | */ 15 | @ReceivedOn(Side.SERVER) 16 | public class SortingMachineDefaultRouteChangeMessage extends TeckleMessage { 17 | 18 | @MarshalledAs("i8") 19 | public int routeMetadata; 20 | public BlockPos sortingMachinePos; 21 | 22 | public SortingMachineDefaultRouteChangeMessage(NetworkContext ctx) { 23 | } 24 | 25 | public SortingMachineDefaultRouteChangeMessage(int routeMetadata, BlockPos sortingMachinePos) { 26 | this.routeMetadata = routeMetadata; 27 | this.sortingMachinePos = sortingMachinePos; 28 | } 29 | 30 | @Override 31 | protected void handle(EntityPlayer sender) { 32 | if (sender != null && sender.world != null) { 33 | TileSortingMachine sortingMachine = (TileSortingMachine) sender.world.getTileEntity(sortingMachinePos); 34 | if (!sortingMachine.isUsableByPlayer(sender)) 35 | return; 36 | 37 | sortingMachine.defaultRoute = TileSortingMachine.DefaultRoute.byMetadata(routeMetadata); 38 | sortingMachine.markDirty(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/machineoverlay.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "textures": { 4 | "side": "" 5 | }, 6 | "elements": [ 7 | { 8 | "from": [ 9 | -0.008, 10 | -0.008, 11 | -0.008 12 | ], 13 | "to": [ 14 | 16.008, 15 | 16.008, 16 | 16.008 17 | ], 18 | "faces": { 19 | "north": { 20 | "texture": "#side", 21 | "uv": [ 22 | 0.0, 23 | 0.0, 24 | 16.0, 25 | 16.0 26 | ], 27 | "rotation": 180 28 | }, 29 | "east": { 30 | "texture": "#side", 31 | "uv": [ 32 | 0.0, 33 | 0.0, 34 | 16.0, 35 | 16.0 36 | ], 37 | "rotation": 180 38 | }, 39 | "south": { 40 | "texture": "#side", 41 | "uv": [ 42 | 0.0, 43 | 0.0, 44 | 16.0, 45 | 16.0 46 | ], 47 | "rotation": 180 48 | }, 49 | "west": { 50 | "texture": "#side", 51 | "uv": [ 52 | 0.0, 53 | 0.0, 54 | 16.0, 55 | 16.0 56 | ], 57 | "rotation": 180 58 | } 59 | } 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/tube.item_leg.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "0": "teckle:blocks/itemtube.full", 5 | "1": "teckle:blocks/itemtube.full.colour" 6 | }, 7 | "elements": [ 8 | { 9 | "name": "Walls", 10 | "from": [ 11 | 4.0, 12 | 8.0, 13 | 4.0 14 | ], 15 | "to": [ 16 | 12.0, 17 | 16.0, 18 | 12.0 19 | ], 20 | "faces": { 21 | "west": { 22 | "texture": "#0" 23 | }, 24 | "east": { 25 | "texture": "#0" 26 | }, 27 | "north": { 28 | "texture": "#0" 29 | }, 30 | "south": { 31 | "texture": "#0" 32 | } 33 | } 34 | }, 35 | { 36 | "name": "Colour", 37 | "from": [ 38 | 4.0, 39 | 8.0, 40 | 4.0 41 | ], 42 | "to": [ 43 | 12.0, 44 | 16.0, 45 | 12.0 46 | ], 47 | "faces": { 48 | "west": { 49 | "texture": "#1", 50 | "tintindex": 1 51 | }, 52 | "east": { 53 | "texture": "#1", 54 | "tintindex": 1 55 | }, 56 | "north": { 57 | "texture": "#1", 58 | "tintindex": 1 59 | }, 60 | "south": { 61 | "texture": "#1", 62 | "tintindex": 1 63 | } 64 | } 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/tube.item_leg_node.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "0": "teckle:blocks/itemtube.full", 6 | "1": "teckle:blocks/itemtube.full.colour", 7 | "particle": "teckle:blocks/itemtube.full" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 12 | 4, 13 | 13, 14 | 4 15 | ], 16 | "to": [ 17 | 12, 18 | 16, 19 | 12 20 | ], 21 | "faces": { 22 | "west": { 23 | "texture": "#0" 24 | }, 25 | "east": { 26 | "texture": "#0" 27 | }, 28 | "north": { 29 | "texture": "#0" 30 | }, 31 | "south": { 32 | "texture": "#0" 33 | } 34 | } 35 | }, 36 | { 37 | "from": [ 38 | 4, 39 | 13, 40 | 4 41 | ], 42 | "to": [ 43 | 12, 44 | 16, 45 | 12 46 | ], 47 | "faces": { 48 | "west": { 49 | "texture": "#1", 50 | "tintindex": 1 51 | }, 52 | "east": { 53 | "texture": "#1", 54 | "tintindex": 1 55 | }, 56 | "north": { 57 | "texture": "#1", 58 | "tintindex": 1 59 | }, 60 | "south": { 61 | "texture": "#1", 62 | "tintindex": 1 63 | } 64 | } 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/render/tile/TileNetworkMemberRenderer.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.client.render.tile; 2 | 3 | import com.elytradev.teckle.client.render.model.ModelMachineOverlay; 4 | import com.elytradev.teckle.common.TeckleObjects; 5 | import com.elytradev.teckle.common.block.BlockSortingMachine; 6 | import com.elytradev.teckle.common.tile.base.TileNetworkMember; 7 | import net.minecraft.block.properties.PropertyDirection; 8 | import net.minecraft.block.state.IBlockState; 9 | import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; 10 | import net.minecraft.util.EnumFacing; 11 | import net.minecraft.util.math.Vec3d; 12 | 13 | public class TileNetworkMemberRenderer extends TileEntitySpecialRenderer { 14 | 15 | protected PropertyDirection facingProp; 16 | protected String lightTexture; 17 | private ModelMachineOverlay errorLightOverlay; 18 | 19 | public TileNetworkMemberRenderer(PropertyDirection facingProp, String lightTexture) { 20 | this.facingProp = facingProp; 21 | this.lightTexture = lightTexture; 22 | } 23 | 24 | @Override 25 | public void render(TileNetworkMember te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { 26 | if (te.isJammed()) { 27 | IBlockState blockState = te.getWorld().getBlockState(te.getPos()); 28 | if (blockState.getBlock() != TeckleObjects.blockSortingMachine) 29 | return; 30 | 31 | EnumFacing pointTo = blockState.getValue(BlockSortingMachine.FACING); 32 | if (errorLightOverlay == null) { 33 | errorLightOverlay = new ModelMachineOverlay(this.getClass(), lightTexture, true); 34 | } 35 | 36 | errorLightOverlay.render(getWorld(), new Vec3d(x, y, z), te.getPos(), blockState, pointTo); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/tube.item_leg_node_inside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "0": "teckle:blocks/itemtube.full", 6 | "particle": "teckle:blocks/itemtube.full" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [ 11 | 4, 12 | 13, 13 | 12 14 | ], 15 | "to": [ 16 | 12, 17 | 16, 18 | 12 19 | ], 20 | "faces": { 21 | "north": { 22 | "texture": "#0" 23 | } 24 | } 25 | }, 26 | { 27 | "from": [ 28 | 4, 29 | 13, 30 | 4 31 | ], 32 | "to": [ 33 | 12, 34 | 16, 35 | 4 36 | ], 37 | "faces": { 38 | "south": { 39 | "texture": "#0" 40 | } 41 | } 42 | }, 43 | { 44 | "from": [ 45 | 4, 46 | 13, 47 | 4 48 | ], 49 | "to": [ 50 | 4, 51 | 16, 52 | 12 53 | ], 54 | "faces": { 55 | "east": { 56 | "texture": "#0" 57 | } 58 | } 59 | }, 60 | { 61 | "from": [ 62 | 12, 63 | 13, 64 | 4 65 | ], 66 | "to": [ 67 | 12, 68 | 16, 69 | 12 70 | ], 71 | "faces": { 72 | "west": { 73 | "texture": "#0" 74 | } 75 | } 76 | } 77 | ] 78 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/api/capabilities/IWorldNetworkAssistantHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.api.capabilities; 18 | 19 | import net.minecraftforge.common.util.INBTSerializable; 20 | 21 | import javax.annotation.Nonnull; 22 | import javax.annotation.Nullable; 23 | 24 | /** 25 | * Holds world network assistants for different types. 26 | */ 27 | public interface IWorldNetworkAssistantHolder { 28 | 29 | /** 30 | * Get an assistant for the given type, default types are ItemStack 31 | * 32 | * @param type the type of assistant. 33 | * @return the assistant matching the given type. 34 | */ 35 | @Nullable 36 | IWorldNetworkAssistant getAssistant(@Nonnull Class type); 37 | 38 | /** 39 | * Add an assistant for the given type. 40 | * 41 | * @param type the type to add. 42 | * @param assistant the assistant for that type. 43 | * @return the already existing assistant if one is present, or the given assistant if its the only one matching. 44 | */ 45 | @Nonnull 46 | IWorldNetworkAssistant addAssistant(@Nonnull Class type, @Nonnull IWorldNetworkAssistant assistant); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/ToggleQuarryMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.serverbound; 2 | 3 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 4 | import com.elytradev.teckle.common.TeckleMod; 5 | import com.elytradev.teckle.common.block.BlockBeamQuarry; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import com.elytradev.teckle.common.tile.TileBeamQuarry; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.util.math.ChunkPos; 11 | import net.minecraft.world.World; 12 | import net.minecraftforge.common.ForgeChunkManager; 13 | import net.minecraftforge.fml.relauncher.Side; 14 | 15 | @ReceivedOn(Side.SERVER) 16 | public class ToggleQuarryMessage extends TeckleMessage { 17 | 18 | public BlockPos quarryPos; 19 | public boolean activateQuarry; 20 | 21 | public ToggleQuarryMessage() { 22 | } 23 | 24 | public ToggleQuarryMessage(BlockPos quarryPos, boolean activateQuarry) { 25 | this.quarryPos = quarryPos; 26 | this.activateQuarry = activateQuarry; 27 | } 28 | 29 | @Override 30 | protected void handle(EntityPlayer player) { 31 | if (player == null) 32 | return; 33 | World world = player.world; 34 | if (world.getTileEntity(quarryPos) instanceof TileBeamQuarry) { 35 | TileBeamQuarry beamQuarry = (TileBeamQuarry) world.getTileEntity(quarryPos); 36 | if (beamQuarry.isUsableByPlayer(player)) { 37 | world.setBlockState(quarryPos, world.getBlockState(quarryPos).withProperty(BlockBeamQuarry.ACTIVE, activateQuarry)); 38 | ForgeChunkManager.Ticket ticket = ForgeChunkManager.requestTicket(TeckleMod.INSTANCE, world, ForgeChunkManager.Type.NORMAL); 39 | for (ChunkPos chunkPos : beamQuarry.chunksInBounds()) { 40 | ForgeChunkManager.forceChunk(ticket, chunkPos); 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/pathing/EndpointData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldnetwork.common.pathing; 18 | 19 | import net.minecraft.util.EnumFacing; 20 | import net.minecraft.util.math.BlockPos; 21 | 22 | import java.util.Objects; 23 | 24 | /** 25 | * Stores an endpoint position as well as the side that endpoint is being injected to. 26 | */ 27 | public class EndpointData { 28 | public EnumFacing side; 29 | public BlockPos pos; 30 | public PathNode node; 31 | public int cost; 32 | 33 | public EndpointData(PathNode node, EnumFacing side) { 34 | this.side = side; 35 | this.node = node; 36 | 37 | this.cost = node.cost; 38 | this.pos = node.realNode.getPosition(); 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return "EndpointData{" + 44 | "side=" + side + 45 | ", pos=" + pos + 46 | ", cost=" + cost + 47 | ", node=" + node + 48 | '}'; 49 | } 50 | 51 | @Override 52 | public boolean equals(Object o) { 53 | if (this == o) return true; 54 | if (o == null || getClass() != o.getClass()) return false; 55 | EndpointData that = (EndpointData) o; 56 | return side == that.side && 57 | Objects.equals(pos, that.pos); 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/inv/ItemStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.tile.inv; 18 | 19 | import net.minecraft.inventory.IInventory; 20 | import net.minecraft.item.ItemStack; 21 | import net.minecraft.util.NonNullList; 22 | import net.minecraftforge.items.IItemHandler; 23 | 24 | import java.util.List; 25 | import java.util.concurrent.atomic.AtomicInteger; 26 | import java.util.stream.Stream; 27 | 28 | /** 29 | * Created by darkevilmac on 5/4/17. 30 | */ 31 | public class ItemStream { 32 | 33 | public static Stream createItemStream(IItemHandler handler) { 34 | AtomicInteger i = new AtomicInteger(0); 35 | return Stream.generate(() -> handler.getStackInSlot(i.getAndIncrement())).limit(handler.getSlots()); 36 | } 37 | 38 | public static Stream createItemStream(IInventory inv) { 39 | AtomicInteger i = new AtomicInteger(0); 40 | return Stream.generate(() -> inv.getStackInSlot(i.getAndIncrement())).limit(inv.getSizeInventory()); 41 | } 42 | 43 | public static NonNullList convertCollectedListToNonNull(List stacks) { 44 | NonNullList result = NonNullList.withSize(stacks.size(), ItemStack.EMPTY); 45 | for (int i = 0; i < stacks.size(); i++) { 46 | result.set(i, stacks.get(i)); 47 | } 48 | 49 | return result; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/BlockPosListMarshaller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network; 18 | 19 | import com.elytradev.concrete.network.Marshaller; 20 | import io.netty.buffer.ByteBuf; 21 | import net.minecraft.util.math.BlockPos; 22 | import net.minecraftforge.fml.common.network.ByteBufUtils; 23 | 24 | import java.util.ArrayList; 25 | 26 | /** 27 | * Simple block position list marshaller, holding onto this in case it comes in handy. 28 | */ 29 | public class BlockPosListMarshaller implements Marshaller> { 30 | 31 | public static final String MARSHALLER_NAME = "com.elytradev.teckle.common.network.BlockPosListMarshaller"; 32 | public static final BlockPosListMarshaller INSTANCE = new BlockPosListMarshaller(); 33 | 34 | @Override 35 | public ArrayList unmarshal(ByteBuf in) { 36 | ArrayList out = new ArrayList<>(); 37 | int size = ByteBufUtils.readVarInt(in, 3); 38 | 39 | for (int i = 0; i < size; i++) { 40 | out.add(BlockPos.fromLong(in.readLong())); 41 | } 42 | 43 | return out; 44 | } 45 | 46 | @Override 47 | public void marshal(ByteBuf out, ArrayList blockPoss) { 48 | ByteBufUtils.writeVarInt(out, blockPoss.size(), 3); 49 | 50 | for (BlockPos blockPos : blockPoss) { 51 | out.writeLong(blockPos.toLong()); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/ChangeQuarryBoundsMessage.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.network.messages.serverbound; 2 | 3 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 4 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 5 | import com.elytradev.teckle.common.TeckleLog; 6 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 7 | import com.elytradev.teckle.common.network.messages.clientbound.TileUpdateMessage; 8 | import com.elytradev.teckle.common.tile.TileBeamQuarry; 9 | import net.minecraft.entity.player.EntityPlayer; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | 14 | import java.util.stream.Stream; 15 | 16 | @ReceivedOn(Side.SERVER) 17 | public class ChangeQuarryBoundsMessage extends TeckleMessage { 18 | 19 | public BlockPos quarryPos; 20 | @MarshalledAs("int") 21 | public int left, right, forward; 22 | 23 | public ChangeQuarryBoundsMessage() { 24 | } 25 | 26 | public ChangeQuarryBoundsMessage(BlockPos quarryPos, int length, int width, int depth) { 27 | this.quarryPos = quarryPos; 28 | this.left = length; 29 | this.right = width; 30 | this.forward = depth; 31 | } 32 | 33 | @Override 34 | protected void handle(EntityPlayer player) { 35 | if (player == null) 36 | return; 37 | 38 | if (Stream.of(left, right, forward).anyMatch(i -> i > 64 || i < 1)) { 39 | if (player != null && player.getGameProfile() != null) 40 | TeckleLog.warn("{} tried to set a quarry size greater than 64.", player.getGameProfile().toString()); 41 | } 42 | 43 | World world = player.world; 44 | if (world != null && world.getTileEntity(quarryPos) instanceof TileBeamQuarry) { 45 | TileBeamQuarry quarry = (TileBeamQuarry) world.getTileEntity(quarryPos); 46 | quarry.setDimensions(left, right, forward); 47 | new TileUpdateMessage(world, quarryPos).sendToAllWatching(quarry); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/IBlockUpdateListener.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.util.SoundCategory; 6 | import net.minecraft.util.SoundEvent; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.IWorldEventListener; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | /** 13 | * A version of IWorldEventListener that defaults all methods besides notifyBlockUpdate, used for lambdas. 14 | */ 15 | public interface IBlockUpdateListener extends IWorldEventListener { 16 | 17 | @Override 18 | default void notifyLightSet(BlockPos pos) { 19 | 20 | } 21 | 22 | @Override 23 | default void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) { 24 | 25 | } 26 | 27 | @Override 28 | default void playSoundToAllNearExcept(@Nullable EntityPlayer player, SoundEvent soundIn, SoundCategory category, double x, double y, double z, float volume, float pitch) { 29 | 30 | } 31 | 32 | @Override 33 | default void playRecord(SoundEvent soundIn, BlockPos pos) { 34 | 35 | } 36 | 37 | @Override 38 | default void spawnParticle(int particleID, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) { 39 | 40 | } 41 | 42 | @Override 43 | default void spawnParticle(int id, boolean ignoreRange, boolean p_190570_3_, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, int... parameters) { 44 | 45 | } 46 | 47 | @Override 48 | default void onEntityAdded(Entity entityIn) { 49 | 50 | } 51 | 52 | @Override 53 | default void onEntityRemoved(Entity entityIn) { 54 | 55 | } 56 | 57 | @Override 58 | default void broadcastSound(int soundID, BlockPos pos, int data) { 59 | 60 | } 61 | 62 | @Override 63 | default void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) { 64 | 65 | } 66 | 67 | @Override 68 | default void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) { 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/gui/base/GuiTeckleButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.client.gui.base; 18 | 19 | import net.minecraft.client.Minecraft; 20 | import net.minecraft.client.gui.GuiButton; 21 | 22 | public abstract class GuiTeckleButton extends GuiButton { 23 | 24 | private boolean acceptsSecondaryClick = false; 25 | 26 | public GuiTeckleButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText) { 27 | super(buttonId, x, y, widthIn, heightIn, buttonText); 28 | } 29 | 30 | public GuiTeckleButton(int buttonId, int x, int y, String buttonText) { 31 | super(buttonId, x, y, buttonText); 32 | } 33 | 34 | public void drawHover(Minecraft mc, int mouseX, int mouseY) { 35 | } 36 | 37 | public void performAction(int mouseX, int mouseY, int mouseButton) { 38 | } 39 | 40 | public boolean acceptsSecondaryClick() { 41 | return acceptsSecondaryClick; 42 | } 43 | 44 | public GuiTeckleButton enableSecondaryClick() { 45 | this.acceptsSecondaryClick = true; 46 | return this; 47 | } 48 | 49 | public GuiTeckleButton disableSecondaryClick() { 50 | this.acceptsSecondaryClick = false; 51 | return this; 52 | } 53 | 54 | 55 | public void checkHovered(int mouseX, int mouseY) { 56 | this.hovered = mouseX >= this.x 57 | && mouseY >= this.y 58 | && mouseX < this.x + this.width 59 | && mouseY < this.y + this.height; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/block/BlockNikoliteOre.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.block; 18 | 19 | import com.elytradev.teckle.common.TeckleObjects; 20 | import net.minecraft.block.BlockOre; 21 | import net.minecraft.block.SoundType; 22 | import net.minecraft.block.state.IBlockState; 23 | import net.minecraft.item.Item; 24 | import net.minecraft.item.ItemStack; 25 | import net.minecraft.util.math.BlockPos; 26 | 27 | import java.util.Random; 28 | 29 | /** 30 | * Created by darkevilmac on 4/20/2017. 31 | */ 32 | public class BlockNikoliteOre extends BlockOre { 33 | public BlockNikoliteOre() { 34 | super(); 35 | this.setHardness(3.0F); 36 | this.setResistance(5.0F); 37 | this.setSoundType(SoundType.STONE); 38 | this.setHarvestLevel("pickaxe", 2); 39 | } 40 | 41 | @Override 42 | public Item getItemDropped(IBlockState state, Random rand, int fortune) { 43 | return TeckleObjects.itemNikolite; 44 | } 45 | 46 | @Override 47 | public int quantityDropped(Random random) { 48 | return 4; 49 | } 50 | 51 | @Override 52 | protected ItemStack getSilkTouchDrop(IBlockState state) { 53 | return new ItemStack(TeckleObjects.blockNikoliteOre); 54 | } 55 | 56 | @Override 57 | public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) { 58 | if (this.getItemDropped(state, RANDOM, fortune) != Item.getItemFromBlock(this)) { 59 | return 1 + RANDOM.nextInt(5); 60 | } 61 | return 0; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/assets/teckle/models/block/tube.item_node.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "0": "teckle:blocks/itemtube.node", 6 | "1": "teckle:blocks/itemtube.node.colour", 7 | "particle": "teckle:blocks/itemtube.node" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 12 | 3, 13 | 3, 14 | 3 15 | ], 16 | "to": [ 17 | 13, 18 | 13, 19 | 13 20 | ], 21 | "faces": { 22 | "up": { 23 | "texture": "#0" 24 | }, 25 | "down": { 26 | "texture": "#0" 27 | }, 28 | "west": { 29 | "texture": "#0" 30 | }, 31 | "east": { 32 | "texture": "#0" 33 | }, 34 | "north": { 35 | "texture": "#0" 36 | }, 37 | "south": { 38 | "texture": "#0" 39 | } 40 | } 41 | }, 42 | { 43 | "from": [ 44 | 3, 45 | 3, 46 | 3 47 | ], 48 | "to": [ 49 | 13, 50 | 13, 51 | 13 52 | ], 53 | "faces": { 54 | "up": { 55 | "texture": "#1", 56 | "tintindex": 1 57 | }, 58 | "down": { 59 | "texture": "#1", 60 | "tintindex": 1 61 | }, 62 | "west": { 63 | "texture": "#1", 64 | "tintindex": 1 65 | }, 66 | "east": { 67 | "texture": "#1", 68 | "tintindex": 1 69 | }, 70 | "north": { 71 | "texture": "#1", 72 | "tintindex": 1 73 | }, 74 | "south": { 75 | "texture": "#1", 76 | "tintindex": 1 77 | } 78 | } 79 | } 80 | ] 81 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/FilterColourChangeMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.serverbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 23 | import com.elytradev.teckle.common.tile.TileFilter; 24 | import net.minecraft.entity.player.EntityPlayer; 25 | import net.minecraft.item.EnumDyeColor; 26 | import net.minecraft.util.math.BlockPos; 27 | import net.minecraftforge.fml.relauncher.Side; 28 | 29 | /** 30 | * Changes the colour on a filter. 31 | */ 32 | @ReceivedOn(Side.SERVER) 33 | public class FilterColourChangeMessage extends TeckleMessage { 34 | 35 | public BlockPos filterPos; 36 | @MarshalledAs("i8") 37 | public int colour; 38 | 39 | public FilterColourChangeMessage(NetworkContext ctx) { 40 | } 41 | 42 | public FilterColourChangeMessage(BlockPos filterPos, EnumDyeColor colour) { 43 | this.filterPos = filterPos; 44 | this.colour = colour == null ? -1 : colour.getMetadata(); 45 | } 46 | 47 | @Override 48 | protected void handle(EntityPlayer sender) { 49 | if (sender != null && sender.world != null) { 50 | TileFilter filter = (TileFilter) sender.world.getTileEntity(filterPos); 51 | if (!filter.isUsableByPlayer(sender)) 52 | return; 53 | filter.colour = this.colour == -1 ? null : EnumDyeColor.byMetadata(this.colour); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/block/property/UnlistedEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.block.property; 18 | 19 | import com.google.common.collect.ImmutableSet; 20 | import com.google.common.collect.Maps; 21 | import net.minecraft.util.IStringSerializable; 22 | import net.minecraftforge.common.property.IUnlistedProperty; 23 | 24 | import java.util.Map; 25 | 26 | /** 27 | * Created by darkevilmac on 4/5/2017. 28 | */ 29 | public class UnlistedEnum & IStringSerializable> implements IUnlistedProperty { 30 | private final ImmutableSet allowedValues; 31 | private String name; 32 | private Class valueClass; 33 | 34 | public UnlistedEnum(String name, Class valueClass) { 35 | this.name = name; 36 | this.valueClass = valueClass; 37 | this.allowedValues = ImmutableSet.copyOf(valueClass.getEnumConstants()); 38 | 39 | for (T t : allowedValues) { 40 | String s = t.getName(); 41 | 42 | Map nameToValue = Maps.newHashMap(); 43 | if (nameToValue.containsKey(s)) { 44 | throw new IllegalArgumentException("Multiple values have the same key \'" + s + "\'"); 45 | } 46 | 47 | nameToValue.put(s, t); 48 | } 49 | } 50 | 51 | @Override 52 | public String getName() { 53 | return name; 54 | } 55 | 56 | @Override 57 | public boolean isValid(T value) { 58 | return value == null || allowedValues.contains(value); 59 | } 60 | 61 | @Override 62 | public Class getType() { 63 | return this.valueClass; 64 | } 65 | 66 | @Override 67 | public String valueToString(T value) { 68 | return value.toString(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/sortingmachine/modes/pullmode/PullModeAuto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.tile.sortingmachine.modes.pullmode; 18 | 19 | import com.elytradev.teckle.common.TeckleMod; 20 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 21 | import net.minecraft.nbt.NBTBase; 22 | import net.minecraft.nbt.NBTTagCompound; 23 | 24 | public class PullModeAuto extends PullMode { 25 | public int coolDown = 6; 26 | 27 | public PullModeAuto() { 28 | super(2, 208, 58, "pullmode.auto"); 29 | } 30 | 31 | @Override 32 | public void onPulse(TileSortingMachine sortingMachine) { 33 | //NOOP 34 | } 35 | 36 | @Override 37 | public void onTick(TileSortingMachine sortingMachine) { 38 | if (isPaused()) { 39 | return; 40 | } 41 | 42 | if (coolDown > 0) 43 | coolDown--; 44 | 45 | if (coolDown <= 0) { 46 | sortingMachine.getSortMode().pulse(sortingMachine, this); 47 | 48 | coolDown = TeckleMod.CONFIG.sortingMachineCooldown; 49 | } 50 | } 51 | 52 | @Override 53 | public NBTBase serializeNBT() { 54 | NBTTagCompound tagCompound = new NBTTagCompound(); 55 | tagCompound.setInteger("cooldown", coolDown); 56 | tagCompound.setBoolean("isPaused", isPaused()); 57 | 58 | return tagCompound; 59 | } 60 | 61 | @Override 62 | public void deserializeNBT(NBTBase nbt) { 63 | NBTTagCompound tagCompound = (NBTTagCompound) nbt; 64 | this.coolDown = tagCompound.getInteger("cooldown"); 65 | 66 | if (tagCompound.getBoolean("isPaused")) { 67 | pause(); 68 | } else { 69 | unpause(); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/handlers/TeckleGuiHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.handlers; 18 | 19 | import com.elytradev.teckle.common.tile.base.IElementProvider; 20 | import net.minecraft.entity.player.EntityPlayer; 21 | import net.minecraft.tileentity.TileEntity; 22 | import net.minecraft.util.math.BlockPos; 23 | import net.minecraft.world.World; 24 | import net.minecraftforge.fml.common.network.IGuiHandler; 25 | 26 | public class TeckleGuiHandler implements IGuiHandler { 27 | @Override 28 | public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { 29 | BlockPos pos = new BlockPos(x, y, z); 30 | TileEntity te; 31 | if (ID == ElementType.ELEMENT_PROVIDER.caseNumber) { 32 | te = world.getTileEntity(pos); 33 | if (te instanceof IElementProvider) { 34 | return ((IElementProvider) te).getServerElement(player); 35 | } 36 | } 37 | 38 | return null; 39 | } 40 | 41 | @Override 42 | public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { 43 | BlockPos pos = new BlockPos(x, y, z); 44 | TileEntity te; 45 | if (ID == ElementType.ELEMENT_PROVIDER.caseNumber) { 46 | te = world.getTileEntity(pos); 47 | if (te instanceof IElementProvider) { 48 | return ((IElementProvider) te).getClientElement(player); 49 | } 50 | } 51 | 52 | return null; 53 | } 54 | 55 | public enum ElementType { 56 | ELEMENT_PROVIDER(0); 57 | 58 | public final int caseNumber; 59 | 60 | ElementType(int caseNumber) { 61 | this.caseNumber = caseNumber; 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/AlloyFurnaceMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.clientbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 23 | import com.elytradev.teckle.common.tile.TileAlloyFurnace; 24 | import net.minecraft.entity.player.EntityPlayer; 25 | import net.minecraft.util.math.BlockPos; 26 | import net.minecraftforge.fml.relauncher.Side; 27 | 28 | /** 29 | * Used to set misc fields on the alloy furnace for clients. 30 | */ 31 | @ReceivedOn(Side.CLIENT) 32 | public class AlloyFurnaceMessage extends TeckleMessage { 33 | 34 | public BlockPos furnacePos; 35 | @MarshalledAs("int") 36 | public int cookTime, fuelBurnTime, currentFuelWorth; 37 | 38 | public AlloyFurnaceMessage(NetworkContext ctx) { 39 | } 40 | 41 | public AlloyFurnaceMessage(TileAlloyFurnace alloyFurnace) { 42 | this.furnacePos = alloyFurnace.getPos(); 43 | this.cookTime = alloyFurnace.cookTime; 44 | this.fuelBurnTime = alloyFurnace.fuelBurnTime; 45 | this.currentFuelWorth = alloyFurnace.currentFuelWorth; 46 | } 47 | 48 | @Override 49 | protected void handle(EntityPlayer sender) { 50 | if (sender.world != null && sender.world.getTileEntity(furnacePos) instanceof TileAlloyFurnace) { 51 | TileAlloyFurnace alloyFurnace = (TileAlloyFurnace) sender.world.getTileEntity(furnacePos); 52 | 53 | alloyFurnace.fuelBurnTime = this.fuelBurnTime; 54 | alloyFurnace.cookTime = this.cookTime; 55 | alloyFurnace.currentFuelWorth = this.currentFuelWorth; 56 | } 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/SortingMachineColourChangeMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.serverbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 23 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 24 | import net.minecraft.entity.player.EntityPlayer; 25 | import net.minecraft.item.EnumDyeColor; 26 | import net.minecraft.util.math.BlockPos; 27 | import net.minecraftforge.fml.relauncher.Side; 28 | 29 | /** 30 | * Created by darkevilmac on 5/22/17. 31 | */ 32 | @ReceivedOn(Side.SERVER) 33 | public class SortingMachineColourChangeMessage extends TeckleMessage { 34 | 35 | public BlockPos pos; 36 | @MarshalledAs("i8") 37 | public int colourIndex; 38 | @MarshalledAs("i8") 39 | public int colour; 40 | 41 | public SortingMachineColourChangeMessage(NetworkContext ctx) { 42 | } 43 | 44 | public SortingMachineColourChangeMessage(BlockPos pos, int colourIndex, EnumDyeColor colour) { 45 | this.pos = pos; 46 | this.colourIndex = colourIndex; 47 | this.colour = colour == null ? -1 : colour.getMetadata(); 48 | } 49 | 50 | @Override 51 | protected void handle(EntityPlayer sender) { 52 | if (sender != null && sender.world != null) { 53 | TileSortingMachine sortingMachine = (TileSortingMachine) sender.world.getTileEntity(pos); 54 | if (!sortingMachine.isUsableByPlayer(sender)) 55 | return; 56 | sortingMachine.colours[colourIndex] = this.colour == -1 ? null : EnumDyeColor.byMetadata(this.colour); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/FabricatorTemplateMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.serverbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 23 | import com.elytradev.teckle.common.tile.TileFabricator; 24 | import net.minecraft.entity.player.EntityPlayer; 25 | import net.minecraft.item.ItemStack; 26 | import net.minecraft.util.math.BlockPos; 27 | import net.minecraftforge.fml.relauncher.Side; 28 | 29 | /** 30 | * Sent by clients to the server to set the fake slots for the fabricator. 31 | */ 32 | @ReceivedOn(Side.SERVER) 33 | public class FabricatorTemplateMessage extends TeckleMessage { 34 | 35 | public BlockPos fabricatorPos; 36 | @MarshalledAs("i8") 37 | public int templateIndex; 38 | public ItemStack stack; 39 | 40 | public FabricatorTemplateMessage(NetworkContext ctx) { 41 | } 42 | 43 | public FabricatorTemplateMessage(BlockPos fabricatorPos, ItemStack stack, int templateIndex) { 44 | this.fabricatorPos = fabricatorPos; 45 | this.stack = stack; 46 | this.templateIndex = templateIndex; 47 | } 48 | 49 | @Override 50 | protected void handle(EntityPlayer sender) { 51 | if (sender != null && sender.world != null) { 52 | sender.getServer().addScheduledTask(() -> { 53 | TileFabricator fabricator = (TileFabricator) sender.world.getTileEntity(fabricatorPos); 54 | if (!fabricator.isUsableByPlayer(sender)) 55 | return; 56 | fabricator.setTemplateSlot(templateIndex, stack); 57 | fabricator.markDirty(); 58 | }); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/sortingmachine/modes/pullmode/PullModeSingleStep.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.tile.sortingmachine.modes.pullmode; 18 | 19 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 20 | import net.minecraft.nbt.NBTBase; 21 | import net.minecraft.nbt.NBTTagCompound; 22 | 23 | public class PullModeSingleStep extends PullMode { 24 | public int pulses; 25 | public int coolDown = 4; 26 | 27 | public PullModeSingleStep() { 28 | super(0, 208, 26, "pullmode.singlestep"); 29 | } 30 | 31 | @Override 32 | public void onPulse(TileSortingMachine sortingMachine) { 33 | pulses++; 34 | } 35 | 36 | @Override 37 | public void onTick(TileSortingMachine sortingMachine) { 38 | if (isPaused()) 39 | return; 40 | 41 | if (pulses > 0) { 42 | if (coolDown <= 0) { 43 | sortingMachine.getSortMode().pulse(sortingMachine, this); 44 | pulses--; 45 | coolDown = 4; 46 | } 47 | 48 | if (coolDown > 0) 49 | coolDown--; 50 | } 51 | } 52 | 53 | @Override 54 | public NBTBase serializeNBT() { 55 | NBTTagCompound tagCompound = new NBTTagCompound(); 56 | tagCompound.setInteger("pulses", pulses); 57 | tagCompound.setInteger("cooldown", coolDown); 58 | tagCompound.setBoolean("isPaused", isPaused()); 59 | 60 | return tagCompound; 61 | } 62 | 63 | @Override 64 | public void deserializeNBT(NBTBase nbt) { 65 | NBTTagCompound tagCompound = (NBTTagCompound) nbt; 66 | this.pulses = tagCompound.getInteger("pulses"); 67 | this.coolDown = tagCompound.getInteger("cooldown"); 68 | if (tagCompound.getBoolean("isPaused")) { 69 | pause(); 70 | } else { 71 | unpause(); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/compat/jei/TeckleJEIPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.compat.jei; 18 | 19 | import com.elytradev.teckle.client.gui.GuiAlloyFurnace; 20 | import com.elytradev.teckle.common.TeckleObjects; 21 | import com.elytradev.teckle.common.crafting.AlloyRecipe; 22 | import com.elytradev.teckle.common.crafting.AlloyRecipes; 23 | import mezz.jei.api.IJeiHelpers; 24 | import mezz.jei.api.IModPlugin; 25 | import mezz.jei.api.IModRegistry; 26 | import mezz.jei.api.JEIPlugin; 27 | import mezz.jei.api.recipe.IRecipeCategoryRegistration; 28 | import mezz.jei.api.recipe.VanillaRecipeCategoryUid; 29 | import net.minecraft.item.ItemStack; 30 | 31 | 32 | @JEIPlugin 33 | public class TeckleJEIPlugin implements IModPlugin { 34 | 35 | public static final String ALLOYRECIPE_UID = "com.elytradev.teckle.alloyrecipes"; 36 | public static IJeiHelpers HELPERS; 37 | 38 | @Override 39 | public void register(IModRegistry registry) { 40 | HELPERS = registry.getJeiHelpers(); 41 | registry.getRecipeTransferRegistry().addRecipeTransferHandler(new FabricatorRecipeTransferHandler(), VanillaRecipeCategoryUid.CRAFTING); 42 | 43 | registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(TeckleObjects.elytraLogo)); 44 | registry.addRecipes(AlloyRecipes.getInstance().getRecipes(), ALLOYRECIPE_UID); 45 | registry.handleRecipes(AlloyRecipe.class, AlloyRecipeWrapper::new, ALLOYRECIPE_UID); 46 | registry.addRecipeCatalyst(new ItemStack(TeckleObjects.blockAlloyFurnace), ALLOYRECIPE_UID); 47 | 48 | registry.addRecipeClickArea(GuiAlloyFurnace.class, 107, 32, 26, 23, ALLOYRECIPE_UID); 49 | } 50 | 51 | @Override 52 | public void registerCategories(IRecipeCategoryRegistration registry) { 53 | HELPERS = registry.getJeiHelpers(); 54 | registry.addRecipeCategories(new AlloyFurnaceCategory(HELPERS.getGuiHelper())); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/compat/mcmp/TeckleMCMPAddon.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.compat.mcmp; 2 | 3 | import com.elytradev.teckle.common.TeckleMod; 4 | import com.elytradev.teckle.common.tile.TileItemTube; 5 | import mcmultipart.api.addon.IMCMPAddon; 6 | import mcmultipart.api.addon.MCMPAddon; 7 | import mcmultipart.api.multipart.IMultipartRegistry; 8 | import mcmultipart.api.multipart.IMultipartTile; 9 | import mcmultipart.api.ref.MCMPCapabilities; 10 | import net.minecraft.tileentity.TileEntity; 11 | import net.minecraft.util.EnumFacing; 12 | import net.minecraft.util.ResourceLocation; 13 | import net.minecraftforge.common.capabilities.Capability; 14 | import net.minecraftforge.common.capabilities.ICapabilityProvider; 15 | import net.minecraftforge.event.AttachCapabilitiesEvent; 16 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.Nullable; 20 | 21 | /** 22 | * Teckle MCMP addon, used to provide compat when MCMP is present. 23 | */ 24 | @MCMPAddon 25 | public class TeckleMCMPAddon implements IMCMPAddon { 26 | 27 | @Override 28 | public void registerParts(IMultipartRegistry registry) { 29 | //TODO: Disabled due to bugs, will enable again once I can fix it. 30 | 31 | //MinecraftForge.EVENT_BUS.register(this); 32 | 33 | //registry.registerPartWrapper(TeckleObjects.blockItemTube, new MultipartTube()); 34 | //Item itemTube = Item.REGISTRY.getObject(TeckleObjects.blockItemTube.getRegistryName()); 35 | //registry.registerStackWrapper(itemTube, s -> true, TeckleObjects.blockItemTube); 36 | } 37 | 38 | @SubscribeEvent 39 | public void onAttachTileCaps(AttachCapabilitiesEvent e) { 40 | if (e.getObject() instanceof TileItemTube) { 41 | e.addCapability(new ResourceLocation(TeckleMod.MOD_ID, "multipart"), new ICapabilityProvider() { 42 | IMultipartTile multipartTileTube = IMultipartTile.wrap(e.getObject()); 43 | 44 | @Override 45 | public boolean hasCapability(@Nonnull Capability capability, @Nullable EnumFacing facing) { 46 | return capability == MCMPCapabilities.MULTIPART_TILE; 47 | } 48 | 49 | @Nullable 50 | @Override 51 | public T getCapability(@Nonnull Capability capability, @Nullable EnumFacing facing) { 52 | if (capability == MCMPCapabilities.MULTIPART_TILE) 53 | return (T) multipartTileTube; 54 | return null; 55 | } 56 | }); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/sortingmachine/modes/pullmode/PullMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.tile.sortingmachine.modes.pullmode; 18 | 19 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 20 | import net.minecraftforge.common.util.INBTSerializable; 21 | 22 | import javax.vecmath.Point2i; 23 | import java.util.ArrayList; 24 | 25 | public abstract class PullMode implements INBTSerializable { 26 | 27 | public static final ArrayList> PULL_MODES; 28 | 29 | public static final Class SINGLE_STEP = PullModeSingleStep.class; 30 | public static final Class SINGLE_SWEEP = PullModeSingleSweep.class; 31 | public static final Class AUTOMATIC = PullModeAuto.class; 32 | 33 | 34 | static { 35 | PULL_MODES = new ArrayList<>(); 36 | 37 | PULL_MODES.add(0, SINGLE_STEP); 38 | PULL_MODES.add(1, SINGLE_SWEEP); 39 | PULL_MODES.add(2, AUTOMATIC); 40 | } 41 | 42 | private final int id, x, y; 43 | private final String unlocalizedName; 44 | private boolean paused; 45 | 46 | public PullMode(int id, int x, int y, String unlocalizedName) { 47 | this.id = id; 48 | this.x = x; 49 | this.y = y; 50 | this.unlocalizedName = unlocalizedName; 51 | } 52 | 53 | public int getID() { 54 | return id; 55 | } 56 | 57 | public String getTranslationKey() { 58 | return unlocalizedName; 59 | } 60 | 61 | public Point2i textureOffset() { 62 | return new Point2i(x, y); 63 | } 64 | 65 | public boolean isPaused() { 66 | return paused; 67 | } 68 | 69 | public void pause() { 70 | paused = true; 71 | } 72 | 73 | public void unpause() { 74 | paused = false; 75 | } 76 | 77 | public abstract void onPulse(TileSortingMachine sortingMachine); 78 | 79 | public abstract void onTick(TileSortingMachine sortingMachine); 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/TeckleConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common; 2 | 3 | import com.elytradev.concrete.config.ConcreteConfig; 4 | import com.elytradev.concrete.config.ConfigValue; 5 | import net.minecraftforge.common.config.Property; 6 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 7 | 8 | import java.io.File; 9 | 10 | public class TeckleConfiguration extends ConcreteConfig { 11 | 12 | public File configFolder; 13 | 14 | @ConfigValue(type = Property.Type.INTEGER, category = "oregen") 15 | public int nikoliteCount = 8, nikoliteSize = 8, nikoliteMinHeight = 0, nikoliteMaxHeight = 16; 16 | 17 | @ConfigValue(type = Property.Type.INTEGER, category = "machine-cooldowns") 18 | public int transposerCooldown = 3, filterCooldown = 5, sortingMachineCooldown = 5, retrieverCooldown = 5, fabricatorCooldown = 5, breakerCooldown = 6; 19 | 20 | @ConfigValue(type = Property.Type.BOOLEAN, category = "misc", comment = "Determines if the alloy furnace will import all available furnace recipes.") 21 | public boolean importFurnaceRecipes = true; 22 | 23 | @ConfigValue(type = Property.Type.INTEGER, category = "worldnetwork", comment = "Determines the amount of ticks that pass between cleaning a network database.") 24 | public int databaseCleaningCooldown = 160; 25 | 26 | @ConfigValue(type = Property.Type.BOOLEAN, category = "advanced", comment = "Disables ore checks when Teckle is launcing, only disable if you plan to replace default recipes." + 27 | " WARNING: Alloy Recipes are currently hardcoded and no system is currently im place to remove them without another mod interaction!") 28 | public boolean skipOreChecks = false; 29 | 30 | private TeckleConfiguration(File configFile) { 31 | super(configFile, TeckleMod.MOD_ID); 32 | this.configFolder = configFile.getParentFile(); 33 | } 34 | 35 | /** 36 | * Create a config file for Teckle, moves any existing legacy config as well. 37 | * 38 | * @param e FMLPreInitializationEvent for the mod. 39 | * @return an instance of the config class. 40 | */ 41 | public static TeckleConfiguration createConfig(FMLPreInitializationEvent e) { 42 | //Move config file if it exists. 43 | File teckleFolder = new File(e.getModConfigurationDirectory(), "teckle"); 44 | teckleFolder.mkdirs(); 45 | if (e.getSuggestedConfigurationFile().exists()) { 46 | e.getSuggestedConfigurationFile().renameTo(new File(teckleFolder, "teckle.cfg")); 47 | } 48 | 49 | TeckleConfiguration config = new TeckleConfiguration(new File(teckleFolder, "teckle.cfg")); 50 | config.loadConfig(); 51 | return config; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/TileLitNetworkMember.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile; 2 | 3 | import com.elytradev.teckle.common.network.messages.clientbound.TileLitMessage; 4 | import com.elytradev.teckle.common.tile.base.TileNetworkMember; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.network.NetworkManager; 8 | import net.minecraft.network.play.server.SPacketUpdateTileEntity; 9 | import net.minecraft.util.ITickable; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | 13 | import javax.annotation.Nullable; 14 | 15 | public class TileLitNetworkMember extends TileNetworkMember implements ITickable { 16 | 17 | private boolean isLit; 18 | 19 | @Override 20 | public void update() { 21 | if (world.isRemote) 22 | return; 23 | 24 | if (isLit()) { 25 | if (!world.isBlockPowered(pos)) { 26 | setLit(false); 27 | new TileLitMessage(this).sendToAllWatching(this); 28 | } 29 | } 30 | } 31 | 32 | @Override 33 | public void readFromNBT(NBTTagCompound compound) { 34 | super.readFromNBT(compound); 35 | setLit(compound.getBoolean("isLit")); 36 | } 37 | 38 | @Override 39 | public NBTTagCompound writeToNBT(NBTTagCompound compound) { 40 | compound.setBoolean("isLit", isLit()); 41 | return super.writeToNBT(compound); 42 | } 43 | 44 | public void setTriggered() { 45 | if (!isLit()) { 46 | setLit(true); 47 | new TileLitMessage(this).sendToAllWatching(this); 48 | } 49 | } 50 | 51 | @Override 52 | public void onLoad() { 53 | if (world.isRemote) new TileLitMessage(this).sendToAllWatching(this); 54 | } 55 | 56 | @Nullable 57 | @Override 58 | public SPacketUpdateTileEntity getUpdatePacket() { 59 | return new SPacketUpdateTileEntity(this.pos, 0, getUpdateTag()); 60 | } 61 | 62 | @Override 63 | public NBTTagCompound getUpdateTag() { 64 | return this.writeToNBT(new NBTTagCompound()); 65 | } 66 | 67 | @Override 68 | public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { 69 | this.readFromNBT(pkt.getNbtCompound()); 70 | } 71 | 72 | @Override 73 | public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) { 74 | return oldState.getBlock() != newSate.getBlock() && super.shouldRefresh(world, pos, oldState, newSate); 75 | } 76 | 77 | public boolean isLit() { 78 | return isLit; 79 | } 80 | 81 | public void setLit(boolean lit) { 82 | isLit = lit; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/TeckleNetworking.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network; 18 | 19 | import com.elytradev.concrete.network.Message; 20 | import com.elytradev.concrete.network.NetworkContext; 21 | import com.elytradev.teckle.common.TeckleMod; 22 | import com.elytradev.teckle.common.network.messages.clientbound.*; 23 | import com.elytradev.teckle.common.network.messages.serverbound.*; 24 | 25 | /** 26 | * Used for registering packets and storing a global network context for Teckle. 27 | */ 28 | public class TeckleNetworking { 29 | 30 | public static final NetworkContext NETWORK = NetworkContext.forChannel(TeckleMod.MOD_ID); 31 | 32 | public static void setupNetwork() { 33 | registerMessage(DebugReceiverMessage.class); 34 | 35 | registerMessage(TravellerDataMessage.class); 36 | registerMessage(TravellerMoveMessage.class); 37 | registerMessage(AlloyFurnaceMessage.class); 38 | 39 | registerMessage(FilterColourChangeMessage.class); 40 | registerMessage(FabricatorTemplateMessage.class); 41 | 42 | registerMessage(RetrieverColourChangeMessage.class); 43 | registerMessage(RetrieverSelectorModeChangeMessage.class); 44 | registerMessage(RetrieverMatchCountMessage.class); 45 | registerMessage(RetrieverSelectorMessage.class); 46 | 47 | registerMessage(SortingMachineColourChangeMessage.class); 48 | registerMessage(SortingMachineSortModeChangeMessage.class); 49 | registerMessage(SortingMachinePullModeChangeMessage.class); 50 | registerMessage(SortingMachineDefaultRouteChangeMessage.class); 51 | registerMessage(SortingMachineSelectorMessage.class); 52 | registerMessage(TileLitMessage.class); 53 | 54 | registerMessage(TileUpdateMessage.class); 55 | 56 | registerMessage(ToggleQuarryMessage.class); 57 | registerMessage(ChangeQuarryBoundsMessage.class); 58 | } 59 | 60 | private static void registerMessage(Class clazz) { 61 | NETWORK.register(clazz); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/SortingMachinePullModeChangeMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.serverbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.common.TeckleLog; 23 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 24 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 25 | import com.elytradev.teckle.common.tile.sortingmachine.modes.pullmode.PullMode; 26 | import net.minecraft.entity.player.EntityPlayer; 27 | import net.minecraft.util.math.BlockPos; 28 | import net.minecraftforge.fml.relauncher.Side; 29 | 30 | /** 31 | * Handles any changes in the pull mode of a sorting machine on the server. 32 | */ 33 | @ReceivedOn(Side.SERVER) 34 | public class SortingMachinePullModeChangeMessage extends TeckleMessage { 35 | 36 | @MarshalledAs("i8") 37 | public int pullModeID; 38 | public BlockPos sortingMachinePos; 39 | 40 | public SortingMachinePullModeChangeMessage(NetworkContext ctx) { 41 | } 42 | 43 | public SortingMachinePullModeChangeMessage(int pullModeID, BlockPos sortingMachinePos) { 44 | this.pullModeID = pullModeID; 45 | this.sortingMachinePos = sortingMachinePos; 46 | } 47 | 48 | @Override 49 | protected void handle(EntityPlayer sender) { 50 | if (sender != null && sender.world != null) { 51 | TileSortingMachine sortingMachine = (TileSortingMachine) sender.world.getTileEntity(sortingMachinePos); 52 | if (!sortingMachine.isUsableByPlayer(sender)) 53 | return; 54 | 55 | try { 56 | sortingMachine.setPullMode(PullMode.PULL_MODES.get(pullModeID).newInstance()); 57 | } catch (Exception e) { 58 | TeckleLog.error("Failed to instantiate pull mode from packet."); 59 | } 60 | sortingMachine.markDirty(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/serverbound/SortingMachineSortModeChangeMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.serverbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.common.TeckleLog; 23 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 24 | import com.elytradev.teckle.common.tile.sortingmachine.TileSortingMachine; 25 | import com.elytradev.teckle.common.tile.sortingmachine.modes.sortmode.SortMode; 26 | import net.minecraft.entity.player.EntityPlayer; 27 | import net.minecraft.util.math.BlockPos; 28 | import net.minecraftforge.fml.relauncher.Side; 29 | 30 | /** 31 | * Handles any changes to a sorting machine sort mode on the server. 32 | */ 33 | @ReceivedOn(Side.SERVER) 34 | public class SortingMachineSortModeChangeMessage extends TeckleMessage { 35 | 36 | @MarshalledAs("int") 37 | public int sortModeID; 38 | public BlockPos sortingMachinePos; 39 | 40 | public SortingMachineSortModeChangeMessage(NetworkContext ctx) { 41 | } 42 | 43 | public SortingMachineSortModeChangeMessage(int sortModeID, BlockPos sortingMachinePos) { 44 | this.sortModeID = sortModeID; 45 | this.sortingMachinePos = sortingMachinePos; 46 | } 47 | 48 | @Override 49 | protected void handle(EntityPlayer sender) { 50 | if (sender != null && sender.world != null) { 51 | TileSortingMachine sortingMachine = (TileSortingMachine) sender.world.getTileEntity(sortingMachinePos); 52 | 53 | if (!sortingMachine.isUsableByPlayer(sender)) 54 | return; 55 | 56 | try { 57 | sortingMachine.setSortMode(SortMode.SORT_MODES.get(sortModeID).newInstance()); 58 | } catch (Exception e) { 59 | TeckleLog.error("Failed to instantiate sort mode from packet."); 60 | } 61 | sortingMachine.markDirty(); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/proxy/CommonProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.proxy; 18 | 19 | import com.elytradev.teckle.common.TeckleLog; 20 | import com.elytradev.teckle.common.TeckleMod; 21 | import com.elytradev.teckle.common.exception.MissingOreException; 22 | import com.elytradev.teckle.common.handlers.TeckleGuiHandler; 23 | import com.elytradev.teckle.common.tile.inv.pool.AdvancedStackHandlerPool; 24 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkDatabase; 25 | import net.minecraftforge.common.MinecraftForge; 26 | import net.minecraftforge.fml.common.LoaderState; 27 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 28 | import net.minecraftforge.fml.common.gameevent.PlayerEvent; 29 | import net.minecraftforge.fml.common.network.NetworkRegistry; 30 | 31 | import java.util.Objects; 32 | 33 | public class CommonProxy { 34 | 35 | public void registerRenderers(LoaderState.ModState state) { 36 | } 37 | 38 | public void registerHandlers() { 39 | NetworkRegistry.INSTANCE.registerGuiHandler(TeckleMod.INSTANCE, new TeckleGuiHandler()); 40 | 41 | MinecraftForge.EVENT_BUS.register(WorldNetworkDatabase.class); 42 | MinecraftForge.EVENT_BUS.register(AdvancedStackHandlerPool.class); 43 | MinecraftForge.EVENT_BUS.register(this); 44 | } 45 | 46 | @SubscribeEvent 47 | public void onPlayerConnect(PlayerEvent.PlayerLoggedInEvent e) { 48 | if (e.player != null && Objects.equals(e.player.getGameProfile().getName(), "darkevilmac")) { 49 | TeckleMod.INDEV = true; 50 | TeckleLog.developerPlayer = e.player; 51 | } 52 | } 53 | 54 | @SubscribeEvent 55 | public void onPlayerDisconnect(PlayerEvent.PlayerLoggedOutEvent e) { 56 | if (e.player != null && Objects.equals(e.player.getGameProfile().getName(), "darkevilmac")) { 57 | TeckleMod.INDEV = false; 58 | TeckleLog.developerPlayer = null; 59 | } 60 | } 61 | 62 | public void handleMissingOres(String m) { 63 | throw new MissingOreException(m); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/sortingmachine/modes/sortmode/SortModeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.tile.sortingmachine.modes.sortmode; 18 | 19 | import com.google.common.collect.Lists; 20 | 21 | import javax.vecmath.Point2i; 22 | import java.util.ArrayList; 23 | 24 | public enum SortModeType { 25 | COMPARTMENT(0, 176, 26, "sortmodetype.compartment"), 26 | SLOT(1, 192, 26, "sortmodetype.slot"); 27 | 28 | public static SortModeType[] TYPES; 29 | 30 | static { 31 | TYPES = new SortModeType[SortModeType.values().length]; 32 | for (int i = 0; i < SortModeType.values().length; i++) { 33 | TYPES[SortModeType.values()[i].id] = SortModeType.values()[i]; 34 | } 35 | } 36 | 37 | public final int id; 38 | private final ArrayList> subModes = Lists.newArrayList(); 39 | private int x, y, minID, maxID; 40 | private String unlocalizedName; 41 | 42 | SortModeType(int i, int x, int y, String unlocalizedName) { 43 | this.id = i; 44 | this.x = x; 45 | this.y = y; 46 | this.unlocalizedName = unlocalizedName; 47 | 48 | this.minID = Integer.MAX_VALUE; 49 | this.maxID = Integer.MIN_VALUE; 50 | } 51 | 52 | public ArrayList> getSubModes() { 53 | return subModes; 54 | } 55 | 56 | public boolean add(SortMode sortMode) { 57 | if (subModes.contains(sortMode.getClass())) 58 | return false; 59 | 60 | int id = sortMode.getID(); 61 | 62 | minID = minID > id ? id : minID; 63 | maxID = maxID < id ? id : maxID; 64 | 65 | return subModes.add(sortMode.getClass()); 66 | } 67 | 68 | 69 | public Point2i textureOffset() { 70 | return new Point2i(x, y); 71 | } 72 | 73 | public int minID() { 74 | return minID; 75 | } 76 | 77 | public int maxID() { 78 | return maxID; 79 | } 80 | 81 | public String getTranslationKey() { 82 | return unlocalizedName; 83 | } 84 | 85 | public Class getDefaultMode() { 86 | return subModes.get(0); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/api/capabilities/impl/WorldNetworkAssistantHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.api.capabilities.impl; 18 | 19 | import com.elytradev.teckle.api.capabilities.IWorldNetworkAssistant; 20 | import com.elytradev.teckle.api.capabilities.IWorldNetworkAssistantHolder; 21 | import com.google.common.collect.Maps; 22 | import net.minecraft.item.ItemStack; 23 | import net.minecraftforge.common.util.INBTSerializable; 24 | 25 | import javax.annotation.Nonnull; 26 | import javax.annotation.Nullable; 27 | import java.util.Map; 28 | 29 | /** 30 | * Default impl of IWorldNetworkAssistantHolder. 31 | */ 32 | public class WorldNetworkAssistantHolder implements IWorldNetworkAssistantHolder { 33 | private Map assistantMap = Maps.newHashMap(); 34 | 35 | public WorldNetworkAssistantHolder() { 36 | // Init assistants. 37 | 38 | assistantMap.put(ItemStack.class, new ItemNetworkAssistant()); 39 | } 40 | 41 | /** 42 | * Get an assistant for the given type, default types are ItemStack 43 | * 44 | * @param type the type of assistant. 45 | * @return the assistant matching the given type. 46 | */ 47 | @Nullable 48 | @Override 49 | public IWorldNetworkAssistant getAssistant(@Nonnull Class type) { 50 | if (assistantMap.containsKey(type)) 51 | return assistantMap.get(type); 52 | 53 | return null; 54 | } 55 | 56 | /** 57 | * Add an assistant for the given type. 58 | * 59 | * @param type the type to add. 60 | * @param assistant the assistant for that type. 61 | * @return the already existing assistant if one is present, or the given assistant if its the only one matching. 62 | */ 63 | @Nonnull 64 | @Override 65 | public IWorldNetworkAssistant addAssistant(@Nonnull Class type, @Nonnull IWorldNetworkAssistant assistant) { 66 | if (getAssistant(type) == null) { 67 | assistantMap.put(type, assistant); 68 | return assistant; 69 | } else { 70 | return assistantMap.get(type); 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/compat/jei/FabricatorRecipeTransferHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.compat.jei; 18 | 19 | import com.elytradev.teckle.common.container.ContainerFabricator; 20 | import com.elytradev.teckle.common.network.messages.serverbound.FabricatorTemplateMessage; 21 | import com.elytradev.teckle.common.tile.TileFabricator; 22 | import mezz.jei.api.gui.IGuiIngredient; 23 | import mezz.jei.api.gui.IRecipeLayout; 24 | import mezz.jei.api.recipe.transfer.IRecipeTransferError; 25 | import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; 26 | import net.minecraft.entity.player.EntityPlayer; 27 | import net.minecraft.item.ItemStack; 28 | 29 | import javax.annotation.Nullable; 30 | import java.util.Map; 31 | 32 | /** 33 | * Handles setting templates in the Fabricator. 34 | */ 35 | public class FabricatorRecipeTransferHandler implements IRecipeTransferHandler { 36 | @Override 37 | public Class getContainerClass() { 38 | return ContainerFabricator.class; 39 | } 40 | 41 | @Nullable 42 | @Override 43 | public IRecipeTransferError transferRecipe(ContainerFabricator container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { 44 | if (doTransfer) { 45 | Map> guiIngredients = recipeLayout.getItemStacks().getGuiIngredients(); 46 | TileFabricator fabricator = container.fabricator; 47 | for (int i = 1; i < 10; i++) { 48 | ItemStack templateIngredient = ItemStack.EMPTY; 49 | if (guiIngredients.containsKey(i)) { 50 | templateIngredient = guiIngredients.get(i).getDisplayedIngredient(); 51 | if (templateIngredient == null) { 52 | templateIngredient = ItemStack.EMPTY; 53 | } else { 54 | templateIngredient.setCount(1); 55 | } 56 | } 57 | fabricator.setTemplateSlot(i - 1, templateIngredient); 58 | new FabricatorTemplateMessage(fabricator.getPos(), templateIngredient, i - 1).sendToServer(); 59 | } 60 | } 61 | return null; 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/DropActions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldnetwork.common; 18 | 19 | import com.elytradev.teckle.common.TeckleLog; 20 | import net.minecraft.entity.item.EntityItem; 21 | import net.minecraft.item.ItemStack; 22 | import net.minecraft.util.Tuple; 23 | import net.minecraft.util.math.BlockPos; 24 | import net.minecraft.world.World; 25 | 26 | import java.util.HashMap; 27 | 28 | public class DropActions { 29 | public static final HashMap ACTIONS = new HashMap<>(); 30 | 31 | public static Tuple ITEMSTACK = new Tuple<>("itemstack", traveller -> { 32 | try { 33 | World world = traveller.network.getWorld(); 34 | BlockPos nodePos = traveller.currentNode.getPosition(); 35 | if (traveller.data.hasKey("stack")) { 36 | ItemStack stackFromTag = new ItemStack(traveller.data.getCompoundTag("stack")); 37 | if (!stackFromTag.isEmpty()) { 38 | world.spawnEntity(new EntityItem(world, nodePos.getX(), nodePos.getY(), 39 | nodePos.getZ(), stackFromTag)); 40 | } 41 | traveller.data.removeTag("stack"); 42 | } 43 | } catch (NullPointerException npe) { 44 | boolean bool = traveller == null; 45 | String debugInfo = "traveller " + (bool ? "null" : traveller.toString()); 46 | bool = bool || traveller.network == null; 47 | debugInfo += " network " + (bool ? "null" : traveller.network.toString()); 48 | bool = bool || traveller.network.getWorld() == null; 49 | debugInfo += " world " + (bool ? "null" : traveller.network.getWorld().toString()); 50 | TeckleLog.error("****************Caught exception when dropping itemstack*******"); 51 | TeckleLog.error("Caught NPE in DropActions!, {}", traveller); 52 | TeckleLog.error("Exception follows, {}", npe); 53 | TeckleLog.error("Here's some useful debug info, {}", debugInfo); 54 | TeckleLog.error("***************************************************************"); 55 | } 56 | }); 57 | 58 | static { 59 | ACTIONS.put(ITEMSTACK.getFirst(), ITEMSTACK.getSecond()); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/client/gui/GuiAlloyFurnace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.client.gui; 18 | 19 | import com.elytradev.teckle.client.gui.base.GuiTeckle; 20 | import com.elytradev.teckle.common.container.ContainerAlloyFurnace; 21 | import com.elytradev.teckle.common.tile.TileAlloyFurnace; 22 | import net.minecraft.entity.player.EntityPlayer; 23 | import net.minecraft.util.ResourceLocation; 24 | 25 | public class GuiAlloyFurnace extends GuiTeckle { 26 | 27 | public final TileAlloyFurnace alloyFurnace; 28 | 29 | public GuiAlloyFurnace(TileAlloyFurnace tile, EntityPlayer player) { 30 | super(new ContainerAlloyFurnace(tile, player)); 31 | this.alloyFurnace = tile; 32 | } 33 | 34 | @Override 35 | public void drawScreen(int mouseX, int mouseY, float partialTicks) { 36 | this.drawDefaultBackground(); 37 | super.drawScreen(mouseX, mouseY, partialTicks); 38 | this.renderHoveredToolTip(mouseX, mouseY); 39 | } 40 | 41 | @Override 42 | public ResourceLocation getBackgroundTexture() { 43 | return new ResourceLocation("teckle", "textures/gui/alloyfurnace.png"); 44 | } 45 | 46 | @Override 47 | protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { 48 | super.drawGuiContainerForegroundLayer(mouseX, mouseY); 49 | 50 | int i = (this.width - this.xSize) / 2; 51 | int j = (this.height - this.ySize) / 2; 52 | 53 | if (alloyFurnace.fuelBurnTime > 0) { 54 | // Lit. 55 | 56 | int k = this.getBurnLeftScaled(13); 57 | this.drawTexturedModalRect(i + 19, j + 34 + 12 - k, 176, 12 - k, 14, k + 1); 58 | } 59 | 60 | int l = this.getCookProgressScaled(24); 61 | if (alloyFurnace.cookTime == 0) 62 | l = 23; 63 | this.drawTexturedModalRect(i + 108, j + 33, 177, 14, 23 - l, 17); 64 | } 65 | 66 | private int getCookProgressScaled(int pixels) { 67 | int i = this.alloyFurnace.cookTime; 68 | int j = 200; 69 | return i != 0 ? i * pixels / j : 0; 70 | } 71 | 72 | private int getBurnLeftScaled(int pixels) { 73 | int divisor = this.alloyFurnace.currentFuelWorth != 0 ? this.alloyFurnace.currentFuelWorth : 1; 74 | 75 | return this.alloyFurnace.fuelBurnTime * pixels / divisor; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/tile/sortingmachine/NetworkTileSortingMachineInput.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.tile.sortingmachine; 2 | 3 | import com.elytradev.teckle.api.IWorldNetwork; 4 | import com.elytradev.teckle.common.TeckleObjects; 5 | import com.elytradev.teckle.common.block.BlockSortingMachine; 6 | import com.elytradev.teckle.common.tile.sortingmachine.modes.pullmode.PullMode; 7 | import com.elytradev.teckle.common.tile.sortingmachine.modes.sortmode.SortMode; 8 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkTraveller; 9 | import com.elytradev.teckle.common.worldnetwork.common.node.WorldNetworkNode; 10 | import net.minecraft.block.state.IBlockState; 11 | import net.minecraft.util.EnumFacing; 12 | import net.minecraft.util.math.BlockPos; 13 | import net.minecraft.world.World; 14 | 15 | import java.util.Objects; 16 | 17 | public class NetworkTileSortingMachineInput extends NetworkTileSortingMachineBase { 18 | 19 | public NetworkTileSortingMachineInput(World world, BlockPos pos, EnumFacing face) { 20 | super(world, pos, face); 21 | } 22 | 23 | public NetworkTileSortingMachineInput(TileSortingMachine sortingMachine) { 24 | super(sortingMachine.getWorld(), sortingMachine.getPos(), sortingMachine.getFacing().getOpposite()); 25 | 26 | this.filterData = sortingMachine.filterData; 27 | this.bufferData = sortingMachine.bufferData; 28 | this.filterID = sortingMachine.filterID; 29 | this.bufferID = sortingMachine.bufferID; 30 | } 31 | 32 | @Override 33 | public EnumFacing getCapabilityFace() { 34 | if (getWorld() != null && getWorld().isBlockLoaded(getPos())) { 35 | IBlockState thisState = getWorld().getBlockState(getPos()); 36 | if (Objects.equals(thisState.getBlock(), TeckleObjects.blockSortingMachine)) { 37 | setCapabilityFace(thisState.getValue(BlockSortingMachine.FACING).getOpposite()); 38 | } 39 | } 40 | 41 | return super.getCapabilityFace(); 42 | } 43 | 44 | @Override 45 | public SortMode getSortMode() { 46 | return getOutputTile().getSortMode(); 47 | } 48 | 49 | @Override 50 | public PullMode getPullMode() { 51 | return getOutputTile().getPullMode(); 52 | } 53 | 54 | @Override 55 | public boolean isValidNetworkMember(IWorldNetwork network, EnumFacing side) { 56 | return Objects.equals(side, getCapabilityFace()); 57 | } 58 | 59 | @Override 60 | public boolean canConnectTo(EnumFacing side) { 61 | return Objects.equals(side, getCapabilityFace()); 62 | } 63 | 64 | @Override 65 | public WorldNetworkNode createNode(IWorldNetwork network, BlockPos pos) { 66 | return new SortingMachineEndpoint(network, pos, getCapabilityFace()); 67 | } 68 | 69 | @Override 70 | public boolean canAcceptTraveller(WorldNetworkTraveller traveller, EnumFacing from) { 71 | return getSortMode().canAcceptTraveller(this, traveller, from); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/api/capabilities/impl/NetworkTileTransporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.api.capabilities.impl; 18 | 19 | import com.elytradev.teckle.api.IWorldNetwork; 20 | import com.elytradev.teckle.api.capabilities.WorldNetworkTile; 21 | import com.elytradev.teckle.common.TeckleLog; 22 | import com.elytradev.teckle.common.worldnetwork.common.node.WorldNetworkNode; 23 | import net.minecraft.util.EnumFacing; 24 | import net.minecraft.util.math.BlockPos; 25 | import net.minecraft.world.World; 26 | 27 | /** 28 | * Framework to build on for network tiles, doesn't implement everything you will need to make adjustments. 29 | */ 30 | public abstract class NetworkTileTransporter extends WorldNetworkTile { 31 | 32 | public Class nodeClazz; 33 | 34 | public WorldNetworkNode node; 35 | 36 | public NetworkTileTransporter(World world, Class nodeClazz) { 37 | super(null, null, null); 38 | this.nodeClazz = nodeClazz; 39 | } 40 | 41 | /** 42 | * Only use this constructor if you will override createNode 43 | */ 44 | public NetworkTileTransporter(World world) { 45 | super(null, null, null); 46 | } 47 | 48 | /** 49 | * Get the current node stored in this object. 50 | * 51 | * @return 52 | */ 53 | @Override 54 | public WorldNetworkNode getNode() { 55 | return node; 56 | } 57 | 58 | /** 59 | * Set the stored node of this tile. 60 | * 61 | * @param node the node to set to. 62 | */ 63 | @Override 64 | public void setNode(WorldNetworkNode node) { 65 | this.node = node; 66 | } 67 | 68 | /** 69 | * Create a new node for the given network, should ALWAYS be a new instance. 70 | * 71 | * @param network the network to create the node for. 72 | * @return a new node. 73 | */ 74 | @Override 75 | public WorldNetworkNode createNode(IWorldNetwork network, BlockPos pos) { 76 | try { 77 | return nodeClazz.getConstructor(IWorldNetwork.class, BlockPos.class, EnumFacing.class).newInstance(network, pos, getCapabilityFace()); 78 | } catch (Exception e) { 79 | TeckleLog.error("Failed to instantiate a WorldNetworkNode for class {}", nodeClazz, e); 80 | } 81 | 82 | return null; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/network/messages/clientbound/TravellerMoveMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.network.messages.clientbound; 18 | 19 | import com.elytradev.concrete.network.NetworkContext; 20 | import com.elytradev.concrete.network.annotation.field.MarshalledAs; 21 | import com.elytradev.concrete.network.annotation.type.ReceivedOn; 22 | import com.elytradev.teckle.client.worldnetwork.ClientTravellerManager; 23 | import com.elytradev.teckle.client.worldnetwork.DummyNetworkTraveller; 24 | import com.elytradev.teckle.common.network.messages.TeckleMessage; 25 | import com.elytradev.teckle.common.worldnetwork.common.WorldNetworkTraveller; 26 | import com.elytradev.teckle.common.worldnetwork.common.pathing.WorldNetworkPath; 27 | import net.minecraft.entity.player.EntityPlayer; 28 | import net.minecraft.nbt.NBTTagCompound; 29 | import net.minecraftforge.fml.relauncher.Side; 30 | 31 | import java.util.UUID; 32 | 33 | /** 34 | * Handles changes in a travellers path on the client. 35 | */ 36 | @ReceivedOn(Side.CLIENT) 37 | public class TravellerMoveMessage extends TeckleMessage { 38 | 39 | @MarshalledAs("int") 40 | public int pathIndex = -1; 41 | public NBTTagCompound data; 42 | public WorldNetworkPath path; 43 | 44 | 45 | public TravellerMoveMessage(NetworkContext ctx) { 46 | } 47 | 48 | public TravellerMoveMessage(WorldNetworkTraveller traveller) { 49 | this.path = traveller.activePath; 50 | this.pathIndex = this.path.getIndex() - 1; 51 | this.data = traveller.data; 52 | } 53 | 54 | @Override 55 | protected void handle(EntityPlayer sender) { 56 | UUID id = data.getUniqueId("id"); 57 | if (ClientTravellerManager.get(id) == null) 58 | return; 59 | 60 | float travelledDistance = ClientTravellerManager.get(id).travelledDistance; 61 | path.setIndex(pathIndex); 62 | DummyNetworkTraveller traveller = new DummyNetworkTraveller(data, path); 63 | traveller.travelledDistance = travelledDistance; 64 | if (pathIndex > 0) { 65 | traveller.previousNode = path.prev(); 66 | traveller.currentNode = path.next(); 67 | traveller.nextNode = path.next(); 68 | } 69 | ClientTravellerManager.removeTraveller(data, true); 70 | ClientTravellerManager.put(data, traveller); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/block/BlockCompacted.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.block; 2 | 3 | import com.elytradev.concrete.resgen.EnumResourceType; 4 | import com.elytradev.concrete.resgen.IResourceHolder; 5 | import com.elytradev.teckle.common.TeckleMod; 6 | import com.elytradev.teckle.common.TeckleObjects; 7 | import com.elytradev.teckle.common.item.ItemIngot; 8 | import net.minecraft.block.Block; 9 | import net.minecraft.block.material.Material; 10 | import net.minecraft.block.properties.PropertyEnum; 11 | import net.minecraft.block.state.BlockStateContainer; 12 | import net.minecraft.block.state.IBlockState; 13 | import net.minecraft.creativetab.CreativeTabs; 14 | import net.minecraft.item.ItemStack; 15 | import net.minecraft.util.NonNullList; 16 | import net.minecraft.util.ResourceLocation; 17 | 18 | import javax.annotation.Nullable; 19 | import java.util.Objects; 20 | 21 | public class BlockCompacted extends Block implements IResourceHolder { 22 | 23 | public static final PropertyEnum TYPE_ENUM = PropertyEnum.create("ingot", ItemIngot.IngotType.class, 24 | Objects::nonNull); 25 | 26 | public BlockCompacted(Material blockMaterialIn) { 27 | super(blockMaterialIn); 28 | this.setHarvestLevel("pickaxe", 2); 29 | this.setHardness(4F); 30 | this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE_ENUM, ItemIngot.IngotType.RED_ALLOY)); 31 | } 32 | 33 | @Override 34 | public BlockStateContainer createBlockState() { 35 | return new BlockStateContainer(this, TYPE_ENUM); 36 | } 37 | 38 | @Override 39 | public int getMetaFromState(IBlockState state) { 40 | return state.getValue(TYPE_ENUM).getMetadata(); 41 | } 42 | 43 | @Override 44 | public IBlockState getStateFromMeta(int meta) { 45 | return getDefaultState().withProperty(TYPE_ENUM, ItemIngot.IngotType.byMetadata(meta)); 46 | } 47 | 48 | @Override 49 | public void getSubBlocks(CreativeTabs tab, NonNullList items) { 50 | if (tab == TeckleObjects.creativeTab) { 51 | for (ItemIngot.IngotType ingotType : ItemIngot.IngotType.values()) { 52 | if (ingotType != ItemIngot.IngotType.BRASS) { 53 | ItemStack stack = new ItemStack(this); 54 | stack.setItemDamage(ingotType.getMetadata()); 55 | items.add(stack); 56 | } 57 | } 58 | } 59 | } 60 | 61 | @Override 62 | public int damageDropped(IBlockState state) { 63 | return state.getValue(TYPE_ENUM).getMetadata(); 64 | } 65 | 66 | @Nullable 67 | @Override 68 | public ResourceLocation getResource(EnumResourceType resourceType, int meta) { 69 | if (resourceType == EnumResourceType.TEXTURE) { 70 | ItemIngot.IngotType ingotType = ItemIngot.IngotType.byMetadata(meta); 71 | return new ResourceLocation(TeckleMod.MOD_ID, "blocks/" + ingotType.getName() + "_block"); 72 | } 73 | return null; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldnetwork/common/node/NodeContainer.java: -------------------------------------------------------------------------------- 1 | package com.elytradev.teckle.common.worldnetwork.common.node; 2 | 3 | import com.elytradev.teckle.api.IWorldNetwork; 4 | import com.elytradev.teckle.api.capabilities.WorldNetworkTile; 5 | import net.minecraft.util.EnumFacing; 6 | import net.minecraft.util.math.BlockPos; 7 | 8 | import javax.annotation.Nonnull; 9 | import javax.annotation.Nullable; 10 | import java.util.Objects; 11 | 12 | /** 13 | * Contains information about a node on a given side of a position. 14 | */ 15 | public class NodeContainer { 16 | 17 | @Nonnull 18 | private BlockPos pos = new BlockPos(0, -1, 0); 19 | @Nullable 20 | private EnumFacing facing; 21 | private IWorldNetwork network; 22 | private WorldNetworkNode node; 23 | 24 | @Override 25 | public boolean equals(Object o) { 26 | if (this == o) return true; 27 | if (o == null || getClass() != o.getClass()) return false; 28 | NodeContainer that = (NodeContainer) o; 29 | return Objects.equals(getPos(), that.getPos()) && 30 | getFacing() == that.getFacing(); 31 | } 32 | 33 | @Override 34 | public int hashCode() { 35 | return Objects.hash(getPos(), getFacing()); 36 | } 37 | 38 | @Nonnull 39 | public BlockPos getPos() { 40 | return pos; 41 | } 42 | 43 | public void setPos(@Nonnull BlockPos pos) { 44 | this.pos = pos; 45 | } 46 | 47 | @Nullable 48 | public EnumFacing getFacing() { 49 | return facing; 50 | } 51 | 52 | public void setFacing(@Nullable EnumFacing facing) { 53 | this.facing = facing; 54 | } 55 | 56 | public IWorldNetwork getNetwork() { 57 | return network; 58 | } 59 | 60 | public void setNetwork(IWorldNetwork network) { 61 | this.network = network; 62 | } 63 | 64 | public WorldNetworkNode getNode() { 65 | return node; 66 | } 67 | 68 | public void setNode(WorldNetworkNode node) { 69 | this.node = node; 70 | } 71 | 72 | public boolean isLoaded() { 73 | return getNode().isLoaded(); 74 | } 75 | 76 | public WorldNetworkTile getNetworkTile() { 77 | return getNode().getNetworkTile(); 78 | } 79 | 80 | public boolean hasNetworkTile() { 81 | return getNode().getNetworkTile() != null; 82 | } 83 | 84 | /** 85 | * Determines if the container is valid, checks if the position is a negative y. 86 | * 87 | * @return true if the container is valid, or false if the data stores is not valid. 88 | */ 89 | public boolean isValid() { 90 | return pos.getY() >= 0; 91 | } 92 | 93 | @Override 94 | public String toString() { 95 | return "NodeContainer{" + 96 | "pos=" + pos + 97 | ", facing=" + facing + 98 | ", network=" + network + 99 | ", node=" + node + 100 | '}'; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/com/elytradev/teckle/common/worldgen/NikoliteOreGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Benjamin K (darkevilmac) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.elytradev.teckle.common.worldgen; 18 | 19 | import com.elytradev.teckle.common.TeckleConfiguration; 20 | import com.elytradev.teckle.common.TeckleMod; 21 | import com.elytradev.teckle.common.TeckleObjects; 22 | import net.minecraft.util.math.BlockPos; 23 | import net.minecraft.world.World; 24 | import net.minecraft.world.chunk.IChunkProvider; 25 | import net.minecraft.world.gen.IChunkGenerator; 26 | import net.minecraft.world.gen.feature.WorldGenMinable; 27 | import net.minecraft.world.gen.feature.WorldGenerator; 28 | import net.minecraftforge.fml.common.IWorldGenerator; 29 | 30 | import java.util.Random; 31 | 32 | 33 | /** 34 | * Just a simple ore generator based on redstone, generates nikolite ore in the world. 35 | */ 36 | public class NikoliteOreGenerator implements IWorldGenerator { 37 | private WorldGenMinable nikoliteGen; 38 | 39 | protected void genOre(World worldIn, int chunkX, int chunkZ, Random random, int blockCount, WorldGenerator generator, int minHeight, int maxHeight) { 40 | if (maxHeight < minHeight) { 41 | int i = minHeight; 42 | minHeight = maxHeight; 43 | maxHeight = i; 44 | } else if (maxHeight == minHeight) { 45 | if (minHeight < 255) { 46 | ++maxHeight; 47 | } else { 48 | --minHeight; 49 | } 50 | } 51 | 52 | for (int j = 0; j < blockCount; ++j) { 53 | BlockPos blockPos = new BlockPos(chunkX * 16, 0, chunkZ * 16); 54 | blockPos = blockPos.add(random.nextInt(16), random.nextInt(maxHeight - minHeight) + minHeight, random.nextInt(16)); 55 | generator.generate(worldIn, random, blockPos); 56 | } 57 | } 58 | 59 | 60 | @Override 61 | public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { 62 | TeckleConfiguration configuration = TeckleMod.CONFIG; 63 | if (world.provider.getDimension() == 0) { 64 | if (nikoliteGen == null) { 65 | this.nikoliteGen = new WorldGenMinable(TeckleObjects.blockNikoliteOre.getDefaultState(), configuration.nikoliteSize); 66 | } 67 | 68 | this.genOre(world, chunkX, chunkZ, random, configuration.nikoliteCount, this.nikoliteGen, configuration.nikoliteMinHeight, configuration.nikoliteMaxHeight); 69 | } 70 | } 71 | } 72 | --------------------------------------------------------------------------------