diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..27b3ea2
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 28b5872..ead8f4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-??.java
-?.java
+/bin
+/libs/decompiled
\ No newline at end of file
diff --git a/ChatHook.java b/ChatHook.java
deleted file mode 100644
index 1bad966..0000000
--- a/ChatHook.java
+++ /dev/null
@@ -1,25 +0,0 @@
-import java.util.ArrayList;
-
-
-public class ChatHook {
- protected static ArrayList hooks = new ArrayList();
- public static boolean runhooks(String chat)
- {
- for (int i=0; i hooks = new ArrayList();
-
- public static void addHook(Renderhook hook)
- {
- hooks.add(hook);
- arrhooks = hooks.toArray(new Renderhook[0]);
- }
- public static void delHook(Renderhook hook)
- {
- hooks.remove(hook);
- arrhooks = hooks.toArray(new Renderhook[0]);
- }
- /* (non-Javadoc)
- * @see bu#a(si, double, double, double, float, float)
- */
- @Override
- public void a(si arg0, double arg1, double arg2, double arg3, float arg4, float arg5)
- {
- render(arg5);
- }
-
-}
diff --git a/Renderhook.java b/Renderhook.java
deleted file mode 100644
index 3c766c7..0000000
--- a/Renderhook.java
+++ /dev/null
@@ -1,7 +0,0 @@
-import net.minecraft.client.Minecraft;
-
-
-public interface Renderhook {
- public void worldRender(Minecraft mc, float renderTick);
- //public void unrotatedRender(Minecraft mc, float renderTick);
-}
diff --git a/formatting.xml b/formatting.xml
new file mode 100644
index 0000000..e8eca8f
--- /dev/null
+++ b/formatting.xml
@@ -0,0 +1,266 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libs/ModLoader.zip b/libs/ModLoader.zip
new file mode 100644
index 0000000..b940390
Binary files /dev/null and b/libs/ModLoader.zip differ
diff --git a/libs/SinglePlayerCommands-MC1.6.5v2.9_1.zip b/libs/SinglePlayerCommands-MC1.6.5v2.9_1.zip
new file mode 100644
index 0000000..9b2ffe2
Binary files /dev/null and b/libs/SinglePlayerCommands-MC1.6.5v2.9_1.zip differ
diff --git a/libs/decompile.bat b/libs/decompile.bat
new file mode 100644
index 0000000..e300828
--- /dev/null
+++ b/libs/decompile.bat
@@ -0,0 +1,3 @@
+@echo off
+
+java -jar fernflower.jar minecraft.jar decompiled/
\ No newline at end of file
diff --git a/libs/fernflower.jar b/libs/fernflower.jar
new file mode 100644
index 0000000..76af2d6
Binary files /dev/null and b/libs/fernflower.jar differ
diff --git a/libs/lwjgl.jar b/libs/lwjgl.jar
new file mode 100644
index 0000000..e8441cd
Binary files /dev/null and b/libs/lwjgl.jar differ
diff --git a/libs/minecraft.jar b/libs/minecraft.jar
new file mode 100644
index 0000000..d576050
Binary files /dev/null and b/libs/minecraft.jar differ
diff --git a/mod_Renderhook.java b/mod_Renderhook.java
deleted file mode 100644
index d80a353..0000000
--- a/mod_Renderhook.java
+++ /dev/null
@@ -1,55 +0,0 @@
-import java.util.Map;
-
-import net.minecraft.client.Minecraft;
-
-
-public class mod_Renderhook extends BaseMod {
-
- public mod_Renderhook()
- {
- //ModLoader.getMinecraftInstance().s = new RenderHooks(ModLoader.getMinecraftInstance());
- ModLoader.SetInGameHook(this, true, true); //the last true is because we don't want to iterate the entity list too often
- }
-
- @Override
- public String Version() {
- // TODO Auto-generated method stub
- return "blarg";
- }
- public static fb lastworld = null;
- public static RenderEntity entity;
- public static void spawn(Minecraft mc)
- {
- entity = new RenderEntity(mc, mc.f);
- entity.d(mc.h.aM, mc.h.aN, mc.h.aO);
- mc.f.a((si)entity);
- entity.d(mc.h.aM, mc.h.aN, mc.h.aO);
- System.out.println("spawned render entity");
- }
- public void OnTickInGame(Minecraft mc)
- {
- if(mc.f!= lastworld)
- {
- //do spawny stuff here
-
- spawn(mc);
- lastworld = mc.f;
- }
- /*boolean found = false;
- for(int i=0; i maxBlockX)
- maxBlockX = testBlockX[index] + 1;
-
- if(testBlockX[index] < minBlockX)
- minBlockX = testBlockX[index];
-
- if(testBlockY[index] + 1 > maxBlockY)
- maxBlockY = testBlockY[index] + 1;
-
- if(testBlockY[index] < minBlockY)
- minBlockY = testBlockY[index];
-
- if(testBlockZ[index] + 1 > maxBlockZ)
- maxBlockZ = testBlockZ[index] + 1;
-
- if(testBlockZ[index] < minBlockZ)
- minBlockZ = testBlockZ[index];
- }
- }
-
- //public static void SetHighlight
-
- public static void RegisterHighlight(int id, int x, int y, int z) {
- if(id < testBlockX.length) {
- testBlockX[id] = x;
- testBlockY[id] = y;
- testBlockZ[id] = z;
- if(id>=numHighlights)
- numHighlights=id+1;
- testBlockActive[id]=true;
- RecalcBlockMinMax();
- }
- }
-
- public static void UnregisterHighlight(int x, int y, int z) {
- for(int index = 0; index < numHighlights; index++)
- if(testBlockX[index] == x && testBlockY[index] == y && testBlockZ[index] == z) {
- if(index == numHighlights-1)
- numHighlights--;
-
- /*for(int index2 = index; index2 < numHighlights; index2++) {
- testBlockX[index2] = testBlockX[index2 + 1];
- testBlockY[index2] = testBlockY[index2 + 1];
- testBlockZ[index2] = testBlockZ[index2 + 1];
- }*/
-
- testBlockActive[index]=true;
- RecalcBlockMinMax();
- //return;
- }
- }
-
- public static void UnregisterHighlight(int id) {
- if(id < testBlockX.length) {
- if(id == numHighlights-1)
- numHighlights--;
- testBlockActive[id]=false;
- RecalcBlockMinMax();
- }
- }
-
- public static SelectionType curSelectionType = SelectionType.cuboid;
- public enum SelectionType {
- none,
- cuboid,
- polygon2d
- ;
- }
-
- public static Pattern commandpattern = Pattern.compile("§5§6§4§5([^|]*)\\|?(.*)");
- public static int regionSize=-1;
- // public static Pattern cuboidpattern = Pattern.compile("|([^|]*)|");
- public boolean processChat(String chat) {
- Matcher matcher = commandpattern.matcher(chat);
- //debug
- System.out.println("message: "+chat);
- if(matcher.find())
- {
- //debug
- System.out.println("'"+matcher.group(1)+"' '"+matcher.group(2)+"'");
-
- //handshake
- if(matcher.group(1).equals(""))
- {
- if(ModLoader.getMinecraftInstance().l()) //isMultiplayerWorld
- ModLoader.getMinecraftInstance().h.a("/worldedit cui");
- else
- System.out.println("/worldedit cui");
- }
- //shape
- else
- {
- return handleEvent(matcher.group(1), matcher.group(2).split("\\|"));
- }
- return true;
- }
- return false;
- }
-
- public static boolean handleEvent(String type, String[] params)
- {
- System.out.print("CUI event: "+type+" ");
- for (int i=0; i 0) {
- if(sj1.h == 60) {
- si si1 = a(sj1.i);
-
- if(si1 instanceof lo)
- ((sg)obj).c = (lo)si1;
- }
-
- ((si) (obj)).a((double)sj1.e / 8000D, (double)sj1.f / 8000D, (double)sj1.g / 8000D);
- }
- }
- }
-
- public void a(ey ey1) {
- double d1 = (double)ey1.b / 32D;
- double d2 = (double)ey1.c / 32D;
- double d3 = (double)ey1.d / 32D;
- c c1 = null;
-
- if(ey1.e == 1)
- c1 = new c(((fb) (g)), d1, d2, d3);
-
- if(c1 != null) {
- c1.bI = ey1.b;
- c1.bJ = ey1.c;
- c1.bK = ey1.d;
- c1.aS = 0.0F;
- c1.aT = 0.0F;
- c1.aD = ey1.a;
- g.a(((si) (c1)));
- }
- }
-
- public void a(vl vl1) {
- qq qq1 = new qq(((fb) (g)), vl1.b, vl1.c, vl1.d, vl1.e, vl1.f);
- g.a(vl1.a, ((si) (qq1)));
- }
-
- public void a(gh gh1) {
- si si1 = a(gh1.a);
-
- if(si1 == null) {
- return;
- } else {
- si1.a((double)gh1.b / 8000D, (double)gh1.c / 8000D, (double)gh1.d / 8000D);
- return;
- }
- }
-
- public void a(uq uq1) {
- si si1 = a(uq1.a);
-
- if(si1 != null && uq1.b() != null)
- si1.ad().a(uq1.b());
- }
-
- public void a(me me1) {
- double d1 = (double)me1.c / 32D;
- double d2 = (double)me1.d / 32D;
- double d3 = (double)me1.e / 32D;
- float f1 = (float)(me1.f * 360) / 256F;
- float f2 = (float)(me1.g * 360) / 256F;
- xq xq1 = new xq(f.f, me1.b);
- xq1.aJ = xq1.bl = xq1.bI = me1.c;
- xq1.aK = xq1.bm = xq1.bJ = me1.d;
- xq1.aL = xq1.bn = xq1.bK = me1.e;
- int i = me1.h;
-
- if(i == 0)
- xq1.c.a[xq1.c.c] = null;
- else
- xq1.c.a[xq1.c.c] = new iw(i, 1, 0);
-
- xq1.b(d1, d2, d3, f1, f2);
- g.a(me1.a, ((si) (xq1)));
- }
-
- public void a(rb rb1) {
- si si1 = a(rb1.a);
-
- if(si1 == null) {
- return;
- } else {
- si1.bI = rb1.b;
- si1.bJ = rb1.c;
- si1.bK = rb1.d;
- double d1 = (double)si1.bI / 32D;
- double d2 = (double)si1.bJ / 32D + 0.015625D;
- double d3 = (double)si1.bK / 32D;
- float f1 = (float)(rb1.e * 360) / 256F;
- float f2 = (float)(rb1.f * 360) / 256F;
- si1.a(d1, d2, d3, f1, f2, 3);
- return;
- }
- }
-
- public void a(uc uc1) {
- si si1 = a(uc1.a);
-
- if(si1 == null) {
- return;
- } else {
- si1.bI += ((int) (uc1.b));
- si1.bJ += ((int) (uc1.c));
- si1.bK += ((int) (uc1.d));
- double d1 = (double)si1.bI / 32D;
- double d2 = (double)si1.bJ / 32D;
- double d3 = (double)si1.bK / 32D;
- float f1 = uc1.g ? (float)(uc1.e * 360) / 256F : si1.aS;
- float f2 = uc1.g ? (float)(uc1.f * 360) / 256F : si1.aT;
- si1.a(d1, d2, d3, f1, f2, 3);
- return;
- }
- }
-
- public void a(rq rq1) {
- g.c(rq1.a);
- }
-
- public void a(id id1) {
- da da1 = f.h;
- double d1 = ((gq) (da1)).aM;
- double d2 = ((gq) (da1)).aN;
- double d3 = ((gq) (da1)).aO;
- float f1 = ((gq) (da1)).aS;
- float f2 = ((gq) (da1)).aT;
-
- if(id1.h) {
- d1 = id1.a;
- d2 = id1.b;
- d3 = id1.c;
- }
-
- if(id1.i) {
- f1 = id1.e;
- f2 = id1.f;
- }
-
- da1.bo = 0.0F;
- da1.aP = da1.aQ = da1.aR = 0.0D;
- ((gq) (da1)).b(d1, d2, d3, f1, f2);
- id1.a = ((gq) (da1)).aM;
- id1.b = ((gq) (da1)).aW.b;
- id1.c = ((gq) (da1)).aO;
- id1.d = ((gq) (da1)).aN;
- e.a(((ke) (id1)));
-
- if(!h) {
- f.h.aJ = f.h.aM;
- f.h.aK = f.h.aN;
- f.h.aL = f.h.aO;
- h = true;
- f.a(((cy) (null)));
- }
- }
-
- public void a(rz rz1) {
- g.a(rz1.a, rz1.b, rz1.c);
- }
-
- public void a(wl wl1) {
- li li1 = g.c(wl1.a, wl1.b);
- int i = wl1.a * 16;
- int j = wl1.b * 16;
-
- for(int k = 0; k < wl1.f; k++) {
- short word0 = wl1.c[k];
- int l = wl1.d[k] & 0xff;
- byte byte0 = wl1.e[k];
- int i1 = word0 >> 12 & 0xf;
- int j1 = word0 >> 8 & 0xf;
- int k1 = word0 & 0xff;
- li1.a(i1, k1, j1, l, ((int) (byte0)));
- g.c(i1 + i, k1, j1 + j, i1 + i, k1, j1 + j);
- g.b(i1 + i, k1, j1 + j, i1 + i, k1, j1 + j);
- }
- }
-
- public void a(ed ed1) {
- g.c(ed1.a, ed1.b, ed1.c, (ed1.a + ed1.d) - 1, (ed1.b + ed1.e) - 1, (ed1.c + ed1.f) - 1);
- g.a(ed1.a, ed1.b, ed1.c, ed1.d, ed1.e, ed1.f, ed1.g);
- }
-
- public void a(tq tq1) {
- g.f(tq1.a, tq1.b, tq1.c, tq1.d, tq1.e);
- }
-
- public void a(yi yi1) {
- e.a("disconnect.kicked", new Object[0]);
- d = true;
- f.a(((fb) (null)));
- f.a(((cy) (new ev("disconnect.disconnected", "disconnect.genericReason", new Object[] {
- yi1.a
- }))));
- }
-
- public void a(String s, Object aobj[]) {
- if(d) {
- return;
- } else {
- d = true;
- f.a(((fb) (null)));
- f.a(((cy) (new ev("disconnect.lost", s, aobj))));
- return;
- }
- }
-
- public void a(ke ke) {
- if(d) {
- return;
- } else {
- e.a(ke);
- e.c();
- return;
- }
- }
-
- public void b(ke ke) {
- if(d) {
- return;
- } else {
- e.a(ke);
- return;
- }
- }
-
- public void a(dg dg1) {
- si si1 = a(dg1.a);
- Object obj = ((Object) ((lo)a(dg1.b)));
-
- if(obj == null)
- obj = ((Object) (f.h));
-
- if(si1 != null) {
- g.a(si1, "random.pop", 0.2F, ((c.nextFloat() - c.nextFloat()) * 0.7F + 1.0F) * 2.0F);
- f.j.a(((xn) (new ek(f.f, si1, ((si) (obj)), -0.5F))));
- g.c(dg1.a);
- }
- }
-
- public void a(pa pa1) {
- if(!ChatHook.runhooks(pa1.a))
- f.v.a(pa1.a);
- }
-
- public void a(ni ni1) {
- si si1 = a(ni1.a);
-
- if(si1 == null)
- return;
-
- if(ni1.b == 1) {
- gq gq1 = (gq)si1;
- gq1.J();
- } else if(ni1.b == 2)
- si1.h();
- else if(ni1.b == 3) {
- gq gq2 = (gq)si1;
- gq2.a(false, false, false);
- } else if(ni1.b == 4) {
- gq gq3 = (gq)si1;
- gq3.v();
- }
- }
-
- public void a(jv jv1) {
- si si1 = a(jv1.a);
-
- if(si1 == null)
- return;
-
- if(jv1.e == 0) {
- gq gq1 = (gq)si1;
- gq1.b(jv1.b, jv1.c, jv1.d);
- }
- }
-
- public void a(ml ml1) {
- if(ml1.a.equals("-"))
- b(((ke) (new nv(f.k.b, 13))));
- else
- try {
- URL url = new URL((new StringBuilder()).append("http://www.minecraft.net/game/joinserver.jsp?user=").append(f.k.b).append("&sessionId=").append(f.k.c).append("&serverId=").append(ml1.a).toString());
- BufferedReader bufferedreader = new BufferedReader(((java.io.Reader) (new InputStreamReader(url.openStream()))));
- String s = bufferedreader.readLine();
- bufferedreader.close();
-
- if(s.equalsIgnoreCase("ok"))
- b(((ke) (new nv(f.k.b, 13))));
- else
- e.a("disconnect.loginFailedInfo", new Object[] {
- s
- });
- } catch(Exception exception) {
- exception.printStackTrace();
- e.a("disconnect.genericReason", new Object[] {
- (new StringBuilder()).append("Internal client error: ").append(exception.toString()).toString()
- });
- }
- }
-
- public void b() {
- d = true;
- e.a();
- e.a("disconnect.closed", new Object[0]);
- }
-
- public void a(jj jj1) {
- double d1 = (double)jj1.c / 32D;
- double d2 = (double)jj1.d / 32D;
- double d3 = (double)jj1.e / 32D;
- float f1 = (float)(jj1.f * 360) / 256F;
- float f2 = (float)(jj1.g * 360) / 256F;
- lo lo1 = (lo)iz.a(((int) (jj1.b)), f.f);
- lo1.bI = jj1.c;
- lo1.bJ = jj1.d;
- lo1.bK = jj1.e;
- lo1.aD = jj1.a;
- lo1.b(d1, d2, d3, f1, f2);
- lo1.V = true;
- g.a(jj1.a, ((si) (lo1)));
- java.util.List list = jj1.b();
-
- if(list != null)
- lo1.ad().a(list);
- }
-
- public void a(he he1) {
- f.f.a(he1.a);
- }
-
- public void a(qx qx1) {
- f.h.a(new bp(qx1.a, qx1.b, qx1.c));
- f.f.x().a(qx1.a, qx1.b, qx1.c);
- }
-
- public void a(no no1) {
- Object obj = ((Object) (a(no1.a)));
- si si1 = a(no1.b);
-
- if(no1.a == f.h.aD)
- obj = ((Object) (f.h));
-
- if(obj == null) {
- return;
- } else {
- ((si) (obj)).i(si1);
- return;
- }
- }
-
- public void a(jc jc1) {
- si si1 = a(jc1.a);
-
- if(si1 != null)
- si1.a(jc1.b);
- }
-
- private si a(int i) {
- if(i == f.h.aD)
- return ((si) (f.h));
- else
- return g.b(i);
- }
-
- public void a(es es1) {
- f.h.b_(es1.a);
- }
-
- public void a(ot ot1) {
- if(ot1.a != f.h.m) {
- h = false;
- g = new mi(this, g.x().b(), ((int) (ot1.a)));
- g.B = true;
- f.a(((fb) (g)));
- f.h.m = ((int) (ot1.a));
- f.a(((cy) (new ge(this))));
- }
-
- f.a(true, ((int) (ot1.a)));
- }
-
- public void a(rh rh1) {
- qs qs1 = new qs(f.f, ((si) (null)), rh1.a, rh1.b, rh1.c, rh1.d);
- qs1.g = rh1.e;
- qs1.a(true);
- }
-
- public void a(it it1) {
- if(it1.b == 0) {
- qk qk1 = new qk(it1.c, it1.d);
- f.h.a(((ls) (qk1)));
- f.h.e.f = it1.a;
- } else if(it1.b == 2) {
- sf sf1 = new sf();
- f.h.a(sf1);
- f.h.e.f = it1.a;
- } else if(it1.b == 3) {
- ay ay1 = new ay();
- f.h.a(ay1);
- f.h.e.f = it1.a;
- } else if(it1.b == 1) {
- da da1 = f.h;
- f.h.a(ik.b(((gq) (da1)).aM), ik.b(((gq) (da1)).aN), ik.b(((gq) (da1)).aO));
- f.h.e.f = it1.a;
- }
- }
-
- public void a(ho ho1) {
- if(ho1.a == -1)
- f.h.c.b(ho1.c);
- else if(ho1.a == 0 && ho1.b >= 36 && ho1.b < 45) {
- iw iw1 = f.h.d.b(ho1.b).a();
-
- if(ho1.c != null && (iw1 == null || iw1.a < ho1.c.a))
- ho1.c.b = 5;
-
- f.h.d.a(ho1.b, ho1.c);
- } else if(ho1.a == f.h.e.f)
- f.h.e.a(ho1.b, ho1.c);
- }
-
- public void a(of of1) {
- du du1 = null;
-
- if(of1.a == 0)
- du1 = f.h.d;
- else if(of1.a == f.h.e.f)
- du1 = f.h.e;
-
- if(du1 != null)
- if(of1.c) {
- du1.a(of1.b);
- } else {
- du1.b(of1.b);
- b(((ke) (new of(of1.a, of1.b, true))));
- }
- }
-
- public void a(jx jx1) {
- if(jx1.a == 0)
- f.h.d.a(jx1.b);
- else if(jx1.a == f.h.e.f)
- f.h.e.a(jx1.b);
- }
-
- public void a(ud ud1) {
- if(f.f.i(ud1.a, ud1.b, ud1.c)) {
- os os = f.f.b(ud1.a, ud1.b, ud1.c);
-
- if(os instanceof yb) {
- yb yb1 = (yb)os;
-
- for(int i = 0; i < 4; i++)
- yb1.a[i] = ud1.d[i];
-
- yb1.y_();
- }
- }
- }
-
- public void a(mr mr1) {
- c(((ke) (mr1)));
-
- if(f.h.e != null && f.h.e.f == mr1.a)
- f.h.e.a(mr1.b, mr1.c);
- }
-
- public void a(r r1) {
- si si1 = a(r1.a);
-
- if(si1 != null)
- si1.c(r1.b, r1.c, r1.d);
- }
-
- public void a(mj mj) {
- f.h.r();
- }
-
- public void a(vo vo1) {
- f.f.d(vo1.a, vo1.b, vo1.c, vo1.d, vo1.e);
- }
-
- public void a(by by1) {
- int i = by1.b;
-
- if(i >= 0 && i < by.a.length && by.a[i] != null)
- f.h.b(by.a[i]);
-
- if(i == 1) {
- g.x().b(true);
- g.h(1.0F);
- } else if(i == 2) {
- g.x().b(false);
- g.h(0.0F);
- }
- }
-
- public void a(ah ah1) {
- if(ah1.a == gk.bb.be)
- wi.a(ah1.b, f.f).a(ah1.c);
- else
- System.out.println((new StringBuilder()).append("Unknown itemid: ").append(((int) (ah1.b))).toString());
- }
-
- public void a(fl fl1) {
- f.f.e(fl1.a, fl1.c, fl1.d, fl1.e, fl1.b);
- }
-
- public void a(ob ob1) {
- ((tf)f.h).b(ji.a(ob1.a), ob1.b);
- }
-
- public boolean c() {
- return false;
- }
-}
diff --git a/releases/WorldEditCui_1.7_01.zip b/releases/WorldEditCui_1.7_01.zip
new file mode 100644
index 0000000..c2221b6
Binary files /dev/null and b/releases/WorldEditCui_1.7_01.zip differ
diff --git a/releases/WorldEditCui_1.7_01v2.zip b/releases/WorldEditCui_1.7_01v2.zip
new file mode 100644
index 0000000..5dcb384
Binary files /dev/null and b/releases/WorldEditCui_1.7_01v2.zip differ
diff --git a/spc_WorldEditCUI.java b/spc_WorldEditCUI.java
deleted file mode 100644
index 9cc9274..0000000
--- a/spc_WorldEditCUI.java
+++ /dev/null
@@ -1,15 +0,0 @@
-public class spc_WorldEditCUI extends SPCPlugin {
- @Override
- public String getVersion() {
- return "1.5_01";
- }
- @Override
- public String getName()
- {
- return "WorldEditCUI";
- }
- @Override
- public void handleCUIEvent(String type, String params[]) {
- mod_WorldEditCUI.handleEvent( type, params);
- }
-}
\ No newline at end of file
diff --git a/src/ChatHook.java b/src/ChatHook.java
new file mode 100644
index 0000000..93edfd0
--- /dev/null
+++ b/src/ChatHook.java
@@ -0,0 +1,22 @@
+import java.util.ArrayList;
+
+public class ChatHook {
+ protected static ArrayList hooks = new ArrayList();
+
+ public static boolean runhooks(String chat) {
+ for (int i = 0; i < hooks.size(); i++) {
+ if (hooks.get(i).processChat(chat)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static void addHook(ChatHookable hook) {
+ hooks.add(hook);
+ }
+
+ public static void delHook(ChatHookable hook) {
+ hooks.remove(hook);
+ }
+}
diff --git a/src/ChatHookable.java b/src/ChatHookable.java
new file mode 100644
index 0000000..9437a52
--- /dev/null
+++ b/src/ChatHookable.java
@@ -0,0 +1,3 @@
+public interface ChatHookable {
+ public boolean processChat(String chat);
+}
diff --git a/src/RenderEntity.java b/src/RenderEntity.java
new file mode 100644
index 0000000..2e826ae
--- /dev/null
+++ b/src/RenderEntity.java
@@ -0,0 +1,46 @@
+import net.minecraft.client.Minecraft;
+
+/**
+ *
+ */
+
+/**
+ * @author lahwran
+ *
+ */
+public class RenderEntity extends sn {
+
+ Minecraft mc;
+
+ /**
+ * @param arg0
+ */
+ public RenderEntity(Minecraft mc, fd arg0) {
+ super(arg0);
+ bM = true; // ignoreFrustumCheck \o/
+ // Do not run debug messages on a live compile!
+ if(mod_WorldEditCUI.WORLDEDIT_CUI_DEBUG) System.out.println("Entity spawned");
+ this.mc = mc;
+ }
+
+ @Override
+ protected void a(nu arg0) {
+ } // Entity.readEntityFromNBT
+
+ @Override
+ protected void b() {
+ } // Entity.entityInit
+
+ @Override
+ protected void b(nu arg0) {
+ }
+
+ @Override
+ public void w_() {
+ this.d(mc.h.aM, mc.h.aN, mc.h.aO);
+ }
+
+ @Override
+ public void K() {
+ }
+}
diff --git a/src/RenderHooks.java b/src/RenderHooks.java
new file mode 100644
index 0000000..5ba88c2
--- /dev/null
+++ b/src/RenderHooks.java
@@ -0,0 +1,41 @@
+import java.util.ArrayList;
+
+import net.minecraft.client.Minecraft;
+
+import org.lwjgl.opengl.GL11;
+
+public class RenderHooks extends bw {
+
+ @SuppressWarnings("static-access")
+ public void render(float renderTick) {
+ ((u) null).a();
+ if (arrhooks == null) {
+ arrhooks = hooks.toArray(new Renderhook[0]);
+ }
+ Minecraft game = ModLoader.getMinecraftInstance();
+ for (int i = 0; i < arrhooks.length; i++) {
+ GL11.glColor3f(1.0f, 1.0f, 1.0f);
+ arrhooks[i].worldRender(game, renderTick);
+ }
+ ((u) null).b();
+ }
+
+ protected static Renderhook[] arrhooks;
+ protected static ArrayList hooks = new ArrayList();
+
+ public static void addHook(Renderhook hook) {
+ hooks.add(hook);
+ arrhooks = hooks.toArray(new Renderhook[0]);
+ }
+
+ public static void delHook(Renderhook hook) {
+ hooks.remove(hook);
+ arrhooks = hooks.toArray(new Renderhook[0]);
+ }
+
+ @Override
+ public void a(sn arg0, double arg1, double arg2, double arg3, float arg4, float arg5) {
+ render(arg5);
+ }
+
+}
diff --git a/src/Renderhook.java b/src/Renderhook.java
new file mode 100644
index 0000000..6d35d33
--- /dev/null
+++ b/src/Renderhook.java
@@ -0,0 +1,6 @@
+import net.minecraft.client.Minecraft;
+
+public interface Renderhook {
+ public void worldRender(Minecraft mc, float renderTick);
+ // public void unrotatedRender(Minecraft mc, float renderTick);
+}
diff --git a/src/mod_Renderhook.java b/src/mod_Renderhook.java
new file mode 100644
index 0000000..cf59b72
--- /dev/null
+++ b/src/mod_Renderhook.java
@@ -0,0 +1,48 @@
+import java.util.Map;
+
+import net.minecraft.client.Minecraft;
+
+public class mod_Renderhook extends BaseMod {
+
+ public mod_Renderhook() {
+ // ModLoader.getMinecraftInstance().s = new
+ // RenderHooks(ModLoader.getMinecraftInstance());
+ ModLoader.SetInGameHook(this, true, true); // the last true is because
+ // we don't want to iterate
+ // the entity list too often
+ }
+
+ @Override
+ public String Version() {
+ return "1.7_01";
+ }
+
+ public static fd lastworld = null;
+ public static RenderEntity entity;
+
+ public static void spawn(Minecraft mc) {
+ entity = new RenderEntity(mc, mc.f);
+ entity.d(mc.h.aM, mc.h.aN, mc.h.aO);
+ mc.f.a((sn) entity);
+ entity.d(mc.h.aM, mc.h.aN, mc.h.aO);
+ // Do not run debug messages on a live compile!
+ if(mod_WorldEditCUI.WORLDEDIT_CUI_DEBUG) System.out.println("spawned render entity");
+ }
+
+ public boolean OnTickInGame(Minecraft mc) {
+ if (mc.f != lastworld) {
+ // do spawny stuff here
+ spawn(mc);
+ lastworld = mc.f;
+ }
+ return true;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void AddRenderer(Map map) {
+ // Do not run debug messages on a live compile!
+ if(mod_WorldEditCUI.WORLDEDIT_CUI_DEBUG) System.out.println("Attaching worldeditcui renderer");
+ map.put(RenderEntity.class, new RenderHooks());
+ }
+}
diff --git a/src/mod_WorldEditCUI.java b/src/mod_WorldEditCUI.java
new file mode 100644
index 0000000..ce2431f
--- /dev/null
+++ b/src/mod_WorldEditCUI.java
@@ -0,0 +1,443 @@
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import net.minecraft.client.Minecraft;
+
+import org.lwjgl.opengl.GL11;
+
+public class mod_WorldEditCUI extends BaseMod implements Renderhook, ChatHookable {
+
+ public static final boolean WORLDEDIT_CUI_DEBUG = false;
+
+ public static int testBlockX[] = new int[2];
+ public static int testBlockY[] = new int[2];
+ public static int testBlockZ[] = new int[2];
+ public static boolean testBlockActive[] = new boolean[2];
+ public static int numHighlights = 0;
+ public static int maxBlockX;
+ public static int maxBlockY;
+ public static int maxBlockZ;
+ public static int minBlockX;
+ public static int minBlockY;
+ public static int minBlockZ;
+ // public static qk highlightedBlock;
+ public double curRenderTick;
+
+ public mod_WorldEditCUI() {
+ // ModLoader.SetInGameHook(this, true, false);+
+ RenderHooks.addHook(this);
+ ChatHook.addHook(this);
+ ModLoader.SetInGameHook(this, true, false);
+ }
+
+ public String Version() {
+ return "1.7_01";
+ }
+
+ private void drawBoundingBox(float red, float green, float blue, float alpha, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
+ nw tessellator = nw.a;
+
+ // Draw bottom face using LineStrip
+ tessellator.a(3);
+ tessellator.a(red, green, blue, alpha);
+ tessellator.a(minX, minY, minZ);
+ tessellator.a(maxX, minY, minZ);
+ tessellator.a(maxX, minY, maxZ);
+ tessellator.a(minX, minY, maxZ);
+ tessellator.a(minX, minY, minZ);
+ tessellator.a();
+
+ // Draw top face using LineStrip
+ tessellator.a(3);
+ tessellator.a(red, green, blue, alpha);
+ tessellator.a(minX, maxY, minZ);
+ tessellator.a(maxX, maxY, minZ);
+ tessellator.a(maxX, maxY, maxZ);
+ tessellator.a(minX, maxY, maxZ);
+ tessellator.a(minX, maxY, minZ);
+ tessellator.a();
+
+ // Draw join top and bottom faces using LineList
+ tessellator.a(1);
+ tessellator.a(red, green, blue, alpha);
+
+ tessellator.a(minX, minY, minZ);
+ tessellator.a(minX, maxY, minZ);
+
+ tessellator.a(maxX, minY, minZ);
+ tessellator.a(maxX, maxY, minZ);
+
+ tessellator.a(maxX, minY, maxZ);
+ tessellator.a(maxX, maxY, maxZ);
+
+ tessellator.a(minX, minY, maxZ);
+ tessellator.a(minX, maxY, maxZ);
+
+ tessellator.a();
+ }
+
+ private void drawLatticeBox(float red, float green, float blue, float alpha, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
+ nw tessellator = nw.a;
+ tessellator.a(1);
+ tessellator.a(red, green, blue, alpha);
+ // XY plane
+ double offsetsize = 1f;
+ for (double xoffset = 0; ((double) xoffset + minX) <= maxX; xoffset += offsetsize) {
+ for (double yoffset = 0; ((double) yoffset + minY) <= maxY; yoffset += offsetsize) {
+ tessellator.a(((double) xoffset + minX), ((double) yoffset + minY), minZ);
+ tessellator.a(((double) xoffset + minX), ((double) yoffset + minY), maxZ);
+ }
+ }
+ // XZ plane
+ for (double xoffset = 0; ((double) xoffset + minX) <= maxX; xoffset += offsetsize) {
+ for (double zoffset = 0; ((double) zoffset + minZ) <= maxZ; zoffset += offsetsize) {
+ tessellator.a(((double) xoffset + minX), minY, ((double) zoffset + minZ));
+ tessellator.a(((double) xoffset + minX), maxY, ((double) zoffset + minZ));
+ }
+ }
+ // YZ
+ for (double yoffset = 0; ((double) yoffset + minY) <= maxY; yoffset += offsetsize) {
+ for (double zoffset = 0; ((double) zoffset + minZ) <= maxZ; zoffset += offsetsize) {
+ tessellator.a(minX, ((double) yoffset + minY), ((double) zoffset + minZ));
+ tessellator.a(maxX, ((double) yoffset + minY), ((double) zoffset + minZ));
+ }
+ }
+ tessellator.a();
+ }
+
+ private void drawGridSurface(float red, float green, float blue, float alpha, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
+ nw tessellator = nw.a;
+ tessellator.a(1);
+ tessellator.a(red, green, blue, alpha);
+ double x, y, z;
+ double offsetSize = 1.0;
+
+ // Zmax XY plane, y axis
+ z = maxZ;
+ y = minY;
+ int msize = 150;
+ if ((maxY - y / offsetSize) < msize)
+ for (double yoff = 0; yoff + y <= maxY; yoff += offsetSize) {
+ tessellator.a(minX, y + yoff, z);
+ tessellator.a(maxX, y + yoff, z);
+ }
+
+ // Zmin XY plane, y axis
+ z = minZ;
+ if ((maxY - y / offsetSize) < msize)
+ for (double yoff = 0; yoff + y <= maxY; yoff += offsetSize) {
+ tessellator.a(minX, y + yoff, z);
+ tessellator.a(maxX, y + yoff, z);
+ }
+
+ // Xmin YZ plane, y axis
+ x = minX;
+ if ((maxY - y / offsetSize) < msize)
+ for (double yoff = 0; yoff + y <= maxY; yoff += offsetSize) {
+ tessellator.a(x, y + yoff, minZ);
+ tessellator.a(x, y + yoff, maxZ);
+ }
+
+ // Xmax YZ plane, y axis
+ x = maxX;
+ if ((maxY - y / offsetSize) < msize)
+ for (double yoff = 0; yoff + y <= maxY; yoff += offsetSize) {
+ tessellator.a(x, y + yoff, minZ);
+ tessellator.a(x, y + yoff, maxZ);
+ }
+
+ // Zmin XY plane, x axis
+ x = minX;
+ z = minZ;
+ if ((maxX - x / offsetSize) < msize)
+ for (double xoff = 0; xoff + x <= maxX; xoff += offsetSize) {
+ tessellator.a(x + xoff, minY, z);
+ tessellator.a(x + xoff, maxY, z);
+ }
+ // Zmax XY plane, x axis
+ z = maxZ;
+ if ((maxX - x / offsetSize) < msize)
+ for (double xoff = 0; xoff + x <= maxX; xoff += offsetSize) {
+ tessellator.a(x + xoff, minY, z);
+ tessellator.a(x + xoff, maxY, z);
+ }
+ // Ymin XZ plane, x axis
+ y = maxY;
+ if ((maxX - x / offsetSize) < msize)
+ for (double xoff = 0; xoff + x <= maxX; xoff += offsetSize) {
+ tessellator.a(x + xoff, y, minZ);
+ tessellator.a(x + xoff, y, maxZ);
+ }
+ // Ymax XZ plane, x axis
+ y = minY;
+ if ((maxX - x / offsetSize) < msize)
+ for (double xoff = 0; xoff + x <= maxX; xoff += offsetSize) {
+ tessellator.a(x + xoff, y, minZ);
+ tessellator.a(x + xoff, y, maxZ);
+ }
+
+ // Ymin XZ plane, z axis
+ z = minZ;
+ y = minY;
+ if ((maxZ - z / offsetSize) < msize)
+ for (double zoff = 0; zoff + z <= maxZ; zoff += offsetSize) {
+ tessellator.a(minX, y, z + zoff);
+ tessellator.a(maxX, y, z + zoff);
+ }
+ // Ymax XZ plane, z axis
+ y = maxY;
+ if ((maxZ - z / offsetSize) < msize)
+ for (double zoff = 0; zoff + z <= maxZ; zoff += offsetSize) {
+ tessellator.a(minX, y, z + zoff);
+ tessellator.a(maxX, y, z + zoff);
+ }
+ // Xmin YZ plane, z axis
+ x = maxX;
+ if ((maxZ - z / offsetSize) < msize)
+ for (double zoff = 0; zoff + z <= maxZ; zoff += offsetSize) {
+ tessellator.a(x, minY, z + zoff);
+ tessellator.a(x, maxY, z + zoff);
+ }
+ // Xmax YZ plane, z axis
+ x = minX;
+ if ((maxZ - z / offsetSize) < msize)
+ for (double zoff = 0; zoff + z <= maxZ; zoff += offsetSize) {
+ tessellator.a(x, minY, z + zoff);
+ tessellator.a(x, maxY, z + zoff);
+ }
+
+ tessellator.a();
+ }
+
+ private void renderColouredBoundingBox(Minecraft mc, float red, float green, float blue, float alpha, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
+ double playerPosX, playerPosY, playerPosZ;
+ playerPosX = mc.h.aJ + ((mc.h.aM - mc.h.aJ) * curRenderTick);
+ playerPosY = mc.h.aK + ((mc.h.aN - mc.h.aK) * curRenderTick);
+ playerPosZ = mc.h.aL + ((mc.h.aO - mc.h.aL) * curRenderTick);
+ drawBoundingBox(red, green, blue, alpha, minX - 0.002D - playerPosX, minY - 0.002D - playerPosY, minZ - 0.002D - playerPosZ, (maxX + 0.002D) - playerPosX, (maxY + 0.002D) - playerPosY, (maxZ + 0.002D) - playerPosZ);
+
+ }
+
+ private void renderColoredGridSurface(Minecraft mc, float red, float green, float blue, float alpha, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
+ double playerPosX, playerPosY, playerPosZ;
+ playerPosX = mc.h.aJ + ((mc.h.aM - mc.h.aJ) * curRenderTick);
+ playerPosY = mc.h.aK + ((mc.h.aN - mc.h.aK) * curRenderTick);
+ playerPosZ = mc.h.aL + ((mc.h.aO - mc.h.aL) * curRenderTick);
+ drawGridSurface(red, green, blue, alpha, minX - playerPosX, minY - playerPosY, minZ - playerPosZ, maxX - playerPosX, maxY - playerPosY, maxZ - playerPosZ);
+
+ }
+
+ @SuppressWarnings("unused")
+ private void renderColoredLatticeBox(Minecraft mc, float red, float green, float blue, float alpha, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
+ double playerPosX, playerPosY, playerPosZ;
+ playerPosX = mc.h.aJ + ((mc.h.aM - mc.h.aJ) * curRenderTick);
+ playerPosY = mc.h.aK + ((mc.h.aN - mc.h.aK) * curRenderTick);
+ playerPosZ = mc.h.aL + ((mc.h.aO - mc.h.aL) * curRenderTick);
+ drawLatticeBox(red, green, blue, alpha, minX - playerPosX, minY - playerPosY, minZ - playerPosZ, maxX - playerPosX, maxY - playerPosY, maxZ - playerPosZ);
+
+ }
+
+ private void renderBoundingBoxes(Minecraft mc, float[]... colors) {
+ /*
+ * GL11.glDisable(3008); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); GL11.glLineWidth(4F); GL11.glDisable(3553); GL11.glDepthMask(false); GL11.glDisable(2929);
+ */
+
+ for (int index = 0; index < numHighlights; index++) {
+ if (!testBlockActive[index])
+ continue;
+ int myBlockMinX = testBlockX[index];
+ int myBlockMinY = testBlockY[index];
+ int myBlockMinZ = testBlockZ[index];
+ int myBlockMaxX = testBlockX[index] + 1;
+ int myBlockMaxY = testBlockY[index] + 1;
+ int myBlockMaxZ = testBlockZ[index] + 1;
+ renderColouredBoundingBox(mc, colors[index][0], colors[index][1], colors[index][2], colors[index][3], myBlockMinX, myBlockMinY, myBlockMinZ, myBlockMaxX, myBlockMaxY, myBlockMaxZ);
+ }
+
+ /*
+ * GL11.glEnable(2929); GL11.glDepthMask(true); GL11.glEnable(3553); GL11.glDisable(3042); GL11.glEnable(3008);
+ */
+ }
+
+ public static final float[] greenuppercolor = new float[] { 0.2f, 0.8f, 0.2f, 0.5f };
+ public static final float[] blueuppercolor = new float[] { 0.2f, 0.2f, 0.8f, 0.5f };
+ public static final float[] greenlowercolor = new float[] { 0.2f, 0.8f, 0.2f, 0.7f };
+ public static final float[] bluelowercolor = new float[] { 0.2f, 0.2f, 0.8f, 0.7f };
+
+ public void worldRender(Minecraft mc, float renderTick) {
+ curRenderTick = (double) renderTick;
+ GL11.glBlendFunc(770 /* GL_SRC_ALPHA */, 771 /* GL_ONE_MINUS_SRC_ALPHA */);
+ GL11.glLineWidth(2F);
+ GL11.glEnable(3042 /* GL_BLEND */);
+ GL11.glDisable(3008 /* GL_ALPHA_TEST */);
+ GL11.glDisable(3553 /* GL_TEXTURE_2D */);
+ GL11.glDepthMask(false);
+ // GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
+ GL11.glDepthFunc(GL11.GL_GEQUAL);
+ renderColouredBoundingBox(mc, 0.4F, 0.1F, 0.1F, 0.2f, minBlockX, minBlockY, minBlockZ, maxBlockX, maxBlockY, maxBlockZ);
+ renderColoredGridSurface(mc, 0.4F, 0.1F, 0.1F, 0.1f, minBlockX, minBlockY, minBlockZ, maxBlockX, maxBlockY, maxBlockZ);
+ renderBoundingBoxes(mc, greenuppercolor, blueuppercolor);
+
+ // GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
+ GL11.glDepthMask(true);
+ GL11.glDepthFunc(GL11.GL_LESS);
+ GL11.glLineWidth(3F);
+ renderColouredBoundingBox(mc, 0.8F, 0.2F, 0.2F, 1.0f, minBlockX, minBlockY, minBlockZ, maxBlockX, maxBlockY, maxBlockZ);
+ renderColoredGridSurface(mc, 0.8F, 0.2F, 0.2F, 0.2f, minBlockX, minBlockY, minBlockZ, maxBlockX, maxBlockY, maxBlockZ);
+ renderBoundingBoxes(mc, greenlowercolor, bluelowercolor);
+
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ GL11.glDisable(2929 /* GL_DEPTH_TEST */);
+
+ GL11.glEnable(2929 /* GL_DEPTH_TEST */);
+ GL11.glEnable(3553 /* GL_TEXTURE_2D */);
+ GL11.glDisable(3042 /* GL_BLEND */);
+ GL11.glEnable(3008 /* GL_ALPHA_TEST */);
+
+ }
+
+ private static void RecalcBlockMinMax() {
+ minBlockX = 0x1e84800;
+ minBlockY = 0x1e84800;
+ minBlockZ = 0x1e84800;
+ maxBlockX = 0xfe17b800;
+ maxBlockY = 0xfe17b800;
+ maxBlockZ = 0xfe17b800;
+
+ for (int index = 0; index < numHighlights; index++) {
+ if (!testBlockActive[index])
+ continue;
+ if (testBlockX[index] + 1 > maxBlockX)
+ maxBlockX = testBlockX[index] + 1;
+
+ if (testBlockX[index] < minBlockX)
+ minBlockX = testBlockX[index];
+
+ if (testBlockY[index] + 1 > maxBlockY)
+ maxBlockY = testBlockY[index] + 1;
+
+ if (testBlockY[index] < minBlockY)
+ minBlockY = testBlockY[index];
+
+ if (testBlockZ[index] + 1 > maxBlockZ)
+ maxBlockZ = testBlockZ[index] + 1;
+
+ if (testBlockZ[index] < minBlockZ)
+ minBlockZ = testBlockZ[index];
+ }
+ }
+
+ // public static void SetHighlight
+
+ public static void RegisterHighlight(int id, int x, int y, int z) {
+ if (id < testBlockX.length) {
+ testBlockX[id] = x;
+ testBlockY[id] = y;
+ testBlockZ[id] = z;
+ if (id >= numHighlights)
+ numHighlights = id + 1;
+ testBlockActive[id] = true;
+ RecalcBlockMinMax();
+ }
+ }
+
+ public static void UnregisterHighlight(int x, int y, int z) {
+ for (int index = 0; index < numHighlights; index++)
+ if (testBlockX[index] == x && testBlockY[index] == y && testBlockZ[index] == z) {
+ if (index == numHighlights - 1)
+ numHighlights--;
+
+ /*
+ * for(int index2 = index; index2 < numHighlights; index2++) { testBlockX[index2] = testBlockX[index2 + 1]; testBlockY[index2] = testBlockY[index2 + 1]; testBlockZ[index2] =
+ * testBlockZ[index2 + 1]; }
+ */
+
+ testBlockActive[index] = true;
+ RecalcBlockMinMax();
+ // return;
+ }
+ }
+
+ public static void UnregisterHighlight(int id) {
+ if (id < testBlockX.length) {
+ if (id == numHighlights - 1)
+ numHighlights--;
+ testBlockActive[id] = false;
+ RecalcBlockMinMax();
+ }
+ }
+
+ public static SelectionType curSelectionType = SelectionType.cuboid;
+
+ public enum SelectionType {
+ none, cuboid, polygon2d;
+ }
+
+ public static Pattern commandpattern = Pattern.compile("\u00a75\u00a76\u00a74\u00a75([^|]*)\\|?(.*)");
+ public static int regionSize = -1;
+
+ // public static Pattern cuboidpattern = Pattern.compile("|([^|]*)|");
+ public boolean processChat(String chat) {
+ Matcher matcher = commandpattern.matcher(chat);
+ // debug
+ if(WORLDEDIT_CUI_DEBUG) System.out.println("message: " + chat);
+ if (matcher.find()) {
+ // debug
+ if(WORLDEDIT_CUI_DEBUG) System.out.println("'" + matcher.group(1) + "' '" + matcher.group(2) + "'");
+
+ // handshake
+ if (matcher.group(1).equals("")) {
+ if (ModLoader.getMinecraftInstance().l()) {// isMultiplayerWorld
+ ModLoader.getMinecraftInstance().h.a("/worldedit cui");
+ } else {
+ if(WORLDEDIT_CUI_DEBUG) System.out.println("/worldedit cui");
+ }
+ }
+ // shape
+ else {
+ return handleEvent(matcher.group(1), matcher.group(2).split("\\|"));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean handleEvent(String type, String[] params) {
+ if(WORLDEDIT_CUI_DEBUG) System.out.print("CUI event: " + type + " ");
+ for (int i = 0; i < params.length; i++) {
+ if(WORLDEDIT_CUI_DEBUG) System.out.print(params[i] + " ");
+ }
+ if(WORLDEDIT_CUI_DEBUG) System.out.println();
+ if (type.equals("s")) {
+ if (params.length == 0) {
+ return false;
+ }
+ if (params[0].equals("cuboid")) {
+ curSelectionType = SelectionType.cuboid;
+ } else if (params[0].equals("polygon2d")) {
+ curSelectionType = SelectionType.polygon2d;
+ }
+ for (int index = 0; index < numHighlights; index++) {
+ testBlockActive[index] = false;
+ }
+ numHighlights = 0;
+ RecalcBlockMinMax();
+ return true;
+ }
+ // point
+ else if (type.equals("p")) {
+ if (params.length == 0) {
+ return false;
+ }
+
+ int id = (int) Float.parseFloat(params[0]);
+ RegisterHighlight(id, (int) Float.parseFloat(params[1]), (int) Float.parseFloat(params[2]), (int) Float.parseFloat(params[3]));
+ regionSize = (int) Float.parseFloat(params[4]);
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
+}
diff --git a/src/nb.java b/src/nb.java
new file mode 100644
index 0000000..f08b9e0
--- /dev/null
+++ b/src/nb.java
@@ -0,0 +1,629 @@
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.List;
+import java.util.Random;
+
+import net.minecraft.client.Minecraft;
+
+public class nb extends ti {
+
+ private boolean d = false;
+ private pf e;
+ public String a;
+ private Minecraft f;
+ private mm g;
+ private boolean h = false;
+ public hc b = new hc((wt) null);
+ Random c = new Random();
+
+ public nb(Minecraft var1, String var2, int var3) throws UnknownHostException, IOException {
+ this.f = var1;
+ Socket var4 = new Socket(InetAddress.getByName(var2), var3);
+ this.e = new pf(var4, "Client", this);
+ }
+
+ public void a() {
+ if (!this.d) {
+ this.e.b();
+ }
+
+ this.e.a();
+ }
+
+ public void a(nz var1) {
+ this.f.c = new xk(this.f, this);
+ this.f.I.a(jl.i, 1);
+ this.g = new mm(this, var1.c, var1.d);
+ this.g.B = true;
+ this.f.a((fd) this.g);
+ this.f.h.m = var1.d;
+ this.f.a((da) (new gg(this)));
+ this.f.h.aD = var1.a;
+ }
+
+ public void a(nd var1) {
+ double var2 = (double) var1.b / 32.0D;
+ double var4 = (double) var1.c / 32.0D;
+ double var6 = (double) var1.d / 32.0D;
+ hl var8 = new hl(this.g, var2, var4, var6, new iz(var1.h, var1.i, var1.l));
+ var8.aP = (double) var1.e / 128.0D;
+ var8.aQ = (double) var1.f / 128.0D;
+ var8.aR = (double) var1.g / 128.0D;
+ var8.bJ = var1.b;
+ var8.bK = var1.c;
+ var8.bL = var1.d;
+ this.g.a(var1.a, var8);
+ }
+
+ public void a(so var1) {
+ double var2 = (double) var1.b / 32.0D;
+ double var4 = (double) var1.c / 32.0D;
+ double var6 = (double) var1.d / 32.0D;
+ Object var8 = null;
+ if (var1.h == 10) {
+ var8 = new yl(this.g, var2, var4, var6, 0);
+ }
+
+ if (var1.h == 11) {
+ var8 = new yl(this.g, var2, var4, var6, 1);
+ }
+
+ if (var1.h == 12) {
+ var8 = new yl(this.g, var2, var4, var6, 2);
+ }
+
+ if (var1.h == 90) {
+ var8 = new lx(this.g, var2, var4, var6);
+ }
+
+ if (var1.h == 60) {
+ var8 = new sl(this.g, var2, var4, var6);
+ }
+
+ if (var1.h == 61) {
+ var8 = new by(this.g, var2, var4, var6);
+ }
+
+ if (var1.h == 63) {
+ var8 = new cf(this.g, var2, var4, var6, (double) var1.e / 8000.0D, (double) var1.f / 8000.0D, (double) var1.g / 8000.0D);
+ var1.i = 0;
+ }
+
+ if (var1.h == 62) {
+ var8 = new vv(this.g, var2, var4, var6);
+ }
+
+ if (var1.h == 1) {
+ var8 = new fz(this.g, var2, var4, var6);
+ }
+
+ if (var1.h == 50) {
+ var8 = new qw(this.g, var2, var4, var6);
+ }
+
+ if (var1.h == 70) {
+ var8 = new ju(this.g, var2, var4, var6, uu.F.bn);
+ }
+
+ if (var1.h == 71) {
+ var8 = new ju(this.g, var2, var4, var6, uu.G.bn);
+ }
+
+ if (var8 != null) {
+ ((sn) var8).bJ = var1.b;
+ ((sn) var8).bK = var1.c;
+ ((sn) var8).bL = var1.d;
+ ((sn) var8).aS = 0.0F;
+ ((sn) var8).aT = 0.0F;
+ ((sn) var8).aD = var1.a;
+ this.g.a(var1.a, (sn) var8);
+ if (var1.i > 0) {
+ if (var1.h == 60) {
+ sn var9 = this.a(var1.i);
+ if (var9 instanceof ls) {
+ ((sl) var8).c = (ls) var9;
+ }
+ }
+
+ ((sn) var8).a((double) var1.e / 8000.0D, (double) var1.f / 8000.0D, (double) var1.g / 8000.0D);
+ }
+ }
+
+ }
+
+ public void a(fa var1) {
+ double var2 = (double) var1.b / 32.0D;
+ double var4 = (double) var1.c / 32.0D;
+ double var6 = (double) var1.d / 32.0D;
+ c var8 = null;
+ if (var1.e == 1) {
+ var8 = new c(this.g, var2, var4, var6);
+ }
+
+ if (var8 != null) {
+ var8.bJ = var1.b;
+ var8.bK = var1.c;
+ var8.bL = var1.d;
+ var8.aS = 0.0F;
+ var8.aT = 0.0F;
+ var8.aD = var1.a;
+ this.g.a(var8);
+ }
+
+ }
+
+ public void a(vt var1) {
+ qv var2 = new qv(this.g, var1.b, var1.c, var1.d, var1.e, var1.f);
+ this.g.a(var1.a, var2);
+ }
+
+ public void a(gj var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ var2.a((double) var1.b / 8000.0D, (double) var1.c / 8000.0D, (double) var1.d / 8000.0D);
+ }
+ }
+
+ public void a(ux var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null && var1.b() != null) {
+ var2.ad().a(var1.b());
+ }
+
+ }
+
+ public void a(mf var1) {
+ double var2 = (double) var1.c / 32.0D;
+ double var4 = (double) var1.d / 32.0D;
+ double var6 = (double) var1.e / 32.0D;
+ float var8 = (float) (var1.f * 360) / 256.0F;
+ float var9 = (float) (var1.g * 360) / 256.0F;
+ xz var10 = new xz(this.f.f, var1.b);
+ var10.aJ = var10.bl = (double) (var10.bJ = var1.c);
+ var10.aK = var10.bm = (double) (var10.bK = var1.d);
+ var10.aL = var10.bn = (double) (var10.bL = var1.e);
+ int var11 = var1.h;
+ if (var11 == 0) {
+ var10.c.a[var10.c.c] = null;
+ } else {
+ var10.c.a[var10.c.c] = new iz(var11, 1, 0);
+ }
+
+ var10.b(var2, var4, var6, var8, var9);
+ this.g.a(var1.a, var10);
+ }
+
+ public void a(rg var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ var2.bJ = var1.b;
+ var2.bK = var1.c;
+ var2.bL = var1.d;
+ double var3 = (double) var2.bJ / 32.0D;
+ double var5 = (double) var2.bK / 32.0D + 0.015625D;
+ double var7 = (double) var2.bL / 32.0D;
+ float var9 = (float) (var1.e * 360) / 256.0F;
+ float var10 = (float) (var1.f * 360) / 256.0F;
+ var2.a(var3, var5, var7, var9, var10, 3);
+ }
+ }
+
+ public void a(uh var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ var2.bJ += var1.b;
+ var2.bK += var1.c;
+ var2.bL += var1.d;
+ double var3 = (double) var2.bJ / 32.0D;
+ double var5 = (double) var2.bK / 32.0D;
+ double var7 = (double) var2.bL / 32.0D;
+ float var9 = var1.g ? (float) (var1.e * 360) / 256.0F : var2.aS;
+ float var10 = var1.g ? (float) (var1.f * 360) / 256.0F : var2.aT;
+ var2.a(var3, var5, var7, var9, var10, 3);
+ }
+ }
+
+ public void a(rv var1) {
+ this.g.c(var1.a);
+ }
+
+ public void a(ig var1) {
+ dc var2 = this.f.h;
+ double var3 = var2.aM;
+ double var5 = var2.aN;
+ double var7 = var2.aO;
+ float var9 = var2.aS;
+ float var10 = var2.aT;
+ if (var1.h) {
+ var3 = var1.a;
+ var5 = var1.b;
+ var7 = var1.c;
+ }
+
+ if (var1.i) {
+ var9 = var1.e;
+ var10 = var1.f;
+ }
+
+ var2.bo = 0.0F;
+ var2.aP = var2.aQ = var2.aR = 0.0D;
+ var2.b(var3, var5, var7, var9, var10);
+ var1.a = var2.aM;
+ var1.b = var2.aW.b;
+ var1.c = var2.aO;
+ var1.d = var2.aN;
+ this.e.a((ki) var1);
+ if (!this.h) {
+ this.f.h.aJ = this.f.h.aM;
+ this.f.h.aK = this.f.h.aN;
+ this.f.h.aL = this.f.h.aO;
+ this.h = true;
+ this.f.a((da) null);
+ }
+
+ }
+
+ public void a(se var1) {
+ this.g.a(var1.a, var1.b, var1.c);
+ }
+
+ public void a(wu var1) {
+ lm var2 = this.g.c(var1.a, var1.b);
+ int var3 = var1.a * 16;
+ int var4 = var1.b * 16;
+
+ for (int var5 = 0; var5 < var1.f; ++var5) {
+ short var6 = var1.c[var5];
+ int var7 = var1.d[var5] & 255;
+ byte var8 = var1.e[var5];
+ int var9 = var6 >> 12 & 15;
+ int var10 = var6 >> 8 & 15;
+ int var11 = var6 & 255;
+ var2.a(var9, var11, var10, var7, var8);
+ this.g.c(var9 + var3, var11, var10 + var4, var9 + var3, var11, var10 + var4);
+ this.g.b(var9 + var3, var11, var10 + var4, var9 + var3, var11, var10 + var4);
+ }
+
+ }
+
+ public void a(ef var1) {
+ this.g.c(var1.a, var1.b, var1.c, var1.a + var1.d - 1, var1.b + var1.e - 1, var1.c + var1.f - 1);
+ this.g.a(var1.a, var1.b, var1.c, var1.d, var1.e, var1.f, var1.g);
+ }
+
+ public void a(tv var1) {
+ this.g.f(var1.a, var1.b, var1.c, var1.d, var1.e);
+ }
+
+ public void a(yr var1) {
+ this.e.a("disconnect.kicked", new Object[0]);
+ this.d = true;
+ this.f.a((fd) null);
+ this.f.a((da) (new ex("disconnect.disconnected", "disconnect.genericReason", new Object[] { var1.a })));
+ }
+
+ public void a(String var1, Object[] var2) {
+ if (!this.d) {
+ this.d = true;
+ this.f.a((fd) null);
+ this.f.a((da) (new ex("disconnect.lost", var1, var2)));
+ }
+ }
+
+ public void a(ki var1) {
+ if (!this.d) {
+ this.e.a(var1);
+ this.e.c();
+ }
+ }
+
+ public void b(ki var1) {
+ if (!this.d) {
+ this.e.a(var1);
+ }
+ }
+
+ public void a(di var1) {
+ sn var2 = this.a(var1.a);
+ Object var3 = (ls) this.a(var1.b);
+ if (var3 == null) {
+ var3 = this.f.h;
+ }
+
+ if (var2 != null) {
+ this.g.a(var2, "random.pop", 0.2F, ((this.c.nextFloat() - this.c.nextFloat()) * 0.7F + 1.0F) * 2.0F);
+ this.f.j.a((xw) (new em(this.f.f, var2, (sn) var3, -0.5F)));
+ this.g.c(var1.a);
+ }
+
+ }
+
+ public void a(pe var1) {
+ if (!ChatHook.runhooks(var1.a)) // WorldEditCui
+ this.f.v.a(var1.a);
+ }
+
+ public void a(nm var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ gs var3;
+ if (var1.b == 1) {
+ var3 = (gs) var2;
+ var3.J();
+ } else if (var1.b == 2) {
+ var2.h();
+ } else if (var1.b == 3) {
+ var3 = (gs) var2;
+ var3.a(false, false, false);
+ } else if (var1.b == 4) {
+ var3 = (gs) var2;
+ var3.v();
+ }
+
+ }
+ }
+
+ public void a(jz var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ if (var1.e == 0) {
+ gs var3 = (gs) var2;
+ var3.b(var1.b, var1.c, var1.d);
+ }
+
+ }
+ }
+
+ public void a(mp var1) {
+ if (var1.a.equals("-")) {
+ this.b(new nz(this.f.k.b, 14));
+ } else {
+ try {
+ URL var2 = new URL("http://www.minecraft.net/game/joinserver.jsp?user=" + this.f.k.b + "&sessionId=" + this.f.k.c + "&serverId=" + var1.a);
+ BufferedReader var3 = new BufferedReader(new InputStreamReader(var2.openStream()));
+ String var4 = var3.readLine();
+ var3.close();
+ if (var4.equalsIgnoreCase("ok")) {
+ this.b(new nz(this.f.k.b, 14));
+ } else {
+ this.e.a("disconnect.loginFailedInfo", new Object[] { var4 });
+ }
+ } catch (Exception var5) {
+ var5.printStackTrace();
+ this.e.a("disconnect.genericReason", new Object[] { "Internal client error: " + var5.toString() });
+ }
+ }
+
+ }
+
+ public void b() {
+ this.d = true;
+ this.e.a();
+ this.e.a("disconnect.closed", new Object[0]);
+ }
+
+ @SuppressWarnings("rawtypes")
+ public void a(jm var1) {
+ double var2 = (double) var1.c / 32.0D;
+ double var4 = (double) var1.d / 32.0D;
+ double var6 = (double) var1.e / 32.0D;
+ float var8 = (float) (var1.f * 360) / 256.0F;
+ float var9 = (float) (var1.g * 360) / 256.0F;
+ ls var10 = (ls) jc.a(var1.b, this.f.f);
+ var10.bJ = var1.c;
+ var10.bK = var1.d;
+ var10.bL = var1.e;
+ var10.aD = var1.a;
+ var10.b(var2, var4, var6, var8, var9);
+ var10.V = true;
+ this.g.a(var1.a, var10);
+ List var11 = var1.b();
+ if (var11 != null) {
+ var10.ad().a(var11);
+ }
+
+ }
+
+ public void a(hg var1) {
+ this.f.f.a(var1.a);
+ }
+
+ public void a(rc var1) {
+ this.f.h.a(new br(var1.a, var1.b, var1.c));
+ this.f.f.x().a(var1.a, var1.b, var1.c);
+ }
+
+ public void a(ns var1) {
+ Object var2 = this.a(var1.a);
+ sn var3 = this.a(var1.b);
+ if (var1.a == this.f.h.aD) {
+ var2 = this.f.h;
+ }
+
+ if (var2 != null) {
+ ((sn) var2).i(var3);
+ }
+ }
+
+ public void a(jf var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ var2.a(var1.b);
+ }
+
+ }
+
+ private sn a(int var1) {
+ return (sn) (var1 == this.f.h.aD ? this.f.h : this.g.b(var1));
+ }
+
+ public void a(eu var1) {
+ this.f.h.d_(var1.a);
+ }
+
+ public void a(ox var1) {
+ if (var1.a != this.f.h.m) {
+ this.h = false;
+ this.g = new mm(this, this.g.x().b(), var1.a);
+ this.g.B = true;
+ this.f.a((fd) this.g);
+ this.f.h.m = var1.a;
+ this.f.a((da) (new gg(this)));
+ }
+
+ this.f.a(true, var1.a);
+ }
+
+ public void a(rm var1) {
+ qx var2 = new qx(this.f.f, (sn) null, var1.a, var1.b, var1.c, var1.d);
+ var2.g = var1.e;
+ var2.a(true);
+ }
+
+ public void a(iw var1) {
+ if (var1.b == 0) {
+ qo var2 = new qo(var1.c, var1.d);
+ this.f.h.a((lw) var2);
+ this.f.h.e.f = var1.a;
+ } else if (var1.b == 2) {
+ sk var3 = new sk();
+ this.f.h.a(var3);
+ this.f.h.e.f = var1.a;
+ } else if (var1.b == 3) {
+ az var4 = new az();
+ this.f.h.a(var4);
+ this.f.h.e.f = var1.a;
+ } else if (var1.b == 1) {
+ dc var5 = this.f.h;
+ this.f.h.a(in.b(var5.aM), in.b(var5.aN), in.b(var5.aO));
+ this.f.h.e.f = var1.a;
+ }
+
+ }
+
+ public void a(hq var1) {
+ if (var1.a == -1) {
+ this.f.h.c.b(var1.c);
+ } else if (var1.a == 0 && var1.b >= 36 && var1.b < 45) {
+ iz var2 = this.f.h.d.b(var1.b).a();
+ if (var1.c != null && (var2 == null || var2.a < var1.c.a)) {
+ var1.c.b = 5;
+ }
+
+ this.f.h.d.a(var1.b, var1.c);
+ } else if (var1.a == this.f.h.e.f) {
+ this.f.h.e.a(var1.b, var1.c);
+ }
+
+ }
+
+ public void a(oj var1) {
+ dw var2 = null;
+ if (var1.a == 0) {
+ var2 = this.f.h.d;
+ } else if (var1.a == this.f.h.e.f) {
+ var2 = this.f.h.e;
+ }
+
+ if (var2 != null) {
+ if (var1.c) {
+ var2.a(var1.b);
+ } else {
+ var2.b(var1.b);
+ this.b(new oj(var1.a, var1.b, true));
+ }
+ }
+
+ }
+
+ public void a(kb var1) {
+ if (var1.a == 0) {
+ this.f.h.d.a(var1.b);
+ } else if (var1.a == this.f.h.e.f) {
+ this.f.h.e.a(var1.b);
+ }
+
+ }
+
+ public void a(ui var1) {
+ if (this.f.f.i(var1.a, var1.b, var1.c)) {
+ ow var2 = this.f.f.b(var1.a, var1.b, var1.c);
+ if (var2 instanceof yk) {
+ yk var3 = (yk) var2;
+
+ for (int var4 = 0; var4 < 4; ++var4) {
+ var3.a[var4] = var1.d[var4];
+ }
+
+ var3.y_();
+ }
+ }
+
+ }
+
+ public void a(mv var1) {
+ this.c(var1);
+ if (this.f.h.e != null && this.f.h.e.f == var1.a) {
+ this.f.h.e.a(var1.b, var1.c);
+ }
+
+ }
+
+ public void a(s var1) {
+ sn var2 = this.a(var1.a);
+ if (var2 != null) {
+ var2.c(var1.b, var1.c, var1.d);
+ }
+
+ }
+
+ public void a(mn var1) {
+ this.f.h.r();
+ }
+
+ public void a(vw var1) {
+ this.f.f.d(var1.a, var1.b, var1.c, var1.d, var1.e);
+ }
+
+ public void a(ca var1) {
+ int var2 = var1.b;
+ if (var2 >= 0 && var2 < ca.a.length && ca.a[var2] != null) {
+ this.f.h.b(ca.a[var2]);
+ }
+
+ if (var2 == 1) {
+ this.g.x().b(true);
+ this.g.h(1.0F);
+ } else if (var2 == 2) {
+ this.g.x().b(false);
+ this.g.h(0.0F);
+ }
+
+ }
+
+ public void a(ai var1) {
+ if (var1.a == gm.bb.bf) {
+ wr.a(var1.b, this.f.f).a(var1.c);
+ } else {
+ System.out.println("Unknown itemid: " + var1.b);
+ }
+
+ }
+
+ public void a(fn var1) {
+ this.f.f.e(var1.a, var1.c, var1.d, var1.e, var1.b);
+ }
+
+ public void a(of var1) {
+ ((tk) this.f.h).b(jl.a(var1.a), var1.b);
+ }
+
+ public boolean c() {
+ return false;
+ }
+}
diff --git a/src/spc_WorldEditCUI.java b/src/spc_WorldEditCUI.java
new file mode 100644
index 0000000..3cfb130
--- /dev/null
+++ b/src/spc_WorldEditCUI.java
@@ -0,0 +1,17 @@
+public class spc_WorldEditCUI extends SPCPlugin {
+
+ @Override
+ public String getVersion() {
+ return "1.7_01";
+ }
+
+ @Override
+ public String getName() {
+ return "WorldEditCUI";
+ }
+
+ @Override
+ public void handleCUIEvent(String type, String params[]) {
+ mod_WorldEditCUI.handleEvent(type, params);
+ }
+}
\ No newline at end of file