Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'ver/1.16.5' of github.com:YatopiaMC/Yatopia into pr/fix…
Browse files Browse the repository at this point in the history
…-374
  • Loading branch information
Titaniumtown committed Feb 16, 2021
2 parents 39341c7 + dede8ef commit 92a0930
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 48 deletions.
1 change: 0 additions & 1 deletion PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ This is an overview over all patches that are currently used.
| server | Fix Bukkit.createInventory() with type LECTERN | willies952002 | |
| server | Fix IndexOutOfBoundsException when sending too many changes | Ivan Pekov | |
| server | Fix LightEngineThreaded memory leak | Ivan Pekov | |
| server | Fix NPE in ControllerLookWASD and ControllerMoveWASD | ishland | |
| server | Fix PlayerEditBookEvent not saving new book | BillyGalbreath | |
| server | Fix cow rotation when shearing mooshroom | William Blake Galbreath | |
| server | Fix death message colors | William Blake Galbreath | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Reduce memory allocations


diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
index 7b29d47dfdef7611db58068af285f76d92a9f12a..7009586430649a87722f6c73cd5a311d7c977196 100644
index 7b29d47dfdef7611db58068af285f76d92a9f12a..6c5d96853d47850b81ce85e56a516c554819ef25 100644
--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -43,8 +43,14 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
Expand All @@ -15,14 +15,33 @@ index 7b29d47dfdef7611db58068af285f76d92a9f12a..7009586430649a87722f6c73cd5a311d
+ // Airplane start - use mutable position
+ BlockPosition.MutableBlockPosition blockposition1 = new BlockPosition.MutableBlockPosition();
for (int i = 0; i < 4; ++i) {
+ blockposition1.setValues(blockposition).add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ blockposition1.setValues(blockposition).addValues(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ /*
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ */
+ // Airplane end

if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index bc61aaff65a7dc1e7534452b285953b83adb7000..f38382cc681f03d9a6a0efa85f045e3770398739 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -438,6 +438,14 @@ public class BlockPosition extends BaseBlockPosition {
public BlockPosition b(int i, int j, int k) {
return super.b(i, j, k).immutableCopy();
}
+ // Airplane start - version of b that doesn't copy
+ public BlockPosition addValues(int x, int y, int z) {
+ ((BaseBlockPosition)this).a += x;
+ ((BaseBlockPosition)this).b += y;
+ ((BaseBlockPosition)this).e += z;
+ return this;
+ }
+ // Airplane end

@Override
public BlockPosition shift(EnumDirection enumdirection, int i) {
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 631eb682e81e30d2a937fd1eafccd8a9ab82d21e..dc07376845f84ea949a2153cb75d2cd9d46a419e 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..e647624f4c9afe8bc603792ad88c807e
+ }
+}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index bc61aaff65a7dc1e7534452b285953b83adb7000..7fddef0afbcf1f9f391c540b8fce1bebf8faa452 100644
index f38382cc681f03d9a6a0efa85f045e3770398739..97b0aee82e080a1225454317cbf0191ef8b14fca 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -341,6 +341,16 @@ public class BlockPosition extends BaseBlockPosition {
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0029-Nuke-streams-off-BlockPosition.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index 8724ad342bec7c733b3c825bd62dbfa5c28c06dd..9907047028b754fe0e314a7d5c5238ce
return this.getBlock().a(tag);
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7fddef0afbcf1f9f391c540b8fce1bebf8faa452..f13b4e6ec815792c2f2b49193707da94df427424 100644
index 97b0aee82e080a1225454317cbf0191ef8b14fca..c4dd89d9bae1960d25b64e2a715a83adde65719a 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -318,7 +318,15 @@ public class BlockPosition extends BaseBlockPosition {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion upstreamCommits/Airplane
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e71967b87c76de81d85dd9750719f3110669d52f
8703980b48dc20f7266c77bcbdf51f376eed6204

0 comments on commit 92a0930

Please sign in to comment.