diff --git a/Patches/Bukkit-Patches/0030-Change-VehicleExitEvent-to-support-non-vechicles.patch b/Patches/Bukkit-Patches/0030-Change-VehicleExitEvent-to-support-non-vechicles.patch new file mode 100644 index 000000000..c70f58971 --- /dev/null +++ b/Patches/Bukkit-Patches/0030-Change-VehicleExitEvent-to-support-non-vechicles.patch @@ -0,0 +1,46 @@ +From 0b2e6d55efca6de55c7e6dc48de65c7c4ffb6166 Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:37:32 +1300 +Subject: [PATCH] Change VehicleExitEvent to support non-vechicles + + +diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +index 364451b..9d36cad 100644 +--- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java ++++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +@@ -1,21 +1,29 @@ + package org.bukkit.event.vehicle; + ++import org.bukkit.entity.Entity; + import org.bukkit.entity.LivingEntity; + import org.bukkit.entity.Vehicle; + import org.bukkit.event.Cancellable; ++import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + + /** + * Raised when a living entity exits a vehicle. + */ +-public class VehicleExitEvent extends VehicleEvent implements Cancellable { ++public class VehicleExitEvent extends Event implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final LivingEntity exited; ++ private final Entity vehicle; + +- public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { +- super(vehicle); ++ public VehicleExitEvent(final Entity vehicle, final LivingEntity exited) { + this.exited = exited; ++ this.vehicle = vehicle; ++ } ++ ++ public Entity getVehicle() ++ { ++ return vehicle; + } + + /** +-- +1.9.5.msysgit.0 + diff --git a/Patches/Bukkit-Patches/0030-Mineplex-Entity-Changes.patch b/Patches/Bukkit-Patches/0030-Mineplex-Entity-Changes.patch deleted file mode 100644 index 6d4f1a800..000000000 --- a/Patches/Bukkit-Patches/0030-Mineplex-Entity-Changes.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 95da114a0184f29b4765b90e81c5a5d3be025a08 Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Tue, 21 Apr 2015 19:12:35 -0400 -Subject: [PATCH] Mineplex - Entity Changes - - -diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 48e2508..a94867b 100644 ---- a/src/main/java/org/bukkit/entity/LivingEntity.java -+++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -215,7 +215,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { - * This method exists for legacy reasons to provide backwards - * compatibility. It will not exist at runtime and should not be used - * under any circumstances. -- * -+ * - * @return damage taken since the last no damage ticks time period - */ - @Deprecated -@@ -232,7 +232,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { - * This method exists for legacy reasons to provide backwards - * compatibility. It will not exist at runtime and should not be used - * under any circumstances. -- * -+ * - * @param damage amount of damage - */ - @Deprecated -@@ -392,4 +392,20 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { - * @return whether the operation was successful - */ - public boolean setLeashHolder(Entity holder); -+ -+ public boolean shouldBreakLeash(); -+ -+ public void setShouldBreakLeash(boolean shouldBreakLeash); -+ -+ public boolean shouldPullWhileLeashed(); -+ -+ public void setPullWhileLeashed(boolean pullWhileLeashed); -+ -+ public boolean isVegetated(); -+ -+ public void setVegetated(boolean vegetated); -+ -+ public boolean isGhost(); -+ -+ public void setGhost(boolean ghost); - } -diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java -index 364451b..9d36cad 100644 ---- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java -+++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java -@@ -1,21 +1,29 @@ - package org.bukkit.event.vehicle; - -+import org.bukkit.entity.Entity; - import org.bukkit.entity.LivingEntity; - import org.bukkit.entity.Vehicle; - import org.bukkit.event.Cancellable; -+import org.bukkit.event.Event; - import org.bukkit.event.HandlerList; - - /** - * Raised when a living entity exits a vehicle. - */ --public class VehicleExitEvent extends VehicleEvent implements Cancellable { -+public class VehicleExitEvent extends Event implements Cancellable { - private static final HandlerList handlers = new HandlerList(); - private boolean cancelled; - private final LivingEntity exited; -+ private final Entity vehicle; - -- public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { -- super(vehicle); -+ public VehicleExitEvent(final Entity vehicle, final LivingEntity exited) { - this.exited = exited; -+ this.vehicle = vehicle; -+ } -+ -+ public Entity getVehicle() -+ { -+ return vehicle; - } - - /** --- -2.3.5 - diff --git a/Patches/Bukkit-Patches/0031-Change-LivingEntity-to-support-Mineplex-calls.patch b/Patches/Bukkit-Patches/0031-Change-LivingEntity-to-support-Mineplex-calls.patch new file mode 100644 index 000000000..97eafac9d --- /dev/null +++ b/Patches/Bukkit-Patches/0031-Change-LivingEntity-to-support-Mineplex-calls.patch @@ -0,0 +1,34 @@ +From c465eb8207feeb742f11eee16e7e1f44b0e3f33c Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:38:17 +1300 +Subject: [PATCH] Change LivingEntity to support Mineplex calls + + +diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java +index 48e2508..fb623ae 100644 +--- a/src/main/java/org/bukkit/entity/LivingEntity.java ++++ b/src/main/java/org/bukkit/entity/LivingEntity.java +@@ -392,4 +392,20 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { + * @return whether the operation was successful + */ + public boolean setLeashHolder(Entity holder); ++ ++ public boolean shouldBreakLeash(); ++ ++ public void setShouldBreakLeash(boolean shouldBreakLeash); ++ ++ public boolean shouldPullWhileLeashed(); ++ ++ public void setPullWhileLeashed(boolean pullWhileLeashed); ++ ++ public boolean isVegetated(); ++ ++ public void setVegetated(boolean vegetated); ++ ++ public boolean isGhost(); ++ ++ public void setGhost(boolean ghost); + } +-- +1.9.5.msysgit.0 + diff --git a/Patches/CraftBukkit-Patches/0160-Mineplex-Ignore-EULA.patch b/Patches/CraftBukkit-Patches/0160-Mineplex-Ignore-EULA.patch deleted file mode 100644 index 5537ab283..000000000 --- a/Patches/CraftBukkit-Patches/0160-Mineplex-Ignore-EULA.patch +++ /dev/null @@ -1,22 +0,0 @@ -From d9962d706bd608053c454e7b3c4561eb0ea7acaf Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Sun, 19 Apr 2015 02:01:08 -0400 -Subject: [PATCH] Mineplex - Ignore EULA - - -diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 86ff385..95ff1d4 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -133,7 +133,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - System.err.println( "If you do not agree to the above EULA please stop your server and remove this flag immediately." ); - } - // Spigot End -- if (!this.p.a() && !eulaAgreed) { // Spigot -+ if (false && !this.p.a() && !eulaAgreed) { // Spigot - DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); - this.p.b(); - return false; --- -2.3.5 - diff --git a/Patches/CraftBukkit-Patches/0162-Mineplex-Packet-Changes.patch b/Patches/CraftBukkit-Patches/0161-Modifications-to-Packets-mostly-making-fields-public.patch similarity index 58% rename from Patches/CraftBukkit-Patches/0162-Mineplex-Packet-Changes.patch rename to Patches/CraftBukkit-Patches/0161-Modifications-to-Packets-mostly-making-fields-public.patch index 368e508a7..9804e6b7c 100644 --- a/Patches/CraftBukkit-Patches/0162-Mineplex-Packet-Changes.patch +++ b/Patches/CraftBukkit-Patches/0161-Modifications-to-Packets-mostly-making-fields-public.patch @@ -1,84 +1,34 @@ -From 07c2505577db74399f7f9ddb0381241a3f0683da Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Tue, 21 Apr 2015 19:48:02 -0400 -Subject: [PATCH] Mineplex - Packet Changes +From 4ddf4eaf665e146583fe29d22045e17738bd8160 Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:44:17 +1300 +Subject: [PATCH] Modifications to Packets, mostly making fields public -diff --git a/src/main/java/com/mineplex/spigot/IPacketVerifier.java b/src/main/java/com/mineplex/spigot/IPacketVerifier.java -new file mode 100644 -index 0000000..4ada0b2 ---- /dev/null -+++ b/src/main/java/com/mineplex/spigot/IPacketVerifier.java -@@ -0,0 +1,8 @@ -+package com.mineplex.spigot; -+ -+import net.minecraft.server.Packet; -+ -+public interface IPacketVerifier -+{ -+ public boolean verify(Packet packet); -+} -diff --git a/src/main/java/com/mineplex/spigot/PacketProcessor.java b/src/main/java/com/mineplex/spigot/PacketProcessor.java -new file mode 100644 -index 0000000..e372c4f ---- /dev/null -+++ b/src/main/java/com/mineplex/spigot/PacketProcessor.java -@@ -0,0 +1,42 @@ -+package com.mineplex.spigot; -+ -+import net.minecraft.server.NetworkManager; -+import net.minecraft.server.Packet; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+public class PacketProcessor -+{ -+ private List _packetVerifiers; -+ -+ public PacketProcessor() -+ { -+ _packetVerifiers = new ArrayList(); -+ } -+ -+ public void addPacketVerifier(IPacketVerifier verifier) -+ { -+ _packetVerifiers.add(verifier); -+ } -+ -+ public void processPacket(Packet packet, NetworkManager networkManager) -+ { -+ boolean addDefaultPacket = true; -+ -+ for (IPacketVerifier verifier : _packetVerifiers) -+ { -+ if (!verifier.verify(packet)) -+ addDefaultPacket = false; -+ } -+ -+ if (addDefaultPacket) -+ networkManager.handle(packet); -+ } -+ -+ public void clearVerifiers() -+ { -+ _packetVerifiers.clear(); -+ } -+ -+} -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 01c09b1..5d36e16 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -325,7 +325,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { - this.a(channelhandlercontext, (Packet) object); - } +diff --git a/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java b/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java +index 02d8e07..ac5928d 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java +@@ -4,13 +4,13 @@ import java.io.IOException; -- static class QueuedPacket { -+ public static class QueuedPacket { + public class PacketPlayInBlockPlace implements Packet { + +- private static final BlockPosition a = new BlockPosition(-1, -1, -1); +- private BlockPosition b; +- private int c; +- private ItemStack d; +- private float e; +- private float f; +- private float g; ++ public static final BlockPosition a = new BlockPosition(-1, -1, -1); ++ public BlockPosition b; ++ public int c; ++ public ItemStack d; ++ public float e; ++ public float f; ++ public float g; + + public long timestamp; // CraftBukkit - private final Packet a; - private final GenericFutureListener>[] b; diff --git a/src/main/java/net/minecraft/server/PacketPlayInCloseWindow.java b/src/main/java/net/minecraft/server/PacketPlayInCloseWindow.java index 4dfb6c0..05c88a6 100644 --- a/src/main/java/net/minecraft/server/PacketPlayInCloseWindow.java @@ -92,6 +42,80 @@ index 4dfb6c0..05c88a6 100644 public PacketPlayInCloseWindow() {} +diff --git a/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java b/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java +index 064374a..c96c2a3 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java +@@ -4,7 +4,7 @@ import java.io.IOException; + + public class PacketPlayInResourcePackStatus implements Packet { + +- private String a; ++ public String a; + public PacketPlayInResourcePackStatus.EnumResourcePackStatus b; // PAIL: private -> public, rename: status + + public PacketPlayInResourcePackStatus() {} +diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +new file mode 100644 +index 0000000..40c4e2d +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +@@ -0,0 +1,54 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++ ++public class PacketPlayInUseEntity ++ implements Packet ++{ ++ public int a; ++ public EnumEntityUseAction action; ++ public Vec3D c; ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) ++ throws IOException ++ { ++ this.a = paramPacketDataSerializer.e(); ++ this.action = ((EnumEntityUseAction)paramPacketDataSerializer.a(EnumEntityUseAction.class)); ++ if (this.action == EnumEntityUseAction.INTERACT_AT) ++ this.c = new Vec3D(paramPacketDataSerializer.readFloat(), paramPacketDataSerializer.readFloat(), paramPacketDataSerializer.readFloat()); ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) ++ throws IOException ++ { ++ paramPacketDataSerializer.b(this.a); ++ paramPacketDataSerializer.a(this.action); ++ if (this.action == EnumEntityUseAction.INTERACT_AT) { ++ paramPacketDataSerializer.writeFloat((float)this.c.a); ++ paramPacketDataSerializer.writeFloat((float)this.c.b); ++ paramPacketDataSerializer.writeFloat((float)this.c.c); ++ } ++ } ++ ++ public void a(PacketListenerPlayIn paramPacketListenerPlayIn) ++ { ++ paramPacketListenerPlayIn.a(this); ++ } ++ ++ public Entity a(World paramWorld) { ++ return paramWorld.a(this.a); ++ } ++ ++ public EnumEntityUseAction a() { ++ return this.action; ++ } ++ ++ public Vec3D b() { ++ return this.c; ++ } ++ ++ public static enum EnumEntityUseAction ++ { ++ INTERACT, ATTACK, INTERACT_AT; ++ } ++} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/PacketPlayOutAnimation.java b/src/main/java/net/minecraft/server/PacketPlayOutAnimation.java new file mode 100644 index 0000000..b5fdd87 @@ -130,7 +154,7 @@ index 0000000..b5fdd87 +} diff --git a/src/main/java/net/minecraft/server/PacketPlayOutAttachEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutAttachEntity.java new file mode 100644 -index 0000000..6e17e4b +index 0000000..314a2de --- /dev/null +++ b/src/main/java/net/minecraft/server/PacketPlayOutAttachEntity.java @@ -0,0 +1,41 @@ @@ -175,7 +199,52 @@ index 0000000..6e17e4b + packetlistenerplayout.a(this); + } +} -\ No newline at end of file +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutBed.java b/src/main/java/net/minecraft/server/PacketPlayOutBed.java +new file mode 100644 +index 0000000..6d7f65e +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutBed.java +@@ -0,0 +1,40 @@ ++package net.minecraft.server; ++ ++public class PacketPlayOutBed ++ implements Packet ++{ ++ public int a; ++ public BlockPosition b; ++ ++ public PacketPlayOutBed() ++ { ++ } ++ ++ public PacketPlayOutBed(EntityHuman entityhuman, BlockPosition blockposition) ++ { ++ a = entityhuman.getId(); ++ b = blockposition; ++ } ++ ++ public void a(PacketDataSerializer packetdataserializer) ++ { ++ a = packetdataserializer.e(); ++ b = packetdataserializer.c(); ++ } ++ ++ public void b(PacketDataSerializer packetdataserializer) ++ { ++ packetdataserializer.b(a); ++ packetdataserializer.a(b); ++ } ++ ++ public void a(PacketListenerPlayOut packetlistenerplayout) ++ { ++ packetlistenerplayout.a(this); ++ } ++ ++ public void a(PacketListener packetlistener) ++ { ++ a((PacketListenerPlayOut)packetlistener); ++ } ++} diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java index 6cd5df2..5acec91 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java @@ -332,6 +401,53 @@ index 0000000..702d33d + } + } +} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityDestroy.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityDestroy.java +new file mode 100644 +index 0000000..2ed18fc +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityDestroy.java +@@ -0,0 +1,40 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++ ++public class PacketPlayOutEntityDestroy ++ implements Packet ++{ ++ public int[] a; ++ ++ public PacketPlayOutEntityDestroy() ++ { ++ } ++ ++ public PacketPlayOutEntityDestroy(int[] s) ++ { ++ this.a = s; ++ } ++ ++ public void a(PacketDataSerializer f) throws IOException ++ { ++ this.a = new int[f.e()]; ++ ++ for (int e = 0; e < this.a.length; e++) ++ this.a[e] = f.e(); ++ } ++ ++ public void b(PacketDataSerializer q) ++ throws IOException ++ { ++ q.b(this.a.length); ++ ++ for (int d = 0; d < this.a.length; d++) ++ q.b(this.a[d]); ++ } ++ ++ public void a(PacketListenerPlayOut w) ++ { ++ w.a(this); ++ } ++} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityEquipment.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityEquipment.java new file mode 100644 index 0000000..ecc2e78 @@ -416,6 +532,52 @@ index 0000000..dbfcc3c + } + +} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityStatus.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityStatus.java +new file mode 100644 +index 0000000..e05f2c8 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityStatus.java +@@ -0,0 +1,40 @@ ++package net.minecraft.server; ++ ++public class PacketPlayOutEntityStatus ++ implements Packet ++{ ++ public int a; ++ public byte b; ++ ++ public PacketPlayOutEntityStatus() ++ { ++ } ++ ++ public PacketPlayOutEntityStatus(Entity entity, byte byte0) ++ { ++ a = entity.getId(); ++ b = byte0; ++ } ++ ++ public void a(PacketDataSerializer packetdataserializer) ++ { ++ a = packetdataserializer.readInt(); ++ b = packetdataserializer.readByte(); ++ } ++ ++ public void b(PacketDataSerializer packetdataserializer) ++ { ++ packetdataserializer.writeInt(a); ++ packetdataserializer.writeByte(b); ++ } ++ ++ public void a(PacketListenerPlayOut packetlistenerplayout) ++ { ++ packetlistenerplayout.a(this); ++ } ++ ++ public void a(PacketListener packetlistener) ++ { ++ a((PacketListenerPlayOut)packetlistener); ++ } ++} diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java new file mode 100644 index 0000000..786047c @@ -555,6 +717,62 @@ index 0000000..6c8dbbc + } + +} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +index 58c0275..c72526a 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +@@ -7,10 +7,11 @@ import java.util.Iterator; + + public class PacketPlayOutMapChunk implements Packet { + +- private int a; +- private int b; +- private PacketPlayOutMapChunk.ChunkMap c; +- private boolean d; ++ public int a; ++ public int b; ++ public PacketPlayOutMapChunk.ChunkMap c; ++ public boolean d; ++ public Chunk mapChunk; + + public PacketPlayOutMapChunk() {} + +@@ -20,6 +21,7 @@ public class PacketPlayOutMapChunk implements Packet { + this.d = flag; + this.c = a(chunk, flag, !chunk.getWorld().worldProvider.o(), i); + chunk.world.spigotConfig.antiXrayInstance.obfuscateSync(chunk.locX, chunk.locZ, c.b, c.a, chunk.world); ++ mapChunk = chunk; + } + + public void a(PacketDataSerializer packetdataserializer) throws IOException { +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java +index 10c0e34..54c1ec9 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java +@@ -5,16 +5,18 @@ import java.util.List; + + public class PacketPlayOutMapChunkBulk implements Packet { + +- private int[] a; +- private int[] b; +- private PacketPlayOutMapChunk.ChunkMap[] c; +- private boolean d; +- private World world; // Spigot ++ public int[] a; ++ public int[] b; ++ public PacketPlayOutMapChunk.ChunkMap[] c; ++ public boolean d; ++ public World world; // Spigot ++ public List mapChunks; + + public PacketPlayOutMapChunkBulk() {} + + public PacketPlayOutMapChunkBulk(List list) { + int i = list.size(); ++ mapChunks = list; + + this.a = new int[i]; + this.b = new int[i]; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java new file mode 100644 index 0000000..23fa49d @@ -625,6 +843,96 @@ index 0000000..23fa49d + } + +} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java +new file mode 100644 +index 0000000..7b1a6f1 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java +@@ -0,0 +1,63 @@ ++package net.minecraft.server; ++ ++import org.apache.commons.lang3.Validate; ++ ++public class PacketPlayOutNamedSoundEffect ++ implements Packet ++{ ++ public String a; ++ public int b; ++ public int c; ++ public int d; ++ public float e; ++ public int f; ++ ++ public PacketPlayOutNamedSoundEffect() ++ { ++ c = 0x7fffffff; ++ } ++ ++ public PacketPlayOutNamedSoundEffect(String s, double d1, double d2, double d3, ++ float f1, float f2) ++ { ++ c = 0x7fffffff; ++ Validate.notNull(s, "name", new Object[0]); ++ a = s; ++ b = (int)(d1 * 8D); ++ c = (int)(d2 * 8D); ++ d = (int)(d3 * 8D); ++ e = f1; ++ f = (int)(f2 * 63F); ++ f2 = MathHelper.a(f2, 0.0F, 255F); ++ } ++ ++ public void a(PacketDataSerializer packetdataserializer) ++ { ++ a = packetdataserializer.c(256); ++ b = packetdataserializer.readInt(); ++ c = packetdataserializer.readInt(); ++ d = packetdataserializer.readInt(); ++ e = packetdataserializer.readFloat(); ++ f = packetdataserializer.readUnsignedByte(); ++ } ++ ++ public void b(PacketDataSerializer packetdataserializer) ++ { ++ packetdataserializer.a(a); ++ packetdataserializer.writeInt(b); ++ packetdataserializer.writeInt(c); ++ packetdataserializer.writeInt(d); ++ packetdataserializer.writeFloat(e); ++ packetdataserializer.writeByte(f); ++ } ++ ++ public void a(PacketListenerPlayOut packetlistenerplayout) ++ { ++ packetlistenerplayout.a(this); ++ } ++ ++ public void a(PacketListener packetlistener) ++ { ++ a((PacketListenerPlayOut)packetlistener); ++ } ++} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java b/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java +index c168194..4c1e9cf 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java +@@ -4,11 +4,11 @@ import java.io.IOException; + + public class PacketPlayOutOpenWindow implements Packet { + +- private int a; +- private String b; +- private IChatBaseComponent c; +- private int d; +- private int e; ++ public int a; ++ public String b; ++ public IChatBaseComponent c; ++ public int d; ++ public int e; + + public PacketPlayOutOpenWindow() {} + diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerInfo.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerInfo.java new file mode 100644 index 0000000..99809cd @@ -921,6 +1229,348 @@ index 0000000..9aebe07 + } + +} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardDisplayObjective.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardDisplayObjective.java +new file mode 100644 +index 0000000..d133b87 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardDisplayObjective.java +@@ -0,0 +1,42 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++ ++public class PacketPlayOutScoreboardDisplayObjective ++ implements Packet ++{ ++ public int a; ++ public String b; ++ ++ public PacketPlayOutScoreboardDisplayObjective() ++ { ++ } ++ ++ public PacketPlayOutScoreboardDisplayObjective(int paramInt, ScoreboardObjective paramScoreboardObjective) ++ { ++ this.a = paramInt; ++ ++ if (paramScoreboardObjective == null) ++ this.b = ""; ++ else ++ this.b = paramScoreboardObjective.getName(); ++ } ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) ++ throws IOException ++ { ++ this.a = paramPacketDataSerializer.readByte(); ++ this.b = paramPacketDataSerializer.c(16); ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ paramPacketDataSerializer.writeByte(this.a); ++ paramPacketDataSerializer.a(this.b); ++ } ++ ++ public void a(PacketListenerPlayOut paramPacketListenerPlayOut) ++ { ++ paramPacketListenerPlayOut.a(this); ++ } ++} +\ No newline at end of file +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardObjective.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardObjective.java +new file mode 100644 +index 0000000..1902839 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardObjective.java +@@ -0,0 +1,51 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++ ++public class PacketPlayOutScoreboardObjective ++ implements Packet ++{ ++ public String a; ++ public String b; ++ public IScoreboardCriteria.EnumScoreboardHealthDisplay c; ++ public int d; ++ ++ public PacketPlayOutScoreboardObjective() ++ { ++ } ++ ++ public PacketPlayOutScoreboardObjective(ScoreboardObjective paramScoreboardObjective, int paramInt) ++ { ++ this.a = paramScoreboardObjective.getName(); ++ this.b = paramScoreboardObjective.getDisplayName(); ++ this.c = paramScoreboardObjective.getCriteria().c(); ++ this.d = paramInt; ++ } ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ this.a = paramPacketDataSerializer.c(16); ++ this.d = paramPacketDataSerializer.readByte(); ++ ++ if ((this.d == 0) || (this.d == 2)) { ++ this.b = paramPacketDataSerializer.c(32); ++ this.c = IScoreboardCriteria.EnumScoreboardHealthDisplay.a(paramPacketDataSerializer.c(16)); ++ } ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ paramPacketDataSerializer.a(this.a); ++ paramPacketDataSerializer.writeByte(this.d); ++ ++ if ((this.d == 0) || (this.d == 2)) { ++ paramPacketDataSerializer.a(this.b); ++ paramPacketDataSerializer.a(this.c.a()); ++ } ++ } ++ ++ public void a(PacketListenerPlayOut paramPacketListenerPlayOut) ++ { ++ paramPacketListenerPlayOut.a(this); ++ } ++} +\ No newline at end of file +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardScore.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardScore.java +new file mode 100644 +index 0000000..1c656d1 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardScore.java +@@ -0,0 +1,69 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++ ++public class PacketPlayOutScoreboardScore ++ implements Packet ++{ ++ public String a = ""; ++ public String b = ""; ++ public int c; ++ public EnumScoreboardAction d; ++ ++ public PacketPlayOutScoreboardScore() ++ { ++ } ++ ++ public PacketPlayOutScoreboardScore(ScoreboardScore paramScoreboardScore) ++ { ++ this.a = paramScoreboardScore.getPlayerName(); ++ this.b = paramScoreboardScore.getObjective().getName(); ++ this.c = paramScoreboardScore.getScore(); ++ this.d = EnumScoreboardAction.CHANGE; ++ } ++ ++ public PacketPlayOutScoreboardScore(String paramString) { ++ this.a = paramString; ++ this.b = ""; ++ this.c = 0; ++ this.d = EnumScoreboardAction.REMOVE; ++ } ++ ++ public PacketPlayOutScoreboardScore(String paramString, ScoreboardObjective paramScoreboardObjective) { ++ this.a = paramString; ++ this.b = paramScoreboardObjective.getName(); ++ this.c = 0; ++ this.d = EnumScoreboardAction.REMOVE; ++ } ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ this.a = paramPacketDataSerializer.c(40); ++ this.d = ((EnumScoreboardAction)paramPacketDataSerializer.a(EnumScoreboardAction.class)); ++ this.b = paramPacketDataSerializer.c(16); ++ ++ if (this.d != EnumScoreboardAction.REMOVE) ++ this.c = paramPacketDataSerializer.e(); ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) ++ throws IOException ++ { ++ paramPacketDataSerializer.a(this.a); ++ paramPacketDataSerializer.a(this.d); ++ paramPacketDataSerializer.a(this.b); ++ ++ if (this.d != EnumScoreboardAction.REMOVE) ++ paramPacketDataSerializer.b(this.c); ++ } ++ ++ public void a(PacketListenerPlayOut paramPacketListenerPlayOut) ++ { ++ paramPacketListenerPlayOut.a(this); ++ } ++ ++ public static enum EnumScoreboardAction ++ { ++ CHANGE, REMOVE; ++ } ++} +\ No newline at end of file +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +new file mode 100644 +index 0000000..f300bfc +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +@@ -0,0 +1,104 @@ ++package net.minecraft.server; ++ ++import com.google.common.collect.Lists; ++import java.io.IOException; ++import java.util.Collection; ++ ++public class PacketPlayOutScoreboardTeam ++ implements Packet ++{ ++ public String a = ""; ++ public String b = ""; ++ public String c = ""; ++ public String d = ""; ++ public String e = ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS.e; ++ public int f = -1; ++ public Collection g = Lists.newArrayList(); ++ public int h; ++ public int i; ++ ++ public PacketPlayOutScoreboardTeam() ++ { ++ } ++ ++ public PacketPlayOutScoreboardTeam(ScoreboardTeam paramScoreboardTeam, int paramInt) ++ { ++ this.a = paramScoreboardTeam.getName(); ++ this.h = paramInt; ++ ++ if ((paramInt == 0) || (paramInt == 2)) { ++ this.b = paramScoreboardTeam.getDisplayName(); ++ this.c = paramScoreboardTeam.getPrefix(); ++ this.d = paramScoreboardTeam.getSuffix(); ++ this.i = paramScoreboardTeam.packOptionData(); ++ this.e = paramScoreboardTeam.getNameTagVisibility().e; ++ this.f = paramScoreboardTeam.l().b(); ++ } ++ if (paramInt == 0) ++ this.g.addAll(paramScoreboardTeam.getPlayerNameSet()); ++ } ++ ++ public PacketPlayOutScoreboardTeam(ScoreboardTeam paramScoreboardTeam, Collection paramCollection, int paramInt) ++ { ++ if ((paramInt != 3) && (paramInt != 4)) { ++ throw new IllegalArgumentException("Method must be join or leave for player constructor"); ++ } ++ if ((paramCollection == null) || (paramCollection.isEmpty())) { ++ throw new IllegalArgumentException("Players cannot be null/empty"); ++ } ++ ++ this.h = paramInt; ++ this.a = paramScoreboardTeam.getName(); ++ this.g.addAll(paramCollection); ++ } ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ this.a = paramPacketDataSerializer.c(16); ++ this.h = paramPacketDataSerializer.readByte(); ++ ++ if ((this.h == 0) || (this.h == 2)) { ++ this.b = paramPacketDataSerializer.c(32); ++ this.c = paramPacketDataSerializer.c(16); ++ this.d = paramPacketDataSerializer.c(16); ++ this.i = paramPacketDataSerializer.readByte(); ++ this.e = paramPacketDataSerializer.c(32); ++ this.f = paramPacketDataSerializer.readByte(); ++ } ++ ++ if ((this.h == 0) || (this.h == 3) || (this.h == 4)) { ++ int j = paramPacketDataSerializer.e(); ++ ++ for (int k = 0; k < j; k++) ++ this.g.add(paramPacketDataSerializer.c(40)); ++ } ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) ++ throws IOException ++ { ++ paramPacketDataSerializer.a(this.a); ++ paramPacketDataSerializer.writeByte(this.h); ++ ++ if ((this.h == 0) || (this.h == 2)) { ++ paramPacketDataSerializer.a(this.b); ++ paramPacketDataSerializer.a(this.c); ++ paramPacketDataSerializer.a(this.d); ++ paramPacketDataSerializer.writeByte(this.i); ++ paramPacketDataSerializer.a(this.e); ++ paramPacketDataSerializer.writeByte(this.f); ++ } ++ ++ if ((this.h == 0) || (this.h == 3) || (this.h == 4)) { ++ paramPacketDataSerializer.b(this.g.size()); ++ ++ for (String str : this.g) ++ paramPacketDataSerializer.a(str); ++ } ++ } ++ ++ public void a(PacketListenerPlayOut paramPacketListenerPlayOut) ++ { ++ paramPacketListenerPlayOut.a(this); ++ } ++} +\ No newline at end of file +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSetSlot.java b/src/main/java/net/minecraft/server/PacketPlayOutSetSlot.java +new file mode 100644 +index 0000000..b87994c +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutSetSlot.java +@@ -0,0 +1,41 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++ ++public class PacketPlayOutSetSlot ++ implements Packet ++{ ++ public int a; ++ public int b; ++ public ItemStack c; ++ ++ public PacketPlayOutSetSlot() ++ { ++ } ++ ++ public PacketPlayOutSetSlot(int paramInt1, int paramInt2, ItemStack paramItemStack) ++ { ++ this.a = paramInt1; ++ this.b = paramInt2; ++ this.c = (paramItemStack == null ? null : paramItemStack.cloneItemStack()); ++ } ++ ++ public void a(PacketListenerPlayOut paramPacketListenerPlayOut) ++ { ++ paramPacketListenerPlayOut.a(this); ++ } ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ this.a = paramPacketDataSerializer.readByte(); ++ this.b = paramPacketDataSerializer.readShort(); ++ this.c = paramPacketDataSerializer.i(); ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ paramPacketDataSerializer.writeByte(this.a); ++ paramPacketDataSerializer.writeShort(this.b); ++ paramPacketDataSerializer.a(this.c); ++ } ++} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java new file mode 100644 index 0000000..d34f59b @@ -1168,61 +1818,172 @@ index 0000000..61aa281 + } + +} -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 3108938..69f4762 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2,6 +2,7 @@ package net.minecraft.server; - - import com.google.common.collect.Lists; - import com.google.common.util.concurrent.Futures; -+import com.mineplex.spigot.PacketProcessor; - import io.netty.buffer.Unpooled; - import io.netty.util.concurrent.Future; - import io.netty.util.concurrent.GenericFutureListener; -@@ -84,6 +85,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - private boolean checkMovement = true; - private boolean processedDisconnect; // CraftBukkit - added - -+ public PacketProcessor PacketVerifier; +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutUpdateAttributes.java b/src/main/java/net/minecraft/server/PacketPlayOutUpdateAttributes.java +new file mode 100644 +index 0000000..9a40921 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutUpdateAttributes.java +@@ -0,0 +1,105 @@ ++package net.minecraft.server; + - public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { - this.minecraftServer = minecraftserver; - this.networkManager = networkmanager; -@@ -91,6 +94,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - this.player = entityplayer; - entityplayer.playerConnection = this; - -+ PacketVerifier = new PacketProcessor(); ++import com.google.common.collect.Lists; ++import java.util.*; + - // CraftBukkit start - add fields and methods - this.server = minecraftserver.server; - } -@@ -881,7 +886,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - // CraftBukkit end - - try { -- this.networkManager.handle(packet); -+ PacketVerifier.processPacket(packet, networkManager); - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.a(throwable, "Sending packet"); - CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Packet being sent"); -@@ -1398,9 +1403,13 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - if (this.player.dead) return; // CraftBukkit - PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.u()); - -- CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit -+ if (packetplayinclosewindow.id == player.activeContainer.windowId) ++public class PacketPlayOutUpdateAttributes ++ implements Packet ++{ ++ public int a; ++ public final List b = new ArrayList(); ++ ++ public PacketPlayOutUpdateAttributes() ++ { ++ } ++ ++ public PacketPlayOutUpdateAttributes(int i, Collection collection) ++ { ++ a = i; ++ ++ for (AttributeInstance instance : collection) ++ this.b.add(new AttributeSnapshot(instance.getAttribute().getName(), instance.b(), instance.c())); ++ } ++ ++ public void a(PacketDataSerializer packetdataserializer) ++ { ++ a = packetdataserializer.e(); ++ int i = packetdataserializer.readInt(); ++ for(int j = 0; j < i; j++) + { -+ CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit ++ String s = packetdataserializer.c(64); ++ double d = packetdataserializer.readDouble(); ++ ArrayList arraylist = Lists.newArrayList(); ++ int k = packetdataserializer.e(); ++ for(int l = 0; l < k; l++) ++ { ++ java.util.UUID uuid = packetdataserializer.g(); ++ arraylist.add(new AttributeModifier(uuid, "Unknown synced attribute modifier", packetdataserializer.readDouble(), packetdataserializer.readByte())); ++ } + -+ this.player.p(); ++ b.add(new AttributeSnapshot(s, d, arraylist)); + } - -- this.player.p(); - } - - public void a(PacketPlayInWindowClick packetplayinwindowclick) { ++ ++ } ++ ++ public void b(PacketDataSerializer packetdataserializer) ++ { ++ packetdataserializer.b(a); ++ packetdataserializer.writeInt(b.size()); ++ ++ for (AttributeSnapshot attributesnapshot : b) ++ { ++ packetdataserializer.a(attributesnapshot.a()); ++ packetdataserializer.writeDouble(attributesnapshot.b()); ++ packetdataserializer.b(attributesnapshot.c().size()); ++ Iterator iterator1 = attributesnapshot.c().iterator(); ++ while(iterator1.hasNext()) ++ { ++ AttributeModifier attributemodifier = (AttributeModifier)iterator1.next(); ++ packetdataserializer.a(attributemodifier.a()); ++ packetdataserializer.writeDouble(attributemodifier.d()); ++ packetdataserializer.writeByte(attributemodifier.c()); ++ } ++ } ++ ++ } ++ ++ public void a(PacketListenerPlayOut packetlistenerplayout) ++ { ++ packetlistenerplayout.a(this); ++ } ++ ++ public void a(PacketListener packetlistener) ++ { ++ a((PacketListenerPlayOut)packetlistener); ++ } ++ ++ public class AttributeSnapshot ++ { ++ private final String b; ++ private final double c; ++ private final Collection d; ++ ++ public AttributeSnapshot(String s, double d1, Collection collection) ++ { ++ b = s; ++ c = d1; ++ d = collection; ++ } ++ ++ public String a() ++ { ++ return b; ++ } ++ ++ public double b() ++ { ++ return c; ++ } ++ ++ public Collection c() ++ { ++ return d; ++ } ++} ++} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +new file mode 100644 +index 0000000..4c2705b +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +@@ -0,0 +1,48 @@ ++package net.minecraft.server; ++ ++import java.io.IOException; ++import java.util.List; ++ ++public class PacketPlayOutWindowItems ++ implements Packet ++{ ++ public int a; ++ public ItemStack[] b; ++ ++ public PacketPlayOutWindowItems() ++ { ++ } ++ ++ public PacketPlayOutWindowItems(int paramInt, List paramList) ++ { ++ this.a = paramInt; ++ this.b = new ItemStack[paramList.size()]; ++ for (int i = 0; i < this.b.length; i++) { ++ ItemStack localItemStack = (ItemStack)paramList.get(i); ++ this.b[i] = (localItemStack == null ? null : localItemStack.cloneItemStack()); ++ } ++ } ++ ++ public void a(PacketDataSerializer paramPacketDataSerializer) throws IOException ++ { ++ this.a = paramPacketDataSerializer.readUnsignedByte(); ++ int i = paramPacketDataSerializer.readShort(); ++ this.b = new ItemStack[i]; ++ for (int j = 0; j < i; j++) ++ this.b[j] = paramPacketDataSerializer.i(); ++ } ++ ++ public void b(PacketDataSerializer paramPacketDataSerializer) ++ throws IOException ++ { ++ paramPacketDataSerializer.writeByte(this.a); ++ paramPacketDataSerializer.writeShort(this.b.length); ++ for (ItemStack localItemStack : this.b) ++ paramPacketDataSerializer.a(localItemStack); ++ } ++ ++ public void a(PacketListenerPlayOut paramPacketListenerPlayOut) ++ { ++ paramPacketListenerPlayOut.a(this); ++ } ++} +\ No newline at end of file -- -2.3.5 +1.9.5.msysgit.0 diff --git a/Patches/CraftBukkit-Patches/0162-Add-Mineplex-packetlisteners.patch b/Patches/CraftBukkit-Patches/0162-Add-Mineplex-packetlisteners.patch new file mode 100644 index 000000000..c72d57bd5 --- /dev/null +++ b/Patches/CraftBukkit-Patches/0162-Add-Mineplex-packetlisteners.patch @@ -0,0 +1,353 @@ +From 97a412e3bbb4bf718e132b2f8c779b434b772e05 Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:45:17 +1300 +Subject: [PATCH] Add Mineplex packetlisteners + + +diff --git a/src/main/java/com/mineplex/spigot/IPacketVerifier.java b/src/main/java/com/mineplex/spigot/IPacketVerifier.java +new file mode 100644 +index 0000000..f86dfd1 +--- /dev/null ++++ b/src/main/java/com/mineplex/spigot/IPacketVerifier.java +@@ -0,0 +1,8 @@ ++package com.mineplex.spigot; ++ ++import net.minecraft.server.Packet; ++ ++public interface IPacketVerifier ++{ ++ public boolean handlePacket(Packet packet); ++} +\ No newline at end of file +diff --git a/src/main/java/com/mineplex/spigot/PacketProcessor.java b/src/main/java/com/mineplex/spigot/PacketProcessor.java +new file mode 100644 +index 0000000..5695899 +--- /dev/null ++++ b/src/main/java/com/mineplex/spigot/PacketProcessor.java +@@ -0,0 +1,250 @@ ++package com.mineplex.spigot; ++ ++import java.util.ArrayList; ++import java.util.List; ++import java.util.HashMap; ++import io.netty.util.concurrent.GenericFutureListener; ++ ++import net.minecraft.server.NetworkManager; ++import net.minecraft.server.IChatBaseComponent; ++ ++import net.minecraft.server.Packet; ++import net.minecraft.server.PacketListenerPlayIn; ++import net.minecraft.server.IUpdatePlayerListBox; ++import net.minecraft.server.PlayerConnection; ++import net.minecraft.server.PacketPlayInChat; ++import net.minecraft.server.PacketPlayInTabComplete; ++import net.minecraft.server.PacketPlayInClientCommand; ++import net.minecraft.server.PacketPlayInSettings; ++import net.minecraft.server.PacketPlayInTransaction; ++import net.minecraft.server.PacketPlayInEnchantItem; ++import net.minecraft.server.PacketPlayInWindowClick; ++import net.minecraft.server.PacketPlayInCloseWindow; ++import net.minecraft.server.PacketPlayInCustomPayload; ++import net.minecraft.server.PacketPlayInUseEntity; ++import net.minecraft.server.PacketPlayInKeepAlive; ++import net.minecraft.server.PacketPlayInFlying; ++import net.minecraft.server.PacketPlayInAbilities; ++import net.minecraft.server.PacketPlayInBlockDig; ++import net.minecraft.server.PacketPlayInEntityAction; ++import net.minecraft.server.PacketPlayInSteerVehicle; ++import net.minecraft.server.PacketPlayInHeldItemSlot; ++import net.minecraft.server.PacketPlayInSetCreativeSlot; ++import net.minecraft.server.PacketPlayInUpdateSign; ++import net.minecraft.server.PacketPlayInBlockPlace; ++import net.minecraft.server.PacketPlayInSpectate; ++import net.minecraft.server.PacketPlayInResourcePackStatus; ++import net.minecraft.server.PacketPlayInArmAnimation; ++ ++public class PacketProcessor implements PacketListenerPlayIn, IUpdatePlayerListBox ++{ ++ private IPacketVerifier _packetVerifier; ++ private PlayerConnection _packetListener; ++ private static volatile HashMap _listenedPackets = new HashMap(); ++ ++ public PacketProcessor(PlayerConnection packetListener) ++ { ++ _packetListener = packetListener; ++ } ++ ++ public void setPacketVerifier(IPacketVerifier verifier) ++ { ++ _packetVerifier = verifier; ++ } ++ ++ public void c() ++ { ++ _packetListener.c(); ++ } ++ ++ public static void addPacket(Class packetClass, boolean forceMainThread) ++ { ++ _listenedPackets.put(packetClass, forceMainThread); ++ } ++ ++ public static void removePacket(Class packetClass) ++ { ++ _listenedPackets.remove(packetClass); ++ } ++ ++ public void processOutgoingPacket(Packet packet, NetworkManager networkManager) ++ { ++ if (!_listenedPackets.containsKey(packet.getClass())) ++ { ++ networkManager.handle(packet); ++ return; ++ } ++ ++ boolean addDefaultPacket = true; ++ ++ if (_packetVerifier != null) ++ { ++ if (!_packetVerifier.handlePacket(packet)) ++ { ++ addDefaultPacket = false; ++ } ++ } ++ ++ if (addDefaultPacket) ++ { ++ networkManager.handle(packet); ++ } ++ } ++ ++ public void processIncomingPacket(final Packet packet) ++ { ++ if (!_listenedPackets.containsKey(packet.getClass())) ++ { ++ packet.a(_packetListener); ++ return; ++ } ++ ++ if (!_packetListener.player.u().isMainThread() && _listenedPackets.get(packet.getClass())) ++ { ++ _packetListener.player.u().postToMainThread(new Runnable() ++ { ++ public void run() ++ { ++ processIncomingPacket(packet); ++ } ++ }); ++ ++ return; ++ } ++ ++ boolean addDefaultPacket = true; ++ ++ if (_packetVerifier != null) ++ { ++ if (!_packetVerifier.handlePacket(packet)) ++ { ++ addDefaultPacket = false; ++ } ++ } ++ ++ if (addDefaultPacket) ++ { ++ packet.a(_packetListener); ++ } ++ } ++ ++ public void a(PacketPlayInChat packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInTabComplete packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInClientCommand packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInSettings packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInTransaction packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInEnchantItem packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInWindowClick packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInCloseWindow packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInCustomPayload packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInUseEntity packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInKeepAlive packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInFlying packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInAbilities packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInBlockDig packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInEntityAction packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInSteerVehicle packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInHeldItemSlot packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInSetCreativeSlot packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInUpdateSign packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInBlockPlace packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInSpectate packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInResourcePackStatus packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(PacketPlayInArmAnimation packet) ++ { ++ processIncomingPacket(packet); ++ } ++ ++ public void a(IChatBaseComponent packet) ++ { ++ _packetListener.a(packet); ++ } ++} +\ No newline at end of file +diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java +index 9d23c6c..83a600c 100644 +--- a/src/main/java/net/minecraft/server/NetworkManager.java ++++ b/src/main/java/net/minecraft/server/NetworkManager.java +@@ -27,6 +27,8 @@ import org.apache.logging.log4j.Logger; + import org.apache.logging.log4j.Marker; + import org.apache.logging.log4j.MarkerManager; + ++import com.mineplex.spigot.PacketProcessor; ++ + public class NetworkManager extends SimpleChannelInboundHandler { + + private static final Logger g = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 5740e49..5edef3e 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -62,6 +62,8 @@ import org.bukkit.inventory.InventoryView; + import org.bukkit.util.NumberConversions; + // CraftBukkit end + ++import com.mineplex.spigot.PacketProcessor; ++ + public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerListBox { + + private static final Logger c = LogManager.getLogger(); +@@ -87,15 +89,20 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList + private boolean checkMovement = true; + private boolean processedDisconnect; // CraftBukkit - added + ++ public PacketProcessor PacketVerifier; ++ + public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { + this.minecraftServer = minecraftserver; + this.networkManager = networkmanager; +- networkmanager.a((PacketListener) this); + this.player = entityplayer; + entityplayer.playerConnection = this; + + // CraftBukkit start - add fields and methods + this.server = minecraftserver.server; ++ ++ ++ PacketVerifier = new PacketProcessor(this); ++ networkmanager.a(PacketVerifier); + } + + private final org.bukkit.craftbukkit.CraftServer server; +@@ -904,7 +911,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList + // CraftBukkit end + + try { +- this.networkManager.handle(packet); ++ PacketVerifier.processOutgoingPacket(packet, networkManager); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.a(throwable, "Sending packet"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Packet being sent"); +@@ -1408,9 +1415,12 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList + if (this.player.dead) return; // CraftBukkit + PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.u()); + +- CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit ++ if (packetplayinclosewindow.id == player.activeContainer.windowId) ++ { ++ CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit + +- this.player.p(); ++ this.player.p(); ++ } + } + + public void a(PacketPlayInWindowClick packetplayinwindowclick) { +-- +1.9.5.msysgit.0 + diff --git a/Patches/CraftBukkit-Patches/0163-Mineplex-Item-Inventory-Changes.patch b/Patches/CraftBukkit-Patches/0163-Inventory-changes.patch similarity index 97% rename from Patches/CraftBukkit-Patches/0163-Mineplex-Item-Inventory-Changes.patch rename to Patches/CraftBukkit-Patches/0163-Inventory-changes.patch index 73bbcc406..243699254 100644 --- a/Patches/CraftBukkit-Patches/0163-Mineplex-Item-Inventory-Changes.patch +++ b/Patches/CraftBukkit-Patches/0163-Inventory-changes.patch @@ -1,14 +1,14 @@ -From 1ef159639f4e89be93c2dc0235097a587c8c5f5d Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Tue, 21 Apr 2015 19:56:41 -0400 -Subject: [PATCH] Mineplex - Item/Inventory Changes +From 251376d9f0a36844f72d955fbc9334c34d8294a5 Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:50:19 +1300 +Subject: [PATCH] Inventory changes diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index a8028e3..5f62731 100644 +index e9a3c50..9fd6359 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -437,8 +437,8 @@ public class CraftInventory implements Inventory { +@@ -441,8 +441,8 @@ public class CraftInventory implements Inventory { return InventoryType.ENCHANTING; } else if (inventory instanceof TileEntityBrewingStand) { return InventoryType.BREWING; @@ -242,7 +242,7 @@ index 23f05f4..fdaf026 100644 return handle != null ? CraftMagicNumbers.getId(handle.getItem()) : 0; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/MinecraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/MinecraftInventory.java new file mode 100644 -index 0000000..d90d218 +index 0000000..f0d8f81 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/inventory/MinecraftInventory.java @@ -0,0 +1,177 @@ @@ -423,7 +423,6 @@ index 0000000..d90d218 + return new ChatComponentText(title); + } +} -\ No newline at end of file -- -2.3.5 +1.9.5.msysgit.0 diff --git a/Patches/CraftBukkit-Patches/0164-Mineplex-World-Changes.patch b/Patches/CraftBukkit-Patches/0164-Mineplex-World-Changes.patch deleted file mode 100644 index 9e4b71e9d..000000000 --- a/Patches/CraftBukkit-Patches/0164-Mineplex-World-Changes.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b09aac2ab0ed33d0b67b1bb0d4ab686bdcce0762 Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Tue, 21 Apr 2015 19:58:54 -0400 -Subject: [PATCH] Mineplex - World Changes - - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index db0697b..35b216b 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1114,9 +1114,9 @@ public class CraftWorld implements World { - ( (EntityOcelot) entity ).spawnBonus = false; - } - // Spigot end -- if (entity instanceof EntityInsentient) { -- ((EntityInsentient) entity).prepare(getHandle().E(new BlockPosition(entity)), (GroupDataEntity) null); -- } -+// if (entity instanceof EntityInsentient) { -+// ((EntityInsentient) entity).prepare(getHandle().E(new BlockPosition(entity)), (GroupDataEntity) null); -+// } - - world.addEntity(entity, reason); - return (T) entity.getBukkitEntity(); --- -2.3.5 - diff --git a/Patches/CraftBukkit-Patches/0161-Mineplex-Entity-Changes.patch b/Patches/CraftBukkit-Patches/0164-Modifications-to-entities.patch similarity index 83% rename from Patches/CraftBukkit-Patches/0161-Mineplex-Entity-Changes.patch rename to Patches/CraftBukkit-Patches/0164-Modifications-to-entities.patch index edd22aea6..8b71e52be 100644 --- a/Patches/CraftBukkit-Patches/0161-Mineplex-Entity-Changes.patch +++ b/Patches/CraftBukkit-Patches/0164-Modifications-to-entities.patch @@ -1,21 +1,20 @@ -From a253848782274cb79da16e13e8b5560fa2754a54 Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Tue, 21 Apr 2015 19:12:35 -0400 -Subject: [PATCH] Mineplex - Entity Changes +From 2cd75b80dd6039fb20279d0d17a5429323ec2c18 Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:56:35 +1300 +Subject: [PATCH] Modifications to entities diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index d6bef0b..c683d78 100644 +index e345dd7..ee19bd6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -124,6 +124,20 @@ public abstract class Entity implements ICommandListener { - public void inactiveTick() { } - // Spigot end +@@ -137,6 +137,31 @@ public abstract class Entity implements ICommandListener { + this.die(); + } -+ // Mineplex + private boolean _silent; + private boolean _invisible; -+ ++ + public boolean isSilent() + { + return _silent; @@ -26,10 +25,22 @@ index d6bef0b..c683d78 100644 + _silent = silent; + } + - public int getId() { - return this.id; - } -@@ -683,7 +697,9 @@ public abstract class Entity implements ICommandListener { ++ public boolean isMineplexInvisible() ++ { ++ return _invisible; ++ } ++ ++ public void setMineplexInvisible(boolean invisible) ++ { ++ _invisible = invisible; ++ ++ setInvisible(isMineplexInvisible() || isInvisible()); ++ } ++ + public Entity(World world) { + this.id = Entity.entityCount++; + this.j = 1.0D; +@@ -684,7 +709,9 @@ public abstract class Entity implements ICommandListener { this.makeSound(this.P(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); } @@ -40,32 +51,28 @@ index d6bef0b..c683d78 100644 block.a(this.world, blockposition, this); // CraftBukkit moved from above } } -@@ -785,7 +801,7 @@ public abstract class Entity implements ICommandListener { +@@ -786,7 +813,7 @@ public abstract class Entity implements ICommandListener { } public void makeSound(String s, float f, float f1) { - if (!this.R()) { -+ if (!isSilent() || !this.R()) { ++ if (!isSilent() && !this.R()) { this.world.makeSound(this, s, f, f1); } -@@ -1536,8 +1552,8 @@ public abstract class Entity implements ICommandListener { +@@ -1537,8 +1564,8 @@ public abstract class Entity implements ICommandListener { if (entity == null) { if (this.vehicle != null) { // CraftBukkit start - if ((this.bukkitEntity instanceof LivingEntity) && (this.vehicle.getBukkitEntity() instanceof Vehicle)) { - VehicleExitEvent event = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity); -+ if (this.bukkitEntity instanceof LivingEntity) { ++ if ((this.bukkitEntity instanceof LivingEntity)) { + VehicleExitEvent event = new VehicleExitEvent(this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity); pluginManager.callEvent(event); if (event.isCancelled() || vehicle != originalVehicle) { -@@ -1553,11 +1569,11 @@ public abstract class Entity implements ICommandListener { - this.vehicle = null; - } else { - // CraftBukkit start -- if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle) && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) { -+ if ((this.bukkitEntity instanceof LivingEntity) && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) { +@@ -1557,8 +1584,8 @@ public abstract class Entity implements ICommandListener { + if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle) && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) { // It's possible to move from one vehicle to another. We need to check if they're already in a vehicle, and fire an exit event if they are. VehicleExitEvent exitEvent = null; - if (this.vehicle != null && this.vehicle.getBukkitEntity() instanceof Vehicle) { @@ -75,30 +82,9 @@ index d6bef0b..c683d78 100644 pluginManager.callEvent(exitEvent); if (exitEvent.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) { -@@ -1679,9 +1695,20 @@ public abstract class Entity implements ICommandListener { - } - - public void setInvisible(boolean flag) { -+ if (isMineplexInvisible() && !flag) -+ return; -+ - this.b(5, flag); - } - -+ public boolean isMineplexInvisible() { -+ return _invisible; -+ } -+ -+ public void setMineplexInvisible(boolean flag) { -+ _invisible = flag; -+ } -+ - public void f(boolean flag) { - this.b(4, flag); - } diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java new file mode 100644 -index 0000000..bffd3dc +index 0000000..c078fa6 --- /dev/null +++ b/src/main/java/net/minecraft/server/EntityBat.java @@ -0,0 +1,206 @@ @@ -308,9 +294,10 @@ index 0000000..bffd3dc + return this.length / 2.0F; + } +} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java new file mode 100644 -index 0000000..53da5c2 +index 0000000..a759e00 --- /dev/null +++ b/src/main/java/net/minecraft/server/EntityBlaze.java @@ -0,0 +1,207 @@ @@ -336,9 +323,9 @@ index 0000000..53da5c2 + + protected void initAttributes() { + super.initAttributes(); -+ this.getAttributeInstance(GenericAttributes.e).setValue(6.0D); -+ this.getAttributeInstance(GenericAttributes.d).setValue(0.23000000417232513D); -+ this.getAttributeInstance(GenericAttributes.b).setValue(48.0D); ++ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6.0D); ++ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.23000000417232513D); ++ this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(48.0D); + } + + protected void h() { @@ -521,12 +508,13 @@ index 0000000..53da5c2 + } + } +} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 4bdcfc6..9539b66 100644 +index d246ae7..ed7f549 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -60,6 +60,18 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo - super.h(); +@@ -51,6 +51,18 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo + this.ah = true; } + public void setTargetBlock(int x, int y, int z) { @@ -534,16 +522,16 @@ index 4bdcfc6..9539b66 100644 + this.a = x; + this.b = y; + this.c = z; -+ this.bA = null; ++ this.target = null; + } + + public void setTargetEntity(Entity e) { -+ this.bA = e; ++ this.target = e; + } + - public double[] b(int i, float f) { - if (this.getHealth() <= 0.0F) { - f = 0.0F; + protected void initAttributes() { + super.initAttributes(); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(200.0D); @@ -170,7 +182,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.c += this.random.nextGaussian() * 2.0D; } @@ -563,7 +551,7 @@ index 4bdcfc6..9539b66 100644 this.a(this.world.getEntities(this, this.bt.getBoundingBox().grow(4.0D, 2.0D, 4.0D).c(0.0D, -2.0D, 0.0D))); this.b(this.world.getEntities(this, this.bn.getBoundingBox().grow(1.0D, 1.0D, 1.0D))); diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index ce91553..59ada33 100644 +index 7a42040..d3403a1 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -17,6 +17,8 @@ public class EntityFallingBlock extends Entity { @@ -575,32 +563,25 @@ index ce91553..59ada33 100644 public EntityFallingBlock(World world) { super(world); } -@@ -42,7 +44,7 @@ public class EntityFallingBlock extends Entity { +@@ -42,7 +44,15 @@ public class EntityFallingBlock extends Entity { protected void h() {} public boolean ad() { - return !this.dead; + return !this.dead && !spectating; - } - - public void t_() { -@@ -219,6 +221,14 @@ public class EntityFallingBlock extends Entity { - - } - ++ } ++ + @Override + public boolean damageEntity(DamageSource damagesource, float f) + { + CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f); + + return true; -+ } -+ - public void a(boolean flag) { - this.hurtEntities = flag; } + + public void t_() { diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index 688099f..404dda2 100644 +index f131419..f293118 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java @@ -125,6 +125,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { @@ -614,7 +595,7 @@ index 688099f..404dda2 100644 this.datawatcher.watch(16, Integer.valueOf(j | i)); } else { diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d73395a..7a9eacb 100644 +index eb54e7f..66c3d0c 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -133,7 +133,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -627,63 +608,25 @@ index d73395a..7a9eacb 100644 this.b(itemstack, 5); } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 9621ce0..463d578 100644 +index a8a327d..b7647bc 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -35,6 +35,10 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -34,6 +34,10 @@ public abstract class EntityInsentient extends EntityLiving { private Entity bp; private NBTTagCompound bq; + private boolean _vegetated; -+ private boolean _shouldBreakLeash; -+ private boolean _pullWhileLeashed; ++ private boolean _shouldBreakLeash = true; ++ private boolean _pullWhileLeashed = true; + public EntityInsentient(World world) { super(world); this.goalSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null); -@@ -53,6 +57,11 @@ public abstract class EntityInsentient extends EntityLiving { - // CraftBukkit start - default persistance to type's persistance value +@@ -53,6 +57,32 @@ public abstract class EntityInsentient extends EntityLiving { this.persistent = !isTypeNotPersistent(); // CraftBukkit end -+ -+ // Mineplex -+ _vegetated = false; -+ _shouldBreakLeash = true; -+ _pullWhileLeashed = true; } - - protected void initAttributes() { -@@ -149,7 +158,7 @@ public abstract class EntityInsentient extends EntityLiving { - public void K() { - super.K(); - this.world.methodProfiler.a("mobBaseTick"); -- if (this.isAlive() && this.random.nextInt(1000) < this.a_++) { -+ if (this.isAlive() && !isSilent() && this.random.nextInt(1000) < this.a_++) { - this.a_ = -this.w(); - this.x(); - } -@@ -771,7 +780,7 @@ public abstract class EntityInsentient extends EntityLiving { - } - - public final boolean e(EntityHuman entityhuman) { -- if (this.cc() && this.getLeashHolder() == entityhuman) { -+ if (this.cc() && this.getLeashHolder() == entityhuman && _shouldBreakLeash) { - // CraftBukkit start - fire PlayerUnleashEntityEvent - if (CraftEventFactory.callPlayerUnleashEntityEvent(this, entityhuman).isCancelled()) { - ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder())); -@@ -836,7 +845,7 @@ public abstract class EntityInsentient extends EntityLiving { - } - - public void unleash(boolean flag, boolean flag1) { -- if (this.bo) { -+ if (this.bo && _shouldBreakLeash) { - this.bo = false; - this.bp = null; - if (!this.world.isClientSide && flag1) { -@@ -936,6 +945,32 @@ public abstract class EntityInsentient extends EntityLiving { - return this.datawatcher.getByte(15) != 0; - } - ++ + public void setVegetated(boolean flag) { + _vegetated = flag; + } @@ -709,24 +652,60 @@ index 9621ce0..463d578 100644 + public boolean shouldPullWhileLeashed() { + return _pullWhileLeashed; + } -+ - public static enum EnumEntityPositionType { - ON_GROUND, IN_AIR, IN_WATER; + protected void initAttributes() { + super.initAttributes(); +@@ -148,7 +178,7 @@ public abstract class EntityInsentient extends EntityLiving { + public void K() { + super.K(); + this.world.methodProfiler.a("mobBaseTick"); +- if (this.isAlive() && this.random.nextInt(1000) < this.a_++) { ++ if (!isSilent() && this.isAlive() && this.random.nextInt(1000) < this.a_++) { + this.a_ = -this.w(); + this.x(); + } +@@ -770,7 +800,7 @@ public abstract class EntityInsentient extends EntityLiving { + } + + public final boolean e(EntityHuman entityhuman) { +- if (this.cc() && this.getLeashHolder() == entityhuman) { ++ if (this.cc() && this.getLeashHolder() == entityhuman && _shouldBreakLeash) { + // CraftBukkit start - fire PlayerUnleashEntityEvent + if (CraftEventFactory.callPlayerUnleashEntityEvent(this, entityhuman).isCancelled()) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder())); +@@ -835,7 +865,7 @@ public abstract class EntityInsentient extends EntityLiving { + } + + public void unleash(boolean flag, boolean flag1) { +- if (this.bo) { ++ if (this.bo && _shouldBreakLeash) { + this.bo = false; + this.bp = null; + if (!this.world.isClientSide && flag1) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 99b120a..12d735d 100644 +index 3c852fd..b861dbe 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -97,6 +97,8 @@ public abstract class EntityLiving extends Entity { - } - // Spigot end - -+ private boolean _ghost; -+ - public void G() { +@@ -101,6 +101,18 @@ public abstract class EntityLiving extends Entity { this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE); } -@@ -1782,7 +1784,7 @@ public abstract class EntityLiving extends Entity { + ++ private boolean _ghost; ++ ++ public boolean isGhost() ++ { ++ return _ghost; ++ } ++ ++ public void setGhost(boolean ghost) ++ { ++ _ghost = ghost; ++ } ++ + public EntityLiving(World world) { + super(world); + this.initAttributes(); +@@ -1783,7 +1795,7 @@ public abstract class EntityLiving extends Entity { } public boolean ad() { @@ -735,30 +714,16 @@ index 99b120a..12d735d 100644 } public boolean ae() { -@@ -1836,4 +1838,12 @@ public abstract class EntityLiving extends Entity { - protected void bP() { - this.updateEffects = true; - } -+ -+ public boolean isGhost() { -+ return _ghost; -+ } -+ -+ public void setGhost(boolean ghost) { -+ _ghost = ghost; -+ } - } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3854edf..c52d591 100644 +index 3810f86..44ac587 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -65,10 +65,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -65,10 +65,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // Spigot start public boolean collidesWithEntities = true; -+ // Mineplex + public boolean spectating; -+ ++ @Override public boolean ad() { @@ -768,20 +733,19 @@ index 3854edf..c52d591 100644 @Override diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 2d22327..3aa9467 100644 +index 2d22327..83e71c1 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -@@ -9,6 +9,9 @@ public class EntityTNTPrimed extends Entity { +@@ -9,6 +9,8 @@ public class EntityTNTPrimed extends Entity { public float yield = 4; // CraftBukkit - add field public boolean isIncendiary = false; // CraftBukkit - add field -+ // Mineplex + public boolean spectating; + public EntityTNTPrimed(World world) { super(world); this.k = true; -@@ -37,7 +40,7 @@ public class EntityTNTPrimed extends Entity { +@@ -37,7 +39,7 @@ public class EntityTNTPrimed extends Entity { } public boolean ad() { @@ -790,77 +754,103 @@ index 2d22327..3aa9467 100644 } public void t_() { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 49c7fa6..0cd36e8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -836,7 +836,7 @@ public class CraftWorld implements World { + + public void playEffect(Location loc, Effect effect, T data, int radius) { + if (data != null) { +- Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!"); ++ Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!"); + } else { + Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); + } +@@ -1122,10 +1122,6 @@ public class CraftWorld implements World { + public T addEntity(net.minecraft.server.Entity entity, SpawnReason reason) throws IllegalArgumentException { + Preconditions.checkArgument(entity != null, "Cannot spawn null entity"); + +- if (entity instanceof EntityInsentient) { +- ((EntityInsentient) entity).prepare(getHandle().E(new BlockPosition(entity)), (GroupDataEntity) null); +- } +- + world.addEntity(entity, reason); + return (T) entity.getBukkitEntity(); + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 5317cff..3ab939f 100644 +index 5317cff..60e8584 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -461,6 +461,54 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { - return true; +@@ -74,6 +74,46 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + } } -+ @Override + public boolean shouldBreakLeash() + { + return ((EntityInsentient) getHandle()).shouldBreakLeash(); + } + -+ @Override + public void setShouldBreakLeash(boolean shouldBreakLeash) + { + ((EntityInsentient) getHandle()).setShouldBreakLeash(shouldBreakLeash); + } + -+ @Override + public boolean shouldPullWhileLeashed() + { + return ((EntityInsentient) getHandle()).shouldPullWhileLeashed(); + } + -+ @Override + public void setPullWhileLeashed(boolean pullWhileLeashed) + { + ((EntityInsentient) getHandle()).setPullWhileLeashed(pullWhileLeashed); + } + -+ @Override + public boolean isVegetated() + { + return ((EntityInsentient) getHandle()).isVegetated(); + } + -+ @Override + public void setVegetated(boolean vegetated) + { + ((EntityInsentient) getHandle()).setVegetated(vegetated); + } + -+ @Override + public boolean isGhost() + { + return getHandle().isGhost(); + } + -+ @Override + public void setGhost(boolean ghost) + { + getHandle().setGhost(ghost); + } + - @Deprecated - public int _INVALID_getLastDamage() { - return NumberConversions.ceil(getLastDamage()); + public double getHealth() { + return Math.min(Math.max(0, getHandle().getHealth()), getMaxHealth()); + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 06e014c..0adc2a9 100644 +index 29082aa..2d508b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -874,10 +874,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -325,7 +325,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + @Override + public void playEffect(Location loc, Effect effect, T data) { + if (data != null) { +- Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!"); ++ Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!"); + } else { + Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); + } +@@ -870,10 +870,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void hidePlayer(Player player) { + hidePlayer(player, false, true); + } + -+ public void hidePlayer(Player player, boolean override, boolean hideList) { ++ public void hidePlayer(Player player, boolean override, boolean hideList) ++ { Validate.notNull(player, "hidden player cannot be null"); if (getHandle().playerConnection == null) return; if (equals(player)) return; @@ -869,7 +859,7 @@ index 06e014c..0adc2a9 100644 hiddenPlayers.add(player.getUniqueId()); //remove this player from the hidden player's EntityTrackerEntry -@@ -889,7 +893,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -885,7 +890,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } //remove the hidden player from this player user list @@ -879,23 +869,22 @@ index 06e014c..0adc2a9 100644 } @Override -@@ -1336,13 +1341,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1363,13 +1369,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public boolean getCollidesWithEntities() { - return getHandle().collidesWithEntities; + return !getHandle().spectating; -+// return getHandle().collidesWithEntities; } @Override public void setCollidesWithEntities(boolean collides) { - getHandle().collidesWithEntities = collides; -+ getHandle().spectating = !collides; ++ getHandle().spectating = collides; getHandle().k = collides; // First boolean of Entity } -- -2.3.5 +1.9.5.msysgit.0 diff --git a/Patches/CraftBukkit-Patches/0158-Mineplex-Chunk-Changes.patch b/Patches/CraftBukkit-Patches/0165-Add-Mineplex-chunk-events-misc-modifications.patch similarity index 70% rename from Patches/CraftBukkit-Patches/0158-Mineplex-Chunk-Changes.patch rename to Patches/CraftBukkit-Patches/0165-Add-Mineplex-chunk-events-misc-modifications.patch index a4b24f156..65420376c 100644 --- a/Patches/CraftBukkit-Patches/0158-Mineplex-Chunk-Changes.patch +++ b/Patches/CraftBukkit-Patches/0165-Add-Mineplex-chunk-events-misc-modifications.patch @@ -1,7 +1,7 @@ -From a5eac8e0980212f40add58f975a652313d6a1a3d Mon Sep 17 00:00:00 2001 -From: Shaun Bennett -Date: Sun, 19 Apr 2015 01:54:13 -0400 -Subject: [PATCH] Mineplex - Chunk Changes +From 2cb042088947c79ccde8d49ad957a861120ba57d Mon Sep 17 00:00:00 2001 +From: libraryaddict +Date: Wed, 21 Oct 2015 04:57:46 +1300 +Subject: [PATCH] Add Mineplex chunk events, misc modifications. diff --git a/src/main/java/com/mineplex/spigot/ChunkAddEntityEvent.java b/src/main/java/com/mineplex/spigot/ChunkAddEntityEvent.java @@ -43,7 +43,7 @@ index 0000000..3f16935 +} diff --git a/src/main/java/com/mineplex/spigot/ChunkPreLoadEvent.java b/src/main/java/com/mineplex/spigot/ChunkPreLoadEvent.java new file mode 100644 -index 0000000..21d75c7 +index 0000000..564efe6 --- /dev/null +++ b/src/main/java/com/mineplex/spigot/ChunkPreLoadEvent.java @@ -0,0 +1,60 @@ @@ -99,7 +99,7 @@ index 0000000..21d75c7 + @Override + public HandlerList getHandlers() + { -+ return null; ++ return handlers; + } + + public static HandlerList getHandlerList() @@ -108,7 +108,7 @@ index 0000000..21d75c7 + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d5922fe..0a0e778 100644 +index 022ba31..464d0c2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -11,6 +11,8 @@ import java.util.Map; @@ -142,7 +142,7 @@ index d5922fe..0a0e778 100644 this.done = flag; } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 74710f9..b0d132f 100644 +index 975d666..a55bd6c 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -8,6 +8,8 @@ import java.util.Iterator; @@ -230,6 +230,54 @@ index 74710f9..b0d132f 100644 if (server != null) { /* * If it's a new world, the first few chunks are generated inside +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index c30867d..b86369b 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -132,7 +132,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + System.err.println( "If you do not agree to the above EULA please stop your server and remove this flag immediately." ); + } + // Spigot End +- if (!this.p.a() && !eulaAgreed) { // Spigot ++ if (false && !this.p.a() && !eulaAgreed) { // Spigot + DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); + this.p.b(); + return false; +diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java +index 4f280dd..73a288c 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java ++++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java +@@ -59,7 +59,7 @@ public class TileEntityBeacon extends TileEntityContainer implements IUpdatePlay + this.A(); + } + +- private void A() { ++ public void A() { + if (this.i && this.j > 0 && !this.world.isClientSide && this.k > 0) { + double d0 = (double) (this.j * 10 + 10); + byte b0 = 0; +@@ -94,7 +94,7 @@ public class TileEntityBeacon extends TileEntityContainer implements IUpdatePlay + + } + +- private void B() { ++ public void B() { + int i = this.j; + int j = this.position.getX(); + int k = this.position.getY(); +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 2759425..f57c785 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -412,7 +412,7 @@ public final class CraftServer implements Server { + int delta = Integer.MAX_VALUE; + for (Player player : getOnlinePlayers()) { + if (player.getName().toLowerCase().startsWith(lowerName)) { +- int curDelta = Math.abs(player.getName().length() - lowerName.length()); ++ int curDelta = player.getName().length() - lowerName.length(); + if (curDelta < delta) { + found = player; + delta = curDelta; -- -2.3.5 +1.9.5.msysgit.0 diff --git a/Plugins/Libraries/craftbukkit.jar b/Plugins/Libraries/craftbukkit.jar index fae772754..45d0e271c 100644 Binary files a/Plugins/Libraries/craftbukkit.jar and b/Plugins/Libraries/craftbukkit.jar differ