9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-29 03:59:06 +00:00

Cleanup and prevent crash error

This commit is contained in:
CocoTheOwner
2021-03-09 20:36:05 +01:00
parent d15228656f
commit 34919ec961
4 changed files with 23 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ import org.zeroturnaround.zip.commons.FileUtils;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.Objects;
import java.util.UUID;
@Data
@@ -308,16 +309,16 @@ public class ProjectManager
return cacheListing;
}
JSONArray a = new JSONArray();
JSONArray a;
if(cached)
{
a = new JSONArray(Iris.getCached("cachedlisting", LISTING));
a = new JSONArray(Objects.requireNonNull(Iris.getCached("cachedlisting", LISTING)));
}
else
{
a = new JSONArray(Iris.getNonCached(!cached + "listing", LISTING));
a = new JSONArray(Iris.getNonCached(true + "listing", LISTING));
}
KMap<String, String> l = new KMap<>();
@@ -331,7 +332,7 @@ public class ProjectManager
l.put(v[0], v[1]);
}
catch(Throwable e)
catch(Throwable ignored)
{
}

View File

@@ -150,7 +150,7 @@ public class WandManager implements Listener
{
try
{
if(e.getHand().equals(EquipmentSlot.HAND) && isWand(e.getPlayer().getInventory().getItemInMainHand()))
if(Objects.equals(e.getHand(), EquipmentSlot.HAND) && isWand(e.getPlayer().getInventory().getItemInMainHand()))
{
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK))
{