# Conflicts:

#	Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java

#	Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_9.java
This commit is contained in:
Jesse Boyd
2016-05-13 03:04:43 +10:00
122 changed files with 1175 additions and 1478 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<>();
@ -742,12 +743,12 @@ public class BukkitChunkManager extends ChunkManager {
chest.getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate chest: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate chest: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate chest (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate chest (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, String[]> blockLocEntry : this.signContents.entrySet()) {
@ -765,14 +766,14 @@ public class BukkitChunkManager extends ChunkManager {
state.update(true);
} else {
PS.debug(
"&c[WARN] Plot clear failed to regenerate sign: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
"&c[WARN] Plot clear failed to regenerate sign: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y
+ "," + (
+ ',' + (
blockLocEntry.getKey().z + zOffset));
}
} catch (IndexOutOfBoundsException e) {
PS.debug("&c[WARN] Plot clear failed to regenerate sign: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry.getKey().y
+ "," + (
} catch (IndexOutOfBoundsException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate sign: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
+ ',' + (
blockLocEntry.getKey().z + zOffset));
}
}
@ -785,12 +786,12 @@ public class BukkitChunkManager extends ChunkManager {
((InventoryHolder) state).getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, ItemStack[]> blockLocEntry : this.dropperContents.entrySet()) {
@ -802,12 +803,12 @@ public class BukkitChunkManager extends ChunkManager {
((InventoryHolder) state).getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, ItemStack[]> blockLocEntry : this.beaconContents.entrySet()) {
@ -819,12 +820,12 @@ public class BukkitChunkManager extends ChunkManager {
((InventoryHolder) state).getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate beacon: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate beacon: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate beacon (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate beacon (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, Material> blockLocMaterialEntry : this.jukeboxDisc.entrySet()) {
@ -837,15 +838,15 @@ public class BukkitChunkManager extends ChunkManager {
((Jukebox) state).setPlaying(blockLocMaterialEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to restore jukebox: " + (blockLocMaterialEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to restore jukebox: " + (blockLocMaterialEntry.getKey().x + xOffset) + ','
+ blockLocMaterialEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocMaterialEntry.getKey().z + zOffset));
}
} catch (Exception ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate jukebox (e): " + (blockLocMaterialEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to regenerate jukebox (e): " + (blockLocMaterialEntry.getKey().x + xOffset) + ','
+ blockLocMaterialEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocMaterialEntry.getKey().z + zOffset));
}
}
@ -863,12 +864,12 @@ public class BukkitChunkManager extends ChunkManager {
((Skull) state).setSkullType((SkullType) data[3]);
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to restore skull: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to restore skull: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (Exception e) {
PS.debug("&c[WARN] Plot clear failed to regenerate skull (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate skull (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
e.printStackTrace();
}
}
@ -881,12 +882,12 @@ public class BukkitChunkManager extends ChunkManager {
((InventoryHolder) state).getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate hopper: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate hopper: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate hopper (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate hopper (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, Note> blockLocNoteEntry : this.noteBlockContents.entrySet()) {
@ -898,15 +899,15 @@ public class BukkitChunkManager extends ChunkManager {
((NoteBlock) state).setNote(blockLocNoteEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate note block: " + (blockLocNoteEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to regenerate note block: " + (blockLocNoteEntry.getKey().x + xOffset) + ','
+ blockLocNoteEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocNoteEntry.getKey().z + zOffset));
}
} catch (Exception ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate note block (e): " + (blockLocNoteEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to regenerate note block (e): " + (blockLocNoteEntry.getKey().x + xOffset) + ','
+ blockLocNoteEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocNoteEntry.getKey().z + zOffset));
}
}
@ -918,14 +919,14 @@ public class BukkitChunkManager extends ChunkManager {
if (state instanceof BrewingStand) {
((BrewingStand) state).setBrewingTime(blockLocShortEntry.getValue());
} else {
PS.debug("&c[WARN] Plot clear failed to restore brewing stand cooking: " + (blockLocShortEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to restore brewing stand cooking: " + (blockLocShortEntry.getKey().x + xOffset) + ','
+ blockLocShortEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocShortEntry.getKey().z + zOffset));
}
} catch (Exception ignored) {
PS.debug("&c[WARN] Plot clear failed to restore brewing stand cooking (e): " + (blockLocShortEntry.getKey().x + xOffset) + ","
+ blockLocShortEntry.getKey().y + "," + (blockLocShortEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to restore brewing stand cooking (e): " + (blockLocShortEntry.getKey().x + xOffset) + ','
+ blockLocShortEntry.getKey().y + ',' + (blockLocShortEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, EntityType> blockLocEntityTypeEntry : this.spawnerData.entrySet()) {
@ -938,14 +939,14 @@ public class BukkitChunkManager extends ChunkManager {
((CreatureSpawner) state).setSpawnedType(blockLocEntityTypeEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to restore spawner type: " + (blockLocEntityTypeEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to restore spawner type: " + (blockLocEntityTypeEntry.getKey().x + xOffset) + ','
+ blockLocEntityTypeEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocEntityTypeEntry.getKey().z + zOffset));
}
} catch (Exception e) {
PS.debug("&c[WARN] Plot clear failed to restore spawner type (e): " + (blockLocEntityTypeEntry.getKey().x + xOffset) + ","
+ blockLocEntityTypeEntry.getKey().y + "," + (blockLocEntityTypeEntry.getKey().z + zOffset));
} catch (Exception ignored) {
PS.debug("&c[WARN] Plot clear failed to restore spawner type (e): " + (blockLocEntityTypeEntry.getKey().x + xOffset) + ','
+ blockLocEntityTypeEntry.getKey().y + ',' + (blockLocEntityTypeEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, String> blockLocStringEntry : this.cmdData.entrySet()) {
@ -957,15 +958,15 @@ public class BukkitChunkManager extends ChunkManager {
((CommandBlock) state).setCommand(blockLocStringEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to restore command block: " + (blockLocStringEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to restore command block: " + (blockLocStringEntry.getKey().x + xOffset) + ','
+ blockLocStringEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocStringEntry.getKey().z + zOffset));
}
} catch (Exception e) {
PS.debug("&c[WARN] Plot clear failed to restore command block (e): " + (blockLocStringEntry.getKey().x + xOffset) + ","
} catch (Exception ignored) {
PS.debug("&c[WARN] Plot clear failed to restore command block (e): " + (blockLocStringEntry.getKey().x + xOffset) + ','
+ blockLocStringEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocStringEntry.getKey().z + zOffset));
}
}
@ -978,15 +979,15 @@ public class BukkitChunkManager extends ChunkManager {
((InventoryHolder) state).getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate brewing stand: " + (blockLocEntry.getKey().x + xOffset) + ","
PS.debug("&c[WARN] Plot clear failed to regenerate brewing stand: " + (blockLocEntry.getKey().x + xOffset) + ','
+ blockLocEntry
.getKey().y + "," + (
.getKey().y + ',' + (
blockLocEntry.getKey().z
+ zOffset));
}
} catch (IllegalArgumentException e) {
PS.debug("&c[WARN] Plot clear failed to regenerate brewing stand (e): " + (blockLocEntry.getKey().x + xOffset) + ","
+ blockLocEntry.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate brewing stand (e): " + (blockLocEntry.getKey().x + xOffset) + ','
+ blockLocEntry.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, Short[]> blockLocEntry : this.furnaceTime.entrySet()) {
@ -1000,13 +1001,13 @@ public class BukkitChunkManager extends ChunkManager {
((Furnace) state).setCookTime(time[1]);
} else {
PS.debug(
"&c[WARN] Plot clear failed to restore furnace cooking: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
"&c[WARN] Plot clear failed to restore furnace cooking: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (Exception e) {
} catch (Exception ignored) {
PS.debug(
"&c[WARN] Plot clear failed to restore furnace cooking (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
"&c[WARN] Plot clear failed to restore furnace cooking (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, ItemStack[]> blockLocEntry : this.furnaceContents.entrySet()) {
@ -1018,12 +1019,12 @@ public class BukkitChunkManager extends ChunkManager {
((InventoryHolder) state).getInventory().setContents(blockLocEntry.getValue());
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate furnace: " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate furnace: " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
} catch (IllegalArgumentException e) {
PS.debug("&c[WARN] Plot clear failed to regenerate furnace (e): " + (blockLocEntry.getKey().x + xOffset) + "," + blockLocEntry
.getKey().y + "," + (blockLocEntry.getKey().z + zOffset));
} catch (IllegalArgumentException ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate furnace (e): " + (blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry
.getKey().y + ',' + (blockLocEntry.getKey().z + zOffset));
}
}
for (Entry<BlockLoc, DyeColor> blockLocByteEntry : this.bannerBase.entrySet()) {
@ -1039,12 +1040,12 @@ public class BukkitChunkManager extends ChunkManager {
banner.setPatterns(patterns);
state.update(true);
} else {
PS.debug("&c[WARN] Plot clear failed to regenerate banner: " + (blockLocByteEntry.getKey().x + xOffset) + ","
+ blockLocByteEntry.getKey().y + "," + (blockLocByteEntry.getKey().z + zOffset));
PS.debug("&c[WARN] Plot clear failed to regenerate banner: " + (blockLocByteEntry.getKey().x + xOffset) + ','
+ blockLocByteEntry.getKey().y + ',' + (blockLocByteEntry.getKey().z + zOffset));
}
} catch (Exception e) {
PS.debug("&c[WARN] Plot clear failed to regenerate banner (e): " + (blockLocByteEntry.getKey().x + xOffset) + ","
+ blockLocByteEntry.getKey().y + "," + (blockLocByteEntry.getKey().z + zOffset));
} catch (Exception ignored) {
PS.debug("&c[WARN] Plot clear failed to regenerate banner (e): " + (blockLocByteEntry.getKey().x + xOffset) + ','
+ blockLocByteEntry.getKey().y + ',' + (blockLocByteEntry.getKey().z + zOffset));
}
}
}
@ -1074,33 +1075,42 @@ public class BukkitChunkManager extends ChunkManager {
if (block.getState() instanceof InventoryHolder) {
InventoryHolder inventoryHolder = (InventoryHolder) block.getState();
ItemStack[] inventory = inventoryHolder.getInventory().getContents().clone();
if (id == Material.CHEST) {
this.chestContents.put(bl, inventory);
} else if (id == Material.DISPENSER) {
this.dispenserContents.put(bl, inventory);
} else if (id == Material.BEACON) {
this.beaconContents.put(bl, inventory);
} else if (id == Material.DROPPER) {
this.dropperContents.put(bl, inventory);
} else if (id == Material.HOPPER) {
this.hopperContents.put(bl, inventory);
} else if (id == Material.BREWING_STAND) {
BrewingStand brewingStand = (BrewingStand) inventoryHolder;
short time = (short) brewingStand.getBrewingTime();
if (time > 0) {
this.brewTime.put(bl, time);
}
ItemStack[] invBre = brewingStand.getInventory().getContents().clone();
this.brewingStandContents.put(bl, invBre);
} else if (id == Material.FURNACE || id == Material.BURNING_FURNACE) {
Furnace furnace = (Furnace) inventoryHolder;
short burn = furnace.getBurnTime();
short cook = furnace.getCookTime();
ItemStack[] invFur = furnace.getInventory().getContents().clone();
this.furnaceContents.put(bl, invFur);
if (cook != 0) {
this.furnaceTime.put(bl, new Short[]{burn, cook});
}
switch (id) {
case CHEST:
this.chestContents.put(bl, inventory);
break;
case DISPENSER:
this.dispenserContents.put(bl, inventory);
break;
case BEACON:
this.beaconContents.put(bl, inventory);
break;
case DROPPER:
this.dropperContents.put(bl, inventory);
break;
case HOPPER:
this.hopperContents.put(bl, inventory);
break;
case BREWING_STAND:
BrewingStand brewingStand = (BrewingStand) inventoryHolder;
short time = (short) brewingStand.getBrewingTime();
if (time > 0) {
this.brewTime.put(bl, time);
}
ItemStack[] invBre = brewingStand.getInventory().getContents().clone();
this.brewingStandContents.put(bl, invBre);
break;
case FURNACE:
case BURNING_FURNACE:
Furnace furnace = (Furnace) inventoryHolder;
short burn = furnace.getBurnTime();
short cook = furnace.getCookTime();
ItemStack[] invFur = furnace.getInventory().getContents().clone();
this.furnaceContents.put(bl, invFur);
if (cook != 0) {
this.furnaceTime.put(bl, new Short[]{burn, cook});
}
break;
}
} else if (block.getState() instanceof CreatureSpawner) {
CreatureSpawner spawner = (CreatureSpawner) block.getState();

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

@ -194,7 +194,7 @@ public class BukkitUtil extends WorldUtil {
try {
Biome biome = Biome.valueOf(biomeStr.toUpperCase());
return Arrays.asList(Biome.values()).indexOf(biome);
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException ignored) {
return -1;
}
}
@ -252,7 +252,7 @@ public class BukkitUtil extends WorldUtil {
}
}
return false;
} catch (Exception e) {
} catch (Exception ignored) {
return false;
}
}
@ -271,9 +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 e) {
//ignored
}
} catch (IllegalArgumentException ignored) {}
try {
byte data;
String[] split = name.split(":");
@ -297,9 +295,7 @@ public class BukkitUtil extends WorldUtil {
StringComparison<PlotBlock> outer = new StringComparison<>();
return outer.new ComparisonResult(match, block);
} catch (NumberFormatException e) {
//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;
}
}
@ -520,11 +519,6 @@ public class Metrics {
return graph.name.equals(this.name);
}
/**
* Called when the server owner decides to opt-out of BukkitMetrics while the server is running.
*/
protected void onOptOut() {
}
}
/**
@ -574,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

@ -51,7 +51,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");