From 70915ce1b32d5baceefb3188e2bcb9be3e34761d Mon Sep 17 00:00:00 2001 From: Electrolyte220 Date: Tue, 29 Aug 2023 21:34:13 -0400 Subject: [PATCH] Configurable impact for tiered millstones & crushing wheels Update version --- build.gradle | 2 +- .../java/electrolyte/greate/GreateConfig.java | 251 +++++++++++++++--- .../java/electrolyte/greate/GreateEnums.java | 20 +- .../data/GreateBuilderTransformers.java | 3 - .../greate/registry/CrushingWheels.java | 24 +- .../greate/registry/Millstones.java | 19 +- src/main/resources/greate.mixin.json | 2 +- 7 files changed, 255 insertions(+), 66 deletions(-) diff --git a/build.gradle b/build.gradle index e60a6f5c..65401c94 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' } -version = '0.0.2' +version = '0.0.3' group = 'electrolyte.greate' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'greate' diff --git a/src/main/java/electrolyte/greate/GreateConfig.java b/src/main/java/electrolyte/greate/GreateConfig.java index e056b9f1..bf18891b 100644 --- a/src/main/java/electrolyte/greate/GreateConfig.java +++ b/src/main/java/electrolyte/greate/GreateConfig.java @@ -11,61 +11,252 @@ public class GreateConfig { @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for ULS tier machines") - public double ULS_CAPACITY = 8; + @Comment("Settings related to ULS tier Machines") + public ULS ULS = new ULS(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for LS tier machines") - public double LS_CAPACITY = 32; + @Comment("Settings related to LS tier Machines") + public LS LS = new LS(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for MS tier machines") - public double MS_CAPACITY = 128; + @Comment("Settings related to MS tier Machines") + public MS MS = new MS(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for HS tier machines") - public double HS_CAPACITY = 512; + @Comment("Settings related to HS tier Machines") + public HS HS = new HS(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for ES tier machines") - public double ES_CAPACITY = 2048; + @Comment("Settings related to ES tier Machines") + public ES ES = new ES(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for IS tier machines") - public double IS_CAPACITY = 8192; + @Comment("Settings related to IS tier Machines") + public IS IS = new IS(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for LuS tier machines") - public double LUS_CAPACITY = 32768; + @Comment("Settings related to LUS tier Machines") + public LUS LUS = new LUS(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for ZPMS tier machines") - public double ZPMS_CAPACITY = 131072; + @Comment("Settings related to ZPM tier Machines") + public ZPM ZPM = new ZPM(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for US tier machines") - public double US_CAPACITY = 524288; + @Comment("Settings related to US tier Machines") + public US US = new US(); @Configurable @Synchronized - @Range(min = 1) - @Comment("Maximum stress capacity for UHS tier machines") - public double UHS_CAPACITY = 2097152; + @Comment("Settings related to UHS tier Machines") + public UHS UHS = new UHS(); + + public static class ULS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for ULS tier machines") + public double CAPACITY = 8; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a ULS tier millstone") + public double MILLSTONE_IMPACT = 0.5; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a ULS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 0.5; + } + + public static class LS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for LS tier machines") + public double CAPACITY = 32; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a LS tier millstone") + public double MILLSTONE_IMPACT = 1.0; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a LS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 1.0; + } + + public static class MS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for MS tier machines") + public double CAPACITY = 128; + + @Configurable + @Synchronized + @Comment("Stress impact for a MS tier millstone") + @Range(min = 0) + public double MILLSTONE_IMPACT = 1.5; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a MS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 1.5; + } + + public static class HS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for HS tier machines") + public double CAPACITY = 512; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a HS tier millstone") + public double MILLSTONE_IMPACT = 2.0; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a HS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 2.0; + } + + public static class ES { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for ES tier machines") + public double CAPACITY = 2048; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a ES tier millstone") + public double MILLSTONE_IMPACT = 2.5; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a ES tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 2.5; + } + + public static class IS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for IS tier machines") + public double CAPACITY = 8192; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a IS tier millstone") + public double MILLSTONE_IMPACT = 3.0; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a IS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 3.0; + + } + + public static class LUS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for LuS tier machines") + public double CAPACITY = 32768; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a LUS tier millstone") + public double MILLSTONE_IMPACT = 3.5; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a LUS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 3.5; + } + + public static class ZPM { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for ZPM tier machines") + public double CAPACITY = 131072; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a ZPM tier millstone") + public double MILLSTONE_IMPACT = 4.0; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a ZPM tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 4.0; + } + + public static class US { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for US tier machines") + public double CAPACITY = 524288; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a US tier millstone") + public double MILLSTONE_IMPACT = 4.5; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a US tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 4.5; + } + + public static class UHS { + @Configurable + @Synchronized + @Range(min = 1) + @Comment("Maximum stress capacity for UHS tier machines") + public double CAPACITY = 2097152; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a UHS tier millstone") + public double MILLSTONE_IMPACT = 5.0; + + @Configurable + @Synchronized + @Range(min = 0) + @Comment("Stress impact for a UHS tier crushing wheel") + public double CRUSHING_WHEEL_IMPACT = 5.0; + } } diff --git a/src/main/java/electrolyte/greate/GreateEnums.java b/src/main/java/electrolyte/greate/GreateEnums.java index 6a55f92a..3c406e9d 100644 --- a/src/main/java/electrolyte/greate/GreateEnums.java +++ b/src/main/java/electrolyte/greate/GreateEnums.java @@ -9,16 +9,16 @@ public class GreateEnums { public enum TIER implements Comparable { - ULTRA_LOW("ULS", Greate.CONFIG.ULS_CAPACITY, ChatFormatting.WHITE), - LOW("LS", Greate.CONFIG.LS_CAPACITY, ChatFormatting.GRAY), - MEDIUM("MS", Greate.CONFIG.MS_CAPACITY, ChatFormatting.AQUA), - HIGH("HS", Greate.CONFIG.HS_CAPACITY, ChatFormatting.GOLD), - EXTREME("ES", Greate.CONFIG.ES_CAPACITY, ChatFormatting.DARK_PURPLE), - INSANE("IS", Greate.CONFIG.IS_CAPACITY, ChatFormatting.DARK_BLUE), - LUDICRIOUS("LuS", Greate.CONFIG.LUS_CAPACITY, ChatFormatting.LIGHT_PURPLE), - ZPM("ZPMS", Greate.CONFIG.ZPMS_CAPACITY, ChatFormatting.RED), - ULTIMATE("US", Greate.CONFIG.US_CAPACITY, ChatFormatting.DARK_AQUA), - ULTIMATE_HIGH("UHS", Greate.CONFIG.UHS_CAPACITY, ChatFormatting.DARK_RED); + ULTRA_LOW("ULS", Greate.CONFIG.ULS.CAPACITY, ChatFormatting.WHITE), + LOW("LS", Greate.CONFIG.LS.CAPACITY, ChatFormatting.GRAY), + MEDIUM("MS", Greate.CONFIG.MS.CAPACITY, ChatFormatting.AQUA), + HIGH("HS", Greate.CONFIG.HS.CAPACITY, ChatFormatting.GOLD), + EXTREME("ES", Greate.CONFIG.ES.CAPACITY, ChatFormatting.DARK_PURPLE), + INSANE("IS", Greate.CONFIG.IS.CAPACITY, ChatFormatting.DARK_BLUE), + LUDICRIOUS("LuS", Greate.CONFIG.LUS.CAPACITY, ChatFormatting.LIGHT_PURPLE), + ZPM("ZPMS", Greate.CONFIG.ZPM.CAPACITY, ChatFormatting.RED), + ULTIMATE("US", Greate.CONFIG.US.CAPACITY, ChatFormatting.DARK_AQUA), + ULTIMATE_HIGH("UHS", Greate.CONFIG.UHS.CAPACITY, ChatFormatting.DARK_RED); private final String name; private final double stressCapacity; diff --git a/src/main/java/electrolyte/greate/foundation/data/GreateBuilderTransformers.java b/src/main/java/electrolyte/greate/foundation/data/GreateBuilderTransformers.java index 2817a128..0e87a23e 100644 --- a/src/main/java/electrolyte/greate/foundation/data/GreateBuilderTransformers.java +++ b/src/main/java/electrolyte/greate/foundation/data/GreateBuilderTransformers.java @@ -14,7 +14,6 @@ import com.tterrag.registrate.builders.ItemBuilder; import com.tterrag.registrate.util.entry.BlockEntry; import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; -import electrolyte.greate.GreateEnums.TIER; import electrolyte.greate.content.kinetics.crusher.TieredCrushingWheelBlock; import electrolyte.greate.content.kinetics.gearbox.TieredGearboxBlock; import electrolyte.greate.content.kinetics.gearbox.TieredVerticalGearboxItem; @@ -28,7 +27,6 @@ import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.ItemLike; -import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.client.model.generators.loaders.ObjModelBuilder; @@ -151,5 +149,4 @@ public static NonNullUnaryOperator RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.ULS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.ULTRA_LOW)) .register(); @@ -56,7 +56,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.LS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.LOW)) .register(); @@ -78,7 +78,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.MS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.MEDIUM)) .register(); @@ -100,7 +100,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.HS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.HIGH)) .register(); @@ -122,7 +122,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.ES.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.EXTREME)) .register(); @@ -145,7 +145,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.IS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.INSANE)) .register(); @@ -168,7 +168,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.LUS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.LUDICRIOUS)) .register(); @@ -190,7 +190,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.ZPM.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.ZPM)) .register(); @@ -212,8 +212,8 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) - .onRegister(c -> c.setTier(TIER.HIGH)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.US.CRUSHING_WHEEL_IMPACT)) + .onRegister(c -> c.setTier(TIER.ULTIMATE)) .register(); public static final BlockEntry DARMSTADTIUM_CRUSHING_WHEEL_CONTROLLER = @@ -223,7 +223,7 @@ public class CrushingWheels { .properties(p -> p.noOcclusion() .noLootTable().air()) .blockstate(GreateBlockStateGen.tieredCrushingWheelControllerProvider()) - .onRegister(c -> c.setTier(TIER.HIGH)) + .onRegister(c -> c.setTier(TIER.ULTIMATE)) .register(); public static final BlockEntry NEUTRONIUM_CRUSHING_WHEEL = @@ -234,7 +234,7 @@ public class CrushingWheels { .transform(TagGen.pickaxeOnly()) .addLayer(() -> RenderType::cutoutMipped) .transform(GreateBuilderTransformers.tieredCrushingWheel()) - .transform(BlockStressDefaults.setImpact(1.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.UHS.CRUSHING_WHEEL_IMPACT)) .onRegister(c -> c.setTier(TIER.ULTIMATE_HIGH)) .register(); diff --git a/src/main/java/electrolyte/greate/registry/Millstones.java b/src/main/java/electrolyte/greate/registry/Millstones.java index 7341302e..30972623 100644 --- a/src/main/java/electrolyte/greate/registry/Millstones.java +++ b/src/main/java/electrolyte/greate/registry/Millstones.java @@ -28,6 +28,7 @@ public class Millstones { .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) .transform(GreateBuilderTransformers.tieredMillstone()) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.ULS.MILLSTONE_IMPACT)) .onRegister(c -> c.setTier(TIER.ULTRA_LOW)) .register(); @@ -36,7 +37,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.LS.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.LOW)) .register(); @@ -46,7 +47,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.MS.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.MEDIUM)) .register(); @@ -56,7 +57,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.HS.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.HIGH)) .register(); @@ -66,7 +67,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.ES.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.EXTREME)) .register(); @@ -77,7 +78,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.IS.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.INSANE)) .register(); @@ -87,7 +88,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.LUS.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.LUDICRIOUS)) .register(); @@ -97,7 +98,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.ZPM.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.ZPM)) .register(); @@ -107,7 +108,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.US.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.ULTIMATE)) .register(); @@ -117,7 +118,7 @@ public class Millstones { .initialProperties(SharedProperties::stone) .properties(p -> p.color(MaterialColor.METAL)) .transform(TagGen.pickaxeOnly()) - .transform(BlockStressDefaults.setImpact(4.0)) + .transform(BlockStressDefaults.setImpact(Greate.CONFIG.UHS.MILLSTONE_IMPACT)) .transform(GreateBuilderTransformers.tieredMillstone()) .onRegister(c -> c.setTier(TIER.ULTIMATE_HIGH)) .register(); diff --git a/src/main/resources/greate.mixin.json b/src/main/resources/greate.mixin.json index 5f20d60a..de6ddaff 100644 --- a/src/main/resources/greate.mixin.json +++ b/src/main/resources/greate.mixin.json @@ -2,7 +2,7 @@ "required": true, "package": "electrolyte.greate.mixin", "minVersion": "0.8", - "compatabilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_16", "mixins": [ "MixinBlockStressDefaults", "MixinGirderBlock",