mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
More patches for 1.14
This commit is contained in:
parent
f542bdef09
commit
3f43b7abe8
40 changed files with 537 additions and 546 deletions
|
@ -5,28 +5,28 @@ Subject: [PATCH] Add More Creeper API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
index a07337ae40..945a75dd62 100644
|
||||
index 29569805c..0c2c3c730 100644
|
||||
--- a/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 {
|
||||
private static final DataWatcherObject<Boolean> b = 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 int bC;
|
||||
private static final DataWatcherObject<Boolean> POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
|
||||
private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> isIgnitedDW = d; // Paper OBFHELPER
|
||||
private int bz;
|
||||
- private int fuseTicks;
|
||||
+ public int fuseTicks; // Paper - public
|
||||
public int maxFuseTicks = 30;
|
||||
public int explosionRadius = 3;
|
||||
private int bG;
|
||||
private int bD;
|
||||
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
|
||||
return super.a(entityhuman, enumhand);
|
||||
}
|
||||
|
||||
+ public void explode() { this.dE(); } // Paper - OBFHELPER
|
||||
private void dE() {
|
||||
+ public void explode() { this.eb(); } // Paper - OBFHELPER
|
||||
private void eb() {
|
||||
if (!this.world.isClientSide) {
|
||||
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
|
||||
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean("mobGriefing") ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
||||
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
|
||||
return (Boolean) this.datawatcher.get(EntityCreeper.c);
|
||||
return (Boolean) this.datawatcher.get(EntityCreeper.d);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -34,20 +34,20 @@ index a07337ae40..945a75dd62 100644
|
|||
+ if (isIgnited() != ignited) {
|
||||
+ com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited);
|
||||
+ if (event.callEvent()) {
|
||||
+ this.datawatcher.set(EntityCreeper.c, event.isIgnited());
|
||||
+ this.datawatcher.set(EntityCreeper.d, event.isIgnited());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public void dB() {
|
||||
- this.datawatcher.set(EntityCreeper.c, true);
|
||||
public void dY() {
|
||||
- this.datawatcher.set(EntityCreeper.d, true);
|
||||
+ setIgnited(true);
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public boolean canCauseHeadDrop() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
||||
index ffebb54caa..ab2b20a0d4 100644
|
||||
index 2f2abb707..e54664661 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
||||
@@ -0,0 +0,0 @@ public class CraftCreeper extends CraftMonster implements Creeper {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index a99d90efcb..f576264a8d 100644
|
||||
index e5ed5a3dc..e5d032d02 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
@ -19,10 +19,10 @@ index a99d90efcb..f576264a8d 100644
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
nbttagcompound.setInt("AY", this.c.getY());
|
||||
nbttagcompound.setInt("AZ", this.c.getZ());
|
||||
nbttagcompound.setInt("AY", this.d.getY());
|
||||
nbttagcompound.setInt("AZ", this.d.getZ());
|
||||
nbttagcompound.setInt("Size", this.getSize());
|
||||
+ // Paper start
|
||||
+ if (this.spawningEntity != null) {
|
||||
|
@ -31,9 +31,9 @@ index a99d90efcb..f576264a8d 100644
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
public SoundCategory bV() {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
return true;
|
||||
return entitysize.a(f);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -46,9 +46,9 @@ index a99d90efcb..f576264a8d 100644
|
|||
+
|
||||
class b extends PathfinderGoal {
|
||||
|
||||
private int b;
|
||||
private final PathfinderTargetCondition b;
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
index 5c43d908f0..5ddf66eef5 100644
|
||||
index 9f64d81c6..11098cd13 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
@@ -0,0 +0,0 @@ public class MobSpawnerPhantom {
|
||||
|
@ -64,14 +64,14 @@ index 5c43d908f0..5ddf66eef5 100644
|
|||
+ continue;
|
||||
+ }
|
||||
+ // Paper end
|
||||
EntityPhantom entityphantom = new EntityPhantom(world);
|
||||
EntityPhantom entityphantom = (EntityPhantom) EntityTypes.PHANTOM.a((World) worldserver);
|
||||
-
|
||||
+ entityphantom.spawningEntity = entityhuman.uniqueID; // Paper
|
||||
entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F);
|
||||
groupdataentity = entityphantom.prepare(difficultydamagescaler, groupdataentity, (NBTTagCompound) null);
|
||||
world.addEntity(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
|
||||
groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
|
||||
worldserver.addEntity(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
|
||||
index 9f9ee92390..2b97313694 100644
|
||||
index 9f9ee9239..2b9731369 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPhantom extends CraftFlying implements Phantom {
|
||||
|
|
|
@ -14,7 +14,7 @@ forwarding, and is integrated into the Minecraft login process by using the 1.13
|
|||
login plugin message packet.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index e4972e30ce..cac79686d8 100644
|
||||
index 6a2eb12ba..ee282cb35 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ import java.io.IOException;
|
||||
|
@ -55,7 +55,7 @@ index e4972e30ce..cac79686d8 100644
|
|||
}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java
|
||||
new file mode 100644
|
||||
index 0000000000..fdd8708f97
|
||||
index 000000000..fdd8708f9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -127,10 +127,10 @@ index 0000000000..fdd8708f97
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index c5801122dd..ca76f2a380 100644
|
||||
index d4d752ddb..5d46a975e 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
||||
private SecretKey loginKey;
|
||||
private EntityPlayer l;
|
||||
public String hostname = ""; // CraftBukkit - add field
|
||||
|
@ -138,9 +138,9 @@ index c5801122dd..ca76f2a380 100644
|
|||
|
||||
public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
|
||||
this.g = LoginListener.EnumProtocolState.HELLO;
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
||||
this.g = LoginListener.EnumProtocolState.KEY;
|
||||
this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.E().getPublic(), this.e));
|
||||
this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e));
|
||||
} else {
|
||||
+ // Paper start - Velocity support
|
||||
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport) {
|
||||
|
@ -153,7 +153,7 @@ index c5801122dd..ca76f2a380 100644
|
|||
// Spigot start
|
||||
// Paper start - Cache authenticator threads
|
||||
authenticatorPool.execute(new Runnable() {
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
||||
public class LoginHandler {
|
||||
|
||||
public void fireEvents() throws Exception {
|
||||
|
@ -166,7 +166,7 @@ index c5801122dd..ca76f2a380 100644
|
|||
String playerName = i.getName();
|
||||
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
|
||||
java.util.UUID uniqueId = i.getId();
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
||||
// Spigot end
|
||||
|
||||
public void a(PacketLoginInCustomPayload packetloginincustompayload) {
|
||||
|
@ -203,7 +203,7 @@ index c5801122dd..ca76f2a380 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 4c1110479c..c536979140 100644
|
||||
index 6c5544807..38386d588 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
@ -216,23 +216,23 @@ index 4c1110479c..c536979140 100644
|
|||
public java.util.UUID spoofedUUID;
|
||||
public com.mojang.authlib.properties.Property[] spoofedProfile;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
index b95836d443..621aad1503 100644
|
||||
index fa2d3ce8c..dac560c63 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
||||
return this.d(oenum.ordinal());
|
||||
}
|
||||
|
||||
+ public int readVarInt() { return this.g(); } // Paper - OBFHELPER
|
||||
public int g() {
|
||||
+ public int readVarInt() { return i(); } // Paper - OBFHELPER
|
||||
public int i() {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
||||
return this;
|
||||
}
|
||||
|
||||
+ public UUID readUUID() { return this.i(); } // Paper - OBFHELPER
|
||||
public UUID i() {
|
||||
+ public UUID readUUID() { return k(); } // Paper - OBFHELPER
|
||||
public UUID k() {
|
||||
return new UUID(this.readLong(), this.readLong());
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
||||
|
@ -241,10 +241,10 @@ index b95836d443..621aad1503 100644
|
|||
|
||||
+ public String readUTF(int maxLength) { return this.e(maxLength); } // Paper - OBFHELPER
|
||||
public String e(int i) {
|
||||
int j = this.g();
|
||||
int j = this.i();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java
|
||||
index bdac03da43..430445cc6d 100644
|
||||
index 4d1f44139..c1ca6f950 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java
|
||||
@@ -0,0 +0,0 @@ import java.io.IOException;
|
||||
|
@ -259,7 +259,7 @@ index bdac03da43..430445cc6d 100644
|
|||
public PacketLoginInCustomPayload() {}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java
|
||||
index 345843a7f2..23c96f44b3 100644
|
||||
index ae74dc9e1..7eb230f1b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java
|
||||
@@ -0,0 +0,0 @@ public class PacketLoginOutCustomPayload implements Packet<PacketLoginOutListene
|
||||
|
@ -274,7 +274,7 @@ index 345843a7f2..23c96f44b3 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public void a(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
this.a = packetdataserializer.g();
|
||||
this.b = packetdataserializer.l();
|
||||
this.a = packetdataserializer.i();
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
index feedfc9d9c..955e0e19b9 100644
|
||||
index ae9efb72c..3cbb34a0c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -20,32 +20,32 @@ index feedfc9d9c..955e0e19b9 100644
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
@@ -0,0 +0,0 @@ import java.util.function.Predicate;
|
||||
public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
|
||||
private static final UUID a = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
|
||||
- private static final AttributeModifier b = (new AttributeModifier(EntityWitch.a, "Drinking speed penalty", -0.25D, 0)).a(false);
|
||||
+ private static final AttributeModifier b = (new AttributeModifier(EntityWitch.a, "Drinking speed penalty", -0.25D, 0)).a(false); private static final AttributeModifier DRINKING_SPEED = b; // Paper - OBFHELPER
|
||||
private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
|
||||
- private int bC;
|
||||
+ private int bC; public int getPotionUseTimeLeft() { return bC; } public void setPotionUseTimeLeft(int timeLeft) { bC = timeLeft; } // Paper - OBFHELPER
|
||||
private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
|
||||
- private static final AttributeModifier bz = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false);
|
||||
+ private static final AttributeModifier bz = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bz; // Paper - OBFHELPER
|
||||
private static final DataWatcherObject<Boolean> bA = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
|
||||
- private int bB;
|
||||
+ private int bB; public int getPotionUseTimeLeft() { return bB; } public void setPotionUseTimeLeft(int timeLeft) { bB = timeLeft; } // Paper - OBFHELPER
|
||||
private PathfinderGoalNearestHealableRaider<EntityRaider> bC;
|
||||
private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bD;
|
||||
|
||||
public EntityWitch(World world) {
|
||||
super(EntityTypes.WITCH, world);
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
return SoundEffects.ENTITY_WITCH_DEATH;
|
||||
}
|
||||
|
||||
+ public void setDrinkingPotion(boolean drinkingPotion) { a(drinkingPotion); } // Paper - OBFHELPER
|
||||
public void a(boolean flag) {
|
||||
this.getDataWatcher().set(EntityWitch.c, flag);
|
||||
+ public void setDrinkingPotion(boolean drinkingPotion) { s(drinkingPotion); } // Paper - OBFHELPER
|
||||
public void s(boolean flag) {
|
||||
this.getDataWatcher().set(EntityWitch.bA, flag);
|
||||
}
|
||||
|
||||
+ public boolean isDrinkingPotion() { return l(); } // Paper - OBFHELPER
|
||||
public boolean l() {
|
||||
return (Boolean) this.getDataWatcher().get(EntityWitch.c);
|
||||
return (Boolean) this.getDataWatcher().get(EntityWitch.bA);
|
||||
}
|
||||
@@ -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) {
|
||||
|
@ -54,27 +54,29 @@ index feedfc9d9c..955e0e19b9 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));
|
||||
- this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
|
||||
+ // Paper start - moved all this down into its own method
|
||||
+ //this.setSlot(EnumItemSlot.MAINHAND, PotionUtil.a(new ItemStack(Items.POTION), potionregistry));
|
||||
+ //this.bC = this.getItemInMainHand().k();
|
||||
+ //this.a(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);
|
||||
+ //ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry);
|
||||
+ //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.bB = this.getItemInMainHand().k();
|
||||
+ //this.s(true);
|
||||
+ //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);
|
||||
+ //AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
+ //attributeinstance.c(EntityWitch.b);
|
||||
+ //attributeinstance.b(EntityWitch.b);
|
||||
+ //attributeinstance.c(EntityWitch.bz);
|
||||
+ //attributeinstance.b(EntityWitch.bz);
|
||||
+
|
||||
+ setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry));
|
||||
// Paper end
|
||||
- this.bC = this.getItemInMainHand().k();
|
||||
- this.a(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.bB = this.getItemInMainHand().k();
|
||||
- this.s(true);
|
||||
- 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);
|
||||
- AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
-
|
||||
- attributeinstance.c(EntityWitch.b);
|
||||
- attributeinstance.b(EntityWitch.b);
|
||||
- attributeinstance.c(EntityWitch.bz);
|
||||
- attributeinstance.b(EntityWitch.bz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
super.movementTick();
|
||||
}
|
||||
|
||||
|
@ -90,28 +92,35 @@ index feedfc9d9c..955e0e19b9 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
protected float applyMagicModifier(DamageSource damagesource, float f) {
|
||||
f = super.applyMagicModifier(damagesource, f);
|
||||
if (damagesource.getEntity() == this) {
|
||||
@Override
|
||||
public SoundEffect dW() {
|
||||
return SoundEffects.ENTITY_WITCH_CELEBRATE;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
index f25998eb6d..ac465bda2e 100644
|
||||
index 49e0f2206..d157d195d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Witch;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
-import com.destroystokyo.paper.entity.CraftRangedEntity; // Paper
|
||||
import net.minecraft.server.EntityWitch;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Witch;
|
||||
+// Paper start
|
||||
+import com.destroystokyo.paper.entity.CraftRangedEntity;
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+// Paper end
|
||||
+
|
||||
public class CraftWitch extends CraftMonster implements Witch, CraftRangedEntity<EntityWitch> { // Paper
|
||||
|
||||
-public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> { // Paper
|
||||
+public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> {
|
||||
public CraftWitch(CraftServer server, EntityWitch entity) {
|
||||
super(server, entity);
|
||||
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftMonster implements Witch, CraftRangedEntity
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<
|
||||
public EntityType getType() {
|
||||
return EntityType.WITCH;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index cb32d64bd0..6367fdd469 100644
|
||||
index 2ed2960c5..064703afe 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.c(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND);
|
||||
}
|
||||
|
||||
// Paper start
|
||||
+ public MovingObjectPosition getRayTrace(int maxDistance) {
|
||||
+ return getRayTrace(maxDistance, FluidCollisionOption.NEVER);
|
||||
|
@ -32,7 +32,7 @@ index cb32d64bd0..6367fdd469 100644
|
|||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 52834b6da3..eeab59379a 100644
|
||||
index 29b23e30f..863802187 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
|
|
@ -5,31 +5,31 @@ Subject: [PATCH] Add sun related API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 856ddf2a74..d1ec201d8a 100644
|
||||
index f1621a9e9..a8318c88a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return flag;
|
||||
}
|
||||
|
||||
+ public boolean isInDaylight() { return dq(); } // Paper - OBFHELPER
|
||||
protected boolean dq() {
|
||||
if (this.world.L() && !this.world.isClientSide) {
|
||||
float f = this.az();
|
||||
+ public boolean isInDaylight() { return dS(); } // Paper - OBFHELPER
|
||||
protected boolean dS() {
|
||||
if (this.world.J() && !this.world.isClientSide) {
|
||||
float f = this.aE();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 728319968b..027bb64acc 100644
|
||||
index cfab578df..c917c39b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean isDayTime() { return L(); } // Paper - OBFHELPER
|
||||
public boolean L() {
|
||||
return this.G < 4;
|
||||
+ public boolean isDayTime() { return J(); } // Paper - OBFHELPER
|
||||
public boolean J() {
|
||||
return this.d < 4;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index eacecccfdb..7c0a530533 100644
|
||||
index a6f6046c6..5e672ae2e 100644
|
||||
--- a/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 {
|
||||
|
@ -46,7 +46,7 @@ index eacecccfdb..7c0a530533 100644
|
|||
return createExplosion(x, y, z, power, false, true);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index 53c2d154ed..40a429942e 100644
|
||||
index 53c2d154e..40a429942 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Allow chests to be placed with NBT data
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 0d06db9355..f8d82a0276 100644
|
||||
index 2d83c9e79..dec589463 100644
|
||||
--- a/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 {
|
||||
|
@ -17,7 +17,7 @@ index 0d06db9355..f8d82a0276 100644
|
|||
for (BlockState blockstate : blocks) {
|
||||
blockstate.update(true, false);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
index c46b761cc5..2e0f782f65 100644
|
||||
index d606e2e4f..f9f9183da 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Allow setting the vex's summoner
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java
|
||||
index c3864b869e..589b13f4ee 100644
|
||||
index 83e022c91..c56933068 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVex.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVex.java
|
||||
@@ -0,0 +0,0 @@ public class EntityVex extends EntityMonster {
|
||||
|
@ -14,10 +14,10 @@ index c3864b869e..589b13f4ee 100644
|
|||
|
||||
+ public void setOwner(EntityInsentient entityinsentient) { a(entityinsentient); } // Paper - OBFHELPER
|
||||
public void a(EntityInsentient entityinsentient) {
|
||||
this.b = entityinsentient;
|
||||
this.c = entityinsentient;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
index c96a5df80a..b09da64c3b 100644
|
||||
index 169c951ec..2f7df3074 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
@@ -0,0 +0,0 @@ public class CraftVex extends CraftMonster implements Vex {
|
||||
|
|
|
@ -8,7 +8,7 @@ we would reuse an existing dimension id, if some other dimension was
|
|||
unloaded before.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 3cf3037857..d4d8fbb556 100644
|
||||
index cf657167d..15756014a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -5,17 +5,17 @@ Subject: [PATCH] Call player spectator target events
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 62feadc8af..f1b7353cf8 100644
|
||||
index 634c30d93..d34daafda 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
private EntityHuman.EnumChatVisibility cs;
|
||||
private boolean ct = true;
|
||||
private long cu = SystemUtils.getMonotonicMillis();
|
||||
private EnumChatVisibility ck;
|
||||
private boolean cl = true;
|
||||
private long cm = SystemUtils.getMonotonicMillis();
|
||||
- private Entity spectatedEntity;
|
||||
+ private Entity spectatedEntity; private void setSpectatorTargetField(Entity e) { this.spectatedEntity = e; } // Paper - OBFHELPER
|
||||
public boolean worldChangeInvuln;
|
||||
private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER
|
||||
private boolean cp; private void setHasSeenCredits(boolean has) { this.cp = has; } // Paper - OBFHELPER
|
||||
private final RecipeBookServer recipeBook;
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity);
|
||||
|
@ -57,5 +57,5 @@ index 62feadc8af..f1b7353cf8 100644
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
protected void E() {
|
||||
@Override
|
||||
--
|
|
@ -13,33 +13,33 @@ Shulkers) may need to be changed in order for it to re-save properly
|
|||
No more crashing though.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
|
||||
index e38a0d488e..a245df1dce 100644
|
||||
index 4b7aefb7a..9e568d5d1 100644
|
||||
--- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
|
||||
this.g = nbttagcompound.getString("Command");
|
||||
this.d = nbttagcompound.getInt("SuccessCount");
|
||||
this.command = nbttagcompound.getString("Command");
|
||||
this.successCount = nbttagcompound.getInt("SuccessCount");
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.h = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.h = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
- this.customName = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.customName = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index c4d4775627..3d90fdb642 100644
|
||||
index 2dfa7d251..98d798abd 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
this.setYawPitch(this.yaw, this.pitch);
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")));
|
||||
+ this.setCustomName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException
|
||||
}
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
this.setYawPitch(this.yaw, this.pitch);
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")));
|
||||
+ this.setCustomName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible"));
|
||||
this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible"));
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index 0ef5ad1165..f70f5899fa 100644
|
||||
index 0ef5ad116..f70f5899f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -0,0 +0,0 @@ public final class MCUtil {
|
||||
|
@ -63,7 +63,7 @@ index 0ef5ad1165..f70f5899fa 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java
|
||||
index 7d9e0837d8..dfee7332ea 100644
|
||||
index 1f26d8a02..12264c4d0 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityBanner.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityBanner.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity {
|
||||
|
@ -75,81 +75,16 @@ index 7d9e0837d8..dfee7332ea 100644
|
|||
}
|
||||
|
||||
if (this.hasWorld()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java
|
||||
index a106a783eb..ff8a5926e1 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl
|
||||
ContainerUtil.b(nbttagcompound, this.items);
|
||||
this.brewTime = nbttagcompound.getShort("BrewTime");
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityContainer.java b/src/main/java/net/minecraft/server/TileEntityContainer.java
|
||||
index 3590b4e31..ea7d5a430 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityContainer.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityContainer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento
|
||||
super.load(nbttagcompound);
|
||||
this.chestLock = ChestLock.b(nbttagcompound);
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.k = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.k = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
this.fuelLevel = nbttagcompound.getByte("Fuel");
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
index 2e0f782f65..77c012946a 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.i = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.i = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java
|
||||
index ddd2e0eb0b..21bd156e91 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityDispenser.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityDispenser extends TileEntityLootable {
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.i = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.i = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
index bfbd35bbe5..538ca9bbb4 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.l = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.l = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
// Paper start - cook speed API
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
index 7303a6fdda..544dde4289 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")));
|
||||
+ this.setCustomName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
this.f = nbttagcompound.getInt("TransferCooldown");
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java
|
||||
index fedba2e1fd..296b8dd56d 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.i = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.i = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
- this.customName = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.customName = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,16 +5,16 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java
|
||||
index b861c623cc..0e2b5ee743 100644
|
||||
index 10957c877..449fbee60 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityDrowned.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityDrowned.java
|
||||
@@ -0,0 +0,0 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityDrowned.class}));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, new EntityDrowned.b(this)));
|
||||
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[] { EntityDrowned.class})).a(EntityPigZombie.class));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::h));
|
||||
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false));
|
||||
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Paper
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bC));
|
||||
this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bz));
|
||||
}
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection throttle kick message
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index c25db284ff..e4972e30ce 100644
|
||||
index e1bbe142b..6a2eb12ba 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
|
@ -21,7 +21,7 @@ index c25db284ff..e4972e30ce 100644
|
|||
private static void savePlayerData() {
|
||||
savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
|
||||
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
index e732d55f9f..2c594b4378 100644
|
||||
index da88978db..1dad79620 100644
|
||||
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable speed for water flowing over lava
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 8f49262226..869bf8a9f9 100644
|
||||
index 2b5402b00..2c27be63e 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 {
|
||||
|
@ -18,19 +18,19 @@ index 8f49262226..869bf8a9f9 100644
|
|||
+ log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
|
||||
+ }
|
||||
+
|
||||
public enum DuplicateUUIDMode {
|
||||
SAFE_REGEN, DELETE, NOTHING, WARN
|
||||
}
|
||||
public boolean armorStandTick = true;
|
||||
private void armorStandTick() {
|
||||
this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick);
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
index e672385829..b53a88c33f 100644
|
||||
index 44e00339f..b4616f259 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
@@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource {
|
||||
|
||||
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) {
|
||||
@Override
|
||||
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
|
||||
if (this.a(world, blockposition, iblockdata)) {
|
||||
- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
|
||||
+ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
|
||||
- world.getFluidTickList().a(blockposition, iblockdata.p().getType(), this.a((IWorldReader) world));
|
||||
+ world.getFluidTickList().a(blockposition, iblockdata.p().getType(), this.getFlowSpeed(world, blockposition)); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -51,15 +51,15 @@ index e672385829..b53a88c33f 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
if (iblockdata.s().d() || iblockdata1.s().d()) {
|
||||
generatoraccess.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess));
|
||||
if (iblockdata.p().isSource() || iblockdata1.p().isSource()) {
|
||||
@@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource {
|
||||
|
||||
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) {
|
||||
@Override
|
||||
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
if (this.a(world, blockposition, iblockdata)) {
|
||||
- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
|
||||
+ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
|
||||
- world.getFluidTickList().a(blockposition, iblockdata.p().getType(), this.a((IWorldReader) world));
|
||||
+ world.getFluidTickList().a(blockposition, iblockdata.p().getType(), this.getFlowSpeed(world, blockposition)); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,16 +16,16 @@ be having data corruption issues anyways.
|
|||
This provides a small boost to all setType calls.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 966879a894..0d51c1baeb 100644
|
||||
index 21fae98c1..98ca253bd 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
this.world.n(blockposition);
|
||||
this.world.removeTileEntity(blockposition);
|
||||
}
|
||||
|
||||
- if (chunksection.getType(i, j & 15, k).getBlock() != block) {
|
||||
+ if (false && chunksection.getType(i, j & 15, k).getBlock() != block) { // Paper - don't need to recheck this - this would only fail due to non main thread writes which are not supported
|
||||
return null;
|
||||
} else {
|
||||
if (flag1) {
|
||||
TileEntity tileentity;
|
||||
--
|
|
@ -5,29 +5,29 @@ Subject: [PATCH] Expose attack cooldown methods for Player
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index cc1bc01b16..4bbf577523 100644
|
||||
index f665dc0eb..f17c1c54b 100644
|
||||
--- a/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 {
|
||||
this.datawatcher.set(EntityHuman.bA, nbttagcompound);
|
||||
this.datawatcher.set(EntityHuman.bw, nbttagcompound);
|
||||
}
|
||||
|
||||
+ public float getCooldownPeriod() { return dG(); } // Paper - OBFHELPER
|
||||
public float dG() {
|
||||
return (float) (1.0D / this.getAttributeInstance(GenericAttributes.g).getValue() * 20.0D);
|
||||
+ public float getCooldownPeriod() { return dY(); } // Paper - OBFHELPER
|
||||
public float dY() {
|
||||
return (float) (1.0D / this.getAttributeInstance(GenericAttributes.ATTACK_SPEED).getValue() * 20.0D);
|
||||
}
|
||||
|
||||
+ public float getCooledAttackStrength(float adjustTicks) { return r(adjustTicks); } // Paper - OBFHELPER
|
||||
public float r(float f) {
|
||||
return MathHelper.a(((float) this.aH + f) / this.dG(), 0.0F, 1.0F);
|
||||
+ public float getCooledAttackStrength(float adjustTicks) { return s(adjustTicks); } // Paper - OBFHELPER
|
||||
public float s(float f) {
|
||||
return MathHelper.a(((float) this.aD + f) / this.dY(), 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
+ public void resetCooldown() { dH(); } // Paper - OBFHELPER
|
||||
public void dH() {
|
||||
this.aH = 0;
|
||||
+ public void resetCooldown() { dZ(); } // Paper - OBFHELPER
|
||||
public void dZ() {
|
||||
this.aD = 0;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 47426d8fda..7a918ea72f 100644
|
||||
index 6ceb02200..d505af188 100644
|
||||
--- a/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 {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix MC-124320
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index c674aa13d8..2e460a7f63 100644
|
||||
index 69e65ea6c..549c50de7 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
|
||||
|
@ -17,7 +17,7 @@ index c674aa13d8..2e460a7f63 100644
|
|||
IBlockData iblockdata1 = iblockdata;
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index 139a70ca3b..e4aba0e0a8 100644
|
||||
index a1033ce28..de2d99534 100644
|
||||
--- a/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 {
|
||||
|
@ -26,7 +26,7 @@ index 139a70ca3b..e4aba0e0a8 100644
|
|||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
- this.enderman.setCarried(iblockdata);
|
||||
+ //this.enderman.setCarried(iblockdata); // Paper - moved down
|
||||
world.setAir(blockposition);
|
||||
world.a(blockposition, false);
|
||||
+ this.enderman.setCarried(Block.getValidBlockForPosition(iblockdata, this.enderman.world, blockposition)); // Paper - Fix MC-124320
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -40,12 +40,12 @@ index 139a70ca3b..e4aba0e0a8 100644
|
|||
|
||||
public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) {
|
||||
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
|
||||
BlockPosition blockposition = new BlockPosition(i, j, k);
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
IBlockData iblockdata1 = world.getType(blockposition.down());
|
||||
BlockPosition blockposition1 = blockposition.down();
|
||||
IBlockData iblockdata1 = world.getType(blockposition1);
|
||||
- IBlockData iblockdata2 = this.a.getCarried();
|
||||
+ IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320
|
||||
|
||||
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1)) {
|
||||
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||
// CraftBukkit start - Place event
|
||||
--
|
|
@ -5,16 +5,16 @@ Subject: [PATCH] Fix MC-93764
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldProviderTheEnd.java b/src/main/java/net/minecraft/server/WorldProviderTheEnd.java
|
||||
index 99191f09f0..4d692b7e05 100644
|
||||
index c25be1642..b323df98e 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldProviderTheEnd.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldProviderTheEnd.java
|
||||
@@ -0,0 +0,0 @@ public class WorldProviderTheEnd extends WorldProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float a(long i, float f) {
|
||||
- return 0.0F;
|
||||
+ return 0.5F; // Paper - fix MC-93764
|
||||
}
|
||||
|
||||
public boolean canRespawn() {
|
||||
@Override
|
||||
--
|
|
@ -5,20 +5,20 @@ Subject: [PATCH] Here's Johnny!
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
|
||||
index 96d0651e9b..4bbb4817b1 100644
|
||||
index 45370ad5d..6b7712ec9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class EntityVindicator extends EntityIllagerAbstract {
|
||||
|
||||
- private boolean b;
|
||||
+ private boolean b; public boolean isJohnny() { return b; } public void setJohnny(boolean johnny) { b = johnny; } // Paper - OBFHELPER
|
||||
private static final Predicate<Entity> c = (entity) -> {
|
||||
return entity instanceof EntityLiving && ((EntityLiving) entity).df();
|
||||
@@ -0,0 +0,0 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
||||
private static final Predicate<EnumDifficulty> b = (enumdifficulty) -> {
|
||||
return enumdifficulty == EnumDifficulty.NORMAL || enumdifficulty == EnumDifficulty.HARD;
|
||||
};
|
||||
- private boolean bz;
|
||||
+ private boolean bz; public boolean isJohnny() { return bz; } public void setJohnny(boolean johnny) { bz = johnny; } // Paper - OBFHELPER
|
||||
|
||||
public EntityVindicator(EntityTypes<? extends EntityVindicator> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
||||
index 951d479298..5ff957ced7 100644
|
||||
index 951d47929..5ff957ced 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
||||
@@ -0,0 +0,0 @@ public class CraftVindicator extends CraftIllager implements Vindicator {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Honor EntityAgeable.ageLock
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java
|
||||
index 2af1ac7028..aa54e380e4 100644
|
||||
index da9740a99..e87754ef3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityAgeable.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
|
|
|
@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're
|
|||
debugging in an IDE pre-relocate.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 632df2270c..b663232201 100644
|
||||
index 467b2d938..61f102355 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -0,0 +0,0 @@ import java.io.FileOutputStream;
|
||||
|
@ -170,7 +170,7 @@ index 632df2270c..b663232201 100644
|
|||
+
|
||||
if ( modern )
|
||||
{
|
||||
super.visitFieldInsn( opcode, owner, name, desc );
|
||||
if ( owner.equals( "org/bukkit/Material" ) )
|
||||
@@ -0,0 +0,0 @@ public class Commodore
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ DimensionManager set to the world it is being placed into.
|
|||
This fixes corrupt entities breaking chunk saving in custom worlds.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index d6d0dd6d88..3db1b6bb1b 100644
|
||||
index 98d798abd..f5625fca3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java
|
||||
index 8e8390282d..f529365817 100644
|
||||
index 3a215dea4..ea93452e6 100644
|
||||
--- a/src/main/java/net/minecraft/server/ArgumentBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/ArgumentBlock.java
|
||||
@@ -0,0 +0,0 @@ public class ArgumentBlock {
|
||||
|
@ -32,10 +32,10 @@ index 8e8390282d..f529365817 100644
|
|||
this.s = this::l;
|
||||
if (this.i.canRead() && this.i.peek() == '#') {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 570f695d82..ec91ab72d6 100644
|
||||
index 9435136cc..9ced2abbb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.inventory.meta.tags.CustomItemTagContainer;
|
||||
import static org.spigotmc.ValidateUtils.*;
|
||||
// Spigot end
|
||||
|
||||
|
@ -48,9 +48,9 @@ index 570f695d82..ec91ab72d6 100644
|
|||
/**
|
||||
* Children must include the following:
|
||||
*
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Specific(Specific.To.NBT)
|
||||
static final ItemMetaKey DAMAGE = new ItemMetaKey("Damage");
|
||||
static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag");
|
||||
static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues");
|
||||
+ // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
+ static final ItemMetaKey CAN_DESTROY = new ItemMetaKey("CanDestroy");
|
||||
|
@ -59,7 +59,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
|
||||
private IChatBaseComponent displayName;
|
||||
private IChatBaseComponent locName;
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
private int hideFlag;
|
||||
private boolean unbreakable;
|
||||
private int damage;
|
||||
|
@ -70,7 +70,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
|
||||
private static final Set<String> HANDLED_TAGS = Sets.newHashSet();
|
||||
private static final CraftCustomTagTypeRegistry TAG_TYPE_REGISTRY = new CraftCustomTagTypeRegistry();
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
this.hideFlag = meta.hideFlag;
|
||||
this.unbreakable = meta.unbreakable;
|
||||
this.damage = meta.damage;
|
||||
|
@ -86,7 +86,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
this.unhandledTags.putAll(meta.unhandledTags);
|
||||
this.publicItemTagContainer.putAll(meta.publicItemTagContainer.getRaw());
|
||||
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
publicItemTagContainer.put(key, compound.get(key));
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
|
||||
Set<String> keys = tag.getKeys();
|
||||
for (String key : keys) {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
setDamage(damage);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
String internal = SerializableMeta.getString(map, "internal", true);
|
||||
if (internal != null) {
|
||||
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.decodeBase64(internal));
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (hasDamage()) {
|
||||
itemTag.setInt(DAMAGE.NBT, damage);
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
+ .map(this::serializeNamespaced)
|
||||
+ .collect(java.util.stream.Collectors.toList());
|
||||
+
|
||||
+ itemTag.set(CAN_PLACE_ON.NBT, createStringList(items));
|
||||
+ itemTag.set(CAN_PLACE_ON.NBT, createNonComponentStringList(items));
|
||||
+ }
|
||||
+
|
||||
+ if (hasDestroyableKeys()) {
|
||||
|
@ -171,28 +171,49 @@ index 570f695d82..ec91ab72d6 100644
|
|||
+ .map(this::serializeNamespaced)
|
||||
+ .collect(java.util.stream.Collectors.toList());
|
||||
+
|
||||
+ itemTag.set(CAN_DESTROY.NBT, createStringList(items));
|
||||
+ itemTag.set(CAN_DESTROY.NBT, createNonComponentStringList(items));
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
for (Map.Entry<String, NBTBase> e : unhandledTags.entrySet()) {
|
||||
itemTag.set(e.getKey(), e.getValue());
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ static NBTTagList createNonComponentStringList(List<String> list) {
|
||||
+ if (list == null || list.isEmpty()) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ NBTTagList tagList = new NBTTagList();
|
||||
+ for (String value : list) {
|
||||
+ tagList.add(new NBTTagString(value));
|
||||
+ }
|
||||
+
|
||||
+ return tagList;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
static NBTTagList createStringList(List<IChatBaseComponent> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Overridden
|
||||
boolean isEmpty() {
|
||||
- return !(hasDisplayName() || hasLocalizedName() || hasEnchants() || hasLore() || hasRepairCost() || !unhandledTags.isEmpty() || !publicItemTagContainer.isEmpty() || hideFlag != 0 || isUnbreakable() || hasDamage() || hasAttributeModifiers());
|
||||
+ return !(hasDisplayName() || hasLocalizedName() || hasEnchants() || hasLore() || hasRepairCost() || !unhandledTags.isEmpty() || !publicItemTagContainer.isEmpty() || hideFlag != 0 || isUnbreakable() || hasDamage() || hasAttributeModifiers()
|
||||
+ || hasPlaceableKeys() || hasDestroyableKeys()); // Paper - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
- return !(hasDisplayName() || hasLocalizedName() || hasEnchants() || hasLore() || hasCustomModelData() || hasBlockData() || hasRepairCost() || !unhandledTags.isEmpty() || !publicItemTagContainer.isEmpty() || hideFlag != 0 || isUnbreakable() || hasDamage() || hasAttributeModifiers());
|
||||
+ return !(hasDisplayName() || hasLocalizedName() || hasEnchants() || hasLore() || hasCustomModelData() || hasBlockData() || hasRepairCost() || !unhandledTags.isEmpty() || !publicItemTagContainer.isEmpty() || hideFlag != 0 || isUnbreakable() || hasDamage() || hasAttributeModifiers() || hasPlaceableKeys() || hasDestroyableKeys()); // Paper - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
&& (this.publicItemTagContainer.equals(that.publicItemTagContainer))
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
&& (this.hideFlag == that.hideFlag)
|
||||
&& (this.isUnbreakable() == that.isUnbreakable())
|
||||
- && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage());
|
||||
+ && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
|
||||
&& (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
|
||||
- && (this.version == that.version);
|
||||
+ && (this.version == that.version)
|
||||
+ // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
+ && (this.hasPlaceableKeys() ? that.hasPlaceableKeys() && this.placeableKeys.equals(that.placeableKeys) : !that.hasPlaceableKeys())
|
||||
+ && (this.hasDestroyableKeys() ? that.hasDestroyableKeys() && this.destroyableKeys.equals(that.destroyableKeys) : !that.hasDestroyableKeys());
|
||||
|
@ -200,10 +221,10 @@ index 570f695d82..ec91ab72d6 100644
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
hash = 61 * hash + (isUnbreakable() ? 1231 : 1237);
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
hash = 61 * hash + (hasDamage() ? this.damage : 0);
|
||||
hash = 61 * hash + (hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
|
||||
hash = 61 * hash + version;
|
||||
+ // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
+ hash = 61 * hash + (hasPlaceableKeys() ? this.placeableKeys.hashCode() : 0);
|
||||
+ hash = 61 * hash + (hasDestroyableKeys() ? this.destroyableKeys.hashCode() : 0);
|
||||
|
@ -211,15 +232,14 @@ index 570f695d82..ec91ab72d6 100644
|
|||
return hash;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
clone.hideFlag = this.hideFlag;
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
clone.unbreakable = this.unbreakable;
|
||||
clone.damage = this.damage;
|
||||
clone.version = this.version;
|
||||
+ // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
+ if (this.placeableKeys != null) {
|
||||
+ clone.placeableKeys = Sets.newHashSet(this.placeableKeys);
|
||||
+ }
|
||||
+
|
||||
+ if (this.destroyableKeys != null) {
|
||||
+ clone.destroyableKeys = Sets.newHashSet(this.destroyableKeys);
|
||||
+ }
|
||||
|
@ -227,7 +247,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
return clone;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new Error(e);
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
builder.put(DAMAGE.BUKKIT, damage);
|
||||
}
|
||||
|
||||
|
@ -252,7 +272,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
final Map<String, NBTBase> internalTags = new HashMap<String, NBTBase>(unhandledTags);
|
||||
serializeInternal(internalTags);
|
||||
if (!internalTags.isEmpty()) {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
CraftMetaArmorStand.NO_BASE_PLATE.NBT,
|
||||
CraftMetaArmorStand.SHOW_ARMS.NBT,
|
||||
CraftMetaArmorStand.SMALL.NBT,
|
||||
|
@ -263,7 +283,7 @@ index 570f695d82..ec91ab72d6 100644
|
|||
// Paper end
|
||||
));
|
||||
}
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
|
|
@ -6,27 +6,27 @@ Subject: [PATCH] Implement furnace cook speed multiplier API
|
|||
Signed-off-by: Tassu <git@tassu.me>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
index 5b6ccfa9f5..bfbd35bbe5 100644
|
||||
index be16fe9a9..b9f3a952e 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
@@ -0,0 +0,0 @@ import java.util.Map.Entry;
|
||||
@@ -0,0 +0,0 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import javax.annotation.Nullable;
|
||||
// CraftBukkit start
|
||||
import java.util.List;
|
||||
+
|
||||
+import java.util.List;
|
||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve
|
||||
private NonNullList<ItemStack> items;
|
||||
private int burnTime;
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
||||
protected NonNullList<ItemStack> items;
|
||||
public int burnTime;
|
||||
private int ticksForCurrentFuel;
|
||||
+ public double cookSpeedMultiplier = 1.0; // Paper - cook speed multiplier API
|
||||
private int cookTime;
|
||||
private int cookTimeTotal;
|
||||
private IChatBaseComponent l;
|
||||
@@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve
|
||||
this.l = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
public int cookTime;
|
||||
public int cookTimeTotal;
|
||||
protected final IContainerProperties b;
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
||||
this.n.put(minecraftkey, j);
|
||||
}
|
||||
|
||||
+ // Paper start - cook speed API
|
||||
|
@ -36,16 +36,16 @@ index 5b6ccfa9f5..bfbd35bbe5 100644
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
public NBTTagCompound save(NBTTagCompound nbttagcompound) {
|
||||
@@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
||||
nbttagcompound.setShort("BurnTime", (short) this.burnTime);
|
||||
nbttagcompound.setShort("CookTime", (short) this.cookTime);
|
||||
nbttagcompound.setShort("CookTimeTotal", (short) this.cookTimeTotal);
|
||||
+ nbttagcompound.setDouble("Paper.CookSpeedMultiplier", this.cookSpeedMultiplier); // Paper - cook speed multiplier API
|
||||
ContainerUtil.a(nbttagcompound, this.items);
|
||||
nbttagcompound.setShort("RecipesUsedSize", (short) this.m.size());
|
||||
nbttagcompound.setShort("RecipesUsedSize", (short) this.n.size());
|
||||
int i = 0;
|
||||
@@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
||||
}
|
||||
|
||||
if (this.isBurning() && this.canBurn(irecipe)) {
|
||||
|
@ -54,15 +54,15 @@ index 5b6ccfa9f5..bfbd35bbe5 100644
|
|||
+ this.cookTime += cookSpeedMultiplier; // Paper - cook speed multiplier API
|
||||
+ if (this.cookTime >= this.cookTimeTotal) { // Paper - cook speed multiplier API
|
||||
this.cookTime = 0;
|
||||
this.cookTimeTotal = this.s();
|
||||
this.cookTimeTotal = this.getRecipeCookingTime();
|
||||
this.burn(irecipe);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
index c2eea8ce03..429c780ec7 100644
|
||||
index 9cc67915c..1ce10ea04 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
@@ -0,0 +0,0 @@ public class CraftFurnace extends CraftContainer<TileEntityFurnace> implements F
|
||||
furnace.setCustomName(null);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class CraftFurnace<T extends TileEntityFurnace> extends CraftContainer<T>
|
||||
public void setCookTimeTotal(int cookTimeTotal) {
|
||||
this.getSnapshot().cookTimeTotal = cookTimeTotal;
|
||||
}
|
||||
+
|
||||
+ // Paper start - cook speed multiplier API
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Inventory#removeItemAnySlot
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
index dd7b3d766f..01af982933 100644
|
||||
index 3a2b57ae7..fe52f87d3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftInventory implements Inventory {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Limit lightning strike effect distance
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 869bf8a9f9..2a912286b2 100644
|
||||
index 2c27be63e..fb44fccc9 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 {
|
||||
|
@ -38,10 +38,10 @@ index 869bf8a9f9..2a912286b2 100644
|
|||
public boolean firePhysicsEventForRedstone = false;
|
||||
private void firePhysicsEventForRedstone() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java
|
||||
index 7781babf51..50f6200095 100644
|
||||
index adf68d165..fbcda86b3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLightning.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLightning.java
|
||||
@@ -0,0 +0,0 @@ public class EntityLightning extends EntityWeather {
|
||||
@@ -0,0 +0,0 @@ public class EntityLightning extends Entity {
|
||||
double deltaX = this.locX - player.locX;
|
||||
double deltaZ = this.locZ - player.locZ;
|
||||
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
||||
|
@ -59,7 +59,7 @@ index 7781babf51..50f6200095 100644
|
|||
if (distanceSquared > viewDistance * viewDistance) {
|
||||
double deltaLength = Math.sqrt(distanceSquared);
|
||||
double relativeX = player.locX + (deltaX / deltaLength) * viewDistance;
|
||||
@@ -0,0 +0,0 @@ public class EntityLightning extends EntityWeather {
|
||||
@@ -0,0 +0,0 @@ public class EntityLightning extends Entity {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -69,16 +69,16 @@ index 7781babf51..50f6200095 100644
|
|||
|
||||
--this.lifeTicks;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index e71a405807..53e7834cca 100644
|
||||
index ffa5a0bee..6d8fb1290 100644
|
||||
--- a/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 {
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (super.strikeLightning(entity)) {
|
||||
- this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entity.locX, entity.locY, entity.locZ, 512.0D, this, new PacketPlayOutSpawnEntityWeather(entity)); // CraftBukkit - Use dimension, // Paper - use world instead of dimension
|
||||
+ this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entity.locX, entity.locY, entity.locZ, this.paperConfig.maxLightningFlashDistance, this, new PacketPlayOutSpawnEntityWeather(entity)); // CraftBukkit - Use dimension, // Paper - use world instead of dimension, limit lightning strike effect distance
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
this.globalEntityList.add(entitylightning);
|
||||
- this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this, new PacketPlayOutSpawnEntityWeather(entitylightning)); // Paper - use world instead of dimension
|
||||
+ this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, paperConfig.maxLightningFlashDistance, this, new PacketPlayOutSpawnEntityWeather(entitylightning)); // Paper - use world instead of dimension, limit lightning strike effect distance
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
|
@ -11,7 +11,7 @@ If the projectile fails to find the shooter in the current world, check
|
|||
other worlds.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
index 62b5b6ecea..60ab1c7514 100644
|
||||
index c19828ed5..7deeaa083 100644
|
||||
--- a/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 {
|
||||
|
|
|
@ -6,16 +6,16 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 7e52859c1d..0e4455d66e 100644
|
||||
index e336813bd..a6f6046c6 100644
|
||||
--- a/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 {
|
||||
|
||||
public boolean loadChunk(int x, int z, boolean generate) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "chunk load"); // Spigot
|
||||
chunkLoadCount++;
|
||||
- return world.getChunkProvider().getChunkAt(x, z, true, generate) != null;
|
||||
+ return world.getChunkProvider().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper
|
||||
}
|
||||
- IChunkAccess chunk = world.getChunkProvider().getChunkAt(x, z, generate ? ChunkStatus.FULL : ChunkStatus.EMPTY, true);
|
||||
+ IChunkAccess chunk = world.getChunkProvider().getChunkAt(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true);
|
||||
|
||||
public boolean isChunkLoaded(Chunk chunk) {
|
||||
// If generate = false, but the chunk already exists, we will get this back.
|
||||
if (chunk instanceof ProtoChunkExtension) {
|
||||
--
|
|
@ -7,7 +7,7 @@ Implements Pathfinding API for mobs
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||
new file mode 100644
|
||||
index 0000000000..ed3d86ddd3
|
||||
index 000000000..ed3d86ddd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -125,7 +125,7 @@ index 0000000000..ed3d86ddd3
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
index c55aadb536..cac0ce2a3a 100644
|
||||
index 0586597e7..583f2c5ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
||||
|
@ -143,9 +143,9 @@ index c55aadb536..cac0ce2a3a 100644
|
|||
@Nullable
|
||||
- public PathEntity a(Entity entity) {
|
||||
+ public PathEntity calculateDestination(Entity entity) { return a(entity); } @Nullable public PathEntity a(Entity entity) { // Paper - OBFHELPER
|
||||
if (!this.b()) {
|
||||
return null;
|
||||
} else {
|
||||
BlockPosition blockposition = new BlockPosition(entity);
|
||||
double d0 = entity.locX;
|
||||
double d1 = entity.getBoundingBox().minY;
|
||||
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
||||
private int pathfindFailures = 0;
|
||||
// Paper end
|
||||
|
@ -155,64 +155,61 @@ index c55aadb536..cac0ce2a3a 100644
|
|||
if (pathentity == null) {
|
||||
this.c = null;
|
||||
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
|
||||
- @Nullable
|
||||
+ @Nullable public PathEntity getPathEntity() { return m(); } @Nullable // Paper - OBFHELPER
|
||||
public PathEntity m() {
|
||||
+ @Nullable public PathEntity getPathEntity() { return l(); } @Nullable // Paper - OBFHELPER
|
||||
public PathEntity l() {
|
||||
return this.c;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
||||
return this.c == null || this.c.b();
|
||||
}
|
||||
|
||||
+ public void stopPathfinding() { q(); } // Paper - OBFHELPER
|
||||
public void q() {
|
||||
+ public void stopPathfinding() { o(); } // Paper - OBFHELPER
|
||||
public void o() {
|
||||
this.pathfindFailures = 0; this.lastFailure = 0; // Paper - Pathfinding optimizations
|
||||
this.c = null;
|
||||
diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java
|
||||
index 31fc1fbc65..5cf7f3bf1b 100644
|
||||
index d1cb80208..ec6b3a292 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathEntity.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class PathEntity {
|
||||
|
||||
- private final PathPoint[] a;
|
||||
+ private final PathPoint[] a; public PathPoint[] getPoints() { return a; } // Paper - OBFHELPER
|
||||
- private final List<PathPoint> a;
|
||||
+ private final List<PathPoint> a; public List<PathPoint> getPoints() { return a; } // Paper - OBFHELPER
|
||||
private PathPoint[] b = new PathPoint[0];
|
||||
private PathPoint[] c = new PathPoint[0];
|
||||
private PathPoint d;
|
||||
- private int e;
|
||||
- private int f;
|
||||
+ private int e; public int getNextIndex() { return e; } // Paper - OBFHELPER
|
||||
+ private int f; public int getPathCount() { return f; } // Paper - OBFHELPER
|
||||
+ public boolean hasNext() { return getNextIndex() < getPathCount(); } // Paper
|
||||
|
||||
public PathEntity(PathPoint[] apathpoint) {
|
||||
this.a = apathpoint;
|
||||
public PathEntity(List<PathPoint> list) {
|
||||
this.a = list;
|
||||
@@ -0,0 +0,0 @@ public class PathEntity {
|
||||
return this.e >= this.a.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- @Nullable
|
||||
- public PathPoint c() {
|
||||
+ public PathPoint getFinalPoint() { return c(); } @Nullable public PathPoint c() { // Paper - OBFHELPER
|
||||
return this.f > 0 ? this.a[this.f - 1] : null;
|
||||
return !this.a.isEmpty() ? (PathPoint) this.a.get(this.a.size() - 1) : null;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class PathEntity {
|
||||
return this.a(entity, this.e);
|
||||
}
|
||||
|
||||
- public Vec3D f() {
|
||||
+ public Vec3D getNext() { return f(); } public Vec3D f() { // Paper - OBFHELPER
|
||||
PathPoint pathpoint = this.a[this.e];
|
||||
- public Vec3D g() {
|
||||
+ public Vec3D getNext() { return g(); } public Vec3D g() { // Paper - OBFHELPER
|
||||
PathPoint pathpoint = (PathPoint) this.a.get(this.e);
|
||||
|
||||
return new Vec3D((double) pathpoint.a, (double) pathpoint.b, (double) pathpoint.c);
|
||||
diff --git a/src/main/java/net/minecraft/server/PathPoint.java b/src/main/java/net/minecraft/server/PathPoint.java
|
||||
index 78ed002868..0dd6e46d12 100644
|
||||
index 0f6e8c51e..5d445e08a 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathPoint.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathPoint.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
@ -229,7 +226,7 @@ index 78ed002868..0dd6e46d12 100644
|
|||
public int d = -1;
|
||||
public float e;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index 5bf1cd06fa..53c2d154ed 100644
|
||||
index 5bf1cd06f..53c2d154e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.loot.LootTable;
|
||||
|
|
|
@ -6,15 +6,15 @@ Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning
|
|||
Uses an EnumMap as well as a Set paired List for O(1) contains calls.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
index c399bdecc3..3496d4236d 100644
|
||||
index 9a839d654..72eb669c5 100644
|
||||
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
||||
protected final Map<WorldGenStage.Decoration, List<WorldGenFeatureComposite<?, ?>>> aW = Maps.newHashMap();
|
||||
protected final List<WorldGenFeatureCompositeFlower<?>> aX = Lists.newArrayList();
|
||||
protected final Map<StructureGenerator<?>, WorldGenFeatureConfiguration> aY = Maps.newHashMap();
|
||||
- private final Map<EnumCreatureType, List<BiomeBase.BiomeMeta>> aZ = Maps.newHashMap();
|
||||
+ private final java.util.EnumMap<EnumCreatureType, List<BiomeBase.BiomeMeta>> aZ = Maps.newEnumMap(EnumCreatureType.class); // Paper
|
||||
protected final Map<WorldGenStage.Decoration, List<WorldGenFeatureConfigured<?>>> r = Maps.newHashMap();
|
||||
protected final List<WorldGenFeatureConfigured<?>> s = Lists.newArrayList();
|
||||
protected final Map<StructureGenerator<?>, WorldGenFeatureConfiguration> t = Maps.newHashMap();
|
||||
- private final Map<EnumCreatureType, List<BiomeBase.BiomeMeta>> u = Maps.newHashMap();
|
||||
+ private final java.util.EnumMap<EnumCreatureType, List<BiomeBase.BiomeMeta>> u = Maps.newEnumMap(EnumCreatureType.class); // Paper
|
||||
|
||||
@Nullable
|
||||
public static BiomeBase a(BiomeBase biomebase) {
|
||||
|
@ -22,13 +22,13 @@ index c399bdecc3..3496d4236d 100644
|
|||
for (j = 0; j < i; ++j) {
|
||||
EnumCreatureType enumcreaturetype = aenumcreaturetype[j];
|
||||
|
||||
- this.aZ.put(enumcreaturetype, Lists.newArrayList());
|
||||
+ this.aZ.put(enumcreaturetype, new MobList()); // Paper
|
||||
- this.u.put(enumcreaturetype, Lists.newArrayList());
|
||||
+ this.u.put(enumcreaturetype, new MobList()); // Paper
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
||||
|
||||
return this.m;
|
||||
}
|
||||
|
||||
+ // Paper start - keep track of data in a pair set to give O(1) contains calls - we have to hook removals incase plugins mess with it
|
||||
|
|
|
@ -7,21 +7,25 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
|
|||
and cloning it when one is needed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockData.java b/src/main/java/net/minecraft/server/BlockData.java
|
||||
index 4dd6c32761..1b226a77e0 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockData.java
|
||||
new file mode 100644
|
||||
index 000000000..1b226a77e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/BlockData.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
+import com.google.common.collect.ImmutableMap;
|
||||
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
|
||||
public class BlockData extends BlockDataAbstract<Block, IBlockData> implements IBlockData {
|
||||
|
||||
@@ -0,0 +0,0 @@ public class BlockData extends BlockDataAbstract<Block, IBlockData> implements I
|
||||
public Block getBlock() {
|
||||
return (Block) this.e_;
|
||||
}
|
||||
+
|
||||
+public class BlockData extends BlockDataAbstract<Block, IBlockData> implements IBlockData {
|
||||
+
|
||||
+ public BlockData(Block block, ImmutableMap<IBlockState<?>, Comparable<?>> immutablemap) {
|
||||
+ super(block, immutablemap);
|
||||
+ }
|
||||
+
|
||||
+ public Block getBlock() {
|
||||
+ return (Block) this.e_;
|
||||
+ }
|
||||
+
|
||||
+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time
|
||||
+ private CraftBlockData cachedCraftBlockData;
|
||||
|
@ -32,22 +36,39 @@ index 4dd6c32761..1b226a77e0 100644
|
|||
+ return (CraftBlockData) cachedCraftBlockData.clone();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
index e4e4c55130..08a5acb0ac 100644
|
||||
index e8ae4b5e4..5413fe5b1 100644
|
||||
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
||||
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
@@ -0,0 +0,0 @@ public interface IBlockData extends IBlockDataHolder<IBlockData> {
|
||||
|
||||
Block getBlock();
|
||||
|
||||
+ org.bukkit.craftbukkit.block.data.CraftBlockData createCraftBlockData(); // Paper - property for converting IBlockData to CraftBlockData, should only be used by CraftBlockData#fromData and should return a clone
|
||||
@@ -0,0 +0,0 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.datafixers.Dynamic;
|
||||
import com.mojang.datafixers.types.DynamicOps;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
+
|
||||
default Material getMaterial() {
|
||||
return this.getBlock().n(this);
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
return (Block) this.a;
|
||||
}
|
||||
|
||||
+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time
|
||||
+ private CraftBlockData cachedCraftBlockData;
|
||||
+
|
||||
+ @Override
|
||||
+ public CraftBlockData createCraftBlockData() {
|
||||
+ if(cachedCraftBlockData == null) cachedCraftBlockData = CraftBlockData.createData(this);
|
||||
+ return (CraftBlockData) cachedCraftBlockData.clone();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public Material getMaterial() {
|
||||
return this.getBlock().l(this);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
index 7755e4f7a6..4bb43e360d 100644
|
||||
index c1666a9ba..3c29abd52 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData {
|
||||
|
|
|
@ -8,23 +8,23 @@ Use larger initial sizes to increase bucket capacity on the BiMap
|
|||
BiMap.get was seen to be using a good bit of CPU time.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
index 1521ed759b..78de740acf 100644
|
||||
index f291e05b2..860924f9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
public class RegistryMaterials<V> implements IRegistry<V> {
|
||||
public class RegistryMaterials<T> extends IRegistryWritable<T> {
|
||||
|
||||
protected static final Logger a = LogManager.getLogger();
|
||||
- protected final RegistryID<V> b = new RegistryID<>(256);
|
||||
- protected final BiMap<MinecraftKey, V> c = HashBiMap.create();
|
||||
protected static final Logger LOGGER = LogManager.getLogger();
|
||||
- protected final RegistryID<T> b = new RegistryID<>(256);
|
||||
- protected final BiMap<MinecraftKey, T> c = HashBiMap.create();
|
||||
- protected Object[] d;
|
||||
+ protected final RegistryID<V> b = new RegistryID<V>(2048); // Paper - use bigger expected size to reduce collisions
|
||||
+ protected final BiMap<MinecraftKey, V> c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
||||
+ protected V[] d; // Paper - Decompile fix
|
||||
private int x;
|
||||
+ protected final RegistryID<T> b = new RegistryID<>(2048); // Paper - use bigger expected size to reduce collisions
|
||||
+ protected final BiMap<MinecraftKey, T> c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
||||
+ protected T[] d; // Paper - Decompile fix
|
||||
private int R;
|
||||
|
||||
public RegistryMaterials() {}
|
||||
@@ -0,0 +0,0 @@ public class RegistryMaterials<V> implements IRegistry<V> {
|
||||
@@ -0,0 +0,0 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ known NMS used methods, but we can add more if naughty plugins are found later.
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldMap.java b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java
|
||||
new file mode 100644
|
||||
index 0000000000..af9e4455c6
|
||||
index 000000000..af9e4455c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -217,25 +217,33 @@ index 0000000000..af9e4455c6
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 4543ac8f15..d2ee4e5781 100644
|
||||
index 27af4398c..e6054dddb 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
public final DataFixer dataConverterManager;
|
||||
private String serverIp;
|
||||
private int q = -1;
|
||||
private int serverPort = -1;
|
||||
- public final Map<DimensionManager, WorldServer> worldServer = Maps.newLinkedHashMap(); // CraftBukkit - keep order, k+v already use identity methods
|
||||
+ public final Map<DimensionManager, WorldServer> worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper;
|
||||
private PlayerList playerList;
|
||||
private boolean isRunning = true;
|
||||
private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
private volatile boolean isRunning = true;
|
||||
private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
}
|
||||
|
||||
- for (WorldServer world : this.getWorlds()) {
|
||||
+ for (WorldServer world : com.google.common.collect.Lists.newArrayList(this.getWorlds())) { // Paper - avoid como if 1 world triggers another world
|
||||
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
|
||||
this.a(this.getDifficulty(), true);
|
||||
- for (WorldServer worldserver : this.getWorlds()) {
|
||||
+ for (WorldServer worldserver : com.google.common.collect.Lists.newArrayList(this.getWorlds())) { // Paper - avoid como if 1 world triggers another world
|
||||
this.loadSpawn(worldserver.getChunkProvider().playerChunkMap.worldLoadListener, worldserver);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.sleepForTick();
|
||||
// CraftBukkit start
|
||||
// Iterator iterator = DimensionManager.a().iterator();
|
||||
-
|
||||
if (true) {
|
||||
DimensionManager dimensionmanager = worldserver.worldProvider.getDimensionManager();
|
||||
// CraftBukkit end
|
||||
--
|
|
@ -9,21 +9,21 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
|
|||
spawners.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
index eca3f85ad2..b2d2de7f81 100644
|
||||
index bca0e3a2e..96080b6c7 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
|
||||
String key = this.getMobName().getKey();
|
||||
String key = entityType.getKey().getKey();
|
||||
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
|
||||
if (type != null) {
|
||||
- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event;
|
||||
- event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||
+ com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent event;
|
||||
+ event = new com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent(
|
||||
MCUtil.toLocation(world, d3, d4, d5),
|
||||
type,
|
||||
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
||||
+ MCUtil.toLocation(world, blockposition)
|
||||
MCUtil.toLocation(world, d3, d4, d5),
|
||||
type,
|
||||
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
||||
+ MCUtil.toLocation(world, blockposition)
|
||||
);
|
||||
if (!event.callEvent()) {
|
||||
flag = true;
|
||||
|
|
|
@ -5,31 +5,31 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
index 2b15aa6c9e..3ca32123bb 100644
|
||||
index ce9318c57..541d97344 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
@@ -0,0 +0,0 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
private final Block f;
|
||||
private final Block g;
|
||||
private final EntityInsentient entity;
|
||||
private int h;
|
||||
private int i;
|
||||
+ private World world; // Paper
|
||||
|
||||
public PathfinderGoalRemoveBlock(Block block, EntityCreature entitycreature, double d0, int i) {
|
||||
super(entitycreature, d0, 24, i);
|
||||
this.f = block;
|
||||
this.g = block;
|
||||
this.entity = entitycreature;
|
||||
+ this.world = entitycreature.world; // Paper
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
|
||||
@Nullable
|
||||
private BlockPosition a(BlockPosition blockposition, IBlockAccess iblockaccess) {
|
||||
- if (iblockaccess.getType(blockposition).getBlock() == this.f) {
|
||||
- if (iblockaccess.getType(blockposition).getBlock() == this.g) {
|
||||
+ Block block = world.getBlockIfLoaded(blockposition); // Paper
|
||||
+ if (block == null) return null; // Paper
|
||||
+ if (block == this.f) { // Paper
|
||||
+ if (block == this.g) { // Paper
|
||||
return blockposition;
|
||||
} else {
|
||||
BlockPosition[] ablockposition = new BlockPosition[] { blockposition.down(), blockposition.west(), blockposition.east(), blockposition.north(), blockposition.south(), blockposition.down().down()};
|
||||
|
@ -37,23 +37,23 @@ index 2b15aa6c9e..3ca32123bb 100644
|
|||
for (int j = 0; j < i; ++j) {
|
||||
BlockPosition blockposition1 = ablockposition1[j];
|
||||
|
||||
- if (iblockaccess.getType(blockposition1).getBlock() == this.f) {
|
||||
+ if (world.getBlockIfLoaded(blockposition1) == this.f) { // Paper
|
||||
- if (iblockaccess.getType(blockposition1).getBlock() == this.g) {
|
||||
+ if (world.getBlockIfLoaded(blockposition1) == this.g) { // Paper
|
||||
return blockposition1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean a(IWorldReader iworldreader, BlockPosition blockposition) {
|
||||
- Block block = iworldreader.getType(blockposition).getBlock();
|
||||
+ Block block = world.getBlockIfLoaded(blockposition); // Paper
|
||||
+ if (block == null) return false; // Paper
|
||||
|
||||
return block == this.f && iworldreader.getType(blockposition.up()).isAir() && iworldreader.getType(blockposition.up(2)).isAir();
|
||||
return block == this.g && iworldreader.getType(blockposition.up()).isAir() && iworldreader.getType(blockposition.up(2)).isAir();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||
index e58fdee8bb..f2c4048c2b 100644
|
||||
index 8340d6d25..78eb1b39c 100644
|
||||
--- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||
@@ -0,0 +0,0 @@ public class RandomPositionGenerator {
|
||||
|
@ -61,7 +61,7 @@ index e58fdee8bb..f2c4048c2b 100644
|
|||
|
||||
blockposition1 = new BlockPosition((double) k1 + entitycreature.locX, (double) l1 + entitycreature.locY, (double) i2 + entitycreature.locZ);
|
||||
+ if (!entitycreature.world.isLoaded(blockposition1)) continue; // Paper
|
||||
if ((!flag1 || entitycreature.f(blockposition1)) && navigationabstract.a(blockposition1)) {
|
||||
if ((!flag1 || entitycreature.a(blockposition1)) && navigationabstract.a(blockposition1)) {
|
||||
if (!flag) {
|
||||
blockposition1 = a(blockposition1, entitycreature);
|
||||
@@ -0,0 +0,0 @@ public class RandomPositionGenerator {
|
||||
|
@ -74,10 +74,10 @@ index e58fdee8bb..f2c4048c2b 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 630ebfb37c..0d45e21573 100644
|
||||
index 79ded224c..cfab578df 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
return chunk.getType(blockposition);
|
||||
}
|
||||
}
|
||||
|
@ -87,12 +87,11 @@ index 630ebfb37c..0d45e21573 100644
|
|||
+ return getFluid(blockposition);
|
||||
+ } else {
|
||||
+ Chunk chunk = this.getChunkIfLoaded(blockposition);
|
||||
|
||||
+ return chunk != null ? chunk.getFluid(blockposition) : null;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
@Override
|
||||
public Fluid getFluid(BlockPosition blockposition) {
|
||||
if (blockposition.isInvalidYLocation()) { // Paper
|
||||
return FluidTypes.EMPTY.i();
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java
|
||||
index 431602cac1..c0955d6ec2 100644
|
||||
index c76fa0b4b..5f1514360 100644
|
||||
--- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java
|
||||
+++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java
|
||||
@@ -0,0 +0,0 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
|
@ -16,7 +16,7 @@ index 431602cac1..c0955d6ec2 100644
|
|||
+ IBlockData iblockdata1 = generatoraccess.getTypeIfLoaded(blockposition1); // Paper
|
||||
+ if (iblockdata1 == null) continue; // Paper
|
||||
|
||||
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
|
||||
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.getType())) {
|
||||
// CraftBukkit start
|
||||
@@ -0,0 +0,0 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
while (iterator.hasNext()) {
|
||||
|
@ -25,9 +25,9 @@ index 431602cac1..c0955d6ec2 100644
|
|||
- IBlockData iblockdata1 = iworldreader.getType(blockposition1);
|
||||
+ IBlockData iblockdata1 = iworldreader.getTypeIfLoaded(blockposition1); // Paper
|
||||
+ if (iblockdata1 == null) continue; // Paper
|
||||
Fluid fluid = iblockdata1.s();
|
||||
Fluid fluid = iblockdata1.p();
|
||||
|
||||
if (fluid.c().a((FluidType) this) && this.a(enumdirection, (IBlockAccess) iworldreader, blockposition, iblockdata, blockposition1, iblockdata1)) {
|
||||
if (fluid.getType().a((FluidType) this) && this.a(enumdirection, (IBlockAccess) iworldreader, blockposition, iblockdata, blockposition1, iblockdata1)) {
|
||||
@@ -0,0 +0,0 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
if (enumdirection1 != enumdirection) {
|
||||
BlockPosition blockposition2 = blockposition.shift(enumdirection1);
|
||||
|
@ -41,15 +41,14 @@ index 431602cac1..c0955d6ec2 100644
|
|||
+ if (iblockdatax == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.s());
|
||||
|
||||
- return Pair.of(iblockdata1, iblockdata1.p());
|
||||
- });
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.p());
|
||||
+ short2objectmap.put(short0, pair);
|
||||
+
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
- return Pair.of(iblockdata1, iblockdata1.s());
|
||||
- });
|
||||
IBlockData iblockdata1 = (IBlockData) pair.getFirst();
|
||||
Fluid fluid = (Fluid) pair.getSecond();
|
||||
|
||||
|
@ -60,7 +59,7 @@ index 431602cac1..c0955d6ec2 100644
|
|||
- Pair<IBlockData, Fluid> pair = (Pair) short2objectmap.computeIfAbsent(short0, (j) -> {
|
||||
- IBlockData iblockdata1 = iworldreader.getType(blockposition1);
|
||||
-
|
||||
- return Pair.of(iblockdata1, iblockdata1.s());
|
||||
- return Pair.of(iblockdata1, iblockdata1.p());
|
||||
- });
|
||||
+ // Paper start
|
||||
+ Pair pair = (Pair) short2objectmap.get(short0);
|
||||
|
@ -68,7 +67,7 @@ index 431602cac1..c0955d6ec2 100644
|
|||
+ IBlockData iblockdatax = iworldreader.getTypeIfLoaded(blockposition1);
|
||||
+ if (iblockdatax == null) continue;
|
||||
+
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.s());
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.p());
|
||||
+ short2objectmap.put(short0, pair);
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
|
|
@ -6,28 +6,28 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks
|
|||
also prevents if out of world border bounds
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index d125fae03b..297c53d15c 100644
|
||||
index e5695c760..696293132 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
|
||||
int i2 = blockposition1.getX();
|
||||
int j2 = blockposition1.getY();
|
||||
int k2 = blockposition1.getZ();
|
||||
- IBlockData iblockdata = worldserver.getType(blockposition1);
|
||||
+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
|
||||
int l = blockposition1.getZ();
|
||||
|
||||
- if (!iblockdata.isOccluding()) {
|
||||
+ if (iblockdata != null && !iblockdata.isOccluding()) { // Paper - don't load chunks for mob spawn
|
||||
int l2 = 0;
|
||||
int i3 = 0;
|
||||
if (k >= 1) {
|
||||
- IBlockData iblockdata = chunk.getType(blockposition1);
|
||||
+ IBlockData iblockdata = world.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
|
||||
|
||||
- if (!iblockdata.isOccluding(chunk, blockposition1)) {
|
||||
+ if (iblockdata != null && !iblockdata.isOccluding(chunk, blockposition1)) { // Paper - don't load chunks for mob spawn
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||
int i1 = 0;
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
|
||||
float f1 = (float) l3 + 0.5F;
|
||||
EntityHuman entityhuman1 = worldserver.a((double) f, (double) f1, -1.0D);
|
||||
float f1 = (float) k1 + 0.5F;
|
||||
EntityHuman entityhuman = world.a((double) f, (double) f1, -1.0D);
|
||||
|
||||
- if (entityhuman1 != null) {
|
||||
+ if (entityhuman1 != null && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
||||
double d0 = entityhuman1.d((double) f, (double) k3, (double) f1);
|
||||
- if (entityhuman != null && entityhuman.e((double) f, (double) k, (double) f1) > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D)) {
|
||||
+ if (entityhuman != null && entityhuman.e((double) f, (double) k, (double) f1) > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D) && world.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition_mutableblockposition);
|
||||
|
||||
if (d0 > 576.0D && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) {
|
||||
if (Objects.equals(chunkcoordintpair, chunk.getPos())) {
|
||||
--
|
|
@ -5,12 +5,12 @@ Subject: [PATCH] Slime Pathfinder Events
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
|
||||
index f92bf02b87..81966542ee 100644
|
||||
index 8115b1e4e..d720d0fae 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySlime.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import javax.annotation.Nullable;
|
||||
+// Paper start
|
||||
+import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent;
|
||||
|
@ -26,15 +26,15 @@ index f92bf02b87..81966542ee 100644
|
|||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setInt("Size", this.getSize() - 1);
|
||||
nbttagcompound.setBoolean("wasOnGround", this.bD);
|
||||
nbttagcompound.setBoolean("wasOnGround", this.bA);
|
||||
+ nbttagcompound.setBoolean("Paper.canWander", this.canWander); // Paper
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
|
||||
this.setSize(i + 1, false);
|
||||
this.bD = nbttagcompound.getBoolean("wasOnGround");
|
||||
this.bA = nbttagcompound.getBoolean("wasOnGround");
|
||||
+ // Paper start - check exists before loading or this will be loaded as false
|
||||
+ if (nbttagcompound.hasKey("Paper.canWander")) {
|
||||
+ this.canWander = nbttagcompound.getBoolean("Paper.canWander");
|
||||
|
@ -42,33 +42,34 @@ index f92bf02b87..81966542ee 100644
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
public boolean dy() {
|
||||
public boolean ea() {
|
||||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return true;
|
||||
+ return this.a.canWander && new SlimeWanderEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper
|
||||
- return !this.a.isPassenger();
|
||||
+ return !this.a.isPassenger() && this.a.canWander && new SlimeWanderEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper
|
||||
}
|
||||
|
||||
public void e() {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return this.a.isInWater() || this.a.ax();
|
||||
+ return (this.a.isInWater() || this.a.ax()) && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper
|
||||
- return (this.a.isInWater() || this.a.aC()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime;
|
||||
+ return (this.a.isInWater() || this.a.aC()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper
|
||||
}
|
||||
|
||||
public void e() {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.ax() || this.a.hasEffect(MobEffects.LEVITATION));
|
||||
+ return this.a.canWander && this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.ax() || this.a.hasEffect(MobEffects.LEVITATION)); // Paper
|
||||
- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aC() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime;
|
||||
+ return this.a.canWander && this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aC() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e() {
|
||||
if (--this.c <= 0) {
|
||||
this.c = 40 + this.a.getRandom().nextInt(60);
|
||||
|
@ -85,7 +86,7 @@ index f92bf02b87..81966542ee 100644
|
|||
public boolean a() {
|
||||
EntityLiving entityliving = this.a.getGoalTarget();
|
||||
|
||||
- return entityliving == null ? false : (!entityliving.isAlive() ? false : !(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.isInvulnerable);
|
||||
- return entityliving == null ? false : (!entityliving.isAlive() ? false : (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable ? false : this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime));
|
||||
+ // Paper start
|
||||
+ if (entityliving == null || !entityliving.isAlive()) {
|
||||
+ return false;
|
||||
|
@ -93,11 +94,11 @@ index f92bf02b87..81966542ee 100644
|
|||
+ if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return this.a.canWander && new SlimeTargetLivingEntityEvent((Slime) this.a.getBukkitEntity(), (LivingEntity) entityliving.getBukkitEntity()).callEvent();
|
||||
+ return this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeTargetLivingEntityEvent((Slime) this.a.getBukkitEntity(), (LivingEntity) entityliving.getBukkitEntity()).callEvent();
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public void c() {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
public boolean b() {
|
||||
EntityLiving entityliving = this.a.getGoalTarget();
|
||||
|
@ -114,9 +115,10 @@ index f92bf02b87..81966542ee 100644
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
public void e() {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
this.a.a((Entity) this.a.getGoalTarget(), 10.0F, 10.0F);
|
||||
((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.dt());
|
||||
((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.dV());
|
||||
}
|
||||
+
|
||||
+ // Paper start - clear timer and target when goal resets
|
||||
|
@ -145,7 +147,7 @@ index f92bf02b87..81966542ee 100644
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
||||
index 18e7ef80ac..8403c1e01c 100644
|
||||
index 00fbef360..6c11a5f8a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
||||
@@ -0,0 +0,0 @@ public class CraftSlime extends CraftMob implements Slime {
|
||||
|
|
|
@ -15,7 +15,7 @@ This seed will end up being saved to the world data file, so it is
|
|||
a permanent change in that it won't go back if you remove it from paper.yml
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 2023b5af0f..07d7976d21 100644
|
||||
index 8062054ab..e1bbe142b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ import java.lang.reflect.Modifier;
|
||||
|
@ -59,10 +59,10 @@ index 2023b5af0f..07d7976d21 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index ae271a57fc..4543ac8f15 100644
|
||||
index 0cebf6f5a..27af4398c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.convertWorld(name); // Run conversion now
|
||||
|
||||
org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
|
||||
|
@ -72,7 +72,7 @@ index ae271a57fc..4543ac8f15 100644
|
|||
|
||||
if (j == 0) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldData.java b/src/main/java/net/minecraft/server/WorldData.java
|
||||
index 8458dc17d4..b5fb95293e 100644
|
||||
index c69a32477..43a557eb4 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldData.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldData.java
|
||||
@@ -0,0 +0,0 @@ public class WorldData {
|
||||
|
@ -85,7 +85,7 @@ index 8458dc17d4..b5fb95293e 100644
|
|||
String s = nbttagcompound.getString("generatorName");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d5ab1d11a2..3cf3037857 100644
|
||||
index 7b204d584..cf657167d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -5,105 +5,106 @@ Subject: [PATCH] Turtle API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
index b016e0ae7c..a533e0eb5b 100644
|
||||
index 1b4933c07..b7929c5c4 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
|
||||
this.Q = 1.0F;
|
||||
this.K = 1.0F;
|
||||
}
|
||||
|
||||
+ public void setHome(BlockPosition pos) { g(pos); } // Paper - OBFHELPER
|
||||
public void g(BlockPosition blockposition) {
|
||||
this.datawatcher.set(EntityTurtle.bD, blockposition);
|
||||
this.datawatcher.set(EntityTurtle.bA, blockposition);
|
||||
}
|
||||
|
||||
+ public BlockPosition getHome() { return dA(); } // Paper - OBFHELPER
|
||||
private BlockPosition dA() {
|
||||
return (BlockPosition) this.datawatcher.get(EntityTurtle.bD);
|
||||
+ public BlockPosition getHome() { return dX(); } // Paper - OBFHELPER
|
||||
private BlockPosition dX() {
|
||||
return (BlockPosition) this.datawatcher.get(EntityTurtle.bA);
|
||||
}
|
||||
|
||||
+ public void setTravelPos(BlockPosition pos) { h(pos); } // Paper - OBFHELPER
|
||||
private void h(BlockPosition blockposition) {
|
||||
this.datawatcher.set(EntityTurtle.bH, blockposition);
|
||||
this.datawatcher.set(EntityTurtle.bE, blockposition);
|
||||
}
|
||||
|
||||
+ public BlockPosition getTravelPos() { return dB(); } // Paper - OBFHELPER
|
||||
private BlockPosition dB() {
|
||||
return (BlockPosition) this.datawatcher.get(EntityTurtle.bH);
|
||||
+ public BlockPosition getTravelPos() { return dY(); } // Paper - OBFHELPER
|
||||
private BlockPosition dY() {
|
||||
return (BlockPosition) this.datawatcher.get(EntityTurtle.bE);
|
||||
}
|
||||
|
||||
+ public boolean hasEgg() { return dy(); } // Paper - OBFHELPER
|
||||
public boolean dy() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bE);
|
||||
+ public boolean hasEgg() { return dV(); } // Paper - OBFHELPER
|
||||
public boolean dV() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bB);
|
||||
}
|
||||
|
||||
+ public void setHasEgg(boolean hasEgg) { s(hasEgg); } // Paper - OBFHELPER
|
||||
+ public void setHasEgg(boolean hasEgg) { r(hasEgg); } // Paper - OBFHELPER
|
||||
private void r(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bB, flag);
|
||||
}
|
||||
|
||||
+ public boolean isDigging() { return dW(); } // Paper - OBFHELPER
|
||||
public boolean dW() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bD);
|
||||
}
|
||||
|
||||
+ public void setDigging(boolean digging) { s(digging); } // Paper - OBFHELPER
|
||||
private void s(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bE, flag);
|
||||
this.bH = flag ? 1 : 0;
|
||||
this.datawatcher.set(EntityTurtle.bD, flag);
|
||||
}
|
||||
|
||||
+ public boolean isDigging() { return dz(); } // Paper - OBFHELPER
|
||||
public boolean dz() {
|
||||
+ public boolean isGoingHome() { return dZ(); } // Paper - OBFHELPER
|
||||
private boolean dZ() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bF);
|
||||
}
|
||||
|
||||
+ public void setGoingHome(boolean goingHome) { t(goingHome); } // Paper - OBFHELPER
|
||||
private void t(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bF, flag);
|
||||
}
|
||||
|
||||
+ public boolean isTravelling() { return ee(); } // Paper - OBFHELPER
|
||||
private boolean ee() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bG);
|
||||
}
|
||||
|
||||
+ public void setDigging(boolean digging) { t(digging); } // Paper - OBFHELPER
|
||||
private void t(boolean flag) {
|
||||
this.bK = flag ? 1 : 0;
|
||||
+ public void setTravelling(boolean travelling) { u(travelling); } // Paper - OBFHELPER
|
||||
private void u(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bG, flag);
|
||||
}
|
||||
|
||||
+ public boolean isGoingHome() { return dC(); } // Paper - OBFHELPER
|
||||
private boolean dC() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bI);
|
||||
}
|
||||
|
||||
+ public void setGoingHome(boolean goingHome) { u(goingHome); } // Paper - OBFHELPER
|
||||
private void u(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bI, flag);
|
||||
}
|
||||
|
||||
+ public boolean isTravelling() { return dH(); } // Paper - OBFHELPER
|
||||
private boolean dH() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bJ);
|
||||
}
|
||||
|
||||
+ public void setTravelling(boolean travelling) { v(travelling); } // Paper - OBFHELPER
|
||||
private void v(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bJ, flag);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
|
||||
|
||||
if (!this.f.isInWater() && this.k()) {
|
||||
if (this.f.bK < 1) {
|
||||
- this.f.t(true);
|
||||
+ this.f.setDigging(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.f.getBukkitEntity(), MCUtil.toLocation(this.f.world, this.d)).callEvent()); // Paper
|
||||
} else if (this.f.bK > 200) {
|
||||
World world = this.f.world;
|
||||
if (!this.g.isInWater() && this.k()) {
|
||||
if (this.g.bH < 1) {
|
||||
- this.g.s(true);
|
||||
+ this.g.setDigging(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.e)).callEvent()); // Paper
|
||||
} else if (this.g.bH > 200) {
|
||||
World world = this.g.world;
|
||||
|
||||
// CraftBukkit start
|
||||
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, this.d.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, Integer.valueOf(this.f.random.nextInt(4) + 1))).isCancelled()) {
|
||||
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.g, this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1)).isCancelled()) {
|
||||
+ // Paper start
|
||||
+ int eggCount = this.f.random.nextInt(4) + 1;
|
||||
+ com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.f.getBukkitEntity(), MCUtil.toLocation(this.f.world, this.d.up()), eggCount);
|
||||
+ if (layEggEvent.callEvent() && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, this.d.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount())).isCancelled()) {
|
||||
+ int eggCount = this.g.random.nextInt(4) + 1;
|
||||
+ com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.e.up()), eggCount);
|
||||
+ if (layEggEvent.callEvent() && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.g, this.e.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount())).isCancelled()) {
|
||||
world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
|
||||
- world.setTypeAndData(this.d.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.f.random.nextInt(4) + 1), 3);
|
||||
+ world.setTypeAndData(this.d.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount()), 3);
|
||||
- world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1), 3);
|
||||
+ world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount()), 3);
|
||||
+ // Paper end
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.f.s(false);
|
||||
this.g.r(false);
|
||||
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return this.a.isBaby() ? false : (this.a.dy() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : this.a.c(this.a.dA()) >= 4096.0D));
|
||||
+ return this.a.isBaby() ? false : (this.a.dy() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : this.a.c(this.a.dA()) >= 4096.0D)) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper;
|
||||
- return this.a.isBaby() ? false : (this.a.dV() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.dX().a((IPosition) this.a.ch(), 64.0D)));
|
||||
+ return this.a.isBaby() ? false : (this.a.dV() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.dX().a((IPosition) this.a.ch(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
|
||||
index 123a2c75ca..8edcf7af65 100644
|
||||
index 123a2c75c..8edcf7af6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
Loading…
Reference in a new issue