Removed the cactus mixin
This commit is contained in:
parent
b6ec851878
commit
fb55340562
4 changed files with 2 additions and 98 deletions
|
@ -24,7 +24,6 @@ import biomesoplenty.api.biome.BiomeOwner;
|
||||||
import biomesoplenty.api.biome.IExtendedBiome;
|
import biomesoplenty.api.biome.IExtendedBiome;
|
||||||
import biomesoplenty.common.biome.ExtendedBiomeRegistry;
|
import biomesoplenty.common.biome.ExtendedBiomeRegistry;
|
||||||
import biomesoplenty.common.biome.ExtendedBiomeRegistry.GenerationManager;
|
import biomesoplenty.common.biome.ExtendedBiomeRegistry.GenerationManager;
|
||||||
import biomesoplenty.common.decoration.extensions.IExtendedCactusGen;
|
|
||||||
import biomesoplenty.common.util.config.JsonBiome;
|
import biomesoplenty.common.util.config.JsonBiome;
|
||||||
import biomesoplenty.common.util.config.JsonEntitySpawn;
|
import biomesoplenty.common.util.config.JsonEntitySpawn;
|
||||||
|
|
||||||
|
@ -85,7 +84,7 @@ public class BiomeConfigurationHandler
|
||||||
|
|
||||||
if (extendedBiome.getBiomeOwner() == BiomeOwner.OTHER)
|
if (extendedBiome.getBiomeOwner() == BiomeOwner.OTHER)
|
||||||
{
|
{
|
||||||
if (biome.theBiomeDecorator.cactiPerChunk > 0)
|
/*if (biome.theBiomeDecorator.cactiPerChunk > 0)
|
||||||
{
|
{
|
||||||
WorldGenCactus cactusGen = new WorldGenCactus();
|
WorldGenCactus cactusGen = new WorldGenCactus();
|
||||||
IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen) cactusGen;
|
IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen) cactusGen;
|
||||||
|
@ -93,7 +92,7 @@ public class BiomeConfigurationHandler
|
||||||
extendedCactusGen.setCactiPerChunk(biome.theBiomeDecorator.cactiPerChunk);
|
extendedCactusGen.setCactiPerChunk(biome.theBiomeDecorator.cactiPerChunk);
|
||||||
generationManager.addGenerator("cactus", extendedCactusGen, Decorate.EventType.CACTUS);
|
generationManager.addGenerator("cactus", extendedCactusGen, Decorate.EventType.CACTUS);
|
||||||
biome.theBiomeDecorator.cactiPerChunk = 0;
|
biome.theBiomeDecorator.cactiPerChunk = 0;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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<WorldGenCactus>
|
|
||||||
{
|
|
||||||
public void setCactiPerChunk(int amount);
|
|
||||||
|
|
||||||
public int getCactiPerChunk();
|
|
||||||
}
|
|
|
@ -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<WorldGenCactus> src)
|
|
||||||
{
|
|
||||||
JsonObject jsonCactusGen = new JsonObject();
|
|
||||||
|
|
||||||
jsonCactusGen.addProperty("cacti_per_chunk", ((IExtendedCactusGen) src).getCactiPerChunk());
|
|
||||||
|
|
||||||
return jsonCactusGen;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IGenerator<WorldGenCactus> 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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"package": "biomesoplenty.common.mixin",
|
"package": "biomesoplenty.common.mixin",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"decoration.MixinWorldGenCactus"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue