Archiviert
13
0

Make it possible to modify the player list in the ping packet.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-12-14 17:35:29 +01:00
Ursprung a6f4aaa09a
Commit f41efdec60
3 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -256,7 +256,7 @@ public class BukkitConverters {
* @return An equivalent converter.
*/
public static <T> EquivalentConverter<Iterable<? extends T>> getArrayConverter(
final Class<?> genericItemType, final EquivalentConverter<T> itemConverter) {
final Class<?> genericItemType, final EquivalentConverter<T> itemConverter) {
// Convert to and from the wrapper
return new IgnoreNullConverter<Iterable<? extends T>>() {
@Override
@ -279,7 +279,7 @@ public class BukkitConverters {
@Override
protected Object getGenericValue(Class<?> genericType, Iterable<? extends T> specific) {
List<T> list = Lists.newArrayList(specific);
Object[] output = (Object[]) Array.newInstance(genericType, list.size());
Object[] output = (Object[]) Array.newInstance(genericItemType, list.size());
// Convert each object
for (int i = 0; i < output.length; i++) {

Datei anzeigen

@ -568,7 +568,7 @@ public class WrappedDataWatcher extends AbstractWrapper implements Iterable<Wrap
VALUE_MAP_ACCESSOR = Accessors.getFieldAccessor(lookup, true);
}
}
// Spigot workaround
// Spigot workaround (not necessary
initializeSpigot(fuzzy);
// Initialize static type type
@ -588,6 +588,7 @@ public class WrappedDataWatcher extends AbstractWrapper implements Iterable<Wrap
initializeMethods(fuzzy);
}
// TODO: Remove, as this was fixed in build #1189 of Spigot
private static void initializeSpigot(FuzzyReflection fuzzy) {
// See if the workaround is needed
if (TYPE_MAP_ACCESSOR != null && VALUE_MAP_ACCESSOR != null)

Datei anzeigen

@ -46,7 +46,7 @@ public class WrappedServerPing extends AbstractWrapper {
// For converting to the underlying array
private static EquivalentConverter<Iterable<? extends WrappedGameProfile>> PROFILE_CONVERT =
BukkitConverters.getArrayConverter(GameProfile[].class, BukkitConverters.getWrappedGameProfileConverter());
BukkitConverters.getArrayConverter(GameProfile.class, BukkitConverters.getWrappedGameProfileConverter());
// Server ping player sample fields
private static Class<?> PLAYERS_CLASS = MinecraftReflection.getServerPingPlayerSampleClass();