From f101c8cd70da211e102ece00125d4067d0fea0cb Mon Sep 17 00:00:00 2001 From: Mysticpasta1 Date: Mon, 9 Oct 2023 08:13:12 -0500 Subject: [PATCH] FG 5 and filter recipes --- build.gradle | 128 ++++++++++-------- gradle.properties | 3 + gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 19 +++ .../api/recipe/AssemblyBehaviors.java | 5 + .../refraction/common/block/BlockFilter.java | 3 +- .../init/recipies/ModAssemblyRecipes.java | 59 ++++++++ .../assets/minecraft/blockstates/air.json | 13 ++ .../assets/refraction/lang/en_US.lang | 18 +-- .../assets/refraction/lang/ru_RU.lang | 18 +-- .../assets/refraction/lang/zh_CN.lang | 18 +-- src/main/resources/mcmod.info | 3 +- 12 files changed, 202 insertions(+), 87 deletions(-) create mode 100644 settings.gradle create mode 100644 src/main/resources/assets/minecraft/blockstates/air.json diff --git a/build.gradle b/build.gradle index 49b58e88..e929562c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,79 +1,95 @@ -buildscript { - repositories { - jcenter() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } - } - dependencies { - classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT" - } +plugins { + id 'net.minecraftforge.gradle' version '5.+' + id 'wtf.gofancy.fancygradle' version '1.1.2-5' + id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7' + id 'org.jetbrains.kotlin.jvm' version "1.9.0" } -apply plugin: "net.minecraftforge.gradle.forge" - version = "$mod_version.$patch_version" group = "com.teamwizardry" archivesBaseName = "refraction-$mc_version" -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' + +sourceCompatibility = targetCompatibility = 1.8 + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' +} + +fancyGradle { + patches { + coremods + } +} minecraft { - version = "$mc_version-$forge_version" - runDir = "run" - mappings = "$mcp_version" + mappings channel: 'stable', version: '39-1.12' - replace 'GRADLE:VERSION', "$mod_version" - replace 'required-before:librarianlib', 'required-before:librarianlib@' + liblib_version + runs { + client { + workingDirectory project.file('run') + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + environment 'MC_VERSION', '1.12.2' + } - replaceIn 'Constants.java' + server { + workingDirectory project.file('run') + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + environment 'MC_VERSION', '1.12.2' + } + } } repositories { mavenCentral() - maven { url = "http://maven.bluexin.be/repository/snapshots/" } - maven { url = "http://dvs1.progwml6.com/files/maven" } - maven { url = "http://maven.tterrag.com/" } - maven { url = "http://maven.blamejared.com" } - maven { url = 'http://maven.mcmoddev.com' } + maven { url = "https://maven.bluexin.be/repository/snapshots/" } + maven { url = "https://dvs1.progwml6.com/files/maven" } + maven { url = "https://maven.tterrag.com/" } + maven { url = "https://maven.blamejared.com" } + maven { url = 'https://maven.mcmoddev.com' } + maven { url = "https://mvnrepository.com/artifact/org.jetbrains/annotations" } + maven { + url "https://cursemaven.com" + content { + includeGroup "curse.maven" + } + } + mavenLocal() } dependencies { - compile "com.teamwizardry.librarianlib:librarianlib-1.12.2:$liblib_version-SNAPSHOT:deobf" - - deobfCompile "mezz.jei:jei_1.12.2:$jei_version:api" - compile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-$ct_version" - compile "net.darkhax.tesla:Tesla-1.12.2:$tesla_version" + minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860' - runtime "mezz.jei:jei_1.12.2:$jei_version" + implementation 'org.jetbrains:annotations:16.0.2' + implementation fg.deobf("com.teamwizardry.librarianlib:librarianlib-1.12.2:$liblib_version-SNAPSHOT:deobf") + compileOnly "mezz.jei:jei_1.12.2:$jei_version:api" + implementation fg.deobf("curse.maven:forgelin-continuous-456403:4635770") + implementation fg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465") + implementation fg.deobf("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-$ct_version") + runtimeOnly fg.deobf("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-$ct_version") + implementation fg.deobf("CraftTweaker2:CraftTweaker2-API:$ct_version") + runtimeOnly fg.deobf("CraftTweaker2:CraftTweaker2-API:$ct_version") + implementation fg.deobf("CraftTweaker2:ZenScript:$ct_version") + runtimeOnly fg.deobf("CraftTweaker2:ZenScript:$ct_version") + implementation fg.deobf("net.darkhax.tesla:Tesla-1.12.2:$tesla_version") + runtimeOnly "mezz.jei:jei_1.12.2:$jei_version" } -processResources { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include "mcmod.info" - - // replace version and mcversion - expand "version": project.version, - "mcversion": project.minecraft.version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude "mcmod.info" +jar { + manifest { + attributes([ + "Specification-Title": "refraction", + "Specification-Vendor": "Mysticpasta1", + "Specification-Version": "1", // We are version 1 of ourselves + "Implementation-Title": project.name, + "Implementation-Version": "${version}", + "Implementation-Vendor" :"Mysticpasta1", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) } } -idea { - module { - inheritOutputDirs = false - outputDir = compileJava.destinationDir - testOutputDir = compileTestJava.destinationDir - } -} +jar.finalizedBy('reobfJar') \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 9d032554..b02415d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,6 @@ +org.gradle.jvmargs=-Xmx5G +org.gradle.daemon=false + mod_version=1.9 patch_version=10 mc_version=1.12.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ce66e81c..6ccc7a67 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..37b1a137 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,19 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { + name 'Garden of Fancy' + url 'https://maven.gofancy.wtf/releases' + } + + maven { + url = 'https://maven.minecraftforge.net' + } + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id.startsWith("org.jetbrains.kotlin")) useVersion("1.9.0") + } + } +} diff --git a/src/main/java/com/teamwizardry/refraction/api/recipe/AssemblyBehaviors.java b/src/main/java/com/teamwizardry/refraction/api/recipe/AssemblyBehaviors.java index 2ee6dc5a..e77d8166 100644 --- a/src/main/java/com/teamwizardry/refraction/api/recipe/AssemblyBehaviors.java +++ b/src/main/java/com/teamwizardry/refraction/api/recipe/AssemblyBehaviors.java @@ -4,6 +4,7 @@ import net.minecraft.item.ItemStack; import java.awt.*; +import java.util.function.Function; import static com.teamwizardry.librarianlib.features.helpers.CommonUtilMethods.getCurrentModId; @@ -29,4 +30,8 @@ public static IAssemblyBehavior register(String key, IAssemblyBehavior recipe) { public static IAssemblyBehavior register(String key, ItemStack output, Color one, Color two, Object... inputs) { return register(key, new AssemblyRecipe(output, one, two, inputs)); } + + public static IAssemblyBehavior register(String key, ItemStack output, Function function, Color one, Color two, Object... inputs) { + return register(key, new AssemblyRecipe(function.apply(output), one, two, inputs)); + } } diff --git a/src/main/java/com/teamwizardry/refraction/common/block/BlockFilter.java b/src/main/java/com/teamwizardry/refraction/common/block/BlockFilter.java index 0138bdbe..10246a96 100644 --- a/src/main/java/com/teamwizardry/refraction/common/block/BlockFilter.java +++ b/src/main/java/com/teamwizardry/refraction/common/block/BlockFilter.java @@ -52,8 +52,7 @@ public class BlockFilter extends BlockMod implements ILightSink, IOpticConnectab public BlockFilter() { super("filter", Material.GLASS, VARIANTS); - setBlockUnbreakable(); - setHardness(100000); + setHardness(2F); setSoundType(SoundType.GLASS); } diff --git a/src/main/java/com/teamwizardry/refraction/init/recipies/ModAssemblyRecipes.java b/src/main/java/com/teamwizardry/refraction/init/recipies/ModAssemblyRecipes.java index 3dc82576..01e12b90 100644 --- a/src/main/java/com/teamwizardry/refraction/init/recipies/ModAssemblyRecipes.java +++ b/src/main/java/com/teamwizardry/refraction/init/recipies/ModAssemblyRecipes.java @@ -1,6 +1,7 @@ package com.teamwizardry.refraction.init.recipies; import com.teamwizardry.refraction.api.recipe.ColorConsumingBehavior; +import com.teamwizardry.refraction.common.block.BlockFilter; import com.teamwizardry.refraction.init.ModBlocks; import com.teamwizardry.refraction.init.ModItems; import net.minecraft.init.Blocks; @@ -8,6 +9,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.awt.*; +import java.util.function.Function; import static com.teamwizardry.refraction.api.lib.LibOreDict.*; import static com.teamwizardry.refraction.api.recipe.AssemblyBehaviors.register; @@ -36,10 +38,12 @@ public static void init() { LENS, LENS, LENS, LENS, LENS, LENS, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, "ingotIron", "ingotIron", "ingotIron"); + register("splitter", new ItemStack(ModBlocks.SPLITTER), new Color(0, 255, 0, 16), new Color(0, 255, 0, 32), LENS, LENS, LENS, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY); + register("sensor", new ItemStack(ModBlocks.SENSOR), new Color(255, 96, 0, 16), new Color(255, 160, 0, 64), LENS, LENS, LENS, LENS, LENS, LENS, @@ -64,10 +68,12 @@ public static void init() { "dustGlowstone", REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, LENS, LENS, LENS); + register("disco", new ItemStack(ModBlocks.DISCO_BALL), new Color(255, 0, 255, 64), new Color(255, 0, 255, 128), "gemDiamond", "gemDiamond", "gemDiamond", "gemDiamond", REFLECTIVE_ALLOY, REFLECTIVE_ALLOY, REFLECTIVE_ALLOY); + register("optic_fiber", new ItemStack(ModBlocks.OPTIC_FIBER, 4), new Color(96, 0, 255, 64), new Color(160, 0, 255, 128), LENS, LENS, LENS, @@ -80,6 +86,52 @@ public static void init() { OPTIC_FIBER, OPTIC_FIBER, OPTIC_FIBER, OPTIC_FIBER, "enderpearl", "ingotIron"); + + register("white_filter", new ItemStack(ModBlocks.FILTER), applyMeta(0), + new Color(255, 255, 255, 128), new Color(255, 255, 255, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("red_filter", new ItemStack(ModBlocks.FILTER), applyMeta(1), + new Color(255, 0, 0, 128), new Color(255, 0, 0, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("green_filter", new ItemStack(ModBlocks.FILTER), applyMeta(2), + new Color(0, 255, 0, 128), new Color(0, 255, 0, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("blue_filter", new ItemStack(ModBlocks.FILTER), applyMeta(3), + new Color(0, 0, 255, 128), new Color(0, 0, 255, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("cyan_filter", new ItemStack(ModBlocks.FILTER), applyMeta(4), + new Color(0, 128, 255, 128), new Color(0, 128, 255, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("yellow_filter", new ItemStack(ModBlocks.FILTER), applyMeta(5), + new Color(255, 255, 0, 128), new Color(255, 255, 0, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("magenta_filter", new ItemStack(ModBlocks.FILTER), applyMeta(6), + new Color(255, 0, 255, 128), new Color(255, 0, 255, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("pink_filter", new ItemStack(ModBlocks.FILTER), applyMeta(7), + new Color(255, 128, 255, 128), new Color(255, 128, 255, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + + register("orange_filter", new ItemStack(ModBlocks.FILTER), applyMeta(8), + new Color(255, 128, 0, 128), new Color(255, 128, 128, 255), + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, + LENS, REFLECTIVE_ALLOY, LENS, REFLECTIVE_ALLOY, LENS); + register("electron_exciter", new ItemStack(ModBlocks.ELECTRON_EXCITER), new Color(0, 255, 96, 128), new Color(0, 255, 160, 255), LENS, LENS, LENS, LENS, LENS, LENS, @@ -99,4 +151,11 @@ public static void init() { register("ammo", new ColorConsumingBehavior(new ItemStack(ModItems.LIGHT_CARTRIDGE), new ItemStack(ModItems.LIGHT_CARTRIDGE))); register("grenade", new ColorConsumingBehavior(new ItemStack(ModItems.GRENADE), new ItemStack(ModItems.GRENADE))); } + + public static Function applyMeta(int meta) { + return itemStack -> { + itemStack.setItemDamage(meta); + return itemStack; + }; + } } diff --git a/src/main/resources/assets/minecraft/blockstates/air.json b/src/main/resources/assets/minecraft/blockstates/air.json new file mode 100644 index 00000000..ea666ff6 --- /dev/null +++ b/src/main/resources/assets/minecraft/blockstates/air.json @@ -0,0 +1,13 @@ +{ + "variants": { + "color=white": {}, + "color=red": {}, + "color=green": {}, + "color=blue": {}, + "color=cyan": {}, + "color=yellow": {}, + "color=magenta": {}, + "color=pink": {}, + "color=orange": {} + } +} diff --git a/src/main/resources/assets/refraction/lang/en_US.lang b/src/main/resources/assets/refraction/lang/en_US.lang index 2032b279..525e2ed8 100644 --- a/src/main/resources/assets/refraction/lang/en_US.lang +++ b/src/main/resources/assets/refraction/lang/en_US.lang @@ -29,15 +29,15 @@ tile.refraction:axyz.8.name=AFDQTA (A Fool Doesn't Question This Acronym) tile.refraction:axyz.9.name=AFDQTA (Atomically Flan Decrementing Quality Total Annihilator) tile.refraction:light_bridge.name=Light Bridge -tile.refraction:filter_white.name=White Creative Filter -tile.refraction:filter_red.name=Red Creative Filter -tile.refraction:filter_green.name=Green Creative Filter -tile.refraction:filter_blue.name=Blue Creative Filter -tile.refraction:filter_cyan.name=Cyan Creative Filter -tile.refraction:filter_yellow.name=Yellow Creative Filter -tile.refraction:filter_magenta.name=Magenta Creative Filter -tile.refraction:filter_pink.name=Pink Creative Filter -tile.refraction:filter_orange.name=Orange Creative Filter +tile.refraction:filter_white.name=White Filter +tile.refraction:filter_red.name=Red Filter +tile.refraction:filter_green.name=Green Filter +tile.refraction:filter_blue.name=Blue Filter +tile.refraction:filter_cyan.name=Cyan Filter +tile.refraction:filter_yellow.name=Yellow Filter +tile.refraction:filter_magenta.name=Magenta Filter +tile.refraction:filter_pink.name=Pink Filter +tile.refraction:filter_orange.name=Orange Filter item.refraction:laser_pen.name=Laser Pen diff --git a/src/main/resources/assets/refraction/lang/ru_RU.lang b/src/main/resources/assets/refraction/lang/ru_RU.lang index ea203722..7b306519 100644 --- a/src/main/resources/assets/refraction/lang/ru_RU.lang +++ b/src/main/resources/assets/refraction/lang/ru_RU.lang @@ -28,15 +28,15 @@ tile.refraction:axyz.7.name=АПКТА (Атомный примитивный к tile.refraction:axyz.8.name=АПКТА (Анатомический практически конспирологический транспортный автобус) tile.refraction:axyz.9.name=АПКТА (Атмосферно проективное коммерческое телефонное агенство) -tile.refraction:filter_white.name=Белый творческий фильтр -tile.refraction:filter_red.name=Красный творческий фильтр -tile.refraction:filter_green.name=Зеленый творческий фильтр -tile.refraction:filter_blue.name=Синий творческий фильтр -tile.refraction:filter_cyan.name=Бирюзовый творческий фильтр -tile.refraction:filter_yellow.name=Желтый творческий фильтр -tile.refraction:filter_magenta.name=Фиолетовый творческий фильтр -tile.refraction:filter_pink.name=Розовый творческий фильтр -tile.refraction:filter_orange.name=Оранжевый творческий фильтр +tile.refraction:filter_white.name=Белый фильтр +tile.refraction:filter_red.name=Красный фильтр +tile.refraction:filter_green.name=Зеленый фильтр +tile.refraction:filter_blue.name=Синий фильтр +tile.refraction:filter_cyan.name=Бирюзовый фильтр +tile.refraction:filter_yellow.name=Желтый фильтр +tile.refraction:filter_magenta.name=Фиолетовый фильтр +tile.refraction:filter_pink.name=Розовый фильтр +tile.refraction:filter_orange.name=Оранжевый фильтр item.refraction:laser_pen.name=Лазерная указка diff --git a/src/main/resources/assets/refraction/lang/zh_CN.lang b/src/main/resources/assets/refraction/lang/zh_CN.lang index 1b31e3e2..e3376606 100644 --- a/src/main/resources/assets/refraction/lang/zh_CN.lang +++ b/src/main/resources/assets/refraction/lang/zh_CN.lang @@ -28,15 +28,15 @@ tile.refraction:axyz.7.name=AFDQTA (Attacking, Flampling Demon Quests To Agadeem tile.refraction:axyz.8.name=AFDQTA (A Fool Doesn't Question This Acronym 就是傻子也不会对这个首字母缩略词有疑问) tile.refraction:light_bridge.name=光桥 -tile.refraction:filter_white.name=白色创造滤镜 -tile.refraction:filter_red.name=红色创造滤镜 -tile.refraction:filter_green.name=绿色创造滤镜 -tile.refraction:filter_blue.name=蓝色创造滤镜 -tile.refraction:filter_cyan.name=青色创造滤镜 -tile.refraction:filter_yellow.name=黄色创造滤镜 -tile.refraction:filter_magenta.name=品红色创造滤镜 -tile.refraction:filter_pink.name=粉色创造滤镜 -tile.refraction:filter_orange.name=橙色创造滤镜 +tile.refraction:filter_white.name=白色过滤器 +tile.refraction:filter_red.name=红色过滤器 +tile.refraction:filter_green.name=绿色过滤器 +tile.refraction:filter_blue.name=蓝色过滤器 +tile.refraction:filter_cyan.name=青色过滤器 +tile.refraction:filter_yellow.name=黄色过滤器 +tile.refraction:filter_magenta.name=品红色过滤器 +tile.refraction:filter_pink.name=粉色过滤器 +tile.refraction:filter_orange.name=橙色过滤器 item.refraction:laser_pen.name=激光笔 diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 1d002a50..b38ea2d5 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -10,7 +10,8 @@ "authorList": [ "Demoniaque", "murapix", - "theCodeWarrior" + "theCodeWarrior", + "Mysticpasta1" ], "credits": "Art: MechWarrior99", "logoFile": "",