9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-29 12:09:07 +00:00
This commit is contained in:
Daniel Mills
2020-10-21 10:03:15 -04:00
parent 0a0617c5fc
commit ccdb136b9a
17 changed files with 807 additions and 26 deletions

View File

@@ -238,7 +238,7 @@ public class IrisProject
return new File(path, getName() + ".code-workspace");
}
public void updateWorkspace()
public boolean updateWorkspace()
{
getPath().mkdirs();
File ws = getCodeWorkspaceFile();
@@ -251,6 +251,7 @@ public class IrisProject
IO.writeAll(ws, j.toString(4));
p.end();
Iris.info("Updated Workspace: " + ws.getPath() + " in " + Form.duration(p.getMilliseconds(), 2));
return true;
}
catch(Throwable e)
@@ -267,6 +268,8 @@ public class IrisProject
e1.printStackTrace();
}
}
return false;
}
public JSONObject createCodeWorkspaceConfig()

View File

@@ -91,7 +91,7 @@ public class ProjectManager
catch(IOException e)
{
e.printStackTrace();
}
}

View File

@@ -155,24 +155,32 @@ public class WandManager implements Listener
@EventHandler
public void on(PlayerInteractEvent e)
{
if(e.getHand().equals(EquipmentSlot.HAND) && isWand(e.getPlayer().getInventory().getItemInMainHand()))
try
{
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK))
if(e.getHand().equals(EquipmentSlot.HAND) && isWand(e.getPlayer().getInventory().getItemInMainHand()))
{
e.setCancelled(true);
e.getPlayer().getInventory().setItemInMainHand(update(true, e.getClickedBlock().getLocation(), e.getPlayer().getInventory().getItemInMainHand()));
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_END_PORTAL_FRAME_FILL, 1f, 0.67f);
e.getPlayer().updateInventory();
}
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK))
{
e.setCancelled(true);
e.getPlayer().getInventory().setItemInMainHand(update(true, e.getClickedBlock().getLocation(), e.getPlayer().getInventory().getItemInMainHand()));
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_END_PORTAL_FRAME_FILL, 1f, 0.67f);
e.getPlayer().updateInventory();
}
else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK))
{
e.setCancelled(true);
e.getPlayer().getInventory().setItemInMainHand(update(false, e.getClickedBlock().getLocation(), e.getPlayer().getInventory().getItemInMainHand()));
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_END_PORTAL_FRAME_FILL, 1f, 1.17f);
e.getPlayer().updateInventory();
else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK))
{
e.setCancelled(true);
e.getPlayer().getInventory().setItemInMainHand(update(false, e.getClickedBlock().getLocation(), e.getPlayer().getInventory().getItemInMainHand()));
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_END_PORTAL_FRAME_FILL, 1f, 1.17f);
e.getPlayer().updateInventory();
}
}
}
catch(Throwable ex)
{
}
}
public static void pasteSchematic(IrisObject s, Location at)