geforkt von Mirrors/Paper
Deprecate and stop using Java15Compat class.
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
f0bfb0fdf7
Commit
3b51e3f230
@ -1,6 +1,7 @@
|
|||||||
package org.bukkit;
|
package org.bukkit;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
@ -58,8 +59,6 @@ import org.bukkit.material.Vine;
|
|||||||
import org.bukkit.material.Wood;
|
import org.bukkit.material.Wood;
|
||||||
import org.bukkit.material.WoodenStep;
|
import org.bukkit.material.WoodenStep;
|
||||||
import org.bukkit.material.Wool;
|
import org.bukkit.material.Wool;
|
||||||
import org.bukkit.potion.Potion;
|
|
||||||
import org.bukkit.util.Java15Compat;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
@ -721,7 +720,7 @@ public enum Material {
|
|||||||
if (byId.length > material.id) {
|
if (byId.length > material.id) {
|
||||||
byId[material.id] = material;
|
byId[material.id] = material;
|
||||||
} else {
|
} else {
|
||||||
byId = Java15Compat.Arrays_copyOfRange(byId, 0, material.id + 2);
|
byId = Arrays.copyOfRange(byId, 0, material.id + 2);
|
||||||
byId[material.id] = material;
|
byId[material.id] = material;
|
||||||
}
|
}
|
||||||
BY_NAME.put(material.name(), material);
|
BY_NAME.put(material.name(), material);
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package org.bukkit.command;
|
package org.bukkit.command;
|
||||||
|
|
||||||
import static org.bukkit.util.Java15Compat.Arrays_copyOfRange;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -137,7 +136,7 @@ public class SimpleCommandMap implements CommandMap {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||||
target.execute(sender, sentCommandLabel, Arrays_copyOfRange(args, 1, args.length));
|
target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length));
|
||||||
} catch (CommandException ex) {
|
} catch (CommandException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
|
@ -2,6 +2,7 @@ package org.bukkit.util;
|
|||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ public class ChatPaginator {
|
|||||||
|
|
||||||
int from = (actualPageNumber - 1) * pageHeight;
|
int from = (actualPageNumber - 1) * pageHeight;
|
||||||
int to = from + pageHeight <= lines.length ? from + pageHeight : lines.length;
|
int to = from + pageHeight <= lines.length ? from + pageHeight : lines.length;
|
||||||
String[] selectedLines = Java15Compat.Arrays_copyOfRange(lines, from, to);
|
String[] selectedLines = Arrays.copyOfRange(lines, from, to);
|
||||||
|
|
||||||
return new ChatPage(selectedLines, actualPageNumber, totalPages);
|
return new ChatPage(selectedLines, actualPageNumber, totalPages);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,11 @@ package org.bukkit.util;
|
|||||||
|
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Bukkit targets Java 1.6. This class will be removed in a
|
||||||
|
* subsequent release.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public class Java15Compat {
|
public class Java15Compat {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> T[] Arrays_copyOfRange(T[] original, int start, int end) {
|
public static <T> T[] Arrays_copyOfRange(T[] original, int start, int end) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren