Skip to content

Commit

Permalink
Updated for LiteLoader 1.7.10.
Browse files Browse the repository at this point in the history
 * Tested against LiteLoader 1.7.10_03, Forge 10.13.0.1180,
   OptiFine HD A4 Ultra for Minecraft 1.7.10, VoxelMap 1.2.3, Schematica.
  • Loading branch information
totemo committed Aug 14, 2014
1 parent 0a7d82d commit 5674bac
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 123 deletions.
1 change: 0 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<classpathentry kind="src" path="res"/>
<classpathentry combineaccessrules="false" kind="src" path="/LiteLoader"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/Client/jars/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar" sourcepath="/opt/lwjgl-2.9.0/src/java"/>
<classpathentry kind="lib" path="/Client/jars/libraries/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar"/>
<classpathentry kind="lib" path="/Client/jars/libraries/com/google/guava/guava/15.0/guava-15.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/SnakeYAML 1.10"/>
Expand Down
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change History
==============
0.8.0.104-mc1.7.10
-------------------
* Updated to LiteLoader 1.7.10.

0.7.0.100-mc1.7.2_02
-------------------
* Fix Issue #35: Make reformatting and colour coding of LogBlock query results configurable.
Expand Down
6 changes: 3 additions & 3 deletions build/build_watson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

<!-- The version of your mod, can be any string as long as it's valid as part of a file name -->
<!-- and should match the version string returned by your mod. -->
<property name="version" value="0.7.0" />
<property name="version" value="0.8.0" />

<!-- The Minecraft version the mod is for, appended to the output file name for reference -->
<property name="mcversion" value="1.7.2" />
<property name="mcversion" value="1.7.10" />

<!-- The version inserted into the mod metadata to tell the loader what version of MC this mod is for -->
<property name="litemodversion" value="1.7.2_02" />
<property name="litemodversion" value="1.7.10" />

<!-- Your name, this gets written into the mod metadata and jar metadata -->
<property name="author" value="totemo" />
Expand Down
4 changes: 2 additions & 2 deletions build/buildnumber.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sun Aug 10 19:02:50 CST 2014
build.number=101
#Thu Aug 14 13:19:00 CST 2014
build.number=105
3 changes: 1 addition & 2 deletions build/litemod.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
"version": "${version}.${build.number}-mc${litemodversion}",
"revision": "${build.number}",
"author": "${author}",
"description": "A 3-D log visualisation tool.",
"classTransformerClasses": "watson.transformer.WatsonCallbackInjectionTransformer"
"description": "A 3-D log visualisation tool."
}
9 changes: 4 additions & 5 deletions res/litemod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"__comment2__": "Actual comments in this file confuse the JSON parser when deployed. :/",

