fixed rain/snow (replaced java.util.Random), fixed miscalculated normals on mirrored faces when using GL_LIGHTING
This commit is contained in:
parent
96fddd62b5
commit
95a869c7d3
|
@ -37,11 +37,11 @@ dependencies {
|
|||
teavm {
|
||||
|
||||
compileScopes = null;
|
||||
minifying = true;
|
||||
minifying = false;
|
||||
maxTopLevelNames = 10000;
|
||||
properties = null;
|
||||
debugInformationGenerated = false;
|
||||
sourceMapsGenerated = true;
|
||||
sourceMapsGenerated = false;
|
||||
sourceFilesCopied = false;
|
||||
incremental = false;
|
||||
transformers = null;
|
||||
|
|
18675
javascript/classes.js
18675
javascript/classes.js
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,84 @@
|
|||
package net.lax1dude.eaglercraft;
|
||||
|
||||
public class EaglercraftRandom {
|
||||
|
||||
private static final long multiplier = 0x5DEECE66DL;
|
||||
private static final long addend = 0xBL;
|
||||
private static final long mask = (1L << 48) - 1;
|
||||
|
||||
private static final double DOUBLE_UNIT = 0x1.0p-53;
|
||||
private long seed = 69;
|
||||
|
||||
public EaglercraftRandom() {
|
||||
this(System.nanoTime());
|
||||
}
|
||||
|
||||
public EaglercraftRandom(long seed) {
|
||||
setSeed(seed);
|
||||
}
|
||||
|
||||
public void setSeed(long yeed) {
|
||||
seed = yeed;
|
||||
}
|
||||
|
||||
protected int next(int bits) {
|
||||
seed = (seed * multiplier + addend) & mask;
|
||||
return (int)(seed >>> (48 - bits));
|
||||
}
|
||||
|
||||
public void nextBytes(byte[] bytes) {
|
||||
for (int i = 0, len = bytes.length; i < len; )
|
||||
for (int rnd = nextInt(),
|
||||
n = Math.min(len - i, Integer.SIZE/Byte.SIZE);
|
||||
n-- > 0; rnd >>= Byte.SIZE)
|
||||
bytes[i++] = (byte)rnd;
|
||||
}
|
||||
public int nextInt() {
|
||||
return next(32);
|
||||
}
|
||||
public int nextInt(int bound) {
|
||||
int r = next(31);
|
||||
int m = bound - 1;
|
||||
if ((bound & m) == 0) // i.e., bound is a power of 2
|
||||
r = (int)((bound * (long)r) >> 31);
|
||||
else {
|
||||
for (int u = r;
|
||||
u - (r = u % bound) + m < 0;
|
||||
u = next(31))
|
||||
;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
public long nextLong() {
|
||||
return ((long)(next(32)) << 32) + next(32);
|
||||
}
|
||||
public boolean nextBoolean() {
|
||||
return next(1) != 0;
|
||||
}
|
||||
public float nextFloat() {
|
||||
return next(24) / ((float)(1 << 24));
|
||||
}
|
||||
public double nextDouble() {
|
||||
return (((long)(next(26)) << 27) + next(27)) * DOUBLE_UNIT;
|
||||
}
|
||||
private double nextNextGaussian;
|
||||
private boolean haveNextNextGaussian = false;
|
||||
public double nextGaussian() {
|
||||
// See Knuth, ACP, Section 3.4.1 Algorithm C.
|
||||
if (haveNextNextGaussian) {
|
||||
haveNextNextGaussian = false;
|
||||
return nextNextGaussian;
|
||||
} else {
|
||||
double v1, v2, s;
|
||||
do {
|
||||
v1 = 2 * nextDouble() - 1; // between -1 and 1
|
||||
v2 = 2 * nextDouble() - 1; // between -1 and 1
|
||||
s = v1 * v1 + v2 * v2;
|
||||
} while (s >= 1 || s == 0);
|
||||
double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s)/s);
|
||||
nextNextGaussian = v2 * multiplier;
|
||||
haveNextNextGaussian = true;
|
||||
return v1 * multiplier;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class Block {
|
||||
/**
|
||||
|
@ -21,7 +22,7 @@ public class Block {
|
|||
public static final StepSound soundLadderFootstep = new StepSoundSand("ladder", 1.0F, 1.0F);
|
||||
public static final StepSound soundAnvilFootstep = new StepSoundAnvil("anvil", 0.3F, 1.0F);
|
||||
|
||||
public static final NoiseGeneratorPerlin grassNoise = new NoiseGeneratorPerlin(new Random("methamphetamine".hashCode()));
|
||||
public static final NoiseGeneratorPerlin grassNoise = new NoiseGeneratorPerlin(new EaglercraftRandom("methamphetamine".hashCode()));
|
||||
public static final double[] grassNoiseArray = new double[256];
|
||||
private static int noiseChunkX = Integer.MIN_VALUE;
|
||||
private static int noiseChunkZ = Integer.MIN_VALUE;
|
||||
|
@ -565,14 +566,14 @@ public class Block {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
}
|
||||
|
||||
/**
|
||||
* A randomly called display update to be able to add particles or other items
|
||||
* for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -613,14 +614,14 @@ public class Block {
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
public int quantityDropped(Random par1Random) {
|
||||
public int quantityDropped(EaglercraftRandom par1Random) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
|
@ -1045,7 +1046,7 @@ public class Block {
|
|||
* Returns the usual quantity dropped by the block plus a bonus of 1 to 'i'
|
||||
* (inclusive).
|
||||
*/
|
||||
public int quantityDroppedWithBonus(int par1, Random par2Random) {
|
||||
public int quantityDroppedWithBonus(int par1, EaglercraftRandom par2Random) {
|
||||
return this.quantityDropped(par2Random);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ public class BlockComparator extends BlockRedstoneLogic implements ITileEntityPr
|
|||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {
|
||||
return Item.comparator.itemID;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ public class BlockComparator extends BlockRedstoneLogic implements ITileEntityPr
|
|||
}
|
||||
}
|
||||
|
||||
private void func_96476_c(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
private void func_96476_c(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
int var7 = this.func_94491_m(par1World, par2, par3, par4, var6);
|
||||
int var8 = this.getTileEntityComparator(par1World, par2, par3, par4).func_96100_a();
|
||||
|
@ -172,7 +172,7 @@ public class BlockComparator extends BlockRedstoneLogic implements ITileEntityPr
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
if (this.isRepeaterPowered) {
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
par1World.setBlock(par2, par3, par4, this.func_94484_i().blockID, var6 | 8, 4);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockEnchantmentTable extends BlockContainer {
|
||||
private Icon field_94461_a;
|
||||
|
@ -25,7 +25,7 @@ public class BlockEnchantmentTable extends BlockContainer {
|
|||
* A randomly called display update to be able to add particles or other items
|
||||
* for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
|
||||
|
||||
for (int var6 = par2 - 2; var6 <= par2 + 2; ++var6) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockFarmland extends Block {
|
||||
private Icon field_94441_a;
|
||||
|
@ -49,7 +49,7 @@ public class BlockFarmland extends Block {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4)) {
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class BlockFarmland extends Block {
|
|||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {
|
||||
return Block.dirt.idDropped(0, par2Random, par3);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockGrass extends Block {
|
||||
private Icon iconGrassTop;
|
||||
|
@ -93,7 +93,7 @@ public class BlockGrass extends Block {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
if (!par1World.isRemote) {
|
||||
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) {
|
||||
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
||||
|
@ -115,7 +115,7 @@ public class BlockGrass extends Block {
|
|||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {
|
||||
return Block.dirt.idDropped(0, par2Random, par3);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockMycelium extends Block {
|
||||
private Icon field_94422_a;
|
||||
|
@ -49,7 +49,7 @@ public class BlockMycelium extends Block {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
if (!par1World.isRemote) {
|
||||
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) {
|
||||
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
||||
|
@ -72,7 +72,7 @@ public class BlockMycelium extends Block {
|
|||
* A randomly called display update to be able to add particles or other items
|
||||
* for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
|
||||
|
||||
if (par5Random.nextInt(10) == 0) {
|
||||
|
@ -83,7 +83,7 @@ public class BlockMycelium extends Block {
|
|||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {
|
||||
return Block.dirt.idDropped(0, par2Random, par3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockPane extends Block {
|
||||
/**
|
||||
|
@ -28,7 +29,7 @@ public class BlockPane extends Block {
|
|||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {
|
||||
return !this.canDropItself ? 0 : super.idDropped(par1, par2Random, par3);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockPortal extends BlockBreakable {
|
||||
public BlockPortal(int par1) {
|
||||
|
@ -11,7 +11,7 @@ public class BlockPortal extends BlockBreakable {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
super.updateTick(par1World, par2, par3, par4, par5Random);
|
||||
|
||||
if (par1World.provider.isSurfaceWorld() && par5Random.nextInt(2000) < par1World.difficultySetting) {
|
||||
|
@ -197,7 +197,7 @@ public class BlockPortal extends BlockBreakable {
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
public int quantityDropped(Random par1Random) {
|
||||
public int quantityDropped(EaglercraftRandom par1Random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ public class BlockPortal extends BlockBreakable {
|
|||
* A randomly called display update to be able to add particles or other items
|
||||
* for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
if (par5Random.nextInt(100) == 0) {
|
||||
par1World.playSound((double) par2 + 0.5D, (double) par3 + 0.5D, (double) par4 + 0.5D, "portal.portal", 0.5F, par5Random.nextFloat() * 0.4F + 0.8F, false);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package net.minecraft.src;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockRedstoneOre extends Block {
|
||||
private boolean glowing;
|
||||
|
||||
|
@ -115,7 +117,7 @@ public class BlockRedstoneOre extends Block {
|
|||
* The redstone ore sparkles.
|
||||
*/
|
||||
private void sparkle(World par1World, int par2, int par3, int par4) {
|
||||
Random var5 = par1World.rand;
|
||||
EaglercraftRandom var5 = par1World.rand;
|
||||
double var6 = 0.0625D;
|
||||
|
||||
for (int var8 = 0; var8 < 6; ++var8) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockStairs extends Block {
|
||||
private static final int[][] field_72159_a = new int[][] { { 2, 6 }, { 3, 7 }, { 2, 3 }, { 6, 7 }, { 0, 4 }, { 1, 5 }, { 0, 1 }, { 4, 5 } };
|
||||
|
@ -292,7 +293,7 @@ public class BlockStairs extends Block {
|
|||
* A randomly called display update to be able to add particles or other items
|
||||
* for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
this.modelBlock.randomDisplayTick(par1World, par2, par3, par4, par5Random);
|
||||
}
|
||||
|
||||
|
@ -422,7 +423,7 @@ public class BlockStairs extends Block {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
this.modelBlock.updateTick(par1World, par2, par3, par4, par5Random);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class BlockTorch extends Block {
|
||||
protected BlockTorch(int par1) {
|
||||
|
@ -96,7 +96,7 @@ public class BlockTorch extends Block {
|
|||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
super.updateTick(par1World, par2, par3, par4, par5Random);
|
||||
|
||||
if (par1World.getBlockMetadata(par2, par3, par4) == 0) {
|
||||
|
@ -217,7 +217,7 @@ public class BlockTorch extends Block {
|
|||
* A randomly called display update to be able to add particles or other items
|
||||
* for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
double var7 = (double) ((float) par2 + 0.5F);
|
||||
double var9 = (double) ((float) par3 + 0.7F);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class ContainerEnchantment extends Container {
|
||||
/** SlotEnchantmentTable object with ItemStack to be enchanted */
|
||||
|
@ -12,7 +13,7 @@ public class ContainerEnchantment extends Container {
|
|||
private int posX;
|
||||
private int posY;
|
||||
private int posZ;
|
||||
private Random rand = new Random();
|
||||
private EaglercraftRandom rand = new EaglercraftRandom();
|
||||
|
||||
/** used as seed for EnchantmentNameParts (see GuiEnchantment) */
|
||||
public long nameSeed;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class EnchantmentDurability extends Enchantment {
|
||||
protected EnchantmentDurability(int par1, int par2) {
|
||||
|
@ -42,7 +42,7 @@ public class EnchantmentDurability extends Enchantment {
|
|||
* enchantment level, otherwise there is a 1-(par/1) chance for damage to be
|
||||
* negated.
|
||||
*/
|
||||
public static boolean negateDamage(ItemStack par0ItemStack, int par1, Random par2Random) {
|
||||
public static boolean negateDamage(ItemStack par0ItemStack, int par1, EaglercraftRandom par2Random) {
|
||||
return par0ItemStack.getItem() instanceof ItemArmor && par2Random.nextFloat() < 0.6F ? false : par2Random.nextInt(par1 + 1) > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,13 +6,14 @@ import java.util.Iterator;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
public class EnchantmentHelper {
|
||||
/** Is the random seed of enchantment effects. */
|
||||
private static final Random enchantmentRand = new Random();
|
||||
private static final EaglercraftRandom enchantmentRand = new EaglercraftRandom();
|
||||
|
||||
/**
|
||||
* Used to calculate the extra armor of enchantments on armors equipped on
|
||||
|
@ -264,7 +265,7 @@ public class EnchantmentHelper {
|
|||
* each index (2nd parameter: 0, 1 and 2), cutting to the max enchantability
|
||||
* power of the table (3rd parameter)
|
||||
*/
|
||||
public static int calcItemStackEnchantability(Random par0Random, int par1, int par2, ItemStack par3ItemStack) {
|
||||
public static int calcItemStackEnchantability(EaglercraftRandom par0Random, int par1, int par2, ItemStack par3ItemStack) {
|
||||
Item var4 = par3ItemStack.getItem();
|
||||
int var5 = var4.getItemEnchantability();
|
||||
|
||||
|
@ -284,7 +285,7 @@ public class EnchantmentHelper {
|
|||
* Adds a random enchantment to the specified item. Args: random, itemStack,
|
||||
* enchantabilityLevel
|
||||
*/
|
||||
public static ItemStack addRandomEnchantment(Random par0Random, ItemStack par1ItemStack, int par2) {
|
||||
public static ItemStack addRandomEnchantment(EaglercraftRandom par0Random, ItemStack par1ItemStack, int par2) {
|
||||
List var3 = buildEnchantmentList(par0Random, par1ItemStack, par2);
|
||||
boolean var4 = par1ItemStack.itemID == Item.book.itemID;
|
||||
|
||||
|
@ -314,7 +315,7 @@ public class EnchantmentHelper {
|
|||
* together to the ItemStack, the 3rd parameter is the total enchantability
|
||||
* level.
|
||||
*/
|
||||
public static List buildEnchantmentList(Random par0Random, ItemStack par1ItemStack, int par2) {
|
||||
public static List buildEnchantmentList(EaglercraftRandom par0Random, ItemStack par1ItemStack, int par2) {
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class EnchantmentNameParts {
|
||||
/** The static instance of this class. */
|
||||
public static final EnchantmentNameParts instance = new EnchantmentNameParts();
|
||||
|
||||
/** The RNG used to generate enchant names. */
|
||||
private Random rand = new Random();
|
||||
private EaglercraftRandom rand = new EaglercraftRandom();
|
||||
|
||||
/** List of words used to generate an enchant name. */
|
||||
private String[] wordList = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale "
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class EnchantmentThorns extends Enchantment {
|
||||
public EnchantmentThorns(int par1, int par2) {
|
||||
|
@ -35,15 +35,15 @@ public class EnchantmentThorns extends Enchantment {
|
|||
return par1ItemStack.getItem() instanceof ItemArmor ? true : super.canApply(par1ItemStack);
|
||||
}
|
||||
|
||||
public static boolean func_92094_a(int par0, Random par1Random) {
|
||||
public static boolean func_92094_a(int par0, EaglercraftRandom par1Random) {
|
||||
return par0 <= 0 ? false : par1Random.nextFloat() < 0.15F * (float) par0;
|
||||
}
|
||||
|
||||
public static int func_92095_b(int par0, Random par1Random) {
|
||||
public static int func_92095_b(int par0, EaglercraftRandom par1Random) {
|
||||
return par0 > 10 ? par0 - 10 : 1 + par1Random.nextInt(4);
|
||||
}
|
||||
|
||||
public static void func_92096_a(Entity par0Entity, EntityLiving par1EntityLiving, Random par2Random) {
|
||||
public static void func_92096_a(Entity par0Entity, EntityLiving par1EntityLiving, EaglercraftRandom par2Random) {
|
||||
int var3 = EnchantmentHelper.func_92098_i(par1EntityLiving);
|
||||
ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, par1EntityLiving);
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
|
@ -141,7 +142,7 @@ public abstract class Entity {
|
|||
* Reduces the velocity applied by entity collisions by the specified percent.
|
||||
*/
|
||||
public float entityCollisionReduction;
|
||||
protected Random rand;
|
||||
protected EaglercraftRandom rand;
|
||||
|
||||
/** How many ticks has this entity had ran since being alive */
|
||||
public int ticksExisted;
|
||||
|
@ -219,7 +220,7 @@ public abstract class Entity {
|
|||
this.stepHeight = 0.0F;
|
||||
this.noClip = false;
|
||||
this.entityCollisionReduction = 0.0F;
|
||||
this.rand = new Random();
|
||||
this.rand = new EaglercraftRandom();
|
||||
this.ticksExisted = 0;
|
||||
this.fireResistance = 1;
|
||||
this.fire = 0;
|
||||
|
|
|
@ -4,7 +4,8 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
|
@ -264,7 +265,7 @@ public abstract class EntityLiving extends Entity {
|
|||
return this.senses;
|
||||
}
|
||||
|
||||
public Random getRNG() {
|
||||
public EaglercraftRandom getRNG() {
|
||||
return this.rand;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,11 @@ package net.minecraft.src;
|
|||
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import net.lax1dude.eaglercraft.EaglerImage;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.GuiScreenVoiceChannel;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
|
@ -122,7 +121,7 @@ public class EntityRenderer {
|
|||
|
||||
/** Torch flicker DY */
|
||||
float torchFlickerDY = 0.0F;
|
||||
private Random random = new Random();
|
||||
private EaglercraftRandom random = new EaglercraftRandom();
|
||||
|
||||
/** Rain sound counter */
|
||||
private int rainSoundCounter = 0;
|
||||
|
@ -1215,7 +1214,6 @@ public class EntityRenderer {
|
|||
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
|
||||
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
|
||||
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.01F);
|
||||
snow.bindTexture();
|
||||
double var9 = var41.lastTickPosX + (var41.posX - var41.lastTickPosX) * (double) par1;
|
||||
double var11 = var41.lastTickPosY + (var41.posY - var41.lastTickPosY) * (double) par1;
|
||||
double var13 = var41.lastTickPosZ + (var41.posZ - var41.lastTickPosZ) * (double) par1;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
|
@ -206,7 +206,7 @@ public class EntitySheep extends EntityAnimal {
|
|||
* This method is called when a sheep spawns in the world to select the color of
|
||||
* sheep fleece.
|
||||
*/
|
||||
public static int getRandomFleeceColor(Random par0Random) {
|
||||
public static int getRandomFleeceColor(EaglercraftRandom par0Random) {
|
||||
int var1 = par0Random.nextInt(100);
|
||||
return var1 < 5 ? 15 : (var1 < 10 ? 7 : (var1 < 15 ? 8 : (var1 < 18 ? 12 : (par0Random.nextInt(500) == 0 ? 6 : 0))));
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@ import java.util.Collections;
|
|||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class EntityVillager extends EntityAgeable implements INpc, IMerchant {
|
||||
private int randomTickDivider;
|
||||
|
@ -401,27 +402,27 @@ public class EntityVillager extends EntityAgeable implements INpc, IMerchant {
|
|||
* each recipie takes a random stack from villagerStockList and offers it for 1
|
||||
* emerald
|
||||
*/
|
||||
private static void addMerchantItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) {
|
||||
private static void addMerchantItem(MerchantRecipeList par0MerchantRecipeList, int par1, EaglercraftRandom par2Random, float par3) {
|
||||
if (par2Random.nextFloat() < par3) {
|
||||
par0MerchantRecipeList.add(new MerchantRecipe(getRandomSizedStack(par1, par2Random), Item.emerald));
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getRandomSizedStack(int par0, Random par1Random) {
|
||||
private static ItemStack getRandomSizedStack(int par0, EaglercraftRandom par1Random) {
|
||||
return new ItemStack(par0, getRandomCountForItem(par0, par1Random), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* default to 1, and villagerStockList contains a min/max amount for each index
|
||||
*/
|
||||
private static int getRandomCountForItem(int par0, Random par1Random) {
|
||||
private static int getRandomCountForItem(int par0, EaglercraftRandom par1Random) {
|
||||
Tuple var2 = (Tuple) villagerStockList.get(Integer.valueOf(par0));
|
||||
return var2 == null ? 1
|
||||
: (((Integer) var2.getFirst()).intValue() >= ((Integer) var2.getSecond()).intValue() ? ((Integer) var2.getFirst()).intValue()
|
||||
: ((Integer) var2.getFirst()).intValue() + par1Random.nextInt(((Integer) var2.getSecond()).intValue() - ((Integer) var2.getFirst()).intValue()));
|
||||
}
|
||||
|
||||
private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) {
|
||||
private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, EaglercraftRandom par2Random, float par3) {
|
||||
if (par2Random.nextFloat() < par3) {
|
||||
int var4 = getRandomCountForBlacksmithItem(par1, par2Random);
|
||||
ItemStack var5;
|
||||
|
@ -439,7 +440,7 @@ public class EntityVillager extends EntityAgeable implements INpc, IMerchant {
|
|||
}
|
||||
}
|
||||
|
||||
private static int getRandomCountForBlacksmithItem(int par0, Random par1Random) {
|
||||
private static int getRandomCountForBlacksmithItem(int par0, EaglercraftRandom par1Random) {
|
||||
Tuple var2 = (Tuple) blacksmithSellingList.get(Integer.valueOf(par0));
|
||||
return var2 == null ? 1
|
||||
: (((Integer) var2.getFirst()).intValue() >= ((Integer) var2.getSecond()).intValue() ? ((Integer) var2.getFirst()).intValue()
|
||||
|
|
|
@ -7,11 +7,10 @@ import java.nio.ByteBuffer;
|
|||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import net.lax1dude.eaglercraft.EaglerImage;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
|
||||
|
@ -21,7 +20,7 @@ public class FontRenderer {
|
|||
|
||||
/** the height in pixels of default text */
|
||||
public int FONT_HEIGHT = 9;
|
||||
public Random fontRandom = new Random();
|
||||
public EaglercraftRandom fontRandom = new EaglercraftRandom();
|
||||
|
||||
/**
|
||||
* Array of the start/end column (in upper/lower nibble) for every glyph in the
|
||||
|
|
|
@ -3,18 +3,17 @@ package net.minecraft.src;
|
|||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
import net.lax1dude.eaglercraft.glemu.EffectPipeline;
|
||||
|
||||
public class GuiIngame extends Gui {
|
||||
private static RenderItem itemRenderer = null;
|
||||
private final Random rand = new Random();
|
||||
private final EaglercraftRandom rand = new EaglercraftRandom();
|
||||
private final Minecraft mc;
|
||||
|
||||
/** ChatGUI instance that retains all previous chat data */
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class ItemEnchantedBook extends Item {
|
||||
public ItemEnchantedBook(int par1) {
|
||||
|
@ -92,7 +93,7 @@ public class ItemEnchantedBook extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
public ItemStack func_92109_a(Random par1Random) {
|
||||
public ItemStack func_92109_a(EaglercraftRandom par1Random) {
|
||||
Enchantment var2 = Enchantment.field_92090_c[par1Random.nextInt(Enchantment.field_92090_c.length)];
|
||||
ItemStack var3 = new ItemStack(this.itemID, 1, 0);
|
||||
int var4 = MathHelper.getRandomIntegerInRange(par1Random, var2.getMinLevel(), var2.getMaxLevel());
|
||||
|
|
|
@ -2,7 +2,8 @@ package net.minecraft.src;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public final class ItemStack {
|
||||
/** Size of the stack. */
|
||||
|
@ -237,7 +238,7 @@ public final class ItemStack {
|
|||
* false otherwise or if the ItemStack can't be damaged or if all points of
|
||||
* damage are negated.
|
||||
*/
|
||||
public boolean attemptDamageItem(int par1, Random par2Random) {
|
||||
public boolean attemptDamageItem(int par1, EaglercraftRandom par2Random) {
|
||||
if (!this.isItemStackDamageable()) {
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
|
@ -130,11 +130,11 @@ public class MathHelper {
|
|||
return par0Str == null || par0Str.length() == 0;
|
||||
}
|
||||
|
||||
public static int getRandomIntegerInRange(Random par0Random, int par1, int par2) {
|
||||
public static int getRandomIntegerInRange(EaglercraftRandom par0Random, int par1, int par2) {
|
||||
return par1 >= par2 ? par1 : par0Random.nextInt(par2 - par1 + 1) + par1;
|
||||
}
|
||||
|
||||
public static double getRandomDoubleInRange(Random par0Random, double par1, double par3) {
|
||||
public static double getRandomDoubleInRange(EaglercraftRandom par0Random, double par1, double par3) {
|
||||
return par1 >= par3 ? par1 : par0Random.nextDouble() * (par3 - par1) + par1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class NoiseGeneratorOctaves extends NoiseGenerator {
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@ public class NoiseGeneratorOctaves extends NoiseGenerator {
|
|||
private NoiseGeneratorPerlin[] generatorCollection;
|
||||
private int octaves;
|
||||
|
||||
public NoiseGeneratorOctaves(Random par1Random, int par2) {
|
||||
public NoiseGeneratorOctaves(EaglercraftRandom par1Random, int par2) {
|
||||
this.octaves = par2;
|
||||
this.generatorCollection = new NoiseGeneratorPerlin[par2];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class NoiseGeneratorPerlin extends NoiseGenerator {
|
||||
private int[] permutations;
|
||||
|
@ -9,10 +9,10 @@ public class NoiseGeneratorPerlin extends NoiseGenerator {
|
|||
public double zCoord;
|
||||
|
||||
public NoiseGeneratorPerlin() {
|
||||
this(new Random());
|
||||
this(new EaglercraftRandom());
|
||||
}
|
||||
|
||||
public NoiseGeneratorPerlin(Random par1Random) {
|
||||
public NoiseGeneratorPerlin(EaglercraftRandom par1Random) {
|
||||
this.permutations = new int[512];
|
||||
this.xCoord = par1Random.nextDouble() * 256.0D;
|
||||
this.yCoord = par1Random.nextDouble() * 256.0D;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
public class RandomPositionGenerator {
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ public class RandomPositionGenerator {
|
|||
* which creature.getBlockPathWeight returns the highest number
|
||||
*/
|
||||
private static Vec3 findRandomTargetBlock(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) {
|
||||
Random var4 = par0EntityCreature.getRNG();
|
||||
EaglercraftRandom var4 = par0EntityCreature.getRNG();
|
||||
boolean var5 = false;
|
||||
int var6 = 0;
|
||||
int var7 = 0;
|
||||
|
|
|
@ -8,11 +8,10 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
|
||||
|
@ -92,9 +91,6 @@ public class RenderGlobal implements IWorldAccess {
|
|||
/** Count entities hidden */
|
||||
private int countEntitiesHidden;
|
||||
|
||||
/** Dummy buffer (50k) not used */
|
||||
int[] dummyBuf50k = new int[50000];
|
||||
|
||||
/** How many renderers are loaded this frame that try to be rendered */
|
||||
private int renderersLoaded;
|
||||
|
||||
|
@ -214,7 +210,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
}
|
||||
|
||||
private void renderStars() {
|
||||
Random var1 = new Random(10842L);
|
||||
EaglercraftRandom var1 = new EaglercraftRandom(10842L);
|
||||
Tessellator var2 = Tessellator.instance;
|
||||
var2.startDrawingQuads();
|
||||
|
||||
|
@ -1742,7 +1738,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
}
|
||||
|
||||
public void broadcastSound(int par1, int par2, int par3, int par4, int par5) {
|
||||
Random var6 = this.theWorld.rand;
|
||||
EaglercraftRandom var6 = this.theWorld.rand;
|
||||
|
||||
switch (par1) {
|
||||
case 1013:
|
||||
|
@ -1778,7 +1774,7 @@ public class RenderGlobal implements IWorldAccess {
|
|||
* one-shot behaviour (particles, etc).
|
||||
*/
|
||||
public void playAuxSFX(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) {
|
||||
Random var7 = this.theWorld.rand;
|
||||
EaglercraftRandom var7 = this.theWorld.rand;
|
||||
double var8;
|
||||
double var10;
|
||||
double var12;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
|
||||
|
@ -12,7 +10,7 @@ public class RenderItem extends Render {
|
|||
private RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
private Random random = new Random();
|
||||
private EaglercraftRandom random = new EaglercraftRandom();
|
||||
public boolean renderWithColor = true;
|
||||
|
||||
/** Defines the zLevel of rendering of item on GUI. */
|
||||
|
|
|
@ -32,9 +32,9 @@ public class TexturedQuad {
|
|||
var1[var2] = this.vertexPositions[this.vertexPositions.length - var2 - 1];
|
||||
}
|
||||
|
||||
this.normal.xCoord = -this.normal.xCoord;
|
||||
this.normal.yCoord = -this.normal.yCoord;
|
||||
this.normal.zCoord = -this.normal.zCoord;
|
||||
//this.normal.xCoord = -this.normal.xCoord;
|
||||
//this.normal.yCoord = -this.normal.yCoord;
|
||||
//this.normal.zCoord = -this.normal.zCoord;
|
||||
|
||||
this.vertexPositions = var1;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,10 @@ import java.util.Collection;
|
|||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
|
||||
|
||||
public abstract class World implements IBlockAccess {
|
||||
|
@ -44,7 +45,7 @@ public abstract class World implements IBlockAccess {
|
|||
* planar series of values ill-suited for choosing random blocks in a 16x128x16
|
||||
* field.
|
||||
*/
|
||||
protected int updateLCG = (new Random()).nextInt();
|
||||
protected int updateLCG = (new EaglercraftRandom()).nextInt();
|
||||
|
||||
/**
|
||||
* magic number used to generate fast random numbers for 3d distribution within
|
||||
|
@ -66,7 +67,7 @@ public abstract class World implements IBlockAccess {
|
|||
public int difficultySetting;
|
||||
|
||||
/** RNG for World. */
|
||||
public Random rand = new Random();
|
||||
public EaglercraftRandom rand = new EaglercraftRandom();
|
||||
|
||||
/** The WorldProvider instance that World uses. */
|
||||
public final WorldProvider provider;
|
||||
|
@ -3339,7 +3340,7 @@ public abstract class World implements IBlockAccess {
|
|||
/**
|
||||
* puts the World Random seed to a specific state dependant on the inputs
|
||||
*/
|
||||
public Random setRandomSeed(int par1, int par2, int par3) {
|
||||
public EaglercraftRandom setRandomSeed(int par1, int par2, int par3) {
|
||||
long var4 = (long) par1 * 341873128712L + (long) par2 * 132897987541L + this.getWorldInfo().getSeed() + (long) par3;
|
||||
this.rand.setSeed(var4);
|
||||
return this.rand;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Iterator;
|
|||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class WorldClient extends World {
|
||||
|
@ -278,7 +278,7 @@ public class WorldClient extends World {
|
|||
|
||||
public void doVoidFogParticles(int par1, int par2, int par3) {
|
||||
byte var4 = 16;
|
||||
Random var5 = new Random();
|
||||
EaglercraftRandom var5 = new EaglercraftRandom();
|
||||
|
||||
for (int var6 = 0; var6 < 1000; ++var6) {
|
||||
int var7 = par1 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user