Skip to content

Commit 1e5b92a

Browse files
committed
some linter cleanups
1 parent 92e8373 commit 1e5b92a

File tree

5 files changed

+19
-48
lines changed

5 files changed

+19
-48
lines changed

src/main/java/com/mcmoddev/orespawn/EventHandlers.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ private boolean compFeatures(NBTTagList tagList, int dim) {
140140
.collect(Collectors.toList()));
141141
}
142142

143-
// List<SpawnBuilder> spc = new LinkedList<>();
144-
// spawns.stream().map( DimensionBuilder::getAllSpawns ).forEach( spc::addAll );
145-
146143
List<FeatureBuilder> featureList = new LinkedList<>();
147144

148145
spawns.forEach( sp -> featureList.addAll(sp.getAllSpawns().stream().map( SpawnBuilder::getFeatureGen ).collect(Collectors.toList())));

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ public FeatureBase( Random rand ) {
3434
this.random = rand;
3535
}
3636

37-
private String getBiomeName( Biome biome ) {
38-
return ForgeRegistries.BIOMES.getKey( biome ).toString();
39-
}
40-
4137
private boolean fullMatch( ImmutableSet<BiomeLocation> locs, Biome biome ) {
4238
for( BiomeLocation b : locs ) {
4339
for( Biome bm : b.getBiomes () ) {
@@ -85,8 +81,6 @@ protected boolean spawn( IBlockState oreBlock, World world, BlockPos coord, int
8581
return false;
8682
}
8783

88-
List<IBlockState> blockToReplace = blockReplace;
89-
9084
Biome thisBiome = world.getBiome ( coord );
9185
if( biomeMatch ( thisBiome, biomes ) ) return false;
9286

@@ -132,8 +126,6 @@ protected boolean spawnNoCheck( IBlockState oreBlock, World world, BlockPos coor
132126
return false;
133127
}
134128

135-
List<IBlockState> blockToReplace = blockReplace;
136-
137129
BlockPos np = mungeFixYcoord(coord);
138130

139131
if( coord.getY() >= world.getHeight()) {
@@ -217,5 +209,21 @@ protected static void mergeDefaults(JsonObject parameters, JsonObject defaultPar
217209
if( !parameters.has(entry.getKey()) )
218210
parameters.add(entry.getKey(), entry.getValue());
219211
});
220-
}
212+
}
213+
214+
protected double triangularDistribution(double a, double b, double c) {
215+
double base = (c - a) / (b - a);
216+
double rand = this.random.nextDouble();
217+
if (rand < base) {
218+
return a + Math.sqrt(rand * (b - a) * (c - a));
219+
} else {
220+
return b - Math.sqrt((1 - rand) * (b - a) * (b - c));
221+
}
222+
}
223+
224+
protected int getPoint( int lowerBound, int upperBound, int median ) {
225+
int t = (int)Math.round( triangularDistribution((float)lowerBound, (float)upperBound, (float)median) );
226+
return t - median;
227+
}
228+
221229
}

src/main/java/com/mcmoddev/orespawn/impl/features/ClusterGenerator.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,6 @@ public void generate( ChunkPos pos, World world, IChunkGenerator chunkGenerator,
7070
}
7171
}
7272

73-
private double triangularDistribution(double a, double b, double c) {
74-
double base = (c - a) / (b - a);
75-
double rand = this.random.nextDouble();
76-
if (rand < base) {
77-
return a + Math.sqrt(rand * (b - a) * (c - a));
78-
} else {
79-
return b - Math.sqrt((1 - rand) * (b - a) * (b - c));
80-
}
81-
}
82-
83-
private int getPoint( int lowerBound, int upperBound, int median ) {
84-
int t = (int)Math.round( triangularDistribution((float)lowerBound, (float)upperBound, (float)median) );
85-
return t - median;
86-
}
87-
8873
private enum parms {
8974
SIZE, VARIANCE, CCOUNT, MAXSPREAD, MINHEIGHT, MAXHEIGHT
9075
}

src/main/java/com/mcmoddev/orespawn/impl/features/NormalCloudGenerator.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,6 @@ public void generate(ChunkPos pos, World world, IChunkGenerator chunkGenerator,
101101
}
102102
}
103103

104-
private double triangularDistribution(double a, double b, double c) {
105-
double base = (c - a) / (b - a);
106-
double rand = this.random.nextDouble();
107-
if (rand < base) {
108-
return a + Math.sqrt(rand * (b - a) * (c - a));
109-
} else {
110-
return b - Math.sqrt((1 - rand) * (b - a) * (b - c));
111-
}
112-
}
113-
114-
private int getPoint( int lowerBound, int upperBound, int median ) {
115-
int t = (int)Math.round( triangularDistribution((float)lowerBound, (float)upperBound, (float)median) );
116-
return t - median;
117-
}
118-
119104
private enum parms {
120105
SIZE, MAXSPREAD, MINHEIGHT, MAXHEIGHT
121106
}

src/main/java/com/mcmoddev/orespawn/worldgen/OreSpawnWorldGen.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package com.mcmoddev.orespawn.worldgen;
22

3-
import java.util.List;
4-
import java.util.ArrayList;
5-
import java.util.Collections;
6-
import java.util.Map;
7-
import java.util.Random;
3+
import java.util.*;
84
import java.util.stream.Collectors;
95

106
import com.google.common.collect.ImmutableList;
@@ -79,7 +75,7 @@ public void generate(Random random, int chunkX, int chunkZ, World world, IChunkG
7975
currentFeatureGen.setRandom(random);
8076
currentFeatureGen.generate(new ChunkPos(chunkX, chunkZ), world, chunkGenerator, chunkProvider, sE.getFeatureGen().getParameters(), sE.getOreSpawns(), replacement, sE.getBiomes());
8177
});
82-
}
78+
}
8379
}
8480

8581

0 commit comments

Comments
 (0)