More 1.14 patches

This commit is contained in:
Spottedleaf 2019-04-28 20:14:31 -07:00
parent 567bd0fcac
commit cab9529fe8
19 changed files with 85 additions and 206 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add method to open already placed sign
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index d5dbc4ca81..9b19dce9bd 100644 index c2b6e792a..6478d6126 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {

View File

@ -8,7 +8,7 @@ This API has more capabilities than .dropItem with the Consumer function
Item can be set inside of the Consumer pre spawn function. Item can be set inside of the Consumer pre spawn function.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 1ed6e86855..1cc42edae8 100644 index ab54624d6..3ed9d3f47 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -0,0 +0,0 @@ public class CraftWorld implements World {

View File

@ -12,7 +12,7 @@ This disables that by not saving the thrower when the chunk is unloaded.
This is mainly useful for survival servers that do not allow freeform teleporting. This is mainly useful for survival servers that do not allow freeform teleporting.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 6fb76388e9..0a270b899d 100644 index 7024336c3..fe9415b1d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -27,7 +27,7 @@ index 6fb76388e9..0a270b899d 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index bab5b89fe9..62b5b6ecea 100644 index bb4679cf7..c19828ed5 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java --- a/src/main/java/net/minecraft/server/EntityProjectile.java
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java
@@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile { @@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Call PaperServerListPingEvent for legacy pings
diff --git a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java diff --git a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java
new file mode 100644 new file mode 100644
index 0000000000..74c012fd40 index 000000000..74c012fd4
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java +++ b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -84,7 +84,7 @@ index 0000000000..74c012fd40
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
index 2a99f34df6..2a30af7def 100644 index 9bc1cce3f..e086b4140 100644
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -105,7 +105,7 @@ index 2a99f34df6..2a30af7def 100644
switch (i) { switch (i) {
case 0: case 0:
LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); LegacyPingHandler.LOGGER.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("%s\u00a7%d\u00a7%d", event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit - s = String.format("%s\u00a7%d\u00a7%d", event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit
+ // Paper start - Call PaperServerListPingEvent and use results + // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); + event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
@ -120,7 +120,7 @@ index 2a99f34df6..2a30af7def 100644
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
} }
LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); LegacyPingHandler.LOGGER.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit - s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit
+ // Paper start - Call PaperServerListPingEvent and use results + // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 127, null); // Paper + event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 127, null); // Paper

View File

@ -1,126 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 00:32:22 -0400
Subject: [PATCH] Configurable Villages loading chunks for door checks
This avoids villages spam loading chunks sync.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0a270b899d..4727ac6eb5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
disableEnderpearlExploit = getBoolean("game-mechanics.disable-unloaded-chunk-enderpearl-exploit", disableEnderpearlExploit);
log("Disable Unloaded Chunk Enderpearl Exploit: " + (disableEnderpearlExploit ? "enabled" : "disabled"));
}
+
+ public boolean villagesLoadChunks = false;
+ private void villagesLoadChunks() {
+ villagesLoadChunks = getBoolean("game-mechanics.villages-load-chunks", false);
+ if (villagesLoadChunks) {
+ log("Villages can load chunks - Warning this can cause intense TPS loss. Strongly consider disabling this.");
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/PersistentVillage.java b/src/main/java/net/minecraft/server/PersistentVillage.java
index 7a9fb97530..e40cd41869 100644
--- a/src/main/java/net/minecraft/server/PersistentVillage.java
+++ b/src/main/java/net/minecraft/server/PersistentVillage.java
@@ -0,0 +0,0 @@ public class PersistentVillage extends PersistentBase {
for (int j = -4; j < 4; ++j) {
for (int k = -16; k < 16; ++k) {
blockposition_mutableblockposition.g(blockposition).d(i, j, k);
- IBlockData iblockdata = this.world.getType(blockposition_mutableblockposition);
+ IBlockData iblockdata = this.world.paperConfig.villagesLoadChunks ? this.world.getType(blockposition_mutableblockposition) : this.world.getTypeIfLoaded(blockposition_mutableblockposition); // Paper
if (this.a(iblockdata)) {
VillageDoor villagedoor = this.c(blockposition_mutableblockposition);
@@ -0,0 +0,0 @@ public class PersistentVillage extends PersistentBase {
}
private boolean a(IBlockData iblockdata) {
- return iblockdata.getBlock() instanceof BlockDoor && iblockdata.getMaterial() == Material.WOOD;
+ return iblockdata != null && iblockdata.getBlock() instanceof BlockDoor && iblockdata.getMaterial() == Material.WOOD; // Paper
}
public void a(NBTTagCompound nbttagcompound) {
diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java
index b794572915..1363c53ff0 100644
--- a/src/main/java/net/minecraft/server/Village.java
+++ b/src/main/java/net/minecraft/server/Village.java
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public class Village {
- private World a;
+ private World a; private World getWorld() { return a; } // Paper - OBFHELPER
private final List<VillageDoor> b = Lists.newArrayList();
private BlockPosition c;
- private BlockPosition d;
+ private BlockPosition d;private BlockPosition getCenter() { return d; } // Paper - OBFHELPER
private int e;
private int f;
private int g;
@@ -0,0 +0,0 @@ public class Village {
}
public void a(int i) {
+ // Paper - don't tick village if chunk isn't loaded
+ Chunk chunk = getWorld().getChunkIfLoaded(getCenter());
+ if (chunk == null || !chunk.areNeighborsLoaded(1)) {
+ return;
+ }
+ // Paper end
this.g = i;
this.m();
this.l();
@@ -0,0 +0,0 @@ public class Village {
while (iterator.hasNext()) {
VillageDoor villagedoor = (VillageDoor) iterator.next();
+ // Paper start - don't remove doors from unloaded chunks
+ if (!getWorld().isLoaded(villagedoor.getPosition())) {
+ villagedoor.setLastSeen(villagedoor.getLastSeen() + 1);
+ continue;
+ }
+ // Paper end
if (flag1) {
villagedoor.a();
@@ -0,0 +0,0 @@ public class Village {
}
private boolean g(BlockPosition blockposition) {
- IBlockData iblockdata = this.a.getType(blockposition);
+ IBlockData iblockdata = this.a.paperConfig.villagesLoadChunks ? this.a.getType(blockposition) : this.a.getTypeIfLoaded(blockposition); // Paper
+ if (iblockdata == null) return false; // Paper
+
Block block = iblockdata.getBlock();
return block instanceof BlockDoor ? iblockdata.getMaterial() == Material.WOOD : false;
diff --git a/src/main/java/net/minecraft/server/VillageDoor.java b/src/main/java/net/minecraft/server/VillageDoor.java
index 33ad5faa3e..1edffc4629 100644
--- a/src/main/java/net/minecraft/server/VillageDoor.java
+++ b/src/main/java/net/minecraft/server/VillageDoor.java
@@ -0,0 +0,0 @@ public class VillageDoor {
return this.f;
}
+ public BlockPosition getPosition() { return d(); } // Paper - OBFHELPER
public BlockPosition d() {
return this.a;
}
@@ -0,0 +0,0 @@ public class VillageDoor {
return this.c.getAdjacentZ() * 2;
}
+ public int getLastSeen() { return h(); } // Paper - OBFHELPER
public int h() {
return this.d;
}
+ public void setLastSeen(int i) { a(i); } // Paper - OBFHELPER
public void a(int i) {
this.d = i;
}
--

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable sprint interruption on attack
If the sprint interruption is disabled players continue sprinting when they attack entities. If the sprint interruption is disabled players continue sprinting when they attack entities.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f68b8a4b05..6fb76388e9 100644 index 32bfe0e46..7024336c3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -20,13 +20,13 @@ index f68b8a4b05..6fb76388e9 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 7f29d12771..d4618d644a 100644 index 1df83d13a..27bf83f37 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java --- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
}
this.motX *= 0.6D; this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D));
this.motZ *= 0.6D;
- this.setSprinting(false); - this.setSprinting(false);
+ // Paper start - Configuration option to disable automatic sprint interruption + // Paper start - Configuration option to disable automatic sprint interruption
+ if (!world.paperConfig.disableSprintInterruptionOnAttack) { + if (!world.paperConfig.disableSprintInterruptionOnAttack) {

View File

@ -6,19 +6,19 @@ Subject: [PATCH] Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 8949529e67..233568cc12 100644 index 2b484c819..e441fa234 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java --- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
super.mobTick(); super.mobTick();
} }
+ public boolean teleportRandomly() { return dz(); } // Paper - OBFHELPER + public final boolean teleportRandomly() { return this.dW(); } // Paper - OBFHELPER
protected boolean dz() { protected boolean dW() {
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D; double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
double d1 = this.locY + (double) (this.random.nextInt(64) - 32); double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
index b81693d9ff..9bc6a6c0c1 100644 index da8a70d6a..e56da9085 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
@@ -0,0 +0,0 @@ public class CraftEnderman extends CraftMonster implements Enderman { @@ -0,0 +0,0 @@ public class CraftEnderman extends CraftMonster implements Enderman {

View File

@ -8,7 +8,7 @@ Allow control over whether or not an enderman aggros a player.
This allows you to override/extend the pumpkin/stare logic. This allows you to override/extend the pumpkin/stare logic.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 233568cc12..139a70ca3b 100644 index e441fa234..a1033ce28 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java --- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {

View File

@ -8,17 +8,17 @@ Fires an event anytime an enderman intends to teleport away from the player
You may cancel this, enabling ranged attacks to damage the enderman for example. You may cancel this, enabling ranged attacks to damage the enderman for example.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index d5d1be8b6b..8949529e67 100644 index 9f2e350b3..2b484c819 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java --- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@ package net.minecraft.server;
package net.minecraft.server;
import java.util.EnumSet;
import java.util.Optional; import java.util.Optional;
+import com.destroystokyo.paper.event.entity.EndermanEscapeEvent; // Paper +import com.destroystokyo.paper.event.entity.EndermanEscapeEvent; // Paper
import java.util.Random; import java.util.Random;
import java.util.UUID; import java.util.UUID;
import java.util.function.Function; import java.util.function.Predicate;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true); setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true);
} }
@ -33,48 +33,51 @@ index d5d1be8b6b..8949529e67 100644
public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) {
if (!super.setGoalTarget(entityliving, reason, fireEvent)) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
if (this.world.L() && this.ticksLived >= this.bE + 600) { if (this.world.J() && this.ticksLived >= this.bC + 600) {
float f = this.az(); float f = this.aE();
- if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { - if (f > 0.5F && this.world.f(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
+ if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper + if (f > 0.5F && this.world.f(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
this.setGoalTarget((EntityLiving) null); this.setGoalTarget((EntityLiving) null);
this.dz(); this.dW();
} }
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
public boolean damageEntity(DamageSource damagesource, float f) { } else if (!(damagesource instanceof EntityDamageSourceIndirect) && damagesource != DamageSource.FIREWORKS) {
if (this.isInvulnerable(damagesource)) {
return false;
- } else if (damagesource instanceof EntityDamageSourceIndirect) {
+ } else if (damagesource instanceof EntityDamageSourceIndirect && tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper
for (int i = 0; i < 64; ++i) {
if (this.dz()) {
return true;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
} else {
boolean flag = super.damageEntity(damagesource, f); boolean flag = super.damageEntity(damagesource, f);
- if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) { - if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) {
+ if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper + if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper
this.dz(); this.dW();
} }
return flag;
} else {
+ if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
for (int i = 0; i < 64; ++i) {
if (this.dW()) {
return true;
}
}
+ } // Paper end
return false;
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget<EntityHuman> { static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
- private final EntityEnderman i; - private final EntityEnderman i;
+ private final EntityEnderman i; public EntityEnderman getEnderman() { return i; } // Paper - OBFHELPER + private final EntityEnderman i; public final EntityEnderman getEnderman() { return this.i; } // Paper - OBFHELPER
private EntityHuman j; private EntityHuman j;
private int k; private int k;
private int l; private int l;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
} else { } else {
if (this.d != null) { if (this.c != null && !this.i.isPassenger()) {
if (this.i.f((EntityHuman) this.d)) { if (this.i.f((EntityHuman) this.c)) {
- if (((EntityHuman) this.d).h(this.i) < 16.0D) { - if (this.c.h((Entity) this.i) < 16.0D) {
+ if (((EntityHuman) this.d).h(this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper + if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) {
this.i.dz(); this.i.dW();
} }
-- --

View File

@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use. This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ee09f4c5a0..e4730352d3 100644 index bbf676958..e400cc05d 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -0,0 +0,0 @@ public class WorldServer extends World {
} }
public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) {
@ -34,7 +34,7 @@ index ee09f4c5a0..e4730352d3 100644
if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index d72f393a75..1ed6e86855 100644 index 3fbc48150..ab54624d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -0,0 +0,0 @@ public class CraftWorld implements World {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 2f00929f63..6dea9456a4 100644 index 25c86b53e..c9caf4423 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
String[] lines = new String[4]; String[] lines = new String[4];
for (int i = 0; i < astring.length; ++i) { for (int i = 0; i < astring.length; ++i) {

View File

@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk. provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 66873e98fe..62235efde9 100644 index 1aff6cab9..01e260024 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
index d2b29ecbe0..2af225021b 100644 index 5dd670615..734d04c09 100644
--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
@@ -0,0 +0,0 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick @@ -0,0 +0,0 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick

View File

@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 927394333a..c1b6eb52bf 100644 index b7d327211..2acd02f2f 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java --- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -0,0 +0,0 @@ public final class ItemStack { @@ -0,0 +0,0 @@ public final class ItemStack {
@ -15,10 +15,10 @@ index 927394333a..c1b6eb52bf 100644
+ public int getItemUseMaxDuration() { return k(); } // Paper - OBFHELPER + public int getItemUseMaxDuration() { return k(); } // Paper - OBFHELPER
public int k() { public int k() {
return this.getItem().c(this); return this.getItem().f_(this);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 69faeb9c09..bc8fb28163 100644 index 4d8013685..1a7849767 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack { @@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack {

View File

@ -5,15 +5,15 @@ Subject: [PATCH] Load version history at server start
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 0d2c7a6dc4..437ac386ac 100644 index d9f1c2205..c2c676e3b 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java --- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
return false; return false;
} }
com.destroystokyo.paper.PaperConfig.registerCommands(); com.destroystokyo.paper.PaperConfig.registerCommands();
+ com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now + com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
// Paper end // Paper end
DedicatedServer.LOGGER.info("Generating keypair"); this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
-- --

View File

@ -6,16 +6,16 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes Otherwise the creeper infinite explodes
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
index b6af429044..a07337ae40 100644 index 9f03d0337..29569805c 100644
--- a/src/main/java/net/minecraft/server/EntityCreeper.java --- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
- private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); - private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
+ private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);private static final DataWatcherObject<Boolean> isIgnitedDW = c; // Paper OBFHELPER + private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> isIgnitedDW = d; // Paper OBFHELPER
private int bC; private int bz;
private int fuseTicks; private int fuseTicks;
public int maxFuseTicks = 30; public int maxFuseTicks = 30;
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand Fires when a witch consumes the potion in their hand
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index eaae9ea9af..0d579c7e47 100644 index 477b53fa7..abac47d4c 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java --- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { @@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a); this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a);
if (itemstack.getItem() == Items.POTION) { if (itemstack.getItem() == Items.POTION) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] WitchReadyPotionEvent
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index 62f99fc3b7..feedfc9d9c 100644 index b9307d380..ae9efb72c 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java --- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { @@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
} }
if (potionregistry != null) { if (potionregistry != null) {
@ -18,7 +18,7 @@ index 62f99fc3b7..feedfc9d9c 100644
+ org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); + org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
+ this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); + this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
+ // Paper end + // Paper end
this.bC = this.getItemInMainHand().k(); this.bB = this.getItemInMainHand().k();
this.a(true); this.s(true);
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.bV(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
-- --

View File

@ -6,14 +6,13 @@ Subject: [PATCH] WitchThrowPotionEvent
Fired when a witch throws a potion at a player Fired when a witch throws a potion at a player
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index 0d579c7e47..62f99fc3b7 100644 index abac47d4c..b9307d380 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java --- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { @@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
potionregistry = Potions.M; potionregistry = Potions.M;
} }
- EntityPotion entitypotion = new EntityPotion(this.world, this, PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry));
+ // Paper start + // Paper start
+ ItemStack potion = PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry); + ItemStack potion = PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry);
+ com.destroystokyo.paper.event.entity.WitchThrowPotionEvent event = new com.destroystokyo.paper.event.entity.WitchThrowPotionEvent((org.bukkit.entity.Witch) this.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); + com.destroystokyo.paper.event.entity.WitchThrowPotionEvent event = new com.destroystokyo.paper.event.entity.WitchThrowPotionEvent((org.bukkit.entity.Witch) this.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
@ -21,9 +20,12 @@ index 0d579c7e47..62f99fc3b7 100644
+ return; + return;
+ } + }
+ potion = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion()); + potion = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion());
+ EntityPotion entitypotion = new EntityPotion(this.world, this, potion); EntityPotion entitypotion = new EntityPotion(this.world, this);
-
- entitypotion.setItem(PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry));
+ entitypotion.setItem(potion);
+ // Paper end + // Paper end
entitypotion.pitch -= -20.0F; entitypotion.pitch -= -20.0F;
entitypotion.shoot(d1, d2 + (double) (f1 * 0.2F), d3, 0.75F, 8.0F); entitypotion.shoot(d0, d1 + (double) (f1 * 0.2F), d2, 0.75F, 8.0F);
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
-- --