diff --git a/README.md b/README.md
index e73d4b2..fe4d57b 100644
--- a/README.md
+++ b/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/client_version b/client_version
index dc93039..8ccb0b3 100644
--- a/client_version
+++ b/client_version
@@ -1 +1 @@
-u41
\ No newline at end of file
+u42
\ No newline at end of file
diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.edit.java b/patches/minecraft/net/minecraft/block/BlockFarmland.edit.java
index a8b4a09..80c8da2 100644
--- a/patches/minecraft/net/minecraft/block/BlockFarmland.edit.java
+++ b/patches/minecraft/net/minecraft/block/BlockFarmland.edit.java
@@ -14,7 +14,11 @@
~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) {
-> CHANGE 66 : 67 @ 66 : 67
+> CHANGE 33 : 34 @ 33 : 35
+
+~ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(pos.add(-4, 0, -4), pos.add(4, 1, 4))) {
+
+> CHANGE 31 : 32 @ 31 : 32
~ public Item getItemDropped(IBlockState var1, EaglercraftRandom random, int i) {
diff --git a/patches/minecraft/net/minecraft/block/BlockGrass.edit.java b/patches/minecraft/net/minecraft/block/BlockGrass.edit.java
index 2e1ccf7..9d9f4eb 100644
--- a/patches/minecraft/net/minecraft/block/BlockGrass.edit.java
+++ b/patches/minecraft/net/minecraft/block/BlockGrass.edit.java
@@ -14,7 +14,28 @@
~ public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) {
-> DELETE 18 @ 18 : 19
+> CHANGE 1 : 4 @ 1 : 3
+
+~ BlockPos tmp = new BlockPos();
+~ if (world.getLightFromNeighbors(blockpos.up(tmp)) < 4
+~ && world.getBlockState(blockpos.up(tmp)).getBlock().getLightOpacity() > 2) {
+
+> CHANGE 2 : 4 @ 2 : 3
+
+~ if (world.getLightFromNeighbors(blockpos.up(tmp)) >= 9) {
+~ BlockPos tmp2 = new BlockPos();
+
+> CHANGE 2 : 4 @ 2 : 4
+
+~ random.nextInt(3) - 1, tmp2);
+~ Block block = world.getBlockState(blockpos1.up(tmp)).getBlock();
+
+> CHANGE 3 : 5 @ 3 : 4
+
+~ && world.getLightFromNeighbors(blockpos1.up(tmp)) >= 4
+~ && block.getLightOpacity() <= 2) {
+
+> DELETE 4 @ 4 : 5
> CHANGE 4 : 5 @ 4 : 5
diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.edit.java b/patches/minecraft/net/minecraft/block/BlockLeaves.edit.java
index 70bee8d..93793f8 100644
--- a/patches/minecraft/net/minecraft/block/BlockLeaves.edit.java
+++ b/patches/minecraft/net/minecraft/block/BlockLeaves.edit.java
@@ -14,7 +14,11 @@
~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) {
-> DELETE 79 @ 79 : 80
+> CHANGE 16 : 17 @ 16 : 17
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> DELETE 62 @ 62 : 63
> CHANGE 3 : 4 @ 3 : 4
diff --git a/patches/minecraft/net/minecraft/block/BlockVine.edit.java b/patches/minecraft/net/minecraft/block/BlockVine.edit.java
index deaf20d..5259037 100644
--- a/patches/minecraft/net/minecraft/block/BlockVine.edit.java
+++ b/patches/minecraft/net/minecraft/block/BlockVine.edit.java
@@ -26,11 +26,15 @@
~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) {
-> INSERT 22 : 23 @ 22
+> INSERT 6 : 7 @ 6
+ BlockPos tmp = new BlockPos(0, 0, 0);
-> CHANGE 4 : 9 @ 4 : 7
+> CHANGE 3 : 4 @ 3 : 4
+
+~ if (world.getBlockState(blockpos.add(j, l, k, tmp)).getBlock() == this) {
+
+> CHANGE 16 : 21 @ 16 : 19
~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
~ for (int j = 0; j < facings.length; ++j) {
@@ -38,7 +42,11 @@
~ if (random.nextBoolean() || !this.canPlaceOn(
~ world.getBlockState(blockpos2.offsetEvenFaster(enumfacing3, tmp)).getBlock())) {
-> CHANGE 33 : 35 @ 33 : 35
+> CHANGE 16 : 17 @ 16 : 17
+
+~ BlockPos blockpos4 = blockpos.offsetEvenFaster(enumfacing1, blockpos2);
+
+> CHANGE 16 : 18 @ 16 : 18
~ } else if (flag1 && world.isAirBlock(blockpos5) && this.canPlaceOn(
~ world.getBlockState(blockpos.offsetEvenFaster(enumfacing2, tmp)).getBlock())) {
@@ -48,7 +56,15 @@
~ } else if (flag2 && world.isAirBlock(blockpos1) && this.canPlaceOn(
~ world.getBlockState(blockpos.offsetEvenFaster(enumfacing4, tmp)).getBlock())) {
-> INSERT 16 : 17 @ 16
+> CHANGE 2 : 3 @ 2 : 3
+
+~ } else if (this.canPlaceOn(world.getBlockState(blockpos4.up(tmp)).getBlock())) {
+
+> CHANGE 10 : 11 @ 10 : 11
+
+~ BlockPos blockpos3 = blockpos.down(blockpos2);
+
+> INSERT 2 : 3 @ 2
+ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
diff --git a/patches/minecraft/net/minecraft/client/Minecraft.edit.java b/patches/minecraft/net/minecraft/client/Minecraft.edit.java
index 976a5e1..7df27e1 100644
--- a/patches/minecraft/net/minecraft/client/Minecraft.edit.java
+++ b/patches/minecraft/net/minecraft/client/Minecraft.edit.java
@@ -713,7 +713,7 @@
+ currentScreen != null ? currentScreen.getClass().getName() : null, scaledResolution.getScaledWidth(),
+ scaledResolution.getScaledHeight(), displayWidth, displayHeight, scaledResolution.getScaleFactor());
-> CHANGE 11 : 50 @ 11 : 12
+> CHANGE 11 : 55 @ 11 : 12
~ RateLimitTracker.tick();
~
@@ -728,6 +728,11 @@
~
~ if (wasPaused != isGamePaused) {
~ SingleplayerServerController.setPaused(this.isGamePaused);
+~ if (isGamePaused) {
+~ mcSoundHandler.pauseSounds();
+~ } else {
+~ mcSoundHandler.resumeSounds();
+~ }
~ wasPaused = isGamePaused;
~ }
~
diff --git a/patches/minecraft/net/minecraft/client/audio/GuardianSound.edit.java b/patches/minecraft/net/minecraft/client/audio/GuardianSound.edit.java
index 8b7360a..32d8833 100644
--- a/patches/minecraft/net/minecraft/client/audio/GuardianSound.edit.java
+++ b/patches/minecraft/net/minecraft/client/audio/GuardianSound.edit.java
@@ -7,4 +7,6 @@
> DELETE 2 @ 2 : 4
+> DELETE 11 @ 11 : 12
+
> EOF
diff --git a/patches/minecraft/net/minecraft/client/audio/ISound.edit.java b/patches/minecraft/net/minecraft/client/audio/ISound.edit.java
new file mode 100644
index 0000000..37072b7
--- /dev/null
+++ b/patches/minecraft/net/minecraft/client/audio/ISound.edit.java
@@ -0,0 +1,10 @@
+
+# Eagler Context Redacted Diff
+# Copyright (c) 2024 lax1dude. All rights reserved.
+
+# Version: 1.0
+# Author: lax1dude
+
+> DELETE 9 @ 9 : 11
+
+> EOF
diff --git a/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecart.edit.java b/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecart.edit.java
index ad2d1ab..6b39a63 100644
--- a/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecart.edit.java
+++ b/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecart.edit.java
@@ -7,4 +7,8 @@
> DELETE 2 @ 2 : 3
+> DELETE 12 @ 12 : 13
+
+> DELETE 18 @ 18 : 19
+
> EOF
diff --git a/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecartRiding.edit.java b/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecartRiding.edit.java
index 8b7360a..323c5a8 100644
--- a/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecartRiding.edit.java
+++ b/patches/minecraft/net/minecraft/client/audio/MovingSoundMinecartRiding.edit.java
@@ -7,4 +7,6 @@
> DELETE 2 @ 2 : 4
+> DELETE 15 @ 15 : 16
+
> EOF
diff --git a/patches/minecraft/net/minecraft/client/audio/PositionedSound.edit.java b/patches/minecraft/net/minecraft/client/audio/PositionedSound.edit.java
index ad2d1ab..f486f12 100644
--- a/patches/minecraft/net/minecraft/client/audio/PositionedSound.edit.java
+++ b/patches/minecraft/net/minecraft/client/audio/PositionedSound.edit.java
@@ -7,4 +7,8 @@
> DELETE 2 @ 2 : 3
+> DELETE 10 @ 10 : 11
+
+> DELETE 14 @ 14 : 18
+
> EOF
diff --git a/patches/minecraft/net/minecraft/client/audio/PositionedSoundRecord.edit.java b/patches/minecraft/net/minecraft/client/audio/PositionedSoundRecord.edit.java
index 8b7360a..a00ab40 100644
--- a/patches/minecraft/net/minecraft/client/audio/PositionedSoundRecord.edit.java
+++ b/patches/minecraft/net/minecraft/client/audio/PositionedSoundRecord.edit.java
@@ -7,4 +7,26 @@
> DELETE 2 @ 2 : 4
+> CHANGE 4 : 5 @ 4 : 5
+
+~ return new PositionedSoundRecord(soundResource, 0.25F, pitch, false, ISound.AttenuationType.NONE, 0.0F, 0.0F,
+
+> CHANGE 4 : 5 @ 4 : 5
+
+~ return new PositionedSoundRecord(soundResource, 1.0F, 1.0F, false, ISound.AttenuationType.NONE, 0.0F, 0.0F,
+
+> CHANGE 5 : 6 @ 5 : 6
+
+~ return new PositionedSoundRecord(soundResource, 4.0F, 1.0F, false, ISound.AttenuationType.LINEAR, xPosition,
+
+> CHANGE 5 : 6 @ 5 : 6
+
+~ this(soundResource, volume, pitch, false, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition);
+
+> CHANGE 3 : 4 @ 3 : 5
+
+~ ISound.AttenuationType attenuationType, float xPosition, float yPosition, float zPosition) {
+
+> DELETE 7 @ 7 : 8
+
> EOF
diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.edit.java b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.edit.java
index 927cc2f..a74df85 100644
--- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.edit.java
+++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.edit.java
@@ -43,7 +43,11 @@
~ EaglercraftRandom random = new EaglercraftRandom();
-> CHANGE 83 : 84 @ 83 : 85
+> CHANGE 3 : 4 @ 3 : 4
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 79 : 80 @ 79 : 81
~ return "Non-integrated multiplayer server";
diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java b/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java
index ba34f71..21af64a 100644
--- a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java
+++ b/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java
@@ -36,7 +36,7 @@
> CHANGE 2 : 6 @ 2 : 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/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java
index c627c90..1698a10 100644
--- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java
+++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java
@@ -616,7 +616,11 @@
~ b0 = 8;
~ } else if (this.mc.gameSettings.fancyGraphics) {
-> CHANGE 38 : 39 @ 38 : 39
+> CHANGE 7 : 8 @ 7 : 8
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 30 : 31 @ 30 : 31
~ if (f2 >= 0.15F) {
diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java
index 7aaa170..d6d243d 100644
--- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java
+++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java
@@ -489,7 +489,11 @@
+ }
+
-> INSERT 29 : 30 @ 29
+> CHANGE 5 : 6 @ 5 : 7
+
+~ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos.add(15, 15, 15))) {
+
+> INSERT 22 : 23 @ 22
+ ((ClippingHelperImpl) this.debugFixedClippingHelper).destroy();
diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java
index c733169..43aea3a 100644
--- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java
+++ b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java
@@ -88,7 +88,7 @@
> CHANGE 2 : 4 @ 2 : 4
-~ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBox(blockpos, blockpos1)) {
+~ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos1)) {
~ IBlockState iblockstate = regionrendercache.getBlockStateFaster(blockpos$mutableblockpos);
> CHANGE 6 : 7 @ 6 : 7
diff --git a/patches/minecraft/net/minecraft/command/CommandCompare.edit.java b/patches/minecraft/net/minecraft/command/CommandCompare.edit.java
index c3bb426..04a848a 100644
--- a/patches/minecraft/net/minecraft/command/CommandCompare.edit.java
+++ b/patches/minecraft/net/minecraft/command/CommandCompare.edit.java
@@ -11,4 +11,9 @@
+
+> CHANGE 40 : 42 @ 40 : 42
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+~ BlockPos blockpos$mutableblockpos1 = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/entity/Entity.edit.java b/patches/minecraft/net/minecraft/entity/Entity.edit.java
index e726385..a4e6912 100644
--- a/patches/minecraft/net/minecraft/entity/Entity.edit.java
+++ b/patches/minecraft/net/minecraft/entity/Entity.edit.java
@@ -147,7 +147,11 @@
~ for (int i = 0; i < numbers.length; ++i) {
~ nbttaglist.appendTag(new NBTTagFloat(numbers[i]));
-> CHANGE 172 : 173 @ 172 : 173
+> CHANGE 33 : 34 @ 33 : 35
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
+
+> CHANGE 137 : 138 @ 137 : 138
~ for (AxisAlignedBB axisalignedbb : (List) list) {
diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.edit.java
index 685bb33..20f8f7c 100644
--- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.edit.java
+++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.edit.java
@@ -16,4 +16,8 @@
~ private static final EaglercraftUUID babySpeedBoostUUID = EaglercraftUUID
~ .fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
+> CHANGE 489 : 490 @ 489 : 490
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/item/ItemMap.edit.java b/patches/minecraft/net/minecraft/item/ItemMap.edit.java
index a9a6a81..660fcbf 100644
--- a/patches/minecraft/net/minecraft/item/ItemMap.edit.java
+++ b/patches/minecraft/net/minecraft/item/ItemMap.edit.java
@@ -16,4 +16,8 @@
> DELETE 9 @ 9 : 11
+> CHANGE 91 : 92 @ 91 : 92
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java
index 3f5c9b6..bbc7202 100644
--- a/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java
+++ b/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java
@@ -7,4 +7,8 @@
> DELETE 8 @ 8 : 11
+> CHANGE 168 : 169 @ 168 : 169
+
+~ for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(parInt1, parInt2, parInt3),
+
> EOF
diff --git a/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java b/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java
index e877e59..9457120 100644
--- a/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java
+++ b/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java
@@ -5,9 +5,9 @@
# Version: 1.0
# Author: lax1dude
-> DELETE 4 @ 4 : 10
+> DELETE 4 @ 4 : 11
-> DELETE 10 @ 10 : 15
+> DELETE 9 @ 9 : 14
> CHANGE 3 : 5 @ 3 : 6
diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java
index e429faa..c2ed709 100644
--- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java
+++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java
@@ -21,7 +21,11 @@
~ for (int m = 0, l = list.size(); m < l; ++m) {
~ list.get(m).addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true, true));
-> CHANGE 87 : 88 @ 87 : 88
+> CHANGE 18 : 19 @ 18 : 19
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 68 : 69 @ 68 : 69
~ List lst = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class,
diff --git a/patches/minecraft/net/minecraft/util/BlockPos.edit.java b/patches/minecraft/net/minecraft/util/BlockPos.edit.java
index c1cc32d..1b7107d 100644
--- a/patches/minecraft/net/minecraft/util/BlockPos.edit.java
+++ b/patches/minecraft/net/minecraft/util/BlockPos.edit.java
@@ -15,7 +15,45 @@
> DELETE 1 @ 1 : 5
-> INSERT 55 : 65 @ 55
+> INSERT 12 : 16 @ 12
+
++ public BlockPos() {
++ super(0, 0, 0);
++ }
++
+
+> CHANGE 22 : 23 @ 22 : 23
+
+~ : new BlockPos((double) this.x + x, (double) this.y + y, (double) this.z + z);
+
+> CHANGE 3 : 4 @ 3 : 4
+
+~ return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.x + x, this.y + y, this.z + z);
+
+> INSERT 2 : 12 @ 2
+
++ /**
++ * eagler
++ */
++ 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;
++ }
++
+
+> CHANGE 1 : 3 @ 1 : 3
+
+~ 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);
+
+> CHANGE 3 : 5 @ 3 : 5
+
+~ 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);
+
+> INSERT 6 : 16 @ 6
+ /**
+ * eagler
@@ -96,9 +134,9 @@
> INSERT 4 : 21 @ 4
+ 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;
+ }
+
@@ -118,10 +156,89 @@
~ : new BlockPos(this.x + facing.getFrontOffsetX() * n, this.y + facing.getFrontOffsetY() * n,
~ this.z + facing.getFrontOffsetZ() * n);
-> DELETE 104 @ 104 : 107
+> CHANGE 3 : 5 @ 3 : 6
-> CHANGE 6 : 7 @ 6 : 10
+~ 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);
-~ super(x_, y_, z_);
+> CHANGE 3 : 5 @ 3 : 5
+
+~ return ((long) this.x & X_MASK) << X_SHIFT | ((long) this.y & Y_MASK) << Y_SHIFT
+~ | ((long) this.z & Z_MASK) << 0;
+
+> CHANGE 10 : 12 @ 10 : 14
+
+~ 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));
+
+> CHANGE 12 : 16 @ 12 : 16
+
+~ int i = this.lastReturned.x;
+~ int j = this.lastReturned.y;
+~ int k = this.lastReturned.z;
+~ if (i < blockpos1.x) {
+
+> CHANGE 1 : 3 @ 1 : 3
+
+~ } else if (j < blockpos1.y) {
+~ i = blockpos.x;
+
+> CHANGE 1 : 4 @ 1 : 4
+
+~ } else if (k < blockpos1.z) {
+~ i = blockpos.x;
+~ j = blockpos.y;
+
+> CHANGE 12 : 19 @ 12 : 21
+
+~ 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;
+
+> CHANGE 1 : 2 @ 1 : 2
+
+~ protected BlockPos computeNext() {
+
+> CHANGE 1 : 2 @ 1 : 3
+
+~ this.theBlockPos = new BlockPos(blockpos.x, blockpos.y, blockpos.z);
+
+> CHANGE 2 : 3 @ 2 : 3
+
+~ return (BlockPos) this.endOfData();
+
+> CHANGE 1 : 5 @ 1 : 5
+
+~ int i = this.theBlockPos.x;
+~ int j = this.theBlockPos.y;
+~ int k = this.theBlockPos.z;
+~ if (i < blockpos1.x) {
+
+> CHANGE 1 : 3 @ 1 : 3
+
+~ } else if (j < blockpos1.y) {
+~ i = blockpos.x;
+
+> CHANGE 1 : 4 @ 1 : 4
+
+~ } else if (k < blockpos1.z) {
+~ i = blockpos.x;
+~ j = blockpos.y;
+
+> CHANGE 14 : 19 @ 14 : 48
+
+~ public BlockPos func_181079_c(int x, int y, int z) {
+~ this.x = x;
+~ this.y = y;
+~ this.z = z;
+~ return this;
+
+> INSERT 1 : 2 @ 1
+
++
> EOF
diff --git a/patches/minecraft/net/minecraft/util/IChatComponent.edit.java b/patches/minecraft/net/minecraft/util/IChatComponent.edit.java
index de2713a..5809f25 100644
--- a/patches/minecraft/net/minecraft/util/IChatComponent.edit.java
+++ b/patches/minecraft/net/minecraft/util/IChatComponent.edit.java
@@ -189,8 +189,11 @@
+ * So sorry for this implementation
+ */
-> CHANGE 1 : 8 @ 1 : 2
+> CHANGE 1 : 11 @ 1 : 2
+~ 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/patches/minecraft/net/minecraft/world/Teleporter.edit.java b/patches/minecraft/net/minecraft/world/Teleporter.edit.java
index ce33e0a..8c660fa 100644
--- a/patches/minecraft/net/minecraft/world/Teleporter.edit.java
+++ b/patches/minecraft/net/minecraft/world/Teleporter.edit.java
@@ -19,4 +19,8 @@
~ this.random = new EaglercraftRandom(worldIn.getSeed(), !worldIn.getWorldInfo().isOldEaglercraftRandom());
+> CHANGE 152 : 153 @ 152 : 153
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/World.edit.java b/patches/minecraft/net/minecraft/world/World.edit.java
index 5e84e69..6044c62 100644
--- a/patches/minecraft/net/minecraft/world/World.edit.java
+++ b/patches/minecraft/net/minecraft/world/World.edit.java
@@ -69,11 +69,29 @@
~ return HString.format("ID #%d (%s // %s)",
-> CHANGE 128 : 129 @ 128 : 129
+> CHANGE 60 : 66 @ 60 : 65
+
+~ 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);
+
+> CHANGE 63 : 64 @ 63 : 64
~ return Chunk.getNoSkyLightValue();
-> CHANGE 74 : 80 @ 74 : 75
+> CHANGE 10 : 16 @ 10 : 15
+
+~ 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));
+
+> CHANGE 59 : 65 @ 59 : 60
~ if (lightValue < 0) {
~ j += -lightValue;
@@ -82,7 +100,15 @@
~ }
~ } else if (j < lightValue) {
-> DELETE 579 @ 579 : 582
+> CHANGE 320 : 321 @ 320 : 321
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 72 : 73 @ 72 : 73
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> DELETE 185 @ 185 : 188
> DELETE 23 @ 23 : 24
@@ -104,7 +130,31 @@
> DELETE 38 @ 38 : 39
-> CHANGE 400 : 401 @ 400 : 401
+> CHANGE 37 : 38 @ 37 : 38
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 22 : 23 @ 22 : 23
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 23 : 24 @ 23 : 24
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 28 : 29 @ 28 : 29
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 38 : 39 @ 38 : 39
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 22 : 23 @ 22 : 23
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 224 : 225 @ 224 : 225
~ if (!this.provider.getHasNoSky() && this.getGameRules().getBoolean("doWeatherCycle")) {
@@ -140,7 +190,13 @@
~ public void forceBlockUpdateTick(Block blockType, BlockPos pos, EaglercraftRandom random) {
-> CHANGE 93 : 96 @ 93 : 94
+> CHANGE 28 : 31 @ 28 : 30
+
+~ 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));
+
+> CHANGE 63 : 66 @ 63 : 64
~ EnumFacing[] facings = EnumFacing._VALUES;
~ for (int m = 0; m < facings.length; ++m) {
@@ -148,7 +204,11 @@
> DELETE 22 @ 22 : 23
-> CHANGE 27 : 30 @ 27 : 28
+> CHANGE 25 : 26 @ 25 : 26
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 1 : 4 @ 1 : 2
~ EnumFacing[] facings = EnumFacing._VALUES;
~ for (int m = 0; m < facings.length; ++m) {
@@ -156,7 +216,35 @@
> DELETE 20 @ 20 : 23
-> DELETE 50 @ 50 : 51
+> INSERT 6 : 7 @ 6
+
++ BlockPos tmp = new BlockPos(0, 0, 0);
+
+> CHANGE 10 : 11 @ 10 : 11
+
+~ if (this.getLightFor(lightType, blockpos1.west(tmp)) < j6) {
+
+> CHANGE 4 : 5 @ 4 : 5
+
+~ if (this.getLightFor(lightType, blockpos1.east(tmp)) < j6) {
+
+> CHANGE 4 : 5 @ 4 : 5
+
+~ if (this.getLightFor(lightType, blockpos1.down(tmp)) < j6) {
+
+> CHANGE 4 : 5 @ 4 : 5
+
+~ if (this.getLightFor(lightType, blockpos1.up(tmp)) < j6) {
+
+> CHANGE 4 : 5 @ 4 : 5
+
+~ if (this.getLightFor(lightType, blockpos1.north(tmp)) < j6) {
+
+> CHANGE 4 : 5 @ 4 : 5
+
+~ if (this.getLightFor(lightType, blockpos1.south(tmp)) < j6) {
+
+> DELETE 8 @ 8 : 9
> CHANGE 43 : 46 @ 43 : 45
@@ -175,7 +263,42 @@
~ for (int j = 0, l = this.loadedEntityList.size(); j < l; ++j) {
~ Entity entity = this.loadedEntityList.get(j);
-> CHANGE 102 : 107 @ 102 : 104
+> CHANGE 51 : 53 @ 51 : 52
+
+~ BlockPos tmp = new BlockPos();
+~ i = Math.max(i, this.getStrongPower(pos.down(tmp), EnumFacing.DOWN));
+
+> CHANGE 3 : 4 @ 3 : 4
+
+~ i = Math.max(i, this.getStrongPower(pos.up(tmp), EnumFacing.UP));
+
+> CHANGE 3 : 4 @ 3 : 4
+
+~ i = Math.max(i, this.getStrongPower(pos.north(tmp), EnumFacing.NORTH));
+
+> CHANGE 3 : 4 @ 3 : 4
+
+~ i = Math.max(i, this.getStrongPower(pos.south(tmp), EnumFacing.SOUTH));
+
+> CHANGE 3 : 4 @ 3 : 4
+
+~ i = Math.max(i, this.getStrongPower(pos.west(tmp), EnumFacing.WEST));
+
+> CHANGE 3 : 4 @ 3 : 4
+
+~ i = Math.max(i, this.getStrongPower(pos.east(tmp), EnumFacing.EAST));
+
+> CHANGE 19 : 26 @ 19 : 25
+
+~ 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))));
+
+> CHANGE 5 : 10 @ 5 : 7
~ EnumFacing[] facings = EnumFacing._VALUES;
~ BlockPos tmp = new BlockPos(0, 0, 0);
diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.edit.java
index 0d7c65a..d21cbbe 100644
--- a/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.edit.java
+++ b/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.edit.java
@@ -7,4 +7,8 @@
> DELETE 4 @ 4 : 5
+> CHANGE 24 : 25 @ 24 : 25
+
+~ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(parBlockPos.add(-1, 0, -1),
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java
index 3fb538e..334784a 100644
--- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java
+++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java
@@ -93,7 +93,11 @@
~ public final void generateBiomeTerrain(World worldIn, EaglercraftRandom rand, ChunkPrimer chunkPrimerIn,
~ int parInt1, int parInt2, double parDouble1) {
-> CHANGE 101 : 177 @ 101 : 102
+> CHANGE 7 : 8 @ 7 : 8
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 93 : 169 @ 93 : 94
~ public static void doBootstrap() {
~ ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans);
diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java b/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java
index ba65f3b..60e6bb5 100644
--- a/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java
+++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java
@@ -195,4 +195,8 @@
~ for (int i = 0; i < facings.length; ++i) {
~ EnumFacing enumfacing = facings[i];
+> CHANGE 49 : 50 @ 49 : 51
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos((this.xPosition << 4) + x, 0, (this.zPosition << 4) + z);
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java
index d9711e3..678d7f3 100644
--- a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java
+++ b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java
@@ -7,4 +7,8 @@
> DELETE 8 @ 8 : 9
+> CHANGE 87 : 88 @ 87 : 88
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java
index 5e01856..5ef387b 100644
--- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java
@@ -23,4 +23,8 @@
~ EaglercraftRandom random = new EaglercraftRandom(parLong1, this.rand.isScramble());
+> CHANGE 106 : 107 @ 106 : 107
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java
index dd0c9d7..d481373 100644
--- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java
@@ -22,4 +22,8 @@
~ EaglercraftRandom random = new EaglercraftRandom(parLong1, this.rand.isScramble());
+> CHANGE 105 : 106 @ 105 : 106
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java
index e295768..96a1272 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 13 : 14 @ 13 : 14
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java
index e18e15a..dfe47f4 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java
@@ -23,14 +23,22 @@
> CHANGE 111 : 113 @ 111 : 113
~ 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);
> CHANGE 22 : 24 @ 22 : 23
~ for (int j = 0, l = this.field_175948_j.size(); j < l; ++j) {
~ WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates = this.field_175948_j.get(j);
-> CHANGE 35 : 36 @ 35 : 36
+> CHANGE 2 : 3 @ 2 : 3
+
+~ if (!blockpos.equals(worldgenbigtree$foliagecoordinates.blockPos)
+
+> CHANGE 1 : 2 @ 1 : 2
+
+~ this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates.blockPos, Blocks.log);
+
+> CHANGE 30 : 31 @ 30 : 31
~ public boolean generate(World worldIn, EaglercraftRandom rand, BlockPos position) {
@@ -38,4 +46,18 @@
~ this.rand = new EaglercraftRandom(rand.nextLong(), !worldIn.getWorldInfo().isOldEaglercraftRandom());
+> CHANGE 32 : 33 @ 32 : 33
+
+~ static class FoliageCoordinates {
+
+> INSERT 1 : 2 @ 1
+
++ private final BlockPos blockPos;
+
+> DELETE 2 @ 2 : 3
+
+> INSERT 1 : 2 @ 1
+
++ this.blockPos = parBlockPos;
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java
index 1493ab3..0b2dc25 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java
@@ -15,4 +15,9 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 25 : 27 @ 25 : 26
+
+~ for (BlockPos blockpos1 : BlockPos.getAllInBoxMutable(blockpos.add(-j, -k, -l),
+~ blockpos.add(j, k, l))) {
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java
index 4c5dc06..10004dd 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 111 : 112 @ 111 : 112
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java
index 60a12be..a4e498f 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 17 : 18 @ 17 : 18
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java
index 4c5dc06..4c78ae4 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 13 : 14 @ 13 : 14
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java
index 4727abe..aac3d69 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 3 : 4 @ 3 : 4
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java
index 4c5dc06..8e4c2bf 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java
@@ -15,4 +15,12 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 18 : 19 @ 18 : 19
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 57 : 58 @ 57 : 58
+
+~ BlockPos blockpos$mutableblockpos1 = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java
index a8005cf..7307595 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 14 : 15 @ 14 : 15
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java
index a8005cf..7307595 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java
@@ -15,4 +15,8 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
+> CHANGE 14 : 15 @ 14 : 15
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java
index 0a83582..c89a63d 100644
--- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java
@@ -15,7 +15,15 @@
~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) {
-> CHANGE 126 : 129 @ 126 : 127
+> CHANGE 13 : 14 @ 13 : 14
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 75 : 76 @ 75 : 76
+
+~ BlockPos blockpos$mutableblockpos1 = new BlockPos();
+
+> CHANGE 36 : 39 @ 36 : 37
~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
~ for (int m = 0; m < facings.length; ++m) {
diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java
index 1a5cb38..1252392 100644
--- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java
@@ -39,7 +39,11 @@
~ protected Feature(EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, int parInt4, int parInt5,
-> CHANGE 86 : 87 @ 86 : 87
+> CHANGE 39 : 40 @ 39 : 40
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 46 : 47 @ 46 : 47
~ public JunglePyramid(EaglercraftRandom parRandom, int parInt1, int parInt2) {
diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java
index bc80a75..2ef376f 100644
--- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java
@@ -19,7 +19,11 @@
~ public abstract boolean addComponentParts(World var1, EaglercraftRandom var2, StructureBoundingBox var3);
-> CHANGE 408 : 409 @ 408 : 409
+> CHANGE 32 : 33 @ 32 : 33
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 375 : 376 @ 375 : 376
~ int minZ, int maxX, int maxY, int maxZ, boolean alwaysReplace, EaglercraftRandom rand,
diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java
index f1c1810..b23cbb6 100644
--- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java
+++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java
@@ -216,7 +216,11 @@
~ List rand, EaglercraftRandom parRandom, int parInt1, int parInt2) {
-> CHANGE 138 : 139 @ 138 : 139
+> CHANGE 27 : 28 @ 27 : 28
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
+> CHANGE 110 : 111 @ 110 : 111
~ public Well(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, int parInt2, int parInt3) {
diff --git a/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java b/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java
index eb6185a..f014806 100644
--- a/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java
+++ b/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java
@@ -13,4 +13,8 @@
~ for (int j = 0; j < facings.length; ++j) {
~ EnumFacing enumfacing = facings[j];
+> CHANGE 16 : 17 @ 16 : 17
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java b/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java
index ffbb9b2..fb31754 100644
--- a/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java
+++ b/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java
@@ -7,4 +7,13 @@
> DELETE 15 @ 15 : 16
+> CHANGE 22 : 24 @ 22 : 24
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos(MathHelper.floor_double(entity.posX), i,
+~ MathHelper.floor_double(entity.posZ));
+
+> CHANGE 113 : 114 @ 113 : 114
+
+~ BlockPos blockpos$mutableblockpos = new BlockPos();
+
> EOF
diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
index fe3a750..960a83a 100644
--- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
+++ b/sources/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/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
index 3a165f4..b510311 100644
--- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
+++ b/sources/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/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
index 5020d8f..b14a084 100644
--- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
+++ b/sources/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/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
index f9cc34b..2068537 100644
--- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
+++ b/sources/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
diff --git a/sources/resources/plugin_download.zip b/sources/resources/plugin_download.zip
index f6df894..3da750a 100644
Binary files a/sources/resources/plugin_download.zip and b/sources/resources/plugin_download.zip differ
diff --git a/sources/resources/plugin_version.json b/sources/resources/plugin_version.json
index c1764ce..ae3a168 100644
--- a/sources/resources/plugin_version.json
+++ b/sources/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/sources/resources/relay_download.zip b/sources/resources/relay_download.zip
index ab0c491..6efd790 100644
Binary files a/sources/resources/relay_download.zip and b/sources/resources/relay_download.zip differ
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java
index 2f529d3..a64a5e6 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java
@@ -119,7 +119,7 @@ public class PlatformApplication {
});
}
- @JSBody(params = { "cb" }, script = "if(!navigator.clipboard) { cb(null); } else if (!navigator.clipboard.readText) cb(null); else navigator.clipboard.readText().then(function(s) { cb(s || null); }, function() { cb(null); });")
+ @JSBody(params = { "cb" }, script = "if(!navigator.clipboard) { cb(null); } else if (!navigator.clipboard.readText) cb(null); else navigator.clipboard.readText().then(function(s) { cb((typeof s === \"string\") ? s : null); }, function(err) { cb(null); });")
private static native void getClipboard1(StupidFunctionResolveString cb);
@JSBody(params = { "str" }, script = "if(navigator.clipboard) { navigator.clipboard.writeText(str); return true; } else { return false; }")
@@ -212,7 +212,7 @@ public class PlatformApplication {
}
@JSBody(params = { "ctx", "buffer", "w", "h" }, script = "var imgData = ctx.createImageData(w, h); var ww = w * 4; for(var i = 0; i < h; ++i) { imgData.data.set(new Uint8ClampedArray(buffer, (h - i - 1) * ww, ww), i * ww); } ctx.putImageData(imgData, 0, 0);")
- private static native JSObject putImageData(CanvasRenderingContext2D ctx, ArrayBuffer buffer, int w, int h);
+ private static native void putImageData(CanvasRenderingContext2D ctx, ArrayBuffer buffer, int w, int h);
@JSBody(params = { "cvs", "name", "parentElement" }, script =
"var vigg = function(el, url){" +
@@ -474,7 +474,7 @@ public class PlatformApplication {
}
@JSFunctor
- private static interface DownloadBytesBlobURLRevoke extends JSObject {
+ static interface DownloadBytesBlobURLRevoke extends JSObject {
void call();
}
@@ -507,6 +507,10 @@ public class PlatformApplication {
downloadBytesImpl(str, blobHandle.toExternalForm(), blobHandle::release, PlatformRuntime.parent);
}
+ static void downloadURLWithNameTeaVM(String str, String url, DownloadBytesBlobURLRevoke revoker) {
+ downloadBytesImpl(str, url, revoker, PlatformRuntime.parent);
+ }
+
public static void showDebugConsole() {
DebugConsoleWindow.showDebugConsole();
}
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
index 7f878cb..2fe7db1 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java
@@ -87,16 +87,19 @@ public class PlatformAudio {
protected final PannerNode panner;
protected final GainNode gain;
protected float pitch;
+ protected boolean repeat;
protected boolean isPaused = false;
protected boolean isEnded = false;
+ protected boolean isDisposed = false;
public BrowserAudioHandle(BrowserAudioResource resource, AudioBufferSourceNode source, PannerNode panner,
- GainNode gain, float pitch) {
+ GainNode gain, float pitch, boolean repeat) {
this.resource = resource;
this.source = source;
this.panner = panner;
this.gain = gain;
this.pitch = pitch;
+ this.repeat = repeat;
source.setOnEnded(this);
}
@@ -115,6 +118,14 @@ public class PlatformAudio {
}
}
+ @Override
+ public void repeat(boolean en) {
+ repeat = en;
+ if(!isEnded) {
+ source.setLoop(en);
+ }
+ }
+
@Override
public void restart() {
if(isEnded) {
@@ -124,11 +135,21 @@ public class PlatformAudio {
resource.cacheHit = PlatformRuntime.steadyTimeMillis();
src.setBuffer(resource.buffer);
src.getPlaybackRate().setValue(pitch);
+ src.setLoop(repeat);
source.disconnect();
src.connect(panner == null ? gain : panner);
+ if(isDisposed) {
+ isDisposed = false;
+ activeSounds.add(this);
+ gain.connect(audioctx.getDestination());
+ if(gameRecGain != null) {
+ gain.connect(gameRecGain);
+ }
+ }
source = src;
source.start();
}else {
+ isPaused = false;
source.getPlaybackRate().setValue(pitch);
source.start(0.0);
}
@@ -179,6 +200,12 @@ public class PlatformAudio {
isEnded = true;
}
+ private void dispose() {
+ if(!isDisposed) {
+ isDisposed = true;
+ gain.disconnect();
+ }
+ }
}
static void initialize() {
@@ -304,10 +331,9 @@ public class PlatformAudio {
gameRecGain = audioctx.createGain();
gameRecGain.getGain().setValue(gameVol);
for(BrowserAudioHandle handle : activeSounds) {
- if(handle.panner != null) {
- handle.panner.connect(gameRecGain);
- }else {
+ try {
handle.gain.connect(gameRecGain);
+ }catch(Throwable t) {
}
}
PlatformVoiceClient.addRecordingDest(gameRecGain);
@@ -342,11 +368,7 @@ public class PlatformAudio {
}
for(BrowserAudioHandle handle : activeSounds) {
try {
- if(handle.panner != null) {
- handle.panner.disconnect(gameRecGain);
- }else {
- handle.gain.disconnect(gameRecGain);
- }
+ handle.gain.disconnect(gameRecGain);
}catch(Throwable t) {
}
}
@@ -451,8 +473,10 @@ public class PlatformAudio {
activeFreeTimer = millis;
Iterator itr = activeSounds.iterator();
while(itr.hasNext()) {
- if(itr.next().shouldFree()) {
+ BrowserAudioHandle h = itr.next();
+ if(h.shouldFree()) {
itr.remove();
+ h.dispose();
}
}
}
@@ -460,6 +484,10 @@ public class PlatformAudio {
public static void flushAudioCache() {
soundCache.clear();
+ Iterator itr = activeSounds.iterator();
+ while(itr.hasNext()) {
+ itr.next().dispose();
+ }
activeSounds.clear();
}
@@ -468,13 +496,14 @@ public class PlatformAudio {
}
public static IAudioHandle beginPlayback(IAudioResource track, float x, float y, float z,
- float volume, float pitch) {
+ float volume, float pitch, boolean repeat) {
BrowserAudioResource internalTrack = (BrowserAudioResource) track;
internalTrack.cacheHit = PlatformRuntime.steadyTimeMillis();
AudioBufferSourceNode src = audioctx.createBufferSource();
src.setBuffer(internalTrack.buffer);
src.getPlaybackRate().setValue(pitch);
+ src.setLoop(repeat);
PannerNode panner = audioctx.createPanner();
panner.setPosition(x, y, z);
@@ -503,18 +532,19 @@ public class PlatformAudio {
src.start();
- BrowserAudioHandle ret = new BrowserAudioHandle(internalTrack, src, panner, gain, pitch);
+ BrowserAudioHandle ret = new BrowserAudioHandle(internalTrack, src, panner, gain, pitch, repeat);
activeSounds.add(ret);
return ret;
}
- public static IAudioHandle beginPlaybackStatic(IAudioResource track, float volume, float pitch) {
+ public static IAudioHandle beginPlaybackStatic(IAudioResource track, float volume, float pitch, boolean repeat) {
BrowserAudioResource internalTrack = (BrowserAudioResource) track;
internalTrack.cacheHit = PlatformRuntime.steadyTimeMillis();
AudioBufferSourceNode src = audioctx.createBufferSource();
src.setBuffer(internalTrack.buffer);
src.getPlaybackRate().setValue(pitch);
+ src.setLoop(repeat);
GainNode gain = audioctx.createGain();
float v2 = volume;
@@ -529,7 +559,7 @@ public class PlatformAudio {
src.start();
- BrowserAudioHandle ret = new BrowserAudioHandle(internalTrack, src, null, gain, pitch);
+ BrowserAudioHandle ret = new BrowserAudioHandle(internalTrack, src, null, gain, pitch, repeat);
activeSounds.add(ret);
return ret;
}
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java
index 585ca93..76cafb5 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java
@@ -330,7 +330,7 @@ public class PlatformInput {
if(tryGrabCursorHook()) return;
int b = evt.getButton();
b = b == 1 ? 2 : (b == 2 ? 1 : b);
- buttonStates[b] = true;
+ if(b >= 0 && b < buttonStates.length) buttonStates[b] = true;
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
synchronized(mouseEvents) {
@@ -348,7 +348,7 @@ public class PlatformInput {
evt.stopPropagation();
int b = evt.getButton();
b = b == 1 ? 2 : (b == 2 ? 1 : b);
- buttonStates[b] = false;
+ if(b >= 0 && b < buttonStates.length) buttonStates[b] = false;
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
synchronized(mouseEvents) {
@@ -366,8 +366,10 @@ public class PlatformInput {
evt.stopPropagation();
mouseX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
mouseY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
- mouseDX += evt.getMovementX();
- mouseDY += -evt.getMovementY();
+ if(pointerLockFlag) {
+ mouseDX += evt.getMovementX();
+ mouseDY += -evt.getMovementY();
+ }
if(hasShownPressAnyKey) {
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
@@ -765,7 +767,7 @@ public class PlatformInput {
win.addEventListener("gamepaddisconnected", gamepaddisconnected = new EventListener() {
@Override
public void handleEvent(GamepadEvent evt) {
- if(evt.getGamepad() == selectedGamepad) {
+ if(selectedGamepad != null && evt.getGamepad().getIndex() == selectedGamepad.getIndex()) {
selectedGamepad = null;
}
enumerateGamepads();
@@ -1287,7 +1289,7 @@ public class PlatformInput {
public static int mouseGetDWheel() {
int ret = (int)mouseDWheel;
- mouseDWheel = 0.0D;
+ mouseDWheel -= ret;
return ret;
}
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
index d64bdcc..bb96874 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java
@@ -599,7 +599,11 @@ public class PlatformRuntime {
}
public static void downloadRemoteURIByteArray(String assetPackageURI, final Consumer cb) {
- downloadRemoteURI(assetPackageURI, arr -> cb.accept(TeaVMUtils.wrapByteArrayBuffer(arr)));
+ downloadRemoteURIByteArray(assetPackageURI, false, cb);
+ }
+
+ public static void downloadRemoteURIByteArray(String assetPackageURI, boolean useCache, final Consumer cb) {
+ downloadRemoteURI(assetPackageURI, useCache, arr -> cb.accept(TeaVMUtils.wrapByteArrayBuffer(arr)));
}
public static void downloadRemoteURI(String assetPackageURI, final Consumer cb) {
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformScreenRecord.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformScreenRecord.java
index 70a9227..5def437 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformScreenRecord.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformScreenRecord.java
@@ -3,7 +3,6 @@ package net.lax1dude.eaglercraft.v1_8.internal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.EnumSet;
-import java.util.HashSet;
import java.util.Set;
import org.teavm.interop.Async;
@@ -16,7 +15,6 @@ import org.teavm.jso.browser.Window;
import org.teavm.jso.canvas.CanvasRenderingContext2D;
import org.teavm.jso.dom.events.Event;
import org.teavm.jso.dom.events.EventListener;
-import org.teavm.jso.dom.html.HTMLAnchorElement;
import org.teavm.jso.dom.html.HTMLCanvasElement;
import org.teavm.jso.webaudio.MediaStream;
@@ -193,19 +191,11 @@ public class PlatformScreenRecord {
final String fileName = EaglercraftVersion.mainMenuStringB + " - " + EaglerProfile.getName() + " - " + fmt.format(new Date()) + "." + params.codec.fileExt;
if("video/webm".equals(params.codec.container)) {
FixWebMDurationJS.getRecUrl(evt, (int) (PlatformRuntime.steadyTimeMillis() - startTime), url -> {
- HTMLAnchorElement a = (HTMLAnchorElement) win.getDocument().createElement("a");
- a.setDownload(fileName);
- a.setHref(url);
- a.click();
- TeaVMUtils.freeDataURL(url);
+ PlatformApplication.downloadURLWithNameTeaVM(fileName, url, () -> TeaVMUtils.freeDataURL(url));
}, logger::info);
}else {
String url = TeaVMUtils.getDataURL(evt.getData());
- HTMLAnchorElement a = (HTMLAnchorElement) win.getDocument().createElement("a");
- a.setDownload(fileName);
- a.setHref(url);
- a.click();
- TeaVMUtils.freeDataURL(url);
+ PlatformApplication.downloadURLWithNameTeaVM(fileName, url, () -> TeaVMUtils.freeDataURL(url));
}
}
});
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
index 4acb93e..40ae258 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformVoiceClient.java
@@ -4,7 +4,6 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
-import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelPeerState;
import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelReadyState;
import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelType;
import net.lax1dude.eaglercraft.v1_8.voice.VoiceClientController;
@@ -179,32 +178,17 @@ public class PlatformVoiceClient {
VoiceClientController.sendPacketDesc(peerId, JSON.stringify(desc));
}, err -> {
logger.error("Failed to set local description for \"{}\"! {}", peerId, err);
- if (peerStateInitial == EnumVoiceChannelPeerState.LOADING) {
- peerStateInitial = EnumVoiceChannelPeerState.FAILED;
- }
signalDisconnect(VoicePeer.this, false);
});
}, err -> {
logger.error("Failed to set create offer for \"{}\"! {}", peerId, err);
- if (peerStateInitial == EnumVoiceChannelPeerState.LOADING) {
- peerStateInitial = EnumVoiceChannelPeerState.FAILED;
- }
signalDisconnect(VoicePeer.this, false);
});
}
TeaVMUtils.addEventListener(peerConnection, "connectionstatechange", (EventListener) evt -> {
String cs = PlatformWebRTC.getConnectionState(peerConnection);
- if ("disconnected".equals(cs)) {
- signalDisconnect(VoicePeer.this, false);
- } else if ("connected".equals(cs)) {
- if (peerState != EnumVoiceChannelPeerState.SUCCESS) {
- peerState = EnumVoiceChannelPeerState.SUCCESS;
- }
- } else if ("failed".equals(cs)) {
- if (peerState == EnumVoiceChannelPeerState.LOADING) {
- peerState = EnumVoiceChannelPeerState.FAILED;
- }
+ if ("disconnected".equals(cs) || "failed".equals(cs)) {
signalDisconnect(VoicePeer.this, false);
}
});
@@ -226,26 +210,21 @@ public class PlatformVoiceClient {
PlatformWebRTC.createAnswer(peerConnection, desc -> {
PlatformWebRTC.setLocalDescription(peerConnection, desc, () -> {
VoiceClientController.sendPacketDesc(peerId, JSON.stringify(desc));
- if (peerStateDesc != EnumVoiceChannelPeerState.SUCCESS) peerStateDesc = EnumVoiceChannelPeerState.SUCCESS;
}, err -> {
logger.error("Failed to set local description for \"{}\"! {}", peerId, err.getMessage());
- if (peerStateDesc == EnumVoiceChannelPeerState.LOADING) peerStateDesc = EnumVoiceChannelPeerState.FAILED;
signalDisconnect(VoicePeer.this, false);
});
}, err -> {
logger.error("Failed to create answer for \"{}\"! {}", peerId, err.getMessage());
- if (peerStateDesc == EnumVoiceChannelPeerState.LOADING) peerStateDesc = EnumVoiceChannelPeerState.FAILED;
signalDisconnect(VoicePeer.this, false);
});
}
}, err -> {
logger.error("Failed to set remote description for \"{}\"! {}", peerId, err.getMessage());
- if (peerStateDesc == EnumVoiceChannelPeerState.LOADING) peerStateDesc = EnumVoiceChannelPeerState.FAILED;
signalDisconnect(VoicePeer.this, false);
});
} catch (Throwable err) {
logger.error("Failed to parse remote description for \"{}\"! {}", peerId, err.getMessage());
- if (peerStateDesc == EnumVoiceChannelPeerState.LOADING) peerStateDesc = EnumVoiceChannelPeerState.FAILED;
signalDisconnect(VoicePeer.this, false);
}
}
@@ -253,10 +232,8 @@ public class PlatformVoiceClient {
public void addICECandidate(String candidate) {
try {
addIceCandidate(peerConnection, candidate);
- if (peerStateIce != EnumVoiceChannelPeerState.SUCCESS) peerStateIce = EnumVoiceChannelPeerState.SUCCESS;
} catch (Throwable err) {
logger.error("Failed to parse ice candidate for \"{}\"! {}", peerId, err.getMessage());
- if (peerStateIce == EnumVoiceChannelPeerState.LOADING) peerStateIce = EnumVoiceChannelPeerState.FAILED;
signalDisconnect(VoicePeer.this, false);
}
}
@@ -269,11 +246,6 @@ public class PlatformVoiceClient {
public static GainNode localMediaStreamGain;
public static MediaStream localRawMediaStream;
public static EnumVoiceChannelReadyState readyState = EnumVoiceChannelReadyState.NONE;
- public static EnumVoiceChannelPeerState peerState = EnumVoiceChannelPeerState.LOADING;
- public static EnumVoiceChannelPeerState peerStateConnect = EnumVoiceChannelPeerState.LOADING;
- public static EnumVoiceChannelPeerState peerStateInitial = EnumVoiceChannelPeerState.LOADING;
- public static EnumVoiceChannelPeerState peerStateDesc = EnumVoiceChannelPeerState.LOADING;
- public static EnumVoiceChannelPeerState peerStateIce = EnumVoiceChannelPeerState.LOADING;
public static AudioContext microphoneVolumeAudioContext = null;
public static void setICEServers(String[] urls) {
@@ -348,43 +320,16 @@ public class PlatformVoiceClient {
}
}
- public static void resetPeerStates() {
- peerState = peerStateConnect = peerStateInitial = peerStateDesc = peerStateIce = EnumVoiceChannelPeerState.LOADING;
- }
-
- public static EnumVoiceChannelPeerState getPeerState() {
- return peerState;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateConnect() {
- return peerStateConnect;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateInitial() {
- return peerStateInitial;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateDesc() {
- return peerStateDesc;
- }
-
- public static EnumVoiceChannelPeerState getPeerStateIce() {
- return peerStateIce;
- }
-
public static EnumVoiceChannelReadyState getReadyState() {
return readyState;
}
public static void signalConnect(EaglercraftUUID peerId, boolean offer) {
- if (!hasInit) initializeDevices();
try {
JSObject peerConnection = PlatformWebRTC.createRTCPeerConnection(JSONWriter.valueToString(iceServers));
VoicePeer peerInstance = new VoicePeer(peerId, peerConnection, offer);
peerList.put(peerId, peerInstance);
- if (peerStateConnect != EnumVoiceChannelPeerState.SUCCESS) peerStateConnect = EnumVoiceChannelPeerState.SUCCESS;
} catch (Throwable e) {
- if (peerStateConnect == EnumVoiceChannelPeerState.LOADING) peerStateConnect = EnumVoiceChannelPeerState.FAILED;
}
}
diff --git a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
index 78d3d57..3d59653 100644
--- a/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
+++ b/sources/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java
@@ -4,23 +4,15 @@ import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
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.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.json.JSONObject;
import org.json.JSONWriter;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSFunctor;
import org.teavm.jso.JSObject;
+import org.teavm.jso.browser.TimerHandler;
import org.teavm.jso.browser.Window;
import org.teavm.jso.core.JSError;
import org.teavm.jso.dom.events.Event;
@@ -326,8 +318,6 @@ public class PlatformWebRTC {
@JSBody(params = { "sock", "buffer" }, script = "sock.send(buffer);")
static native void nativeBinarySend(WebSocket sock, ArrayBuffer buffer);
- private static final Map fuckTeaVM = new HashMap<>();
-
public static void runScheduledTasks() {
}
@@ -403,12 +393,20 @@ public class PlatformWebRTC {
TeaVMUtils.addEventListener(peerConnection, "icecandidate", (EventListener) evt -> {
if (hasCandidate(evt)) {
if (iceCandidates.isEmpty()) {
- Window.setTimeout(() -> {
+ final int[] candidateState = new int[2];
+ final TimerHandler[] runnable = new TimerHandler[1];
+ Window.setTimeout(runnable[0] = () -> {
if (peerConnection != null && !"disconnected".equals(getConnectionState(peerConnection))) {
+ int trial = ++candidateState[1];
+ if(candidateState[0] != iceCandidates.size() && trial < 3) {
+ candidateState[0] = iceCandidates.size();
+ Window.setTimeout(runnable[0], 2000);
+ return;
+ }
clientICECandidate = JSONWriter.valueToString(iceCandidates);
iceCandidates.clear();
}
- }, 3000);
+ }, 2000);
}
Map m = new HashMap<>();
m.put("sdpMLineIndex", "" + getSdpMLineIndex(evt));
@@ -506,6 +504,8 @@ public class PlatformWebRTC {
public LANServer client;
public String peerId;
public JSObject peerConnection;
+ public JSObject dataChannel;
+ public String ipcChannel;
public LANPeer(LANServer client, String peerId, JSObject peerConnection) {
this.client = client;
@@ -517,15 +517,23 @@ public class PlatformWebRTC {
TeaVMUtils.addEventListener(peerConnection, "icecandidate", (EventListener) evt -> {
if (hasCandidate(evt)) {
if (iceCandidates.isEmpty()) {
- Window.setTimeout(() -> {
+ final int[] candidateState = new int[2];
+ final TimerHandler[] runnable = new TimerHandler[1];
+ Window.setTimeout(runnable[0] = () -> {
if (peerConnection != null && !"disconnected".equals(getConnectionState(peerConnection))) {
+ int trial = ++candidateState[1];
+ if(candidateState[0] != iceCandidates.size() && trial < 3) {
+ candidateState[0] = iceCandidates.size();
+ Window.setTimeout(runnable[0], 2000);
+ return;
+ }
LANPeerEvent.LANPeerICECandidateEvent e = new LANPeerEvent.LANPeerICECandidateEvent(peerId, JSONWriter.valueToString(iceCandidates));
synchronized(serverLANEventBuffer) {
serverLANEventBuffer.put(peerId, e);
}
iceCandidates.clear();
}
- }, 3000);
+ }, 2000);
}
Map m = new HashMap<>();
m.put("sdpMLineIndex", "" + getSdpMLineIndex(evt));
@@ -542,16 +550,23 @@ public class PlatformWebRTC {
}
if (getChannel(evt) == null) return;
JSObject dataChannel = getChannel(evt);
- synchronized(fuckTeaVM) {
- fuckTeaVM.put(peerId, dataChannel);
+ if(this.dataChannel != null) {
+ closeIt(dataChannel);
+ return;
}
+ this.dataChannel = dataChannel;
synchronized(serverLANEventBuffer) {
serverLANEventBuffer.put(peerId, new LANPeerEvent.LANPeerDataChannelEvent(peerId));
}
TeaVMUtils.addEventListener(dataChannel, "message", (EventListener) evt2 -> {
- LANPeerEvent.LANPeerPacketEvent e = new LANPeerEvent.LANPeerPacketEvent(peerId, TeaVMUtils.wrapByteArrayBuffer(getData(evt2)));
- synchronized(serverLANEventBuffer) {
- serverLANEventBuffer.put(peerId, e);
+ ArrayBuffer data = getData(evt2);
+ if(ipcChannel != null) {
+ ClientPlatformSingleplayer.sendPacketTeaVM(ipcChannel, data);
+ }else {
+ LANPeerEvent.LANPeerPacketEvent e = new LANPeerEvent.LANPeerPacketEvent(peerId, TeaVMUtils.wrapByteArrayBuffer(data));
+ synchronized(serverLANEventBuffer) {
+ serverLANEventBuffer.put(peerId, e);
+ }
}
});
};
@@ -572,11 +587,8 @@ public class PlatformWebRTC {
}
public void disconnect() {
- synchronized(fuckTeaVM) {
- if (fuckTeaVM.get(peerId) != null) {
- closeIt(fuckTeaVM.get(peerId));
- fuckTeaVM.remove(peerId);
- }
+ if(dataChannel != null) {
+ closeIt(dataChannel);
}
closeIt(peerConnection);
}
@@ -627,11 +639,26 @@ public class PlatformWebRTC {
client.signalRemoteDisconnect(peerId);
}
}
+
+ public void mapIPC(String ipcChannel) {
+ if(this.ipcChannel == null) {
+ if(ipcChannel != null) {
+ this.ipcChannel = ipcChannel;
+ this.client.ipcMapList.put(ipcChannel, this);
+ }
+ }else {
+ if(ipcChannel == null) {
+ this.client.ipcMapList.remove(this.ipcChannel);
+ this.ipcChannel = null;
+ }
+ }
+ }
}
public static class LANServer {
public Set