3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00

Fix Piglin issue

Dieser Commit ist enthalten in:
Aikar 2020-06-27 20:32:49 -04:00
Ursprung 68aa46cc55
Commit 78c5491f14
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE
21 geänderte Dateien mit 64 neuen und 85 gelöschten Zeilen

Datei anzeigen

@ -232,6 +232,49 @@ index 0aa66addb2cb472b2ab90000d3f0e0f967353e0f..eaa527f4fe289a9492b12591154a60e5
}
return biomebase;
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..886b43e2b8f21c358b4d6785c677f14c91d191f3 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -220,8 +220,8 @@ public class BlockPosition extends BaseBlockPosition {
};
}
- public static Iterable<BlockPosition> a(BlockPosition blockposition, int i, int j, int k) {
- int l = i + j + k;
+ public static Iterable<BlockPosition> a(BlockPosition blockposition, int p_i, int p_j, int p_k) { // Paper - decompile issues - variable name conflicts to inner class field refs
+ int l_decompiled = p_i + p_j + p_k; // Paper - decompile issues
int i1 = blockposition.getX();
int j1 = blockposition.getY();
int k1 = blockposition.getZ();
@@ -249,15 +249,15 @@ public class BlockPosition extends BaseBlockPosition {
++this.l;
if (this.l > this.j) {
++this.i;
- if (this.i > l) {
+ if (this.i > l_decompiled) { // Paper - use proper l above (first line of this method)
return (BlockPosition) this.endOfData();
}
- this.j = Math.min(i, this.i);
+ this.j = Math.min(p_i, this.i); // Paper - decompile issues
this.l = -this.j;
}
- this.k = Math.min(j, this.i - Math.abs(this.l));
+ this.k = Math.min(p_j, this.i - Math.abs(this.l)); // Paper - decompile issues
this.m = -this.k;
}
@@ -265,7 +265,7 @@ public class BlockPosition extends BaseBlockPosition {
int i2 = this.m;
int j2 = this.i - Math.abs(l1) - Math.abs(i2);
- if (j2 <= k) {
+ if (j2 <= p_k) { // Paper - decompile issues
this.n = j2 != 0;
blockposition_mutableblockposition = this.h.d(i1 + l1, j1 + i2, k1 + j2);
}
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index 771841e08591955e61c7bcc5b09c8457652c1b9c..8162c11d14b8e88c2b572f9ddf6b7a15977047f8 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java

Datei anzeigen

@ -2331,7 +2331,7 @@ index 47324feca49786b49563d3d0e854e74ad27c190b..26d446077bb563ca3c5bb0339695b336
public boolean isAlwaysDestroyable() {
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..b61651fcd6605cd8638ce14f15e41b878add3f1c 100644
index 886b43e2b8f21c358b4d6785c677f14c91d191f3..f1ad6ad22a59b28d2e8aeb2c0f4c21bce6070bc5 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -98,6 +98,7 @@ public class BlockPosition extends BaseBlockPosition {
@ -4459,7 +4459,7 @@ index ac7c9efc53123e4fa964b33f67cf8196846056cc..f45b5ddc66024e993ac94436ee25a03e
private final MinecraftServer server;
public final WorldDataServer worldDataServer; // CraftBukkit - type
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 993fae70fe6844581b2a52bd4df8088539d49b8a..2097ea9b2683bf4063fbcb601720e8d297fb3b13 100644
index 6a797a0ac8ca3f120eea5bd9c54de21a4f38b257..f1c4ae9997d5d11d903360dbccf45f3c1df078bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -85,6 +85,7 @@ public final class CraftItemStack extends ItemStack {

Datei anzeigen

@ -79,7 +79,7 @@ index 76091ab3f149decc0d3c848b79edd24e20cf181d..a360711ea14983e8df34caa5edda80a0
public boolean hasEnchantments() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 2097ea9b2683bf4063fbcb601720e8d297fb3b13..52fbc33dab7090075146e04388262f91ae027f2d 100644
index f1c4ae9997d5d11d903360dbccf45f3c1df078bc..9e0db30c5f99164412e97a1cdd865ca254861a78 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -178,28 +178,11 @@ public final class CraftItemStack extends ItemStack {

Datei anzeigen

@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index c55c7d765d179c8d78929fe3395ce3e147f8daea..0a29a851c4bd5ef9745c93e29a8c580baece00da 100644
index 97a58900ac1622e84b8bed87004c7dd85067d31e..efa013a8bf91df0b71cbf01d2c1b1099ac616c57 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -325,4 +325,10 @@ public final class CraftItemFactory implements ItemFactory {
@@ -326,4 +326,10 @@ public final class CraftItemFactory implements ItemFactory {
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
return ((CraftMetaItem) meta).updateMaterial(material);
}

Datei anzeigen

@ -34,10 +34,10 @@ index ea7cb9943dc6da7a05e0841985eb1be4b6bc5169..c83ba9d9869f8ba51df17963d530536d
public abstract boolean b(String s);
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 0a29a851c4bd5ef9745c93e29a8c580baece00da..9dcc81140a803c07c839faa115db81ff09e22515 100644
index efa013a8bf91df0b71cbf01d2c1b1099ac616c57..0d62f3ae939557b73c79792d6c2a0fd42513c8b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -330,5 +330,18 @@ public final class CraftItemFactory implements ItemFactory {
@@ -331,5 +331,18 @@ public final class CraftItemFactory implements ItemFactory {
public ItemStack ensureServerConversions(ItemStack item) {
return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
}

Datei anzeigen

@ -39,7 +39,7 @@ index 5e5bb5aaa3d8f4e8f4b00ba8bee059ec79f82b43..2b06c95b4fac97513e706ef073fdd741
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 1d75200e73f3eaccca4040853a14cfa35a09a2ea..20a294723869756495b4bd5c23846be4049d52a6 100644
index 606a89a905396a020a3497aa293f64a04c693c7b..12b8d544566888dc77bc2c8748d78f09c4bb3b76 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -308,6 +308,20 @@ public class CraftBlock implements Block {

Datei anzeigen

@ -18,7 +18,7 @@ index c4d034c6a6ff176bc954c00c328512bdf67455a6..7b2010ec4955fb5788c60178c6e306ea
return this.getItem().e_(this);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 52fbc33dab7090075146e04388262f91ae027f2d..2146d1354c48b9a76b24bca321b578d401e1a0a8 100644
index 9e0db30c5f99164412e97a1cdd865ca254861a78..c6173133cc458fe5a5fe6f431ab79a9abb15101e 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -174,6 +174,13 @@ public final class CraftItemStack extends ItemStack {

Datei anzeigen

@ -62,7 +62,7 @@ index 8b202b342f899a38b989b683bd8be4f5c4061f48..1842e69839a65e7b8d2c47fd30ec8f31
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index b61651fcd6605cd8638ce14f15e41b878add3f1c..b25b84d017ee610d8f006536fdfa63e840474a9b 100644
index f1ad6ad22a59b28d2e8aeb2c0f4c21bce6070bc5..48410cfbfe203dbe533294a7e4f261dba9c327cb 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -81,6 +81,7 @@ public class BlockPosition extends BaseBlockPosition {

Datei anzeigen

@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 2146d1354c48b9a76b24bca321b578d401e1a0a8..3541fed804b9bbfbd8c658d6c03a74c3dd4acf25 100644
index c6173133cc458fe5a5fe6f431ab79a9abb15101e..8af956955c8399cb62df8cbb4fc0ae6c87cdc187 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -561,7 +561,7 @@ public final class CraftItemStack extends ItemStack {
@@ -562,7 +562,7 @@ public final class CraftItemStack extends ItemStack {
@Override
public boolean hasItemMeta() {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Optimize BlockPosition helper methods
Resolves #1338
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index b25b84d017ee610d8f006536fdfa63e840474a9b..37570a3bbb9a36133d012350eca1685cca68c73b 100644
index 48410cfbfe203dbe533294a7e4f261dba9c327cb..b50d86b39d2296e1dfb9aaaeb8f8f6f62a4e7430 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -113,57 +113,74 @@ public class BlockPosition extends BaseBlockPosition {

Datei anzeigen

@ -84,10 +84,10 @@ index 957799e034ad8bc7201815b849244b7a809fb666..2301b38ac3b488809d2f624055ad3e23
return this.ab;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 20a294723869756495b4bd5c23846be4049d52a6..2e24b75d2b56dc40d05200ddded817d6ae06803c 100644
index 12b8d544566888dc77bc2c8748d78f09c4bb3b76..bda3e17ae7a5de98ef94f37307df302fefa3675f 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -717,4 +717,11 @@ public class CraftBlock implements Block {
@@ -718,4 +718,11 @@ public class CraftBlock implements Block {
AxisAlignedBB aabb = shape.getBoundingBox();
return new BoundingBox(getX() + aabb.minX, getY() + aabb.minY, getZ() + aabb.minZ, getX() + aabb.maxX, getY() + aabb.maxY, getZ() + aabb.maxZ);
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add effect to block break naturally
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 2e24b75d2b56dc40d05200ddded817d6ae06803c..c50277fb107c562c00f9d803967b4121e427f40e 100644
index bda3e17ae7a5de98ef94f37307df302fefa3675f..9b0e868f006a34b47ef9a48c7ea844be8122c291 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -619,6 +619,13 @@ public class CraftBlock implements Block {
@@ -620,6 +620,13 @@ public class CraftBlock implements Block {
@Override
public boolean breakNaturally(ItemStack item) {
@ -22,7 +22,7 @@ index 2e24b75d2b56dc40d05200ddded817d6ae06803c..c50277fb107c562c00f9d803967b4121
// Order matters here, need to drop before setting to air so skulls can get their data
net.minecraft.server.IBlockData iblockdata = this.getNMS();
net.minecraft.server.Block block = iblockdata.getBlock();
@@ -628,6 +635,7 @@ public class CraftBlock implements Block {
@@ -629,6 +636,7 @@ public class CraftBlock implements Block {
// Modelled off EntityHuman#hasBlock
if (block != Blocks.AIR && (item == null || !iblockdata.isAlwaysDestroyable() || nmsItem.canDestroySpecialBlock(iblockdata))) {
net.minecraft.server.Block.dropItems(iblockdata, world.getMinecraftWorld(), position, world.getTileEntity(position), null, nmsItem);

Datei anzeigen

@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..3edc8e52e06a62ce9f8cc734fd7458b3
+ }
+}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 37570a3bbb9a36133d012350eca1685cca68c73b..9fb776318c10f393eb6d94e5112c454a7cd246b9 100644
index b50d86b39d2296e1dfb9aaaeb8f8f6f62a4e7430..2d3e73ef92c7b88d49f8eb27233cb823b425ea4a 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -402,6 +402,7 @@ public class BlockPosition extends BaseBlockPosition {

Datei anzeigen

@ -878,7 +878,7 @@ index 0000000000000000000000000000000000000000..118988c39e58f28e8a2851792b9c014f
+ }
+}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 9fb776318c10f393eb6d94e5112c454a7cd246b9..adfeeefbbc307a77738c2cc8d82856cd02c2285e 100644
index 2d3e73ef92c7b88d49f8eb27233cb823b425ea4a..163a6c83a2e494e28981974ef9accd3255e562c2 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -104,6 +104,7 @@ public class BlockPosition extends BaseBlockPosition {

Datei anzeigen

@ -7,7 +7,7 @@ Inline bit operations and reduce instruction count to make these hot
operations faster
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index adfeeefbbc307a77738c2cc8d82856cd02c2285e..52b2bff9ee3ccb4cea9549542b2b484685a70bfb 100644
index 163a6c83a2e494e28981974ef9accd3255e562c2..551ca4471fa3e80fd812938bfce53ca1854dc94d 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -53,28 +53,29 @@ public class BlockPosition extends BaseBlockPosition {

Datei anzeigen

@ -1,64 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MiniDigger <admin@minidigger.me>
Date: Fri, 26 Jun 2020 16:51:44 +0200
Subject: [PATCH] FIX DIS SHIT
diff --git a/src/main/java/net/minecraft/server/SensorHoglinSpecific.java b/src/main/java/net/minecraft/server/SensorHoglinSpecific.java
index 40900c51dfdc20b2ce1516f78efd14f61643291a..f5d12bf371bf196d69c8a6569c64015a1d75b042 100644
--- a/src/main/java/net/minecraft/server/SensorHoglinSpecific.java
+++ b/src/main/java/net/minecraft/server/SensorHoglinSpecific.java
@@ -19,7 +19,7 @@ public class SensorHoglinSpecific extends Sensor<EntityHoglin> {
protected void a(WorldServer worldserver, EntityHoglin entityhoglin) {
BehaviorController<?> behaviorcontroller = entityhoglin.getBehaviorController();
- behaviorcontroller.setMemory(MemoryModuleType.NEAREST_REPELLENT, this.b(worldserver, entityhoglin));
+ // behaviorcontroller.setMemory(MemoryModuleType.NEAREST_REPELLENT, this.bb(worldserver, entityhoglin)); // Paper - fix dis shit (for now) + rename
Optional<EntityPiglin> optional = Optional.empty();
int i = 0;
List<EntityHoglin> list = Lists.newArrayList();
@@ -42,12 +42,12 @@ public class SensorHoglinSpecific extends Sensor<EntityHoglin> {
}
behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, optional);
- behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, (Object) list);
- behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, (Object) i);
- behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, (Object) list.size());
+ behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, list); // Paper - decomp fix
+ behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, i); // Paper - decomp fix
+ behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, list.size()); // Paper - decomp fix
}
- private Optional<BlockPosition> b(WorldServer worldserver, EntityHoglin entityhoglin) {
+ private Optional<BlockPosition> bb(WorldServer worldserver, EntityHoglin entityhoglin) { // Paper - rename
return BlockPosition.a(entityhoglin.getChunkCoordinates(), 8, 4, (blockposition) -> {
return worldserver.getType(blockposition).a((Tag) TagsBlock.HOGLIN_REPELLENTS);
});
diff --git a/src/main/java/net/minecraft/server/SensorPiglinSpecific.java b/src/main/java/net/minecraft/server/SensorPiglinSpecific.java
index 2b11bc960a004714a9d725575d2470588d5801fb..4cc50f38e901f5dde4576a91cf4d6797fb45631a 100644
--- a/src/main/java/net/minecraft/server/SensorPiglinSpecific.java
+++ b/src/main/java/net/minecraft/server/SensorPiglinSpecific.java
@@ -21,7 +21,7 @@ public class SensorPiglinSpecific extends Sensor<EntityLiving> {
protected void a(WorldServer worldserver, EntityLiving entityliving) {
BehaviorController<?> behaviorcontroller = entityliving.getBehaviorController();
- behaviorcontroller.setMemory(MemoryModuleType.NEAREST_REPELLENT, c(worldserver, entityliving));
+// behaviorcontroller.setMemory(MemoryModuleType.NEAREST_REPELLENT, c(worldserver, entityliving)); // Paper - fix dis shit (for now)
Optional<EntityInsentient> optional = Optional.empty();
Optional<EntityHoglin> optional1 = Optional.empty();
Optional<EntityHoglin> optional2 = Optional.empty();
@@ -92,10 +92,10 @@ public class SensorPiglinSpecific extends Sensor<EntityLiving> {
behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, optional4);
behaviorcontroller.setMemory(MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD, optional5);
behaviorcontroller.setMemory(MemoryModuleType.NEAREST_PLAYER_HOLDING_WANTED_ITEM, optional6);
- behaviorcontroller.setMemory(MemoryModuleType.NEAREST_ADULT_PIGLINS, (Object) list1);
- behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, (Object) list);
- behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, (Object) list.size());
- behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, (Object) i);
+ behaviorcontroller.setMemory(MemoryModuleType.NEAREST_ADULT_PIGLINS, list1); // Paper - decomp fix
+ behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, list); // Paper - decomp fix
+ behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, list.size()); // Paper - decomp fix
+ behaviorcontroller.setMemory(MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, i); // Paper - decomp fix
}
private static Optional<BlockPosition> c(WorldServer worldserver, EntityLiving entityliving) {