@@ -189,19 +189,19 @@ public static class Server extends ObjectEnum<PacketType> {
189
189
* @deprecated Removed in 1.9
190
190
*/
191
191
@ Deprecated
192
- public static final PacketType MAP_CHUNK_BULK = new PacketType (PROTOCOL , SENDER , -1 , -1 , "MapChunkBulk" ).deprecated ( );
192
+ public static final PacketType MAP_CHUNK_BULK = new PacketType (PROTOCOL , SENDER , -1 , -1 , "MapChunkBulk" ).deprecatedIn ( MinecraftVersion . COMBAT_UPDATE );
193
193
194
194
/**
195
195
* @deprecated Removed in 1.9
196
196
*/
197
197
@ Deprecated
198
- public static final PacketType SET_COMPRESSION = new PacketType (PROTOCOL , SENDER , -1 , -1 , "SetCompression" ).deprecated ( );
198
+ public static final PacketType SET_COMPRESSION = new PacketType (PROTOCOL , SENDER , -1 , -1 , "SetCompression" ).deprecatedIn ( MinecraftVersion . COMBAT_UPDATE );
199
199
200
200
/**
201
201
* @deprecated Removed in 1.9
202
202
*/
203
203
@ Deprecated
204
- public static final PacketType UPDATE_ENTITY_NBT = new PacketType (PROTOCOL , SENDER , -1 , -1 , "UpdateEntityNBT" ).deprecated ( );
204
+ public static final PacketType UPDATE_ENTITY_NBT = new PacketType (PROTOCOL , SENDER , -1 , -1 , "UpdateEntityNBT" ).deprecatedIn ( MinecraftVersion . COMBAT_UPDATE );
205
205
206
206
// ----- Renamed packets
207
207
@@ -235,9 +235,8 @@ public static class Server extends ObjectEnum<PacketType> {
235
235
* @deprecated Replaced by {@link TILE_ENTITY_DATA}
236
236
*/
237
237
@ Deprecated
238
- public static final PacketType UPDATE_SIGN = TILE_ENTITY_DATA . deprecated ();
238
+ public static final PacketType UPDATE_SIGN = getUpdateSign ();
239
239
240
- // The instance must
241
240
private final static Server INSTANCE = new Server ();
242
241
243
242
// Prevent accidental construction
@@ -249,6 +248,11 @@ public static Sender getSender() {
249
248
public static Server getInstance () {
250
249
return INSTANCE ;
251
250
}
251
+
252
+ private static PacketType getUpdateSign () {
253
+ PacketType type = new PacketType (PROTOCOL , SENDER , -1 , -1 , "UpdateSign" );
254
+ return type .getPacketClass () != null ? type : UPDATE_ENTITY_NBT .deprecated ();
255
+ }
252
256
}
253
257
254
258
/**
@@ -582,7 +586,7 @@ public String getPacketName() {
582
586
/**
583
587
* Protocol version of all the current IDs.
584
588
*/
585
- private static final MinecraftVersion PROTOCOL_VERSION = MinecraftVersion .BOUNTIFUL_UPDATE ;
589
+ private static final MinecraftVersion PROTOCOL_VERSION = MinecraftVersion .FROSTBURN_UPDATE ;
586
590
587
591
private final Protocol protocol ;
588
592
private final Sender sender ;
@@ -1075,6 +1079,14 @@ public boolean forceAsync() {
1075
1079
return forceAsync ;
1076
1080
}
1077
1081
1082
+ private PacketType deprecatedIn (MinecraftVersion version ) {
1083
+ try {
1084
+ return MinecraftVersion .getCurrentVersion ().isAtLeast (version ) ? deprecated () : this ;
1085
+ } catch (Throwable ex ) {
1086
+ return deprecated ();
1087
+ }
1088
+ }
1089
+
1078
1090
private PacketType deprecated () {
1079
1091
PacketType ret = clone ();
1080
1092
ret .deprecated = true ;
0 commit comments