Skip to content

Commit 523627d

Browse files
authored
No longer hardcode biomes for primitive water pump (GregTechCEu#81)
- Now utilizes Forge's BiomeDictionary types - Ocean/River => `Type.WATER` (1000) - Swamp => `Type.SWAMP` and `Type.WET` (800) - Jungle => `Type.JUNGLE` (350) - Snow => `Type.SNOWY` (300) - Plains/Forest => `Type.PLAINS` and `Type.FOREST` (250) - Taiga => `Type.COLD` (175) - Beach => `Type.BEACH` (170)
1 parent 85b3e98 commit 523627d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityPrimitiveWaterPump.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
import net.minecraft.entity.player.EntityPlayer;
2525
import net.minecraft.util.ResourceLocation;
2626
import net.minecraft.world.biome.*;
27+
import net.minecraftforge.common.BiomeDictionary;
2728
import net.minecraftforge.fluids.FluidTank;
2829
import net.minecraftforge.fluids.IFluidTank;
2930

3031
import javax.annotation.Nonnull;
3132
import java.util.List;
33+
import java.util.Set;
3234
import java.util.function.Predicate;
3335

3436
public class MetaTileEntityPrimitiveWaterPump extends MultiblockControllerBase {
@@ -59,24 +61,23 @@ public void update() {
5961
}
6062

6163
private static int getAmountForBiome(Biome biome) {
62-
Class<? extends Biome> biomeClass = biome.getBiomeClass();
63-
if (biomeClass == BiomeOcean.class || biomeClass == BiomeRiver.class) {
64+
Set<BiomeDictionary.Type> biomeTypes = BiomeDictionary.getTypes(biome);
65+
if (biomeTypes.contains(BiomeDictionary.Type.WATER)) {
6466
return 1000;
65-
} else if (biomeClass == BiomeSwamp.class) {
67+
} else if (biomeTypes.contains(BiomeDictionary.Type.SWAMP) || biomeTypes.contains(BiomeDictionary.Type.WET)) {
6668
return 800;
67-
} else if (biomeClass == BiomeJungle.class) {
69+
} else if (biomeTypes.contains(BiomeDictionary.Type.JUNGLE)) {
6870
return 350;
69-
} else if (biomeClass == BiomeSnow.class) {
71+
} else if (biomeTypes.contains(BiomeDictionary.Type.SNOWY)) {
7072
return 300;
71-
} else if (biomeClass == BiomePlains.class || biomeClass == BiomeForest.class) {
73+
} else if (biomeTypes.contains(BiomeDictionary.Type.PLAINS) || biomeTypes.contains(BiomeDictionary.Type.FOREST)) {
7274
return 250;
73-
} else if (biomeClass == BiomeTaiga.class) {
75+
} else if (biomeTypes.contains(BiomeDictionary.Type.COLD)) {
7476
return 175;
75-
} else if (biomeClass == BiomeBeach.class) {
77+
} else if (biomeTypes.contains(BiomeDictionary.Type.BEACH)) {
7678
return 170;
77-
} else {
78-
return 100;
7979
}
80+
return 100;
8081
}
8182

8283
@Override

0 commit comments

Comments
 (0)