From 38caffb85d7858178f1af07191d48b8247a8b8a7 Mon Sep 17 00:00:00 2001 From: FalsePattern Date: Tue, 6 Aug 2024 23:46:32 +0200 Subject: [PATCH] Climate Control compat (#185 , #189) --- README.MD | 1 + build.gradle.kts | 3 ++ .../api/BiomeSettingsMixin.java | 42 ++++++++++++++++ .../api/ClimateControlRulesMixin.java | 42 ++++++++++++++++ .../customGenLayer/ConfirmBiomeMixin.java | 41 ++++++++++++++++ .../GenLayerBiomeByClimateMixin.java | 47 ++++++++++++++++++ .../GenLayerBiomeByTaggedClimateMixin.java | 41 ++++++++++++++++ .../GenLayerDefineClimateMixin.java | 41 ++++++++++++++++ .../GenLayerLowlandRiverMixMixin.java | 41 ++++++++++++++++ .../GenLayerSmoothCoastMixin.java | 41 ++++++++++++++++ .../customGenLayer/GenLayerSubBiomeMixin.java | 47 ++++++++++++++++++ .../genLayerPack/GenLayerHillsMixin.java | 48 +++++++++++++++++++ .../genLayerPack/GenLayerPackMixin.java | 42 ++++++++++++++++ .../genLayerPack/GenLayerSmoothMixin.java | 41 ++++++++++++++++ .../GenLayerVoronoiZoomMixin.java | 41 ++++++++++++++++ .../genLayerPack/GenLayerZoomMixin.java | 41 ++++++++++++++++ .../AbstractWorldGeneratorMixin.java | 42 ++++++++++++++++ .../generator/BiomeSwapperMixin.java | 42 ++++++++++++++++ .../generator/SubBiomeChooserMixin.java | 42 ++++++++++++++++ .../endlessids/mixin/plugin/Mixin.java | 19 ++++++++ .../endlessids/mixin/plugin/TargetedMod.java | 1 + 21 files changed, 746 insertions(+) create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/BiomeSettingsMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/ClimateControlRulesMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/ConfirmBiomeMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByClimateMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByTaggedClimateMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerDefineClimateMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerLowlandRiverMixMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSmoothCoastMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSubBiomeMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerHillsMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerPackMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerSmoothMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerVoronoiZoomMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerZoomMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/AbstractWorldGeneratorMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/BiomeSwapperMixin.java create mode 100644 src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/SubBiomeChooserMixin.java diff --git a/README.MD b/README.MD index cfc535c..e2e8844 100644 --- a/README.MD +++ b/README.MD @@ -46,6 +46,7 @@ This mod also contains patches for the following mods: - Biome Wand - BuildCraft - ChromatiCraft +- Climate Control - Compact Machines - CoFH Lib - Dark World diff --git a/build.gradle.kts b/build.gradle.kts index 81b0c2c..b9b1adc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -103,6 +103,9 @@ dependencies { //Buildcraft 7.1.24 compileOnly(deobfCurse("buildcraft-61811:3538651")) + //Climate Control 0.8.2 + compileOnly(deobfCurse("climatecontrol-76544:2359685")) + //CoFH Lib 1.2.1-185 compileOnly(deobfCurse("cofh-lib-220333:2388748")) diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/BiomeSettingsMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/BiomeSettingsMixin.java new file mode 100644 index 0000000..71ccfcd --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/BiomeSettingsMixin.java @@ -0,0 +1,42 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.api; + +import climateControl.api.BiomeSettings; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(BiomeSettings.class) +public abstract class BiomeSettingsMixin { + @ModifyConstant(method = "nameDefaultClimates", + remap = false, + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/ClimateControlRulesMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/ClimateControlRulesMixin.java new file mode 100644 index 0000000..dc3d3fd --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/api/ClimateControlRulesMixin.java @@ -0,0 +1,42 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.api; + +import climateControl.api.ClimateControlRules; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(ClimateControlRules.class) +public abstract class ClimateControlRulesMixin { + @ModifyConstant(method = "", + remap = false, + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 4) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDCount; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/ConfirmBiomeMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/ConfirmBiomeMixin.java new file mode 100644 index 0000000..ee0be69 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/ConfirmBiomeMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.ConfirmBiome; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(ConfirmBiome.class) +public abstract class ConfirmBiomeMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByClimateMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByClimateMixin.java new file mode 100644 index 0000000..5044965 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByClimateMixin.java @@ -0,0 +1,47 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.GenLayerBiomeByClimate; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerBiomeByClimate.class) +public abstract class GenLayerBiomeByClimateMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 1) + private int extendBiomes1(int constant) { + return ExtendedConstants.biomeIDCount; + } + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 1) + private int extendBiomes2(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByTaggedClimateMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByTaggedClimateMixin.java new file mode 100644 index 0000000..fe70819 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerBiomeByTaggedClimateMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.GenLayerBiomeByTaggedClimate; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerBiomeByTaggedClimate.class) +public abstract class GenLayerBiomeByTaggedClimateMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerDefineClimateMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerDefineClimateMixin.java new file mode 100644 index 0000000..d1810a0 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerDefineClimateMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.GenLayerDefineClimate; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerDefineClimate.class) +public abstract class GenLayerDefineClimateMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerLowlandRiverMixMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerLowlandRiverMixMixin.java new file mode 100644 index 0000000..e8270c1 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerLowlandRiverMixMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.GenLayerLowlandRiverMix; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerLowlandRiverMix.class) +public abstract class GenLayerLowlandRiverMixMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 3) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSmoothCoastMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSmoothCoastMixin.java new file mode 100644 index 0000000..deb690c --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSmoothCoastMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.GenLayerSmoothCoast; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerSmoothCoast.class) +public abstract class GenLayerSmoothCoastMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDCount; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSubBiomeMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSubBiomeMixin.java new file mode 100644 index 0000000..c828084 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/customGenLayer/GenLayerSubBiomeMixin.java @@ -0,0 +1,47 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.customGenLayer; + +import climateControl.customGenLayer.GenLayerSubBiome; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerSubBiome.class) +public abstract class GenLayerSubBiomeMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 1) + private int extendBiomes1(int constant) { + return ExtendedConstants.biomeIDCount; + } + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = 128), + require = 1) + private int extendBiomes2(int constant) { + return ExtendedConstants.biomeIDCount - 128; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerHillsMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerHillsMixin.java new file mode 100644 index 0000000..bf0d314 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerHillsMixin.java @@ -0,0 +1,48 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.genLayerPack; + +import climateControl.genLayerPack.GenLayerHills; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerHills.class) +public abstract class GenLayerHillsMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 1) + private int extendBiomes1(int constant) { + return ExtendedConstants.biomeIDMask; + } + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = 128, + ordinal = 0), + require = 1) + private int extendBiomes2(int constant) { + return ExtendedConstants.biomeIDCount - 128; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerPackMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerPackMixin.java new file mode 100644 index 0000000..51a8996 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerPackMixin.java @@ -0,0 +1,42 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.genLayerPack; + +import climateControl.genLayerPack.GenLayerPack; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerPack.class) +public abstract class GenLayerPackMixin { + @ModifyConstant(method = {"isBiomeOceanic", "isOceanic"}, + remap = false, + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 2) + private static int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerSmoothMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerSmoothMixin.java new file mode 100644 index 0000000..99a13ce --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerSmoothMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.genLayerPack; + +import climateControl.genLayerPack.GenLayerSmooth; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerSmooth.class) +public abstract class GenLayerSmoothMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 2) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerVoronoiZoomMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerVoronoiZoomMixin.java new file mode 100644 index 0000000..a30137e --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerVoronoiZoomMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.genLayerPack; + +import climateControl.genLayerPack.GenLayerVoronoiZoom; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerVoronoiZoom.class) +public abstract class GenLayerVoronoiZoomMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDMask), + require = 2) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDMask; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerZoomMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerZoomMixin.java new file mode 100644 index 0000000..b6d779a --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/genLayerPack/GenLayerZoomMixin.java @@ -0,0 +1,41 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.genLayerPack; + +import climateControl.genLayerPack.GenLayerZoom; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(GenLayerZoom.class) +public abstract class GenLayerZoomMixin { + @ModifyConstant(method = "getInts", + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 6) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDCount; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/AbstractWorldGeneratorMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/AbstractWorldGeneratorMixin.java new file mode 100644 index 0000000..3d67c1e --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/AbstractWorldGeneratorMixin.java @@ -0,0 +1,42 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.generator; + +import climateControl.generator.AbstractWorldGenerator; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(AbstractWorldGenerator.class) +public abstract class AbstractWorldGeneratorMixin { + @ModifyConstant(method = "setRules", + remap = false, + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDCount; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/BiomeSwapperMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/BiomeSwapperMixin.java new file mode 100644 index 0000000..a3bddf4 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/BiomeSwapperMixin.java @@ -0,0 +1,42 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.generator; + +import climateControl.generator.BiomeSwapper; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(BiomeSwapper.class) +public abstract class BiomeSwapperMixin { + @ModifyConstant(method = "", + remap = false, + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 2) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDCount; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/SubBiomeChooserMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/SubBiomeChooserMixin.java new file mode 100644 index 0000000..a28e246 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/climatecontrol/generator/SubBiomeChooserMixin.java @@ -0,0 +1,42 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.climatecontrol.generator; + +import climateControl.generator.SubBiomeChooser; +import com.falsepattern.endlessids.constants.ExtendedConstants; +import com.falsepattern.endlessids.constants.VanillaConstants; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(SubBiomeChooser.class) +public abstract class SubBiomeChooserMixin { + @ModifyConstant(method = "", + remap = false, + constant = @Constant(intValue = VanillaConstants.biomeIDCount), + require = 1) + private int extendBiomes(int constant) { + return ExtendedConstants.biomeIDCount; + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java b/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java index ba7d104..1672ce5 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java @@ -85,6 +85,25 @@ public enum Mixin implements IMixin { //region Buildcraft BuildcraftEnergyMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.BUILDCRAFT)), "biome.buildcraft.BuildcraftEnergyMixin"), //endregion Buildcraft + //region ClimateControl + ClimateControl_api_BiomeSettingsMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.api.BiomeSettingsMixin"), + ClimateControl_api_ClimateControlRulesMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.api.ClimateControlRulesMixin"), + ClimateControl_customGenLayer_ConfirmBiomeMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.ConfirmBiomeMixin"), + ClimateControl_customGenLayer_GenLayerBiomeByClimateMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.GenLayerBiomeByClimateMixin"), + ClimateControl_customGenLayer_GenLayerBiomeByTaggedClimateMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.GenLayerBiomeByTaggedClimateMixin"), + ClimateControl_customGenLayer_GenLayerDefineClimateMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.GenLayerDefineClimateMixin"), + ClimateControl_customGenLayer_GenLayerLowlandRiverMixMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.GenLayerLowlandRiverMixMixin"), + ClimateControl_customGenLayer_GenLayerSmoothCoastMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.GenLayerSmoothCoastMixin"), + ClimateControl_customGenLayer_GenLayerSubBiomeMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.customGenLayer.GenLayerSubBiomeMixin"), + ClimateControl_generator_AbstractWorldGeneratorMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.generator.AbstractWorldGeneratorMixin"), + ClimateControl_generator_BiomeSwapperMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.generator.BiomeSwapperMixin"), + ClimateControl_generator_SubBiomeChooserMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.generator.SubBiomeChooserMixin"), + ClimateControl_genLayerPack_GenLayerHillsMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.genLayerPack.GenLayerHillsMixin"), + ClimateControl_genLayerPack_GenLayerPackMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.genLayerPack.GenLayerPackMixin"), + ClimateControl_genLayerPack_GenLayerSmoothMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.genLayerPack.GenLayerSmoothMixin"), + ClimateControl_genLayerPack_GenLayerVoronoiZoomMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.genLayerPack.GenLayerVoronoiZoomMixin"), + ClimateControl_genLayerPack_GenLayerZoomMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.CLIMATECONTROL)), "biome.climatecontrol.genLayerPack.GenLayerZoomMixin"), + //endregion ClimateControl //region CompactMachines CMCubeToolsMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.COMPACTMACHINES)), "biome.compactmachines.CubeToolsMixin"), //endregion CompactMachines diff --git a/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java b/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java index 41ae649..16f6f13 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java @@ -42,6 +42,7 @@ public enum TargetedMod implements ITargetedMod { BIOMETWEAKER("Biome Tweaker", false, contains("biometweaker-")), BIOMEWAND("Biome Wand", false, contains("biome-wand")), BUILDCRAFT("BuildCraft", false, contains("buildcraft-").and(contains("compat").negate())), + CLIMATECONTROL("Climate Control", false, contains("climatecontrol-")), COFHLIB("CoFH Lib", false, contains("cofhlib-")), COMPACTMACHINES("Compact Machines", false, contains("compactmachines-")), DARKWORLD("Dark World", false, contains("darkworld-")),