13
0
geforkt von Mirrors/Paper

Fix Piglin issue

Dieser Commit ist enthalten in:
Aikar 2020-06-27 20:32:49 -04:00
Ursprung d661902f52
Commit 5b8bdf1dbc
2 geänderte Dateien mit 43 neuen und 64 gelöschten Zeilen

Datei anzeigen

@ -1,64 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MiniDigger | Martin <admin@minidigger.dev>
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/SensorHoglinSpecific.java
+++ b/src/main/java/net/minecraft/server/SensorHoglinSpecific.java
@@ -0,0 +0,0 @@ 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();
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/SensorPiglinSpecific.java
+++ b/src/main/java/net/minecraft/server/SensorPiglinSpecific.java
@@ -0,0 +0,0 @@ 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();
@@ -0,0 +0,0 @@ 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) {

Datei anzeigen

@ -232,6 +232,49 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
return biomebase;
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ 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();
@@ -0,0 +0,0 @@ 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;
}
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java