geforkt von Mirrors/Paper
Update from upstream SpigotMC
3e3ea0bd0d8 320ed92779f 612de468951
Dieser Commit ist enthalten in:
Ursprung
6e2bd0745f
Commit
de978d5161
83
Bukkit-Patches/0031-BungeeCord-Chat-API.patch
Normale Datei
83
Bukkit-Patches/0031-BungeeCord-Chat-API.patch
Normale Datei
@ -0,0 +1,83 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: md_5 <git@md-5.net>
|
||||||
|
Date: Sat, 13 Dec 2014 12:59:14 +1100
|
||||||
|
Subject: [PATCH] BungeeCord Chat API
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/pom.xml b/pom.xml
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/pom.xml
|
||||||
|
+++ b/pom.xml
|
||||||
|
@@ -0,0 +0,0 @@
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
|
+ <dependency>
|
||||||
|
+ <groupId>net.md-5</groupId>
|
||||||
|
+ <artifactId>bungeecord-chat</artifactId>
|
||||||
|
+ <version>1.8-SNAPSHOT</version>
|
||||||
|
+ <type>jar</type>
|
||||||
|
+ <scope>compile</scope>
|
||||||
|
+ </dependency>
|
||||||
|
|
||||||
|
<!-- testing -->
|
||||||
|
<dependency>
|
||||||
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
|
||||||
|
{
|
||||||
|
throw new UnsupportedOperationException( "Not supported yet." );
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Sends the component to the player
|
||||||
|
+ *
|
||||||
|
+ * @param component the components to send
|
||||||
|
+ */
|
||||||
|
+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent component) {
|
||||||
|
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Sends an array of components as a single message to the player
|
||||||
|
+ *
|
||||||
|
+ * @param components the components to send
|
||||||
|
+ */
|
||||||
|
+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||||
|
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
Spigot spigot();
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||||
|
{
|
||||||
|
throw new UnsupportedOperationException( "Not supported yet." );
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Sends the component to the player
|
||||||
|
+ *
|
||||||
|
+ * @param component the components to send
|
||||||
|
+ */
|
||||||
|
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) {
|
||||||
|
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Sends an array of components as a single message to the player
|
||||||
|
+ *
|
||||||
|
+ * @param components the components to send
|
||||||
|
+ */
|
||||||
|
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||||
|
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
Spigot spigot();
|
||||||
|
--
|
@ -1,34 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thinkofdeath <thethinkofdeath@gmail.com>
|
|
||||||
Date: Sat, 18 Jan 2014 14:27:03 +0000
|
|
||||||
Subject: [PATCH] Support vanilla's direction tag on fireballs
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/EntityFireball.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityFireball.java
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class EntityFireball extends Entity {
|
|
||||||
nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
|
|
||||||
// CraftBukkit - Fix direction being mismapped to invalid variables
|
|
||||||
nbttagcompound.set("power", this.a(new double[] { this.dirX, this.dirY, this.dirZ}));
|
|
||||||
+ // Spigot - Support vanilla's direction tag
|
|
||||||
+ nbttagcompound.set("direction", this.a(new double[] { this.motX, this.motY, this.motZ}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class EntityFireball extends Entity {
|
|
||||||
this.dirY = nbttaglist.d(1);
|
|
||||||
this.dirZ = nbttaglist.d(2);
|
|
||||||
// CraftBukkit end
|
|
||||||
+ } else if (nbttagcompound.hasKeyOfType("direction", 9)) { // Spigot - Support vanilla's direction tag
|
|
||||||
+ NBTTagList nbttaglist = nbttagcompound.getList("direction", 6);
|
|
||||||
+
|
|
||||||
+ this.motX = nbttaglist.d(0);
|
|
||||||
+ this.motY = nbttaglist.d(1);
|
|
||||||
+ this.motZ = nbttaglist.d(2);
|
|
||||||
+
|
|
||||||
} else {
|
|
||||||
this.die();
|
|
||||||
}
|
|
||||||
--
|
|
@ -1,39 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thinkofdeath <thethinkofdeath@gmail.com>
|
|
||||||
Date: Sat, 18 Jan 2014 19:32:42 +0000
|
|
||||||
Subject: [PATCH] Support non-prefixed URLs
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
|
||||||
@@ -0,0 +0,0 @@ import com.google.common.collect.ImmutableMap.Builder;
|
|
||||||
public final class CraftChatMessage {
|
|
||||||
private static class StringMessage {
|
|
||||||
private static final Map<Character, EnumChatFormat> formatMap;
|
|
||||||
- private static final Pattern INCREMENTAL_PATTERN = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-or])|(\\n)|(?:(https?://[^ ][^ ]*?)(?=[\\.\\?!,;:]?(?:[ \\n]|$)))", Pattern.CASE_INSENSITIVE);
|
|
||||||
+ private static final Pattern INCREMENTAL_PATTERN = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-or])|(\\n)|((?:(?:https?)://)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " \\n]|$))))", Pattern.CASE_INSENSITIVE);
|
|
||||||
|
|
||||||
static {
|
|
||||||
Builder<Character, EnumChatFormat> builder = ImmutableMap.builder();
|
|
||||||
@@ -0,0 +0,0 @@ public final class CraftChatMessage {
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
+ if ( !( match.startsWith( "http://" ) || match.startsWith( "https://" ) ) ) {
|
|
||||||
+ match = "http://" + match;
|
|
||||||
+ }
|
|
||||||
modifier.setChatClickable(new ChatClickable(EnumClickAction.OPEN_URL, match));
|
|
||||||
appendNewComponent(matcher.end(groupId));
|
|
||||||
modifier.setChatClickable((ChatClickable) null);
|
|
||||||
@@ -0,0 +0,0 @@ public final class CraftChatMessage {
|
|
||||||
appendNewComponent(message.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
- output = list.toArray(new IChatBaseComponent[0]);
|
|
||||||
+ output = list.toArray(new IChatBaseComponent[list.size()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendNewComponent(int index) {
|
|
||||||
--
|
|
@ -15,6 +15,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
<Appenders>
|
<Appenders>
|
||||||
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
|
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
|
||||||
<Queue name="TerminalConsole">
|
<Queue name="TerminalConsole">
|
||||||
--
|
--
|
||||||
1.9.4.msysgit.2
|
|
||||||
|
|
@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.lastY = this.locY;
|
this.lastY = this.locY;
|
||||||
this.lastZ = this.locZ;
|
this.lastZ = this.locZ;
|
||||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..00000000000000000000000000000000000000004 100644
|
||||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
126
CraftBukkit-Patches/0158-BungeeCord-Chat-API.patch
Normale Datei
126
CraftBukkit-Patches/0158-BungeeCord-Chat-API.patch
Normale Datei
@ -0,0 +1,126 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: md_5 <git@md-5.net>
|
||||||
|
Date: Sat, 13 Dec 2014 13:06:05 +1100
|
||||||
|
Subject: [PATCH] BungeeCord Chat API
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
||||||
|
@@ -0,0 +0,0 @@
|
||||||
|
+package net.minecraft.server;
|
||||||
|
+
|
||||||
|
+public class PacketPlayOutChat implements Packet {
|
||||||
|
+
|
||||||
|
+ private IChatBaseComponent a;
|
||||||
|
+ public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
|
||||||
|
+ private byte b;
|
||||||
|
+
|
||||||
|
+ public PacketPlayOutChat() {}
|
||||||
|
+
|
||||||
|
+ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent) {
|
||||||
|
+ this(ichatbasecomponent, (byte) 1);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, byte b0) {
|
||||||
|
+ this.a = ichatbasecomponent;
|
||||||
|
+ this.b = b0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void a(PacketDataSerializer packetdataserializer) {
|
||||||
|
+ this.a = packetdataserializer.d();
|
||||||
|
+ this.b = packetdataserializer.readByte();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void b(PacketDataSerializer packetdataserializer) {
|
||||||
|
+ // Spigot start
|
||||||
|
+ if (components != null) {
|
||||||
|
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components));
|
||||||
|
+ } else {
|
||||||
|
+ packetdataserializer.a(this.a);
|
||||||
|
+ }
|
||||||
|
+ // Spigot end
|
||||||
|
+ packetdataserializer.writeByte(this.b);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void a(PacketListenerPlayOut packetlistenerplayout) {
|
||||||
|
+ packetlistenerplayout.a(this);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public boolean b() {
|
||||||
|
+ return this.b == 1 || this.b == 2;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void a(PacketListener packetlistener) {
|
||||||
|
+ this.a((PacketListenerPlayOut) packetlistener);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
@@ -0,0 +0,0 @@ import io.netty.buffer.ByteBufOutputStream;
|
||||||
|
import io.netty.buffer.Unpooled;
|
||||||
|
import io.netty.handler.codec.base64.Base64;
|
||||||
|
import jline.console.ConsoleReader;
|
||||||
|
+import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
|
||||||
|
public final class CraftServer implements Server {
|
||||||
|
private static final Player[] EMPTY_PLAYER_ARRAY = new Player[0];
|
||||||
|
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||||
|
{
|
||||||
|
return org.spigotmc.SpigotConfig.config;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void broadcast(BaseComponent component) {
|
||||||
|
+ for (Player player : getOnlinePlayers()) {
|
||||||
|
+ player.spigot().sendMessage(component);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void broadcast(BaseComponent... components) {
|
||||||
|
+ for (Player player : getOnlinePlayers()) {
|
||||||
|
+ player.spigot().sendMessage(components);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
};
|
||||||
|
|
||||||
|
public Spigot spigot()
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 @@ import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
+import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
|
||||||
|
import net.minecraft.server.*;
|
||||||
|
|
||||||
|
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
|
||||||
|
return java.util.Collections.unmodifiableSet( ret );
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(BaseComponent component) {
|
||||||
|
+ sendMessage( new BaseComponent[] { component } );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void sendMessage(BaseComponent... components) {
|
||||||
|
+ if ( getHandle().playerConnection == null ) return;
|
||||||
|
+
|
||||||
|
+ PacketPlayOutChat packet = new PacketPlayOutChat();
|
||||||
|
+ packet.components = components;
|
||||||
|
+ getHandle().playerConnection.sendPacket(packet);
|
||||||
|
+ }
|
||||||
|
};
|
||||||
|
|
||||||
|
public Player.Spigot spigot()
|
||||||
|
--
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren