Bug Fix and Cleanup

This commit is contained in:
MattBDev
2016-04-29 18:14:12 -04:00
parent 8f3d35bca3
commit 421203a27d
68 changed files with 377 additions and 595 deletions

View File

@ -58,6 +58,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@ -616,25 +617,25 @@ public class BukkitChunkManager extends ChunkManager {
public static class ContentMap {
public final HashMap<BlockLoc, ItemStack[]> chestContents;
public final HashMap<BlockLoc, ItemStack[]> furnaceContents;
public final HashMap<BlockLoc, ItemStack[]> dispenserContents;
public final HashMap<BlockLoc, ItemStack[]> dropperContents;
public final HashMap<BlockLoc, ItemStack[]> brewingStandContents;
public final HashMap<BlockLoc, ItemStack[]> beaconContents;
public final HashMap<BlockLoc, ItemStack[]> hopperContents;
public final HashMap<BlockLoc, Short[]> furnaceTime;
public final HashMap<BlockLoc, Object[]> skullData;
public final HashMap<BlockLoc, Material> jukeboxDisc;
public final HashMap<BlockLoc, Short> brewTime;
public final HashMap<BlockLoc, EntityType> spawnerData;
public final HashMap<BlockLoc, String> cmdData;
public final HashMap<BlockLoc, String[]> signContents;
public final HashMap<BlockLoc, Note> noteBlockContents;
public final HashMap<BlockLoc, List<Pattern>> bannerPatterns;
public final HashMap<BlockLoc, DyeColor> bannerBase;
public final HashSet<EntityWrapper> entities;
public final HashMap<PlotLoc, PlotBlock[]> allBlocks;
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;
public ContentMap() {
this.chestContents = new HashMap<>();

View File

@ -49,8 +49,7 @@ public class BukkitHybridUtils extends HybridUtils {
}
final BiomeGrid nullBiomeGrid = new BiomeGrid() {
@Override
public void setBiome(int a, int b, Biome c) {
}
public void setBiome(int a, int b, Biome c) {}
@Override
public Biome getBiome(int a, int b) {

View File

@ -22,12 +22,10 @@ public class BukkitPlainChatManager extends ChatManager<List<StringBuilder>> {
}
@Override
public void tooltip(PlotMessage message, PlotMessage... tooltips) {
}
public void tooltip(PlotMessage message, PlotMessage... tooltips) {}
@Override
public void command(PlotMessage message, String command) {
}
public void command(PlotMessage message, String command) {}
@Override
public void text(PlotMessage message, String text) {
@ -44,7 +42,6 @@ public class BukkitPlainChatManager extends ChatManager<List<StringBuilder>> {
}
@Override
public void suggest(PlotMessage plotMessage, String command) {
}
public void suggest(PlotMessage plotMessage, String command) {}
}

View File

@ -271,8 +271,7 @@ public class BukkitUtil extends WorldUtil {
try {
Material material = Material.valueOf(name.toUpperCase());
return new StringComparison<PlotBlock>().new ComparisonResult(0, new PlotBlock((short) material.getId(), (byte) 0));
} catch (IllegalArgumentException ignored) {
}
} catch (IllegalArgumentException ignored) {}
try {
byte data;
String[] split = name.split(":");
@ -296,8 +295,7 @@ public class BukkitUtil extends WorldUtil {
StringComparison<PlotBlock> outer = new StringComparison<>();
return outer.new ComparisonResult(match, block);
} catch (NumberFormatException ignored) {
}
} catch (NumberFormatException ignored) {}
return null;
}

View File

@ -95,8 +95,7 @@ public class Metrics {
if (gzos != null) {
try {
gzos.close();
} catch (IOException ignore) {
}
} catch (IOException ignore) {}
}
}
return baos.toByteArray();
@ -117,7 +116,7 @@ public class Metrics {
Double.parseDouble(value);
isValueNumeric = true;
}
} catch (NumberFormatException e) {
} catch (NumberFormatException ignored) {
isValueNumeric = false;
}
if (json.charAt(json.length() - 1) != '{') {
@ -446,7 +445,7 @@ public class Metrics {
try {
Class.forName("mineshafter.MineServer");
return true;
} catch (ClassNotFoundException e) {
} catch (ClassNotFoundException ignored) {
return false;
}
}
@ -569,8 +568,7 @@ public class Metrics {
/**
* Called after the website graphs have been updated
*/
public void reset() {
}
public void reset() {}
@Override
public int hashCode() {

View File

@ -42,7 +42,7 @@ public class SendChunk {
/**
* Constructor
*/
public SendChunk() {
public SendChunk() throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException {
RefClass classCraftPlayer = getRefClass("{cb}.entity.CraftPlayer");
this.methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle");
RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");

View File

@ -38,7 +38,7 @@ public class FastQueue_1_7 extends SlowQueue {
private final HashMap<ChunkWrapper, Chunk> toUpdate = new HashMap<>();
public FastQueue_1_7() throws RuntimeException {
public FastQueue_1_7() throws NoSuchMethodException, ClassNotFoundException, NoSuchFieldException {
this.methodGetHandle = this.classCraftWorld.getMethod("getHandle");
this.methodGetChunkAt = this.classWorld.getMethod("getChunkAt", int.class, int.class);
this.methodA = this.classChunk.getMethod("a", int.class, int.class, int.class, this.classBlock, int.class);

View File

@ -41,7 +41,7 @@ public class FastQueue_1_8 extends SlowQueue {
private final RefConstructor constructorBlockPosition;
private final SendChunk sendChunk;
public FastQueue_1_8() throws RuntimeException {
public FastQueue_1_8() throws NoSuchMethodException, ClassNotFoundException, NoSuchFieldException {
this.methodInitLighting = this.classChunk.getMethod("initLighting");
this.constructorBlockPosition = this.classBlockPosition.getConstructor(int.class, int.class, int.class);
this.methodGetByCombinedId = this.classBlock.getMethod("getByCombinedId", int.class);
@ -56,7 +56,7 @@ public class FastQueue_1_8 extends SlowQueue {
return;
}
int count = 0;
ArrayList<Chunk> chunks = new ArrayList<Chunk>();
ArrayList<Chunk> chunks = new ArrayList<>();
Iterator<Entry<ChunkWrapper, Chunk>> i = FastQueue_1_8.this.toUpdate.entrySet().iterator();
while (i.hasNext() && count < 128) {
chunks.add(i.next().getValue());

View File

@ -49,7 +49,7 @@ public class FastQueue_1_8_3 extends SlowQueue {
private final RefMethod methodGetWorld;
private final RefField tileEntityListTick;
public FastQueue_1_8_3() throws RuntimeException {
public FastQueue_1_8_3() throws NoSuchMethodException, ClassNotFoundException, NoSuchFieldException {
RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
RefClass classCraftWorld = getRefClass("{cb}.CraftWorld");
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle");

View File

@ -53,7 +53,7 @@ public class FastQueue_1_9 extends SlowQueue {
private final RefField tileEntityListTick;
public FastQueue_1_9() throws RuntimeException {
public FastQueue_1_9() throws NoSuchFieldException, NoSuchMethodException, ClassNotFoundException {
RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
RefClass classChunk = getRefClass("{nms}.Chunk");