3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 13:00:06 +01:00
Dieser Commit ist enthalten in:
md_5 2013-12-01 16:17:16 +11:00
Ursprung 341ec013fe
Commit 6ba479d591
5 geänderte Dateien mit 28 neuen und 24 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 19204e7a95da55b334559e9abeaa24e8ef728c44 Mon Sep 17 00:00:00 2001
From b0bb7a61bc7b6e5dbb344ace753e81bf010e0363 Mon Sep 17 00:00:00 2001
From: Alex Ciuba <alexciuba@gmail.com>
Date: Tue, 11 Jun 2013 15:23:03 -0400
Subject: [PATCH] Prevent Ghost Players Caused by Plugins
@ -6,16 +6,18 @@ Subject: [PATCH] Prevent Ghost Players Caused by Plugins
Check if the player is still connected after firing event. Fixes BUKKIT-4327
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index b10b9a7..c8186e6 100644
index b10b9a7..6527db0 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -467,6 +467,9 @@ public abstract class PlayerList {
@@ -467,6 +467,11 @@ public abstract class PlayerList {
Player respawnPlayer = this.cserver.getPlayer(entityplayer1);
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn);
this.cserver.getPluginManager().callEvent(respawnEvent);
+ if (entityplayer.playerConnection.disconnected) {
+ // Spigot Start
+ if (entityplayer.playerConnection.isDisconnected()) {
+ return entityplayer;
+ }
+ // Spigot End
location = respawnEvent.getRespawnLocation();
entityplayer.reset();

Datei anzeigen

@ -1,4 +1,4 @@
From 7c62ad80df53048515179a7866b5918f8cd3f519 Mon Sep 17 00:00:00 2001
From d91a8eb52fb822cea177f0ad19670574f2858c64 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:27:07 +1000
Subject: [PATCH] Player Collision API
@ -31,7 +31,7 @@ index a61001d..35d30f1 100644
Entity entity = (Entity) list.get(i);
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index af08d2f..d6a384b 100644
index af08d2f..12e90cc 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -64,6 +64,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -42,22 +42,22 @@ index af08d2f..d6a384b 100644
+ public boolean collidesWithEntities = true;
+
+ @Override
+ public boolean L()
+ public boolean S()
+ {
+ return this.collidesWithEntities && super.L();
+ return this.collidesWithEntities && super.S();
+ }
+
+ @Override
+ /*@Override
+ public boolean M()
+ {
+ return this.collidesWithEntities && super.M();
+ }
+ }*/ // SPIGOT TODO
+ // Spigot end
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
super(worldserver, gameprofile);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0b8b324..fb53781 100644
index 0b8b324..67e7747 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1130,6 +1130,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -75,7 +75,7 @@ index 0b8b324..fb53781 100644
+ public void setCollidesWithEntities(boolean collides)
+ {
+ getHandle().collidesWithEntities = collides;
+ getHandle().m = collides; // First boolean of Entity
+ getHandle().l = collides; // First boolean of Entity
+ }
};

Datei anzeigen

@ -1,4 +1,4 @@
From d50e13b301a56c8cc19761f7265d571a37dceb19 Mon Sep 17 00:00:00 2001
From bd4223f37b76956cc070d5d7183e6ada4c561571 Mon Sep 17 00:00:00 2001
From: BlackHole <black-hole@live.com>
Date: Tue, 16 Jul 2013 22:34:50 +0200
Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT
@ -6,7 +6,7 @@ Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT
Adds BUKKIT-4355
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
index 6d5090b..819bef9 100644
index 6d5090b..50e2fa0 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -54,7 +54,7 @@ public class BlockTNT extends Block {
@ -23,7 +23,7 @@ index 6d5090b..819bef9 100644
if (entityarrow.isBurning()) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, i, j, k, 0, 0).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, i, j, k, Blocks.AIR, 0).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end

Datei anzeigen

@ -1,16 +1,16 @@
From 9ec229ca5ae594d9aef1a8df8bb350c133a18f42 Mon Sep 17 00:00:00 2001
From 5fc844c7ebaa9fd7debd05f70365c01ba3e8c976 Mon Sep 17 00:00:00 2001
From: ninja- <xninja@openmailbox.org>
Date: Tue, 8 Oct 2013 14:34:49 +0200
Subject: [PATCH] Implement respawn API.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index bcfda5b..7fecef9 100644
index 07f7c2e..f870cc6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1143,6 +1143,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().collidesWithEntities = collides;
getHandle().m = collides; // First boolean of Entity
getHandle().l = collides; // First boolean of Entity
}
+
+ @Override

Datei anzeigen

@ -1,4 +1,4 @@
From 1065d7a11aacc532a428121fc5002c730efc6f4d Mon Sep 17 00:00:00 2001
From 5274d4541b5da2b6007256ad45181b01811bd1ff Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 12:33:20 +1100
Subject: [PATCH] Watchdog Thread.
@ -26,19 +26,21 @@ index 2ab8366..831707c 100644
} catch (Throwable throwable1) {
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java
new file mode 100644
index 0000000..3ca7a46
index 0000000..a8840c9
--- /dev/null
+++ b/src/main/java/org/spigotmc/RestartCommand.java
@@ -0,0 +1,111 @@
@@ -0,0 +1,113 @@
+package org.spigotmc;
+
+import java.io.File;
+import java.util.List;
+import net.minecraft.server.EntityPlayer;
+import net.minecraft.server.IChatBaseComponent;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.Packet255KickDisconnect;
+import net.minecraft.server.PacketPlayOutKickDisconnect;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.craftbukkit.util.CraftChatMessage;
+
+public class RestartCommand extends Command
+{
@ -73,7 +75,7 @@ index 0000000..3ca7a46
+ // Kick all players
+ for ( EntityPlayer p : (List< EntityPlayer>) MinecraftServer.getServer().getPlayerList().players )
+ {
+ p.playerConnection.networkManager.queue( new Packet255KickDisconnect( SpigotConfig.restartMessage ) );
+ p.playerConnection.disconnect(SpigotConfig.restartMessage);
+ p.playerConnection.networkManager.d();
+ }
+ // Give the socket a chance to send the packets
@ -84,7 +86,7 @@ index 0000000..3ca7a46
+ {
+ }
+ // Close the socket so we can rebind with the new process
+ MinecraftServer.getServer().ag().a();
+ MinecraftServer.getServer().ag().b();
+
+ // Give time for it to kick in
+ try