Skip to content

Commit

Permalink
Added variable passive cooling amounts depending on what biome the pl…
Browse files Browse the repository at this point in the history
…ayer is currently in.

The initials values are not balanced, they are simply placeholders.
  • Loading branch information
Andrew2448 committed May 2, 2013
1 parent a7a001f commit 30f0193
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions src/minecraft/net/machinemuse/utils/MusePlayerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
import net.minecraft.world.World;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;

public class MusePlayerUtils {
static final double root2 = Math.sqrt(2);
private static HashMap<String, Double> biomeMap = new HashMap();

public static MovingObjectPosition raytraceEntities(World world, EntityPlayer player, boolean collisionFlag, double reachDistance) {

Expand Down Expand Up @@ -320,13 +322,19 @@ public static EntityPlayer toPlayer(Object data) {
}

public static double getPlayerCoolingBasedOnMaterial(EntityPlayer player) {
double cool = 0;
if (player.isInWater()) {
return 0.5;
cool += 0.5;
} else if (player.isInsideOfMaterial(Material.lava)) {
return 0;
} else {
return 0.1;
}
if (biomeMap.containsKey(player.worldObj.getWorldChunkManager().getBiomeGenAt((int)player.posX, (int)player.posZ).biomeName)) {
cool += biomeMap.get(player.worldObj.getWorldChunkManager().getBiomeGenAt((int)player.posX, (int)player.posZ).biomeName);
}
else {
cool += 0.1;
}
return cool;
}

public static void setFOVMult(EntityPlayer player, float fovmult) {
Expand Down Expand Up @@ -362,4 +370,31 @@ public static Field getMovementFactorField() {
}
return movementfactorfieldinstance;
}

static {
biomeMap.put("ocean", 0.5);
biomeMap.put("plains", 0.1);
biomeMap.put("desert", 0.0);
biomeMap.put("extremeHills", 0.1);
biomeMap.put("forest", 0.1);
biomeMap.put("taiga", 0.1);
biomeMap.put("swampland", 0.5);
biomeMap.put("river", 0.1);
biomeMap.put("hell", 0.0);
biomeMap.put("sky", 0.1);
biomeMap.put("frozenOcean", 1.0);
biomeMap.put("frozenRiver", 1.0);
biomeMap.put("icePlains", 1.0);
biomeMap.put("iceMountains", 1.0);
biomeMap.put("mushroomIsland", 0.1);
biomeMap.put("mushroomIslandShore", 0.1);
biomeMap.put("beach", 0.1);
biomeMap.put("desertHills", 0.0);
biomeMap.put("forestHills", 0.1);
biomeMap.put("taigaHills", 1.0);
biomeMap.put("extremeHillsEdge", 0.1);
biomeMap.put("jungle", 0.1);
biomeMap.put("jungleHills", 0.1);

}
}

0 comments on commit 30f0193

Please sign in to comment.