Improved readability of variables
Hopefully improved semantics of variables Fixed typos Added hyphenations
This commit is contained in:
@@ -13,7 +13,7 @@ public class CompassManager
|
||||
|
||||
public static CompassManager instance = new CompassManager();
|
||||
|
||||
class CompassReq
|
||||
class CompassRequest
|
||||
{
|
||||
|
||||
final int hash;
|
||||
@@ -21,7 +21,7 @@ public class CompassManager
|
||||
final long attunement;
|
||||
final int cx, cdy, cz;
|
||||
|
||||
public CompassReq(long attunement, int x, int y, int z) {
|
||||
public CompassRequest(long attunement, int x, int y, int z) {
|
||||
this.attunement = attunement;
|
||||
cx = x >> 4;
|
||||
cdy = y >> 5;
|
||||
@@ -38,25 +38,25 @@ public class CompassManager
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
CompassReq b = (CompassReq) obj;
|
||||
CompassRequest b = (CompassRequest) obj;
|
||||
return attunement == b.attunement && cx == b.cx && cdy == b.cdy && cz == b.cz;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HashMap<CompassReq, CompassResult> reqs = new HashMap();
|
||||
HashMap<CompassRequest, CompassResult> requests = new HashMap();
|
||||
|
||||
public void postResult(long attunement, int x, int y, int z, CompassResult res)
|
||||
public void postResult(long attunement, int x, int y, int z, CompassResult result)
|
||||
{
|
||||
CompassReq r = new CompassReq( attunement, x, y, z );
|
||||
reqs.put( r, res );
|
||||
CompassRequest r = new CompassRequest( attunement, x, y, z );
|
||||
requests.put( r, result );
|
||||
}
|
||||
|
||||
public CompassResult getCompassDirection(long attunement, int x, int y, int z)
|
||||
{
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
Iterator<CompassResult> i = reqs.values().iterator();
|
||||
Iterator<CompassResult> i = requests.values().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
CompassResult res = i.next();
|
||||
@@ -65,13 +65,13 @@ public class CompassManager
|
||||
i.remove();
|
||||
}
|
||||
|
||||
CompassReq r = new CompassReq( attunement, x, y, z );
|
||||
CompassResult res = reqs.get( r );
|
||||
CompassRequest r = new CompassRequest( attunement, x, y, z );
|
||||
CompassResult res = requests.get( r );
|
||||
|
||||
if ( res == null )
|
||||
{
|
||||
res = new CompassResult( false, true, 0 );
|
||||
reqs.put( r, res );
|
||||
requests.put( r, res );
|
||||
requestUpdate( r );
|
||||
}
|
||||
else if ( now - res.time > 1000 * 3 )
|
||||
@@ -86,7 +86,7 @@ public class CompassManager
|
||||
return res;
|
||||
}
|
||||
|
||||
private void requestUpdate(CompassReq r)
|
||||
private void requestUpdate(CompassRequest r)
|
||||
{
|
||||
|
||||
try
|
||||
|
||||
@@ -20,9 +20,9 @@ final public class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem
|
||||
int i = dispenser.getXInt() + enumfacing.getFrontOffsetX();
|
||||
int j = dispenser.getYInt() + enumfacing.getFrontOffsetY();
|
||||
int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ();
|
||||
EntityTinyTNTPrimed entitytntprimed = new EntityTinyTNTPrimed( world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F),
|
||||
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F),
|
||||
(double) ((float) k + 0.5F), (EntityLiving) null );
|
||||
world.spawnEntityInWorld( entitytntprimed );
|
||||
world.spawnEntityInWorld( primedTinyTNTEntity );
|
||||
--dispensedItem.stackSize;
|
||||
return dispensedItem;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import net.minecraft.world.World;
|
||||
public interface IBlockTool
|
||||
{
|
||||
|
||||
boolean onItemUse(ItemStack dispensedItem, EntityPlayer player, World w, int x, int y, int z, int ordinal, float hitx, float hity, float hitz);
|
||||
boolean onItemUse(ItemStack dispensedItem, EntityPlayer player, World w, int x, int y, int z, int ordinal, float hitX, float hitY, float hitZ);
|
||||
|
||||
}
|
||||
|
||||
@@ -35,19 +35,19 @@ final public class QuartzWorldGen implements IWorldGenerator
|
||||
@Override
|
||||
public void generate(Random r, int chunkX, int chunkZ, World w, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
int sealevel = w.provider.getAverageGroundLevel() + 1;
|
||||
int seaLevel = w.provider.getAverageGroundLevel() + 1;
|
||||
|
||||
if ( sealevel < 20 )
|
||||
if ( seaLevel < 20 )
|
||||
{
|
||||
int x = (chunkX << 4) + 8;
|
||||
int z = (chunkZ << 4) + 8;
|
||||
sealevel = w.getHeightValue( x, z );
|
||||
seaLevel = w.getHeightValue( x, z );
|
||||
}
|
||||
|
||||
if ( oreNormal == null || oreCharged == null )
|
||||
return;
|
||||
|
||||
double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * sealevel / 64;
|
||||
double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64;
|
||||
int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier );
|
||||
|
||||
for (int x = 0; x < (r.nextBoolean() ? scale * 2 : scale) / 2; ++x)
|
||||
@@ -58,7 +58,7 @@ final public class QuartzWorldGen implements IWorldGenerator
|
||||
if ( WorldGenRegistry.instance.isWorldGenEnabled( isCharged ? WorldGenType.ChargedCertusQuartz : WorldGenType.CertusQuartz, w ) )
|
||||
{
|
||||
int cx = chunkX * 16 + r.nextInt( 22 );
|
||||
int cy = r.nextInt( 40 * sealevel / 64 ) + r.nextInt( 22 * sealevel / 64 ) + 12 * sealevel / 64;
|
||||
int cy = r.nextInt( 40 * seaLevel / 64 ) + r.nextInt( 22 * seaLevel / 64 ) + 12 * seaLevel / 64;
|
||||
int cz = chunkZ * 16 + r.nextInt( 22 );
|
||||
whichOre.generate( w, r, cx, cy, cz );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user