2013-04-03 07:20:29 +00:00
|
|
|
From c9c8a4745f0652ba8cd5e0f89e6ee90677036845 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.
|
|
|
|
---
|
2013-04-03 07:20:29 +00:00
|
|
|
.../java/net/minecraft/server/MinecraftServer.java | 2 +-
|
|
|
|
src/main/java/org/bukkit/craftbukkit/Spigot.java | 2 ++
|
|
|
|
.../org/bukkit/craftbukkit/entity/CraftPlayer.java | 2 +-
|
|
|
|
src/main/resources/configurations/bukkit.yml | 1 +
|
2013-03-23 02:05:01 +00:00
|
|
|
4 files changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2013-03-25 07:57:00 +00:00
|
|
|
index 168394f..3b2d9d3 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-03-25 07:57:00 +00:00
|
|
|
@@ -1073,7 +1073,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-04-03 07:20:29 +00:00
|
|
|
index 49092c7..121b5ba 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
|
|
|
|
@@ -24,6 +24,7 @@ public class Spigot {
|
|
|
|
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"));
|
|
|
|
@@ -62,6 +63,7 @@ public class Spigot {
|
|
|
|
|
|
|
|
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-03-25 07:57:00 +00:00
|
|
|
index 8eb93c0..f9a7645 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-03-23 07:05:22 +00:00
|
|
|
@@ -828,7 +828,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-03-23 23:59:27 +00:00
|
|
|
index df8dfaa..bc0b044 100644
|
2013-03-23 02:05:01 +00:00
|
|
|
--- a/src/main/resources/configurations/bukkit.yml
|
|
|
|
+++ b/src/main/resources/configurations/bukkit.yml
|
|
|
|
@@ -37,6 +37,7 @@ settings:
|
|
|
|
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-04-03 07:20:29 +00:00
|
|
|
1.7.0.4
|
2013-03-23 02:05:01 +00:00
|
|
|
|