diff --git a/EAGLERCRAFTX_README.md b/EAGLERCRAFTX_README.md
index 350eae8a..5aa06e3a 100755
--- a/EAGLERCRAFTX_README.md
+++ b/EAGLERCRAFTX_README.md
@@ -247,4 +247,4 @@ The `crashReportShow` hook can be used to capture crash reports and append addit
There is currently no system in place to make forks of 1.8 and merge commits made to the patch files in this repository with the patch files or workspace of the fork, you're on your own if you try to keep a fork of this repo for reasons other than to contribute to it
-A javascript-based modding API resembling Minecraft Forge may be implemented someday though for adding custom content to the game.
+**Note:** If you are trying to use the desktop runtime on Linux, make sure you add the "desktopRuntime" folder to the `LD_LIBRARY_PATH` environment variable of the Java process. This should be done automatically by the Eclipse project's default run configuration, but it might not work properly on every system, or when the Eclipse project is imported into IntelliJ.
diff --git a/README.md b/README.md
index 2cc29d0d..8c6cad93 100755
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ Java must be added to your PATH!
2. Open one of the .java files from the source folders (workaround for a bug)
3. Run/Debug the client with the included "eaglercraftDebugRuntime" configuration
+**Note:** If you are trying to use the desktop runtime on Linux, make sure you add the "desktopRuntime" folder to the `LD_LIBRARY_PATH` environment variable of the Java process. This should be done automatically by the Eclipse project's default run configuration, but it might not work properly on every system, or when the Eclipse project is imported into IntelliJ.
+
**See the main 1.8 repository's README for more info**
The source codes of EaglercraftXBungee and EaglercraftXVelocity are not included here.
\ No newline at end of file
diff --git a/desktopRuntime/resources/EPKVersionIdentifier.txt b/desktopRuntime/resources/EPKVersionIdentifier.txt
index dc930393..8ccb0b39 100755
--- a/desktopRuntime/resources/EPKVersionIdentifier.txt
+++ b/desktopRuntime/resources/EPKVersionIdentifier.txt
@@ -1 +1 @@
-u41
\ No newline at end of file
+u42
\ No newline at end of file
diff --git a/desktopRuntime/resources/assets/eagler/boot_menu/boot_menu_markup.html b/desktopRuntime/resources/assets/eagler/boot_menu/boot_menu_markup.html
index 3d386a1b..d60b315e 100755
--- a/desktopRuntime/resources/assets/eagler/boot_menu/boot_menu_markup.html
+++ b/desktopRuntime/resources/assets/eagler/boot_menu/boot_menu_markup.html
@@ -30,7 +30,6 @@
-
diff --git a/desktopRuntime/resources/plugin_download.zip b/desktopRuntime/resources/plugin_download.zip
index f6df8941..3da750a0 100755
Binary files a/desktopRuntime/resources/plugin_download.zip and b/desktopRuntime/resources/plugin_download.zip differ
diff --git a/desktopRuntime/resources/plugin_version.json b/desktopRuntime/resources/plugin_version.json
index c1764ce4..ae3a1684 100755
--- a/desktopRuntime/resources/plugin_version.json
+++ b/desktopRuntime/resources/plugin_version.json
@@ -1 +1 @@
-{"pluginName":"EaglercraftXBungee","pluginVersion":"1.3.2","pluginButton":"Download \"EaglerXBungee-1.3.2.jar\"","pluginFilename":"EaglerXBungee.zip"}
\ No newline at end of file
+{"pluginName":"EaglercraftXBungee","pluginVersion":"1.3.3","pluginButton":"Download \"EaglerXBungee-1.3.3.jar\"","pluginFilename":"EaglerXBungee.zip"}
\ No newline at end of file
diff --git a/desktopRuntime/resources/relay_download.zip b/desktopRuntime/resources/relay_download.zip
index ab0c491b..6efd790a 100755
Binary files a/desktopRuntime/resources/relay_download.zip and b/desktopRuntime/resources/relay_download.zip differ
diff --git a/src/game/java/net/minecraft/block/BlockFarmland.java b/src/game/java/net/minecraft/block/BlockFarmland.java
index e5036e2a..17bf6d1b 100755
--- a/src/game/java/net/minecraft/block/BlockFarmland.java
+++ b/src/game/java/net/minecraft/block/BlockFarmland.java
@@ -103,8 +103,7 @@ public class BlockFarmland extends Block {
}
private boolean hasWater(World worldIn, BlockPos pos) {
- for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(pos.add(-4, 0, -4),
- pos.add(4, 1, 4))) {
+ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(pos.add(-4, 0, -4), pos.add(4, 1, 4))) {
if (worldIn.getBlockState(blockpos$mutableblockpos).getBlock().getMaterial() == Material.water) {
return true;
}
diff --git a/src/game/java/net/minecraft/block/BlockGrass.java b/src/game/java/net/minecraft/block/BlockGrass.java
index b6447a72..77cd8bdd 100755
--- a/src/game/java/net/minecraft/block/BlockGrass.java
+++ b/src/game/java/net/minecraft/block/BlockGrass.java
@@ -71,19 +71,22 @@ public class BlockGrass extends Block implements IGrowable {
public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) {
if (!world.isRemote) {
- if (world.getLightFromNeighbors(blockpos.up()) < 4
- && world.getBlockState(blockpos.up()).getBlock().getLightOpacity() > 2) {
+ BlockPos tmp = new BlockPos();
+ if (world.getLightFromNeighbors(blockpos.up(tmp)) < 4
+ && world.getBlockState(blockpos.up(tmp)).getBlock().getLightOpacity() > 2) {
world.setBlockState(blockpos, Blocks.dirt.getDefaultState());
} else {
- if (world.getLightFromNeighbors(blockpos.up()) >= 9) {
+ if (world.getLightFromNeighbors(blockpos.up(tmp)) >= 9) {
+ BlockPos tmp2 = new BlockPos();
for (int i = 0; i < 4; ++i) {
BlockPos blockpos1 = blockpos.add(random.nextInt(3) - 1, random.nextInt(5) - 3,
- random.nextInt(3) - 1);
- Block block = world.getBlockState(blockpos1.up()).getBlock();
+ random.nextInt(3) - 1, tmp2);
+ Block block = world.getBlockState(blockpos1.up(tmp)).getBlock();
IBlockState iblockstate = world.getBlockState(blockpos1);
if (iblockstate.getBlock() == Blocks.dirt
&& iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT
- && world.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity() <= 2) {
+ && world.getLightFromNeighbors(blockpos1.up(tmp)) >= 4
+ && block.getLightOpacity() <= 2) {
world.setBlockState(blockpos1, Blocks.grass.getDefaultState());
}
}
diff --git a/src/game/java/net/minecraft/block/BlockLeaves.java b/src/game/java/net/minecraft/block/BlockLeaves.java
index 0682d66f..dc534462 100755
--- a/src/game/java/net/minecraft/block/BlockLeaves.java
+++ b/src/game/java/net/minecraft/block/BlockLeaves.java
@@ -106,7 +106,7 @@ public abstract class BlockLeaves extends BlockLeavesBase {
}
if (world.isAreaLoaded(new BlockPos(j - i, k - i, l - i), new BlockPos(j + i, k + i, l + i))) {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = -b0; k1 <= b0; ++k1) {
for (int l1 = -b0; l1 <= b0; ++l1) {
diff --git a/src/game/java/net/minecraft/block/BlockVine.java b/src/game/java/net/minecraft/block/BlockVine.java
index c807bba0..179beece 100755
--- a/src/game/java/net/minecraft/block/BlockVine.java
+++ b/src/game/java/net/minecraft/block/BlockVine.java
@@ -243,10 +243,11 @@ public class BlockVine extends Block {
int i = 5;
boolean flag = false;
+ BlockPos tmp = new BlockPos(0, 0, 0);
label62: for (int j = -b0; j <= b0; ++j) {
for (int k = -b0; k <= b0; ++k) {
for (int l = -1; l <= 1; ++l) {
- if (world.getBlockState(blockpos.add(j, l, k)).getBlock() == this) {
+ if (world.getBlockState(blockpos.add(j, l, k, tmp)).getBlock() == this) {
--i;
if (i <= 0) {
flag = true;
@@ -259,7 +260,6 @@ public class BlockVine extends Block {
EnumFacing enumfacing1 = EnumFacing.random(random);
BlockPos blockpos2 = blockpos.up();
- BlockPos tmp = new BlockPos(0, 0, 0);
if (enumfacing1 == EnumFacing.UP && blockpos.getY() < 255 && world.isAirBlock(blockpos2)) {
if (!flag) {
IBlockState iblockstate3 = iblockstate;
@@ -285,7 +285,7 @@ public class BlockVine extends Block {
} else if (enumfacing1.getAxis().isHorizontal()
&& !((Boolean) iblockstate.getValue(getPropertyFor(enumfacing1))).booleanValue()) {
if (!flag) {
- BlockPos blockpos4 = blockpos.offset(enumfacing1);
+ BlockPos blockpos4 = blockpos.offsetEvenFaster(enumfacing1, blockpos2);
Block block1 = world.getBlockState(blockpos4).getBlock();
if (block1.blockMaterial == Material.air) {
EnumFacing enumfacing2 = enumfacing1.rotateY();
@@ -310,7 +310,7 @@ public class BlockVine extends Block {
world.getBlockState(blockpos.offsetEvenFaster(enumfacing4, tmp)).getBlock())) {
world.setBlockState(blockpos1, this.getDefaultState().withProperty(
getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2);
- } else if (this.canPlaceOn(world.getBlockState(blockpos4.up()).getBlock())) {
+ } else if (this.canPlaceOn(world.getBlockState(blockpos4.up(tmp)).getBlock())) {
world.setBlockState(blockpos4, this.getDefaultState(), 2);
}
} else if (block1.blockMaterial.isOpaque() && block1.isFullCube()) {
@@ -321,7 +321,7 @@ public class BlockVine extends Block {
}
} else {
if (blockpos.getY() > 1) {
- BlockPos blockpos3 = blockpos.down();
+ BlockPos blockpos3 = blockpos.down(blockpos2);
IBlockState iblockstate1 = world.getBlockState(blockpos3);
Block block = iblockstate1.getBlock();
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
diff --git a/src/game/java/net/minecraft/client/Minecraft.java b/src/game/java/net/minecraft/client/Minecraft.java
index 7567361a..1ab340d7 100755
--- a/src/game/java/net/minecraft/client/Minecraft.java
+++ b/src/game/java/net/minecraft/client/Minecraft.java
@@ -1171,6 +1171,11 @@ public class Minecraft implements IThreadListener {
if (wasPaused != isGamePaused) {
SingleplayerServerController.setPaused(this.isGamePaused);
+ if (isGamePaused) {
+ mcSoundHandler.pauseSounds();
+ } else {
+ mcSoundHandler.resumeSounds();
+ }
wasPaused = isGamePaused;
}
diff --git a/src/game/java/net/minecraft/client/audio/GuardianSound.java b/src/game/java/net/minecraft/client/audio/GuardianSound.java
index d884d362..b88fd273 100755
--- a/src/game/java/net/minecraft/client/audio/GuardianSound.java
+++ b/src/game/java/net/minecraft/client/audio/GuardianSound.java
@@ -31,7 +31,6 @@ public class GuardianSound extends MovingSound {
this.guardian = guardian;
this.attenuationType = ISound.AttenuationType.NONE;
this.repeat = true;
- this.repeatDelay = 0;
}
/**+
diff --git a/src/game/java/net/minecraft/client/audio/ISound.java b/src/game/java/net/minecraft/client/audio/ISound.java
index 2569b0cb..5df9e099 100755
--- a/src/game/java/net/minecraft/client/audio/ISound.java
+++ b/src/game/java/net/minecraft/client/audio/ISound.java
@@ -27,8 +27,6 @@ public interface ISound {
boolean canRepeat();
- int getRepeatDelay();
-
float getVolume();
float getPitch();
diff --git a/src/game/java/net/minecraft/client/audio/MovingSoundMinecart.java b/src/game/java/net/minecraft/client/audio/MovingSoundMinecart.java
index cbfea380..5abe13c8 100755
--- a/src/game/java/net/minecraft/client/audio/MovingSoundMinecart.java
+++ b/src/game/java/net/minecraft/client/audio/MovingSoundMinecart.java
@@ -32,7 +32,6 @@ public class MovingSoundMinecart extends MovingSound {
super(new ResourceLocation("minecraft:minecart.base"));
this.minecart = minecartIn;
this.repeat = true;
- this.repeatDelay = 0;
}
/**+
@@ -54,7 +53,6 @@ public class MovingSoundMinecart extends MovingSound {
this.distance = 0.0F;
this.volume = 0.0F;
}
-
}
}
}
\ No newline at end of file
diff --git a/src/game/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java b/src/game/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java
index bae4442f..876c5625 100755
--- a/src/game/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java
+++ b/src/game/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java
@@ -35,7 +35,6 @@ public class MovingSoundMinecartRiding extends MovingSound {
this.minecart = minecart;
this.attenuationType = ISound.AttenuationType.NONE;
this.repeat = true;
- this.repeatDelay = 0;
}
/**+
diff --git a/src/game/java/net/minecraft/client/audio/PositionedSound.java b/src/game/java/net/minecraft/client/audio/PositionedSound.java
index 4f4419fe..a6790292 100755
--- a/src/game/java/net/minecraft/client/audio/PositionedSound.java
+++ b/src/game/java/net/minecraft/client/audio/PositionedSound.java
@@ -30,10 +30,6 @@ public abstract class PositionedSound implements ISound {
protected float yPosF;
protected float zPosF;
protected boolean repeat = false;
- /**+
- * The number of ticks between repeating the sound
- */
- protected int repeatDelay = 0;
protected ISound.AttenuationType attenuationType = ISound.AttenuationType.LINEAR;
protected PositionedSound(ResourceLocation soundResource) {
@@ -48,10 +44,6 @@ public abstract class PositionedSound implements ISound {
return this.repeat;
}
- public int getRepeatDelay() {
- return this.repeatDelay;
- }
-
public float getVolume() {
return this.volume;
}
diff --git a/src/game/java/net/minecraft/client/audio/PositionedSoundRecord.java b/src/game/java/net/minecraft/client/audio/PositionedSoundRecord.java
index 86c6ebfb..7814e6ee 100755
--- a/src/game/java/net/minecraft/client/audio/PositionedSoundRecord.java
+++ b/src/game/java/net/minecraft/client/audio/PositionedSoundRecord.java
@@ -24,29 +24,28 @@ import net.minecraft.util.ResourceLocation;
*/
public class PositionedSoundRecord extends PositionedSound {
public static PositionedSoundRecord create(ResourceLocation soundResource, float pitch) {
- return new PositionedSoundRecord(soundResource, 0.25F, pitch, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F,
+ return new PositionedSoundRecord(soundResource, 0.25F, pitch, false, ISound.AttenuationType.NONE, 0.0F, 0.0F,
0.0F);
}
public static PositionedSoundRecord create(ResourceLocation soundResource) {
- return new PositionedSoundRecord(soundResource, 1.0F, 1.0F, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F,
+ return new PositionedSoundRecord(soundResource, 1.0F, 1.0F, false, ISound.AttenuationType.NONE, 0.0F, 0.0F,
0.0F);
}
public static PositionedSoundRecord create(ResourceLocation soundResource, float xPosition, float yPosition,
float zPosition) {
- return new PositionedSoundRecord(soundResource, 4.0F, 1.0F, false, 0, ISound.AttenuationType.LINEAR, xPosition,
+ return new PositionedSoundRecord(soundResource, 4.0F, 1.0F, false, ISound.AttenuationType.LINEAR, xPosition,
yPosition, zPosition);
}
public PositionedSoundRecord(ResourceLocation soundResource, float volume, float pitch, float xPosition,
float yPosition, float zPosition) {
- this(soundResource, volume, pitch, false, 0, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition);
+ this(soundResource, volume, pitch, false, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition);
}
private PositionedSoundRecord(ResourceLocation soundResource, float volume, float pitch, boolean repeat,
- int repeatDelay, ISound.AttenuationType attenuationType, float xPosition, float yPosition,
- float zPosition) {
+ ISound.AttenuationType attenuationType, float xPosition, float yPosition, float zPosition) {
super(soundResource);
this.volume = volume;
this.pitch = pitch;
@@ -54,7 +53,6 @@ public class PositionedSoundRecord extends PositionedSound {
this.yPosF = yPosition;
this.zPosF = zPosition;
this.repeat = repeat;
- this.repeatDelay = repeatDelay;
this.attenuationType = attenuationType;
}
}
\ No newline at end of file
diff --git a/src/game/java/net/minecraft/client/multiplayer/WorldClient.java b/src/game/java/net/minecraft/client/multiplayer/WorldClient.java
index 64c2fafe..4eeb770c 100755
--- a/src/game/java/net/minecraft/client/multiplayer/WorldClient.java
+++ b/src/game/java/net/minecraft/client/multiplayer/WorldClient.java
@@ -281,7 +281,7 @@ public class WorldClient extends World {
ItemStack itemstack = this.mc.thePlayer.getHeldItem();
boolean flag = this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.CREATIVE
&& itemstack != null && Block.getBlockFromItem(itemstack.getItem()) == Blocks.barrier;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i = 0; i < 1000; ++i) {
int j = parInt1 + this.rand.nextInt(b0) - this.rand.nextInt(b0);
diff --git a/src/game/java/net/minecraft/client/renderer/BlockModelRenderer.java b/src/game/java/net/minecraft/client/renderer/BlockModelRenderer.java
index d7ef196d..17e4d2e4 100755
--- a/src/game/java/net/minecraft/client/renderer/BlockModelRenderer.java
+++ b/src/game/java/net/minecraft/client/renderer/BlockModelRenderer.java
@@ -110,7 +110,7 @@ public class BlockModelRenderer {
float[] afloat = isDeferred ? new float[EnumFacing._VALUES.length * 2] : null;
BitSet bitset = new BitSet(3);
- BlockPos.MutableBlockPos pointer = new BlockPos.MutableBlockPos();
+ BlockPos pointer = new BlockPos();
EnumFacing[] facings = EnumFacing._VALUES;
for (int m = 0; m < facings.length; ++m) {
EnumFacing enumfacing = facings[m];
diff --git a/src/game/java/net/minecraft/client/renderer/EntityRenderer.java b/src/game/java/net/minecraft/client/renderer/EntityRenderer.java
index 28541073..04b40a5a 100755
--- a/src/game/java/net/minecraft/client/renderer/EntityRenderer.java
+++ b/src/game/java/net/minecraft/client/renderer/EntityRenderer.java
@@ -1496,7 +1496,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
float f1 = (float) this.rendererUpdateCount + partialTicks;
worldrenderer.setTranslation(-d0, -d1, -d2);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i1 = k - b0; i1 <= k + b0; ++i1) {
for (int j1 = i - b0; j1 <= i + b0; ++j1) {
diff --git a/src/game/java/net/minecraft/client/renderer/RenderGlobal.java b/src/game/java/net/minecraft/client/renderer/RenderGlobal.java
index e7925b67..90e0a698 100755
--- a/src/game/java/net/minecraft/client/renderer/RenderGlobal.java
+++ b/src/game/java/net/minecraft/client/renderer/RenderGlobal.java
@@ -988,8 +988,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
BlockPos blockpos = new BlockPos(pos.getX() >> 4 << 4, pos.getY() >> 4 << 4, pos.getZ() >> 4 << 4);
Chunk chunk = this.theWorld.getChunkFromBlockCoords(blockpos);
- for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos,
- blockpos.add(15, 15, 15))) {
+ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos.add(15, 15, 15))) {
if (chunk.getBlock(blockpos$mutableblockpos).isOpaqueCube()) {
visgraph.func_178606_a(blockpos$mutableblockpos);
}
diff --git a/src/game/java/net/minecraft/client/renderer/chunk/RenderChunk.java b/src/game/java/net/minecraft/client/renderer/chunk/RenderChunk.java
index 49bf3f50..9bebfeab 100755
--- a/src/game/java/net/minecraft/client/renderer/chunk/RenderChunk.java
+++ b/src/game/java/net/minecraft/client/renderer/chunk/RenderChunk.java
@@ -151,7 +151,7 @@ public class RenderChunk {
boolean[] aboolean = new boolean[EnumWorldBlockLayer._VALUES.length];
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
- for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBox(blockpos, blockpos1)) {
+ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos1)) {
IBlockState iblockstate = regionrendercache.getBlockStateFaster(blockpos$mutableblockpos);
Block block = iblockstate.getBlock();
if (block.isOpaqueCube()) {
diff --git a/src/game/java/net/minecraft/command/CommandCompare.java b/src/game/java/net/minecraft/command/CommandCompare.java
index a5a0b7e7..2245b012 100755
--- a/src/game/java/net/minecraft/command/CommandCompare.java
+++ b/src/game/java/net/minecraft/command/CommandCompare.java
@@ -83,8 +83,8 @@ public class CommandCompare extends CommandBase {
BlockPos blockpos3 = new BlockPos(structureboundingbox1.minX - structureboundingbox.minX,
structureboundingbox1.minY - structureboundingbox.minY,
structureboundingbox1.minZ - structureboundingbox.minZ);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
- BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
+ BlockPos blockpos$mutableblockpos1 = new BlockPos();
for (int j = structureboundingbox.minZ; j <= structureboundingbox.maxZ; ++j) {
for (int k = structureboundingbox.minY; k <= structureboundingbox.maxY; ++k) {
diff --git a/src/game/java/net/minecraft/entity/Entity.java b/src/game/java/net/minecraft/entity/Entity.java
index d8eaccaf..7f425102 100755
--- a/src/game/java/net/minecraft/entity/Entity.java
+++ b/src/game/java/net/minecraft/entity/Entity.java
@@ -1514,8 +1514,7 @@ public abstract class Entity implements ICommandSender {
if (this.noClip) {
return false;
} else {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(Integer.MIN_VALUE,
- Integer.MIN_VALUE, Integer.MIN_VALUE);
+ BlockPos blockpos$mutableblockpos = new BlockPos(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
for (int i = 0; i < 8; ++i) {
int j = MathHelper.floor_double(
diff --git a/src/game/java/net/minecraft/entity/monster/EntityZombie.java b/src/game/java/net/minecraft/entity/monster/EntityZombie.java
index 5ac5f726..b4bf2cff 100755
--- a/src/game/java/net/minecraft/entity/monster/EntityZombie.java
+++ b/src/game/java/net/minecraft/entity/monster/EntityZombie.java
@@ -656,7 +656,7 @@ public class EntityZombie extends EntityMob {
int i = 1;
if (this.rand.nextFloat() < 0.01F) {
int j = 0;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = (int) this.posX - 4; k < (int) this.posX + 4 && j < 14; ++k) {
for (int l = (int) this.posY - 4; l < (int) this.posY + 4 && j < 14; ++l) {
diff --git a/src/game/java/net/minecraft/item/ItemMap.java b/src/game/java/net/minecraft/item/ItemMap.java
index 0d99646a..fa3a7a12 100755
--- a/src/game/java/net/minecraft/item/ItemMap.java
+++ b/src/game/java/net/minecraft/item/ItemMap.java
@@ -126,7 +126,7 @@ public class ItemMap extends ItemMapBase {
d1 = 100.0D;
} else {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i4 = 0; i4 < i; ++i4) {
for (int j4 = 0; j4 < i; ++j4) {
diff --git a/src/game/java/net/minecraft/pathfinding/PathNavigateGround.java b/src/game/java/net/minecraft/pathfinding/PathNavigateGround.java
index 081e67e3..005c9df7 100755
--- a/src/game/java/net/minecraft/pathfinding/PathNavigateGround.java
+++ b/src/game/java/net/minecraft/pathfinding/PathNavigateGround.java
@@ -217,7 +217,7 @@ public class PathNavigateGround extends PathNavigate {
*/
private boolean isPositionClear(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6,
Vec3 parVec3_1, double parDouble1, double parDouble2) {
- for (BlockPos blockpos : BlockPos.getAllInBox(new BlockPos(parInt1, parInt2, parInt3),
+ for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(parInt1, parInt2, parInt3),
new BlockPos(parInt1 + parInt4 - 1, parInt2 + parInt5 - 1, parInt3 + parInt6 - 1))) {
double d0 = (double) blockpos.getX() + 0.5D - parVec3_1.xCoord;
double d1 = (double) blockpos.getZ() + 0.5D - parVec3_1.zCoord;
diff --git a/src/game/java/net/minecraft/stats/StatisticsFile.java b/src/game/java/net/minecraft/stats/StatisticsFile.java
index 9cfa89d8..e5164ffa 100755
--- a/src/game/java/net/minecraft/stats/StatisticsFile.java
+++ b/src/game/java/net/minecraft/stats/StatisticsFile.java
@@ -2,7 +2,6 @@ package net.minecraft.stats;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
diff --git a/src/game/java/net/minecraft/tileentity/TileEntityBeacon.java b/src/game/java/net/minecraft/tileentity/TileEntityBeacon.java
index 2b2d5c52..2dab48a1 100755
--- a/src/game/java/net/minecraft/tileentity/TileEntityBeacon.java
+++ b/src/game/java/net/minecraft/tileentity/TileEntityBeacon.java
@@ -125,7 +125,7 @@ public class TileEntityBeacon extends TileEntityLockable implements ITickable, I
EntitySheep.func_175513_a(EnumDyeColor.WHITE));
this.beamSegments.add(tileentitybeacon$beamsegment);
boolean flag = true;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i1 = k + 1; i1 < 256; ++i1) {
IBlockState iblockstate = this.worldObj.getBlockState(blockpos$mutableblockpos.func_181079_c(j, i1, l));
diff --git a/src/game/java/net/minecraft/util/BlockPos.java b/src/game/java/net/minecraft/util/BlockPos.java
index 5d9dc27c..b3fa7cfc 100755
--- a/src/game/java/net/minecraft/util/BlockPos.java
+++ b/src/game/java/net/minecraft/util/BlockPos.java
@@ -40,6 +40,10 @@ public class BlockPos extends Vec3i {
private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L;
private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L;
+ public BlockPos() {
+ super(0, 0, 0);
+ }
+
public BlockPos(int x, int y, int z) {
super(x, y, z);
}
@@ -65,30 +69,43 @@ public class BlockPos extends Vec3i {
*/
public BlockPos add(double x, double y, double z) {
return x == 0.0D && y == 0.0D && z == 0.0D ? this
- : new BlockPos((double) this.getX() + x, (double) this.getY() + y, (double) this.getZ() + z);
+ : new BlockPos((double) this.x + x, (double) this.y + y, (double) this.z + z);
}
/**+
* Add the given coordinates to the coordinates of this BlockPos
*/
public BlockPos add(int x, int y, int z) {
- return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z);
+ return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.x + x, this.y + y, this.z + z);
+ }
+
+ /**
+ * eagler
+ */
+ /**+
+ * Add the given coordinates to the coordinates of this BlockPos
+ */
+ public BlockPos add(int x, int y, int z, BlockPos dst) {
+ dst.x = this.x + x;
+ dst.y = this.y + y;
+ dst.z = this.z + z;
+ return dst;
}
/**+
* Add the given coordinates to the coordinates of this BlockPos
*/
public BlockPos add(Vec3i vec) {
- return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this
- : new BlockPos(this.getX() + vec.getX(), this.getY() + vec.getY(), this.getZ() + vec.getZ());
+ return vec.x == 0 && vec.y == 0 && vec.z == 0 ? this
+ : new BlockPos(this.x + vec.x, this.y + vec.y, this.z + vec.z);
}
/**+
* Subtract the given Vector from this BlockPos
*/
public BlockPos subtract(Vec3i vec) {
- return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this
- : new BlockPos(this.getX() - vec.getX(), this.getY() - vec.getY(), this.getZ() - vec.getZ());
+ return vec.x == 0 && vec.y == 0 && vec.z == 0 ? this
+ : new BlockPos(this.x - vec.x, this.y - vec.y, this.z - vec.z);
}
/**+
@@ -261,9 +278,9 @@ public class BlockPos extends Vec3i {
}
public BlockPos offsetFaster(EnumFacing facing, BlockPos ret) {
- ret.x = this.getX() + facing.getFrontOffsetX();
- ret.y = this.getY() + facing.getFrontOffsetY();
- ret.z = this.getZ() + facing.getFrontOffsetZ();
+ ret.x = this.x + facing.getFrontOffsetX();
+ ret.y = this.y + facing.getFrontOffsetY();
+ ret.z = this.z + facing.getFrontOffsetZ();
return ret;
}
@@ -290,17 +307,16 @@ public class BlockPos extends Vec3i {
* Calculate the cross product of this and the given Vector
*/
public BlockPos crossProduct(Vec3i vec3i) {
- return new BlockPos(this.getY() * vec3i.getZ() - this.getZ() * vec3i.getY(),
- this.getZ() * vec3i.getX() - this.getX() * vec3i.getZ(),
- this.getX() * vec3i.getY() - this.getY() * vec3i.getX());
+ return new BlockPos(this.y * vec3i.z - this.z * vec3i.y, this.z * vec3i.x - this.x * vec3i.z,
+ this.x * vec3i.y - this.y * vec3i.x);
}
/**+
* Serialize this BlockPos into a long value
*/
public long toLong() {
- return ((long) this.getX() & X_MASK) << X_SHIFT | ((long) this.getY() & Y_MASK) << Y_SHIFT
- | ((long) this.getZ() & Z_MASK) << 0;
+ return ((long) this.x & X_MASK) << X_SHIFT | ((long) this.y & Y_MASK) << Y_SHIFT
+ | ((long) this.z & Z_MASK) << 0;
}
/**+
@@ -319,10 +335,8 @@ public class BlockPos extends Vec3i {
* specified by the given corners
*/
public static Iterable getAllInBox(BlockPos from, BlockPos to) {
- final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()),
- Math.min(from.getZ(), to.getZ()));
- final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()),
- Math.max(from.getZ(), to.getZ()));
+ final BlockPos blockpos = new BlockPos(Math.min(from.x, to.x), Math.min(from.y, to.y), Math.min(from.z, to.z));
+ final BlockPos blockpos1 = new BlockPos(Math.max(from.x, to.x), Math.max(from.y, to.y), Math.max(from.z, to.z));
return new Iterable() {
public Iterator iterator() {
return new AbstractIterator() {
@@ -335,17 +349,17 @@ public class BlockPos extends Vec3i {
} else if (this.lastReturned.equals(blockpos1)) {
return (BlockPos) this.endOfData();
} else {
- int i = this.lastReturned.getX();
- int j = this.lastReturned.getY();
- int k = this.lastReturned.getZ();
- if (i < blockpos1.getX()) {
+ int i = this.lastReturned.x;
+ int j = this.lastReturned.y;
+ int k = this.lastReturned.z;
+ if (i < blockpos1.x) {
++i;
- } else if (j < blockpos1.getY()) {
- i = blockpos.getX();
+ } else if (j < blockpos1.y) {
+ i = blockpos.x;
++j;
- } else if (k < blockpos1.getZ()) {
- i = blockpos.getX();
- j = blockpos.getY();
+ } else if (k < blockpos1.z) {
+ i = blockpos.x;
+ j = blockpos.y;
++k;
}
@@ -363,35 +377,32 @@ public class BlockPos extends Vec3i {
* If this method is used, the resulting BlockPos instances can
* only be used inside the iteration loop.
*/
- public static Iterable getAllInBoxMutable(BlockPos from, BlockPos to) {
- final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()),
- Math.min(from.getZ(), to.getZ()));
- final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()),
- Math.max(from.getZ(), to.getZ()));
- return new Iterable() {
- public Iterator iterator() {
- return new AbstractIterator() {
- private BlockPos.MutableBlockPos theBlockPos = null;
+ public static Iterable getAllInBoxMutable(BlockPos from, BlockPos to) {
+ final BlockPos blockpos = new BlockPos(Math.min(from.x, to.x), Math.min(from.y, to.y), Math.min(from.z, to.z));
+ final BlockPos blockpos1 = new BlockPos(Math.max(from.x, to.x), Math.max(from.y, to.y), Math.max(from.z, to.z));
+ return new Iterable() {
+ public Iterator iterator() {
+ return new AbstractIterator() {
+ private BlockPos theBlockPos = null;
- protected BlockPos.MutableBlockPos computeNext() {
+ protected BlockPos computeNext() {
if (this.theBlockPos == null) {
- this.theBlockPos = new BlockPos.MutableBlockPos(blockpos.getX(), blockpos.getY(),
- blockpos.getZ());
+ this.theBlockPos = new BlockPos(blockpos.x, blockpos.y, blockpos.z);
return this.theBlockPos;
} else if (this.theBlockPos.equals(blockpos1)) {
- return (BlockPos.MutableBlockPos) this.endOfData();
+ return (BlockPos) this.endOfData();
} else {
- int i = this.theBlockPos.getX();
- int j = this.theBlockPos.getY();
- int k = this.theBlockPos.getZ();
- if (i < blockpos1.getX()) {
+ int i = this.theBlockPos.x;
+ int j = this.theBlockPos.y;
+ int k = this.theBlockPos.z;
+ if (i < blockpos1.x) {
++i;
- } else if (j < blockpos1.getY()) {
- i = blockpos.getX();
+ } else if (j < blockpos1.y) {
+ i = blockpos.x;
++j;
- } else if (k < blockpos1.getZ()) {
- i = blockpos.getX();
- j = blockpos.getY();
+ } else if (k < blockpos1.z) {
+ i = blockpos.x;
+ j = blockpos.y;
++k;
}
@@ -406,33 +417,11 @@ public class BlockPos extends Vec3i {
};
}
- public static final class MutableBlockPos extends BlockPos {
-
- public MutableBlockPos() {
- this(0, 0, 0);
- }
-
- public MutableBlockPos(int x_, int y_, int z_) {
- super(x_, y_, z_);
- }
-
- public int getX() {
- return this.x;
- }
-
- public int getY() {
- return this.y;
- }
-
- public int getZ() {
- return this.z;
- }
-
- public BlockPos.MutableBlockPos func_181079_c(int parInt1, int parInt2, int parInt3) {
- this.x = parInt1;
- this.y = parInt2;
- this.z = parInt3;
- return this;
- }
+ public BlockPos func_181079_c(int x, int y, int z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ return this;
}
+
}
\ No newline at end of file
diff --git a/src/game/java/net/minecraft/util/IChatComponent.java b/src/game/java/net/minecraft/util/IChatComponent.java
index 51c952bc..6bfdc531 100755
--- a/src/game/java/net/minecraft/util/IChatComponent.java
+++ b/src/game/java/net/minecraft/util/IChatComponent.java
@@ -233,6 +233,9 @@ public interface IChatComponent extends Iterable {
* So sorry for this implementation
*/
public static String componentToJson(IChatComponent component) {
+ if (component == null) {
+ return "null";
+ }
if ((component instanceof ChatComponentText) && component.getChatStyle().isEmpty()
&& component.getSiblings().isEmpty()) {
String escaped = new JSONObject().put("E", component.getUnformattedTextForChat()).toString();
diff --git a/src/game/java/net/minecraft/world/Teleporter.java b/src/game/java/net/minecraft/world/Teleporter.java
index 890f5f60..6e9b256d 100755
--- a/src/game/java/net/minecraft/world/Teleporter.java
+++ b/src/game/java/net/minecraft/world/Teleporter.java
@@ -203,7 +203,7 @@ public class Teleporter {
int j1 = k;
int k1 = 0;
int l1 = this.random.nextInt(4);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i2 = i - b0; i2 <= i + b0; ++i2) {
double d1 = (double) i2 + 0.5D - parEntity.posX;
diff --git a/src/game/java/net/minecraft/world/World.java b/src/game/java/net/minecraft/world/World.java
index 4f303183..08e53390 100755
--- a/src/game/java/net/minecraft/world/World.java
+++ b/src/game/java/net/minecraft/world/World.java
@@ -524,11 +524,12 @@ public abstract class World implements IBlockAccess {
public int getLight(BlockPos pos, boolean checkNeighbors) {
if (pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000) {
if (checkNeighbors && this.getBlockState(pos).getBlock().getUseNeighborBrightness()) {
- int i1 = this.getLight(pos.up(), false);
- int i = this.getLight(pos.east(), false);
- int j = this.getLight(pos.west(), false);
- int k = this.getLight(pos.south(), false);
- int l = this.getLight(pos.north(), false);
+ BlockPos tmp = new BlockPos(0, 0, 0);
+ int i1 = this.getLight(pos.up(tmp), false);
+ int i = this.getLight(pos.east(tmp), false);
+ int j = this.getLight(pos.west(tmp), false);
+ int k = this.getLight(pos.south(tmp), false);
+ int l = this.getLight(pos.north(tmp), false);
if (i > i1) {
i1 = i;
}
@@ -610,11 +611,12 @@ public abstract class World implements IBlockAccess {
} else if (!this.isBlockLoaded(pos)) {
return type.defaultLightValue;
} else if (this.getBlockState(pos).getBlock().getUseNeighborBrightness()) {
- int i1 = this.getLightFor(type, pos.up());
- int i = this.getLightFor(type, pos.east());
- int j = this.getLightFor(type, pos.west());
- int k = this.getLightFor(type, pos.south());
- int l = this.getLightFor(type, pos.north());
+ BlockPos tmp = new BlockPos();
+ int i1 = this.getLightFor(type, pos.up(tmp));
+ int i = this.getLightFor(type, pos.east(tmp));
+ int j = this.getLightFor(type, pos.west(tmp));
+ int k = this.getLightFor(type, pos.south(tmp));
+ int l = this.getLightFor(type, pos.north(tmp));
if (i > i1) {
i1 = i;
}
@@ -1060,7 +1062,7 @@ public abstract class World implements IBlockAccess {
boolean flag = entityIn.isOutsideBorder();
boolean flag1 = this.isInsideBorder(worldborder, entityIn);
IBlockState iblockstate = Blocks.stone.getDefaultState();
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = i1; l1 < j1; ++l1) {
@@ -1133,7 +1135,7 @@ public abstract class World implements IBlockAccess {
int l = MathHelper.floor_double(bb.maxY + 1.0D);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = i1; l1 < j1; ++l1) {
@@ -1628,7 +1630,7 @@ public abstract class World implements IBlockAccess {
int l = MathHelper.floor_double(bb.maxY);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 <= j; ++k1) {
for (int l1 = k; l1 <= l; ++l1) {
@@ -1655,7 +1657,7 @@ public abstract class World implements IBlockAccess {
int l = MathHelper.floor_double(bb.maxY);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 <= j; ++k1) {
for (int l1 = k; l1 <= l; ++l1) {
@@ -1679,7 +1681,7 @@ public abstract class World implements IBlockAccess {
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);
if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = k; l1 < l; ++l1) {
@@ -1712,7 +1714,7 @@ public abstract class World implements IBlockAccess {
} else {
boolean flag = false;
Vec3 vec3 = new Vec3(0.0D, 0.0D, 0.0D);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = k; l1 < l; ++l1) {
@@ -1755,7 +1757,7 @@ public abstract class World implements IBlockAccess {
int l = MathHelper.floor_double(bb.maxY + 1.0D);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = k; l1 < l; ++l1) {
@@ -1782,7 +1784,7 @@ public abstract class World implements IBlockAccess {
int l = MathHelper.floor_double(bb.maxY + 1.0D);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = k; l1 < l; ++l1) {
@@ -2210,8 +2212,9 @@ public abstract class World implements IBlockAccess {
return true;
}
- boolean flag = this.isWater(pos.west()) && this.isWater(pos.east()) && this.isWater(pos.north())
- && this.isWater(pos.south());
+ BlockPos tmp = new BlockPos();
+ boolean flag = this.isWater(pos.west(tmp)) && this.isWater(pos.east(tmp))
+ && this.isWater(pos.north(tmp)) && this.isWater(pos.south(tmp));
if (!flag) {
return true;
}
@@ -2332,7 +2335,7 @@ public abstract class World implements IBlockAccess {
int k3 = MathHelper.abs_int(j2 - j1);
int l3 = MathHelper.abs_int(k2 - k1);
if (j3 + k3 + l3 < 17) {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
EnumFacing[] facings = EnumFacing._VALUES;
for (int m = 0; m < facings.length; ++m) {
@@ -2363,6 +2366,7 @@ public abstract class World implements IBlockAccess {
int k5 = (i5 >> 6 & 63) - 32 + j1;
int l5 = (i5 >> 12 & 63) - 32 + k1;
BlockPos blockpos1 = new BlockPos(j5, k5, l5);
+ BlockPos tmp = new BlockPos(0, 0, 0);
int i6 = this.getLightFor(lightType, blockpos1);
int j6 = this.getRawLight(blockpos1, lightType);
if (j6 != i6) {
@@ -2373,32 +2377,32 @@ public abstract class World implements IBlockAccess {
int i7 = Math.abs(l5 - k1);
boolean flag = j < this.lightUpdateBlockList.length - 6;
if (k6 + l6 + i7 < 17 && flag) {
- if (this.getLightFor(lightType, blockpos1.west()) < j6) {
+ if (this.getLightFor(lightType, blockpos1.west(tmp)) < j6) {
this.lightUpdateBlockList[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6)
+ (l5 - k1 + 32 << 12);
}
- if (this.getLightFor(lightType, blockpos1.east()) < j6) {
+ if (this.getLightFor(lightType, blockpos1.east(tmp)) < j6) {
this.lightUpdateBlockList[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6)
+ (l5 - k1 + 32 << 12);
}
- if (this.getLightFor(lightType, blockpos1.down()) < j6) {
+ if (this.getLightFor(lightType, blockpos1.down(tmp)) < j6) {
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6)
+ (l5 - k1 + 32 << 12);
}
- if (this.getLightFor(lightType, blockpos1.up()) < j6) {
+ if (this.getLightFor(lightType, blockpos1.up(tmp)) < j6) {
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6)
+ (l5 - k1 + 32 << 12);
}
- if (this.getLightFor(lightType, blockpos1.north()) < j6) {
+ if (this.getLightFor(lightType, blockpos1.north(tmp)) < j6) {
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6)
+ (l5 - 1 - k1 + 32 << 12);
}
- if (this.getLightFor(lightType, blockpos1.south()) < j6) {
+ if (this.getLightFor(lightType, blockpos1.south(tmp)) < j6) {
this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6)
+ (l5 + 1 - k1 + 32 << 12);
}
@@ -2617,27 +2621,28 @@ public abstract class World implements IBlockAccess {
*/
public int getStrongPower(BlockPos pos) {
int i = 0;
- i = Math.max(i, this.getStrongPower(pos.down(), EnumFacing.DOWN));
+ BlockPos tmp = new BlockPos();
+ i = Math.max(i, this.getStrongPower(pos.down(tmp), EnumFacing.DOWN));
if (i >= 15) {
return i;
} else {
- i = Math.max(i, this.getStrongPower(pos.up(), EnumFacing.UP));
+ i = Math.max(i, this.getStrongPower(pos.up(tmp), EnumFacing.UP));
if (i >= 15) {
return i;
} else {
- i = Math.max(i, this.getStrongPower(pos.north(), EnumFacing.NORTH));
+ i = Math.max(i, this.getStrongPower(pos.north(tmp), EnumFacing.NORTH));
if (i >= 15) {
return i;
} else {
- i = Math.max(i, this.getStrongPower(pos.south(), EnumFacing.SOUTH));
+ i = Math.max(i, this.getStrongPower(pos.south(tmp), EnumFacing.SOUTH));
if (i >= 15) {
return i;
} else {
- i = Math.max(i, this.getStrongPower(pos.west(), EnumFacing.WEST));
+ i = Math.max(i, this.getStrongPower(pos.west(tmp), EnumFacing.WEST));
if (i >= 15) {
return i;
} else {
- i = Math.max(i, this.getStrongPower(pos.east(), EnumFacing.EAST));
+ i = Math.max(i, this.getStrongPower(pos.east(tmp), EnumFacing.EAST));
return i >= 15 ? i : i;
}
}
@@ -2657,12 +2662,13 @@ public abstract class World implements IBlockAccess {
}
public boolean isBlockPowered(BlockPos pos) {
- return this.getRedstonePower(pos.down(), EnumFacing.DOWN) > 0 ? true
- : (this.getRedstonePower(pos.up(), EnumFacing.UP) > 0 ? true
- : (this.getRedstonePower(pos.north(), EnumFacing.NORTH) > 0 ? true
- : (this.getRedstonePower(pos.south(), EnumFacing.SOUTH) > 0 ? true
- : (this.getRedstonePower(pos.west(), EnumFacing.WEST) > 0 ? true
- : this.getRedstonePower(pos.east(), EnumFacing.EAST) > 0))));
+ BlockPos tmp = new BlockPos(0, 0, 0);
+ return this.getRedstonePower(pos.down(tmp), EnumFacing.DOWN) > 0 ? true
+ : (this.getRedstonePower(pos.up(tmp), EnumFacing.UP) > 0 ? true
+ : (this.getRedstonePower(pos.north(tmp), EnumFacing.NORTH) > 0 ? true
+ : (this.getRedstonePower(pos.south(tmp), EnumFacing.SOUTH) > 0 ? true
+ : (this.getRedstonePower(pos.west(tmp), EnumFacing.WEST) > 0 ? true
+ : this.getRedstonePower(pos.east(tmp), EnumFacing.EAST) > 0))));
}
/**+
diff --git a/src/game/java/net/minecraft/world/biome/BiomeColorHelper.java b/src/game/java/net/minecraft/world/biome/BiomeColorHelper.java
index e81b8f06..98f3da1e 100755
--- a/src/game/java/net/minecraft/world/biome/BiomeColorHelper.java
+++ b/src/game/java/net/minecraft/world/biome/BiomeColorHelper.java
@@ -46,7 +46,7 @@ public class BiomeColorHelper {
int j = 0;
int k = 0;
- for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(parBlockPos.add(-1, 0, -1),
+ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(parBlockPos.add(-1, 0, -1),
parBlockPos.add(1, 0, 1))) {
int l = parColorResolver.getColorAtPos(parIBlockAccess.getBiomeGenForCoords(blockpos$mutableblockpos),
blockpos$mutableblockpos);
diff --git a/src/game/java/net/minecraft/world/biome/BiomeGenBase.java b/src/game/java/net/minecraft/world/biome/BiomeGenBase.java
index 89006dbd..833a9aee 100755
--- a/src/game/java/net/minecraft/world/biome/BiomeGenBase.java
+++ b/src/game/java/net/minecraft/world/biome/BiomeGenBase.java
@@ -406,7 +406,7 @@ public abstract class BiomeGenBase {
int k = (int) (parDouble1 / 3.0D + 3.0D + rand.nextDouble() * 0.25D);
int l = parInt1 & 15;
int i1 = parInt2 & 15;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int j1 = 255; j1 >= 0; --j1) {
if (j1 <= rand.nextInt(5)) {
diff --git a/src/game/java/net/minecraft/world/chunk/Chunk.java b/src/game/java/net/minecraft/world/chunk/Chunk.java
index 1368f130..a415090c 100755
--- a/src/game/java/net/minecraft/world/chunk/Chunk.java
+++ b/src/game/java/net/minecraft/world/chunk/Chunk.java
@@ -1290,8 +1290,7 @@ public class Chunk {
int i = this.getTopFilledSegment();
boolean flag = false;
boolean flag1 = false;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos((this.xPosition << 4) + x, 0,
- (this.zPosition << 4) + z);
+ BlockPos blockpos$mutableblockpos = new BlockPos((this.xPosition << 4) + x, 0, (this.zPosition << 4) + z);
for (int j = i + 16 - 1; j > this.worldObj.func_181545_F() || j > 0 && !flag1; --j) {
blockpos$mutableblockpos.func_181079_c(blockpos$mutableblockpos.getX(), j, blockpos$mutableblockpos.getZ());
diff --git a/src/game/java/net/minecraft/world/chunk/storage/ChunkLoader.java b/src/game/java/net/minecraft/world/chunk/storage/ChunkLoader.java
index 138a3ff7..c0425e64 100755
--- a/src/game/java/net/minecraft/world/chunk/storage/ChunkLoader.java
+++ b/src/game/java/net/minecraft/world/chunk/storage/ChunkLoader.java
@@ -113,7 +113,7 @@ public class ChunkLoader {
parNBTTagCompound.setTag("Sections", nbttaglist);
byte[] abyte = new byte[256];
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int j2 = 0; j2 < 16; ++j2) {
for (int k2 = 0; k2 < 16; ++k2) {
diff --git a/src/game/java/net/minecraft/world/gen/MapGenCaves.java b/src/game/java/net/minecraft/world/gen/MapGenCaves.java
index 6225e7a9..ca518b16 100755
--- a/src/game/java/net/minecraft/world/gen/MapGenCaves.java
+++ b/src/game/java/net/minecraft/world/gen/MapGenCaves.java
@@ -157,7 +157,7 @@ public class MapGenCaves extends MapGenBase {
}
if (!flag3) {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int j3 = k2; j3 < k; ++j3) {
double d10 = ((double) (j3 + parInt1 * 16) + 0.5D - parDouble1) / d2;
diff --git a/src/game/java/net/minecraft/world/gen/MapGenRavine.java b/src/game/java/net/minecraft/world/gen/MapGenRavine.java
index 13818b12..734a3e0d 100755
--- a/src/game/java/net/minecraft/world/gen/MapGenRavine.java
+++ b/src/game/java/net/minecraft/world/gen/MapGenRavine.java
@@ -144,7 +144,7 @@ public class MapGenRavine extends MapGenBase {
}
if (!flag2) {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int j3 = k2; j3 < k; ++j3) {
double d10 = ((double) (j3 + parInt1 * 16) + 0.5D - parDouble1) / d9;
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
index e5f314d4..d273980d 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
@@ -54,7 +54,7 @@ public class WorldGenBigMushroom extends WorldGenerator {
b0 = 0;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) {
for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenBigTree.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenBigTree.java
index 66a3ea00..45ab3c4b 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenBigTree.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenBigTree.java
@@ -205,7 +205,7 @@ public class WorldGenBigTree extends WorldGenAbstractTree {
*/
void generateLeaves() {
for (int i = 0, l = this.field_175948_j.size(); i < l; ++i) {
- this.generateLeafNode(this.field_175948_j.get(i));
+ this.generateLeafNode(this.field_175948_j.get(i).blockPos);
}
}
@@ -245,9 +245,9 @@ public class WorldGenBigTree extends WorldGenAbstractTree {
WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates = this.field_175948_j.get(j);
int i = worldgenbigtree$foliagecoordinates.func_177999_q();
BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ());
- if (!blockpos.equals(worldgenbigtree$foliagecoordinates)
+ if (!blockpos.equals(worldgenbigtree$foliagecoordinates.blockPos)
&& this.leafNodeNeedsBase(i - this.basePos.getY())) {
- this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates, Blocks.log);
+ this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates.blockPos, Blocks.log);
}
}
@@ -325,12 +325,13 @@ public class WorldGenBigTree extends WorldGenAbstractTree {
}
}
- static class FoliageCoordinates extends BlockPos {
+ static class FoliageCoordinates {
private final int field_178000_b;
+ private final BlockPos blockPos;
public FoliageCoordinates(BlockPos parBlockPos, int parInt1) {
- super(parBlockPos.getX(), parBlockPos.getY(), parBlockPos.getZ());
this.field_178000_b = parInt1;
+ this.blockPos = parBlockPos;
}
public int func_177999_q() {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java
index 660b57c3..7ba4d736 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java
@@ -62,7 +62,8 @@ public class WorldGenBlockBlob extends WorldGenerator {
int l = i1 + random.nextInt(2);
float f = (float) (j + k + l) * 0.333F + 0.5F;
- for (BlockPos blockpos1 : BlockPos.getAllInBox(blockpos.add(-j, -k, -l), blockpos.add(j, k, l))) {
+ for (BlockPos blockpos1 : BlockPos.getAllInBoxMutable(blockpos.add(-j, -k, -l),
+ blockpos.add(j, k, l))) {
if (blockpos1.distanceSq(blockpos) <= (double) (f * f)) {
world.setBlockState(blockpos1, this.field_150545_a.getDefaultState(), 4);
}
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java
index fda7c3fa..c513608b 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java
@@ -156,7 +156,7 @@ public class WorldGenCanopyTree extends WorldGenAbstractTree {
int i = parBlockPos.getX();
int j = parBlockPos.getY();
int k = parBlockPos.getZ();
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int l = 0; l <= parInt1 + 1; ++l) {
byte b0 = 1;
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenForest.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenForest.java
index 87649433..0723d7d2 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenForest.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenForest.java
@@ -62,7 +62,7 @@ public class WorldGenForest extends WorldGenAbstractTree {
b0 = 2;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) {
for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java
index 6882fd06..492087bf 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java
@@ -58,7 +58,7 @@ public class WorldGenSavannaTree extends WorldGenAbstractTree {
b0 = 2;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) {
for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenSpikes.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenSpikes.java
index 4b14dd95..77aeacde 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenSpikes.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenSpikes.java
@@ -38,7 +38,7 @@ public class WorldGenSpikes extends WorldGenerator {
if (world.isAirBlock(blockpos) && world.getBlockState(blockpos.down()).getBlock() == this.baseBlockRequired) {
int i = random.nextInt(32) + 6;
int j = random.nextInt(4) + 1;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = blockpos.getX() - j; k <= blockpos.getX() + j; ++k) {
for (int l = blockpos.getZ() - j; l <= blockpos.getZ() + j; ++l) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenSwamp.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenSwamp.java
index 4a2657ac..c1d56e1c 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenSwamp.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenSwamp.java
@@ -63,7 +63,7 @@ public class WorldGenSwamp extends WorldGenAbstractTree {
b0 = 3;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) {
for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) {
@@ -121,7 +121,7 @@ public class WorldGenSwamp extends WorldGenAbstractTree {
for (int i2 = blockpos.getY() - 3 + i; i2 <= blockpos.getY() + i; ++i2) {
int k2 = i2 - (blockpos.getY() + i);
int i3 = 2 - k2 / 2;
- BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos1 = new BlockPos();
for (int l3 = blockpos.getX() - i3; l3 <= blockpos.getX() + i3; ++l3) {
for (int i4 = blockpos.getZ() - i3; i4 <= blockpos.getZ() + i3; ++i4) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java
index cfac51e0..64d37a14 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java
@@ -58,7 +58,7 @@ public class WorldGenTaiga1 extends WorldGenAbstractTree {
j1 = l;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = blockpos.getX() - j1; k1 <= blockpos.getX() + j1 && flag; ++k1) {
for (int l1 = blockpos.getZ() - j1; l1 <= blockpos.getZ() + j1 && flag; ++l1) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java
index cb486244..c8aaabe0 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java
@@ -58,7 +58,7 @@ public class WorldGenTaiga2 extends WorldGenAbstractTree {
j1 = l;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = blockpos.getX() - j1; k1 <= blockpos.getX() + j1 && flag; ++k1) {
for (int l1 = blockpos.getZ() - j1; l1 <= blockpos.getZ() + j1 && flag; ++l1) {
diff --git a/src/game/java/net/minecraft/world/gen/feature/WorldGenTrees.java b/src/game/java/net/minecraft/world/gen/feature/WorldGenTrees.java
index 2a17b219..859d696d 100755
--- a/src/game/java/net/minecraft/world/gen/feature/WorldGenTrees.java
+++ b/src/game/java/net/minecraft/world/gen/feature/WorldGenTrees.java
@@ -74,7 +74,7 @@ public class WorldGenTrees extends WorldGenAbstractTree {
b0 = 2;
}
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) {
for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) {
@@ -150,7 +150,7 @@ public class WorldGenTrees extends WorldGenAbstractTree {
for (int l2 = blockpos.getY() - 3 + i; l2 <= blockpos.getY() + i; ++l2) {
int k3 = l2 - (blockpos.getY() + i);
int l3 = 2 - k3 / 2;
- BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos1 = new BlockPos();
for (int i4 = blockpos.getX() - l3; i4 <= blockpos.getX() + l3; ++i4) {
for (int j4 = blockpos.getZ() - l3; j4 <= blockpos.getZ() + l3; ++j4) {
diff --git a/src/game/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java b/src/game/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java
index 5eae9a00..16be0f68 100755
--- a/src/game/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java
+++ b/src/game/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java
@@ -510,7 +510,7 @@ public class ComponentScatteredFeaturePieces {
} else {
int i = 0;
int j = 0;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) {
for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) {
diff --git a/src/game/java/net/minecraft/world/gen/structure/StructureComponent.java b/src/game/java/net/minecraft/world/gen/structure/StructureComponent.java
index 0a525e82..325d5030 100755
--- a/src/game/java/net/minecraft/world/gen/structure/StructureComponent.java
+++ b/src/game/java/net/minecraft/world/gen/structure/StructureComponent.java
@@ -139,7 +139,7 @@ public abstract class StructureComponent {
int l = Math.min(this.boundingBox.maxX + 1, boundingboxIn.maxX);
int i1 = Math.min(this.boundingBox.maxY + 1, boundingboxIn.maxY);
int j1 = Math.min(this.boundingBox.maxZ + 1, boundingboxIn.maxZ);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = k; l1 <= j1; ++l1) {
diff --git a/src/game/java/net/minecraft/world/gen/structure/StructureVillagePieces.java b/src/game/java/net/minecraft/world/gen/structure/StructureVillagePieces.java
index a81dec41..cdce5674 100755
--- a/src/game/java/net/minecraft/world/gen/structure/StructureVillagePieces.java
+++ b/src/game/java/net/minecraft/world/gen/structure/StructureVillagePieces.java
@@ -1749,7 +1749,7 @@ public class StructureVillagePieces {
protected int getAverageGroundLevel(World worldIn, StructureBoundingBox parStructureBoundingBox) {
int i = 0;
int j = 0;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) {
for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) {
diff --git a/src/game/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java b/src/game/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java
index a2558049..913f9c77 100755
--- a/src/game/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java
+++ b/src/game/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java
@@ -89,7 +89,7 @@ public class SwimNodeProcessor extends NodeProcessor {
}
private int func_176186_b(Entity entityIn, int x, int y, int z) {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i = x; i < x + this.entitySizeX; ++i) {
for (int j = y; j < y + this.entitySizeY; ++j) {
diff --git a/src/game/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java b/src/game/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java
index 86812647..d8844366 100755
--- a/src/game/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java
+++ b/src/game/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java
@@ -66,8 +66,8 @@ public class WalkNodeProcessor extends NodeProcessor {
int i;
if (this.canSwim && entity.isInWater()) {
i = (int) entity.getEntityBoundingBox().minY;
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(
- MathHelper.floor_double(entity.posX), i, MathHelper.floor_double(entity.posZ));
+ BlockPos blockpos$mutableblockpos = new BlockPos(MathHelper.floor_double(entity.posX), i,
+ MathHelper.floor_double(entity.posZ));
for (Block block = this.blockaccess.getBlockState(blockpos$mutableblockpos)
.getBlock(); block == Blocks.flowing_water
@@ -194,7 +194,7 @@ public class WalkNodeProcessor extends NodeProcessor {
int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors) {
boolean flag = false;
BlockPos blockpos = new BlockPos(entityIn);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
+ BlockPos blockpos$mutableblockpos = new BlockPos();
for (int i = x; i < x + sizeX; ++i) {
for (int j = y; j < y + sizeY; ++j) {
diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
index da69e7a7..51326a98 100755
--- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
+++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
@@ -53,18 +53,23 @@ public class PlatformAudio {
@Override
public void pause(boolean setPaused) {
if(setPaused) {
- if(sndSystem.playing(sourceName)) {
+ if(!paused) {
sndSystem.pause(sourceName);
+ paused = true;
}
- paused = true;
}else {
- if(!sndSystem.playing(sourceName)) {
+ if(paused) {
sndSystem.play(sourceName);
+ paused = false;
}
- paused = false;
}
}
+ @Override
+ public void repeat(boolean en) {
+ sndSystem.setLooping(sourceName, en);
+ }
+
@Override
public void restart() {
this.stall = PlatformRuntime.steadyTimeMillis();
@@ -172,7 +177,7 @@ public class PlatformAudio {
private static int sourceCounter = 0;
public static IAudioHandle beginPlayback(IAudioResource track, float x, float y, float z,
- float volume, float pitch) {
+ float volume, float pitch, boolean repeat) {
if(sndSystem == null) {
return null;
}
@@ -188,12 +193,13 @@ public class PlatformAudio {
sndSystem.setTemporary(srcName, true);
sndSystem.setPitch(srcName, pitch);
sndSystem.setVolume(srcName, volume);
+ sndSystem.setLooping(srcName, repeat);
sndSystem.play(srcName);
return new PaulscodeAudioHandle(srcName);
}
- public static IAudioHandle beginPlaybackStatic(IAudioResource track, float volume, float pitch) {
+ public static IAudioHandle beginPlaybackStatic(IAudioResource track, float volume, float pitch, boolean repeat) {
if(sndSystem == null) {
return null;
}
@@ -204,6 +210,7 @@ public class PlatformAudio {
sndSystem.setTemporary(srcName, true);
sndSystem.setPitch(srcName, pitch);
sndSystem.setVolume(srcName, volume);
+ sndSystem.setLooping(srcName, repeat);
sndSystem.play(srcName);
return new PaulscodeAudioHandle(srcName);
diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
index f5a3a8a1..4cd715cf 100755
--- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
+++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
@@ -567,7 +567,11 @@ public class PlatformRuntime {
public static InputStream newGZIPInputStream(InputStream is) throws IOException {
return new GZIPInputStream(is);
}
-
+
+ public static void downloadRemoteURIByteArray(String assetPackageURI, boolean forceCache, final Consumer cb) {
+ downloadRemoteURIByteArray(assetPackageURI, cb);
+ }
+
public static void downloadRemoteURIByteArray(String assetPackageURI, final Consumer cb) {
logger.info("Downloading: {}");
try(InputStream is = (new URL(assetPackageURI)).openStream()) {
diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
index 4da3bfff..bb3da1ae 100755
--- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
+++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
@@ -1,7 +1,6 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
-import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelPeerState;
import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelReadyState;
/**
@@ -89,28 +88,8 @@ public class PlatformVoiceClient {
}
- public static EnumVoiceChannelPeerState getPeerState() {
- return EnumVoiceChannelPeerState.LOADING;
- }
-
public static EnumVoiceChannelReadyState getReadyState() {
return EnumVoiceChannelReadyState.NONE;
}
- public static EnumVoiceChannelPeerState getPeerStateConnect() {
- return EnumVoiceChannelPeerState.LOADING;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateInitial() {
- return EnumVoiceChannelPeerState.LOADING;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateDesc() {
- return EnumVoiceChannelPeerState.LOADING;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateIce() {
- return EnumVoiceChannelPeerState.LOADING;
- }
-
}
diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
index cadc5296..85fbb210 100755
--- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
+++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
@@ -5,18 +5,8 @@ import dev.onvoid.webrtc.internal.NativeLoader;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
+import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer;
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANPeerEvent;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayLoggerImpl;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQuery;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQueryImpl;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQueryRateLimitDummy;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerRateLimitTracker;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocketImpl;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocketRateLimitDummy;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQuery;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQueryImpl;
-import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQueryRateLimitDummy;
import org.apache.commons.lang3.SystemUtils;
import org.json.JSONArray;
@@ -50,11 +40,8 @@ public class PlatformWebRTC {
private static final Logger logger = LogManager.getLogger("PlatformWebRTC");
- private static final RelayLoggerImpl loggerImpl = new RelayLoggerImpl(LogManager.getLogger("RelayPacket"));
-
private static final Object lock1 = new Object();
private static final Object lock2 = new Object();
- private static final Object lock3 = new Object();
private static final List scheduledRunnables = new LinkedList<>();
@@ -93,8 +80,6 @@ public class PlatformWebRTC {
return supported;
}
- private static final Map fuckTeaVM = new HashMap<>();
-
private static final Comparator sortTasks = (r1, r2) -> {
return (int)(r1.runAt - r2.runAt);
};
@@ -177,9 +162,17 @@ public class PlatformWebRTC {
synchronized (lock1) {
if (iceCandidate.sdp != null && !iceCandidate.sdp.isEmpty()) {
if (iceCandidates.isEmpty()) {
- scheduleTask(3000l, () -> {
+ final int[] candidateState = new int[2];
+ final Runnable[] runnable = new Runnable[1];
+ scheduleTask(2000l, runnable[0] = () -> {
synchronized (lock1) {
if (peerConnection != null && peerConnection.getConnectionState() != RTCPeerConnectionState.DISCONNECTED) {
+ int trial = ++candidateState[1];
+ if(candidateState[0] != iceCandidates.size() && trial < 3) {
+ candidateState[0] = iceCandidates.size();
+ scheduleTask(2000l, runnable[0]);
+ return;
+ }
clientICECandidate = JSONWriter.valueToString(iceCandidates);
iceCandidates.clear();
}
@@ -382,6 +375,8 @@ public class PlatformWebRTC {
public LANServer client;
public String peerId;
public RTCPeerConnection peerConnection;
+ public RTCDataChannel dataChannel;
+ public String ipcChannel;
public LANPeer(LANServer client, String peerId, RTCPeerConnection peerConnection) {
this.client = client;
@@ -390,10 +385,9 @@ public class PlatformWebRTC {
}
public void disconnect() {
- synchronized (fuckTeaVM) {
- if (fuckTeaVM.get(peerId) != null) {
- fuckTeaVM.remove(peerId).close();
- }
+ if(dataChannel != null) {
+ dataChannel.close();
+ dataChannel = null;
}
peerConnection.close();
peerConnection = null;
@@ -472,16 +466,36 @@ public class PlatformWebRTC {
client.signalRemoteDisconnect(peerId);
}
}
+
+ public void mapIPC(String ipcChannel) {
+ if(this.ipcChannel == null) {
+ if(ipcChannel != null) {
+ this.ipcChannel = ipcChannel;
+ synchronized(this.client.ipcMapList) {
+ this.client.ipcMapList.put(ipcChannel, this);
+ }
+ }
+ }else {
+ if(ipcChannel == null) {
+ synchronized(this.client.ipcMapList) {
+ this.client.ipcMapList.remove(this.ipcChannel);
+ }
+ this.ipcChannel = null;
+ }
+ }
+ }
}
public static class LANServer {
public Set