@@ -222,30 +222,34 @@ public static String getMinecraftPackage() {
222
222
Class <?> craftEntity = getCraftEntityClass ();
223
223
Method getHandle = craftEntity .getMethod ("getHandle" );
224
224
225
- MINECRAFT_FULL_PACKAGE = getPackage (getHandle .getReturnType ().getCanonicalName ());
226
-
227
- // Pretty important invariantt
228
- if (!MINECRAFT_FULL_PACKAGE .startsWith (MINECRAFT_PREFIX_PACKAGE )) {
229
- // See if we got the Forge entity package
230
- if (MINECRAFT_FULL_PACKAGE .equals (FORGE_ENTITY_PACKAGE )) {
231
- // USe the standard NMS versioned package
232
- MINECRAFT_FULL_PACKAGE = CachedPackage .combine (MINECRAFT_PREFIX_PACKAGE , packageVersion );
225
+ if (MinecraftVersion .CAVES_CLIFFS_1 .atOrAbove ()) {
226
+ // total rework of the NMS structure in 1.17 (at least there's no versioning)
227
+ MINECRAFT_FULL_PACKAGE = MINECRAFT_PREFIX_PACKAGE = "net.minecraft" ;
228
+ } else {
229
+ MINECRAFT_FULL_PACKAGE = getPackage (getHandle .getReturnType ().getCanonicalName ());
230
+
231
+ // Pretty important invariantt
232
+ if (!MINECRAFT_FULL_PACKAGE .startsWith (MINECRAFT_PREFIX_PACKAGE )) {
233
+ // See if we got the Forge entity package
234
+ if (MINECRAFT_FULL_PACKAGE .equals (FORGE_ENTITY_PACKAGE )) {
235
+ // USe the standard NMS versioned package
236
+ MINECRAFT_FULL_PACKAGE = CachedPackage .combine (MINECRAFT_PREFIX_PACKAGE , packageVersion );
237
+ } else {
238
+ // Assume they're the same instead
239
+ MINECRAFT_PREFIX_PACKAGE = MINECRAFT_FULL_PACKAGE ;
240
+ }
241
+
242
+ // The package is usualy flat, so go with that assumption
243
+ String matcher =
244
+ (MINECRAFT_PREFIX_PACKAGE .length () > 0 ? Pattern .quote (MINECRAFT_PREFIX_PACKAGE + "." ) : "" ) + CANONICAL_REGEX ;
245
+
246
+ // We'll still accept the default location, however
247
+ setDynamicPackageMatcher ("(" + matcher + ")|(" + MINECRAFT_OBJECT + ")" );
248
+
233
249
} else {
234
- // Assume they're the same instead
235
- MINECRAFT_PREFIX_PACKAGE = MINECRAFT_FULL_PACKAGE ;
250
+ // Use the standard matcher
251
+ setDynamicPackageMatcher ( MINECRAFT_OBJECT ) ;
236
252
}
237
-
238
- // The package is usualy flat, so go with that assumption
239
- String matcher =
240
- (MINECRAFT_PREFIX_PACKAGE .length () > 0 ?
241
- Pattern .quote (MINECRAFT_PREFIX_PACKAGE + "." ) : "" ) + CANONICAL_REGEX ;
242
-
243
- // We'll still accept the default location, however
244
- setDynamicPackageMatcher ("(" + matcher + ")|(" + MINECRAFT_OBJECT + ")" );
245
-
246
- } else {
247
- // Use the standard matcher
248
- setDynamicPackageMatcher (MINECRAFT_OBJECT );
249
253
}
250
254
251
255
return MINECRAFT_FULL_PACKAGE ;
@@ -752,7 +756,9 @@ public static Class<?> getByteBufClass() {
752
756
* @return The Enum protocol class.
753
757
*/
754
758
public static Class <?> getEnumProtocolClass () {
755
- try {
759
+ return getMinecraftClass ("network.EnumProtocol" , "EnumProtocol" );
760
+
761
+ /* try {
756
762
return getMinecraftClass("network.EnumProtocol", "EnumProtocol");
757
763
} catch (RuntimeException e) {
758
764
Method protocolMethod = FuzzyReflection.fromClass(getNetworkManagerClass()).getMethod(
@@ -762,7 +768,7 @@ public static Class<?> getEnumProtocolClass() {
762
768
build()
763
769
);
764
770
return setMinecraftClass("EnumProtocol", protocolMethod.getParameterTypes()[0]);
765
- }
771
+ } */
766
772
}
767
773
768
774
/**
0 commit comments