mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-29 03:59:06 +00:00
Auto stash before revert of "Flush "
This commit is contained in:
@@ -27,9 +27,6 @@ public class CommandIrisStudio extends MortarCommand
|
||||
@Command
|
||||
private CommandIrisStudioUpdate update;
|
||||
|
||||
//@Command
|
||||
//private CommandIrisStudioMap map;
|
||||
|
||||
@Command
|
||||
private CommandIrisStudioGoto got0;
|
||||
|
||||
@@ -56,10 +53,13 @@ public class CommandIrisStudio extends MortarCommand
|
||||
|
||||
@Command
|
||||
private CommandIrisStudioTPStudio tps;
|
||||
|
||||
|
||||
@Command
|
||||
private CommandIrisStudioConvert convert;
|
||||
|
||||
@Command
|
||||
private CommandIrisStudioMap map;
|
||||
|
||||
public CommandIrisStudio()
|
||||
{
|
||||
super("studio", "std", "s");
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.volmit.iris.manager.command.studio;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.manager.gui.IrisVision;
|
||||
import com.volmit.iris.scaffold.IrisWorlds;
|
||||
import com.volmit.iris.scaffold.engine.IrisAccess;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
@@ -38,9 +39,21 @@ public class CommandIrisStudioMap extends MortarCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisAccess g = Iris.proj.getActiveProject().getActiveProvider();
|
||||
IrisVision.launch(g, 0);
|
||||
sender.sendMessage("Opening Map!");
|
||||
|
||||
try
|
||||
{
|
||||
IrisAccess g = Iris.proj.getActiveProject().getActiveProvider();
|
||||
IrisVision.launch(g, 0);
|
||||
sender.sendMessage("Opening Map!");
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
IrisAccess g = IrisWorlds.access(sender.player().getWorld());
|
||||
IrisVision.launch(g, 0);
|
||||
sender.sendMessage("Opening Map!");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.volmit.iris.manager.command.world;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.pregen.GeneratorQueue;
|
||||
import com.volmit.iris.pregen.Pregenerator;
|
||||
import com.volmit.iris.pregen.queue.QueuedWorld;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.volmit.iris.manager.gui;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import com.volmit.iris.scaffold.engine.Engine;
|
||||
import com.volmit.iris.util.IrisInterpolation;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class IrisRenderer
|
||||
{
|
||||
@@ -31,4 +33,8 @@ public class IrisRenderer
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
public void set(double worldX, double worldZ) {
|
||||
((Engine)renderer).getWorld().getBlockAt((int)worldX, 20, (int)worldZ).setType(Material.DIAMOND_BLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.volmit.iris.manager.gui;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.engine.IrisAccess;
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
@@ -24,6 +26,7 @@ public class IrisVision extends JPanel implements MouseWheelListener
|
||||
private static final long serialVersionUID = 2094606939770332040L;
|
||||
private IrisRenderer renderer;
|
||||
private int posX = 0;
|
||||
private World world;
|
||||
private int posZ = 0;
|
||||
private double scale = 128;
|
||||
private double mscale = 1D;
|
||||
@@ -176,6 +179,26 @@ public class IrisVision extends JPanel implements MouseWheelListener
|
||||
return null;
|
||||
}
|
||||
|
||||
private double getWorldX(double screenX)
|
||||
{
|
||||
return (screenX + oxp) * mscale;
|
||||
}
|
||||
|
||||
private double getWorldZ(double screenZ)
|
||||
{
|
||||
return (screenZ + ozp) * mscale;
|
||||
}
|
||||
|
||||
private double getScreenX(double x)
|
||||
{
|
||||
return (oxp + x) / mscale;
|
||||
}
|
||||
|
||||
private double getScreenZ(double z)
|
||||
{
|
||||
return (ozp + z) / mscale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics gx)
|
||||
{
|
||||
@@ -204,7 +227,7 @@ public class IrisVision extends JPanel implements MouseWheelListener
|
||||
w = getWidth();
|
||||
h = getHeight();
|
||||
double vscale = scale;
|
||||
scale = w / 32D;
|
||||
scale = w / 16D;
|
||||
|
||||
if(scale != vscale)
|
||||
{
|
||||
@@ -257,6 +280,12 @@ public class IrisVision extends JPanel implements MouseWheelListener
|
||||
}
|
||||
}
|
||||
|
||||
for(Player i : world.getPlayers())
|
||||
{
|
||||
g.setColor(Color.getHSBColor(RNG.r.f(), 1f, 1f));
|
||||
g.drawRect((int)getScreenX(i.getLocation().getX()), (int)getScreenZ(i.getLocation().getZ()), 4, 4);
|
||||
}
|
||||
|
||||
if(!isVisible())
|
||||
{
|
||||
return;
|
||||
@@ -279,10 +308,11 @@ public class IrisVision extends JPanel implements MouseWheelListener
|
||||
});
|
||||
}
|
||||
|
||||
private static void createAndShowGUI(Renderer r, int s)
|
||||
private static void createAndShowGUI(Renderer r, int s, World world)
|
||||
{
|
||||
JFrame frame = new JFrame("Vision");
|
||||
IrisVision nv = new IrisVision();
|
||||
nv.world = world;
|
||||
nv.renderer = new IrisRenderer(r);
|
||||
frame.add(nv);
|
||||
frame.setSize(1440, 820);
|
||||
@@ -306,7 +336,7 @@ public class IrisVision extends JPanel implements MouseWheelListener
|
||||
public static void launch(IrisAccess g, int i) {
|
||||
J.a(() ->
|
||||
{
|
||||
createAndShowGUI((x, z) -> g.getEngineAccess(i).draw(x, z), i);
|
||||
createAndShowGUI((x, z) -> g.getEngineAccess(i).draw(x, z), i, g.getCompound().getWorld());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
14
src/main/java/com/volmit/iris/manager/gui/TileRender.java
Normal file
14
src/main/java/com/volmit/iris/manager/gui/TileRender.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.volmit.iris.manager.gui;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
public class TileRender
|
||||
{
|
||||
private BufferedImage image;
|
||||
private int quality;
|
||||
}
|
||||
Reference in New Issue
Block a user