Code cleaning and Gradle Update

Updated gradle wrapper to 3.0
Updated Gradle files for Nukkit
Added/cleaned minor Nukkit code
Removed duplicate TitleManagement code

Signed-off-by: MattBDev <mattbdev@outlook.com>
This commit is contained in:
MattBDev
2016-09-13 18:10:01 -04:00
parent a95b68b73c
commit b6dac54677
15 changed files with 58 additions and 84 deletions

View File

@ -18,7 +18,7 @@ public class DefaultTitleManager extends TitleManager {
* @param stayTime Stay on screen time
* @param fadeOutTime Fade out time
*/
public DefaultTitleManager(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) {
DefaultTitleManager(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) {
super(title, subtitle, fadeInTime, stayTime, fadeOutTime);
}
@ -106,9 +106,9 @@ public class DefaultTitleManager extends TitleManager {
}
}
private Method getMethod(Class<?> clazz, String name, Class<?>... args) {
Method getMethod(Class<?> clazz, String name, Class<?>... args) {
for (Method m : clazz.getMethods()) {
if (m.getName().equals(name) && (args.length == 0 || ClassListEqual(args, m.getParameterTypes()))) {
if (m.getName().equals(name) && (args.length == 0 || classListEqual(args, m.getParameterTypes()))) {
m.setAccessible(true);
return m;
}
@ -116,17 +116,4 @@ public class DefaultTitleManager extends TitleManager {
return null;
}
boolean ClassListEqual(Class<?>[] l1, Class<?>[] l2) {
if (l1.length != l2.length) {
return false;
}
boolean equal = true;
for (int i = 0; i < l1.length; i++) {
if (l1[i] != l2[i]) {
equal = false;
break;
}
}
return equal;
}
}

View File

@ -17,7 +17,7 @@ public class DefaultTitleManager_183 extends DefaultTitleManager {
* @param stayTime Stay on screen time
* @param fadeOutTime Fade out time
*/
public DefaultTitleManager_183(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) {
DefaultTitleManager_183(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) {
super(title, subtitle, fadeInTime, stayTime, fadeOutTime);
}
@ -67,15 +67,4 @@ public class DefaultTitleManager_183 extends DefaultTitleManager {
}
}
}
private Method getMethod(Class<?> clazz, String name, Class<?>... args) {
for (Method m : clazz.getMethods()) {
if (m.getName().equals(name) && ((args.length == 0) || ClassListEqual(args, m.getParameterTypes()))) {
m.setAccessible(true);
return m;
}
}
return null;
}
}

View File

@ -19,7 +19,7 @@ public class HackTitleManager extends TitleManager {
* @param stayTime Stay on screen time
* @param fadeOutTime Fade out time
*/
public HackTitleManager(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) {
HackTitleManager(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) {
super(title, subtitle, fadeInTime, stayTime, fadeOutTime);
}
@ -162,18 +162,4 @@ public class HackTitleManager extends TitleManager {
return null;
}
private boolean classListEqual(Class<?>[] l1, Class<?>[] l2) {
if (l1.length != l2.length) {
return false;
}
boolean equal = true;
for (int i = 0; i < l1.length; i++) {
if (l1[i] != l2[i]) {
equal = false;
break;
}
}
return equal;
}
}

View File

@ -241,4 +241,17 @@ public abstract class TitleManager {
return true;
}
boolean classListEqual(Class<?>[] l1, Class<?>[] l2) {
if (l1.length != l2.length) {
return false;
}
boolean equal = true;
for (int i = 0; i < l1.length; i++) {
if (l1[i] != l2[i]) {
equal = false;
break;
}
}
return equal;
}
}

View File

@ -610,27 +610,27 @@ public class BukkitChunkManager extends ChunkManager {
public static class ContentMap {
public final Map<BlockLoc, ItemStack[]> chestContents;
public final Map<BlockLoc, ItemStack[]> furnaceContents;
public final Map<BlockLoc, ItemStack[]> dispenserContents;
public final Map<BlockLoc, ItemStack[]> dropperContents;
public final Map<BlockLoc, ItemStack[]> brewingStandContents;
public final Map<BlockLoc, ItemStack[]> beaconContents;
public final Map<BlockLoc, ItemStack[]> hopperContents;
public final Map<BlockLoc, Short[]> furnaceTime;
public final Map<BlockLoc, Object[]> skullData;
public final Map<BlockLoc, Material> jukeboxDisc;
public final Map<BlockLoc, Short> brewTime;
public final Map<BlockLoc, EntityType> spawnerData;
public final Map<BlockLoc, String> cmdData;
public final Map<BlockLoc, String[]> signContents;
public final Map<BlockLoc, Note> noteBlockContents;
public final Map<BlockLoc, List<Pattern>> bannerPatterns;
public final Map<BlockLoc, DyeColor> bannerBase;
public final Set<EntityWrapper> entities;
public final Map<PlotLoc, PlotBlock[]> allBlocks;
final Map<BlockLoc, ItemStack[]> chestContents;
final Map<BlockLoc, ItemStack[]> furnaceContents;
final Map<BlockLoc, ItemStack[]> dispenserContents;
final Map<BlockLoc, ItemStack[]> dropperContents;
final Map<BlockLoc, ItemStack[]> brewingStandContents;
final Map<BlockLoc, ItemStack[]> beaconContents;
final Map<BlockLoc, ItemStack[]> hopperContents;
final Map<BlockLoc, Short[]> furnaceTime;
final Map<BlockLoc, Object[]> skullData;
final Map<BlockLoc, Material> jukeboxDisc;
final Map<BlockLoc, Short> brewTime;
final Map<BlockLoc, EntityType> spawnerData;
final Map<BlockLoc, String> cmdData;
final Map<BlockLoc, String[]> signContents;
final Map<BlockLoc, Note> noteBlockContents;
final Map<BlockLoc, List<Pattern>> bannerPatterns;
final Map<BlockLoc, DyeColor> bannerBase;
final Set<EntityWrapper> entities;
final Map<PlotLoc, PlotBlock[]> allBlocks;
public ContentMap() {
ContentMap() {
this.chestContents = new HashMap<>();
this.furnaceContents = new HashMap<>();
this.dispenserContents = new HashMap<>();