Removed the current properties system whilst it's being redone

This commit is contained in:
Adubbz 2015-01-20 19:06:10 +11:00
parent c3357f46d0
commit ae72d29ec3
5 changed files with 0 additions and 87 deletions

View file

@ -1,34 +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.api.biome;
public enum BiomeProperty
{
GRASS_PER_CHUNK(1),
FLOWERS_PER_CHUNK(2);
private Object defaultValue;
private BiomeProperty() {}
private BiomeProperty(Object defaultValue)
{
this.defaultValue = defaultValue;
}
public String getName()
{
return this.name().toLowerCase();
}
public Object getDefaultValue()
{
return this.defaultValue;
}
}

View file

@ -13,7 +13,4 @@ import java.util.Map;
public interface IExtendedBiome public interface IExtendedBiome
{ {
public BiomeOwner getBiomeOwner(); public BiomeOwner getBiomeOwner();
public void setProperty(BiomeProperty property, Object value);
public Object getProperty(BiomeProperty property);
public Map<BiomeProperty, Object> getPropertyMap();
} }

View file

@ -18,7 +18,6 @@ import net.minecraft.world.biome.BiomeGenBase;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import biomesoplenty.api.biome.BiomeOwner; import biomesoplenty.api.biome.BiomeOwner;
import biomesoplenty.api.biome.BiomeProperty;
import biomesoplenty.api.biome.IExtendedBiome; import biomesoplenty.api.biome.IExtendedBiome;
import biomesoplenty.common.util.config.JsonBiome; import biomesoplenty.common.util.config.JsonBiome;
import biomesoplenty.common.util.config.JsonEntitySpawn; import biomesoplenty.common.util.config.JsonEntitySpawn;
@ -130,11 +129,6 @@ public class BiomeConfigurationHandler
if (extendedBiome.getBiomeOwner() == BiomeOwner.OTHER) if (extendedBiome.getBiomeOwner() == BiomeOwner.OTHER)
{ {
extendedBiome.setProperty(BiomeProperty.GRASS_PER_CHUNK, biome.theBiomeDecorator.grassPerChunk);
//TODO: Create our own implementations
//biome.theBiomeDecorator.grassPerChunk = 0;
extendedBiome.setProperty(BiomeProperty.FLOWERS_PER_CHUNK, biome.theBiomeDecorator.flowersPerChunk);
//biome.theBiomeDecorator.flowersPerChunk = 0;
} }
} }
@ -153,19 +147,5 @@ public class BiomeConfigurationHandler
JsonEntitySpawn.addBiomeEntitySpawns(biome, jsonBiome); JsonEntitySpawn.addBiomeEntitySpawns(biome, jsonBiome);
IExtendedBiome extendedBiome = (IExtendedBiome)biome; IExtendedBiome extendedBiome = (IExtendedBiome)biome;
if (!jsonBiome.decorationProperties.isEmpty())
{
for (Entry<BiomeProperty, Object> entry : jsonBiome.decorationProperties.entrySet())
{
BiomeProperty property = entry.getKey();
Object value = entry.getValue();
if (property != null)
{
extendedBiome.setProperty(property, value);
}
}
}
} }
} }

View file

@ -8,9 +8,6 @@
package biomesoplenty.common.mixin.biome; package biomesoplenty.common.mixin.biome;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@ -19,20 +16,17 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import biomesoplenty.api.biome.BiomeOwner; import biomesoplenty.api.biome.BiomeOwner;
import biomesoplenty.api.biome.BiomeProperty;
import biomesoplenty.api.biome.IExtendedBiome; import biomesoplenty.api.biome.IExtendedBiome;
@Mixin(BiomeGenBase.class) @Mixin(BiomeGenBase.class)
public abstract class MixinBiomeGenBase implements IExtendedBiome public abstract class MixinBiomeGenBase implements IExtendedBiome
{ {
private BiomeOwner biomeOwner; private BiomeOwner biomeOwner;
private HashMap<BiomeProperty, Object> properties;
@Inject(method = "<init>(IZ)V", at = @At("RETURN")) @Inject(method = "<init>(IZ)V", at = @At("RETURN"))
private void onConstructed(int biomeId, boolean register, CallbackInfo callbackInfo) private void onConstructed(int biomeId, boolean register, CallbackInfo callbackInfo)
{ {
this.biomeOwner = BiomeOwner.OTHER; this.biomeOwner = BiomeOwner.OTHER;
this.properties = new HashMap();
} }
@Override @Override
@ -40,23 +34,4 @@ public abstract class MixinBiomeGenBase implements IExtendedBiome
{ {
return biomeOwner; return biomeOwner;
} }
@Override
public void setProperty(BiomeProperty property, Object value)
{
if (property.getDefaultValue() != value)
this.properties.put(property, value);
}
@Override
public Object getProperty(BiomeProperty property)
{
return this.properties.get(property);
}
@Override
public Map<BiomeProperty, Object> getPropertyMap()
{
return properties;
}
} }

View file

@ -9,12 +9,9 @@
package biomesoplenty.common.util.config; package biomesoplenty.common.util.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.api.biome.BiomeProperty;
import biomesoplenty.api.biome.IExtendedBiome;
import com.google.gson.FieldNamingPolicy; import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -37,7 +34,6 @@ public class JsonBiome
public int color; public int color;
public int waterColorMultiplier; public int waterColorMultiplier;
public ArrayList<JsonEntitySpawn> entities; public ArrayList<JsonEntitySpawn> entities;
public Map<BiomeProperty, Object> decorationProperties;
public static JsonBiome createFromBiomeGenBase(BiomeGenBase baseBiome) public static JsonBiome createFromBiomeGenBase(BiomeGenBase baseBiome)
{ {
@ -54,7 +50,6 @@ public class JsonBiome
biome.color = baseBiome.color; biome.color = baseBiome.color;
biome.waterColorMultiplier = baseBiome.waterColorMultiplier; biome.waterColorMultiplier = baseBiome.waterColorMultiplier;
biome.entities = JsonEntitySpawn.getBiomeEntitySpawns(baseBiome); biome.entities = JsonEntitySpawn.getBiomeEntitySpawns(baseBiome);
biome.decorationProperties = ((IExtendedBiome)baseBiome).getPropertyMap();
return biome; return biome;
} }