From fb553405621d12ead08376840d86c60338a8c713 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 8 Mar 2015 14:49:47 +1100 Subject: [PATCH] Removed the cactus mixin --- .../config/BiomeConfigurationHandler.java | 5 +- .../extensions/IExtendedCactusGen.java | 19 ----- .../mixin/decoration/MixinWorldGenCactus.java | 75 ------------------- src/main/resources/mixins.biomesoplenty.json | 1 - 4 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 src/main/java/biomesoplenty/common/decoration/extensions/IExtendedCactusGen.java delete mode 100644 src/main/java/biomesoplenty/common/mixin/decoration/MixinWorldGenCactus.java diff --git a/src/main/java/biomesoplenty/common/config/BiomeConfigurationHandler.java b/src/main/java/biomesoplenty/common/config/BiomeConfigurationHandler.java index 7bf9ecff4..3a6648c86 100644 --- a/src/main/java/biomesoplenty/common/config/BiomeConfigurationHandler.java +++ b/src/main/java/biomesoplenty/common/config/BiomeConfigurationHandler.java @@ -24,7 +24,6 @@ import biomesoplenty.api.biome.BiomeOwner; import biomesoplenty.api.biome.IExtendedBiome; import biomesoplenty.common.biome.ExtendedBiomeRegistry; import biomesoplenty.common.biome.ExtendedBiomeRegistry.GenerationManager; -import biomesoplenty.common.decoration.extensions.IExtendedCactusGen; import biomesoplenty.common.util.config.JsonBiome; import biomesoplenty.common.util.config.JsonEntitySpawn; @@ -85,7 +84,7 @@ public class BiomeConfigurationHandler if (extendedBiome.getBiomeOwner() == BiomeOwner.OTHER) { - if (biome.theBiomeDecorator.cactiPerChunk > 0) + /*if (biome.theBiomeDecorator.cactiPerChunk > 0) { WorldGenCactus cactusGen = new WorldGenCactus(); IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen) cactusGen; @@ -93,7 +92,7 @@ public class BiomeConfigurationHandler extendedCactusGen.setCactiPerChunk(biome.theBiomeDecorator.cactiPerChunk); generationManager.addGenerator("cactus", extendedCactusGen, Decorate.EventType.CACTUS); biome.theBiomeDecorator.cactiPerChunk = 0; - } + }*/ } } diff --git a/src/main/java/biomesoplenty/common/decoration/extensions/IExtendedCactusGen.java b/src/main/java/biomesoplenty/common/decoration/extensions/IExtendedCactusGen.java deleted file mode 100644 index baf674ba6..000000000 --- a/src/main/java/biomesoplenty/common/decoration/extensions/IExtendedCactusGen.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright 2014-2015, the Biomes O' Plenty Team - * - * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. - * - * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. - ******************************************************************************/ - -package biomesoplenty.common.decoration.extensions; - -import net.minecraft.world.gen.feature.WorldGenCactus; -import biomesoplenty.api.biome.IGenerator; - -public interface IExtendedCactusGen extends IGenerator -{ - public void setCactiPerChunk(int amount); - - public int getCactiPerChunk(); -} diff --git a/src/main/java/biomesoplenty/common/mixin/decoration/MixinWorldGenCactus.java b/src/main/java/biomesoplenty/common/mixin/decoration/MixinWorldGenCactus.java deleted file mode 100644 index cb3ba81da..000000000 --- a/src/main/java/biomesoplenty/common/mixin/decoration/MixinWorldGenCactus.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright 2014-2015, the Biomes O' Plenty Team - * - * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. - * - * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. - ******************************************************************************/ - -package biomesoplenty.common.mixin.decoration; - -import java.util.Random; - -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenCactus; -import net.minecraft.world.gen.feature.WorldGenerator; - -import org.spongepowered.asm.mixin.Implements; -import org.spongepowered.asm.mixin.Interface; -import org.spongepowered.asm.mixin.Mixin; - -import biomesoplenty.api.biome.IGenerator; -import biomesoplenty.common.decoration.extensions.IExtendedCactusGen; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -@Mixin(WorldGenCactus.class) -@Implements(@Interface(iface = IExtendedCactusGen.class, prefix = "extendedCactus$")) -public abstract class MixinWorldGenCactus extends WorldGenerator //implements IExtendedCactusGen -{ - private int cactiPerChunk; - - public void extendedCactus$generate(World world, Random random, BlockPos pos) - { - for (int i = 0; i < cactiPerChunk; i++) - { - int x = random.nextInt(16) + 8; - int z = random.nextInt(16) + 8; - int y = random.nextInt(world.getHeight(pos.add(x, 0, z)).getY() * 2); - - this.generate(world, random, pos.add(x, y, z)); - } - } - - public void extendedCactus$setCactiPerChunk(int amount) - { - this.cactiPerChunk = amount; - } - - public int extendedCactus$getCactiPerChunk() - { - return this.cactiPerChunk; - } - - public JsonElement extendedCactus$serialize(IGenerator src) - { - JsonObject jsonCactusGen = new JsonObject(); - - jsonCactusGen.addProperty("cacti_per_chunk", ((IExtendedCactusGen) src).getCactiPerChunk()); - - return jsonCactusGen; - } - - public IGenerator extendedCactus$deserialize(JsonElement json) - { - JsonObject jsonCactusGen = json.getAsJsonObject(); - WorldGenCactus cactusGen = new WorldGenCactus(); - IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen) cactusGen; - - extendedCactusGen.setCactiPerChunk(jsonCactusGen.get("cacti_per_chunk").getAsInt()); - - return extendedCactusGen; - } -} diff --git a/src/main/resources/mixins.biomesoplenty.json b/src/main/resources/mixins.biomesoplenty.json index ab4a89836..ace3d4269 100644 --- a/src/main/resources/mixins.biomesoplenty.json +++ b/src/main/resources/mixins.biomesoplenty.json @@ -1,6 +1,5 @@ { "package": "biomesoplenty.common.mixin", "mixins": [ - "decoration.MixinWorldGenCactus" ] }