2013-06-02 05:15:15 +00:00
|
|
|
From 890ebddcce4bf2ca1660e415c05485797feb80ef Mon Sep 17 00:00:00 2001
|
2013-03-23 02:05:01 +00:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Sat, 23 Mar 2013 13:04:45 +1100
|
|
|
|
Subject: [PATCH] Texture Pack Resolutions
|
|
|
|
|
|
|
|
Fix issues when specifiying a server texture pack URL with resolution != 16.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2013-06-02 05:15:15 +00:00
|
|
|
index d197f06..e348ac5 100644
|
2013-03-23 02:05:01 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2013-04-30 22:33:27 +00:00
|
|
|
@@ -1076,7 +1076,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
2013-03-23 02:05:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int S() {
|
|
|
|
- return 16;
|
|
|
|
+ return org.bukkit.craftbukkit.Spigot.textureResolution; // Spigot
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract boolean T();
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
|
2013-06-02 05:15:15 +00:00
|
|
|
index 861cfd9..9ac137a 100644
|
2013-03-23 02:05:01 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
|
2013-04-24 23:01:05 +00:00
|
|
|
@@ -55,6 +55,7 @@ public class Spigot {
|
2013-03-23 02:05:01 +00:00
|
|
|
public static boolean tabPing = false;
|
|
|
|
private static Metrics metrics;
|
|
|
|
public static List<String> bungeeIPs;
|
|
|
|
+ public static int textureResolution = 16;
|
|
|
|
|
|
|
|
public static void initialize(CraftServer server, SimpleCommandMap commandMap, YamlConfiguration configuration) {
|
|
|
|
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
|
2013-05-16 08:10:23 +00:00
|
|
|
@@ -92,6 +93,7 @@ public class Spigot {
|
2013-03-23 02:05:01 +00:00
|
|
|
|
|
|
|
tabPing = configuration.getBoolean("settings.tab-ping", tabPing);
|
|
|
|
bungeeIPs = configuration.getStringList("settings.bungee-proxies");
|
|
|
|
+ textureResolution = configuration.getInt("settings.texture-resolution", textureResolution);
|
|
|
|
|
|
|
|
if (metrics == null) {
|
|
|
|
try {
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2013-06-02 05:15:15 +00:00
|
|
|
index 26cb661..382fc41 100644
|
2013-03-23 02:05:01 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2013-04-10 02:36:11 +00:00
|
|
|
@@ -830,7 +830,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2013-03-23 02:05:01 +00:00
|
|
|
public void setTexturePack(String url) {
|
|
|
|
Validate.notNull(url, "Texture pack URL cannot be null");
|
|
|
|
|
|
|
|
- byte[] message = (url + "\0" + "16").getBytes();
|
|
|
|
+ byte[] message = (url + "\0" + org.bukkit.craftbukkit.Spigot.textureResolution).getBytes(); // Spigot
|
|
|
|
Validate.isTrue(message.length <= Messenger.MAX_MESSAGE_SIZE, "Texture pack URL is too long");
|
|
|
|
|
|
|
|
getHandle().playerConnection.sendPacket(new Packet250CustomPayload("MC|TPack", message));
|
|
|
|
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
|
2013-05-16 08:10:23 +00:00
|
|
|
index f0d9129..cdf66e1 100644
|
2013-03-23 02:05:01 +00:00
|
|
|
--- a/src/main/resources/configurations/bukkit.yml
|
|
|
|
+++ b/src/main/resources/configurations/bukkit.yml
|
2013-04-23 01:50:42 +00:00
|
|
|
@@ -39,6 +39,7 @@ settings:
|
2013-03-23 02:05:01 +00:00
|
|
|
restart-script-location: /path/to/server/start.sh
|
|
|
|
bungee-proxies:
|
|
|
|
- 127.0.0.1
|
|
|
|
+ texture-resolution: 16
|
|
|
|
world-settings:
|
|
|
|
default:
|
|
|
|
growth-chunks-per-tick: 650
|
|
|
|
--
|
2013-06-02 05:15:15 +00:00
|
|
|
1.8.1.2
|
2013-03-23 02:05:01 +00:00
|
|
|
|