Permalink
Browse files

Address some deprecations

  • Loading branch information...
PseudoKnight committed Sep 16, 2018
1 parent 649b753 commit 0b87a48f6c2be9069cccb6a00df24059a6166325
@@ -400,7 +400,7 @@ public int getMaxPlayers() {
public List<MCOfflinePlayer> getBannedPlayers() {
List<MCOfflinePlayer> list = new ArrayList<>();
for(OfflinePlayer p : s.getBannedPlayers()) {
list.add(getOfflinePlayer(p.getName()));
list.add(new BukkitMCOfflinePlayer(p));
}
return list;
}
@@ -409,7 +409,7 @@ public int getMaxPlayers() {
public List<MCOfflinePlayer> getWhitelistedPlayers() {
List<MCOfflinePlayer> list = new ArrayList<>();
for(OfflinePlayer p : s.getWhitelistedPlayers()) {
list.add(getOfflinePlayer(p.getName()));
list.add(new BukkitMCOfflinePlayer(p));
}
return list;
}
@@ -418,7 +418,7 @@ public int getMaxPlayers() {
public List<MCOfflinePlayer> getOperators() {
List<MCOfflinePlayer> list = new ArrayList<>();
for(OfflinePlayer p : s.getOperators()) {
list.add(getOfflinePlayer(p.getName()));
list.add(new BukkitMCOfflinePlayer(p));
}
return list;
}
@@ -15,16 +15,6 @@ public BukkitMCBoat(Entity e) {
this.b = (Boat) e;
}
@Override
public double getMaxSpeed() {
return b.getMaxSpeed();
}
@Override
public void setMaxSpeed(double speed) {
b.setMaxSpeed(speed);
}
@Override
public MCTreeSpecies getWoodType() {
return BukkitMCTreeSpecies.getConvertor().getAbstractedEnum(b.getWoodType());
@@ -831,9 +831,14 @@ public void setNewBookMeta(MCBookMeta bookMeta) {
pebe.setNewBookMeta(((BukkitMCBookMeta) bookMeta).getBookMeta());
}
@SuppressWarnings("deprecation")
@Override
public int getSlot() {
return pebe.getSlot();
int slot = pebe.getSlot();
if(slot == -1) { // bukkit offhand slot
return -106; // vanilla offhand slot
}
return slot;
}
@Override
@@ -3,8 +3,6 @@
import com.laytonsmith.abstraction.enums.MCTreeSpecies;
public interface MCBoat extends MCVehicle {
double getMaxSpeed();
void setMaxSpeed(double speed);
MCTreeSpecies getWoodType();
void setWoodType(MCTreeSpecies type);
}
@@ -118,7 +118,7 @@ private static LogLevel GetLevel(Tags tag) {
}
LogLevel level;
try {
String pref = (String) prefs.getPreference(tag.name);
String pref = prefs.getStringPreference(tag.name);
if("ON".equals(pref)) {
level = LogLevel.ERROR;
} else {
@@ -603,7 +603,7 @@ public static void main(String[] args) throws Exception {
password = reader.readLine("Enter password: ", cha);
} finally {
if(reader != null) {
reader.shutdown();
reader.close();
}
}
}
@@ -32,10 +32,12 @@
private List<StackTraceElement> stackTrace = null;
@SuppressWarnings("deprecation")
public AbstractCREException(String msg, Target t) {
super(msg, t);
}
@SuppressWarnings("deprecation")
public AbstractCREException(String msg, Target t, Throwable cause) {
super(msg, t, cause);
}
@@ -645,7 +645,7 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
throw new CREIOException(ex.getMessage(), t);
} finally {
if(reader != null) {
reader.shutdown();
reader.close();
}
}
@@ -723,7 +723,7 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
throw new CREIOException(ex.getMessage(), t);
} finally {
if(reader != null) {
reader.shutdown();
reader.close();
}
}
@@ -788,7 +788,7 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
throw new CREIOException(ex.getMessage(), t);
} finally {
if(reader != null) {
reader.shutdown();
reader.close();
}
}
@@ -1083,7 +1083,6 @@ public Boolean runAsync() {
}
}
@hide("Deprecated")
@api(environments = {CommandHelperEnvironment.class})
public static class spawn_falling_block extends AbstractFunction implements Optimizable {
@@ -96,11 +96,11 @@ public Profiler(File initFile) throws IOException {
if(configGranularity == null) {
configGranularity = LogLevel.ERROR;
}
profilerOn = (Boolean) prefs.getPreference("profiler-on");
logFile = (String) prefs.getPreference("profiler-log");
writeToFile = (Boolean) prefs.getPreference("write-to-file");
writeToScreen = (Boolean) prefs.getPreference("write-to-screen");
logThreshold = (Double) prefs.getPreference("profile-log-threshold");
profilerOn = prefs.getBooleanPreference("profiler-on");
logFile = prefs.getStringPreference("profiler-log");
writeToFile = prefs.getBooleanPreference("write-to-file");
writeToScreen = prefs.getBooleanPreference("write-to-screen");
logThreshold = prefs.getDoublePreference("profile-log-threshold");
new GarbageCollectionDetector(this);
//As a form of calibration, we want to "warm up" a point.
//For whatever reason, this levels out the profile points pretty well.
@@ -170,17 +170,17 @@ public static void run(boolean generatePrefs, boolean useLocalCache, File sitede
}
prefs.init(sitedeploy);
String username = (String) prefs.getPreference(USERNAME);
String hostname = (String) prefs.getPreference(HOSTNAME);
Integer port = (Integer) prefs.getPreference(PORT);
String directory = (String) prefs.getPreference(DIRECTORY);
Boolean usePassword = (Boolean) prefs.getPreference(PASSWORD);
String docsBase = (String) prefs.getPreference(DOCSBASE);
String siteBase = (String) prefs.getPreference(SITEBASE);
Boolean showTemplateCredit = (Boolean) prefs.getPreference(SHOW_TEMPLATE_CREDIT);
String githubBaseUrl = (String) prefs.getPreference(GITHUB_BASE_URL);
String validatorUrl = (String) prefs.getPreference(VALIDATOR_URL);
File finalizerScript = (File) prefs.getPreference(POST_SCRIPT);
String username = prefs.getStringPreference(USERNAME);
String hostname = prefs.getStringPreference(HOSTNAME);
Integer port = prefs.getIntegerPreference(PORT);
String directory = prefs.getStringPreference(DIRECTORY);
Boolean usePassword = prefs.getBooleanPreference(PASSWORD);
String docsBase = prefs.getStringPreference(DOCSBASE);
String siteBase = prefs.getStringPreference(SITEBASE);
Boolean showTemplateCredit = prefs.getBooleanPreference(SHOW_TEMPLATE_CREDIT);
String githubBaseUrl = prefs.getStringPreference(GITHUB_BASE_URL);
String validatorUrl = prefs.getStringPreference(VALIDATOR_URL);
File finalizerScript = prefs.getFilePreference(POST_SCRIPT);
{
// Check for config errors
@@ -260,7 +260,7 @@ public static void run(boolean generatePrefs, boolean useLocalCache, File sitede
password = reader.readLine("Please enter your password: ", cha);
} finally {
if(reader != null) {
reader.shutdown();
reader.close();
}
}
}

0 comments on commit 0b87a48

Please sign in to comment.