mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-12-01 13:23:26 +01:00
Fixed IllegalArgumentException when processing corrupt data
This commit is contained in:
parent
1974838f74
commit
070c5139e1
@ -1914,7 +1914,7 @@ public class Rollback extends Queue {
|
|||||||
}
|
}
|
||||||
itemstack.setItemMeta(meta);
|
itemstack.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
else if ((rowType == Material.MAP)) {
|
else if (rowType == Material.MAP || rowType == Material.FILLED_MAP) {
|
||||||
for (Map<String, Object> colorData : map) {
|
for (Map<String, Object> colorData : map) {
|
||||||
MapMeta meta = (MapMeta) itemstack.getItemMeta();
|
MapMeta meta = (MapMeta) itemstack.getItemMeta();
|
||||||
org.bukkit.Color color = org.bukkit.Color.deserialize(colorData);
|
org.bukkit.Color color = org.bukkit.Color.deserialize(colorData);
|
||||||
|
@ -1386,13 +1386,17 @@ public class Util extends Queue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static BlockData createBlockData(Material material) {
|
public static BlockData createBlockData(Material material) {
|
||||||
|
try {
|
||||||
BlockData result = material.createBlockData();
|
BlockData result = material.createBlockData();
|
||||||
if (result instanceof Waterlogged) {
|
if (result instanceof Waterlogged) {
|
||||||
((Waterlogged) result).setWaterlogged(false);
|
((Waterlogged) result).setWaterlogged(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void prepareTypeAndData(Map<Block, BlockData> map, Block block, Material type, BlockData blockData, boolean update) {
|
public static void prepareTypeAndData(Map<Block, BlockData> map, Block block, Material type, BlockData blockData, boolean update) {
|
||||||
if (blockData == null) {
|
if (blockData == null) {
|
||||||
@ -1413,8 +1417,10 @@ public class Util extends Queue {
|
|||||||
blockData = createBlockData(type);
|
blockData = createBlockData(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blockData != null) {
|
||||||
block.setBlockData(blockData, update);
|
block.setBlockData(blockData, update);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean successfulQuery(Connection connection, String query) {
|
public static boolean successfulQuery(Connection connection, String query) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user