Skip to content

Commit b296d2c

Browse files
committed
Simplify the SpawnEntry logic by removing code only used in the OreSpawn v2 json writer and also remove that format writer, as it is not needed
1 parent 0b2f619 commit b296d2c

File tree

3 files changed

+0
-183
lines changed

3 files changed

+0
-183
lines changed

src/main/java/com/mcmoddev/orespawn/api/SpawnEntry.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
public interface SpawnEntry {
1111
IBlockState getState();
1212

13-
int getSize();
14-
15-
int getVariation();
16-
17-
float getFrequency();
18-
19-
int getMinHeight();
20-
21-
int getMaxHeight();
22-
2313
List<Biome> getBiomes();
2414

2515
IFeature getFeatureGen();

src/main/java/com/mcmoddev/orespawn/impl/SpawnEntryImpl.java

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.google.gson.JsonObject;
88
import com.mcmoddev.orespawn.api.IFeature;
99
import com.mcmoddev.orespawn.api.SpawnEntry;
10-
import com.mcmoddev.orespawn.impl.features.DefaultFeatureGenerator;
1110

1211
import net.minecraft.block.state.IBlockState;
1312
import net.minecraft.world.biome.Biome;
@@ -18,55 +17,6 @@ public class SpawnEntryImpl implements SpawnEntry {
1817
private final List<Biome> biomes;
1918
private final IFeature generator;
2019
private final IBlockState blockRep;
21-
private final static String sz = "size";
22-
private final static String var = "variation";
23-
private final static String freq = "frequency";
24-
private final static String mny = "minHeight";
25-
private final static String mxy = "maxHeight";
26-
27-
public SpawnEntryImpl(IBlockState state, int size, int variation, float frequency, int minHeight, int maxHeight, Biome[] biomes) {
28-
this.paramStore = new JsonObject();
29-
this.paramStore.addProperty(sz, size);
30-
this.paramStore.addProperty(var, variation);
31-
this.paramStore.addProperty(freq, frequency);
32-
this.paramStore.addProperty(mny, minHeight);
33-
this.paramStore.addProperty(mxy, maxHeight);
34-
this.state = state;
35-
this.blockRep = null;
36-
37-
if( biomes == null || biomes.length == 0 ) {
38-
this.biomes = Collections.<Biome>emptyList();;
39-
} else {
40-
this.biomes = new ArrayList<>();
41-
for( Biome b : biomes ) {
42-
this.biomes.add(b);
43-
}
44-
}
45-
this.generator = new DefaultFeatureGenerator();
46-
// OreSpawn.LOGGER.fatal("OreSpawnAPI: registering block "+state.getBlock()+" for generation");
47-
}
48-
49-
public SpawnEntryImpl(IBlockState state, int size, int variation, float frequency, int minHeight, int maxHeight,
50-
Biome[] biomes, IFeature featureGen, IBlockState blockRep) {
51-
this.paramStore = new JsonObject();
52-
this.paramStore.addProperty(sz, size);
53-
this.paramStore.addProperty(var, variation);
54-
this.paramStore.addProperty(freq, frequency);
55-
this.paramStore.addProperty(mny, minHeight);
56-
this.paramStore.addProperty(mxy, maxHeight);
57-
this.generator = featureGen;
58-
this.blockRep = blockRep;
59-
this.state = state;
60-
61-
if( biomes == null || biomes.length == 0 ) {
62-
this.biomes = Collections.<Biome>emptyList();
63-
} else {
64-
this.biomes = new ArrayList<>();
65-
for( Biome b : biomes ) {
66-
this.biomes.add(b);
67-
}
68-
}
69-
}
7020

7121
public SpawnEntryImpl(IBlockState state, JsonObject parameters, Biome[] biomes, IFeature featureGen,
7222
IBlockState blockRep) {
@@ -90,31 +40,6 @@ public IBlockState getState() {
9040
return this.state;
9141
}
9242

93-
@Override
94-
public int getSize() {
95-
return this.paramStore.get(sz).getAsInt();
96-
}
97-
98-
@Override
99-
public int getVariation() {
100-
return this.paramStore.get(var).getAsInt();
101-
}
102-
103-
@Override
104-
public float getFrequency() {
105-
return this.paramStore.get(freq).getAsFloat();
106-
}
107-
108-
@Override
109-
public int getMinHeight() {
110-
return this.paramStore.get(mny).getAsInt();
111-
}
112-
113-
@Override
114-
public int getMaxHeight() {
115-
return this.paramStore.get(mxy).getAsInt();
116-
}
117-
11843
@Override
11944
public List<Biome> getBiomes() {
12045
return Collections.unmodifiableList(this.biomes);

src/main/java/com/mcmoddev/orespawn/json/OS2Writer.java

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)