"name": "watson",
"mcversion": "1.7.2_02",
"version": "0.7.0.100-mc1.7.2_02",
"revision": "100",
"mcversion": "1.7.10",
"version": "0.8.0.104-mc1.7.10",
"revision": "104",
"author": "totemo",
"description": "A 3-D log visualisation tool.",
"classTransformerClasses": "watson.transformer.WatsonCallbackInjectionTransformer"
"description": "A 3-D log visualisation tool."
}
2 changes: 1 addition & 1 deletion src/watson/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public DisplaySettings getDisplaySettings()
public String getServerIP()
{
Minecraft mc = Minecraft.getMinecraft();
ServerData serverData = mc.func_147104_D();
ServerData serverData = mc.getCurrentServerData();
if (!mc.isSingleplayer() && serverData != null)
{
return serverData.serverIP;
Expand Down
25 changes: 20 additions & 5 deletions src/watson/LiteModWatson.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.google.gson.Gson;
import com.mumfrey.liteloader.ChatFilter;
import com.mumfrey.liteloader.JoinGameListener;
import com.mumfrey.liteloader.OutboundChatFilter;
import com.mumfrey.liteloader.PostRenderListener;
import com.mumfrey.liteloader.Tickable;
import com.mumfrey.liteloader.core.LiteLoader;
Expand All @@ -48,8 +49,8 @@
*
* @author totemo
*/
@ExposableOptions(strategy = ConfigStrategy.Versioned, filename = "examplemod.json")
public class LiteModWatson implements JoinGameListener, ChatFilter, Tickable, PostRenderListener
@ExposableOptions(strategy = ConfigStrategy.Versioned, filename = "watson.json")
public class LiteModWatson implements JoinGameListener, ChatFilter, Tickable, PostRenderListener, OutboundChatFilter
{
// --------------------------------------------------------------------------
/**
Expand Down Expand Up @@ -350,10 +351,23 @@ private double getPlayerZ(float partialTicks)

// --------------------------------------------------------------------------
/**
* Callback redirected from EntityClientPlayerMP.sendChatMessage(String).
* @see com.mumfrey.liteloader.OutboundChatFilter#onSendChatMessage(java.lang.String)
*/
@Override
public boolean onSendChatMessage(String chat)
{
// Send the chat to server if not handled locally as a command.
return !ClientCommandManager.instance.handleClientCommand(chat);
}

// --------------------------------------------------------------------------
/**
* This method acts as an entry point into
* ClientCommandManager.handleClientCommand(), for use by the watson_macros
* mod.
*
* This is used to intercept player chats heading for the server and filter
* out (and act upon) Watson commands.
* The method was originally a callback used by a transformer, but that is no
* longer the case.
*/
public static void sendChatMessage(EntityClientPlayerMP player, String chat)
{
Expand Down Expand Up @@ -419,4 +433,5 @@ private InputStream getLiteModJsonStream()
* message a second later. When 0, no welcome message is shown.
*/
private static long _gameJoinTime = 0;

} // class LiteModWatson
2 changes: 1 addition & 1 deletion src/watson/chat/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void localChat(IChatComponent chat)
if (isChatGuiReady())
{
IChatComponent highlighted = getChatHighlighter().highlight(chat);
Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(highlighted);
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(highlighted);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/watson/db/BlockEditSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ public void drawHUD()
GL11.glPushMatrix();

Minecraft mc = Minecraft.getMinecraft();
ScaledResolution scaledResolution = new ScaledResolution(mc.gameSettings,
mc.displayWidth, mc.displayHeight);
ScaledResolution scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);

}
finally
Expand Down
41 changes: 13 additions & 28 deletions src/watson/db/PlayerEditSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import java.util.Iterator;
import java.util.TreeSet;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Vec3;
import net.minecraft.util.Vec3Pool;

import org.lwjgl.opengl.GL11;

Expand Down Expand Up @@ -152,7 +150,6 @@ public void drawVectors(ARGB colour)
DisplaySettings settings = Controller.instance.getDisplaySettings();
if (settings.areVectorsShown() && isVisible() && !_edits.isEmpty())
{
final Vec3Pool pool = Minecraft.getMinecraft().theWorld.getWorldVec3Pool();
final Tessellator tess = Tessellator.instance;
tess.startDrawing(GL11.GL_LINES);

Expand All @@ -161,8 +158,8 @@ public void drawVectors(ARGB colour)
GL11.glLineWidth(0.5f);

// Unit X and Y vectors used for cross products to get arrow axes.
Vec3 unitX = pool.getVecFromPool(1, 0, 0);
Vec3 unitY = pool.getVecFromPool(0, 1, 0);
Vec3 unitX = Vec3.createVectorHelper(1, 0, 0);
Vec3 unitY = Vec3.createVectorHelper(0, 1, 0);

// We only need to draw vectors if there are at least 2 edits.
Iterator<BlockEdit> it = _edits.iterator();
Expand All @@ -178,10 +175,8 @@ public void drawVectors(ARGB colour)
|| (!next.creation && settings.isLinkedDestructions());
if (show)
{
Vec3 pPos = pool.getVecFromPool(0.5 + prev.x, 0.5 + prev.y,
0.5 + prev.z);
Vec3 nPos = pool.getVecFromPool(0.5 + next.x, 0.5 + next.y,
0.5 + next.z);
Vec3 pPos = Vec3.createVectorHelper(0.5 + prev.x, 0.5 + prev.y, 0.5 + prev.z);
Vec3 nPos = Vec3.createVectorHelper(0.5 + next.x, 0.5 + next.y, 0.5 + next.z);
// Vector difference, from prev to next.
Vec3 diff = nPos.subtract(pPos);

Expand All @@ -206,18 +201,16 @@ public void drawVectors(ARGB colour)

// Position of the tip and tail of the arrow, sitting in the
// middle of the vector.
Vec3 tip = pool.getVecFromPool(
Vec3 tip = Vec3.createVectorHelper(
pPos.xCoord * (0.5 - arrowScale) + nPos.xCoord
* (0.5 + arrowScale), pPos.yCoord * (0.5 - arrowScale)
+ nPos.yCoord * (0.5 + arrowScale),
pPos.zCoord * (0.5 - arrowScale) + nPos.zCoord
* (0.5 + arrowScale));
Vec3 tail = pool.getVecFromPool(pPos.xCoord * (0.5 + arrowScale)
+ nPos.xCoord
* (0.5 - arrowScale),
pPos.yCoord * (0.5 + arrowScale) + nPos.yCoord
* (0.5 - arrowScale), pPos.zCoord * (0.5 + arrowScale)
+ nPos.zCoord * (0.5 - arrowScale));
Vec3 tail = Vec3.createVectorHelper(
pPos.xCoord * (0.5 + arrowScale) + nPos.xCoord * (0.5 - arrowScale),
pPos.yCoord * (0.5 + arrowScale) + nPos.yCoord * (0.5 - arrowScale),
pPos.zCoord * (0.5 + arrowScale) + nPos.zCoord * (0.5 - arrowScale));

// Fin axes, perpendicular to vector. Scale by vector length.
// If the vector is colinear with the Y axis, use the X axis for
Expand All @@ -242,21 +235,13 @@ public void drawVectors(ARGB colour)

// Draw four fins.
tess.addVertex(tip.xCoord, tip.yCoord, tip.zCoord);
tess.addVertex(tail.xCoord + fin1.xCoord, tail.yCoord
+ fin1.yCoord,
tail.zCoord + fin1.zCoord);
tess.addVertex(tail.xCoord + fin1.xCoord, tail.yCoord + fin1.yCoord, tail.zCoord + fin1.zCoord);
tess.addVertex(tip.xCoord, tip.yCoord, tip.zCoord);
tess.addVertex(tail.xCoord - fin1.xCoord, tail.yCoord
- fin1.yCoord,
tail.zCoord - fin1.zCoord);
tess.addVertex(tail.xCoord - fin1.xCoord, tail.yCoord - fin1.yCoord, tail.zCoord - fin1.zCoord);
tess.addVertex(tip.xCoord, tip.yCoord, tip.zCoord);
tess.addVertex(tail.xCoord + fin2.xCoord, tail.yCoord
+ fin2.yCoord,
tail.zCoord + fin2.zCoord);
tess.addVertex(tail.xCoord + fin2.xCoord, tail.yCoord + fin2.yCoord, tail.zCoord + fin2.zCoord);
tess.addVertex(tip.xCoord, tip.yCoord, tip.zCoord);
tess.addVertex(tail.xCoord - fin2.xCoord, tail.yCoord
- fin2.yCoord,
tail.zCoord - fin2.zCoord);
tess.addVertex(tail.xCoord - fin2.xCoord, tail.yCoord - fin2.yCoord, tail.zCoord - fin2.zCoord);
} // if we are drawing this vector
prev = next;
} // if
Expand Down
73 changes: 0 additions & 73 deletions src/watson/transformer/WatsonCallbackInjectionTransformer.java

This file was deleted.

0 comments on commit 5674bac

Please sign in to comment.