├── .gitattributes ├── .gitignore ├── AST.png ├── AST.uml ├── FUNDING.yml ├── LICENSE.txt ├── PERFORMANCE.md ├── README.md ├── RELEASE_PROCESS.md ├── TROUBLESHOOTING.md ├── act.ps1 ├── actions ├── Build.ps1 ├── Collect jars.ps1 ├── Download test server.ps1 ├── Get-DiscussionAsMarkdown.ps1 ├── Launch PrismMC.ps1 ├── Launch test server.ps1 ├── Open IntelliJ IDEA.ps1 ├── Open jar dir.ps1 ├── Open libs dirs.ps1 ├── Propagate changes.ps1 ├── Push all.ps1 ├── Run gameTestServer for all versions.ps1 ├── Tag.ps1 ├── Update PrismMC test instances to use latest build output.ps1 ├── Update properties for test servers.ps1 ├── Update test servers to use latest build output.ps1 ├── Wipe jars summary dir.ps1 └── runData.ps1 ├── build.gradle ├── emc_experiment ├── .gitignore ├── .vscode │ └── settings.json ├── emc_finder │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── rustfmt.toml │ └── src │ │ ├── main.rs │ │ └── preprocess.rs └── explore.ipynb ├── examples ├── 01-moveitems.sfm ├── 02-retention.sfm ├── 03-conditions.sfm ├── 04-smelting.sfm ├── 05-each.sfm ├── 06-slots.sfm ├── 07-redstone.sfm ├── 08-fluids.sfm ├── README.md ├── WIP │ └── alias.sfm └── random │ ├── alltheores.sfm │ ├── forgeenergy.sfm │ ├── mekanism.sfm │ └── patterns.sfm ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── media ├── banner.png ├── expansion cache.png ├── many barrels.png ├── pattern cache.png ├── performance first.png ├── performance second.png ├── predicate builder.png ├── tests.png └── vscode syntax.png ├── notes.md ├── npp └── SFML.xml ├── settings.gradle ├── src ├── datagen │ └── java │ │ └── ca │ │ └── teamdman │ │ └── sfm │ │ └── datagen │ │ ├── SFMBlockStatesAndModels.java │ │ ├── SFMBlockTags.java │ │ ├── SFMDatagen.java │ │ ├── SFMItemModels.java │ │ ├── SFMLanguageProvider.java │ │ ├── SFMLootTables.java │ │ ├── SFMRecipes.java │ │ ├── package-info.java │ │ └── version_plumbing │ │ ├── MCVersionAgnosticBlockStatesAndModelsDataGen.java │ │ ├── MCVersionAgnosticBlockTagsDataGen.java │ │ ├── MCVersionAgnosticItemModelsDataGen.java │ │ ├── MCVersionAgnosticLanguageDataGen.java │ │ ├── MCVersionAgnosticLootTablesDataGen.java │ │ ├── MCVersionAgnosticRecipeDataGen.java │ │ └── package-info.java ├── gametest │ ├── java │ │ └── ca │ │ │ └── teamdman │ │ │ └── sfm │ │ │ ├── gametest │ │ │ ├── LeftRightManagerTest.java │ │ │ ├── LeftRightTopManagerTest.java │ │ │ ├── SFMDelegatedTestFunction.java │ │ │ ├── SFMGameTest.java │ │ │ ├── SFMGameTestDefinition.java │ │ │ ├── SFMGameTestDiscovery.java │ │ │ ├── SFMGameTestHelper.java │ │ │ ├── SFMGameTestMethodHelpers.java │ │ │ ├── SFMStructureGenerator.java │ │ │ ├── SFMTestBuilder.java │ │ │ ├── commands.txt │ │ │ ├── declarative │ │ │ │ ├── SFMDeclarativeTestBuilder.java │ │ │ │ ├── SFMTestBlockEntitySpec.java │ │ │ │ └── SFMTestSpec.java │ │ │ ├── package-info.java │ │ │ └── tests │ │ │ │ ├── compat │ │ │ │ ├── ae2 │ │ │ │ │ ├── Ae2InscribersGameTest.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── dank │ │ │ │ │ ├── DankInputRetainRegressionGameTest.java │ │ │ │ │ ├── DankOutputRetainGameTest.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── industrialforegoing │ │ │ │ │ ├── IndustrialforegoingBlackholeEmptyGameTest.java │ │ │ │ │ ├── IndustrialforegoingBlackholeFullGameTest.java │ │ │ │ │ ├── IndustrialforegoingBlackholeSomeGameTest.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── mekanism │ │ │ │ │ ├── MekBinEmptyGameTest.java │ │ │ │ │ ├── MekBinFullGameTest.java │ │ │ │ │ ├── MekBinSomeGameTest.java │ │ │ │ │ ├── MekChemtankInfusionEmptyGameTest.java │ │ │ │ │ ├── MekChemtankInfusionFullGameTest.java │ │ │ │ │ ├── MekChemtankInfusionSomeGameTest.java │ │ │ │ │ ├── MekCubeGameTest.java │ │ │ │ │ ├── MekEnergyEmptyGameTest.java │ │ │ │ │ ├── MekEnergyFullGameTest.java │ │ │ │ │ ├── MekEnergySomeGameTest.java │ │ │ │ │ ├── MekEnergyTenGameTest.java │ │ │ │ │ ├── MekInductionGameTest.java │ │ │ │ │ ├── MekManyLavaCauldronsGameTest.java │ │ │ │ │ ├── MekMultiFluidGameTest.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── multiple │ │ │ │ │ ├── FluidTankRetainRegressionGameTest.java │ │ │ │ │ ├── MeatFluidDirectGameTest.java │ │ │ │ │ ├── MeatFluidGameTest.java │ │ │ │ │ ├── ResourceLossRegressionGameTest.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ └── thermal │ │ │ │ │ ├── ThermalFurnaceArrayGameTest.java │ │ │ │ │ ├── ThermalPhytoArrayGameTest.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── general │ │ │ │ ├── ManagerStateUpdateGameTest.java │ │ │ │ ├── Move1StackDirectGameTest.java │ │ │ │ ├── Move1StackGameTest.java │ │ │ │ └── package-info.java │ │ │ │ └── migrated │ │ │ │ ├── CableNetworkFormationGameTest.java │ │ │ │ ├── CableNetworkRebuildingGameTest.java │ │ │ │ ├── CableSpiralGameTest.java │ │ │ │ ├── CasingRulesGameTest.java │ │ │ │ ├── CauldronLavaMovementGameTest.java │ │ │ │ ├── ComparisonEqGameTest.java │ │ │ │ ├── ComparisonGeGameTest.java │ │ │ │ ├── ComparisonGtGameTest.java │ │ │ │ ├── ComparisonLeGameTest.java │ │ │ │ ├── ComparisonLtGameTest.java │ │ │ │ ├── ConditionalOutputInspectionGameTest.java │ │ │ │ ├── CountExecutionPaths1GameTest.java │ │ │ │ ├── CountExecutionPaths2GameTest.java │ │ │ │ ├── CountExecutionPaths3GameTest.java │ │ │ │ ├── CountExecutionPathsConditional1GameTest.java │ │ │ │ ├── CountExecutionPathsConditional1bGameTest.java │ │ │ │ ├── CountExecutionPathsConditional2GameTest.java │ │ │ │ ├── DiskItemClientsideRegressionGameTest.java │ │ │ │ ├── DiskNameGameTest.java │ │ │ │ ├── EachDestQuantityEachRetainGameTest.java │ │ │ │ ├── EachDestQuantityGameTest.java │ │ │ │ ├── EachDestQuantityRetainGameTest.java │ │ │ │ ├── EachDestRetainGameTest.java │ │ │ │ ├── EachSrcQuantityEachRetainGameTest.java │ │ │ │ ├── EachSrcQuantityGameTest.java │ │ │ │ ├── EachSrcQuantityRetainGameTest.java │ │ │ │ ├── EachSrcRetainGameTest.java │ │ │ │ ├── FallingAnvilDisenchantGameTest.java │ │ │ │ ├── FallingAnvilEnchantmentFormGameTest.java │ │ │ │ ├── FallingAnvilProgramFormGameTest.java │ │ │ │ ├── FallingAnvilXpShardGameTest.java │ │ │ │ ├── FallingAnvilXpShardManyGameTest.java │ │ │ │ ├── Forget1GameTest.java │ │ │ │ ├── Forget2GameTest.java │ │ │ │ ├── ForgetInputCountStateGameTest.java │ │ │ │ ├── ForgetSlotGameTest.java │ │ │ │ ├── GatherSuppliesGameTest.java │ │ │ │ ├── HasOrGameTest.java │ │ │ │ ├── InvWrapperInvestigationGameTest.java │ │ │ │ ├── ManyOutputsGameTest.java │ │ │ │ ├── MekanismNullIoDirectionGameTest.java │ │ │ │ ├── MoveCauldronLavaGameTest.java │ │ │ │ ├── MoveCauldronWaterGameTest.java │ │ │ │ ├── MoveFullChestGameTest.java │ │ │ │ ├── MoveIfPoweredGameTest.java │ │ │ │ ├── MoveManyFullGameTest.java │ │ │ │ ├── MoveManyInventoriesGameTest.java │ │ │ │ ├── MoveManyRegexGameTest.java │ │ │ │ ├── MoveMultipleItemNamesGameTest.java │ │ │ │ ├── MoveOnPulseGameTest.java │ │ │ │ ├── MoveOneEachWithTagMineableAxeGameTest.java │ │ │ │ ├── MoveRegexCircleGameTest.java │ │ │ │ ├── MoveSlotsGameTest.java │ │ │ │ ├── MoveUsingEachOrGameTest.java │ │ │ │ ├── MoveUsingOrGameTest.java │ │ │ │ ├── MoveWithComplexWithClauseGameTest.java │ │ │ │ ├── MoveWithNestedWithClauseGameTest.java │ │ │ │ ├── MoveWithNotAndOrCombinationGameTest.java │ │ │ │ ├── MoveWithTagConjunctionGameTest.java │ │ │ │ ├── MoveWithTagDisjunctionGameTest.java │ │ │ │ ├── MoveWithTagIngotsGameTest.java │ │ │ │ ├── MoveWithTagMineableGameTest.java │ │ │ │ ├── MoveWithTagNegationGameTest.java │ │ │ │ ├── MoveWithoutComplexWithClauseGameTest.java │ │ │ │ ├── MoveWithoutNestedWithClauseGameTest.java │ │ │ │ ├── MoveWithoutNotAndOrCombinationGameTest.java │ │ │ │ ├── MoveWithoutTagConjunctionGameTest.java │ │ │ │ ├── MoveWithoutTagDisjunctionGameTest.java │ │ │ │ ├── MoveWithoutTagIngotsGameTest.java │ │ │ │ ├── MoveWithoutTagMineableGameTest.java │ │ │ │ ├── MoveWithoutTagNegationGameTest.java │ │ │ │ ├── MultiIoLimitsGameTest.java │ │ │ │ ├── PatternCacheRegression1GameTest.java │ │ │ │ ├── PatternCacheRegression2GameTest.java │ │ │ │ ├── PatternCacheRegression3GameTest.java │ │ │ │ ├── PrintingPressCloneEnchantmentGameTest.java │ │ │ │ ├── PrintingPressCloneProgramGameTest.java │ │ │ │ ├── PrintingPressInsertionExtractionGameTest.java │ │ │ │ ├── ProgramCrlfLineEndingsConversionGameTest.java │ │ │ │ ├── RegressionCrashTypeMixingGameTest.java │ │ │ │ ├── RegressionInputRetainBExpandedExpandedGameTest.java │ │ │ │ ├── RegressionInputRetainBExpandedSharedGameTest.java │ │ │ │ ├── RegressionInputRetainBSharedExpandedGameTest.java │ │ │ │ ├── RegressionInputRetainBSharedSharedGameTest.java │ │ │ │ ├── Reorder1GameTest.java │ │ │ │ ├── Reorder2GameTest.java │ │ │ │ ├── Reorder3GameTest.java │ │ │ │ ├── Retain5GameTest.java │ │ │ │ ├── RoundRobinByBlock1GameTest.java │ │ │ │ ├── RoundRobinByBlock2GameTest.java │ │ │ │ ├── RoundRobinByLabelGameTest.java │ │ │ │ ├── RoundRobinNoBlocksCrashRegressionGameTest.java │ │ │ │ ├── SfmV4120ChangelogGameTest.java │ │ │ │ ├── UnusedIoWarningInputLabelNotPresentInOutputGameTest.java │ │ │ │ ├── UnusedIoWarningOutputLabelNotPresnetInInputGameTest.java │ │ │ │ ├── ValidateTagsGameTest.java │ │ │ │ ├── WirelessRegressionGameTest.java │ │ │ │ └── package-info.java │ │ │ └── mixins │ │ │ └── StructureTemplateManagerMixin.java │ └── resources │ │ └── sfm.mixins.json ├── generated │ └── resources │ │ ├── .cache │ │ ├── 67cce32b1c3cbbcb1f646605f4914e3f196986c2 │ │ ├── 726a4eaaa226cb50028c5f3f85d691417b67903b │ │ ├── 9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e │ │ ├── bf0ffec7956ce36aba0a993095f41e47d655813b │ │ ├── c622617f6fabf890a00b9275cd5f643584a8a2c8 │ │ └── e178a5522f40c551aab415c9b173854697679d35 │ │ ├── assets │ │ └── sfm │ │ │ ├── blockstates │ │ │ ├── cable.json │ │ │ ├── cable_facade.json │ │ │ ├── fancy_cable.json │ │ │ ├── fancy_cable_facade.json │ │ │ ├── manager.json │ │ │ ├── printing_press.json │ │ │ ├── test_barrel.json │ │ │ ├── test_barrel_tank.json │ │ │ └── water_tank.json │ │ │ ├── lang │ │ │ └── en_us.json │ │ │ └── models │ │ │ ├── block │ │ │ ├── cable.json │ │ │ ├── fancy_cable_connection.json │ │ │ ├── fancy_cable_core.json │ │ │ ├── manager.json │ │ │ ├── test_barrel_tank.json │ │ │ ├── water_tank_active.json │ │ │ └── water_tank_inactive.json │ │ │ └── item │ │ │ ├── cable.json │ │ │ ├── disk.json │ │ │ ├── fancy_cable.json │ │ │ ├── form.json │ │ │ ├── form_base.json │ │ │ ├── labelgun.json │ │ │ ├── manager.json │ │ │ ├── network_tool.json │ │ │ ├── printing_press.json │ │ │ ├── water_tank.json │ │ │ ├── xp_goop.json │ │ │ └── xp_shard.json │ │ └── data │ │ ├── minecraft │ │ ├── recipes │ │ │ ├── disk_reset.json │ │ │ └── label_gun_reset.json │ │ └── tags │ │ │ └── blocks │ │ │ └── mineable │ │ │ ├── axe.json │ │ │ └── pickaxe.json │ │ └── sfm │ │ ├── advancements │ │ └── recipes │ │ │ └── sfm │ │ │ ├── cable.json │ │ │ ├── disk.json │ │ │ ├── fancy_cable.json │ │ │ ├── fancy_to_cable.json │ │ │ ├── labelgun.json │ │ │ ├── manager.json │ │ │ ├── network_tool.json │ │ │ ├── printing_press.json │ │ │ ├── water_tank.json │ │ │ └── xp_goop.json │ │ ├── loot_tables │ │ └── blocks │ │ │ ├── cable.json │ │ │ ├── cable_facade.json │ │ │ ├── fancy_cable.json │ │ │ ├── fancy_cable_facade.json │ │ │ ├── manager.json │ │ │ ├── printing_press.json │ │ │ └── water_tank.json │ │ └── recipes │ │ ├── cable.json │ │ ├── disk.json │ │ ├── enchanted_book_copy.json │ │ ├── fancy_cable.json │ │ ├── fancy_to_cable.json │ │ ├── labelgun.json │ │ ├── manager.json │ │ ├── map_copy.json │ │ ├── network_tool.json │ │ ├── printing_press.json │ │ ├── program_copy.json │ │ ├── water_tank.json │ │ ├── written_book_copy.json │ │ └── xp_goop.json ├── main │ ├── antlr │ │ ├── sfml │ │ │ └── SFML.g4 │ │ └── toml │ │ │ ├── TomlLexer.g4 │ │ │ └── TomlParser.g4 │ ├── java │ │ ├── ca │ │ │ └── teamdman │ │ │ │ ├── sfm │ │ │ │ ├── SFM.java │ │ │ │ ├── SFMPerformanceTweaks.java │ │ │ │ ├── client │ │ │ │ │ ├── ClientFacadeWarningHelper.java │ │ │ │ │ ├── ClientKeyHelpers.java │ │ │ │ │ ├── ClientRayCastHelpers.java │ │ │ │ │ ├── ClientTranslationHelpers.java │ │ │ │ │ ├── ProgramSyntaxHighlightingHelper.java │ │ │ │ │ ├── ProgramTokenContextActions.java │ │ │ │ │ ├── diagnostics │ │ │ │ │ │ └── SFMClientDiagnostics.java │ │ │ │ │ ├── gui │ │ │ │ │ │ ├── overlay │ │ │ │ │ │ │ ├── LabelGunReminderOverlay.java │ │ │ │ │ │ │ └── NetworkToolReminderOverlay.java │ │ │ │ │ │ ├── package-info.java │ │ │ │ │ │ ├── screen │ │ │ │ │ │ │ ├── ExampleEditScreen.java │ │ │ │ │ │ │ ├── ExampleEditScreenOpenContext.java │ │ │ │ │ │ │ ├── ExamplesScreen.java │ │ │ │ │ │ │ ├── LabelGunScreen.java │ │ │ │ │ │ │ ├── LogsScreen.java │ │ │ │ │ │ │ ├── ManagerScreen.java │ │ │ │ │ │ │ ├── ProgramEditScreenOpenContext.java │ │ │ │ │ │ │ ├── ProgramEditorConfigScreen.java │ │ │ │ │ │ │ ├── ProgramEditorScreen.java │ │ │ │ │ │ │ ├── SFMFontUtils.java │ │ │ │ │ │ │ ├── SFMScreenChangeHelpers.java │ │ │ │ │ │ │ ├── SFMScreenRenderUtils.java │ │ │ │ │ │ │ ├── TestBarrelTankScreen.java │ │ │ │ │ │ │ ├── TomlEditScreen.java │ │ │ │ │ │ │ ├── TomlEditScreenOpenContext.java │ │ │ │ │ │ │ └── package-info.java │ │ │ │ │ │ └── widget │ │ │ │ │ │ │ ├── PickList.java │ │ │ │ │ │ │ ├── PickListItem.java │ │ │ │ │ │ │ ├── SFMButtonBuilder.java │ │ │ │ │ │ │ ├── SFMExtendedButton.java │ │ │ │ │ │ │ ├── SFMExtendedButtonWithTooltip.java │ │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── handler │ │ │ │ │ │ ├── ContainerScreenInspectorHandler.java │ │ │ │ │ │ ├── ItemWorldRenderer.java │ │ │ │ │ │ ├── LabelGunKeyMappingHandler.java │ │ │ │ │ │ ├── LabelGunScrollSwitcher.java │ │ │ │ │ │ ├── NetworkToolKeyMappingHandler.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── jei │ │ │ │ │ │ ├── FallingAnvilDisenchantRecipe.java │ │ │ │ │ │ ├── FallingAnvilExperienceShardRecipe.java │ │ │ │ │ │ ├── FallingAnvilFormRecipe.java │ │ │ │ │ │ ├── FallingAnvilJEICategory.java │ │ │ │ │ │ ├── FallingAnvilRecipe.java │ │ │ │ │ │ ├── PrintingPressJEICategory.java │ │ │ │ │ │ ├── SFMJEIPlugin.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── registry │ │ │ │ │ │ ├── SFMBlockColors.java │ │ │ │ │ │ ├── SFMBlockEntityRenderers.java │ │ │ │ │ │ ├── SFMBlockModelWrappers.java │ │ │ │ │ │ ├── SFMKeyMappings.java │ │ │ │ │ │ ├── SFMMenuScreens.java │ │ │ │ │ │ ├── SFMOverlays.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── render │ │ │ │ │ │ ├── CableFacadeBlockModelWrapper.java │ │ │ │ │ │ ├── FacadeBlockColor.java │ │ │ │ │ │ ├── FancyCableFacadeBlockModelWrapper.java │ │ │ │ │ │ ├── FormItemExtensions.java │ │ │ │ │ │ ├── FormItemRenderer.java │ │ │ │ │ │ ├── PrintingPressBlockEntityRenderer.java │ │ │ │ │ │ ├── RetexturedBakedQuad.java │ │ │ │ │ │ └── package-info.java │ │ │ │ ├── common │ │ │ │ │ ├── block │ │ │ │ │ │ ├── BatteryBlock.java │ │ │ │ │ │ ├── CableBlock.java │ │ │ │ │ │ ├── CableFacadeBlock.java │ │ │ │ │ │ ├── FancyCableBlock.java │ │ │ │ │ │ ├── FancyCableFacadeBlock.java │ │ │ │ │ │ ├── IFacadableBlock.java │ │ │ │ │ │ ├── ManagerBlock.java │ │ │ │ │ │ ├── PrintingPressBlock.java │ │ │ │ │ │ ├── TestBarrelBlock.java │ │ │ │ │ │ ├── TestBarrelTankBlock.java │ │ │ │ │ │ ├── TunnelledManagerBlock.java │ │ │ │ │ │ ├── WaterTankBlock.java │ │ │ │ │ │ ├── package-info.java │ │ │ │ │ │ └── shape │ │ │ │ │ │ │ └── ShapeCache.java │ │ │ │ │ ├── blockentity │ │ │ │ │ │ ├── BatteryBlockEntity.java │ │ │ │ │ │ ├── CableFacadeBlockEntity.java │ │ │ │ │ │ ├── CommonFacadeBlockEntity.java │ │ │ │ │ │ ├── FancyCableFacadeBlockEntity.java │ │ │ │ │ │ ├── IFacadeBlockEntity.java │ │ │ │ │ │ ├── ManagerBlockEntity.java │ │ │ │ │ │ ├── PrintingPressBlockEntity.java │ │ │ │ │ │ ├── TestBarrelBlockEntity.java │ │ │ │ │ │ ├── TestBarrelTankBlockEntity.java │ │ │ │ │ │ ├── TunnelledManagerBlockEntity.java │ │ │ │ │ │ ├── WaterTankBlockEntity.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── cablenetwork │ │ │ │ │ │ ├── CableNetwork.java │ │ │ │ │ │ ├── CableNetworkManager.java │ │ │ │ │ │ ├── CapabilityCache.java │ │ │ │ │ │ ├── ICableBlock.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── capabilityprovidermapper │ │ │ │ │ │ ├── BlockEntityCapabilityProviderMapper.java │ │ │ │ │ │ ├── CapabilityProviderMapper.java │ │ │ │ │ │ ├── CauldronCapabilityProviderMapper.java │ │ │ │ │ │ └── ae2 │ │ │ │ │ │ │ └── InterfaceCapabilityProviderMapper.java │ │ │ │ │ ├── command │ │ │ │ │ │ ├── ConfigCommand.java │ │ │ │ │ │ ├── ConfigCommandBehaviourInput.java │ │ │ │ │ │ ├── ConfigCommandVariantInput.java │ │ │ │ │ │ ├── SFMCommand.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── compat │ │ │ │ │ │ ├── SFMMekanismCompat.java │ │ │ │ │ │ ├── SFMModCompat.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── config │ │ │ │ │ │ ├── SFMClientConfig.java │ │ │ │ │ │ ├── SFMClientProgramEditorConfig.java │ │ │ │ │ │ ├── SFMConfig.java │ │ │ │ │ │ ├── SFMConfigReadWriter.java │ │ │ │ │ │ ├── SFMConfigTracker.java │ │ │ │ │ │ ├── SFMServerConfig.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── containermenu │ │ │ │ │ │ ├── ManagerContainerMenu.java │ │ │ │ │ │ ├── TestBarrelTankContainerMenu.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── diagnostics │ │ │ │ │ │ └── SFMDiagnostics.java │ │ │ │ │ ├── facade │ │ │ │ │ │ ├── ApplyFacadesFacadePlan.java │ │ │ │ │ │ ├── ChangeWorldBlockFacadePlan.java │ │ │ │ │ │ ├── ClearFacadesFacadePlan.java │ │ │ │ │ │ ├── FacadeData.java │ │ │ │ │ │ ├── FacadePlanAnalysisResult.java │ │ │ │ │ │ ├── FacadePlanWarning.java │ │ │ │ │ │ ├── FacadePlanner.java │ │ │ │ │ │ ├── FacadeSpreadLogic.java │ │ │ │ │ │ ├── FacadeTextureMode.java │ │ │ │ │ │ ├── FacadeTransparency.java │ │ │ │ │ │ ├── IFacadePlan.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── handler │ │ │ │ │ │ ├── FallingAnvilHandler.java │ │ │ │ │ │ ├── OpenContainerTracker.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── item │ │ │ │ │ │ ├── DiskItem.java │ │ │ │ │ │ ├── ExperienceGoopItem.java │ │ │ │ │ │ ├── ExperienceShardItem.java │ │ │ │ │ │ ├── FormItem.java │ │ │ │ │ │ ├── LabelGunItem.java │ │ │ │ │ │ ├── NetworkToolItem.java │ │ │ │ │ │ ├── PrintingPressBlockItem.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── localization │ │ │ │ │ │ ├── LocalizationEntry.java │ │ │ │ │ │ └── LocalizationKeys.java │ │ │ │ │ ├── logging │ │ │ │ │ │ ├── TranslatableAppender.java │ │ │ │ │ │ ├── TranslatableLogEvent.java │ │ │ │ │ │ └── TranslatableLogger.java │ │ │ │ │ ├── net │ │ │ │ │ │ ├── ClientboundBoolExprStatementInspectionResultsPacket.java │ │ │ │ │ │ ├── ClientboundClientConfigCommandPacket.java │ │ │ │ │ │ ├── ClientboundContainerExportsInspectionResultsPacket.java │ │ │ │ │ │ ├── ClientboundIfStatementInspectionResultsPacket.java │ │ │ │ │ │ ├── ClientboundInputInspectionResultsPacket.java │ │ │ │ │ │ ├── ClientboundLabelInspectionResultsPacket.java │ │ │ │ │ │ ├── ClientboundManagerGuiUpdatePacket.java │ │ │ │ │ │ ├── ClientboundManagerLogLevelUpdatedPacket.java │ │ │ │ │ │ ├── ClientboundManagerLogsPacket.java │ │ │ │ │ │ ├── ClientboundOutputInspectionResultsPacket.java │ │ │ │ │ │ ├── ClientboundServerConfigCommandPacket.java │ │ │ │ │ │ ├── ClientboundShowChangelogPacket.java │ │ │ │ │ │ ├── SFMPacket.java │ │ │ │ │ │ ├── SFMPacketDaddy.java │ │ │ │ │ │ ├── SFMPacketHandlingContext.java │ │ │ │ │ │ ├── ServerboundBoolExprStatementInspectionRequestPacket.java │ │ │ │ │ │ ├── ServerboundContainerExportsInspectionRequestPacket.java │ │ │ │ │ │ ├── ServerboundDiskItemSetProgramPacket.java │ │ │ │ │ │ ├── ServerboundFacadePacket.java │ │ │ │ │ │ ├── ServerboundIfStatementInspectionRequestPacket.java │ │ │ │ │ │ ├── ServerboundInputInspectionRequestPacket.java │ │ │ │ │ │ ├── ServerboundLabelGunClearPacket.java │ │ │ │ │ │ ├── ServerboundLabelGunCycleViewModePacket.java │ │ │ │ │ │ ├── ServerboundLabelGunPrunePacket.java │ │ │ │ │ │ ├── ServerboundLabelGunUpdatePacket.java │ │ │ │ │ │ ├── ServerboundLabelGunUsePacket.java │ │ │ │ │ │ ├── ServerboundLabelInspectionRequestPacket.java │ │ │ │ │ │ ├── ServerboundManagerClearLogsPacket.java │ │ │ │ │ │ ├── ServerboundManagerFixPacket.java │ │ │ │ │ │ ├── ServerboundManagerLogDesireUpdatePacket.java │ │ │ │ │ │ ├── ServerboundManagerProgramPacket.java │ │ │ │ │ │ ├── ServerboundManagerRebuildPacket.java │ │ │ │ │ │ ├── ServerboundManagerResetPacket.java │ │ │ │ │ │ ├── ServerboundManagerSetLogLevelPacket.java │ │ │ │ │ │ ├── ServerboundNetworkToolToggleOverlayPacket.java │ │ │ │ │ │ ├── ServerboundNetworkToolUsePacket.java │ │ │ │ │ │ ├── ServerboundOutputInspectionRequestPacket.java │ │ │ │ │ │ ├── ServerboundServerConfigRequestPacket.java │ │ │ │ │ │ ├── ServerboundServerConfigUpdatePacket.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── program │ │ │ │ │ │ ├── CapabilityConsumer.java │ │ │ │ │ │ ├── DefaultProgramBehaviour.java │ │ │ │ │ │ ├── ExpandedQuantityExpandedRetentionInputResourceTracker.java │ │ │ │ │ │ ├── ExpandedQuantityExpandedRetentionOutputResourceTracker.java │ │ │ │ │ │ ├── ExpandedQuantitySharedRetentionInputResourceTracker.java │ │ │ │ │ │ ├── ExpandedQuantitySharedRetentionOutputResourceTracker.java │ │ │ │ │ │ ├── IInputResourceTracker.java │ │ │ │ │ │ ├── IOutputResourceTracker.java │ │ │ │ │ │ ├── LabelPositionHolder.java │ │ │ │ │ │ ├── LimitedInputSlot.java │ │ │ │ │ │ ├── LimitedInputSlotObjectPool.java │ │ │ │ │ │ ├── LimitedOutputSlot.java │ │ │ │ │ │ ├── LimitedOutputSlotObjectPool.java │ │ │ │ │ │ ├── LimitedSlot.java │ │ │ │ │ │ ├── ProgramBehaviour.java │ │ │ │ │ │ ├── ProgramContext.java │ │ │ │ │ │ ├── RegexCache.java │ │ │ │ │ │ ├── SharedQuantityExpandedRetentionInputResourceTracker.java │ │ │ │ │ │ ├── SharedQuantityExpandedRetentionOutputResourceTracker.java │ │ │ │ │ │ ├── SharedQuantitySharedRetentionInputResourceTracker.java │ │ │ │ │ │ ├── SharedQuantitySharedRetentionOutputResourceTracker.java │ │ │ │ │ │ ├── SimulateExploreAllPathsProgramBehaviour.java │ │ │ │ │ │ ├── linting │ │ │ │ │ │ │ ├── FlowProgramLinter.java │ │ │ │ │ │ │ ├── GatherWarningsProgramBehaviour.java │ │ │ │ │ │ │ ├── IProgramLinter.java │ │ │ │ │ │ │ ├── LabelLinter.java │ │ │ │ │ │ │ ├── MekanismSideConfigProgramLinter.java │ │ │ │ │ │ │ ├── ProgramLinter.java │ │ │ │ │ │ │ ├── ResourcesProgramLinter.java │ │ │ │ │ │ │ └── package-info.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── recipe │ │ │ │ │ │ ├── DiskResetRecipe.java │ │ │ │ │ │ ├── LabelGunResetRecipe.java │ │ │ │ │ │ ├── NotContainer.java │ │ │ │ │ │ ├── PrintingPressFinishedRecipe.java │ │ │ │ │ │ ├── PrintingPressRecipe.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── registry │ │ │ │ │ │ ├── SFMBlockEntities.java │ │ │ │ │ │ ├── SFMBlocks.java │ │ │ │ │ │ ├── SFMCapabilityProviderMappers.java │ │ │ │ │ │ ├── SFMItems.java │ │ │ │ │ │ ├── SFMMenus.java │ │ │ │ │ │ ├── SFMPackets.java │ │ │ │ │ │ ├── SFMProgramLinters.java │ │ │ │ │ │ ├── SFMRecipeSerializers.java │ │ │ │ │ │ ├── SFMRecipeTypes.java │ │ │ │ │ │ ├── SFMResourceTypes.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── resourcetype │ │ │ │ │ │ ├── FluidResourceType.java │ │ │ │ │ │ ├── ForgeEnergyResourceType.java │ │ │ │ │ │ ├── GasResourceType.java │ │ │ │ │ │ ├── InfuseResourceType.java │ │ │ │ │ │ ├── IntegerResourceType.java │ │ │ │ │ │ ├── ItemResourceType.java │ │ │ │ │ │ ├── MekanismEnergyResourceType.java │ │ │ │ │ │ ├── PigmentResourceType.java │ │ │ │ │ │ ├── RegistryBackedResourceType.java │ │ │ │ │ │ ├── ResourceType.java │ │ │ │ │ │ ├── ScalarResourceType.java │ │ │ │ │ │ ├── SlurryResourceType.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── util │ │ │ │ │ │ ├── CompressedBlockPosSet.java │ │ │ │ │ │ ├── HelpsWithMinecraftVersionIndependence.java │ │ │ │ │ │ ├── InPlaceBlockPlaceContext.java │ │ │ │ │ │ ├── MCVersionDependentBehaviour.java │ │ │ │ │ │ ├── NotStored.java │ │ │ │ │ │ ├── SFMASTUtils.java │ │ │ │ │ │ ├── SFMContainerUtil.java │ │ │ │ │ │ ├── SFMDirections.java │ │ │ │ │ │ ├── SFMDisplayUtils.java │ │ │ │ │ │ ├── SFMEnvironmentUtils.java │ │ │ │ │ │ ├── SFMHandUtils.java │ │ │ │ │ │ ├── SFMItemUtils.java │ │ │ │ │ │ ├── SFMPlayerUtils.java │ │ │ │ │ │ ├── SFMStreamUtils.java │ │ │ │ │ │ ├── SFMTranslationUtils.java │ │ │ │ │ │ ├── Stored.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── watertanknetwork │ │ │ │ │ │ ├── WaterNetwork.java │ │ │ │ │ │ └── WaterNetworkManager.java │ │ │ │ └── package-info.java │ │ │ │ └── sfml │ │ │ │ ├── ast │ │ │ │ ├── ASTBuilder.java │ │ │ │ ├── ASTNode.java │ │ │ │ ├── Block.java │ │ │ │ ├── BoolConjunction.java │ │ │ │ ├── BoolDisjunction.java │ │ │ │ ├── BoolExpr.java │ │ │ │ ├── BoolFalse.java │ │ │ │ ├── BoolHas.java │ │ │ │ ├── BoolNegation.java │ │ │ │ ├── BoolParen.java │ │ │ │ ├── BoolRedstone.java │ │ │ │ ├── BoolTrue.java │ │ │ │ ├── ComparisonOperator.java │ │ │ │ ├── DirectionQualifier.java │ │ │ │ ├── ForgetStatement.java │ │ │ │ ├── IOStatement.java │ │ │ │ ├── IfStatement.java │ │ │ │ ├── InputStatement.java │ │ │ │ ├── Interval.java │ │ │ │ ├── Label.java │ │ │ │ ├── LabelAccess.java │ │ │ │ ├── Limit.java │ │ │ │ ├── Number.java │ │ │ │ ├── NumberRange.java │ │ │ │ ├── NumberRangeSet.java │ │ │ │ ├── OutputStatement.java │ │ │ │ ├── Program.java │ │ │ │ ├── ProgramName.java │ │ │ │ ├── RedstoneTrigger.java │ │ │ │ ├── ResourceIdSet.java │ │ │ │ ├── ResourceIdentifier.java │ │ │ │ ├── ResourceLimit.java │ │ │ │ ├── ResourceLimits.java │ │ │ │ ├── ResourceQuantity.java │ │ │ │ ├── RoundRobin.java │ │ │ │ ├── SetOperator.java │ │ │ │ ├── Side.java │ │ │ │ ├── Statement.java │ │ │ │ ├── StringHolder.java │ │ │ │ ├── TagMatcher.java │ │ │ │ ├── TimerTrigger.java │ │ │ │ ├── ToStringCondensed.java │ │ │ │ ├── ToStringPretty.java │ │ │ │ ├── Trigger.java │ │ │ │ ├── With.java │ │ │ │ ├── WithAlwaysTrue.java │ │ │ │ ├── WithClause.java │ │ │ │ ├── WithConjunction.java │ │ │ │ ├── WithDisjunction.java │ │ │ │ ├── WithNegation.java │ │ │ │ ├── WithParen.java │ │ │ │ ├── WithTag.java │ │ │ │ └── package-info.java │ │ │ │ ├── ext_antlr4c3 │ │ │ │ └── CodeCompletionCore.java │ │ │ │ ├── intellisense │ │ │ │ ├── IntellisenseAction.java │ │ │ │ ├── IntellisenseContext.java │ │ │ │ ├── MutableProgramString.java │ │ │ │ ├── SFMLIntellisense.java │ │ │ │ ├── SuggestedLabelIntellisenseAction.java │ │ │ │ ├── SuggestedResourceIntellisenseAction.java │ │ │ │ ├── SuggestedTokensIntellisenseAction.java │ │ │ │ └── package-info.java │ │ │ │ ├── manipulation │ │ │ │ ├── ManipulationResult.java │ │ │ │ └── ProgramStringManipulationUtils.java │ │ │ │ └── program_builder │ │ │ │ ├── ListErrorListener.java │ │ │ │ ├── ProgramBuildResult.java │ │ │ │ ├── ProgramBuilder.java │ │ │ │ └── ProgramMetadata.java │ │ └── org │ │ │ └── simmetrics │ │ │ ├── Distance.java │ │ │ ├── LICENSE │ │ │ ├── ListDistance.java │ │ │ ├── ListMetric.java │ │ │ ├── Metric.java │ │ │ ├── MultisetDistance.java │ │ │ ├── MultisetMetric.java │ │ │ ├── SetDistance.java │ │ │ ├── SetMetric.java │ │ │ ├── StringDistance.java │ │ │ ├── StringMetric.java │ │ │ ├── builders │ │ │ ├── StringDistanceBuilder.java │ │ │ ├── StringDistances.java │ │ │ ├── StringMetricBuilder.java │ │ │ └── StringMetrics.java │ │ │ ├── metrics │ │ │ ├── BlockDistance.java │ │ │ ├── CosineSimilarity.java │ │ │ ├── DamerauLevenshtein.java │ │ │ ├── Dice.java │ │ │ ├── EuclideanDistance.java │ │ │ ├── GeneralizedJaccard.java │ │ │ ├── GeneralizedOverlapCoefficient.java │ │ │ ├── HammingDistance.java │ │ │ ├── Identity.java │ │ │ ├── Jaccard.java │ │ │ ├── Jaro.java │ │ │ ├── JaroWinkler.java │ │ │ ├── Levenshtein.java │ │ │ ├── LongestCommonSubsequence.java │ │ │ ├── LongestCommonSubstring.java │ │ │ ├── Math.java │ │ │ ├── MongeElkan.java │ │ │ ├── NeedlemanWunch.java │ │ │ ├── OverlapCoefficient.java │ │ │ ├── SimonWhite.java │ │ │ ├── SmithWaterman.java │ │ │ ├── SmithWatermanGotoh.java │ │ │ ├── StringDistances.java │ │ │ ├── StringMetrics.java │ │ │ ├── TanimotoCoefficient.java │ │ │ └── functions │ │ │ │ ├── AffineGap.java │ │ │ │ ├── ConstantGap.java │ │ │ │ ├── Gap.java │ │ │ │ ├── LinearGap.java │ │ │ │ ├── MatchMismatch.java │ │ │ │ └── Substitution.java │ │ │ ├── simplifiers │ │ │ ├── Caverphone1.java │ │ │ ├── Caverphone2.java │ │ │ ├── ColognePhonetic.java │ │ │ ├── DaitchMokotoffSoundex.java │ │ │ ├── DoubleMetaphone.java │ │ │ ├── MatchRatingApproach.java │ │ │ ├── Metaphone.java │ │ │ ├── Nysiis.java │ │ │ ├── RefinedSoundex.java │ │ │ ├── Simplifier.java │ │ │ ├── Simplifiers.java │ │ │ └── Soundex.java │ │ │ └── tokenizers │ │ │ ├── AbstractTokenizer.java │ │ │ ├── AbstractTokenizer.java.orig │ │ │ ├── Tokenizer.java │ │ │ └── Tokenizers.java │ └── resources │ │ ├── META-INF │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ │ ├── assets │ │ └── sfm │ │ │ ├── models │ │ │ └── block │ │ │ │ └── printing_press.json │ │ │ ├── template_programs │ │ │ ├── a_simple_program.sfml │ │ │ ├── ae2_inscribers.sfml │ │ │ ├── changelog.sfml │ │ │ ├── filtering.sfml │ │ │ ├── forget.sfml │ │ │ ├── furnace_manager.sfml │ │ │ ├── if_statements.sfml │ │ │ ├── known_issues.sfml │ │ │ ├── limits.sfml │ │ │ ├── redstone_item_move.sfml │ │ │ ├── redstone_signals.sfml │ │ │ ├── resource_types.sfml │ │ │ ├── round_robin.sfml │ │ │ ├── slots_and_sides.sfml │ │ │ ├── tag_matching.sfml │ │ │ ├── thank_you.sfml │ │ │ └── timer_triggers.sfml │ │ │ └── textures │ │ │ ├── block │ │ │ ├── cable.png │ │ │ ├── fancy_cable.png │ │ │ ├── manager_bot.png │ │ │ ├── manager_side.png │ │ │ ├── manager_top.png │ │ │ ├── printing_press_base.png │ │ │ ├── printing_press_top.png │ │ │ ├── test_barrel_tank.png │ │ │ ├── tunnelled_manager_bot.png │ │ │ ├── tunnelled_manager_side.png │ │ │ ├── tunnelled_manager_top.png │ │ │ ├── water_intake_active.png │ │ │ └── water_intake_inactive.png │ │ │ ├── gui │ │ │ ├── container │ │ │ │ └── manager.png │ │ │ └── jei │ │ │ │ └── printing_press.png │ │ │ └── item │ │ │ ├── disk.png │ │ │ ├── form.png │ │ │ ├── labelgun.png │ │ │ ├── network_tool.png │ │ │ ├── xp_goop.png │ │ │ └── xp_shard.png │ │ └── pack.mcmeta └── test │ └── java │ └── ca │ └── teamdman │ ├── ai │ ├── FileImportWalker.java │ ├── ProjectEverythingLister.java │ ├── ProjectTestMethodLister.java │ ├── ProjectTestMethodMigrator.java │ └── ProjectTestMethodProgramLister.java │ ├── benchmark │ ├── CollectionIterationBenchmark.java │ ├── CollectionIterationBenchmarkOutput.txt │ ├── LogLevelCheckBenchmark.java │ ├── README.md │ ├── ResourceTypeCacheBenchmark.java │ ├── SampleBenchmark.java │ ├── SpeedySet.java │ └── package-info.java │ ├── sfm │ ├── CompressionTests.java │ ├── IndentationTests.java │ ├── NullableDirectionEnumMapTests.java │ ├── ObjectPoolPerformanceComparisonTests.java │ ├── RegexCacheTests.java │ ├── SFMTests.java │ ├── SpeedySetCorrectnessTests.java │ └── TagMatcherTests.java │ └── sfml │ ├── CodegenTests.java │ ├── SFMLIntellisenseTests.java │ ├── SFMLTestHelpers.java │ ├── SFMLTests.java │ └── SFMLTimerTriggerTests.java ├── test performance ├── 0001 - before fastutils.log └── 0002 - fastutils hash.log └── vscodeextension └── super-factory-manager-language ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── TODO.md ├── language-configuration.json ├── media ├── controller.png ├── disk.png ├── experience goop.png ├── experience shard.png ├── label gun.png ├── label.png ├── printing press.png └── tool.png ├── package-lock.json ├── package.json ├── src ├── activitybar │ ├── ActivityBar.ts │ └── SFMLTreeDataProvider.ts ├── antlrg4 │ ├── Parser.ts │ └── Warning.ts ├── extension.ts ├── generated │ ├── SFML.interp │ ├── SFML.tokens │ ├── SFMLLexer.interp │ ├── SFMLLexer.tokens │ ├── SFMLLexer.ts │ ├── SFMLListener.ts │ ├── SFMLParser.ts │ └── SFMLVisitor.ts └── snippets │ ├── Snippets.ts │ └── snippetController.ts ├── syntaxes ├── SFML.g4 └── sfml.tmLanguage.json ├── tests ├── SFMFile.sfm ├── SFMLFile.sfml ├── VisualTest.sfml ├── Warning.sfml ├── check_other_files.txt └── snippets.sfm ├── tsconfig.json ├── vsc-extension-quickstart.md └── vsce-versions ├── super-factory-manager-language-0.0.1.vsix ├── super-factory-manager-language-0.0.10.vsix ├── super-factory-manager-language-0.0.11.vsix ├── super-factory-manager-language-0.0.12.vsix ├── super-factory-manager-language-0.0.2.vsix ├── super-factory-manager-language-0.0.3.vsix ├── super-factory-manager-language-0.0.4.vsix ├── super-factory-manager-language-0.0.5.vsix ├── super-factory-manager-language-0.0.6.vsix ├── super-factory-manager-language-0.0.7.vsix ├── super-factory-manager-language-0.0.8.vsix └── super-factory-manager-language-0.0.9.vsix /.gitattributes: -------------------------------------------------------------------------------- 1 | # Disable autocrlf on generated files, they always generate with LF 2 | # Add any extra files or paths here to make git stop saying they 3 | # are changed when only line endings change. 4 | src/generated/**/.cache/cache text eol=lf 5 | src/generated/**/*.json text eol=lf 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | logs/ 4 | *.launch 5 | .settings 6 | .metadata 7 | .classpath 8 | .project 9 | .conda 10 | 11 | 12 | logs/debug.log 13 | logs/latest.log 14 | logs/test.log 15 | 16 | # idea 17 | out 18 | *.ipr 19 | *.iws 20 | *.iml 21 | .idea 22 | .idea.bak 23 | .idea.bak.* 24 | 25 | # gradle 26 | build 27 | .gradle 28 | 29 | # other 30 | eclipse 31 | run 32 | runClient 33 | runData 34 | runTest 35 | runGameTest 36 | 37 | # Files from Forge MDK 38 | forge*changelog.txt 39 | 40 | runServer 41 | runs -------------------------------------------------------------------------------- /AST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/AST.png -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: TeamDman 2 | ko-fi: TeamDman -------------------------------------------------------------------------------- /act.ps1: -------------------------------------------------------------------------------- 1 | # Action loop 2 | while ($true) { 3 | # Prompt user to select an action 4 | $action = Get-ChildItem -Path actions ` 5 | | Select-Object -ExpandProperty name ` 6 | | Sort-Object -Descending ` 7 | | fzf --prompt "Action: " --header "Select an action to run" 8 | if ([string]::IsNullOrWhiteSpace($action)) { 9 | break 10 | } 11 | 12 | # Run the selected action 13 | . ".\actions\$action" 14 | 15 | # Leave the action display on the screen for a moment 16 | # (the action loop clears it with fzf) 17 | pause 18 | } 19 | -------------------------------------------------------------------------------- /actions/Download test server.ps1: -------------------------------------------------------------------------------- 1 | Invoke-Item "https://projects.neoforged.net/neoforged/neoforge" -------------------------------------------------------------------------------- /actions/Launch PrismMC.ps1: -------------------------------------------------------------------------------- 1 | # Invoke-Item "C:\Users\TeamD\OneDrive\Documents\PrismLauncher-Windows-MSVC-Portable-6.3\prismlauncher.exe" & 2 | Invoke-Item "C:\Users\TeamD\AppData\Local\Programs\PrismLauncher\prismlauncher.exe" & -------------------------------------------------------------------------------- /actions/Launch test server.ps1: -------------------------------------------------------------------------------- 1 | $servers_path = "..\..\test servers" 2 | $servers = Get-ChildItem -Directory -Path $servers_path 3 | $chosen = $servers ` 4 | | ForEach-Object { $_.Name } ` 5 | | Sort-Object -Descending ` 6 | | fzf ` 7 | --multi ` 8 | --bind "ctrl-a:select-all,ctrl-d:deselect-all,ctrl-t:toggle-all" ` 9 | --header "Pick servers to run" 10 | $servers = $servers | Where-Object { $chosen -contains $_.Name } 11 | foreach ($server in $servers) { 12 | Push-Location $server 13 | try { 14 | Write-Host "Launching $($server.Name)" 15 | & .\run.bat 16 | } finally { 17 | Pop-Location 18 | } 19 | } -------------------------------------------------------------------------------- /actions/Open IntelliJ IDEA.ps1: -------------------------------------------------------------------------------- 1 | Push-Location ".." 2 | try { 3 | $cwd = Get-Location 4 | $expected = "D:\repos\Minecraft\SFM\repos" 5 | if (-not $cwd -eq $expected) { 6 | Write-Host $cwd 7 | throw "This should be ran from a directory that is a child of D:\repos\Minecraft\SFM" 8 | } 9 | 10 | 11 | $repo_clones = Get-ChildItem -Directory | Sort-Object 12 | <# 13 | ❯ $repo_clones 14 | 15 | Directory: D:\Repos\Minecraft\SFM 16 | 17 | Mode LastWriteTime Length Name 18 | ---- ------------- ------ ---- 19 | d---- 2024-04-14 1:41 PM SuperFactoryManager 1.19.2 20 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.19.4 21 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20 22 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20.1 23 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20.2 24 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20.3 25 | #> 26 | 27 | # Perform build 28 | foreach ($repo in $repo_clones) { 29 | try { 30 | Push-Location $repo 31 | # idea . & 32 | # 2023.3.8 community edition 33 | start "$Env:LOCALAPPDATA\Programs\IntelliJ IDEA Community Edition 2\bin\idea64.exe" . & 34 | Start-Sleep -Seconds 3 35 | } finally { 36 | Pop-Location 37 | } 38 | } 39 | } finally { 40 | Pop-Location 41 | } -------------------------------------------------------------------------------- /actions/Open jar dir.ps1: -------------------------------------------------------------------------------- 1 | Invoke-Item "..\..\jars" -------------------------------------------------------------------------------- /actions/Open libs dirs.ps1: -------------------------------------------------------------------------------- 1 | Push-Location ".." 2 | try { 3 | $cwd = Get-Location 4 | $expected = "D:\repos\Minecraft\SFM\repos" 5 | if (-not $cwd -eq $expected) { 6 | Write-Host $cwd 7 | throw "This should be ran from a directory that is a child of D:\repos\Minecraft\SFM" 8 | } 9 | 10 | 11 | $repo_clones = Get-ChildItem -Directory | Sort-Object 12 | <# 13 | ❯ $repo_clones 14 | 15 | Directory: D:\Repos\Minecraft\SFM 16 | 17 | Mode LastWriteTime Length Name 18 | ---- ------------- ------ ---- 19 | d---- 2024-04-14 1:41 PM SuperFactoryManager 1.19.2 20 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.19.4 21 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20 22 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20.1 23 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20.2 24 | d---- 2024-04-14 1:39 PM SuperFactoryManager 1.20.3 25 | #> 26 | 27 | # Perform build 28 | foreach ($repo in $repo_clones) { 29 | try { 30 | Push-Location $repo 31 | start build\libs 32 | Start-Sleep -Seconds 1 33 | } finally { 34 | Pop-Location 35 | } 36 | } 37 | } finally { 38 | Pop-Location 39 | } -------------------------------------------------------------------------------- /actions/Update properties for test servers.ps1: -------------------------------------------------------------------------------- 1 | $servers_path = "..\..\test servers" 2 | $servers = Get-ChildItem -Directory -Path $servers_path ` 3 | | Sort-Object -Property Name 4 | 5 | $lowest_properties = $servers[0].GetFiles() | Where-Object { $_.Name -like "server.properties" } 6 | 7 | $port = 25565 8 | 9 | foreach ($server in $servers) { 10 | $version = $server.Name 11 | $properties = Join-Path -Path $servers_path -ChildPath "$version\server.properties" 12 | if (-not (Test-Path $properties)) { 13 | Write-Host "Copying properties to $version" 14 | Copy-Item -Path $lowest_properties -Destination $properties 15 | } else { 16 | Write-Host "$version already has properties file" 17 | } 18 | } -------------------------------------------------------------------------------- /actions/Update test servers to use latest build output.ps1: -------------------------------------------------------------------------------- 1 | function Get-JarForVersion { 2 | [CmdletBinding()] 3 | param( 4 | [Parameter(Mandatory)] 5 | [string] 6 | $version 7 | ) 8 | $jars = Get-ChildItem -Path "D:\Repos\Minecraft\SFM\jars" 9 | foreach ($jar in $jars) { 10 | if ($jar.Name -like "*-MC$version-*") { 11 | return $jar 12 | } 13 | } 14 | return $null 15 | } 16 | 17 | $servers_path = "..\..\test servers" 18 | $servers = Get-ChildItem -Directory -Path $servers_path 19 | 20 | foreach ($server in $servers) { 21 | $version = $server.Name 22 | $jar = Get-JarForVersion -version $version 23 | if ($null -eq $jar) { 24 | Write-Error "No jar found for version $version" 25 | return 26 | } 27 | $mods_folder = Join-Path -Path $servers_path -ChildPath "$version\mods" 28 | New-Item -ItemType Directory -Path $mods_folder -Force | Out-Null 29 | Get-ChildItem -File -Filter "*Super Factory Manager*" $mods_folder ` 30 | | ForEach-Object { 31 | Write-Host "Removing old version $_" 32 | Remove-Item -LiteralPath $_.FullName 33 | } 34 | Write-Host "Copying $jar to $($mods_folder)" 35 | Copy-Item -Path $jar -Destination $mods_folder 36 | } -------------------------------------------------------------------------------- /actions/Wipe jars summary dir.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem -File ..\..\jars ` 2 | | ForEach-Object { 3 | Write-Host "Removing $_" 4 | $_ | Remove-Item 5 | } -------------------------------------------------------------------------------- /emc_experiment/.gitignore: -------------------------------------------------------------------------------- 1 | items.json 2 | jei/ 3 | outputs/ -------------------------------------------------------------------------------- /emc_experiment/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.analysis.typeCheckingMode": "basic" 3 | } -------------------------------------------------------------------------------- /emc_experiment/emc_finder/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | results.txt 3 | processed.bin -------------------------------------------------------------------------------- /emc_experiment/emc_finder/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "emc_finder" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | bincode = "1.3.3" 8 | itertools = "0.13.0" 9 | rayon = "1.10.0" 10 | serde = { version = "1.0.209", features = ["derive"] } 11 | serde_json = "1.0.127" 12 | uuid = { version = "1.10.0", features = ["fast-rng", "v4"] } 13 | -------------------------------------------------------------------------------- /emc_experiment/emc_finder/rustfmt.toml: -------------------------------------------------------------------------------- 1 | imports_granularity = "Item" -------------------------------------------------------------------------------- /examples/02-retention.sfm: -------------------------------------------------------------------------------- 1 | name "retention" 2 | 3 | every 20 ticks do 4 | -- move all items except 1 from "a" to "b" 5 | input retain 1 from a 6 | output to b 7 | end 8 | 9 | 10 | every 20 ticks do 11 | -- move 25 items except 1 from "a" to "b" 12 | input 25 retain 1 from a 13 | output to b 14 | end 15 | 16 | 17 | every 20 ticks do 18 | -- move 25 red_sand items except 1 from "a" to "b" 19 | input 25 retain 1 red_sand from a 20 | output to b 21 | end 22 | 23 | 24 | every 20 ticks do 25 | -- move 20 red sand and all coal 26 | -- but leave 1 red sand 27 | input 28 | 20 retain 1 red_sand, 29 | retain 1 coal 30 | from a 31 | 32 | output to b 33 | end 34 | 35 | 36 | every 20 ticks do 37 | input from a 38 | output retain 1 to b 39 | -- only output until "b" has 1 item 40 | end 41 | 42 | every 20 ticks do 43 | input from a 44 | output 5 retain 20 red_sand to b 45 | -- accept 5 red sand at once, with "a" max of 20 in "b" 46 | end 47 | 48 | 49 | every 20 ticks do 50 | input 51 | 15 retain 5 iron_ingot, 52 | 12 retain 3 stone 53 | from "a" top side 54 | 55 | output 56 | 2 iron_ingot, 57 | 64 retain 10 stone 58 | to b 59 | 60 | -- moves all but 5 iron ingots to "b", 15 at a time 61 | -- moves up to 10 stone to "b", ensuring "a" keeps 3 stone 62 | -- "b" can accept up to 64 stone but "a" can only provide 12 at a time 63 | end -------------------------------------------------------------------------------- /examples/04-smelting.sfm: -------------------------------------------------------------------------------- 1 | name "smelting" 2 | 3 | every 20 ticks do 4 | input from chest 5 | 6 | output 7 | minecraft:oak_log -- items can be specified 8 | to furnace top side 9 | 10 | output 11 | coal, -- namespace defaults to "minecraft:" 12 | 1 retain 1 oak_log, -- limits are per-item 13 | charcoal 14 | to furnace bottom side 15 | end 16 | 17 | every 20 ticks do 18 | input from furnace bottom side 19 | output to chest 20 | end -------------------------------------------------------------------------------- /examples/05-each.sfm: -------------------------------------------------------------------------------- 1 | name "each" 2 | 3 | -- using every inventory labelled "c", move 5 items total 4 | -- "b" will receive 5 items, or whatever is available if less than 5. 5 | every 20 ticks do 6 | input 5 from c 7 | output to b 8 | end 9 | 10 | -- for every inventory labelled "a", 5 items will be moved 11 | -- "b" will receive |a| * 5 items 12 | every 20 ticks do 13 | input 5 from each a -- note the "each" keyword 14 | output to b 15 | end 16 | -------------------------------------------------------------------------------- /examples/06-slots.sfm: -------------------------------------------------------------------------------- 1 | name "slots" 2 | 3 | every 20 ticks do 4 | -- multiple slots can be specified, comma separated, also supporting ranges 5 | input from a top side slots 0,1,3-4, 5 6 | output to a slots 2 7 | end -------------------------------------------------------------------------------- /examples/07-redstone.sfm: -------------------------------------------------------------------------------- 1 | every redstone pulse do 2 | input from a 3 | output to b 4 | end 5 | 6 | every 20 ticks do 7 | if redstone ge 2 then 8 | input from a 9 | output to b 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /examples/08-fluids.sfm: -------------------------------------------------------------------------------- 1 | EVERY 20 TICKS DO 2 | INPUT fluid:minecraft:water from a BOTTOM SIDE 3 | OUTPUT fluid:*:* to b TOP SIDE 4 | END -------------------------------------------------------------------------------- /examples/WIP/alias.sfm: -------------------------------------------------------------------------------- 1 | -- not yet implemented. 2 | 3 | name "alias" 4 | 5 | every 20 ticks do 6 | INPUT FROM a BOTTOM SIDE SLOTS 0 AS ax 7 | IF ax has gt 10 iron THEN 8 | 9 | END 10 | end -------------------------------------------------------------------------------- /examples/random/alltheores.sfm: -------------------------------------------------------------------------------- 1 | name "ATO" 2 | 3 | every 20 ticks do 4 | input from coal top side 5 | input from alum top side 6 | output coal to furn bottom side 7 | output 2 alltheores:raw_aluminum to each furn top side 8 | end 9 | 10 | every 20 ticks do 11 | -- when not using quotes, "*" gets replaced by ".*" for convenience 12 | -- then the identifiers are treated as regular expressions 13 | input *:*ingot* from furn 14 | output to out 15 | end -------------------------------------------------------------------------------- /examples/random/forgeenergy.sfm: -------------------------------------------------------------------------------- 1 | name "energy" 2 | EVERY 20 TICKS DO 3 | INPUT 1000 sfm:forge_energy:forge:energy from a BOTTOM SIDE 4 | OUTPUT sfm:forge_energy:forge:energy to b TOP SIDE 5 | END 6 | 7 | --- 8 | 9 | every 20 ticks do 10 | input from a top side 11 | output to b top side 12 | end -------------------------------------------------------------------------------- /examples/random/mekanism.sfm: -------------------------------------------------------------------------------- 1 | every 20 ticks do 2 | input gas:mekanism:* from a bottom side 3 | output gas:mekanism:* to b bottom side 4 | end 5 | --- 6 | every 20 ticks do 7 | input infusion:mekanism:* from a bottom side 8 | output infusion:mekanism:* to b bottom side 9 | end 10 | --- 11 | every 20 ticks do 12 | input pigment:mekanism:* from a bottom side 13 | output pigment:mekanism:* to b bottom side 14 | end 15 | --- 16 | every 20 ticks do 17 | input slurry:alltheores:* from a bottom side 18 | output slurry:*:* to b bottom side 19 | end -------------------------------------------------------------------------------- /examples/random/patterns.sfm: -------------------------------------------------------------------------------- 1 | name "patterns" 2 | 3 | every 20 ticks do 4 | -- since we are using quotes, we must use ".*" instead of just "*" if we want to match all mods 5 | input ".*:(iron|copper)_ingot" from a 6 | output to b 7 | end 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 24 21:07:16 EDT 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /media/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/banner.png -------------------------------------------------------------------------------- /media/expansion cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/expansion cache.png -------------------------------------------------------------------------------- /media/many barrels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/many barrels.png -------------------------------------------------------------------------------- /media/pattern cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/pattern cache.png -------------------------------------------------------------------------------- /media/performance first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/performance first.png -------------------------------------------------------------------------------- /media/performance second.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/performance second.png -------------------------------------------------------------------------------- /media/predicate builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/predicate builder.png -------------------------------------------------------------------------------- /media/tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/tests.png -------------------------------------------------------------------------------- /media/vscode syntax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/media/vscode syntax.png -------------------------------------------------------------------------------- /notes.md: -------------------------------------------------------------------------------- 1 | # Logs 2 | 3 | - https://www.digyourselfout.app/ 4 | - https://mclo.gs/ 5 | 6 | # World Editing 7 | 8 | - https://www.amuletmc.com/ 9 | 10 | # Rendering 11 | 12 | - MagicaVoxel https://ephtracy.github.io/ 13 | - Gander https://github.com/CompactMods/Gander A world-to-screen rendering library 14 | 15 | # Tags 16 | 17 | - https://minecraft.wiki/w/Tag#List_of_tags 18 | 19 | # Text Editor Creation 20 | 21 | - [Coding My Own Text Editor Again (Ded S02E01) (youtube.com)](https://www.youtube.com/watch?v=w_yXlnjeAy4) 22 | 23 | # Action scripts 24 | 25 | - Resume propagate after merge conflicts resolved and committed 26 | 27 | # Modelling 28 | 29 | - [Block Display Models - A place for your Minecraft models (block-display.com)](https://block-display.com/) 30 | - [Blockbench](https://www.blockbench.net/) 31 | 32 | # Worldgen, datagen 33 | 34 | - https://github.com/misode/misode.github.io 35 | - https://misode.github.io/ 36 | - https://misode.github.io/worldgen/ 37 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | maven { url = 'https://maven.minecraftforge.net/' } 5 | maven { url = 'https://maven.parchmentmc.org' } 6 | } 7 | } -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/SFMBlockTags.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import ca.teamdman.sfm.common.registry.SFMBlocks; 5 | import ca.teamdman.sfm.datagen.version_plumbing.MCVersionAgnosticBlockTagsDataGen; 6 | import net.minecraft.tags.BlockTags; 7 | import net.minecraftforge.data.event.GatherDataEvent; 8 | 9 | public class SFMBlockTags extends MCVersionAgnosticBlockTagsDataGen { 10 | public SFMBlockTags(GatherDataEvent event) { 11 | super(event, SFM.MOD_ID); 12 | } 13 | 14 | @Override 15 | protected void addBlockTags() { 16 | tag(BlockTags.MINEABLE_WITH_PICKAXE) 17 | .add(SFMBlocks.CABLE_BLOCK.get()) 18 | .add(SFMBlocks.CABLE_FACADE_BLOCK.get()) 19 | .add(SFMBlocks.FANCY_CABLE_BLOCK.get()) 20 | .add(SFMBlocks.MANAGER_BLOCK.get()) 21 | // .add(SFMBlocks.TUNNELLED_MANAGER_BLOCK.get()) 22 | .add(SFMBlocks.PRINTING_PRESS_BLOCK.get()); 23 | tag(BlockTags.MINEABLE_WITH_AXE) 24 | .add(SFMBlocks.PRINTING_PRESS_BLOCK.get()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/SFMDatagen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import net.minecraftforge.data.event.GatherDataEvent; 5 | import net.minecraftforge.data.loading.DatagenModLoader; 6 | import net.minecraftforge.eventbus.api.SubscribeEvent; 7 | import net.minecraftforge.fml.common.Mod; 8 | 9 | @Mod.EventBusSubscriber(modid = SFM.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) 10 | public class SFMDatagen { 11 | @SubscribeEvent 12 | public static void onGather(GatherDataEvent event) { 13 | if (!DatagenModLoader.isRunningDataGen()) return; 14 | if (event.includeServer()) { 15 | event.getGenerator().addProvider(event.includeClient(), new SFMBlockStatesAndModels(event)); 16 | event.getGenerator().addProvider(event.includeClient(), new SFMItemModels(event)); 17 | event.getGenerator().addProvider(event.includeClient(), new SFMBlockTags(event)); 18 | event.getGenerator().addProvider(event.includeClient(), new SFMLootTables(event)); 19 | event.getGenerator().addProvider(event.includeClient(), new SFMRecipes(event)); 20 | event.getGenerator().addProvider(event.includeClient(), new SFMLanguageProvider(event)); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.datagen; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/version_plumbing/MCVersionAgnosticBlockStatesAndModelsDataGen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen.version_plumbing; 2 | 3 | import ca.teamdman.sfm.common.util.MCVersionDependentBehaviour; 4 | import net.minecraftforge.client.model.generators.BlockStateProvider; 5 | import net.minecraftforge.data.event.GatherDataEvent; 6 | 7 | public abstract class MCVersionAgnosticBlockStatesAndModelsDataGen extends BlockStateProvider { 8 | @MCVersionDependentBehaviour 9 | public MCVersionAgnosticBlockStatesAndModelsDataGen( 10 | GatherDataEvent event, 11 | String modId 12 | ) { 13 | super(event.getGenerator(), modId, event.getExistingFileHelper()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/version_plumbing/MCVersionAgnosticBlockTagsDataGen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen.version_plumbing; 2 | 3 | import ca.teamdman.sfm.common.util.MCVersionDependentBehaviour; 4 | import net.minecraft.data.tags.BlockTagsProvider; 5 | import net.minecraftforge.data.event.GatherDataEvent; 6 | 7 | public abstract class MCVersionAgnosticBlockTagsDataGen extends BlockTagsProvider { 8 | @MCVersionDependentBehaviour 9 | public MCVersionAgnosticBlockTagsDataGen( 10 | GatherDataEvent event, 11 | String modId 12 | ) { 13 | super( 14 | event.getGenerator(), 15 | modId, 16 | event.getExistingFileHelper() 17 | ); 18 | } 19 | 20 | protected abstract void addBlockTags(); 21 | 22 | @MCVersionDependentBehaviour 23 | @Override 24 | protected void addTags() { 25 | this.addBlockTags(); 26 | } 27 | 28 | @Override 29 | public String getName() { 30 | return modId + " Block Tags"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/version_plumbing/MCVersionAgnosticItemModelsDataGen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen.version_plumbing; 2 | 3 | import ca.teamdman.sfm.common.util.MCVersionDependentBehaviour; 4 | import net.minecraftforge.client.model.generators.ItemModelProvider; 5 | import net.minecraftforge.data.event.GatherDataEvent; 6 | 7 | public abstract class MCVersionAgnosticItemModelsDataGen extends ItemModelProvider { 8 | @MCVersionDependentBehaviour 9 | public MCVersionAgnosticItemModelsDataGen( 10 | GatherDataEvent event, 11 | String modId 12 | ) { 13 | super(event.getGenerator(), modId, event.getExistingFileHelper()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/version_plumbing/MCVersionAgnosticLanguageDataGen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen.version_plumbing; 2 | 3 | import ca.teamdman.sfm.common.util.MCVersionDependentBehaviour; 4 | import net.minecraftforge.common.data.LanguageProvider; 5 | import net.minecraftforge.data.event.GatherDataEvent; 6 | 7 | public abstract class MCVersionAgnosticLanguageDataGen extends LanguageProvider { 8 | @MCVersionDependentBehaviour 9 | public MCVersionAgnosticLanguageDataGen( 10 | GatherDataEvent event, 11 | String modId, 12 | String locale 13 | ) { 14 | super(event.getGenerator(), modId, locale); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/version_plumbing/MCVersionAgnosticRecipeDataGen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.datagen.version_plumbing; 2 | 3 | import net.minecraft.data.recipes.FinishedRecipe; 4 | import net.minecraft.data.recipes.RecipeProvider; 5 | import net.minecraft.data.recipes.ShapedRecipeBuilder; 6 | import net.minecraft.data.recipes.ShapelessRecipeBuilder; 7 | import net.minecraft.world.level.ItemLike; 8 | import net.minecraftforge.data.event.GatherDataEvent; 9 | 10 | import java.util.function.Consumer; 11 | 12 | @SuppressWarnings("SameParameterValue") 13 | public abstract class MCVersionAgnosticRecipeDataGen extends RecipeProvider { 14 | public MCVersionAgnosticRecipeDataGen(GatherDataEvent event, String modId) { 15 | super(event.getGenerator()); 16 | } 17 | 18 | @Override 19 | protected void buildCraftingRecipes(Consumer writer) { 20 | this.populate(writer); 21 | } 22 | 23 | protected abstract void populate(Consumer pConsumer); 24 | 25 | protected ShapedRecipeBuilder beginShaped(ItemLike result, int count) { 26 | return new ShapedRecipeBuilder(result, count); 27 | } 28 | 29 | protected ShapelessRecipeBuilder beginShapeless(ItemLike result, int count) { 30 | return new ShapelessRecipeBuilder(result, count); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/datagen/java/ca/teamdman/sfm/datagen/version_plumbing/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.datagen.version_plumbing; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/LeftRightManagerTest.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.gametest; 2 | 3 | import ca.teamdman.sfm.common.util.Stored; 4 | import net.minecraft.core.BlockPos; 5 | 6 | public class LeftRightManagerTest extends SFMTestBuilder { 7 | public LeftRightManagerTest(SFMGameTestHelper helper) { 8 | super(helper); 9 | } 10 | 11 | @Override 12 | protected void setupStructure(@Stored BlockPos offset) { 13 | setupChests(offset); 14 | setupManager(offset); 15 | } 16 | 17 | protected void setupChests(@Stored BlockPos offset) { 18 | addChest("left", new BlockPos(2, 2, 0).offset(offset)); 19 | addChest("right", new BlockPos(0, 2, 0).offset(offset)); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/LeftRightTopManagerTest.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.gametest; 2 | 3 | 4 | import ca.teamdman.sfm.common.util.NotStored; 5 | import net.minecraft.core.BlockPos; 6 | 7 | @SuppressWarnings("unused") 8 | public class LeftRightTopManagerTest extends LeftRightManagerTest { 9 | public LeftRightTopManagerTest(SFMGameTestHelper helper) { 10 | super(helper); 11 | } 12 | 13 | @Override 14 | protected void setupStructure(@NotStored BlockPos offset) { 15 | setupChests(offset.offset(0, 0, 1)); 16 | setupManager(offset.offset(0, 0, 1)); 17 | } 18 | 19 | @Override 20 | protected void setupChests(@NotStored BlockPos offset) { 21 | super.setupChests(offset); 22 | addChest("top", new BlockPos(1, 3, 0).offset(offset)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/SFMGameTest.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.gametest; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Classes annotated with this will have their methods scanned 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target({ElementType.METHOD, ElementType.TYPE}) 13 | public @interface SFMGameTest { 14 | } 15 | -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/SFMGameTestDefinition.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.gametest; 2 | 3 | import net.minecraft.gametest.framework.TestFunction; 4 | 5 | public abstract class SFMGameTestDefinition { 6 | public abstract String template(); 7 | public String templateModId() { 8 | return "sfm"; 9 | } 10 | 11 | public abstract void run(SFMGameTestHelper helper); 12 | 13 | public String batchName() { 14 | return "defaultBatch"; 15 | } 16 | 17 | public String testName() { 18 | return toSnakeCase(getClass().getSimpleName().replaceAll("GameTest$", "")); 19 | } 20 | 21 | public int maxTicks() { 22 | return 100; 23 | } 24 | 25 | public int setupTicks() { 26 | return 0; 27 | } 28 | 29 | public boolean required() { 30 | return true; 31 | } 32 | 33 | public TestFunction intoTestFunction() { 34 | return new SFMDelegatedTestFunction(this); 35 | } 36 | 37 | private String toSnakeCase(String input) { 38 | return 39 | input.replaceAll("([a-zA-Z])(\\d+)", "$1_$2") 40 | .replaceAll("(\\d+)([a-zA-Z])", "$1_$2") 41 | .replaceAll("([a-z])([A-Z])", "$1_$2") 42 | .toLowerCase(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/commands.txt: -------------------------------------------------------------------------------- 1 | For cleaning up when the `/test clear` didn't finish the job 2 | 3 | /fill ~-22 ~ ~-22 ~22 ~5 ~22 air 4 | 5 | 6 | For running faster 7 | 8 | /effect give @a minecraft:speed 9999 100 true -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/declarative/SFMTestBlockEntitySpec.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.gametest.declarative; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.world.level.block.Block; 5 | import net.minecraft.world.level.block.entity.BlockEntity; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | import java.util.function.Consumer; 9 | 10 | public record SFMTestBlockEntitySpec( 11 | String label, 12 | BlockPos posRelativeToManager, 13 | Block block, 14 | @Nullable Consumer blockEntityConfigurer 15 | ) { 16 | public static SFMTestBlockEntitySpec of( 17 | String label, 18 | BlockPos posRelativeToManager, 19 | Block block, 20 | @Nullable Consumer blockEntityConfigurer 21 | ) { 22 | return new SFMTestBlockEntitySpec<>(label, posRelativeToManager, block, blockEntityConfigurer); 23 | } 24 | 25 | public static SFMTestBlockEntitySpec of( 26 | String label, 27 | BlockPos posRelativeToManager, 28 | Block block 29 | ) { 30 | return new SFMTestBlockEntitySpec<>(label, posRelativeToManager, block, null); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/ae2/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat.ae2; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/dank/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat.dank; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/industrialforegoing/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat.industrialforegoing; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/mekanism/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat.mekanism; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/multiple/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat.multiple; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/compat/thermal/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.compat.thermal; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/general/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.general; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/migrated/MekanismNullIoDirectionGameTest.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.gametest.tests.migrated; 2 | 3 | import ca.teamdman.sfm.gametest.SFMGameTest; 4 | import ca.teamdman.sfm.gametest.SFMGameTestDefinition; 5 | import ca.teamdman.sfm.gametest.SFMGameTestHelper; 6 | 7 | /** 8 | * Migrated from SFMProgramLinterGameTests.mekanism_null_io_direction 9 | */ 10 | @SuppressWarnings({ 11 | "RedundantSuppression", 12 | "DataFlowIssue", 13 | "OptionalGetWithoutIsPresent", 14 | "DuplicatedCode", 15 | "ArraysAsListWithZeroOrOneArgument" 16 | }) 17 | @SFMGameTest 18 | public class MekanismNullIoDirectionGameTest extends SFMGameTestDefinition { 19 | 20 | @Override 21 | public String template() { 22 | return "3x2x1"; 23 | } 24 | 25 | @Override 26 | public void run(SFMGameTestHelper helper) { 27 | helper.succeed(); 28 | // TODO: Ensure there's a warning when interacting with a mekanism machine without a direction specified 29 | /* 30 | INPUT fe:: FROM cube1 31 | OUTPUT fe:: TO cube2 32 | 33 | should produce a warning 34 | 35 | */ 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/gametest/tests/migrated/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.gametest.tests.migrated; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/gametest/java/ca/teamdman/sfm/mixins/StructureTemplateManagerMixin.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.mixins; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import ca.teamdman.sfm.gametest.SFMStructureGenerator; 5 | import net.minecraft.resources.ResourceLocation; 6 | import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; 7 | import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | import java.util.Optional; 14 | 15 | @Mixin(value = StructureTemplateManager.class, priority = 0) 16 | public class StructureTemplateManagerMixin { 17 | // @Inject(method = "tryLoad", at = @At("HEAD"), cancellable = true) 18 | @Inject(method = "get", at = @At("HEAD"), cancellable = true) 19 | public void onTryLoad( 20 | ResourceLocation pId, 21 | CallbackInfoReturnable> cir 22 | ) { 23 | if (pId.getNamespace().equals(SFM.MOD_ID)) { 24 | cir.setReturnValue(SFMStructureGenerator.generateStructureTemplate(pId)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/gametest/resources/sfm.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8.3", 4 | "package": "ca.teamdman.sfm.mixins", 5 | "compatibilityLevel": "JAVA_17", 6 | "mixins": [ 7 | "StructureTemplateManagerMixin" 8 | ], 9 | "client": [ 10 | ], 11 | "server": [], 12 | "injectors": { 13 | "defaultRequire": 1 14 | } 15 | } -------------------------------------------------------------------------------- /src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2: -------------------------------------------------------------------------------- 1 | // 1.19.2 2025-02-17T16:45:15.2140485 LootTables 2 | 5286db740244722d7db672fc22de815fdd8ab330 data/sfm/loot_tables/blocks/cable.json 3 | 5286db740244722d7db672fc22de815fdd8ab330 data/sfm/loot_tables/blocks/cable_facade.json 4 | 9362833df3c9ef338cf4648460e7e1185154e2d7 data/sfm/loot_tables/blocks/fancy_cable.json 5 | 9362833df3c9ef338cf4648460e7e1185154e2d7 data/sfm/loot_tables/blocks/fancy_cable_facade.json 6 | ef4bb95208a13cbe51de891c102654406caee78e data/sfm/loot_tables/blocks/manager.json 7 | c0a6bdf7e2d285eb10d05e1515ffede8d52f6c0f data/sfm/loot_tables/blocks/printing_press.json 8 | 27422621ac079ae70ed818918f4b2cbd190547f0 data/sfm/loot_tables/blocks/water_tank.json 9 | -------------------------------------------------------------------------------- /src/generated/resources/.cache/726a4eaaa226cb50028c5f3f85d691417b67903b: -------------------------------------------------------------------------------- 1 | // 1.19.2 2025-02-17T16:45:15.2140485 Item Models: sfm 2 | 8518af52bb22ef1d984719f3534ff29e08cca857 assets/sfm/models/item/cable.json 3 | bee75adb2bb431a6b671015aa9bac0d68a98f5fb assets/sfm/models/item/disk.json 4 | 3b5be3966b540f1e99a3d6fd8836ad39bf937e96 assets/sfm/models/item/fancy_cable.json 5 | 2c8c32d785bfc59bf23083eff8838054ee580570 assets/sfm/models/item/form.json 6 | a74b029bcf88d674c6a4c4eaece9426cfd9c4533 assets/sfm/models/item/form_base.json 7 | a70b1032681b30f1066fdfb8b28870e87e51c261 assets/sfm/models/item/labelgun.json 8 | e945e739059a159bb1d4de5af118d412b50aae6c assets/sfm/models/item/manager.json 9 | d35a3dbb1180878d85e94f3f00812e5f34a4b2da assets/sfm/models/item/network_tool.json 10 | cd81e93f92577f247bb4bd12e01494d83e0733ce assets/sfm/models/item/printing_press.json 11 | d77c035fcc24eea6601b7089df59b28edd863c10 assets/sfm/models/item/water_tank.json 12 | 473c0d96aa35fd20318e3ae56e6671d6e31932f9 assets/sfm/models/item/xp_goop.json 13 | 4eaa10f5637abc652dcd063263148ea9b1895397 assets/sfm/models/item/xp_shard.json 14 | -------------------------------------------------------------------------------- /src/generated/resources/.cache/bf0ffec7956ce36aba0a993095f41e47d655813b: -------------------------------------------------------------------------------- 1 | // 1.19.2 2025-02-17T16:45:15.2150484 Block States: sfm 2 | f303dc233cde263e111cfdb2e2cbc48b93521724 assets/sfm/blockstates/cable.json 3 | f303dc233cde263e111cfdb2e2cbc48b93521724 assets/sfm/blockstates/cable_facade.json 4 | 0a672c9322f8bb4628d2c78d1f2d4edf3099aa31 assets/sfm/blockstates/fancy_cable.json 5 | 0a672c9322f8bb4628d2c78d1f2d4edf3099aa31 assets/sfm/blockstates/fancy_cable_facade.json 6 | 01e9d7d54169b7f6bbd287f4b896629f66f25305 assets/sfm/blockstates/manager.json 7 | a351025a2054b6ce2ddc21dc14734cc8b5b635bc assets/sfm/blockstates/printing_press.json 8 | 9be344941a18ad0d8dccbcd6536d52bf7295c1c8 assets/sfm/blockstates/test_barrel.json 9 | f629d3d23ca3e52dc1dcd0d8f94fb9081b9c315c assets/sfm/blockstates/test_barrel_tank.json 10 | f3c25839c6554e631061f91277bc687aebc38fd7 assets/sfm/blockstates/water_tank.json 11 | a76567fd4e65d191d69cf166b98776786d47a8e2 assets/sfm/models/block/cable.json 12 | 7b8c954b87699a007b3d7aa3558bf7892b838975 assets/sfm/models/block/fancy_cable_connection.json 13 | 7ba1003f6a1c077779c8e51166e1d134874844a8 assets/sfm/models/block/fancy_cable_core.json 14 | 953313d31931040aa2bd9a8742d4a54a2c632b8d assets/sfm/models/block/manager.json 15 | 369e3217e52fc9f71d3e4a83b9175bb4e36dbac0 assets/sfm/models/block/test_barrel_tank.json 16 | 220cea2f958589873eff05d62905d9e088c08951 assets/sfm/models/block/water_tank_active.json 17 | 5c39779ee6f051e682c82c8534c2fae85779747d assets/sfm/models/block/water_tank_inactive.json 18 | -------------------------------------------------------------------------------- /src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8: -------------------------------------------------------------------------------- 1 | // 1.19.2 2025-03-26T13:46:02.7833951 Languages: en_us 2 | 86101c61ca09738917f80ce7313402c3d7017a11 assets/sfm/lang/en_us.json 3 | -------------------------------------------------------------------------------- /src/generated/resources/.cache/e178a5522f40c551aab415c9b173854697679d35: -------------------------------------------------------------------------------- 1 | // 1.19.2 2025-02-17T16:45:15.2110485 sfm Block Tags 2 | 22c0d1933af00895b3b1fad66a738923e2f3b362 data/minecraft/tags/blocks/mineable/axe.json 3 | 9cefc22a73f22386627275687ae17e7c129083dd data/minecraft/tags/blocks/mineable/pickaxe.json 4 | -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "sfm:block/cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/cable_facade.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "sfm:block/cable" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/fancy_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "sfm:block/fancy_cable_core" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "sfm:block/fancy_cable_connection", 11 | "x": 90 12 | }, 13 | "when": { 14 | "down": "true" 15 | } 16 | }, 17 | { 18 | "apply": { 19 | "model": "sfm:block/fancy_cable_connection", 20 | "x": 270 21 | }, 22 | "when": { 23 | "up": "true" 24 | } 25 | }, 26 | { 27 | "apply": { 28 | "model": "sfm:block/fancy_cable_connection" 29 | }, 30 | "when": { 31 | "north": "true" 32 | } 33 | }, 34 | { 35 | "apply": { 36 | "model": "sfm:block/fancy_cable_connection", 37 | "y": 180 38 | }, 39 | "when": { 40 | "south": "true" 41 | } 42 | }, 43 | { 44 | "apply": { 45 | "model": "sfm:block/fancy_cable_connection", 46 | "y": 270 47 | }, 48 | "when": { 49 | "west": "true" 50 | } 51 | }, 52 | { 53 | "apply": { 54 | "model": "sfm:block/fancy_cable_connection", 55 | "y": 90 56 | }, 57 | "when": { 58 | "east": "true" 59 | } 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/fancy_cable_facade.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "sfm:block/fancy_cable_core" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "sfm:block/fancy_cable_connection", 11 | "x": 90 12 | }, 13 | "when": { 14 | "down": "true" 15 | } 16 | }, 17 | { 18 | "apply": { 19 | "model": "sfm:block/fancy_cable_connection", 20 | "x": 270 21 | }, 22 | "when": { 23 | "up": "true" 24 | } 25 | }, 26 | { 27 | "apply": { 28 | "model": "sfm:block/fancy_cable_connection" 29 | }, 30 | "when": { 31 | "north": "true" 32 | } 33 | }, 34 | { 35 | "apply": { 36 | "model": "sfm:block/fancy_cable_connection", 37 | "y": 180 38 | }, 39 | "when": { 40 | "south": "true" 41 | } 42 | }, 43 | { 44 | "apply": { 45 | "model": "sfm:block/fancy_cable_connection", 46 | "y": 270 47 | }, 48 | "when": { 49 | "west": "true" 50 | } 51 | }, 52 | { 53 | "apply": { 54 | "model": "sfm:block/fancy_cable_connection", 55 | "y": 90 56 | }, 57 | "when": { 58 | "east": "true" 59 | } 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/manager.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "sfm:block/manager" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/printing_press.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "sfm:block/printing_press" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/test_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "facing=down,open=false": { 4 | "model": "minecraft:block/barrel", 5 | "x": 180 6 | }, 7 | "facing=down,open=true": { 8 | "model": "minecraft:block/barrel_open", 9 | "x": 180 10 | }, 11 | "facing=east,open=false": { 12 | "model": "minecraft:block/barrel", 13 | "x": 90, 14 | "y": 90 15 | }, 16 | "facing=east,open=true": { 17 | "model": "minecraft:block/barrel_open", 18 | "x": 90, 19 | "y": 90 20 | }, 21 | "facing=north,open=false": { 22 | "model": "minecraft:block/barrel", 23 | "x": 90 24 | }, 25 | "facing=north,open=true": { 26 | "model": "minecraft:block/barrel_open", 27 | "x": 90 28 | }, 29 | "facing=south,open=false": { 30 | "model": "minecraft:block/barrel", 31 | "x": 90, 32 | "y": 180 33 | }, 34 | "facing=south,open=true": { 35 | "model": "minecraft:block/barrel_open", 36 | "x": 90, 37 | "y": 180 38 | }, 39 | "facing=up,open=false": { 40 | "model": "minecraft:block/barrel" 41 | }, 42 | "facing=up,open=true": { 43 | "model": "minecraft:block/barrel_open" 44 | }, 45 | "facing=west,open=false": { 46 | "model": "minecraft:block/barrel", 47 | "x": 90, 48 | "y": 270 49 | }, 50 | "facing=west,open=true": { 51 | "model": "minecraft:block/barrel_open", 52 | "x": 90, 53 | "y": 270 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/test_barrel_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "sfm:block/test_barrel_tank" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/blockstates/water_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "in_water=false": { 4 | "model": "sfm:block/water_tank_inactive" 5 | }, 6 | "in_water=true": { 7 | "model": "sfm:block/water_tank_active" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/block/cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "sfm:block/cable" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/block/manager.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_bottom_top", 3 | "textures": { 4 | "bottom": "sfm:block/manager_bot", 5 | "particle": "#top", 6 | "side": "sfm:block/manager_side", 7 | "top": "sfm:block/manager_top" 8 | } 9 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/block/test_barrel_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "sfm:block/test_barrel_tank", 5 | "particle": "#all" 6 | } 7 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/block/water_tank_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "sfm:block/water_intake_active" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/block/water_tank_inactive.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "sfm:block/water_intake_inactive" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "sfm:block/cable" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/disk.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "sfm:item/disk" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/fancy_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "sfm:block/fancy_cable_core" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/form.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:builtin/entity", 3 | "gui_light": "front" 4 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/form_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "sfm:item/form" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/labelgun.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "sfm:item/labelgun" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/manager.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "sfm:block/manager" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/network_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "sfm:item/network_tool" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/printing_press.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "sfm:block/printing_press" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/water_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "sfm:block/water_tank_active" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/xp_goop.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "sfm:item/xp_goop" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/sfm/models/item/xp_shard.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "sfm:item/xp_shard" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/recipes/disk_reset.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "sfm:disk_reset" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/recipes/label_gun_reset.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "sfm:label_gun_reset" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "sfm:printing_press" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "sfm:cable", 4 | "sfm:cable_facade", 5 | "sfm:fancy_cable", 6 | "sfm:manager", 7 | "sfm:printing_press" 8 | ] 9 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_chest": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "tag": "forge:chests" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_iron_ingot": { 15 | "conditions": { 16 | "items": [ 17 | { 18 | "items": [ 19 | "minecraft:iron_ingot" 20 | ] 21 | } 22 | ] 23 | }, 24 | "trigger": "minecraft:inventory_changed" 25 | }, 26 | "has_the_recipe": { 27 | "conditions": { 28 | "recipe": "sfm:cable" 29 | }, 30 | "trigger": "minecraft:recipe_unlocked" 31 | } 32 | }, 33 | "requirements": [ 34 | [ 35 | "has_iron_ingot", 36 | "has_chest", 37 | "has_the_recipe" 38 | ] 39 | ], 40 | "rewards": { 41 | "recipes": [ 42 | "sfm:cable" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/disk.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_redstone": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": [ 9 | "minecraft:redstone" 10 | ] 11 | } 12 | ] 13 | }, 14 | "trigger": "minecraft:inventory_changed" 15 | }, 16 | "has_the_recipe": { 17 | "conditions": { 18 | "recipe": "sfm:disk" 19 | }, 20 | "trigger": "minecraft:recipe_unlocked" 21 | } 22 | }, 23 | "requirements": [ 24 | [ 25 | "has_redstone", 26 | "has_the_recipe" 27 | ] 28 | ], 29 | "rewards": { 30 | "recipes": [ 31 | "sfm:disk" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/fancy_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_chest": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "tag": "forge:chests" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_iron_ingot": { 15 | "conditions": { 16 | "items": [ 17 | { 18 | "items": [ 19 | "minecraft:iron_ingot" 20 | ] 21 | } 22 | ] 23 | }, 24 | "trigger": "minecraft:inventory_changed" 25 | }, 26 | "has_the_recipe": { 27 | "conditions": { 28 | "recipe": "sfm:fancy_cable" 29 | }, 30 | "trigger": "minecraft:recipe_unlocked" 31 | } 32 | }, 33 | "requirements": [ 34 | [ 35 | "has_iron_ingot", 36 | "has_chest", 37 | "has_the_recipe" 38 | ] 39 | ], 40 | "rewards": { 41 | "recipes": [ 42 | "sfm:fancy_cable" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/fancy_to_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_chest": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "tag": "forge:chests" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_iron_ingot": { 15 | "conditions": { 16 | "items": [ 17 | { 18 | "items": [ 19 | "minecraft:iron_ingot" 20 | ] 21 | } 22 | ] 23 | }, 24 | "trigger": "minecraft:inventory_changed" 25 | }, 26 | "has_the_recipe": { 27 | "conditions": { 28 | "recipe": "sfm:fancy_to_cable" 29 | }, 30 | "trigger": "minecraft:recipe_unlocked" 31 | } 32 | }, 33 | "requirements": [ 34 | [ 35 | "has_iron_ingot", 36 | "has_chest", 37 | "has_the_recipe" 38 | ] 39 | ], 40 | "rewards": { 41 | "recipes": [ 42 | "sfm:fancy_to_cable" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/labelgun.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_ink": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "tag": "forge:dyes/black" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_the_recipe": { 15 | "conditions": { 16 | "recipe": "sfm:labelgun" 17 | }, 18 | "trigger": "minecraft:recipe_unlocked" 19 | } 20 | }, 21 | "requirements": [ 22 | [ 23 | "has_ink", 24 | "has_the_recipe" 25 | ] 26 | ], 27 | "rewards": { 28 | "recipes": [ 29 | "sfm:labelgun" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/manager.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_chest": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "tag": "forge:chests" 9 | } 10 | ] 11 | }, 12 | "trigger": "minecraft:inventory_changed" 13 | }, 14 | "has_iron_ingot": { 15 | "conditions": { 16 | "items": [ 17 | { 18 | "items": [ 19 | "minecraft:iron_ingot" 20 | ] 21 | } 22 | ] 23 | }, 24 | "trigger": "minecraft:inventory_changed" 25 | }, 26 | "has_the_recipe": { 27 | "conditions": { 28 | "recipe": "sfm:manager" 29 | }, 30 | "trigger": "minecraft:recipe_unlocked" 31 | } 32 | }, 33 | "requirements": [ 34 | [ 35 | "has_iron_ingot", 36 | "has_chest", 37 | "has_the_recipe" 38 | ] 39 | ], 40 | "rewards": { 41 | "recipes": [ 42 | "sfm:manager" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/network_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_redstone_lamp": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": [ 9 | "minecraft:redstone_lamp" 10 | ] 11 | } 12 | ] 13 | }, 14 | "trigger": "minecraft:inventory_changed" 15 | }, 16 | "has_the_recipe": { 17 | "conditions": { 18 | "recipe": "sfm:network_tool" 19 | }, 20 | "trigger": "minecraft:recipe_unlocked" 21 | } 22 | }, 23 | "requirements": [ 24 | [ 25 | "has_redstone_lamp", 26 | "has_the_recipe" 27 | ] 28 | ], 29 | "rewards": { 30 | "recipes": [ 31 | "sfm:network_tool" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/printing_press.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_iron": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": [ 9 | "minecraft:iron_ingot" 10 | ] 11 | } 12 | ] 13 | }, 14 | "trigger": "minecraft:inventory_changed" 15 | }, 16 | "has_the_recipe": { 17 | "conditions": { 18 | "recipe": "sfm:printing_press" 19 | }, 20 | "trigger": "minecraft:recipe_unlocked" 21 | } 22 | }, 23 | "requirements": [ 24 | [ 25 | "has_iron", 26 | "has_the_recipe" 27 | ] 28 | ], 29 | "rewards": { 30 | "recipes": [ 31 | "sfm:printing_press" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/water_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_the_recipe": { 5 | "conditions": { 6 | "recipe": "sfm:water_tank" 7 | }, 8 | "trigger": "minecraft:recipe_unlocked" 9 | }, 10 | "has_water": { 11 | "conditions": { 12 | "items": [ 13 | { 14 | "items": [ 15 | "minecraft:water_bucket" 16 | ] 17 | } 18 | ] 19 | }, 20 | "trigger": "minecraft:inventory_changed" 21 | } 22 | }, 23 | "requirements": [ 24 | [ 25 | "has_water", 26 | "has_the_recipe" 27 | ] 28 | ], 29 | "rewards": { 30 | "recipes": [ 31 | "sfm:water_tank" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/advancements/recipes/sfm/xp_goop.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "criteria": { 4 | "has_experience_shard": { 5 | "conditions": { 6 | "items": [ 7 | { 8 | "items": [ 9 | "sfm:xp_shard" 10 | ] 11 | } 12 | ] 13 | }, 14 | "trigger": "minecraft:inventory_changed" 15 | }, 16 | "has_the_recipe": { 17 | "conditions": { 18 | "recipe": "sfm:xp_goop" 19 | }, 20 | "trigger": "minecraft:recipe_unlocked" 21 | } 22 | }, 23 | "requirements": [ 24 | [ 25 | "has_experience_shard", 26 | "has_the_recipe" 27 | ] 28 | ], 29 | "rewards": { 30 | "recipes": [ 31 | "sfm:xp_goop" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/cable_facade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/fancy_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:fancy_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/fancy_cable_facade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:fancy_cable" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/manager.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:manager" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/printing_press.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:printing_press" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/loot_tables/blocks/water_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "sfm:water_tank" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "B": { 5 | "item": "minecraft:iron_bars" 6 | }, 7 | "C": { 8 | "tag": "forge:chests" 9 | }, 10 | "D": { 11 | "tag": "forge:dyes/black" 12 | }, 13 | "G": { 14 | "item": "minecraft:light_weighted_pressure_plate" 15 | } 16 | }, 17 | "pattern": [ 18 | "DGD", 19 | "BCB", 20 | "DGD" 21 | ], 22 | "result": { 23 | "count": 16, 24 | "item": "sfm:cable" 25 | } 26 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/disk.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "R": { 5 | "item": "minecraft:redstone_block" 6 | }, 7 | "a": { 8 | "tag": "forge:dyes/red" 9 | }, 10 | "b": { 11 | "tag": "forge:dyes/green" 12 | }, 13 | "c": { 14 | "tag": "forge:dyes/blue" 15 | }, 16 | "d": { 17 | "item": "minecraft:repeater" 18 | }, 19 | "e": { 20 | "item": "minecraft:redstone" 21 | }, 22 | "p": { 23 | "item": "minecraft:paper" 24 | } 25 | }, 26 | "pattern": [ 27 | "pbp", 28 | "aRc", 29 | "ede" 30 | ], 31 | "result": { 32 | "item": "sfm:disk" 33 | } 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/enchanted_book_copy.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "sfm:printing_press", 3 | "form": { 4 | "item": "minecraft:enchanted_book" 5 | }, 6 | "ink": { 7 | "item": "sfm:xp_goop" 8 | }, 9 | "paper": { 10 | "item": "minecraft:book" 11 | } 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/fancy_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "sfm:cable" 6 | } 7 | ], 8 | "result": { 9 | "item": "sfm:fancy_cable" 10 | } 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/fancy_to_cable.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "sfm:fancy_cable" 6 | } 7 | ], 8 | "result": { 9 | "item": "sfm:cable" 10 | } 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/labelgun.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "B": { 5 | "tag": "forge:dyes/black" 6 | }, 7 | "C": { 8 | "tag": "minecraft:signs" 9 | }, 10 | "L": { 11 | "tag": "forge:dyes/blue" 12 | }, 13 | "S": { 14 | "tag": "forge:rods/wooden" 15 | } 16 | }, 17 | "pattern": [ 18 | " LC", 19 | " SB", 20 | "S " 21 | ], 22 | "result": { 23 | "item": "sfm:labelgun" 24 | } 25 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/manager.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "A": { 5 | "tag": "forge:chests" 6 | }, 7 | "B": { 8 | "item": "sfm:cable" 9 | }, 10 | "C": { 11 | "item": "minecraft:repeater" 12 | } 13 | }, 14 | "pattern": [ 15 | "ABA", 16 | "BCB", 17 | "ABA" 18 | ], 19 | "result": { 20 | "item": "sfm:manager" 21 | } 22 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/map_copy.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "sfm:printing_press", 3 | "form": { 4 | "item": "minecraft:filled_map" 5 | }, 6 | "ink": { 7 | "tag": "forge:dyes/black" 8 | }, 9 | "paper": { 10 | "item": "minecraft:map" 11 | } 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/network_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "C": { 5 | "tag": "minecraft:signs" 6 | }, 7 | "L": { 8 | "item": "minecraft:redstone_lamp" 9 | }, 10 | "P": { 11 | "item": "minecraft:heavy_weighted_pressure_plate" 12 | }, 13 | "S": { 14 | "item": "minecraft:iron_ingot" 15 | } 16 | }, 17 | "pattern": [ 18 | " LC", 19 | " SP", 20 | "S " 21 | ], 22 | "result": { 23 | "item": "sfm:network_tool" 24 | } 25 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/printing_press.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "a": { 5 | "item": "minecraft:anvil" 6 | }, 7 | "g": { 8 | "item": "minecraft:iron_bars" 9 | }, 10 | "i": { 11 | "tag": "forge:dyes/black" 12 | }, 13 | "p": { 14 | "item": "minecraft:light_weighted_pressure_plate" 15 | }, 16 | "s": { 17 | "item": "minecraft:stone" 18 | }, 19 | "x": { 20 | "item": "minecraft:piston" 21 | } 22 | }, 23 | "pattern": [ 24 | "pip", 25 | "sas", 26 | "gxg" 27 | ], 28 | "result": { 29 | "item": "sfm:printing_press" 30 | } 31 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/program_copy.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "sfm:printing_press", 3 | "form": { 4 | "item": "sfm:disk" 5 | }, 6 | "ink": { 7 | "tag": "forge:dyes/black" 8 | }, 9 | "paper": { 10 | "item": "sfm:disk" 11 | } 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/water_tank.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "key": { 4 | "b": { 5 | "item": "minecraft:water_bucket" 6 | }, 7 | "g": { 8 | "item": "minecraft:iron_bars" 9 | }, 10 | "p": { 11 | "item": "minecraft:light_weighted_pressure_plate" 12 | } 13 | }, 14 | "pattern": [ 15 | "gbg", 16 | "gpg", 17 | "gbg" 18 | ], 19 | "result": { 20 | "item": "sfm:water_tank" 21 | } 22 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/written_book_copy.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "sfm:printing_press", 3 | "form": { 4 | "item": "minecraft:written_book" 5 | }, 6 | "ink": { 7 | "tag": "forge:dyes/black" 8 | }, 9 | "paper": { 10 | "item": "minecraft:book" 11 | } 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/sfm/recipes/xp_goop.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "sfm:xp_shard" 6 | }, 7 | { 8 | "item": "sfm:xp_shard" 9 | }, 10 | { 11 | "item": "sfm:xp_shard" 12 | }, 13 | { 14 | "item": "sfm:xp_shard" 15 | }, 16 | { 17 | "item": "sfm:xp_shard" 18 | }, 19 | { 20 | "item": "sfm:xp_shard" 21 | }, 22 | { 23 | "item": "sfm:xp_shard" 24 | }, 25 | { 26 | "item": "sfm:xp_shard" 27 | }, 28 | { 29 | "item": "sfm:xp_shard" 30 | } 31 | ], 32 | "result": { 33 | "item": "sfm:xp_goop" 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/SFMPerformanceTweaks.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm; 2 | 3 | import ca.teamdman.sfm.common.util.SFMEnvironmentUtils; 4 | 5 | /** 6 | * Allows for disabling certain performance tweaks for analysis and debugging purposes 7 | */ 8 | public class SFMPerformanceTweaks { 9 | public static final boolean OBJECT_POOL_VALIDATION = SFMEnvironmentUtils.isInIDE(); 10 | public static final boolean OBJECT_POOL_ENABLED = true; 11 | public static final boolean REGEX_CACHE_ENABLED = true; 12 | public static final boolean REGEX_PREDICATE_OPTIMIZATION = true; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/ClientKeyHelpers.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client; 2 | 3 | import com.mojang.blaze3d.platform.InputConstants; 4 | import net.minecraft.client.KeyMapping; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraftforge.common.util.Lazy; 7 | 8 | public class ClientKeyHelpers { 9 | public static boolean isKeyDownInScreenOrWorld(Lazy key) { 10 | if (key.get().getKey().equals(InputConstants.UNKNOWN)) { 11 | return false; 12 | } 13 | // special effort is needed to ensure this works properly when the manager screen is open 14 | // https://github.com/mekanism/Mekanism/blob/f92b48a49e0766cd3aa78e95c9c4a47ba90402f5/src/main/java/mekanism/client/key/MekKeyHandler.java 15 | long handle = Minecraft.getInstance().getWindow().getWindow(); 16 | return InputConstants.isKeyDown( 17 | handle, 18 | key.get().getKey().getValue() 19 | ); 20 | } 21 | public static boolean isKeyDownInWorld(Lazy key) { 22 | if (key.get().getKey().equals(InputConstants.UNKNOWN)) { 23 | return false; 24 | } 25 | return key.get().isDown(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/ClientRayCastHelpers.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client; 2 | 3 | import ca.teamdman.sfm.common.util.SFMEnvironmentUtils; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.multiplayer.ClientLevel; 6 | import net.minecraft.world.level.block.entity.BlockEntity; 7 | import net.minecraft.world.phys.BlockHitResult; 8 | import net.minecraft.world.phys.HitResult; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class ClientRayCastHelpers { 12 | public static @Nullable BlockEntity getLookBlockEntity() { 13 | if (!SFMEnvironmentUtils.isClient()) { 14 | throw new IllegalCallerException("getLookBlockEntity must be called on client"); 15 | } 16 | ClientLevel level = Minecraft.getInstance().level; 17 | if (level == null) return null; 18 | HitResult hr = Minecraft.getInstance().hitResult; 19 | if (hr == null) return null; 20 | if (hr.getType() != HitResult.Type.BLOCK) return null; 21 | var pos = ((BlockHitResult) hr).getBlockPos(); 22 | return level.getBlockEntity(pos); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/ClientTranslationHelpers.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client; 2 | 3 | import net.minecraft.client.resources.language.I18n; 4 | import net.minecraft.network.chat.contents.TranslatableContents; 5 | 6 | public class ClientTranslationHelpers { 7 | public static String resolveTranslation(TranslatableContents contents) { 8 | return I18n.get(contents.getKey(), contents.getArgs()); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.gui; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/screen/ExampleEditScreenOpenContext.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.gui.screen; 2 | 3 | import ca.teamdman.sfm.common.program.LabelPositionHolder; 4 | 5 | import java.util.Map; 6 | import java.util.function.Consumer; 7 | 8 | public record ExampleEditScreenOpenContext( 9 | String exampleProgrmaString, 10 | String diskProgramString, 11 | Map templates, 12 | LabelPositionHolder labelPositionHolder, 13 | Consumer saveCallback 14 | ) { 15 | public boolean equalsAnyTemplate(String content) { 16 | return templates().values().stream().anyMatch(content::equals); 17 | } 18 | 19 | /** 20 | * Check if it is safe to overwrite the disk with a new program. 21 | * If the disk is empty, it is safe to overwrite. 22 | * If the disk contains a template, it is safe to overwrite. 23 | * @return true if it is safe to overwrite the disk, false otherwise 24 | */ 25 | public boolean isSafeToOverwriteDisk() { 26 | if (diskProgramString().isBlank()) return true; 27 | return equalsAnyTemplate(this.diskProgramString()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/screen/ProgramEditScreenOpenContext.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.gui.screen; 2 | 3 | import ca.teamdman.sfm.common.program.LabelPositionHolder; 4 | 5 | import java.util.function.Consumer; 6 | 7 | public record ProgramEditScreenOpenContext( 8 | String programString, 9 | LabelPositionHolder labelPositionHolder, 10 | Consumer saveCallback 11 | ) { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/screen/TomlEditScreen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.gui.screen; 2 | 3 | import ca.teamdman.sfm.common.program.LabelPositionHolder; 4 | 5 | public class TomlEditScreen extends ProgramEditorScreen { 6 | public TomlEditScreen( 7 | TomlEditScreenOpenContext openContext 8 | ) { 9 | super(new ProgramEditScreenOpenContext( 10 | openContext.textContents(), 11 | LabelPositionHolder.empty(), 12 | openContext.saveCallback() 13 | )); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/screen/TomlEditScreenOpenContext.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.gui.screen; 2 | 3 | import java.util.function.Consumer; 4 | 5 | public record TomlEditScreenOpenContext( 6 | String textContents, 7 | Consumer saveCallback 8 | ) { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/screen/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.gui.screen; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/widget/PickListItem.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.gui.widget; 2 | 3 | import net.minecraft.network.chat.Component; 4 | 5 | public interface PickListItem { 6 | Component getComponent(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/widget/SFMExtendedButtonWithTooltip.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.gui.widget; 2 | 3 | import ca.teamdman.sfm.common.util.MCVersionDependentBehaviour; 4 | import com.mojang.blaze3d.vertex.PoseStack; 5 | import net.minecraft.network.chat.Component; 6 | 7 | public class SFMExtendedButtonWithTooltip extends SFMExtendedButton { 8 | private final OnTooltip TOOLTIP; 9 | 10 | @MCVersionDependentBehaviour 11 | public SFMExtendedButtonWithTooltip( 12 | int xPos, 13 | int yPos, 14 | int width, 15 | int height, 16 | Component displayString, 17 | OnPress handler, 18 | OnTooltip tooltip 19 | ) { 20 | super(xPos, yPos, width, height, displayString, handler); 21 | TOOLTIP = tooltip; 22 | } 23 | 24 | @MCVersionDependentBehaviour 25 | @Override 26 | public void renderToolTip(PoseStack pose, int mx, int my) { 27 | if (isHovered && visible) { 28 | TOOLTIP.onTooltip(this, pose, mx, my); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/gui/widget/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.gui.widget; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/handler/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.handler; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/jei/FallingAnvilDisenchantRecipe.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.jei; 2 | 3 | public class FallingAnvilDisenchantRecipe extends FallingAnvilRecipe { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/jei/FallingAnvilExperienceShardRecipe.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.jei; 2 | 3 | public class FallingAnvilExperienceShardRecipe extends FallingAnvilRecipe { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/jei/FallingAnvilFormRecipe.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.jei; 2 | 3 | import ca.teamdman.sfm.common.recipe.PrintingPressRecipe; 4 | 5 | public class FallingAnvilFormRecipe extends FallingAnvilRecipe { 6 | public final PrintingPressRecipe PARENT; 7 | 8 | public FallingAnvilFormRecipe(PrintingPressRecipe parent) { 9 | this.PARENT = parent; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/jei/FallingAnvilRecipe.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.jei; 2 | 3 | public class FallingAnvilRecipe { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/jei/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.jei; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/registry/SFMBlockColors.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.registry; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import ca.teamdman.sfm.client.render.FacadeBlockColor; 5 | import ca.teamdman.sfm.common.registry.SFMBlocks; 6 | import net.minecraftforge.api.distmarker.Dist; 7 | import net.minecraftforge.client.event.RegisterColorHandlersEvent; 8 | import net.minecraftforge.eventbus.api.SubscribeEvent; 9 | import net.minecraftforge.fml.common.Mod; 10 | 11 | @Mod.EventBusSubscriber(modid = SFM.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) 12 | public class SFMBlockColors { 13 | @SubscribeEvent 14 | public static void registerBlockColor(RegisterColorHandlersEvent.Block event) { 15 | FacadeBlockColor blockColor = new FacadeBlockColor(); 16 | event.register(blockColor, SFMBlocks.CABLE_FACADE_BLOCK.get()); 17 | event.register(blockColor, SFMBlocks.FANCY_CABLE_FACADE_BLOCK.get()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/registry/SFMBlockEntityRenderers.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.registry; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import ca.teamdman.sfm.client.render.PrintingPressBlockEntityRenderer; 5 | import ca.teamdman.sfm.common.registry.SFMBlockEntities; 6 | import net.minecraftforge.api.distmarker.Dist; 7 | import net.minecraftforge.client.event.EntityRenderersEvent; 8 | import net.minecraftforge.eventbus.api.SubscribeEvent; 9 | import net.minecraftforge.fml.common.Mod; 10 | 11 | @Mod.EventBusSubscriber(modid = SFM.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) 12 | public class SFMBlockEntityRenderers { 13 | @SubscribeEvent 14 | public static void onRegisterRenderers(EntityRenderersEvent.RegisterRenderers event) { 15 | event.registerBlockEntityRenderer( 16 | SFMBlockEntities.PRINTING_PRESS_BLOCK_ENTITY.get(), 17 | PrintingPressBlockEntityRenderer::new 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/registry/SFMMenuScreens.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.registry; 2 | 3 | import ca.teamdman.sfm.client.gui.screen.ManagerScreen; 4 | import ca.teamdman.sfm.client.gui.screen.TestBarrelTankScreen; 5 | import ca.teamdman.sfm.common.registry.SFMMenus; 6 | import net.minecraft.client.gui.screens.MenuScreens; 7 | 8 | public class SFMMenuScreens { 9 | public static void register() { 10 | MenuScreens.register(SFMMenus.MANAGER_MENU.get(), ManagerScreen::new); 11 | MenuScreens.register(SFMMenus.TEST_BARREL_TANK_MENU.get(), TestBarrelTankScreen::new); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/registry/SFMOverlays.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.registry; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import ca.teamdman.sfm.client.gui.overlay.LabelGunReminderOverlay; 5 | import ca.teamdman.sfm.client.gui.overlay.NetworkToolReminderOverlay; 6 | import net.minecraftforge.api.distmarker.Dist; 7 | import net.minecraftforge.client.event.RegisterGuiOverlaysEvent; 8 | import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay; 9 | import net.minecraftforge.common.util.Lazy; 10 | import net.minecraftforge.eventbus.api.SubscribeEvent; 11 | import net.minecraftforge.fml.common.Mod; 12 | 13 | @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = SFM.MOD_ID, value = Dist.CLIENT) 14 | public class SFMOverlays { 15 | public static final Lazy LABEL_GUN_REMINDER_OVERLAY = Lazy.of(LabelGunReminderOverlay::new); 16 | public static final Lazy NETWORK_TOOL_REMINDER_OVERLAY = Lazy.of(NetworkToolReminderOverlay::new); 17 | 18 | @SubscribeEvent 19 | public static void onRegisterOverlays(RegisterGuiOverlaysEvent event) { 20 | event.registerAbove( 21 | VanillaGuiOverlay.HOTBAR.id(), 22 | "label_gun_reminder", 23 | LABEL_GUN_REMINDER_OVERLAY.get() 24 | ); 25 | event.registerAbove( 26 | VanillaGuiOverlay.HOTBAR.id(), 27 | "network_tool_reminder", 28 | NETWORK_TOOL_REMINDER_OVERLAY.get() 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/registry/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.registry; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/render/FacadeBlockColor.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.render; 2 | 3 | import ca.teamdman.sfm.common.blockentity.IFacadeBlockEntity; 4 | import ca.teamdman.sfm.common.facade.FacadeData; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.color.block.BlockColor; 7 | import net.minecraft.core.BlockPos; 8 | import net.minecraft.world.level.BlockAndTintGetter; 9 | import net.minecraft.world.level.block.entity.BlockEntity; 10 | import net.minecraft.world.level.block.state.BlockState; 11 | import org.jetbrains.annotations.Nullable; 12 | 13 | public class FacadeBlockColor implements BlockColor { 14 | 15 | @Override 16 | public int getColor( 17 | BlockState blockState, 18 | @Nullable BlockAndTintGetter blockAndTintGetter, 19 | @Nullable BlockPos blockPos, 20 | int tintIndex 21 | ) { 22 | if (blockAndTintGetter == null || blockPos == null) return -1; 23 | 24 | BlockEntity blockEntity = blockAndTintGetter.getBlockEntity(blockPos); 25 | if (!(blockEntity instanceof IFacadeBlockEntity facadeBlockEntity)) return -1; 26 | FacadeData facadeData = facadeBlockEntity.getFacadeData(); 27 | if (facadeData == null) return -1; 28 | BlockState facadeState = facadeData.facadeBlockState(); 29 | return Minecraft.getInstance().getBlockColors().getColor(facadeState, blockAndTintGetter, blockPos, tintIndex); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/render/FormItemExtensions.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.client.render; 2 | 3 | import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; 4 | import net.minecraftforge.client.extensions.common.IClientItemExtensions; 5 | 6 | public class FormItemExtensions implements IClientItemExtensions { 7 | private final BlockEntityWithoutLevelRenderer RENDERER = new FormItemRenderer(); 8 | 9 | @Override 10 | public BlockEntityWithoutLevelRenderer getCustomRenderer() { 11 | return RENDERER; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/client/render/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.client.render; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/block/IFacadableBlock.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.block; 2 | 3 | import ca.teamdman.sfm.common.facade.FacadeTransparency; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.level.LevelAccessor; 6 | import net.minecraft.world.level.block.Block; 7 | import net.minecraft.world.level.block.LightBlock; 8 | import net.minecraft.world.level.block.state.BlockState; 9 | import net.minecraft.world.level.block.state.StateDefinition; 10 | 11 | public interface IFacadableBlock { 12 | IFacadableBlock getNonFacadeBlock(); 13 | 14 | IFacadableBlock getFacadeBlock(); 15 | 16 | BlockState getStateForPlacementByFacadePlan( 17 | LevelAccessor level, 18 | BlockPos pos 19 | ); 20 | 21 | default void createFacadeBlockStateDefinition(StateDefinition.Builder builder) { 22 | builder.add(FacadeTransparency.FACADE_TRANSPARENCY_PROPERTY); 23 | builder.add(LightBlock.LEVEL); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/block/TunnelledManagerBlock.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.block; 2 | 3 | import ca.teamdman.sfm.common.blockentity.TunnelledManagerBlockEntity; 4 | import ca.teamdman.sfm.common.registry.SFMBlockEntities; 5 | import ca.teamdman.sfm.common.util.Stored; 6 | import net.minecraft.core.BlockPos; 7 | import net.minecraft.world.level.Level; 8 | import net.minecraft.world.level.block.entity.BlockEntity; 9 | import net.minecraft.world.level.block.entity.BlockEntityTicker; 10 | import net.minecraft.world.level.block.entity.BlockEntityType; 11 | import net.minecraft.world.level.block.state.BlockState; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | public class TunnelledManagerBlock extends ManagerBlock { 15 | @Override 16 | public BlockEntity newBlockEntity(@Stored BlockPos pos, BlockState state) { 17 | return SFMBlockEntities.TUNNELLED_MANAGER_BLOCK_ENTITY 18 | .get() 19 | .create(pos, state); 20 | } 21 | 22 | @Override 23 | public @Nullable BlockEntityTicker getTicker( 24 | Level level, 25 | BlockState state, 26 | BlockEntityType type 27 | ) { 28 | if (level.isClientSide()) return null; 29 | return createTickerHelper(type, SFMBlockEntities.TUNNELLED_MANAGER_BLOCK_ENTITY.get(), TunnelledManagerBlockEntity::serverTick); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/block/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | @ParametersAreNonnullByDefault 3 | @MethodsReturnNonnullByDefault 4 | @FieldsAreNonnullByDefault 5 | package ca.teamdman.sfm.common.block; 6 | 7 | import net.minecraft.FieldsAreNonnullByDefault; 8 | import net.minecraft.MethodsReturnNonnullByDefault; 9 | 10 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/block/shape/ShapeCache.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.block.shape; 2 | 3 | import net.minecraft.world.level.block.state.BlockState; 4 | import net.minecraft.world.phys.shapes.VoxelShape; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.function.Function; 9 | 10 | public final class ShapeCache { 11 | private static final Map STORAGE = new HashMap<>(); 12 | 13 | private ShapeCache() { 14 | } 15 | 16 | public static VoxelShape getOrCompute(BlockState state, Function computeFunction) { 17 | return STORAGE.computeIfAbsent(state, computeFunction); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/blockentity/CableFacadeBlockEntity.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.blockentity; 2 | 3 | import ca.teamdman.sfm.common.registry.SFMBlockEntities; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.level.block.state.BlockState; 6 | import net.minecraftforge.client.model.data.ModelData; 7 | 8 | public class CableFacadeBlockEntity extends CommonFacadeBlockEntity { 9 | public CableFacadeBlockEntity( 10 | BlockPos pos, 11 | BlockState state 12 | ) { 13 | super(SFMBlockEntities.CABLE_FACADE_BLOCK_ENTITY.get(), pos, state); 14 | } 15 | 16 | @Override 17 | public ModelData getModelData() { 18 | if (getFacadeData() != null) { 19 | return ModelData.builder().with(FACADE_BLOCK_STATE_MODEL_PROPERTY, getFacadeData().facadeBlockState()).build(); 20 | } 21 | return ModelData.EMPTY; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/blockentity/FancyCableFacadeBlockEntity.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.blockentity; 2 | 3 | import ca.teamdman.sfm.common.registry.SFMBlockEntities; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.core.Direction; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import net.minecraftforge.client.model.data.ModelData; 8 | import net.minecraftforge.client.model.data.ModelProperty; 9 | 10 | public class FancyCableFacadeBlockEntity extends CommonFacadeBlockEntity { 11 | public static final ModelProperty FACADE_DIRECTION = new ModelProperty<>(); 12 | 13 | public FancyCableFacadeBlockEntity( 14 | BlockPos pos, 15 | BlockState state 16 | ) { 17 | super(SFMBlockEntities.FANCY_CABLE_FACADE_BLOCK_ENTITY.get(), pos, state); 18 | } 19 | 20 | @Override 21 | public ModelData getModelData() { 22 | if (getFacadeData() != null) { 23 | return ModelData.builder() 24 | .with(IFacadeBlockEntity.FACADE_BLOCK_STATE_MODEL_PROPERTY, getFacadeData().facadeBlockState()) 25 | .with(FACADE_DIRECTION, getFacadeData().facadeDirection()) 26 | .build(); 27 | } 28 | return ModelData.EMPTY; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/blockentity/IFacadeBlockEntity.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.blockentity; 2 | 3 | import ca.teamdman.sfm.common.facade.FacadeData; 4 | import net.minecraft.world.level.block.state.BlockState; 5 | import net.minecraftforge.client.model.data.ModelProperty; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public interface IFacadeBlockEntity { 9 | ModelProperty FACADE_BLOCK_STATE_MODEL_PROPERTY = new ModelProperty<>(); 10 | 11 | void updateFacadeData(FacadeData newFacadeData); 12 | 13 | @Nullable FacadeData getFacadeData(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/blockentity/TestBarrelBlockEntity.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.blockentity; 2 | 3 | import ca.teamdman.sfm.common.registry.SFMBlockEntities; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.level.block.entity.BarrelBlockEntity; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | 8 | public class TestBarrelBlockEntity extends BarrelBlockEntity { 9 | public TestBarrelBlockEntity( 10 | BlockPos pPos, 11 | BlockState pBlockState 12 | ) { 13 | super(pPos, pBlockState); 14 | } 15 | 16 | // @Override 17 | @SuppressWarnings("unused") // 1.21.1 only 18 | public boolean isValidBlockState(BlockState blockState) { 19 | return SFMBlockEntities.TEST_BARREL_BLOCK_ENTITY.get().isValid(blockState); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/blockentity/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | @ParametersAreNonnullByDefault 3 | @MethodsReturnNonnullByDefault 4 | @FieldsAreNonnullByDefault 5 | package ca.teamdman.sfm.common.blockentity; 6 | 7 | import net.minecraft.FieldsAreNonnullByDefault; 8 | import net.minecraft.MethodsReturnNonnullByDefault; 9 | 10 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/cablenetwork/ICableBlock.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.cablenetwork; 2 | 3 | public interface ICableBlock { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/cablenetwork/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | @ParametersAreNonnullByDefault 3 | @MethodsReturnNonnullByDefault 4 | @FieldsAreNonnullByDefault 5 | package ca.teamdman.sfm.common.cablenetwork; 6 | 7 | import net.minecraft.FieldsAreNonnullByDefault; 8 | import net.minecraft.MethodsReturnNonnullByDefault; 9 | 10 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/capabilityprovidermapper/BlockEntityCapabilityProviderMapper.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.capabilityprovidermapper; 2 | 3 | import ca.teamdman.sfm.common.util.NotStored; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.level.LevelAccessor; 6 | import net.minecraftforge.common.capabilities.ICapabilityProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public class BlockEntityCapabilityProviderMapper implements CapabilityProviderMapper { 10 | @Override 11 | public @Nullable ICapabilityProvider getProviderFor(LevelAccessor level, @NotStored BlockPos pos) { 12 | return level.getBlockEntity(pos); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/capabilityprovidermapper/CapabilityProviderMapper.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.capabilityprovidermapper; 2 | 3 | import ca.teamdman.sfm.common.util.Stored; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.level.LevelAccessor; 6 | import net.minecraftforge.common.capabilities.ICapabilityProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface CapabilityProviderMapper { 10 | @Nullable ICapabilityProvider getProviderFor(LevelAccessor level, @Stored BlockPos pos); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/command/ConfigCommandBehaviourInput.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.command; 2 | 3 | public enum ConfigCommandBehaviourInput { 4 | SHOW, 5 | EDIT 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/command/ConfigCommandVariantInput.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.command; 2 | 3 | public enum ConfigCommandVariantInput { 4 | CLIENT, 5 | SERVER 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/command/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | @ParametersAreNonnullByDefault 3 | @MethodsReturnNonnullByDefault 4 | @FieldsAreNonnullByDefault 5 | package ca.teamdman.sfm.common.command; 6 | 7 | import net.minecraft.FieldsAreNonnullByDefault; 8 | import net.minecraft.MethodsReturnNonnullByDefault; 9 | 10 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/compat/SFMModCompat.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.compat; 2 | 3 | import ca.teamdman.sfm.common.util.NotStored; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.resources.ResourceLocation; 6 | import net.minecraft.world.level.Level; 7 | import net.minecraft.world.level.block.Block; 8 | import net.minecraftforge.fml.ModList; 9 | import net.minecraftforge.registries.ForgeRegistries; 10 | 11 | public class SFMModCompat { 12 | public static boolean isMekanismLoaded() { 13 | return isModLoaded("mekanism"); 14 | } 15 | 16 | public static boolean isAE2Loaded() { 17 | return isModLoaded("ae2"); 18 | } 19 | 20 | public static boolean isModLoaded(String modid) { 21 | return ModList.get().getModContainerById(modid).isPresent(); 22 | } 23 | 24 | public static boolean isMekanismBlock( 25 | Level level, 26 | @NotStored BlockPos pos 27 | ) { 28 | Block block = level.getBlockState(pos).getBlock(); 29 | ResourceLocation blockId = ForgeRegistries.BLOCKS.getKey(block); 30 | assert blockId != null; 31 | return blockId.getNamespace().equals("mekanism"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/compat/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | @ParametersAreNonnullByDefault 3 | @MethodsReturnNonnullByDefault 4 | @FieldsAreNonnullByDefault 5 | package ca.teamdman.sfm.common.compat; 6 | 7 | import net.minecraft.FieldsAreNonnullByDefault; 8 | import net.minecraft.MethodsReturnNonnullByDefault; 9 | 10 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/config/SFMClientConfig.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.config; 2 | 3 | import net.minecraftforge.common.ForgeConfigSpec; 4 | 5 | public class SFMClientConfig { 6 | public final ForgeConfigSpec.BooleanValue showLabelGunReminderOverlay; 7 | public final ForgeConfigSpec.BooleanValue showNetworkToolReminderOverlay; 8 | 9 | SFMClientConfig(ForgeConfigSpec.Builder builder) { 10 | showLabelGunReminderOverlay = builder.define("showLabelGunReminderOverlay", true); 11 | showNetworkToolReminderOverlay = builder.define("showNetworkToolReminderOverlay", true); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/config/SFMClientProgramEditorConfig.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.config; 2 | 3 | import net.minecraftforge.common.ForgeConfigSpec; 4 | 5 | public class SFMClientProgramEditorConfig { 6 | public final ForgeConfigSpec.BooleanValue showLineNumbers; 7 | public final ForgeConfigSpec.EnumValue intellisenseLevel; 8 | 9 | SFMClientProgramEditorConfig(ForgeConfigSpec.Builder builder) { 10 | showLineNumbers = builder.define("showLineNumbers", true); 11 | intellisenseLevel = builder.defineEnum("intellisenseLevel", IntellisenseLevel.OFF); 12 | } 13 | 14 | public enum IntellisenseLevel { 15 | OFF, 16 | BASIC, 17 | ADVANCED, 18 | ; 19 | 20 | public boolean isResourceIntellisenseEnabled() { 21 | return this == ADVANCED; 22 | } 23 | 24 | public boolean isDisabled() { 25 | return this == OFF; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/config/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.config; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/containermenu/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.containermenu; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/facade/FacadeSpreadLogic.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.facade; 2 | 3 | public enum FacadeSpreadLogic { 4 | SINGLE, 5 | NETWORK, 6 | NETWORK_GLOBAL_SAME_PAINT, 7 | NETWORK_CONTIGUOUS_SAME_PAINT; 8 | 9 | public static FacadeSpreadLogic fromParts( 10 | boolean isCtrlKeyDown, 11 | boolean isAltKeyDown 12 | ) { 13 | if (isCtrlKeyDown && isAltKeyDown) { 14 | return NETWORK; 15 | } 16 | if (isAltKeyDown) { 17 | return NETWORK_GLOBAL_SAME_PAINT; 18 | } 19 | if (isCtrlKeyDown) { 20 | return NETWORK_CONTIGUOUS_SAME_PAINT; 21 | } 22 | return SINGLE; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/facade/FacadeTextureMode.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.facade; 2 | 3 | import net.minecraft.util.StringRepresentable; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public enum FacadeTextureMode implements StringRepresentable { 7 | STRETCH, 8 | FILL; 9 | 10 | @SuppressWarnings("deprecation") 11 | public static final EnumCodec CODEC = StringRepresentable.fromEnum(FacadeTextureMode::values); 12 | 13 | @Override 14 | public String getSerializedName() { 15 | return name(); 16 | } 17 | 18 | public static @Nullable FacadeTextureMode byName(@Nullable String pName) { 19 | return CODEC.byName(pName); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/facade/FacadeTransparency.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.facade; 2 | 3 | import net.minecraft.util.StringRepresentable; 4 | import net.minecraft.world.level.block.state.properties.EnumProperty; 5 | 6 | public enum FacadeTransparency implements StringRepresentable { 7 | OPAQUE, TRANSLUCENT; 8 | public static final EnumProperty FACADE_TRANSPARENCY_PROPERTY = EnumProperty.create("facade_transparency", FacadeTransparency.class); 9 | 10 | FacadeTransparency() { 11 | } 12 | 13 | @Override 14 | public String getSerializedName() { 15 | return switch (this) { 16 | case OPAQUE -> "opaque"; 17 | case TRANSLUCENT -> "translucent"; 18 | }; 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/facade/IFacadePlan.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.facade; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.world.level.Level; 5 | import org.jetbrains.annotations.Nullable; 6 | 7 | import java.util.Set; 8 | 9 | public interface IFacadePlan { 10 | void apply(Level level); 11 | Set positions(); 12 | @Nullable FacadePlanWarning computeWarning(Level level); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/facade/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.facade; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/handler/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.handler; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/item/ExperienceGoopItem.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.item; 2 | 3 | import ca.teamdman.sfm.common.registry.SFMItems; 4 | import net.minecraft.world.item.Item; 5 | 6 | public class ExperienceGoopItem extends Item { 7 | public ExperienceGoopItem() { 8 | super(new Properties().tab(SFMItems.TAB)); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/item/ExperienceShardItem.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.item; 2 | 3 | import ca.teamdman.sfm.common.registry.SFMItems; 4 | import net.minecraft.world.item.Item; 5 | 6 | public class ExperienceShardItem extends Item { 7 | public ExperienceShardItem() { 8 | super(new Item.Properties().tab(SFMItems.TAB)); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/item/PrintingPressBlockItem.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.item; 2 | 3 | import ca.teamdman.sfm.common.localization.LocalizationKeys; 4 | import ca.teamdman.sfm.common.registry.SFMBlocks; 5 | import ca.teamdman.sfm.common.registry.SFMItems; 6 | import net.minecraft.ChatFormatting; 7 | import net.minecraft.network.chat.Component; 8 | import net.minecraft.world.item.BlockItem; 9 | import net.minecraft.world.item.ItemStack; 10 | import net.minecraft.world.item.TooltipFlag; 11 | import net.minecraft.world.level.Level; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | import java.util.List; 15 | 16 | public class PrintingPressBlockItem extends BlockItem { 17 | public PrintingPressBlockItem() { 18 | super(SFMBlocks.PRINTING_PRESS_BLOCK.get(), new Properties().tab(SFMItems.TAB)); 19 | } 20 | 21 | @Override 22 | public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List pTooltip, TooltipFlag pFlag) { 23 | super.appendHoverText(pStack, pLevel, pTooltip, pFlag); 24 | pTooltip.add(LocalizationKeys.PRINTING_PRESS_TOOLTIP.getComponent().withStyle(ChatFormatting.GRAY)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/item/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.item; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/logging/TranslatableLogEvent.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.logging; 2 | 3 | import ca.teamdman.sfm.common.util.SFMTranslationUtils; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | import net.minecraft.network.chat.contents.TranslatableContents; 6 | import org.apache.logging.log4j.Level; 7 | import org.apache.logging.log4j.core.time.Instant; 8 | import org.apache.logging.log4j.core.time.MutableInstant; 9 | 10 | public record TranslatableLogEvent( 11 | Level level, 12 | Instant instant, 13 | TranslatableContents contents 14 | ) { 15 | public void encode(FriendlyByteBuf buf) { 16 | buf.writeUtf(level.name()); 17 | buf.writeLong(instant.getEpochMillisecond()); 18 | buf.writeInt(instant.getNanoOfMillisecond()); 19 | SFMTranslationUtils.encodeTranslation(contents, buf); 20 | } 21 | public static TranslatableLogEvent decode(FriendlyByteBuf buf) { 22 | var level = Level.getLevel(buf.readUtf()); 23 | var epochMillisecond = buf.readLong(); 24 | var epochNano = buf.readInt(); 25 | var contents = SFMTranslationUtils.decodeTranslation(buf); 26 | 27 | var instant = new MutableInstant(); 28 | instant.initFromEpochMilli(epochMillisecond, epochNano); 29 | 30 | return new TranslatableLogEvent(level, instant, contents); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/net/ClientboundShowChangelogPacket.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.net; 2 | 3 | import ca.teamdman.sfm.client.gui.screen.SFMScreenChangeHelpers; 4 | import net.minecraft.network.FriendlyByteBuf; 5 | 6 | public record ClientboundShowChangelogPacket( 7 | ) implements SFMPacket { 8 | 9 | public static class Daddy implements SFMPacketDaddy { 10 | @Override 11 | public PacketDirection getPacketDirection() { 12 | return PacketDirection.CLIENTBOUND; 13 | } 14 | @Override 15 | public void encode( 16 | ClientboundShowChangelogPacket msg, 17 | FriendlyByteBuf friendlyByteBuf 18 | ) { 19 | } 20 | 21 | @Override 22 | public ClientboundShowChangelogPacket decode(FriendlyByteBuf friendlyByteBuf) { 23 | return new ClientboundShowChangelogPacket( 24 | ); 25 | } 26 | 27 | @Override 28 | public void handle( 29 | ClientboundShowChangelogPacket msg, 30 | SFMPacketHandlingContext context 31 | ) { 32 | SFMScreenChangeHelpers.showChangelog(); 33 | } 34 | 35 | @Override 36 | public Class getPacketClass() { 37 | return ClientboundShowChangelogPacket.class; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/net/SFMPacket.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.net; 2 | 3 | public interface SFMPacket { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/net/package-info.java: -------------------------------------------------------------------------------- 1 | @ParametersAreNonnullByDefault 2 | @MethodsReturnNonnullByDefault 3 | @FieldsAreNonnullByDefault 4 | package ca.teamdman.sfm.common.net; 5 | 6 | import net.minecraft.FieldsAreNonnullByDefault; 7 | import net.minecraft.MethodsReturnNonnullByDefault; 8 | 9 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/CapabilityConsumer.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.program; 2 | 3 | import ca.teamdman.sfml.ast.Label; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.core.Direction; 6 | 7 | @FunctionalInterface 8 | public interface CapabilityConsumer { 9 | void accept( 10 | Label label, 11 | BlockPos pos, 12 | Direction direction, 13 | T cap 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/DefaultProgramBehaviour.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.program; 2 | 3 | public class DefaultProgramBehaviour implements ProgramBehaviour { 4 | @Override 5 | public ProgramBehaviour fork() { 6 | return this; // this is stateless so this should be fine 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/LimitedSlot.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.program; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | import ca.teamdman.sfml.ast.Label; 5 | import net.minecraft.core.BlockPos; 6 | import net.minecraft.core.Direction; 7 | 8 | public interface LimitedSlot { 9 | ResourceType getType(); 10 | 11 | CAP getHandler(); 12 | 13 | BlockPos getPos(); 14 | 15 | Label getLabel(); 16 | 17 | Direction getDirection(); 18 | 19 | int getSlot(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/ProgramBehaviour.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.program; 2 | 3 | public interface ProgramBehaviour { 4 | ProgramBehaviour fork(); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/linting/IProgramLinter.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.program.linting; 2 | 3 | import ca.teamdman.sfm.common.blockentity.ManagerBlockEntity; 4 | import ca.teamdman.sfm.common.program.LabelPositionHolder; 5 | import ca.teamdman.sfml.ast.Program; 6 | import net.minecraft.network.chat.contents.TranslatableContents; 7 | import net.minecraft.world.item.ItemStack; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import java.util.ArrayList; 11 | 12 | public interface IProgramLinter { 13 | ArrayList gatherWarnings( 14 | Program program, 15 | LabelPositionHolder labelPositionHolder, 16 | @Nullable 17 | ManagerBlockEntity managerBlockEntity 18 | ); 19 | 20 | void fixWarnings( 21 | ManagerBlockEntity managerBlockEntity, 22 | ItemStack diskStack, 23 | Program program 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/linting/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.program.linting; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/program/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.program; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/recipe/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.recipe; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/registry/SFMRecipeTypes.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.registry; 2 | 3 | import ca.teamdman.sfm.SFM; 4 | import ca.teamdman.sfm.common.recipe.PrintingPressRecipe; 5 | import net.minecraft.resources.ResourceLocation; 6 | import net.minecraft.world.item.crafting.RecipeType; 7 | import net.minecraftforge.eventbus.api.IEventBus; 8 | import net.minecraftforge.registries.DeferredRegister; 9 | import net.minecraftforge.registries.ForgeRegistries; 10 | import net.minecraftforge.registries.RegistryObject; 11 | 12 | public class SFMRecipeTypes { 13 | private static final DeferredRegister> RECIPE_TYPES = DeferredRegister.create( 14 | ForgeRegistries.RECIPE_TYPES, 15 | SFM.MOD_ID 16 | ); 17 | 18 | public static final RegistryObject> PRINTING_PRESS = RECIPE_TYPES.register( 19 | "printing_press", 20 | () -> RecipeType.simple(new ResourceLocation(SFM.MOD_ID, "printing_press")) 21 | ); 22 | 23 | public static void register(IEventBus bus) { 24 | RECIPE_TYPES.register(bus); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/registry/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.registry; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/resourcetype/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.resourcetype; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/HelpsWithMinecraftVersionIndependence.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.PACKAGE}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface HelpsWithMinecraftVersionIndependence { 11 | // String description() default "Helps with Minecraft version independence"; 12 | // String from() default "1.19.2"; 13 | // String to() default "latest"; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/InPlaceBlockPlaceContext.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import net.minecraft.world.InteractionHand; 4 | import net.minecraft.world.entity.player.Player; 5 | import net.minecraft.world.item.ItemStack; 6 | import net.minecraft.world.item.context.BlockPlaceContext; 7 | import net.minecraft.world.item.context.UseOnContext; 8 | import net.minecraft.world.level.Level; 9 | import net.minecraft.world.phys.BlockHitResult; 10 | import org.jetbrains.annotations.Nullable; 11 | 12 | public class InPlaceBlockPlaceContext extends BlockPlaceContext { 13 | public InPlaceBlockPlaceContext( 14 | Player pPlayer, 15 | InteractionHand pHand, 16 | ItemStack pItemStack, 17 | BlockHitResult pHitResult 18 | ) { 19 | super(pPlayer, pHand, pItemStack, pHitResult); 20 | this.replaceClicked = true; 21 | } 22 | 23 | @SuppressWarnings("unused") 24 | public InPlaceBlockPlaceContext(UseOnContext pContext) { 25 | super(pContext); 26 | this.replaceClicked = true; 27 | } 28 | 29 | @SuppressWarnings("unused") 30 | public InPlaceBlockPlaceContext( 31 | Level pLevel, 32 | @Nullable Player pPlayer, 33 | InteractionHand pHand, 34 | ItemStack pItemStack, 35 | BlockHitResult pHitResult 36 | ) { 37 | super(pLevel, pPlayer, pHand, pItemStack, pHitResult); 38 | this.replaceClicked = true; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/MCVersionDependentBehaviour.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /// The content changes between the versions of Minecraft. 9 | @Retention(RetentionPolicy.CLASS) 10 | @Target({ 11 | ElementType.METHOD, 12 | ElementType.FIELD, 13 | ElementType.PARAMETER, 14 | ElementType.LOCAL_VARIABLE, 15 | ElementType.TYPE_USE 16 | }) 17 | public @interface MCVersionDependentBehaviour { 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/NotStored.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /// Signals that it's fine to pass a MutableBlockPos here. 9 | /// A BlockPos passed here will not be stored as a reference beyond the method call. 10 | /// BlockPos::asLong may be used which is fine because that doesn't persistently borrow the parameter by reference. 11 | @Retention(RetentionPolicy.CLASS) 12 | @Target({ElementType.PARAMETER}) 13 | public @interface NotStored { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/SFMContainerUtil.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import net.minecraft.world.entity.player.Player; 4 | import net.minecraft.world.level.block.entity.BlockEntity; 5 | 6 | public class SFMContainerUtil { 7 | public static boolean stillValid(BlockEntity blockEntity, Player player) { 8 | var level = blockEntity.getLevel(); 9 | if (level == null) return false; 10 | var pos = blockEntity.getBlockPos(); 11 | if (level.getBlockEntity(pos) != blockEntity) return false; 12 | double dist = player.distanceToSqr( 13 | (double) pos.getX() + 0.5D, 14 | (double) pos.getY() + 0.5D, 15 | (double) pos.getZ() + 0.5D 16 | ); 17 | return dist <= 64.0D; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/SFMEnvironmentUtils.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import cpw.mods.modlauncher.Launcher; 4 | import net.minecraftforge.api.distmarker.Dist; 5 | import net.minecraftforge.fml.loading.FMLEnvironment; 6 | 7 | public class SFMEnvironmentUtils { 8 | public static boolean isGameLoaded() { 9 | return Launcher.INSTANCE != null; 10 | } 11 | public static boolean isInIDE() { 12 | return !FMLEnvironment.production; 13 | } 14 | public static boolean isClient() { 15 | return FMLEnvironment.dist == Dist.CLIENT; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/SFMPlayerUtils.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import net.minecraft.world.entity.player.Player; 4 | import net.minecraft.world.level.Level; 5 | 6 | public class SFMPlayerUtils { 7 | @MCVersionDependentBehaviour 8 | public static Level getLevel(Player player) { 9 | return player.level; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/Stored.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm.common.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /// A BlockPos passed here will may be stored as a reference beyond the scope of the method. 9 | /// If passed a BlockPos.MutableBlockPos, expect pain and suffering. 10 | /// The semantics of this are to prevent MutableBlockPos from being passed here. 11 | @Retention(RetentionPolicy.CLASS) 12 | @Target({ElementType.PARAMETER}) 13 | public @interface Stored { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/common/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm.common.util; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfm/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfm; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/ASTNode.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import java.util.List; 4 | import java.util.stream.Stream; 5 | 6 | public interface ASTNode { 7 | default List getStatements() { 8 | return List.of(); 9 | } 10 | 11 | default Stream getDescendantStatements() { 12 | Stream.Builder builder = Stream.builder(); 13 | getStatements().forEach(s -> { 14 | builder.accept(s); 15 | s.getDescendantStatements().forEach(builder); 16 | }); 17 | return builder.build(); 18 | } 19 | 20 | default Stream> getReferencedIOResourceIds() { 21 | if (this instanceof IOStatement ioStatement) { 22 | return ioStatement.resourceLimits().resourceLimitList().stream() 23 | .flatMap(resourceLimit -> resourceLimit.resourceIds().stream()); 24 | } 25 | return getDescendantStatements() 26 | .filter(IOStatement.class::isInstance) 27 | .map(IOStatement.class::cast) 28 | .flatMap(statement -> statement.resourceLimits().resourceLimitList().stream()) 29 | .flatMap(resourceLimit -> resourceLimit.resourceIds().stream()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolConjunction.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public record BoolConjunction(BoolExpr left, BoolExpr right) implements BoolExpr { 6 | @Override 7 | public boolean test(ProgramContext programContext) { 8 | return left.test(programContext) && right.test(programContext); 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return left + " AND " + right; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolDisjunction.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public record BoolDisjunction(BoolExpr left, BoolExpr right) implements BoolExpr { 6 | @Override 7 | public boolean test(ProgramContext programContext) { 8 | return left.test(programContext) || right.test(programContext); 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return left + " OR " + right; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolExpr.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | import java.util.function.Predicate; 6 | 7 | public interface BoolExpr extends Predicate, ASTNode, ToStringPretty { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolFalse.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public record BoolFalse() implements BoolExpr { 6 | @Override 7 | public boolean test(ProgramContext programContext) { 8 | return false; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return "FALSE"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolNegation.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public record BoolNegation(BoolExpr inner) implements BoolExpr { 6 | @Override 7 | public boolean test(ProgramContext programContext) { 8 | return !inner.test(programContext); 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return "NOT " + inner; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolParen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public record BoolParen(BoolExpr inner) implements BoolExpr { 6 | @Override 7 | public boolean test(ProgramContext programContext) { 8 | return inner.test(programContext); 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return "(" + inner + ")"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolRedstone.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.blockentity.ManagerBlockEntity; 4 | import ca.teamdman.sfm.common.program.ProgramContext; 5 | import net.minecraft.world.level.Level; 6 | 7 | public record BoolRedstone(ComparisonOperator operator, long number) implements BoolExpr { 8 | @SuppressWarnings("UnnecessaryLocalVariable") 9 | @Override 10 | public boolean test(ProgramContext programContext) { 11 | ManagerBlockEntity manager = programContext.getManager(); 12 | Level level = manager.getLevel(); 13 | assert level != null; 14 | long lhs = level.getBestNeighborSignal(manager.getBlockPos()); 15 | long rhs = number; 16 | return operator.test(lhs, rhs); 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return "REDSTONE " + operator + " " + number; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/BoolTrue.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public record BoolTrue() implements BoolExpr { 6 | @Override 7 | public boolean test(ProgramContext programContext) { 8 | return true; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return "TRUE"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/ComparisonOperator.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import java.util.Locale; 4 | import java.util.function.BiPredicate; 5 | 6 | public enum ComparisonOperator implements ASTNode, BiPredicate, ToStringPretty { 7 | GREATER((a, b) -> a > b), 8 | LESSER((a, b) -> a < b), 9 | EQUALS(Long::equals), 10 | LESSER_OR_EQUAL((a, b) -> a <= b), 11 | GREATER_OR_EQUAL((a, b) -> a >= b); 12 | 13 | private final BiPredicate PRED; 14 | 15 | ComparisonOperator(BiPredicate pred) { 16 | this.PRED = pred; 17 | } 18 | 19 | public static ComparisonOperator from(String text) { 20 | return switch (text.toUpperCase(Locale.ROOT)) { 21 | case "GT", ">" -> GREATER; 22 | case "LT", "<" -> LESSER; 23 | case "EQ", "=" -> EQUALS; 24 | case "LE", "<=" -> LESSER_OR_EQUAL; 25 | case "GE", ">=" -> GREATER_OR_EQUAL; 26 | default -> throw new IllegalArgumentException("Invalid comparison operator: " + text); 27 | }; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return switch (this) { 33 | case GREATER -> ">"; 34 | case LESSER -> "<"; 35 | case EQUALS -> "="; 36 | case LESSER_OR_EQUAL -> "<="; 37 | case GREATER_OR_EQUAL -> ">="; 38 | }; 39 | } 40 | 41 | @Override 42 | public boolean test(Long a, Long b) { 43 | return PRED.test(a, b); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/IOStatement.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public interface IOStatement extends Statement, ToStringPretty { 4 | LabelAccess labelAccess(); 5 | ResourceLimits resourceLimits(); 6 | boolean each(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/Interval.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | import java.util.Objects; 6 | 7 | public record Interval( 8 | int ticks, 9 | IntervalAlignment alignment, 10 | int offset 11 | ) implements ASTNode { 12 | public boolean shouldTick(ProgramContext context) { 13 | return switch (alignment) { 14 | case LOCAL -> context.getManager().getTick() % ticks == offset; 15 | case GLOBAL -> Objects.requireNonNull(context.getManager().getLevel()).getGameTime() % ticks == offset; 16 | }; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return ticks + " TICKS"; 22 | } 23 | 24 | public enum IntervalAlignment { 25 | LOCAL, 26 | GLOBAL 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/Label.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public record Label(String name) implements ASTNode { 4 | @Override 5 | public String toString() { 6 | return name; 7 | } 8 | 9 | public static boolean needsQuotes(String label) { 10 | return !label.matches("[a-zA-Z_][a-zA-Z0-9_]*"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/Number.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public record Number(long value) implements ASTNode { 4 | @Override 5 | public String toString() { 6 | return String.valueOf(value); 7 | } 8 | 9 | public Number add(Number number) { 10 | return new Number(value + number.value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/NumberRange.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public record NumberRange( 4 | long start, 5 | long end 6 | ) implements ASTNode { 7 | public static final NumberRange MAX_RANGE = new NumberRange(Long.MIN_VALUE, Long.MAX_VALUE); 8 | 9 | /** 10 | * Inclusive 11 | */ 12 | public boolean contains(int value) { 13 | return value >= start && value <= end; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | if (start == end) return String.valueOf(start); 19 | return start + "-" + end; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/NumberRangeSet.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import java.util.Arrays; 4 | import java.util.stream.Collectors; 5 | 6 | public record NumberRangeSet(NumberRange[] ranges) implements ASTNode { 7 | public static final NumberRangeSet MAX_RANGE = new NumberRangeSet(new NumberRange[]{NumberRange.MAX_RANGE}); 8 | public boolean contains(int value) { 9 | for (NumberRange range : ranges) { 10 | if (range.contains(value)) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "[" + (this.equals(MAX_RANGE) ? "ALL" : Arrays.stream(ranges).map(NumberRange::toString).collect(Collectors.joining(","))) + "]"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/ProgramName.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public record ProgramName(StringHolder value) implements ASTNode { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/RedstoneTrigger.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | import ca.teamdman.sfm.common.program.SimulateExploreAllPathsProgramBehaviour; 5 | 6 | public record RedstoneTrigger( 7 | Block block 8 | ) implements Trigger, ToStringCondensed { 9 | @Override 10 | public Block getBlock() { 11 | return block; 12 | } 13 | 14 | @Override 15 | public void tick(ProgramContext context) { 16 | for (int i = 0; i < context.getRedstonePulses(); i++) { 17 | block.tick(context); 18 | } 19 | if (context.getBehaviour() instanceof SimulateExploreAllPathsProgramBehaviour simulation) { 20 | simulation.onTriggerDropped(context, this); 21 | } 22 | } 23 | 24 | @Override 25 | public boolean shouldTick(ProgramContext context) { 26 | if (context.getBehaviour() instanceof SimulateExploreAllPathsProgramBehaviour) return true; 27 | return context.getManager().getUnprocessedRedstonePulseCount() > 0; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "EVERY REDSTONE PULSE DO\n" + block.toString().indent(1).stripTrailing() + "\nEND"; 33 | } 34 | 35 | @Override 36 | public String toStringCondensed() { 37 | return "EVERY REDSTONE PULSE DO"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/ResourceQuantity.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public record ResourceQuantity( 4 | Number number, 5 | IdExpansionBehaviour idExpansionBehaviour 6 | ) implements ASTNode { 7 | @SuppressWarnings("DataFlowIssue") 8 | public static final ResourceQuantity UNSET = new ResourceQuantity(null, IdExpansionBehaviour.NO_EXPAND); 9 | public static final ResourceQuantity MAX_QUANTITY = new ResourceQuantity( 10 | new Number(Long.MAX_VALUE), 11 | IdExpansionBehaviour.NO_EXPAND 12 | ); 13 | 14 | public ResourceQuantity add(ResourceQuantity quantity) { 15 | return new ResourceQuantity( 16 | number.add(quantity.number), 17 | idExpansionBehaviour 18 | ); 19 | } 20 | 21 | public enum IdExpansionBehaviour { 22 | EXPAND, 23 | NO_EXPAND 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return (this == UNSET ? "UNSET" : number) + (idExpansionBehaviour == IdExpansionBehaviour.EXPAND ? " EACH" : ""); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/Side.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public enum Side implements ASTNode { 4 | TOP, 5 | BOTTOM, 6 | NORTH, 7 | SOUTH, 8 | EAST, 9 | WEST 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/Statement.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.program.ProgramContext; 4 | 5 | public interface Statement extends ASTNode { 6 | void tick(ProgramContext context); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/StringHolder.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public record StringHolder(String value) implements ASTNode { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/ToStringCondensed.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public interface ToStringCondensed { 4 | String toStringCondensed(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/ToStringPretty.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | public interface ToStringPretty { 4 | default String toStringPretty() { 5 | return this.toString(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/With.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public record With( 6 | WithClause condition, 7 | WithMode mode 8 | ) implements WithClause, ToStringPretty { 9 | public static final With ALWAYS_TRUE = new With( 10 | new WithAlwaysTrue(), 11 | WithMode.WITH 12 | ); 13 | 14 | @Override 15 | public boolean matchesStack( 16 | ResourceType resourceType, 17 | STACK stack 18 | ) { 19 | boolean matches = condition.matchesStack(resourceType, stack); 20 | return switch (mode) { 21 | case WITH -> matches; 22 | case WITHOUT -> !matches; 23 | }; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return switch (mode) { 29 | case WITH -> "WITH " + condition.toStringPretty(); 30 | case WITHOUT -> "WITHOUT " + condition.toStringPretty(); 31 | }; 32 | } 33 | 34 | public enum WithMode { 35 | WITH, 36 | WITHOUT 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithAlwaysTrue.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public final class WithAlwaysTrue implements WithClause { 6 | @Override 7 | public boolean matchesStack( 8 | ResourceType resourceType, 9 | STACK stack 10 | ) { 11 | return true; 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return "(ALWAYS => TRUE)"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithClause.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public interface WithClause extends ASTNode, ToStringPretty { 6 | boolean matchesStack( 7 | ResourceType resourceType, 8 | STACK stack 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithConjunction.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public record WithConjunction(WithClause left, WithClause right) implements ASTNode, WithClause, ToStringPretty { 6 | @Override 7 | public boolean matchesStack( 8 | ResourceType resourceType, 9 | STACK stack 10 | ) { 11 | return left.matchesStack(resourceType, stack) && right.matchesStack(resourceType, stack); 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return left + " AND " + right; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithDisjunction.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public record WithDisjunction(WithClause left, WithClause right) implements ASTNode, WithClause, ToStringPretty { 6 | @Override 7 | public boolean matchesStack( 8 | ResourceType resourceType, 9 | STACK stack 10 | ) { 11 | return left.matchesStack(resourceType, stack) || right.matchesStack(resourceType, stack); 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return left + " OR " + right; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithNegation.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public record WithNegation(WithClause inner) implements ASTNode, WithClause, ToStringPretty { 6 | @Override 7 | public boolean matchesStack( 8 | ResourceType resourceType, 9 | STACK stack 10 | ) { 11 | return !inner.matchesStack(resourceType, stack); 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return "NOT " + inner; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithParen.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public record WithParen(WithClause inner) implements ASTNode, WithClause, ToStringPretty { 6 | @Override 7 | public boolean matchesStack( 8 | ResourceType resourceType, 9 | STACK stack 10 | ) { 11 | return inner.matchesStack(resourceType, stack); 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return "(" + inner + ")"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/WithTag.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.ast; 2 | 3 | import ca.teamdman.sfm.common.resourcetype.ResourceType; 4 | 5 | public record WithTag(TagMatcher tagMatcher) implements ASTNode, WithClause, ToStringPretty { 6 | @Override 7 | public boolean matchesStack( 8 | ResourceType resourceType, 9 | STACK stack 10 | ) { 11 | return resourceType.getTagsForStack(stack).anyMatch(tagMatcher::testResourceLocation); 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return "TAG " + tagMatcher; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/ast/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfml.ast; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/intellisense/IntellisenseAction.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.intellisense; 2 | 3 | import ca.teamdman.sfm.client.gui.widget.PickListItem; 4 | import ca.teamdman.sfml.manipulation.ManipulationResult; 5 | 6 | public interface IntellisenseAction extends PickListItem { 7 | ManipulationResult perform(IntellisenseContext context); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/intellisense/IntellisenseContext.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.intellisense; 2 | 3 | import ca.teamdman.sfm.common.config.SFMClientProgramEditorConfig; 4 | import ca.teamdman.sfm.common.program.LabelPositionHolder; 5 | import ca.teamdman.sfml.program_builder.ProgramBuildResult; 6 | 7 | public record IntellisenseContext( 8 | ProgramBuildResult programBuildResult, 9 | int cursorPosition, 10 | int selectionCursorPosition, 11 | LabelPositionHolder labelPositionHolder, 12 | SFMClientProgramEditorConfig.IntellisenseLevel intellisenseLevel 13 | ) { 14 | public MutableProgramString createMutableProgramString() { 15 | return new MutableProgramString( 16 | programBuildResult.metadata().programString(), 17 | cursorPosition, 18 | selectionCursorPosition 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/intellisense/SuggestedLabelIntellisenseAction.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.intellisense; 2 | 3 | import ca.teamdman.sfml.ast.Label; 4 | import ca.teamdman.sfml.manipulation.ManipulationResult; 5 | import net.minecraft.network.chat.Component; 6 | 7 | public record SuggestedLabelIntellisenseAction( 8 | String label, 9 | int numBlocks 10 | ) implements IntellisenseAction { 11 | @Override 12 | public Component getComponent() { 13 | return Component.literal("%s (%d)".formatted(label, numBlocks)); 14 | } 15 | 16 | @Override 17 | public ManipulationResult perform(IntellisenseContext context) { 18 | if (Label.needsQuotes(label)) { 19 | return context.createMutableProgramString() 20 | .replaceWordAndMoveCursorsToEnd("\"%s\" ".formatted(label)) 21 | .intoResult(); 22 | } else { 23 | return context.createMutableProgramString() 24 | .replaceWordAndMoveCursorsToEnd("%s ".formatted(label)) 25 | .intoResult(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/intellisense/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.sfml.intellisense; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/manipulation/ManipulationResult.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.manipulation; 2 | 3 | public record ManipulationResult( 4 | String content, 5 | int cursorPosition, 6 | int selectionCursorPosition 7 | ) { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/program_builder/ListErrorListener.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.program_builder; 2 | 3 | import org.antlr.v4.runtime.BaseErrorListener; 4 | import org.antlr.v4.runtime.RecognitionException; 5 | import org.antlr.v4.runtime.Recognizer; 6 | 7 | import java.util.List; 8 | 9 | public class ListErrorListener extends BaseErrorListener { 10 | private final List errors; 11 | 12 | public ListErrorListener(List errors) { 13 | this.errors = errors; 14 | } 15 | 16 | @Override 17 | public void syntaxError( 18 | Recognizer recognizer, 19 | Object offendingSymbol, 20 | int line, 21 | int charPositionInLine, 22 | String msg, 23 | RecognitionException e 24 | ) { 25 | errors.add("line " + line + ":" + charPositionInLine + " " + msg); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ca/teamdman/sfml/program_builder/ProgramMetadata.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfml.program_builder; 2 | 3 | import ca.teamdman.langs.SFMLLexer; 4 | import ca.teamdman.langs.SFMLParser; 5 | import ca.teamdman.sfml.ast.ASTBuilder; 6 | import net.minecraft.network.chat.contents.TranslatableContents; 7 | import org.antlr.v4.runtime.CommonTokenStream; 8 | 9 | import java.util.List; 10 | 11 | public record ProgramMetadata( 12 | String programString, 13 | SFMLLexer lexer, 14 | CommonTokenStream tokens, 15 | SFMLParser parser, 16 | ASTBuilder astBuilder, 17 | List errors 18 | ) { 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/simmetrics/tokenizers/AbstractTokenizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Simmetrics Core 4 | * %% 5 | * Copyright (C) 2014 - 2016 Simmetrics Authors 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | 21 | package org.simmetrics.tokenizers; 22 | 23 | import com.google.common.collect.HashMultiset; 24 | import com.google.common.collect.Multiset; 25 | 26 | import java.util.HashSet; 27 | import java.util.Set; 28 | 29 | /** 30 | * Convenience tokenizer. Provides default implementation to tokenize to set and 31 | * multiset by calling {@link Tokenizer#tokenizeToList(String)}. 32 | */ 33 | public abstract class AbstractTokenizer implements Tokenizer { 34 | 35 | @Override 36 | public Set tokenizeToSet(final String input) { 37 | return new HashSet<>(tokenizeToList(input)); 38 | } 39 | 40 | @Override 41 | public Multiset tokenizeToMultiset(final String input) { 42 | return HashMultiset.create(tokenizeToList(input)); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/simmetrics/tokenizers/AbstractTokenizer.java.orig: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Simmetrics Core 4 | * %% 5 | * Copyright (C) 2014 - 2016 Simmetrics Authors 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | 21 | package org.simmetrics.tokenizers; 22 | 23 | import java.util.HashSet; 24 | import java.util.Set; 25 | 26 | import com.google.common.collect.HashMultiset; 27 | import com.google.common.collect.Multiset; 28 | 29 | /** 30 | * Convenience tokenizer. Provides default implementation to tokenize to set and 31 | * multiset by calling {@link Tokenizer#tokenizeToList(String)}. 32 | */ 33 | public abstract class AbstractTokenizer implements Tokenizer { 34 | 35 | @Override 36 | public Set tokenizeToSet(final String input) { 37 | return new HashSet<>(tokenizeToList(input)); 38 | } 39 | @Override 40 | public Multiset tokenizeToMultiset(final String input) { 41 | return HashMultiset.create(tokenizeToList(input)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | protected net.minecraft.client.gui.components.MultiLineEditBox f_238540_ # textField 2 | protected net.minecraft.client.gui.components.MultiLineEditBox f_238790_ # font 3 | protected net.minecraft.client.gui.components.MultiLineEditBox f_238824_ # frame 4 | public net.minecraft.client.gui.components.AbstractWidget m_93680_(DD)Z # clicked 5 | public net.minecraft.client.gui.components.MultilineTextField f_238550_ # selectCursor 6 | public net.minecraft.client.gui.components.MultilineTextField f_238566_ # cursor 7 | public net.minecraft.client.gui.components.MultilineTextField$StringView # StringView 8 | public net.minecraft.client.gui.screens.inventory.AbstractContainerScreen f_97734_ # hoveredSlot 9 | public net.minecraft.client.gui.components.AbstractWidget m_93692_(Z)V # setFocused, only needed for 1.19.2 10 | 11 | 12 | public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate f_74482_ # palettes 13 | public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate f_74483_ # entityInfoList 14 | public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate$Palette (Ljava/util/List;)V # Palette 15 | public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate f_74484_ # size 16 | 17 | public net.minecraft.gametest.framework.GameTestHelper f_127595_ # testInfo -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/a_simple_program.sfml: -------------------------------------------------------------------------------- 1 | NAME "A simple program" 2 | 3 | EVERY 20 TICKS DO 4 | -- on their own, input statements do nothing 5 | -- there is no item buffer 6 | INPUT FROM a 7 | 8 | -- all the magic happens here 9 | OUTPUT TO b 10 | END 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/ae2_inscribers.sfml: -------------------------------------------------------------------------------- 1 | NAME "AE2 Inscribers" 2 | 3 | -- labels: 4 | -- logic, engineering, calculation, silicon, last => inscribers 5 | -- materials, results => chests 6 | EVERY 20 TICKS DO 7 | INPUT FROM materials 8 | OUTPUT gold_ingot TO logic SLOTS 2 9 | OUTPUT diamond TO engineering SLOTS 2 10 | OUTPUT certus_quartz_crystal TO calculation SLOTS 2 11 | OUTPUT silicon TO silicon SLOTS 2 12 | OUTPUT redstone TO last SLOTS 2 13 | OUTPUT printed_silicon TO last SLOTS 1 14 | OUTPUT printed_calculation_processor, printed_engineering_processor, printed_logic_processor TO last SLOTS 0 15 | FORGET 16 | INPUT FROM logic, engineering, calculation, silicon west side 17 | output to materials 18 | FORGET 19 | INPUT FROM last west SIDE 20 | OUTPUT TO results 21 | END 22 | EVERY 200 TICKS DO 23 | IF SOME last HAS LT 3 THEN 24 | -- There's a partially filled inscriber. 25 | -- We want to shuffle ingredients to make sure there isn't a full craft 26 | -- that is improperly distributed. 27 | -- This trigger interval should be longer than the time it takes 28 | -- to process a single craft so that SFM doesn't sabotage the crafting 29 | -- process by pulling out ingredients from inscribers that have enough. 30 | INPUT FROM last 31 | OUTPUT TO materials 32 | END 33 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/filtering.sfml: -------------------------------------------------------------------------------- 1 | name "Filtering" 2 | 3 | -- basic filtering with limits 4 | EVERY 20 TICKS DO 5 | INPUT 6 | 5 stone, 7 | 3 iron_ingot, 8 | cobblestone, -- trailing comma is fine 9 | FROM a 10 | OUTPUT TO b 11 | END 12 | 13 | -- use an asterisk to fuzzy match 14 | every 20 ticks do 15 | -- quoted patterns use full regex 16 | OUTPUT ".*ingot.*" to b 17 | 18 | -- without quotes, "*" gets converted to ".*" 19 | -- this is shorter, I prefer it 20 | INPUT *ingot* from a 21 | end 22 | 23 | -- you can exclude items too 24 | EVERY 20 TICKS DO 25 | INPUT *ingot* EXCEPT iron_ingot, gold_ingot FROM a 26 | INPUT EXCEPT cobblestone FROM z 27 | OUTPUT 5 EXCEPT copper_ingot TO b 28 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/forget.sfml: -------------------------------------------------------------------------------- 1 | NAME "Forget" 2 | 3 | EVERY 20 TICKS DO 4 | INPUT FROM a 5 | OUTPUT 1 to b 6 | 7 | INPUT FROM c 8 | OUTPUT TO d -- the "a" input is still active!!! 9 | END 10 | 11 | EVERY 20 TICKS DO 12 | INPUT FROM a 13 | OUTPUT 1 to b 14 | 15 | FORGET a 16 | -- or just 17 | FORGET 18 | 19 | INPUT FROM c 20 | OUTPUT TO d -- only the "c" input is active :D 21 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/furnace_manager.sfml: -------------------------------------------------------------------------------- 1 | name "Furnace Manager" 2 | 3 | every 20 ticks do 4 | input from "to be smelted" 5 | output 8 to each furnace top side 6 | 7 | FORGET 8 | 9 | input from fuel 10 | output retain 1 to each furnace bottom side 11 | 12 | FORGET 13 | 14 | input from furnace bottom side 15 | output to results 16 | end -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/if_statements.sfml: -------------------------------------------------------------------------------- 1 | name "IF statements" 2 | -- three inventories, all labelled "a" 3 | 4 | -- a a a 5 | -- | 5 stone | | 5 stone | | 10 stone | 6 | 7 | -- every a has = 5 stone - FALSE (not all of them do!) 8 | -- each a has >= 5 stone - TRUE (alias for "every") 9 | -- some a has eq 5 stone - TRUE 10 | -- one a has = 5 stone - FALSE (more than one does!) 11 | -- lone a has = 5 stone - FALSE (more than zero or one does!) 12 | -- overall a has eq 5 stone - FALSE (there are 20 stone in total, not 5) 13 | -- a has eq 5 stone - FALSE (default behaviour is 'overall') 14 | 15 | every 20 ticks do 16 | INPUT FROM source 17 | 18 | if some source has gt 10 minecraft:iron_ingot then 19 | OUTPUT TO dest1 20 | end 21 | 22 | if 23 | not source has > 20 stone 24 | and source has ge 20 cobblestone 25 | then 26 | output 20 to dest2 27 | end 28 | end -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/limits.sfml: -------------------------------------------------------------------------------- 1 | name "Limits" 2 | 3 | every 20 ticks do 4 | 5 | -- This is hard to explain since there's so many variations 6 | -- This is more a collection of samples than a coherent program 7 | -- Guess what you think each statement does, try them out on your own! 8 | 9 | INPUT FROM a 10 | INPUT 1 FROM a 11 | INPUT stone FROM a 12 | INPUT 3 stone FROM a 13 | INPUT 5 RETAIN 3 stone FROM a 14 | INPUT 5 *ingot FROM a 15 | INPUT 5 EACH *ingot FROM a 16 | INPUT 5 RETAIN 1 EACH *ingot FROM a 17 | 18 | -- quantity and retention can both be expanded with the EACH keyword 19 | -- this only makes sense if your resource id is a pattern 20 | INPUT 5 EACH RETAIN 3 EACH *ingot* FROM a 21 | 22 | OUTPUT TO b 23 | 24 | INPUT 1 "redstone" FROM EACH a 25 | OUTPUT 1 TO EACH b 26 | 27 | OUTPUT 5 TO b 28 | OUTPUT 5 stone TO b 29 | OUTPUT RETAIN 1 coal TO furnace BOTTOM SIDE 30 | OUTPUT 8 EACH *ingot* to b 31 | OUTPUT RETAIN 8 EACH *ingot* to b 32 | OUTPUT 8 EACH retain 8 EACH *ingot* to b 33 | 34 | end -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/redstone_item_move.sfml: -------------------------------------------------------------------------------- 1 | name "Redstone item movement" 2 | 3 | EVERY 20 TICKS DO 4 | -- redstone is a keyword 5 | -- I fixed it so that it can be used without quotes now :D 6 | input redstone from a 7 | output minecraft:redstone to b 8 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/redstone_signals.sfml: -------------------------------------------------------------------------------- 1 | name "Redstone signals" 2 | 3 | every redstone pulse do 4 | input from a 5 | output to b 6 | end 7 | 8 | every 20 ticks do 9 | -- this checks the redstone signal on the manager block 10 | if redstone ge 2 then 11 | input from a 12 | output to b 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/resource_types.sfml: -------------------------------------------------------------------------------- 1 | NAME "Fluids and other resource types" 2 | 3 | EVERY 20 TICKS DO 4 | -- the default resource type is sfm:item 5 | INPUT stone FROM a 6 | -- is the same as 7 | INPUT sfm:item:*:stone FROM a 8 | 9 | -- so if you want to move all fluids, you gotta do 10 | INPUT fluid:: from a 11 | OUTPUT fluid:: to b 12 | -- this expands to INPUT sfm:fluid:*:* FROM a 13 | 14 | -- these are equivalent 15 | INPUT fluid::water FROM a 16 | INPUT sfm:fluid:*:water FROM a 17 | 18 | INPUT iron_ingot FROM a 19 | INPUT sfm:item:*:iron_ingot FROM a 20 | 21 | -- older versions used to default to "minecraft" for items 22 | INPUT iron_ingot FROM a 23 | INPUT sfm:item:minecraft:iron_ingot FROM a 24 | -- this is no longer the case, since there isn't usually name conflicts 25 | -- if there are, you can just manually specify the mod id if you care 26 | INPUT totally_not_minecraft:iron_ingot FROM a 27 | END 28 | 29 | -- the following resource types are supported 30 | -- (this example is generated so it's always up to date) 31 | EVERY 20 TICKS DO 32 | $REPLACE_RESOURCE_TYPES_HERE$ 33 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/round_robin.sfml: -------------------------------------------------------------------------------- 1 | NAME "Round Robin" 2 | 3 | EVERY 20 TICKS DO 4 | -- you probably don't need round robin 5 | -- instead, try retain! 6 | 7 | INPUT FROM source 8 | OUTPUT RETAIN 1000 fluid::water TO thingy 9 | -- don't put more than 1 bucket of water in each block labelled "thingy" 10 | 11 | 12 | FORGET 13 | 14 | INPUT RETAIN 5 stone FROM first 15 | OUTPUT TO second 16 | -- don't take the last 5 stone 17 | END 18 | 19 | -- alternatively, there is some round robin support 20 | -- it will rotate the each time the statement ticks, so it isn't the fastest 21 | 22 | EVERY 20 TICKS DO 23 | INPUT FROM source 24 | OUTPUT 128 dirt TO dest ROUND ROBIN BY BLOCK 25 | -- instead of outputting to all blocks labelled "dest" 26 | -- when this statement executes it will pick only one block 27 | -- the chosen block rotates each time this statement is executed 28 | 29 | FORGET 30 | 31 | INPUT FROM "storage a", "storage b" ROUND ROBIN BY LABEL 32 | OUTPUT 8 bone_meal TO EACH dispenser 33 | -- instead of outputting to all the labels 34 | -- one label will be chosen each time the statement executes 35 | -- basically alternating between 36 | -- INPUT FROM "storage a" 37 | -- and 38 | -- INPUT FROM "storage b" 39 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/slots_and_sides.sfml: -------------------------------------------------------------------------------- 1 | name "Slots and sides" 2 | 3 | every 20 ticks do 4 | input from a top, west side slots 0,1,3-4,7-9,21 5 | output to a bottom side slots 2 6 | end -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/tag_matching.sfml: -------------------------------------------------------------------------------- 1 | NAME "Tag Matching" 2 | 3 | EVERY 20 TICKS DO 4 | -- these are equivalent 5 | INPUT WITH #forge:gems FROM chest 6 | INPUT WITH TAG forge:gems FROM chest 7 | INPUT WITH TAG #forge:gems FROM chest 8 | 9 | -- you can omit the namespace to match all namespaces 10 | -- these are equivalent 11 | INPUT WITH #ingots FROM chest 12 | INPUT WITH TAG *:ingots FROM chest 13 | 14 | -- some tags have multiple path elements 15 | INPUT WITH TAG refinedstorage:disks/items/* FROM chest 16 | INPUT WITH #tools/*/*_matter FROM chest 17 | 18 | -- block tags work for items too 19 | INPUT *a* WITH TAG minecraft:mineable/shovel FROM chest 20 | 21 | -- matching all remaining segments is possible 22 | INPUT WITH #the_bumblezone:essence/** FROM chest 23 | -- should match: 24 | -- #the_bumblezone:essence/life/grow_plants 25 | -- #the_bumblezone:essence/calming_arena/drowned_bonus_held_item" 26 | -- #the_bumblezone:essence/knowing/block_entity_forced_highlighting" 27 | 28 | -- combine with other stuff too 29 | INPUT 30 | 3 RETAIN 5 WITH TAG #forge:ingots, 31 | 4 dirt, 32 | WITH #mineable/axe, 33 | minecraft: WITH #ingots, 34 | stone, 35 | EXCEPT sand, gold_ingot 36 | FROM chest 37 | 38 | OUTPUT TO other_chest 39 | END -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/thank_you.sfml: -------------------------------------------------------------------------------- 1 | NAME "Thank you!" 2 | 3 | ---- GitHub Sponsors - https://github.com/sponsors/TeamDman 4 | 5 | -- SpruceMist 6 | -- GodTierUser 7 | 8 | ---- Ko-fi - https://ko-fi.com/teamdman 9 | 10 | -- micrwvae 11 | -- juh9870 12 | -- Flynn 13 | -- rick2049deckard 14 | -- Satherov 15 | -- TheVoos 16 | -- Qther 17 | 18 | ---- Patreon - https://www.patreon.com/c/TeamDman 19 | 20 | -- ...There's nothing here. Be the first! -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/template_programs/timer_triggers.sfml: -------------------------------------------------------------------------------- 1 | NAME "Timer triggers" 2 | 3 | -- The manager's internal clock starts at zero when placed 4 | -- It is also randomly initialized after being unloaded 5 | EVERY 20 TICKS DO 6 | END 7 | 8 | -- Sometimes you may want more control 9 | -- Instead of the manager's internal clock, you can use the world clock to choose when to tick 10 | EVERY 20 GLOBAL TICKS DO END 11 | 12 | -- You can also add an offset 13 | EVERY 20 PLUS 1 TICKS DO END -- manager clock 14 | EVERY 20 GLOBAL PLUS 1 TICKS DO END -- global clock 15 | 16 | -- There is also a shorthand notation 17 | -- Don't mistake this for math lol 18 | EVERY 20+1 TICKS DO END -- manager clock 19 | EVERY 20G TICKS DO END -- global clock 20 | EVERY 20G+1 TICKS DO END -- global clock 21 | 22 | -- You can mix and match 23 | EVERY 20 G PLUS 1 TICKS DO END 24 | EVERY 20 GLOBAL + 1 TICKS DO END 25 | -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/cable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/cable.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/fancy_cable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/fancy_cable.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/manager_bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/manager_bot.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/manager_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/manager_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/manager_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/manager_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/printing_press_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/printing_press_base.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/printing_press_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/printing_press_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/test_barrel_tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/test_barrel_tank.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/tunnelled_manager_bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/tunnelled_manager_bot.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/tunnelled_manager_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/tunnelled_manager_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/tunnelled_manager_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/tunnelled_manager_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/water_intake_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/water_intake_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/block/water_intake_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/block/water_intake_inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/gui/container/manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/gui/container/manager.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/gui/jei/printing_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/gui/jei/printing_press.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/item/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/item/disk.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/item/form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/item/form.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/item/labelgun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/item/labelgun.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/item/network_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/item/network_tool.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/item/xp_goop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/item/xp_goop.png -------------------------------------------------------------------------------- /src/main/resources/assets/sfm/textures/item/xp_shard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/src/main/resources/assets/sfm/textures/item/xp_shard.png -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "examplemod resources", 4 | "pack_format": 7 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/test/java/ca/teamdman/benchmark/README.md: -------------------------------------------------------------------------------- 1 | [Sharp CS - Elegant Code - My subscriber was right! | Testing Java Streams performance with Java Microbenchmark Harness (JMH)](https://www.youtube.com/watch?v=28sYWL7LtFU) 2 | 3 | [Benchmarking Java code with JMH](https://davidvlijmincx.com/posts/jmh-benchmark-java/) 4 | 5 | [jmh mailing archives](https://mail.openjdk.org/pipermail/jmh-dev/) 6 | 7 | [what is the difference between warmup attribute in Fork and Warmup annotation in jmh?](https://stackoverflow.com/questions/47776345/what-is-the-difference-between-warmup-attribute-in-fork-and-warmup-annotation-in/48363614#48363614) 8 | 9 | [What is the purpose of JMH @Fork?](https://stackoverflow.com/questions/35046745/what-is-the-purpose-of-jmh-fork) 10 | 11 | [jmh java docs](https://javadoc.io/doc/org.openjdk.jmh/jmh-core/latest/index.html) 12 | -------------------------------------------------------------------------------- /src/test/java/ca/teamdman/benchmark/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ParametersAreNonnullByDefault 4 | @MethodsReturnNonnullByDefault 5 | @FieldsAreNonnullByDefault 6 | package ca.teamdman.benchmark; 7 | 8 | import net.minecraft.FieldsAreNonnullByDefault; 9 | import net.minecraft.MethodsReturnNonnullByDefault; 10 | 11 | import javax.annotation.ParametersAreNonnullByDefault; -------------------------------------------------------------------------------- /src/test/java/ca/teamdman/sfm/NullableDirectionEnumMapTests.java: -------------------------------------------------------------------------------- 1 | package ca.teamdman.sfm; 2 | 3 | import ca.teamdman.sfm.common.util.SFMDirections; 4 | import net.minecraft.core.Direction; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | import static org.junit.jupiter.api.Assertions.assertNull; 12 | 13 | public class NullableDirectionEnumMapTests { 14 | @Test 15 | public void test() { 16 | var map = new SFMDirections.NullableDirectionEnumMap(); 17 | for (Direction direction : SFMDirections.DIRECTIONS_WITH_NULL) { 18 | map.put(direction, "test"); 19 | } 20 | for (Direction direction : SFMDirections.DIRECTIONS_WITH_NULL) { 21 | assertEquals("test", map.get(direction)); 22 | } 23 | map.forEach((direction, s) -> assertEquals("test", s)); 24 | List keys = new ArrayList<>(); 25 | map.forEach((direction, s) -> keys.add(direction)); 26 | assertEquals(SFMDirections.DIRECTIONS_WITH_NULL.length, keys.size()); 27 | map = new SFMDirections.NullableDirectionEnumMap<>(); 28 | map.put(null, "hi"); 29 | assertEquals("hi", map.get(null)); 30 | for (Direction direction : SFMDirections.DIRECTIONS) { 31 | assertNull(map.get(direction)); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Debug Visually Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ] 15 | }, 16 | { 17 | "name": "Compile and Debug Extension", 18 | "type": "extensionHost", 19 | "request": "launch", 20 | "args": [ 21 | "--extensionDevelopmentPath=${workspaceFolder}" 22 | ], 23 | "preLaunchTask": "Compile Extension", 24 | "outFiles": [ 25 | "${workspaceFolder}/out/**/*.js" 26 | ] 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Compile Extension", 6 | "type": "shell", 7 | "command": "npm", 8 | "args": [ 9 | "run", 10 | "compile" 11 | ], 12 | "group": { 13 | "kind": "build", 14 | "isDefault": true 15 | }, 16 | "problemMatcher": [] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | tests/** 6 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/TODO.md: -------------------------------------------------------------------------------- 1 | https://github.com/mike-lischke/antlr4-c3 2 | 3 | - Button to download all examples from all categories --> Button should be located on the bottom bar, next to UTF-8 and similar, it will download every content from every url 4 | Maybe making it a setting to keep the files? 5 | 6 | - Improve snippets --> Configuration for key words, not everybody likes "input" but "Input" or "INPUT" 7 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "--", 5 | }, 6 | // symbols used as brackets 7 | "brackets": [ 8 | ["{", "}"], 9 | ["[", "]"], 10 | ["(", ")"] 11 | ], 12 | // symbols that are auto closed when typing 13 | "autoClosingPairs": [ 14 | ["{", "}"], 15 | ["[", "]"], 16 | ["(", ")"], 17 | ["\"", "\""], 18 | ["'", "'"] 19 | ], 20 | // symbols that can be used to surround a selection 21 | "surroundingPairs": [ 22 | ["{", "}"], 23 | ["[", "]"], 24 | ["(", ")"], 25 | ["\"", "\""], 26 | ["'", "'"] 27 | ], 28 | //Every ... ticks do .... 29 | "folding": { 30 | "markers": { 31 | "start": "^\\s*([iI][fF]\\s+.*\\s*[tT][hH][eE][nN]|[iI][fF]\\s+.*|[eE][vV][eE][rR][yY]\\s+\\d+\\s+[tT][iI][cC][kK][sS]\\s+[dD][oO]|[eE][vV][eE][rR][yY]\\s+[rR][eE][dD][sS][tT][oO][nN][eE]\\s+[pP][uU][lL][sS][eE]\\s+[dD][oO])\\s*$", 32 | "end": "^\\s*[eE][nN][dD]\\s*$" 33 | }, 34 | "offSide": true 35 | } 36 | } -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/controller.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/disk.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/experience goop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/experience goop.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/experience shard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/experience shard.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/label gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/label gun.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/label.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/printing press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/printing press.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/media/tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/media/tool.png -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { registerSnippets } from './snippets/snippetController'; 3 | import { activityBar, deleteTempFiles } from './activitybar/ActivityBar'; 4 | import { handleDocument} from './antlrg4/Parser'; 5 | import { checkInputOutput } from './antlrg4/Warning'; 6 | 7 | /** 8 | * Main method to call everything we need 9 | * @param context Vscode extension 10 | */ 11 | export function activate(context: vscode.ExtensionContext) { 12 | console.log("bruh activating"); 13 | registerSnippets(context); 14 | activityBar(context); 15 | 16 | const checking = vscode.workspace.onDidSaveTextDocument((document) => { 17 | handleDocument(document); 18 | checkInputOutput(document); 19 | }); 20 | context.subscriptions.push(checking); 21 | } 22 | 23 | export function deactivate() { 24 | console.log("bruh deactivating"); //Copying teamy, sorry :P 25 | deleteTempFiles(); 26 | } 27 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/src/generated/SFML.tokens: -------------------------------------------------------------------------------- 1 | IF=1 2 | THEN=2 3 | ELSE=3 4 | HAS=4 5 | OVERALL=5 6 | SOME=6 7 | ONE=7 8 | LONE=8 9 | TRUE=9 10 | FALSE=10 11 | NOT=11 12 | AND=12 13 | OR=13 14 | GT=14 15 | GT_SYMBOL=15 16 | LT=16 17 | LT_SYMBOL=17 18 | EQ=18 19 | EQ_SYMBOL=19 20 | LE=20 21 | LE_SYMBOL=21 22 | GE=22 23 | GE_SYMBOL=23 24 | FROM=24 25 | TO=25 26 | INPUT=26 27 | OUTPUT=27 28 | WHERE=28 29 | SLOTS=29 30 | RETAIN=30 31 | EACH=31 32 | EXCEPT=32 33 | FORGET=33 34 | WITHOUT=34 35 | WITH=35 36 | TAG=36 37 | HASHTAG=37 38 | ROUND=38 39 | ROBIN=39 40 | BY=40 41 | LABEL=41 42 | BLOCK=42 43 | TOP=43 44 | BOTTOM=44 45 | NORTH=45 46 | EAST=46 47 | SOUTH=47 48 | WEST=48 49 | SIDE=49 50 | TICKS=50 51 | TICK=51 52 | SECONDS=52 53 | SECOND=53 54 | GLOBAL=54 55 | PLUS=55 56 | REDSTONE=56 57 | PULSE=57 58 | DO=58 59 | END=59 60 | NAME=60 61 | EVERY=61 62 | COMMA=62 63 | COLON=63 64 | SLASH=64 65 | DASH=65 66 | LPAREN=66 67 | RPAREN=67 68 | NUMBER_WITH_G_SUFFIX=68 69 | NUMBER=69 70 | IDENTIFIER=70 71 | STRING=71 72 | LINE_COMMENT=72 73 | WS=73 74 | UNUSED=74 75 | '>'=15 76 | '<'=17 77 | '='=19 78 | '<='=21 79 | '>='=23 80 | '#'=37 81 | ','=62 82 | ':'=63 83 | '/'=64 84 | '-'=65 85 | '('=66 86 | ')'=67 87 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/src/generated/SFMLLexer.tokens: -------------------------------------------------------------------------------- 1 | IF=1 2 | THEN=2 3 | ELSE=3 4 | HAS=4 5 | OVERALL=5 6 | SOME=6 7 | ONE=7 8 | LONE=8 9 | TRUE=9 10 | FALSE=10 11 | NOT=11 12 | AND=12 13 | OR=13 14 | GT=14 15 | GT_SYMBOL=15 16 | LT=16 17 | LT_SYMBOL=17 18 | EQ=18 19 | EQ_SYMBOL=19 20 | LE=20 21 | LE_SYMBOL=21 22 | GE=22 23 | GE_SYMBOL=23 24 | FROM=24 25 | TO=25 26 | INPUT=26 27 | OUTPUT=27 28 | WHERE=28 29 | SLOTS=29 30 | RETAIN=30 31 | EACH=31 32 | EXCEPT=32 33 | FORGET=33 34 | WITHOUT=34 35 | WITH=35 36 | TAG=36 37 | HASHTAG=37 38 | ROUND=38 39 | ROBIN=39 40 | BY=40 41 | LABEL=41 42 | BLOCK=42 43 | TOP=43 44 | BOTTOM=44 45 | NORTH=45 46 | EAST=46 47 | SOUTH=47 48 | WEST=48 49 | SIDE=49 50 | TICKS=50 51 | TICK=51 52 | SECONDS=52 53 | SECOND=53 54 | GLOBAL=54 55 | PLUS=55 56 | REDSTONE=56 57 | PULSE=57 58 | DO=58 59 | END=59 60 | NAME=60 61 | EVERY=61 62 | COMMA=62 63 | COLON=63 64 | SLASH=64 65 | DASH=65 66 | LPAREN=66 67 | RPAREN=67 68 | NUMBER_WITH_G_SUFFIX=68 69 | NUMBER=69 70 | IDENTIFIER=70 71 | STRING=71 72 | LINE_COMMENT=72 73 | WS=73 74 | UNUSED=74 75 | '>'=15 76 | '<'=17 77 | '='=19 78 | '<='=21 79 | '>='=23 80 | '#'=37 81 | ','=62 82 | ':'=63 83 | '/'=64 84 | '-'=65 85 | '('=66 86 | ')'=67 87 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tests/SFMFile.sfm: -------------------------------------------------------------------------------- 1 | --This file is just to make sure the icon on .sfml file is place correctly 2 | 3 | name "phytos!!!!!" 4 | 5 | every 20 ticks do 6 | if redstone eq 15 then 7 | input fluid:: from water 8 | output fluid:: to phyto 9 | forget 10 | input * except phytogro from drawer top side 11 | output retain 20 to each phyto slots 0 12 | forget 13 | input phytogro from drawer top side 14 | output * retain 4 phytogro to each phyto slots 1 15 | forget 16 | input * from phyto slots 2-5 17 | output * to drawer top side 18 | else 19 | input * from phyto 20 | output * to drawer top side 21 | end 22 | 23 | end 24 | 25 | every 2 ticks do 26 | input fe:: from powah top side 27 | output fe:: to phyto top side 28 | end 29 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tests/SFMLFile.sfml: -------------------------------------------------------------------------------- 1 | --This file is just to make sure the icon on .sfml file is place correctly 2 | 3 | name "hola" 4 | 5 | every 20 ticks do 6 | input 20 from interface 7 | output * to furnace top side 8 | forget 9 | input fe:: from interface2 10 | output item:minecraft:cobble* to chest2 11 | output * to fluid 12 | item:: 13 | item:minecraft: 14 | item:industrialforegoing:laser* this doesnt 15 | ::cobble* 16 | item 17 | if boolean_expression then 18 | if boolean_expression 19 | then 20 | end 21 | test> = > < <= >= --First one shouldnt have color, the rest yes 22 | end 23 | except Except exCEPT 24 | IF boolean_expression tHen 25 | end 26 | end 27 | 28 | every redstone pulse do 29 | 30 | end 31 | 32 | EVery Redstone pulse DO 33 | 34 | end 35 | evEry 20 ticks do 36 | hollaaaaa 37 | end 38 | 39 | every 1 ticks do 40 | input fe:: from power_source 41 | output fe:: to machine 42 | 43 | end 44 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tests/VisualTest.sfml: -------------------------------------------------------------------------------- 1 | -- Test here anything related to colors related stuff 2 | -- Should be tested at least with 3 different themes, the default one for vscode 3 | -- and another 2 that you like and have multiple colors 4 | 5 | name "A program" -- color on name and "a program" 6 | 7 | every 1 ticks do -- every, do using the same color, 1 using another, ticks using the same as fe::, item::, gas::, fluid:: 8 | input fe:: from power_source1 -- label should have no colors by default, nor the number on power_source1 9 | output fe:: to machine 10 | end 11 | 12 | every 20 ticks do 13 | input from furnace 14 | output to furnace 15 | end 16 | 17 | every 20 ticks do 18 | if chest has gt 5 then -- gt, lt, eq, .... should have a color 19 | --Something 20 | end 21 | if chest has >= then -- >=, =, >, .... should have a color 22 | 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tests/Warning.sfml: -------------------------------------------------------------------------------- 1 | --This example comes from the github itself, currently it does 5/7 cases (blame the last forget) 2 | 3 | 4 | EVERY 20 TICKS DO 5 | INPUT fluid:mek: FROM tank1 6 | OUTPUT TO tank2 7 | -- missing fluid output 8 | 9 | FORGET 10 | 11 | INPUT FROM thing1 12 | OUTPUT fluid::* TO thing2 13 | 14 | FORGET 15 | 16 | INPUT FROM tank1 17 | OUTPUT fluid:: TO tank2 18 | -- missing fluid input 19 | 20 | FORGET 21 | 22 | INPUT FROM chest 23 | INPUT fluid:: FROM tank1 24 | OUTPUT TO chest 25 | -- missing fluid output 26 | 27 | FORGET 28 | 29 | IF chest HAS > 0 stone THEN 30 | INPUT FROM chest 31 | INPUT fluid:: FROM tank 32 | END 33 | OUTPUT TO chest 34 | -- missing fluid input 35 | END 36 | EVERY 20 TICKS DO 37 | OUTPUT TO chest 38 | -- missing input 39 | 40 | FORGET 41 | 42 | INPUT FROM chest 43 | -- missing output 44 | END 45 | EVERY 20 TICKS DO 46 | INPUT 5 FROM a,b,c 47 | OUTPUT 1 to z1 48 | FORGET b,c 49 | OUTPUT TO z2 50 | -- no output uses input from b,c 51 | END 52 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tests/check_other_files.txt: -------------------------------------------------------------------------------- 1 | every 20 ticks do 2 | input from furnace 3 | output to furnace 4 | end 5 | 6 | -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tests/snippets.sfm: -------------------------------------------------------------------------------- 1 | -- Here you can test snippets (keep these 3 lines and delete the rest before commiting) 2 | -- Currently there are 7 snippets (change number and text below if added more): 3 | -- every, if, ifelse, ifelseif, input, output, basic and energy -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "rootDir": "src", 7 | "sourceMap": true, 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true 11 | }, 12 | "include": [ 13 | "src" 14 | ], 15 | "exclude": [ 16 | "node_modules", 17 | ".vscode-test" 18 | ] 19 | } -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.1.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.1.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.10.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.10.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.11.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.11.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.12.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.12.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.2.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.2.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.3.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.3.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.4.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.4.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.5.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.5.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.6.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.6.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.7.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.7.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.8.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.8.vsix -------------------------------------------------------------------------------- /vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.9.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDman/SuperFactoryManager/ed27be5bab6439ee1b39814eff8976c881acf233/vscodeextension/super-factory-manager-language/vsce-versions/super-factory-manager-language-0.0.9.vsix --------------------------------------------------------------------------------