A few minor fixes

This commit is contained in:
dordsor21 2018-12-20 18:46:52 +00:00
parent 096ad1febe
commit 4e10682748
3 changed files with 9 additions and 10 deletions

View File

@ -297,7 +297,8 @@ public class BukkitChunkManager extends ChunkManager {
if (id != null) { if (id != null) {
value.setBlock(x, y, z, id); value.setBlock(x, y, z, id);
} else { } else {
value.setBlock(x, y, z, PlotBlock.get("air")); value.setBlock(x, y, z,
PlotBlock.get("air"));
} }
} }
for (int y = Math.min(128, ids.length); for (int y = Math.min(128, ids.length);
@ -1095,14 +1096,13 @@ public class BukkitChunkManager extends ChunkManager {
Block block = world.getBlockAt(x, y, z); Block block = world.getBlockAt(x, y, z);
Material id = block.getType(); Material id = block.getType();
if (storeNormal) { if (storeNormal) {
int typeId = id.getId(); if (id.name().contains("AIR")) {
if (typeId == 0) {
ids[y] = StringPlotBlock.EVERYTHING; ids[y] = StringPlotBlock.EVERYTHING;
} else { } else {
ids[y] = PlotBlock.get((short) typeId, block.getData()); ids[y] = PlotBlock.get(id.name());
} }
} }
if (!id.equals(Material.AIR)) { if (!id.name().contains("AIR")) {
try { try {
BlockLoc bl = new BlockLoc(x + offsetX, y, z + offsetZ); BlockLoc bl = new BlockLoc(x + offsetX, y, z + offsetZ);
if (block.getState() instanceof InventoryHolder) { if (block.getState() instanceof InventoryHolder) {
@ -1136,7 +1136,6 @@ public class BukkitChunkManager extends ChunkManager {
this.brewingStandContents.put(bl, invBre); this.brewingStandContents.put(bl, invBre);
break; break;
case FURNACE: case FURNACE:
case LEGACY_BURNING_FURNACE:
Furnace furnace = (Furnace) inventoryHolder; Furnace furnace = (Furnace) inventoryHolder;
short burn = furnace.getBurnTime(); short burn = furnace.getBurnTime();
short cook = furnace.getCookTime(); short cook = furnace.getCookTime();

View File

@ -729,9 +729,9 @@ public class BukkitLegacyMappings extends LegacyMappings {
} }
} }
} }
PlotBlock plotBlock = fromStringToLegacy(workingString); PlotBlock plotBlock;
if (plotBlock != null) { if (NEW_STRING_TO_LEGACY_PLOT_BLOCK.keySet().contains(workingString.toLowerCase())) {
return plotBlock; return PlotBlock.get(workingString);
} else if ((plotBlock = fromLegacyToString(workingString)) != null) { } else if ((plotBlock = fromLegacyToString(workingString)) != null) {
return plotBlock; return plotBlock;
} else { } else {

View File

@ -11,7 +11,7 @@ import java.util.Map;
public class StringPlotBlock extends PlotBlock { public class StringPlotBlock extends PlotBlock {
public static final PlotBlock EVERYTHING = new StringPlotBlock(""); public static final PlotBlock EVERYTHING = new StringPlotBlock("air");
private static final Map<String, StringPlotBlock> STRING_PLOT_BLOCK_CACHE = new HashMap<>(); private static final Map<String, StringPlotBlock> STRING_PLOT_BLOCK_CACHE = new HashMap<>();
@Getter private final String nameSpace; @Getter private final String nameSpace;
@Getter private final String itemId; @Getter private final String itemId;