diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/everglades/world')
5 files changed, 53 insertions, 56 deletions
diff --git a/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java b/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java index 95ea14858e..1c0cfb8301 100644 --- a/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java +++ b/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java @@ -3,6 +3,7 @@ package gtPlusPlus.everglades.world; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; + import net.minecraft.world.WorldType; public class CustomWorldType extends WorldType { diff --git a/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java b/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java index bfeb8c94ad..21c48ea17d 100644 --- a/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java +++ b/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java @@ -3,6 +3,7 @@ package gtPlusPlus.everglades.world; import net.minecraft.util.ChunkCoordinates; public class EvergladesPortalPosition extends ChunkCoordinates { + public long field_85087_d; final TeleporterDimensionMod field_85088_e; diff --git a/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java b/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java index ee8488ab75..1d700b16b0 100644 --- a/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java +++ b/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java @@ -1,7 +1,7 @@ package gtPlusPlus.everglades.world; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; import java.util.*; + import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.util.*; @@ -9,6 +9,8 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.Teleporter; import net.minecraft.world.WorldServer; +import gtPlusPlus.everglades.dimension.Dimension_Everglades; + public class TeleporterDimensionMod extends Teleporter { private final WorldServer worldServerInstance; @@ -21,8 +23,8 @@ public class TeleporterDimensionMod extends Teleporter { */ private final LongHashMap destinationCoordinateCache = new LongHashMap(); /** - * A list of valid keys for the destinationCoordainteCache. These are - * based on the X & Z of the players initial location. + * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial + * location. */ @SuppressWarnings("rawtypes") private final List destinationCoordinateKeys = new ArrayList(); @@ -57,8 +59,8 @@ public class TeleporterDimensionMod extends Teleporter { int l1 = j + j1; int i2 = k + i1 * b1 - l * b0; boolean flag = j1 < 0; - this.worldServerInstance.setBlock( - k1, l1, i2, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air); + this.worldServerInstance + .setBlock(k1, l1, i2, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air); } } } @@ -86,8 +88,8 @@ public class TeleporterDimensionMod extends Teleporter { int l3; if (this.destinationCoordinateCache.containsItem(j1)) { - Teleporter.PortalPosition portalposition = - (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(j1); + Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache + .getValueByKey(j1); d3 = 0.0D; i = portalposition.posX; j = portalposition.posY; @@ -125,8 +127,8 @@ public class TeleporterDimensionMod extends Teleporter { if (d3 >= 0.0D) { if (flag) { - this.destinationCoordinateCache.add( - j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime())); + this.destinationCoordinateCache + .add(j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime())); this.destinationCoordinateKeys.add(Long.valueOf(j1)); } @@ -262,8 +264,7 @@ public class TeleporterDimensionMod extends Teleporter { for (k2 = k - b0; k2 <= k + b0; ++k2) { d2 = k2 + 0.5D - par1Entity.posZ; - label274: - for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) { + label274: for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) { if (this.worldServerInstance.isAirBlock(i2, i3, k2)) { while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) { --i3; @@ -286,10 +287,8 @@ public class TeleporterDimensionMod extends Teleporter { int j5 = k2 + (j4 - 1) * l3 - i4 * k3; if (k4 < 0 - && !this.worldServerInstance - .getBlock(l4, i5, j5) - .getMaterial() - .isSolid() + && !this.worldServerInstance.getBlock(l4, i5, j5).getMaterial() + .isSolid() || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5)) { continue label274; } @@ -319,8 +318,7 @@ public class TeleporterDimensionMod extends Teleporter { for (k2 = k - b0; k2 <= k + b0; ++k2) { d2 = k2 + 0.5D - par1Entity.posZ; - label222: - for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) { + label222: for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) { if (this.worldServerInstance.isAirBlock(i2, i3, k2)) { while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) { --i3; @@ -337,10 +335,8 @@ public class TeleporterDimensionMod extends Teleporter { i5 = k2 + (i4 - 1) * l3; if (j4 < 0 - && !this.worldServerInstance - .getBlock(k4, l4, i5) - .getMaterial() - .isSolid() + && !this.worldServerInstance.getBlock(k4, l4, i5).getMaterial() + .isSolid() || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5)) { continue label222; } @@ -395,8 +391,8 @@ public class TeleporterDimensionMod extends Teleporter { i4 = j2 + k3; j4 = k2 + (j3 - 1) * l2 - i3 * l5; flag = k3 < 0; - this.worldServerInstance.setBlock( - l3, i4, j4, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air); + this.worldServerInstance + .setBlock(l3, i4, j4, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air); } } } @@ -424,8 +420,8 @@ public class TeleporterDimensionMod extends Teleporter { l3 = k5 + (j3 - 1) * l5; i4 = j2 + k3; j4 = k2 + (j3 - 1) * l2; - this.worldServerInstance.notifyBlocksOfNeighborChange( - l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4)); + this.worldServerInstance + .notifyBlocksOfNeighborChange(l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4)); } } } @@ -434,8 +430,8 @@ public class TeleporterDimensionMod extends Teleporter { } /** - * called periodically to remove out-of-date portal locations from the - * cache list. Argument par1 is a WorldServer.getTotalWorldTime() value. + * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a + * WorldServer.getTotalWorldTime() value. */ @Override public void removeStalePortalLocations(long par1) { @@ -446,8 +442,8 @@ public class TeleporterDimensionMod extends Teleporter { while (iterator.hasNext()) { Long olong = (Long) iterator.next(); - Teleporter.PortalPosition portalposition = - (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(olong.longValue()); + Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache + .getValueByKey(olong.longValue()); if (portalposition == null || portalposition.lastUpdateTime < j) { iterator.remove(); @@ -458,6 +454,7 @@ public class TeleporterDimensionMod extends Teleporter { } public class PortalPosition extends ChunkCoordinates { + /** * The worldtime at which this PortalPosition was last verified */ diff --git a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java index 7618885d08..6a4ef65f17 100644 --- a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java +++ b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java @@ -1,11 +1,9 @@ package gtPlusPlus.everglades.world; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.everglades.biome.GenLayerEverglades; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReportCategory; import net.minecraft.util.ReportedException; @@ -18,6 +16,10 @@ import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.IntCache; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.everglades.biome.GenLayerEverglades; + public class WorldChunkManagerCustom extends WorldChunkManager { private GenLayer genBiomes; @@ -28,7 +30,7 @@ public class WorldChunkManagerCustom extends WorldChunkManager { /** A list of biomes that the player can spawn in. */ private List<BiomeGenBase> biomesToSpawnIn; - @SuppressWarnings({"rawtypes"}) + @SuppressWarnings({ "rawtypes" }) public WorldChunkManagerCustom() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); @@ -58,8 +60,7 @@ public class WorldChunkManagerCustom extends WorldChunkManager { } /** - * Returns a list of rainfall values for the specified blocks. Args: - * listToReuse, x, z, width, length. + * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. */ @Override public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) { @@ -97,8 +98,7 @@ public class WorldChunkManagerCustom extends WorldChunkManager { } /** - * Return an adjusted version of a given temperature based on the y - * height + * Return an adjusted version of a given temperature based on the y height */ @Override @SideOnly(Side.CLIENT) @@ -110,8 +110,8 @@ public class WorldChunkManagerCustom extends WorldChunkManager { * Returns an array of biomes for the location input. */ @Override - public BiomeGenBase[] getBiomesForGeneration( - BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, + int par5) { IntCache.resetIntCache(); if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { @@ -139,9 +139,8 @@ public class WorldChunkManagerCustom extends WorldChunkManager { } /** - * Returns biomes to use for the blocks and loads the other data like - * temperature and humidity onto the WorldChunkManager Args: - * oldBiomeList, x, z, width, depth + * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the + * WorldChunkManager Args: oldBiomeList, x, z, width, depth */ @Override public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) { @@ -149,13 +148,12 @@ public class WorldChunkManagerCustom extends WorldChunkManager { } /** - * Return a list of biomes for the specified blocks. Args: listToReuse, - * x, y, width, length, cacheFlag (if false, don't check biomeCache to - * avoid infinite loop in BiomeCacheBlock) + * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, + * don't check biomeCache to avoid infinite loop in BiomeCacheBlock) */ @Override - public BiomeGenBase[] getBiomeGenAt( - BiomeGenBase[] listToReuse, int x, int y, int width, int length, boolean cacheFlag) { + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int y, int width, int length, + boolean cacheFlag) { IntCache.resetIntCache(); if (listToReuse == null || listToReuse.length < width * length) { @@ -214,14 +212,13 @@ public class WorldChunkManagerCustom extends WorldChunkManager { } /** - * Finds a valid position within a range, that is in one of the listed - * biomes. Searches {par1,par2} +-par3 blocks. Strongly favors positive - * y positions. + * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks. + * Strongly favors positive y positions. */ @Override @SuppressWarnings("rawtypes") - public ChunkPosition findBiomePosition( - int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) { + public ChunkPosition findBiomePosition(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, + Random p_150795_5_) { IntCache.resetIntCache(); int l = p_150795_1_ - p_150795_3_ >> 2; int i1 = p_150795_2_ - p_150795_3_ >> 2; diff --git a/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java b/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java index 1bd026af72..9b25025263 100644 --- a/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java +++ b/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java @@ -1,14 +1,15 @@ package gtPlusPlus.everglades.world; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.everglades.chunk.ChunkProviderModded; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; import net.minecraft.util.Vec3; import net.minecraft.world.WorldProvider; import net.minecraft.world.WorldType; import net.minecraft.world.chunk.IChunkProvider; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.everglades.chunk.ChunkProviderModded; +import gtPlusPlus.everglades.dimension.Dimension_Everglades; + public class WorldProviderMod extends WorldProvider { @Override |