Commit fdb36ae1376359126e34c37f63a2792bc38f9bd4
1 parent
3781bd92
Style update part 3 - apply checkstyle
Showing
100 changed files
with
1045 additions
and
508 deletions
Too many changes to show.
To preserve performance only 100 of 219 files are displayed.
build.gradle
@@ -17,6 +17,7 @@ buildscript { | @@ -17,6 +17,7 @@ buildscript { | ||
17 | } | 17 | } |
18 | 18 | ||
19 | apply plugin: 'net.minecraftforge.gradle.tweaker-client' | 19 | apply plugin: 'net.minecraftforge.gradle.tweaker-client' |
20 | +apply plugin: 'checkstyle' | ||
20 | apply plugin: 'maven' | 21 | apply plugin: 'maven' |
21 | 22 | ||
22 | // Artefact details | 23 | // Artefact details |
@@ -60,6 +61,17 @@ sourceSets { | @@ -60,6 +61,17 @@ sourceSets { | ||
60 | } | 61 | } |
61 | } | 62 | } |
62 | 63 | ||
64 | +checkstyle { | ||
65 | + configProperties = [ | ||
66 | + "name" : project.name, | ||
67 | + "organization": project.organization, | ||
68 | + "url" : project.url, | ||
69 | + "year" : project.inceptionYear | ||
70 | + ] | ||
71 | + configFile = file("checkstyle.xml") | ||
72 | + toolVersion = '6.13' | ||
73 | +} | ||
74 | + | ||
63 | javadoc { | 75 | javadoc { |
64 | source sourceSets.client.allJava | 76 | source sourceSets.client.allJava |
65 | source sourceSets.debug.allJava | 77 | source sourceSets.debug.allJava |
@@ -110,7 +122,7 @@ task runClient(type: JavaExec, overwrite: true) { | @@ -110,7 +122,7 @@ task runClient(type: JavaExec, overwrite: true) { | ||
110 | } | 122 | } |
111 | 123 | ||
112 | tasks.withType(JavaCompile) { | 124 | tasks.withType(JavaCompile) { |
113 | - options.compilerArgs += ['-Xlint:all', '-Xlint:-path'] | 125 | + options.compilerArgs += ['-Xlint:all', '-Xlint:-path', '-Xlint:-rawtypes'] |
114 | options.deprecation = true | 126 | options.deprecation = true |
115 | options.encoding = 'utf8' | 127 | options.encoding = 'utf8' |
116 | } | 128 | } |
checkstyle.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | ||
3 | + | ||
4 | +<!-- | ||
5 | + This configuration file was written by the eclipse-cs plugin configuration editor | ||
6 | +--> | ||
7 | +<!-- | ||
8 | + Checkstyle-Configuration: LiteLoader Style | ||
9 | + Description: none | ||
10 | +--> | ||
11 | +<module name="Checker"> | ||
12 | + <property name="severity" value="warning"/> | ||
13 | + <property name="charset" value="UTF-8"/> | ||
14 | + <module name="TreeWalker"> | ||
15 | + <module name="FileContentsHolder"/> | ||
16 | + <module name="OuterTypeFilename"/> | ||
17 | + <module name="IllegalTokenText"> | ||
18 | + <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/> | ||
19 | + <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/> | ||
20 | + <property name="message" value="Avoid using corresponding octal or Unicode escape."/> | ||
21 | + </module> | ||
22 | + <module name="EmptyBlock"> | ||
23 | + <property name="option" value="TEXT"/> | ||
24 | + <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> | ||
25 | + </module> | ||
26 | + <module name="ArrayTypeStyle"/> | ||
27 | + <module name="MissingSwitchDefault"/> | ||
28 | + <module name="FallThrough"/> | ||
29 | + <module name="UpperEll"/> | ||
30 | + <module name="ModifierOrder"/> | ||
31 | + <module name="PackageName"> | ||
32 | + <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> | ||
33 | + <message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/> | ||
34 | + </module> | ||
35 | + <module name="TypeName"> | ||
36 | + <message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/> | ||
37 | + </module> | ||
38 | + <module name="MemberName"> | ||
39 | + <property name="format" value="^[a-z]([a-zA-Z0-9]*)?$"/> | ||
40 | + <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/> | ||
41 | + </module> | ||
42 | + <module name="ParameterName"> | ||
43 | + <property name="format" value="^[a-z]([a-zA-Z0-9]*)?$"/> | ||
44 | + <message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/> | ||
45 | + </module> | ||
46 | + <module name="LocalVariableName"> | ||
47 | + <property name="format" value="^[a-z]([a-zA-Z0-9]*)?$"/> | ||
48 | + <property name="tokens" value="VARIABLE_DEF"/> | ||
49 | + <message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/> | ||
50 | + </module> | ||
51 | + <module name="ClassTypeParameterName"> | ||
52 | + <property name="format" value="(^[A-Z][0-9]?)$|(T[A-Z][a-zA-Z0-9]*$)"/> | ||
53 | + <message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/> | ||
54 | + </module> | ||
55 | + <module name="MethodTypeParameterName"> | ||
56 | + <property name="format" value="(^[A-Z][0-9]?)$|(T[A-Z][a-zA-Z0-9]*$)"/> | ||
57 | + <message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/> | ||
58 | + </module> | ||
59 | + <module name="NoFinalizer"/> | ||
60 | + <module name="OperatorWrap"> | ||
61 | + <property name="option" value="NL"/> | ||
62 | + <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/> | ||
63 | + </module> | ||
64 | + <module name="RequireThis"/> | ||
65 | + <module name="EqualsHashCode"/> | ||
66 | + <module name="LeftCurly"> | ||
67 | + <property name="option" value="nl"/> | ||
68 | + </module> | ||
69 | + <module name="MethodParamPad"> | ||
70 | + <property name="allowLineBreaks" value="true"/> | ||
71 | + <property name="tokens" value="CTOR_DEF,METHOD_CALL,METHOD_DEF,SUPER_CTOR_CALL"/> | ||
72 | + </module> | ||
73 | + <module name="LineLength"> | ||
74 | + <metadata name="net.sf.eclipsecs.core.comment" value="Code line length"/> | ||
75 | + <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> | ||
76 | + <property name="max" value="150"/> | ||
77 | + <message key="maxLineLen" value="Code line is longer than {0,number,integer} characters (found {1,number,integer})."/> | ||
78 | + </module> | ||
79 | + <module name="LineLength"> | ||
80 | + <metadata name="net.sf.eclipsecs.core.comment" value="Comment line length"/> | ||
81 | + <property name="ignorePattern" value="^[ ]*([a-zA-Z0-9\{\}\+\|\&\"@\(\)\?\:\.=]|//)"/> | ||
82 | + <message key="maxLineLen" value="Comment line is longer than {0,number,integer} characters (found {1,number,integer})."/> | ||
83 | + </module> | ||
84 | + <module name="NeedBraces"> | ||
85 | + <property name="allowSingleLineStatement" value="true"/> | ||
86 | + <message key="needBraces" value="''{0}'' must use '''{}'''s."/> | ||
87 | + </module> | ||
88 | + <module name="RightCurly"> | ||
89 | + <property name="option" value="alone"/> | ||
90 | + <property name="tokens" value="LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_IF,LITERAL_ELSE,CLASS_DEF,METHOD_DEF,CTOR_DEF,LITERAL_FOR,LITERAL_WHILE,LITERAL_DO,STATIC_INIT,INSTANCE_INIT"/> | ||
91 | + <property name="shouldStartLine" value="false"/> | ||
92 | + </module> | ||
93 | + <module name="MissingOverride"> | ||
94 | + <property name="severity" value="error"/> | ||
95 | + </module> | ||
96 | + <module name="MissingDeprecated"> | ||
97 | + <property name="severity" value="warning"/> | ||
98 | + </module> | ||
99 | + <module name="TypecastParenPad"> | ||
100 | + <property name="tokens" value="RPAREN,TYPECAST"/> | ||
101 | + </module> | ||
102 | + <module name="DefaultComesLast"/> | ||
103 | + <module name="EmptyStatement"/> | ||
104 | + <module name="EqualsAvoidNull"/> | ||
105 | + <module name="StringLiteralEquality"/> | ||
106 | + <module name="FinalClass"/> | ||
107 | + </module> | ||
108 | + <module name="SuppressionCommentFilter"/> | ||
109 | +</module> |
src/client/java/com/mumfrey/liteloader/ChatFilter.java
@@ -13,11 +13,13 @@ import net.minecraft.util.IChatComponent; | @@ -13,11 +13,13 @@ import net.minecraft.util.IChatComponent; | ||
13 | public interface ChatFilter extends LiteMod | 13 | public interface ChatFilter extends LiteMod |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | - * Chat filter function, return false to filter this packet, true to pass the packet | 16 | + * Chat filter function, return false to filter this packet, true to pass |
17 | + * the packet. | ||
17 | * | 18 | * |
18 | * @param chat ChatMessageComponent parsed from the chat packet | 19 | * @param chat ChatMessageComponent parsed from the chat packet |
19 | * @param message Chat message parsed from the chat message component | 20 | * @param message Chat message parsed from the chat message component |
20 | - * @param newMessage If you wish to mutate the message, set the value using newMessage.set() | 21 | + * @param newMessage If you wish to mutate the message, set the value using |
22 | + * newMessage.set() | ||
21 | * | 23 | * |
22 | * @return True to keep the packet, false to discard | 24 | * @return True to keep the packet, false to discard |
23 | */ | 25 | */ |
src/client/java/com/mumfrey/liteloader/EntityRenderListener.java
@@ -4,7 +4,8 @@ import net.minecraft.client.renderer.entity.Render; | @@ -4,7 +4,8 @@ import net.minecraft.client.renderer.entity.Render; | ||
4 | import net.minecraft.entity.Entity; | 4 | import net.minecraft.entity.Entity; |
5 | 5 | ||
6 | /** | 6 | /** |
7 | - * Interface for mods which want to receive callbacks when entities are rendered into the world | 7 | + * Interface for mods which want to receive callbacks when entities are rendered |
8 | + * into the world. | ||
8 | * | 9 | * |
9 | * @author Adam Mummery-Smith | 10 | * @author Adam Mummery-Smith |
10 | */ | 11 | */ |
src/client/java/com/mumfrey/liteloader/FrameBufferListener.java
@@ -3,20 +3,23 @@ package com.mumfrey.liteloader; | @@ -3,20 +3,23 @@ package com.mumfrey.liteloader; | ||
3 | import net.minecraft.client.shader.Framebuffer; | 3 | import net.minecraft.client.shader.Framebuffer; |
4 | 4 | ||
5 | /** | 5 | /** |
6 | - * Interface for mods which want to interact with Minecraft's main Frame Buffer Object | 6 | + * Interface for mods which want to interact with Minecraft's main Frame Buffer |
7 | + * Object. | ||
7 | * | 8 | * |
8 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
9 | */ | 10 | */ |
10 | public interface FrameBufferListener extends LiteMod | 11 | public interface FrameBufferListener extends LiteMod |
11 | { | 12 | { |
12 | /** | 13 | /** |
13 | - * Called before the FBO is rendered. Useful if you want to interact with the FBO before it is drawn to the screen | 14 | + * Called before the FBO is rendered. Useful if you want to interact with |
15 | + * the FBO before it is drawn to the screen. | ||
14 | */ | 16 | */ |
15 | public abstract void preRenderFBO(Framebuffer fbo); | 17 | public abstract void preRenderFBO(Framebuffer fbo); |
16 | 18 | ||
17 | /** | 19 | /** |
18 | - * Called immediately before the FBO is rendered to the screen, after the appropriate IGL modes and matrix transforms | ||
19 | - * have been set but before the FBO is actually rendered into the main output buffer. | 20 | + * Called immediately before the FBO is rendered to the screen, after the |
21 | + * appropriate IGL modes and matrix transforms have been set but before the | ||
22 | + * FBO is actually rendered into the main output buffer. | ||
20 | * | 23 | * |
21 | * @param fbo FBO instance | 24 | * @param fbo FBO instance |
22 | * @param width FBO width | 25 | * @param width FBO width |
src/client/java/com/mumfrey/liteloader/InitCompleteListener.java
@@ -5,15 +5,17 @@ import net.minecraft.client.Minecraft; | @@ -5,15 +5,17 @@ import net.minecraft.client.Minecraft; | ||
5 | import com.mumfrey.liteloader.core.LiteLoader; | 5 | import com.mumfrey.liteloader.core.LiteLoader; |
6 | 6 | ||
7 | /** | 7 | /** |
8 | - * Interface for mods which need to initialise stuff once the game initialisation is completed, | ||
9 | - * for example mods which need to register new renderers. | 8 | + * Interface for mods which need to initialise stuff once the game |
9 | + * initialisation is completed, for example mods which need to register new | ||
10 | + * renderers. | ||
10 | * | 11 | * |
11 | * @author Adam Mummery-Smith | 12 | * @author Adam Mummery-Smith |
12 | */ | 13 | */ |
13 | public interface InitCompleteListener extends Tickable | 14 | public interface InitCompleteListener extends Tickable |
14 | { | 15 | { |
15 | /** | 16 | /** |
16 | - * Called as soon as the game is initialised and the main game loop is running | 17 | + * Called as soon as the game is initialised and the main game loop is |
18 | + * running. | ||
17 | * | 19 | * |
18 | * @param minecraft Minecraft instance | 20 | * @param minecraft Minecraft instance |
19 | * @param loader LiteLoader instance | 21 | * @param loader LiteLoader instance |
src/client/java/com/mumfrey/liteloader/JoinGameListener.java
@@ -8,7 +8,8 @@ import com.mojang.realmsclient.dto.RealmsServer; | @@ -8,7 +8,8 @@ import com.mojang.realmsclient.dto.RealmsServer; | ||
8 | 8 | ||
9 | 9 | ||
10 | /** | 10 | /** |
11 | - * Interface for mods which wish to be notified when the player connects to a server (or local game) | 11 | + * Interface for mods which wish to be notified when the player connects to a |
12 | + * server (or local game). | ||
12 | * | 13 | * |
13 | * @author Adam Mummery-Smith | 14 | * @author Adam Mummery-Smith |
14 | */ | 15 | */ |
@@ -19,8 +20,10 @@ public interface JoinGameListener extends LiteMod | @@ -19,8 +20,10 @@ public interface JoinGameListener extends LiteMod | ||
19 | * | 20 | * |
20 | * @param netHandler Net handler | 21 | * @param netHandler Net handler |
21 | * @param joinGamePacket Join game packet | 22 | * @param joinGamePacket Join game packet |
22 | - * @param serverData ServerData object representing the server being connected to | ||
23 | - * @param realmsServer If connecting to a realm, a reference to the RealmsServer object | 23 | + * @param serverData ServerData object representing the server being |
24 | + * connected to | ||
25 | + * @param realmsServer If connecting to a realm, a reference to the | ||
26 | + * RealmsServer object | ||
24 | */ | 27 | */ |
25 | public abstract void onJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer); | 28 | public abstract void onJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer); |
26 | } | 29 | } |
src/client/java/com/mumfrey/liteloader/OutboundChatFilter.java
@@ -8,7 +8,8 @@ package com.mumfrey.liteloader; | @@ -8,7 +8,8 @@ package com.mumfrey.liteloader; | ||
8 | public interface OutboundChatFilter extends LiteMod | 8 | public interface OutboundChatFilter extends LiteMod |
9 | { | 9 | { |
10 | /** | 10 | /** |
11 | - * Raised when a chat message is being sent, return false to filter this message or true to allow it to be sent | 11 | + * Raised when a chat message is being sent, return false to filter this |
12 | + * message or true to allow it to be sent. | ||
12 | * | 13 | * |
13 | * @param message | 14 | * @param message |
14 | */ | 15 | */ |
src/client/java/com/mumfrey/liteloader/OutboundChatListener.java
@@ -10,7 +10,8 @@ import net.minecraft.network.play.client.C01PacketChatMessage; | @@ -10,7 +10,8 @@ import net.minecraft.network.play.client.C01PacketChatMessage; | ||
10 | public interface OutboundChatListener extends LiteMod | 10 | public interface OutboundChatListener extends LiteMod |
11 | { | 11 | { |
12 | /** | 12 | /** |
13 | - * Raised when a new chat packet is created (not necessarily transmitted, something could be trolling us) | 13 | + * Raised when a new chat packet is created (not necessarily transmitted, |
14 | + * something could be trolling us). | ||
14 | * | 15 | * |
15 | * @param packet | 16 | * @param packet |
16 | * @param message | 17 | * @param message |
src/client/java/com/mumfrey/liteloader/PostLoginListener.java
@@ -10,8 +10,9 @@ import net.minecraft.network.login.server.S02PacketLoginSuccess; | @@ -10,8 +10,9 @@ import net.minecraft.network.login.server.S02PacketLoginSuccess; | ||
10 | public interface PostLoginListener extends LiteMod | 10 | public interface PostLoginListener extends LiteMod |
11 | { | 11 | { |
12 | /** | 12 | /** |
13 | - * Called immediately after login, before the player has properly joined the game. Note that this event is raised | ||
14 | - * <b>in the network thread</b> and is not marshalled to the main thread as other packet-generated events are. | 13 | + * Called immediately after login, before the player has properly joined the |
14 | + * game. Note that this event is raised <b>in the network thread</b> and is | ||
15 | + * not marshalled to the main thread as other packet-generated events are. | ||
15 | * | 16 | * |
16 | * @param netHandler | 17 | * @param netHandler |
17 | * @param packet | 18 | * @param packet |
src/client/java/com/mumfrey/liteloader/PreRenderListener.java
@@ -10,14 +10,16 @@ import net.minecraft.client.renderer.RenderGlobal; | @@ -10,14 +10,16 @@ import net.minecraft.client.renderer.RenderGlobal; | ||
10 | public interface PreRenderListener extends LiteMod | 10 | public interface PreRenderListener extends LiteMod |
11 | { | 11 | { |
12 | /** | 12 | /** |
13 | - * Called immediately before rendering of the world (including the sky) is started. | 13 | + * Called immediately before rendering of the world (including the sky) is |
14 | + * started. | ||
14 | * | 15 | * |
15 | * @param partialTicks | 16 | * @param partialTicks |
16 | */ | 17 | */ |
17 | public abstract void onRenderWorld(float partialTicks); | 18 | public abstract void onRenderWorld(float partialTicks); |
18 | 19 | ||
19 | /** | 20 | /** |
20 | - * Called <b>after</b> the world camera transform is initialised, may be called more than once per frame if anaglyph is enabled | 21 | + * Called <b>after</b> the world camera transform is initialised, may be |
22 | + * called more than once per frame if anaglyph is enabled. | ||
21 | * | 23 | * |
22 | * @param partialTicks | 24 | * @param partialTicks |
23 | * @param pass | 25 | * @param pass |
@@ -26,7 +28,8 @@ public interface PreRenderListener extends LiteMod | @@ -26,7 +28,8 @@ public interface PreRenderListener extends LiteMod | ||
26 | public abstract void onSetupCameraTransform(float partialTicks, int pass, long timeSlice); | 28 | public abstract void onSetupCameraTransform(float partialTicks, int pass, long timeSlice); |
27 | 29 | ||
28 | /** | 30 | /** |
29 | - * Called when the sky is rendered, may be called more than once per frame if anaglyph is enabled | 31 | + * Called when the sky is rendered, may be called more than once per frame |
32 | + * if anaglyph is enabled. | ||
30 | * | 33 | * |
31 | * @param partialTicks | 34 | * @param partialTicks |
32 | * @param pass | 35 | * @param pass |
@@ -34,7 +37,8 @@ public interface PreRenderListener extends LiteMod | @@ -34,7 +37,8 @@ public interface PreRenderListener extends LiteMod | ||
34 | public abstract void onRenderSky(float partialTicks, int pass); | 37 | public abstract void onRenderSky(float partialTicks, int pass); |
35 | 38 | ||
36 | /** | 39 | /** |
37 | - * Called immediately before the clouds are rendered, may be called more than once per frame if anaglyph is enabled | 40 | + * Called immediately before the clouds are rendered, may be called more |
41 | + * than once per frame if anaglyph is enabled. | ||
38 | * | 42 | * |
39 | * @param renderGlobal | 43 | * @param renderGlobal |
40 | * @param partialTicks | 44 | * @param partialTicks |
@@ -43,7 +47,8 @@ public interface PreRenderListener extends LiteMod | @@ -43,7 +47,8 @@ public interface PreRenderListener extends LiteMod | ||
43 | public abstract void onRenderClouds(float partialTicks, int pass, RenderGlobal renderGlobal); | 47 | public abstract void onRenderClouds(float partialTicks, int pass, RenderGlobal renderGlobal); |
44 | 48 | ||
45 | /** | 49 | /** |
46 | - * Called before the terrain is rendered, may be called more than once per frame if anaglyph is enabled | 50 | + * Called before the terrain is rendered, may be called more than once per |
51 | + * frame if anaglyph is enabled. | ||
47 | * | 52 | * |
48 | * @param partialTicks | 53 | * @param partialTicks |
49 | * @param pass | 54 | * @param pass |
src/client/java/com/mumfrey/liteloader/ScreenshotListener.java
@@ -13,15 +13,16 @@ import com.mumfrey.liteloader.core.LiteLoaderEventBroker.ReturnValue; | @@ -13,15 +13,16 @@ import com.mumfrey.liteloader.core.LiteLoaderEventBroker.ReturnValue; | ||
13 | public interface ScreenshotListener extends LiteMod | 13 | public interface ScreenshotListener extends LiteMod |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | - * Called when a screenshot is taken, mods should return FALSE to suspend further processing, or TRUE to allow | ||
17 | - * processing to continue normally | 16 | + * Called when a screenshot is taken, mods should return FALSE to suspend |
17 | + * further processing, or TRUE to allow processing to continue normally | ||
18 | * | 18 | * |
19 | * @param screenshotName | 19 | * @param screenshotName |
20 | * @param width | 20 | * @param width |
21 | * @param height | 21 | * @param height |
22 | * @param fbo | 22 | * @param fbo |
23 | * @param message Message to return if the event is cancelled | 23 | * @param message Message to return if the event is cancelled |
24 | - * @return FALSE to suspend further processing, or TRUE to allow processing to continue normally | 24 | + * @return FALSE to suspend further processing, or TRUE to allow processing |
25 | + * to continue normally | ||
25 | */ | 26 | */ |
26 | public boolean onSaveScreenshot(String screenshotName, int width, int height, Framebuffer fbo, ReturnValue<IChatComponent> message); | 27 | public boolean onSaveScreenshot(String screenshotName, int width, int height, Framebuffer fbo, ReturnValue<IChatComponent> message); |
27 | } | 28 | } |
src/client/java/com/mumfrey/liteloader/Tickable.java
@@ -15,7 +15,8 @@ public interface Tickable extends LiteMod | @@ -15,7 +15,8 @@ public interface Tickable extends LiteMod | ||
15 | * @param minecraft Minecraft instance | 15 | * @param minecraft Minecraft instance |
16 | * @param partialTicks Partial tick value | 16 | * @param partialTicks Partial tick value |
17 | * @param inGame True if in-game, false if in the menu | 17 | * @param inGame True if in-game, false if in the menu |
18 | - * @param clock True if this is a new tick, otherwise false if it's a regular frame | 18 | + * @param clock True if this is a new tick, otherwise false if it's a |
19 | + * regular frame | ||
19 | */ | 20 | */ |
20 | public abstract void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock); | 21 | public abstract void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock); |
21 | } | 22 | } |
src/client/java/com/mumfrey/liteloader/client/CallbackProxyClient.java
@@ -26,9 +26,10 @@ import com.mumfrey.liteloader.transformers.event.EventInfo; | @@ -26,9 +26,10 @@ import com.mumfrey.liteloader.transformers.event.EventInfo; | ||
26 | import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; | 26 | import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | - * Proxy class which handles the redirected calls from the injected callbacks and routes them to the | ||
30 | - * relevant liteloader handler classes. We do this rather than patching a bunch of bytecode into the packet | ||
31 | - * classes themselves because this is easier to maintain. | 29 | + * Proxy class which handles the redirected calls from the injected callbacks |
30 | + * and routes them to the relevant liteloader handler classes. We do this rather | ||
31 | + * than patching a bunch of bytecode into the packet classes themselves because | ||
32 | + * this is easier to maintain. | ||
32 | * | 33 | * |
33 | * @author Adam Mummery-Smith | 34 | * @author Adam Mummery-Smith |
34 | */ | 35 | */ |
@@ -50,7 +51,8 @@ public abstract class CallbackProxyClient extends CallbackProxyCommon | @@ -50,7 +51,8 @@ public abstract class CallbackProxyClient extends CallbackProxyCommon | ||
50 | 51 | ||
51 | if (CallbackProxyClient.clientEventBroker == null) | 52 | if (CallbackProxyClient.clientEventBroker == null) |
52 | { | 53 | { |
53 | - throw new RuntimeException("LiteLoader failed to start up properly. The game is in an unstable state and must shut down now. Check the developer log for startup errors"); | 54 | + throw new RuntimeException("LiteLoader failed to start up properly." |
55 | + + " The game is in an unstable state and must shut down now. Check the developer log for startup errors"); | ||
54 | } | 56 | } |
55 | 57 | ||
56 | CallbackProxyClient.clientEventBroker.onStartupComplete(); | 58 | CallbackProxyClient.clientEventBroker.onStartupComplete(); |
@@ -115,7 +117,8 @@ public abstract class CallbackProxyClient extends CallbackProxyCommon | @@ -115,7 +117,8 @@ public abstract class CallbackProxyClient extends CallbackProxyCommon | ||
115 | CallbackProxyClient.clientEventBroker.postRenderHUD(partialTicks); | 117 | CallbackProxyClient.clientEventBroker.postRenderHUD(partialTicks); |
116 | } | 118 | } |
117 | 119 | ||
118 | - public static void IntegratedServerCtor(EventInfo<IntegratedServer> e, Minecraft minecraft, String folderName, String worldName, WorldSettings worldSettings) | 120 | + public static void IntegratedServerCtor(EventInfo<IntegratedServer> e, Minecraft minecraft, String folderName, String worldName, |
121 | + WorldSettings worldSettings) | ||
119 | { | 122 | { |
120 | CallbackProxyClient.clientEventBroker.onStartServer(e.getSource(), folderName, worldName, worldSettings); | 123 | CallbackProxyClient.clientEventBroker.onStartServer(e.getSource(), folderName, worldName, worldSettings); |
121 | } | 124 | } |
@@ -185,24 +188,27 @@ public abstract class CallbackProxyClient extends CallbackProxyCommon | @@ -185,24 +188,27 @@ public abstract class CallbackProxyClient extends CallbackProxyCommon | ||
185 | CallbackProxyClient.clientEventBroker.onRenderTerrain(partialTicks, pass, timeSlice); | 188 | CallbackProxyClient.clientEventBroker.onRenderTerrain(partialTicks, pass, timeSlice); |
186 | } | 189 | } |
187 | 190 | ||
188 | - public static void onSaveScreenshot(ReturnEventInfo<ScreenShotHelper, IChatComponent> e, File gameDir, String name, int width, int height, Framebuffer fbo) | 191 | + public static void onSaveScreenshot(ReturnEventInfo<ScreenShotHelper, IChatComponent> e, File gameDir, String name, int width, int height, |
192 | + Framebuffer fbo) | ||
189 | { | 193 | { |
190 | CallbackProxyClient.clientEventBroker.onScreenshot(e, name, width, height, fbo); | 194 | CallbackProxyClient.clientEventBroker.onScreenshot(e, name, width, height, fbo); |
191 | } | 195 | } |
192 | 196 | ||
193 | - public static void onRenderEntity(ReturnEventInfo<RenderManager, Boolean> e, Entity entity, double xPos, double yPos, double zPos, float yaw, float partialTicks, boolean hideBoundingBox, Render render) | 197 | + public static void onRenderEntity(ReturnEventInfo<RenderManager, Boolean> e, Entity entity, double xPos, double yPos, double zPos, float yaw, |
198 | + float partialTicks, boolean hideBoundingBox, Render render) | ||
194 | { | 199 | { |
195 | CallbackProxyClient.clientEventBroker.onRenderEntity(e.getSource(), entity, xPos, yPos, zPos, yaw, partialTicks, render); | 200 | CallbackProxyClient.clientEventBroker.onRenderEntity(e.getSource(), entity, xPos, yPos, zPos, yaw, partialTicks, render); |
196 | } | 201 | } |
197 | 202 | ||
198 | - public static void onPostRenderEntity(ReturnEventInfo<RenderManager, Boolean> e, Entity entity, double xPos, double yPos, double zPos, float yaw, float partialTicks, boolean hideBoundingBox, Render render) | 203 | + public static void onPostRenderEntity(ReturnEventInfo<RenderManager, Boolean> e, Entity entity, double xPos, double yPos, double zPos, float yaw, |
204 | + float partialTicks, boolean hideBoundingBox, Render render) | ||
199 | { | 205 | { |
200 | CallbackProxyClient.clientEventBroker.onPostRenderEntity(e.getSource(), entity, xPos, yPos, zPos, yaw, partialTicks, render); | 206 | CallbackProxyClient.clientEventBroker.onPostRenderEntity(e.getSource(), entity, xPos, yPos, zPos, yaw, partialTicks, render); |
201 | } | 207 | } |
202 | 208 | ||
203 | /** | 209 | /** |
204 | - * Compatiblbe behaviour with FML, this method is called to generate a consistent offline UUID between client and server | ||
205 | - * for a given username. | 210 | + * Compatiblbe behaviour with FML, this method is called to generate a |
211 | + * consistent offline UUID between client and server for a given username. | ||
206 | */ | 212 | */ |
207 | public static void generateOfflineUUID(ReturnEventInfo<Session, GameProfile> e) | 213 | public static void generateOfflineUUID(ReturnEventInfo<Session, GameProfile> e) |
208 | { | 214 | { |
src/client/java/com/mumfrey/liteloader/client/ClientPluginChannelsClient.java
@@ -86,7 +86,9 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | @@ -86,7 +86,9 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | ||
86 | protected boolean send(String channel, PacketBuffer data, ChannelPolicy policy) | 86 | protected boolean send(String channel, PacketBuffer data, ChannelPolicy policy) |
87 | { | 87 | { |
88 | if (channel == null || channel.length() > 16 || CHANNEL_REGISTER.equals(channel) || CHANNEL_UNREGISTER.equals(channel)) | 88 | if (channel == null || channel.length() > 16 || CHANNEL_REGISTER.equals(channel) || CHANNEL_UNREGISTER.equals(channel)) |
89 | + { | ||
89 | throw new RuntimeException("Invalid channel name specified"); | 90 | throw new RuntimeException("Invalid channel name specified"); |
91 | + } | ||
90 | 92 | ||
91 | if (!policy.allows(this, channel)) | 93 | if (!policy.allows(this, channel)) |
92 | { | 94 | { |
src/client/java/com/mumfrey/liteloader/client/GameEngineClient.java
@@ -148,7 +148,8 @@ public class GameEngineClient implements GameEngine<Minecraft, IntegratedServer> | @@ -148,7 +148,8 @@ public class GameEngineClient implements GameEngine<Minecraft, IntegratedServer> | ||
148 | } | 148 | } |
149 | 149 | ||
150 | /* (non-Javadoc) | 150 | /* (non-Javadoc) |
151 | - * @see com.mumfrey.liteloader.common.GameEngine#setKeyBindings(java.util.List) | 151 | + * @see com.mumfrey.liteloader.common.GameEngine |
152 | + * #setKeyBindings(java.util.List) | ||
152 | */ | 153 | */ |
153 | @Override | 154 | @Override |
154 | public void setKeyBindings(List<KeyBinding> keyBindings) | 155 | public void setKeyBindings(List<KeyBinding> keyBindings) |
src/client/java/com/mumfrey/liteloader/client/LiteLoaderCoreProviderClient.java
1 | package com.mumfrey.liteloader.client; | 1 | package com.mumfrey.liteloader.client; |
2 | 2 | ||
3 | +import net.minecraft.client.audio.SoundHandler; | ||
3 | import net.minecraft.client.resources.IResourceManager; | 4 | import net.minecraft.client.resources.IResourceManager; |
4 | import net.minecraft.client.resources.IResourcePack; | 5 | import net.minecraft.client.resources.IResourcePack; |
5 | import net.minecraft.client.resources.SimpleReloadableResourceManager; | 6 | import net.minecraft.client.resources.SimpleReloadableResourceManager; |
@@ -28,12 +29,15 @@ public class LiteLoaderCoreProviderClient implements CoreProvider | @@ -28,12 +29,15 @@ public class LiteLoaderCoreProviderClient implements CoreProvider | ||
28 | private final LoaderProperties properties; | 29 | private final LoaderProperties properties; |
29 | 30 | ||
30 | /** | 31 | /** |
31 | - * Read from the properties file, if true we will inhibit the sound manager reload during startup to avoid getting in trouble with OpenAL | 32 | + * Read from the properties file, if true we will inhibit the sound manager |
33 | + * reload during startup to avoid getting in trouble with OpenAL. | ||
32 | */ | 34 | */ |
33 | private boolean inhibitSoundManagerReload = true; | 35 | private boolean inhibitSoundManagerReload = true; |
34 | 36 | ||
35 | /** | 37 | /** |
36 | - * If inhibit is enabled, this object is used to reflectively inhibit the sound manager's reload process during startup by removing it from the reloadables list | 38 | + * If inhibit is enabled, this object is used to reflectively inhibit the |
39 | + * sound manager's reload process during startup by removing it from the | ||
40 | + * reloadables list. | ||
37 | */ | 41 | */ |
38 | private SoundHandlerReloadInhibitor soundHandlerReloadInhibitor; | 42 | private SoundHandlerReloadInhibitor soundHandlerReloadInhibitor; |
39 | 43 | ||
@@ -52,7 +56,9 @@ public class LiteLoaderCoreProviderClient implements CoreProvider | @@ -52,7 +56,9 @@ public class LiteLoaderCoreProviderClient implements CoreProvider | ||
52 | @Override | 56 | @Override |
53 | public void onPostInit(GameEngine<?, ?> engine) | 57 | public void onPostInit(GameEngine<?, ?> engine) |
54 | { | 58 | { |
55 | - this.soundHandlerReloadInhibitor = new SoundHandlerReloadInhibitor((SimpleReloadableResourceManager)engine.getResources().getResourceManager(), ((GameEngineClient)engine).getSoundHandler()); | 59 | + SimpleReloadableResourceManager resourceManager = (SimpleReloadableResourceManager)engine.getResources().getResourceManager(); |
60 | + SoundHandler soundHandler = ((GameEngineClient)engine).getSoundHandler(); | ||
61 | + this.soundHandlerReloadInhibitor = new SoundHandlerReloadInhibitor(resourceManager, soundHandler); | ||
56 | 62 | ||
57 | if (this.inhibitSoundManagerReload) | 63 | if (this.inhibitSoundManagerReload) |
58 | { | 64 | { |
src/client/java/com/mumfrey/liteloader/client/LiteLoaderEventBrokerClient.java
@@ -36,7 +36,7 @@ import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; | @@ -36,7 +36,7 @@ import com.mumfrey.liteloader.transformers.event.ReturnEventInfo; | ||
36 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | 36 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; |
37 | 37 | ||
38 | public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft, IntegratedServer> implements IResourceManagerReloadListener | 38 | public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft, IntegratedServer> implements IResourceManagerReloadListener |
39 | -{ | 39 | +{ |
40 | private static LiteLoaderEventBrokerClient instance; | 40 | private static LiteLoaderEventBrokerClient instance; |
41 | 41 | ||
42 | /** | 42 | /** |
@@ -60,8 +60,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -60,8 +60,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
60 | private boolean wasFullScreen = false; | 60 | private boolean wasFullScreen = false; |
61 | 61 | ||
62 | /** | 62 | /** |
63 | - * Hash code of the current world. We don't store the world reference here because we don't want | ||
64 | - * to mess with world GC by mistake | 63 | + * Hash code of the current world. We don't store the world reference |
64 | + * here because we don't want to mess with world GC by mistake. | ||
65 | */ | 65 | */ |
66 | private int worldHashCode = 0; | 66 | private int worldHashCode = 0; |
67 | 67 | ||
@@ -76,8 +76,10 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -76,8 +76,10 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
76 | private FastIterableDeque<ViewportListener> viewportListeners = new HandlerList<ViewportListener>(ViewportListener.class); | 76 | private FastIterableDeque<ViewportListener> viewportListeners = new HandlerList<ViewportListener>(ViewportListener.class); |
77 | private FastIterableDeque<FrameBufferListener> frameBufferListeners = new HandlerList<FrameBufferListener>(FrameBufferListener.class); | 77 | private FastIterableDeque<FrameBufferListener> frameBufferListeners = new HandlerList<FrameBufferListener>(FrameBufferListener.class); |
78 | private FastIterableDeque<InitCompleteListener> initListeners = new HandlerList<InitCompleteListener>(InitCompleteListener.class); | 78 | private FastIterableDeque<InitCompleteListener> initListeners = new HandlerList<InitCompleteListener>(InitCompleteListener.class); |
79 | - private FastIterableDeque<OutboundChatFilter> outboundChatFilters = new HandlerList<OutboundChatFilter>(OutboundChatFilter.class, ReturnLogicOp.AND); | ||
80 | - private FastIterableDeque<ScreenshotListener> screenshotListeners = new HandlerList<ScreenshotListener>(ScreenshotListener.class, ReturnLogicOp.AND_BREAK_ON_FALSE); | 79 | + private FastIterableDeque<OutboundChatFilter> outboundChatFilters = new HandlerList<OutboundChatFilter>(OutboundChatFilter.class, |
80 | + ReturnLogicOp.AND); | ||
81 | + private FastIterableDeque<ScreenshotListener> screenshotListeners = new HandlerList<ScreenshotListener>(ScreenshotListener.class, | ||
82 | + ReturnLogicOp.AND_BREAK_ON_FALSE); | ||
81 | private FastIterableDeque<EntityRenderListener> entityRenderListeners = new HandlerList<EntityRenderListener>(EntityRenderListener.class); | 83 | private FastIterableDeque<EntityRenderListener> entityRenderListeners = new HandlerList<EntityRenderListener>(EntityRenderListener.class); |
82 | 84 | ||
83 | @SuppressWarnings("cast") | 85 | @SuppressWarnings("cast") |
@@ -103,7 +105,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -103,7 +105,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
103 | } | 105 | } |
104 | 106 | ||
105 | /* (non-Javadoc) | 107 | /* (non-Javadoc) |
106 | - * @see com.mumfrey.liteloader.api.InterfaceProvider#registerInterfaces(com.mumfrey.liteloader.core.InterfaceRegistrationDelegate) | 108 | + * @see com.mumfrey.liteloader.api.InterfaceProvider#registerInterfaces( |
109 | + * com.mumfrey.liteloader.core.InterfaceRegistrationDelegate) | ||
107 | */ | 110 | */ |
108 | @Override | 111 | @Override |
109 | public void registerInterfaces(InterfaceRegistrationDelegate delegate) | 112 | public void registerInterfaces(InterfaceRegistrationDelegate delegate) |
@@ -540,7 +543,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -540,7 +543,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
540 | * @param partialTicks | 543 | * @param partialTicks |
541 | * @param render | 544 | * @param render |
542 | */ | 545 | */ |
543 | - public void onRenderEntity(RenderManager source, Entity entity, double xPos, double yPos, double zPos, float yaw, float partialTicks, Render render) | 546 | + public void onRenderEntity(RenderManager source, Entity entity, double xPos, double yPos, double zPos, float yaw, float partialTicks, |
547 | + Render render) | ||
544 | { | 548 | { |
545 | this.entityRenderListeners.all().onRenderEntity(render, entity, xPos, yPos, zPos, yaw, partialTicks); | 549 | this.entityRenderListeners.all().onRenderEntity(render, entity, xPos, yPos, zPos, yaw, partialTicks); |
546 | } | 550 | } |
@@ -555,7 +559,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -555,7 +559,8 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
555 | * @param partialTicks | 559 | * @param partialTicks |
556 | * @param render | 560 | * @param render |
557 | */ | 561 | */ |
558 | - public void onPostRenderEntity(RenderManager source, Entity entity, double xPos, double yPos, double zPos, float yaw, float partialTicks, Render render) | 562 | + public void onPostRenderEntity(RenderManager source, Entity entity, double xPos, double yPos, double zPos, float yaw, float partialTicks, |
563 | + Render render) | ||
559 | { | 564 | { |
560 | this.entityRenderListeners.all().onPostRenderEntity(render, entity, xPos, yPos, zPos, yaw, partialTicks); | 565 | this.entityRenderListeners.all().onPostRenderEntity(render, entity, xPos, yPos, zPos, yaw, partialTicks); |
561 | } | 566 | } |
src/client/java/com/mumfrey/liteloader/client/LiteLoaderPanelManager.java
@@ -41,7 +41,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -41,7 +41,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
41 | private Minecraft minecraft; | 41 | private Minecraft minecraft; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | - * Setting which determines whether we show the "mod info" screen tab in the main menu | 44 | + * Setting which determines whether we show the "mod info" screen tab in the |
45 | + * main menu. | ||
45 | */ | 46 | */ |
46 | private boolean displayModInfoScreenTab = true; | 47 | private boolean displayModInfoScreenTab = true; |
47 | 48 | ||
@@ -51,8 +52,9 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -51,8 +52,9 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
51 | private boolean tabAlwaysExpanded = false; | 52 | private boolean tabAlwaysExpanded = false; |
52 | 53 | ||
53 | /** | 54 | /** |
54 | - * Override for the "mod info" tab setting, so that mods which want to handle the mod info themselves | ||
55 | - * can temporarily disable the function without having to change the underlying property | 55 | + * Override for the "mod info" tab setting, so that mods which want to |
56 | + * handle the mod info themselves can temporarily disable the function | ||
57 | + * without having to change the underlying property. | ||
56 | */ | 58 | */ |
57 | private boolean hideModInfoScreenTab = false; | 59 | private boolean hideModInfoScreenTab = false; |
58 | 60 | ||
@@ -61,8 +63,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -61,8 +63,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
61 | private String notification; | 63 | private String notification; |
62 | 64 | ||
63 | /** | 65 | /** |
64 | - * Active "mod info" screen, drawn as an overlay when in the main menu and made the active screen if | ||
65 | - * the user clicks the tab | 66 | + * Active "mod info" screen, drawn as an overlay when in the main menu and |
67 | + * made the active screen if the user clicks the tab. | ||
66 | */ | 68 | */ |
67 | private GuiLiteLoaderPanel panelHost; | 69 | private GuiLiteLoaderPanel panelHost; |
68 | 70 | ||
@@ -114,7 +116,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -114,7 +116,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
114 | } | 116 | } |
115 | 117 | ||
116 | /* (non-Javadoc) | 118 | /* (non-Javadoc) |
117 | - * @see com.mumfrey.liteloader.api.TickObserver#onTick(boolean, float, boolean) | 119 | + * @see com.mumfrey.liteloader.api.TickObserver |
120 | + * #onTick(boolean, float, boolean) | ||
118 | */ | 121 | */ |
119 | @Override | 122 | @Override |
120 | public void onTick(boolean clock, float partialTicks, boolean inGame) | 123 | public void onTick(boolean clock, float partialTicks, boolean inGame) |
@@ -140,7 +143,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -140,7 +143,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
140 | } | 143 | } |
141 | 144 | ||
142 | /* (non-Javadoc) | 145 | /* (non-Javadoc) |
143 | - * @see com.mumfrey.liteloader.api.PostRenderObserver#onPostRender(int, int, float) | 146 | + * @see com.mumfrey.liteloader.api.PostRenderObserver |
147 | + * #onPostRender(int, int, float) | ||
144 | */ | 148 | */ |
145 | @Override | 149 | @Override |
146 | public void onPostRender(int mouseX, int mouseY, float partialTicks) | 150 | public void onPostRender(int mouseX, int mouseY, float partialTicks) |
@@ -149,12 +153,14 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -149,12 +153,14 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
149 | 153 | ||
150 | boolean tabHidden = this.isTabHidden() && this.minecraft.currentScreen instanceof GuiMainMenu; | 154 | boolean tabHidden = this.isTabHidden() && this.minecraft.currentScreen instanceof GuiMainMenu; |
151 | 155 | ||
152 | - if (this.isPanelSupportedOnScreen(this.minecraft.currentScreen) && ((this.displayModInfoScreenTab && !tabHidden) || (this.panelHost != null && this.panelHost.isOpen()))) | 156 | + if (this.isPanelSupportedOnScreen(this.minecraft.currentScreen) |
157 | + && ((this.displayModInfoScreenTab && !tabHidden) || (this.panelHost != null && this.panelHost.isOpen()))) | ||
153 | { | 158 | { |
154 | // If we're at the main menu, prepare the overlay | 159 | // If we're at the main menu, prepare the overlay |
155 | if (this.panelHost == null || this.panelHost.getScreen() != this.minecraft.currentScreen) | 160 | if (this.panelHost == null || this.panelHost.getScreen() != this.minecraft.currentScreen) |
156 | { | 161 | { |
157 | - this.panelHost = new GuiLiteLoaderPanel(this.minecraft, this.minecraft.currentScreen, this.mods, this.environment, this.properties, this.configManager, !tabHidden); | 162 | + this.panelHost = new GuiLiteLoaderPanel(this.minecraft, this.minecraft.currentScreen, this.mods, this.environment, this.properties, |
163 | + this.configManager, !tabHidden); | ||
158 | if (this.notification != null) | 164 | if (this.notification != null) |
159 | { | 165 | { |
160 | this.panelHost.setNotification(this.notification); | 166 | this.panelHost.setNotification(this.notification); |
@@ -170,14 +176,18 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -170,14 +176,18 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
170 | this.panelHost.release(); | 176 | this.panelHost.release(); |
171 | this.panelHost = null; | 177 | this.panelHost = null; |
172 | } | 178 | } |
173 | - else if (this.isPanelSupportedOnScreen(this.minecraft.currentScreen) && Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && Keyboard.isKeyDown(Keyboard.KEY_TAB)) | 179 | + else if (this.isPanelSupportedOnScreen(this.minecraft.currentScreen) |
180 | + && Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) | ||
181 | + && Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) | ||
182 | + && Keyboard.isKeyDown(Keyboard.KEY_TAB)) | ||
174 | { | 183 | { |
175 | this.displayLiteLoaderPanel(this.minecraft.currentScreen); | 184 | this.displayLiteLoaderPanel(this.minecraft.currentScreen); |
176 | } | 185 | } |
177 | } | 186 | } |
178 | 187 | ||
179 | /** | 188 | /** |
180 | - * Set the "mod info" screen tab to hidden, regardless of the property setting | 189 | + * Set the "mod info" screen tab to hidden, regardless of the property |
190 | + * setting. | ||
181 | */ | 191 | */ |
182 | @Override | 192 | @Override |
183 | public void hideTab() | 193 | public void hideTab() |
@@ -247,7 +257,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | @@ -247,7 +257,8 @@ public class LiteLoaderPanelManager implements PanelManager<GuiScreen> | ||
247 | { | 257 | { |
248 | if (this.isPanelSupportedOnScreen(parentScreen)) | 258 | if (this.isPanelSupportedOnScreen(parentScreen)) |
249 | { | 259 | { |
250 | - this.panelHost = new GuiLiteLoaderPanel(this.minecraft, parentScreen, this.mods, this.environment, this.properties, this.configManager, !this.isTabHidden()); | 260 | + this.panelHost = new GuiLiteLoaderPanel(this.minecraft, parentScreen, this.mods, this.environment, this.properties, |
261 | + this.configManager, !this.isTabHidden()); | ||
251 | this.minecraft.displayGuiScreen(this.panelHost); | 262 | this.minecraft.displayGuiScreen(this.panelHost); |
252 | } | 263 | } |
253 | } | 264 | } |
src/client/java/com/mumfrey/liteloader/client/PacketEventsClient.java
@@ -45,11 +45,13 @@ public class PacketEventsClient extends PacketEvents | @@ -45,11 +45,13 @@ public class PacketEventsClient extends PacketEvents | ||
45 | { | 45 | { |
46 | private static RealmsServer joiningRealm; | 46 | private static RealmsServer joiningRealm; |
47 | 47 | ||
48 | - private FastIterableDeque<JoinGameListener> joinGameListeners = new HandlerList<JoinGameListener>(JoinGameListener.class); | ||
49 | - private FastIterableDeque<ChatListener> chatListeners = new HandlerList<ChatListener>(ChatListener.class); | ||
50 | - private FastIterableDeque<ChatFilter> chatFilters = new HandlerList<ChatFilter>(ChatFilter.class, ReturnLogicOp.AND_BREAK_ON_FALSE); | ||
51 | - private FastIterableDeque<PreJoinGameListener> preJoinGameListeners = new HandlerList<PreJoinGameListener>(PreJoinGameListener.class, ReturnLogicOp.AND_BREAK_ON_FALSE); | ||
52 | - private FastIterableDeque<PostLoginListener> postLoginListeners = new HandlerList<PostLoginListener>(PostLoginListener.class); | 48 | + private FastIterableDeque<JoinGameListener> joinGameListeners = new HandlerList<JoinGameListener>(JoinGameListener.class); |
49 | + private FastIterableDeque<ChatListener> chatListeners = new HandlerList<ChatListener>(ChatListener.class); | ||
50 | + private FastIterableDeque<ChatFilter> chatFilters = new HandlerList<ChatFilter>(ChatFilter.class, | ||
51 | + ReturnLogicOp.AND_BREAK_ON_FALSE); | ||
52 | + private FastIterableDeque<PreJoinGameListener> preJoinGameListeners = new HandlerList<PreJoinGameListener>(PreJoinGameListener.class, | ||
53 | + ReturnLogicOp.AND_BREAK_ON_FALSE); | ||
54 | + private FastIterableDeque<PostLoginListener> postLoginListeners = new HandlerList<PostLoginListener>(PostLoginListener.class); | ||
53 | 55 | ||
54 | @Override | 56 | @Override |
55 | public void registerInterfaces(InterfaceRegistrationDelegate delegate) | 57 | public void registerInterfaces(InterfaceRegistrationDelegate delegate) |
@@ -86,7 +88,8 @@ public class PacketEventsClient extends PacketEvents | @@ -86,7 +88,8 @@ public class PacketEventsClient extends PacketEvents | ||
86 | { | 88 | { |
87 | if (chatListener instanceof ChatFilter) | 89 | if (chatListener instanceof ChatFilter) |
88 | { | 90 | { |
89 | - LiteLoaderLogger.warning("Interface error initialising mod '%1s'. A mod implementing ChatFilter and ChatListener is not supported! Remove one of these interfaces", chatListener.getName()); | 91 | + LiteLoaderLogger.warning("Interface error initialising mod '%1s'. A mod implementing ChatFilter and ChatListener is not supported! " |
92 | + + "Remove one of these interfaces", chatListener.getName()); | ||
90 | } | 93 | } |
91 | else | 94 | else |
92 | { | 95 | { |
@@ -127,7 +130,10 @@ public class PacketEventsClient extends PacketEvents | @@ -127,7 +130,10 @@ public class PacketEventsClient extends PacketEvents | ||
127 | } | 130 | } |
128 | 131 | ||
129 | /* (non-Javadoc) | 132 | /* (non-Javadoc) |
130 | - * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket(com.mumfrey.liteloader.common.transformers.PacketEventInfo, net.minecraft.network.INetHandler, net.minecraft.network.play.server.S01PacketJoinGame) | 133 | + * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket( |
134 | + * com.mumfrey.liteloader.common.transformers.PacketEventInfo, | ||
135 | + * net.minecraft.network.INetHandler, | ||
136 | + * net.minecraft.network.play.server.S01PacketJoinGame) | ||
131 | */ | 137 | */ |
132 | @Override | 138 | @Override |
133 | protected void handlePacket(PacketEventInfo<Packet> e, INetHandler netHandler, S01PacketJoinGame packet) | 139 | protected void handlePacket(PacketEventInfo<Packet> e, INetHandler netHandler, S01PacketJoinGame packet) |
@@ -179,7 +185,10 @@ public class PacketEventsClient extends PacketEvents | @@ -179,7 +185,10 @@ public class PacketEventsClient extends PacketEvents | ||
179 | } | 185 | } |
180 | 186 | ||
181 | /* (non-Javadoc) | 187 | /* (non-Javadoc) |
182 | - * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket(com.mumfrey.liteloader.common.transformers.PacketEventInfo, net.minecraft.network.INetHandler, net.minecraft.network.login.server.S02PacketLoginSuccess) | 188 | + * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket( |
189 | + * com.mumfrey.liteloader.common.transformers.PacketEventInfo, | ||
190 | + * net.minecraft.network.INetHandler, | ||
191 | + * net.minecraft.network.login.server.S02PacketLoginSuccess) | ||
183 | */ | 192 | */ |
184 | @Override | 193 | @Override |
185 | protected void handlePacket(PacketEventInfo<Packet> e, INetHandler netHandler, S02PacketLoginSuccess packet) | 194 | protected void handlePacket(PacketEventInfo<Packet> e, INetHandler netHandler, S02PacketLoginSuccess packet) |
@@ -199,13 +208,18 @@ public class PacketEventsClient extends PacketEvents | @@ -199,13 +208,18 @@ public class PacketEventsClient extends PacketEvents | ||
199 | } | 208 | } |
200 | 209 | ||
201 | /* (non-Javadoc) | 210 | /* (non-Javadoc) |
202 | - * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket(com.mumfrey.liteloader.common.transformers.PacketEventInfo, net.minecraft.network.INetHandler, net.minecraft.network.play.server.S02PacketChat) | 211 | + * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket( |
212 | + * com.mumfrey.liteloader.common.transformers.PacketEventInfo, | ||
213 | + * net.minecraft.network.INetHandler, | ||
214 | + * net.minecraft.network.play.server.S02PacketChat) | ||
203 | */ | 215 | */ |
204 | @Override | 216 | @Override |
205 | protected void handlePacket(PacketEventInfo<Packet> e, INetHandler netHandler, S02PacketChat packet) | 217 | protected void handlePacket(PacketEventInfo<Packet> e, INetHandler netHandler, S02PacketChat packet) |
206 | { | 218 | { |
207 | if (packet.getChatComponent() == null) | 219 | if (packet.getChatComponent() == null) |
220 | + { | ||
208 | return; | 221 | return; |
222 | + } | ||
209 | 223 | ||
210 | IChatComponent originalChat = packet.getChatComponent(); | 224 | IChatComponent originalChat = packet.getChatComponent(); |
211 | IChatComponent chat = originalChat; | 225 | IChatComponent chat = originalChat; |
src/client/java/com/mumfrey/liteloader/client/ResourceObserver.java
@@ -50,7 +50,8 @@ public class ResourceObserver implements ModLoadObserver | @@ -50,7 +50,8 @@ public class ResourceObserver implements ModLoadObserver | ||
50 | { | 50 | { |
51 | LiteLoaderLogger.info("Adding \"%s\" to active resource pack set", container.getLocation()); | 51 | LiteLoaderLogger.info("Adding \"%s\" to active resource pack set", container.getLocation()); |
52 | IResourcePack resourcePack = this.initResourcePack(container, modName); | 52 | IResourcePack resourcePack = this.initResourcePack(container, modName); |
53 | - Resources<IResourceManager, IResourcePack> resources = (Resources<IResourceManager, IResourcePack>)LiteLoader.getGameEngine().getResources(); | 53 | + Resources<IResourceManager, IResourcePack> resources |
54 | + = (Resources<IResourceManager, IResourcePack>)LiteLoader.getGameEngine().getResources(); | ||
54 | if (resources.registerResourcePack(resourcePack)) | 55 | if (resources.registerResourcePack(resourcePack)) |
55 | { | 56 | { |
56 | LiteLoaderLogger.info("Successfully added \"%s\" to active resource pack set", container.getLocation()); | 57 | LiteLoaderLogger.info("Successfully added \"%s\" to active resource pack set", container.getLocation()); |
@@ -66,7 +67,8 @@ public class ResourceObserver implements ModLoadObserver | @@ -66,7 +67,8 @@ public class ResourceObserver implements ModLoadObserver | ||
66 | { | 67 | { |
67 | if (container.isDirectory()) | 68 | if (container.isDirectory()) |
68 | { | 69 | { |
69 | - LiteLoaderLogger.info("Setting up \"%s/%s\" as mod resource pack with identifier \"%s\"", container.toFile().getParentFile().getName(), container.getName(), name); | 70 | + LiteLoaderLogger.info("Setting up \"%s/%s\" as mod resource pack with identifier \"%s\"", |
71 | + container.toFile().getParentFile().getName(), container.getName(), name); | ||
70 | resourcePack = new ModResourcePackDir(name, container.toFile()); | 72 | resourcePack = new ModResourcePackDir(name, container.toFile()); |
71 | } | 73 | } |
72 | else | 74 | else |
src/client/java/com/mumfrey/liteloader/client/ResourcesClient.java
@@ -22,7 +22,8 @@ public class ResourcesClient implements Resources<IResourceManager, IResourcePac | @@ -22,7 +22,8 @@ public class ResourcesClient implements Resources<IResourceManager, IResourcePac | ||
22 | private final Map<String, IResourcePack> registeredResourcePacks = new HashMap<String, IResourcePack>(); | 22 | private final Map<String, IResourcePack> registeredResourcePacks = new HashMap<String, IResourcePack>(); |
23 | 23 | ||
24 | /** | 24 | /** |
25 | - * True while initialising mods if we need to do a resource manager reload once the process is completed | 25 | + * True while initialising mods if we need to do a resource manager reload |
26 | + * once the process is completed. | ||
26 | */ | 27 | */ |
27 | private boolean pendingResourceReload; | 28 | private boolean pendingResourceReload; |
28 | 29 | ||
@@ -50,7 +51,8 @@ public class ResourcesClient implements Resources<IResourceManager, IResourcePac | @@ -50,7 +51,8 @@ public class ResourcesClient implements Resources<IResourceManager, IResourcePac | ||
50 | } | 51 | } |
51 | 52 | ||
52 | /* (non-Javadoc) | 53 | /* (non-Javadoc) |
53 | - * @see com.mumfrey.liteloader.common.GameEngine#registerResourcePack(net.minecraft.client.resources.IResourcePack) | 54 | + * @see com.mumfrey.liteloader.common.GameEngine#registerResourcePack( |
55 | + * net.minecraft.client.resources.IResourcePack) | ||
54 | */ | 56 | */ |
55 | @Override | 57 | @Override |
56 | public boolean registerResourcePack(IResourcePack resourcePack) | 58 | public boolean registerResourcePack(IResourcePack resourcePack) |
@@ -72,7 +74,8 @@ public class ResourcesClient implements Resources<IResourceManager, IResourcePac | @@ -72,7 +74,8 @@ public class ResourcesClient implements Resources<IResourceManager, IResourcePac | ||
72 | } | 74 | } |
73 | 75 | ||
74 | /* (non-Javadoc) | 76 | /* (non-Javadoc) |
75 | - * @see com.mumfrey.liteloader.common.GameEngine#unRegisterResourcePack(net.minecraft.client.resources.IResourcePack) | 77 | + * @see com.mumfrey.liteloader.common.GameEngine#unRegisterResourcePack( |
78 | + * net.minecraft.client.resources.IResourcePack) | ||
76 | */ | 79 | */ |
77 | @Override | 80 | @Override |
78 | public boolean unRegisterResourcePack(IResourcePack resourcePack) | 81 | public boolean unRegisterResourcePack(IResourcePack resourcePack) |
src/client/java/com/mumfrey/liteloader/client/SoundHandlerReloadInhibitor.java
@@ -10,7 +10,8 @@ import com.mumfrey.liteloader.client.util.PrivateFieldsClient; | @@ -10,7 +10,8 @@ import com.mumfrey.liteloader.client.util.PrivateFieldsClient; | ||
10 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | 10 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; |
11 | 11 | ||
12 | /** | 12 | /** |
13 | - * Manager object which handles inhibiting the sound handler's reload notification at startup | 13 | + * Manager object which handles inhibiting the sound handler's reload |
14 | + * notification at startup. | ||
14 | * | 15 | * |
15 | * @author Adam Mummery-Smith | 16 | * @author Adam Mummery-Smith |
16 | */ | 17 | */ |
@@ -32,7 +33,8 @@ public class SoundHandlerReloadInhibitor | @@ -32,7 +33,8 @@ public class SoundHandlerReloadInhibitor | ||
32 | private boolean inhibited; | 33 | private boolean inhibited; |
33 | 34 | ||
34 | /** | 35 | /** |
35 | - * So that we can re-insert the sound manager at the same index, we store the index we remove it from | 36 | + * So that we can re-insert the sound manager at the same index, we store |
37 | + * the index we remove it from. | ||
36 | */ | 38 | */ |
37 | private int storedIndex; | 39 | private int storedIndex; |
38 | 40 |
src/client/java/com/mumfrey/liteloader/client/Translator.java
@@ -7,7 +7,8 @@ import com.mumfrey.liteloader.api.TranslationProvider; | @@ -7,7 +7,8 @@ import com.mumfrey.liteloader.api.TranslationProvider; | ||
7 | public class Translator implements TranslationProvider | 7 | public class Translator implements TranslationProvider |
8 | { | 8 | { |
9 | /* (non-Javadoc) | 9 | /* (non-Javadoc) |
10 | - * @see com.mumfrey.liteloader.api.TranslationProvider#translate(java.lang.String, java.lang.Object[]) | 10 | + * @see com.mumfrey.liteloader.api.TranslationProvider#translate( |
11 | + * java.lang.String, java.lang.Object[]) | ||
11 | */ | 12 | */ |
12 | @Override | 13 | @Override |
13 | public String translate(String key, Object... args) | 14 | public String translate(String key, Object... args) |
@@ -17,7 +18,8 @@ public class Translator implements TranslationProvider | @@ -17,7 +18,8 @@ public class Translator implements TranslationProvider | ||
17 | } | 18 | } |
18 | 19 | ||
19 | /* (non-Javadoc) | 20 | /* (non-Javadoc) |
20 | - * @see com.mumfrey.liteloader.api.TranslationProvider#translate(java.lang.String, java.lang.String, java.lang.Object[]) | 21 | + * @see com.mumfrey.liteloader.api.TranslationProvider#translate( |
22 | + * java.lang.String, java.lang.String, java.lang.Object[]) | ||
21 | */ | 23 | */ |
22 | @Override | 24 | @Override |
23 | public String translate(String locale, String key, Object... args) | 25 | public String translate(String locale, String key, Object... args) |
src/client/java/com/mumfrey/liteloader/client/api/LiteLoaderBrandingProvider.java
@@ -20,9 +20,13 @@ public class LiteLoaderBrandingProvider implements BrandingProvider | @@ -20,9 +20,13 @@ public class LiteLoaderBrandingProvider implements BrandingProvider | ||
20 | public static final int BRANDING_COLOUR = 0xFF4785D1; | 20 | public static final int BRANDING_COLOUR = 0xFF4785D1; |
21 | 21 | ||
22 | public static final ResourceLocation ABOUT_TEXTURE = new ResourceLocation("liteloader", "textures/gui/about.png"); | 22 | public static final ResourceLocation ABOUT_TEXTURE = new ResourceLocation("liteloader", "textures/gui/about.png"); |
23 | - public static final IconAbsolute LOGO_COORDS = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, "logo", 128, 40, 0, 0, 256, 80); | ||
24 | - public static final IconAbsolute ICON_COORDS = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, "chicken", 32, 45, 0, 80, 64, 170); | ||
25 | - public static final IconAbsolute TWITTER_AVATAR_COORDS = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, "twitter_avatar", 32, 32, 192, 80, 256, 144); | 23 | + |
24 | + public static final IconAbsolute LOGO_COORDS = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, | ||
25 | + "logo", 128, 40, 0, 0, 256, 80); | ||
26 | + public static final IconAbsolute ICON_COORDS = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, | ||
27 | + "chicken", 32, 45, 0, 80, 64, 170); | ||
28 | + public static final IconAbsolute TWITTER_AVATAR_COORDS = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, | ||
29 | + "twitter_avatar",32, 32, 192, 80, 256, 144); | ||
26 | 30 | ||
27 | public static final URI LITELOADER_URI = URI.create("http://www.liteloader.com/"); | 31 | public static final URI LITELOADER_URI = URI.create("http://www.liteloader.com/"); |
28 | 32 | ||
@@ -117,7 +121,8 @@ public class LiteLoaderBrandingProvider implements BrandingProvider | @@ -117,7 +121,8 @@ public class LiteLoaderBrandingProvider implements BrandingProvider | ||
117 | } | 121 | } |
118 | 122 | ||
119 | /* (non-Javadoc) | 123 | /* (non-Javadoc) |
120 | - * @see com.mumfrey.liteloader.api.BrandingProvider#getTwitterAvatarResource() | 124 | + * @see com.mumfrey.liteloader.api.BrandingProvider |
125 | + * #getTwitterAvatarResource() | ||
121 | */ | 126 | */ |
122 | @Override | 127 | @Override |
123 | public ResourceLocation getTwitterAvatarResource() | 128 | public ResourceLocation getTwitterAvatarResource() |
src/client/java/com/mumfrey/liteloader/client/api/LiteLoaderCoreAPIClient.java
@@ -53,7 +53,8 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI | @@ -53,7 +53,8 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI | ||
53 | } | 53 | } |
54 | 54 | ||
55 | /* (non-Javadoc) | 55 | /* (non-Javadoc) |
56 | - * @see com.mumfrey.liteloader.api.LiteAPI#getRequiredDownstreamTransformers() | 56 | + * @see com.mumfrey.liteloader.api.LiteAPI |
57 | + * #getRequiredDownstreamTransformers() | ||
57 | */ | 58 | */ |
58 | @Override | 59 | @Override |
59 | public String[] getRequiredDownstreamTransformers() | 60 | public String[] getRequiredDownstreamTransformers() |
@@ -144,7 +145,7 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI | @@ -144,7 +145,7 @@ public class LiteLoaderCoreAPIClient extends LiteLoaderCoreAPI | ||
144 | if (this.objectFactory == null) | 145 | if (this.objectFactory == null) |
145 | { | 146 | { |
146 | this.objectFactory = new ObjectFactoryClient(this.environment, this.properties); | 147 | this.objectFactory = new ObjectFactoryClient(this.environment, this.properties); |
147 | - } | 148 | + } |
148 | 149 | ||
149 | return this.objectFactory; | 150 | return this.objectFactory; |
150 | } | 151 | } |
src/client/java/com/mumfrey/liteloader/client/api/LiteLoaderModInfoDecorator.java
@@ -20,14 +20,17 @@ import com.mumfrey.liteloader.util.render.IconTextured; | @@ -20,14 +20,17 @@ import com.mumfrey.liteloader.util.render.IconTextured; | ||
20 | public class LiteLoaderModInfoDecorator implements ModInfoDecorator | 20 | public class LiteLoaderModInfoDecorator implements ModInfoDecorator |
21 | { | 21 | { |
22 | /* (non-Javadoc) | 22 | /* (non-Javadoc) |
23 | - * @see com.mumfrey.liteloader.api.ModInfoDecorator#addIcons(com.mumfrey.liteloader.core.ModInfo, java.util.List) | 23 | + * @see com.mumfrey.liteloader.api.ModInfoDecorator |
24 | + * #addIcons(com.mumfrey.liteloader.core.ModInfo, java.util.List) | ||
24 | */ | 25 | */ |
25 | @Override | 26 | @Override |
26 | public void addIcons(final ModInfo<?> mod, List<IconTextured> icons) | 27 | public void addIcons(final ModInfo<?> mod, List<IconTextured> icons) |
27 | { | 28 | { |
28 | if (mod.hasTweakClass()) | 29 | if (mod.hasTweakClass()) |
29 | { | 30 | { |
30 | - icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, I18n.format("gui.mod.providestweak"), 12, 12, 158, 80, 170, 92){ | 31 | + icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, |
32 | + I18n.format("gui.mod.providestweak"), 12, 12, 158, 80, 170, 92) | ||
33 | + { | ||
31 | @Override | 34 | @Override |
32 | public void onClicked(Object source, Object container) | 35 | public void onClicked(Object source, Object container) |
33 | { | 36 | { |
@@ -41,7 +44,9 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | @@ -41,7 +44,9 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | ||
41 | 44 | ||
42 | if (mod.hasEventTransformers()) | 45 | if (mod.hasEventTransformers()) |
43 | { | 46 | { |
44 | - icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, I18n.format("gui.mod.providesevents"), 12, 12, 170, 92, 182, 104){ | 47 | + icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, |
48 | + I18n.format("gui.mod.providesevents"), 12, 12, 170, 92, 182, 104) | ||
49 | + { | ||
45 | @Override | 50 | @Override |
46 | public void onClicked(Object source, Object container) | 51 | public void onClicked(Object source, Object container) |
47 | { | 52 | { |
@@ -55,7 +60,9 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | @@ -55,7 +60,9 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | ||
55 | 60 | ||
56 | if (mod.hasClassTransformers()) | 61 | if (mod.hasClassTransformers()) |
57 | { | 62 | { |
58 | - icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, I18n.format("gui.mod.providestransformer"), 12, 12, 170, 80, 182, 92){ | 63 | + icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, |
64 | + I18n.format("gui.mod.providestransformer"), 12, 12, 170, 80, 182, 92) | ||
65 | + { | ||
59 | @Override | 66 | @Override |
60 | public void onClicked(Object source, Object container) | 67 | public void onClicked(Object source, Object container) |
61 | { | 68 | { |
@@ -69,13 +76,16 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | @@ -69,13 +76,16 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | ||
69 | 76 | ||
70 | if (mod.usesAPI()) | 77 | if (mod.usesAPI()) |
71 | { | 78 | { |
72 | - icons.add(new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, I18n.format("gui.mod.usingapi"), 12, 12, 122, 92, 134, 104)); | 79 | + icons.add(new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, |
80 | + I18n.format("gui.mod.usingapi"), 12, 12, 122, 92, 134, 104)); | ||
73 | } | 81 | } |
74 | 82 | ||
75 | List<Throwable> startupErrors = mod.getStartupErrors(); | 83 | List<Throwable> startupErrors = mod.getStartupErrors(); |
76 | if (startupErrors != null && startupErrors.size() > 0) | 84 | if (startupErrors != null && startupErrors.size() > 0) |
77 | { | 85 | { |
78 | - icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, I18n.format("gui.mod.startuperror", startupErrors.size()), 12, 12, 134, 92, 146, 104){ | 86 | + icons.add(new IconAbsoluteClickable(LiteLoaderBrandingProvider.ABOUT_TEXTURE, |
87 | + I18n.format("gui.mod.startuperror", startupErrors.size()), 12, 12, 134, 92, 146, 104) | ||
88 | + { | ||
79 | @Override | 89 | @Override |
80 | public void onClicked(Object source, Object container) | 90 | public void onClicked(Object source, Object container) |
81 | { | 91 | { |
@@ -89,7 +99,9 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | @@ -89,7 +99,9 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | ||
89 | } | 99 | } |
90 | 100 | ||
91 | /* (non-Javadoc) | 101 | /* (non-Javadoc) |
92 | - * @see com.mumfrey.liteloader.api.ModInfoDecorator#modifyStatusText(com.mumfrey.liteloader.core.ModInfo, java.lang.String) | 102 | + * @see com.mumfrey.liteloader.api.ModInfoDecorator |
103 | + * #modifyStatusText(com.mumfrey.liteloader.core.ModInfo, | ||
104 | + * java.lang.String) | ||
93 | */ | 105 | */ |
94 | @Override | 106 | @Override |
95 | public String modifyStatusText(ModInfo<?> mod, String statusText) | 107 | public String modifyStatusText(ModInfo<?> mod, String statusText) |
@@ -98,10 +110,13 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | @@ -98,10 +110,13 @@ public class LiteLoaderModInfoDecorator implements ModInfoDecorator | ||
98 | } | 110 | } |
99 | 111 | ||
100 | /* (non-Javadoc) | 112 | /* (non-Javadoc) |
101 | - * @see com.mumfrey.liteloader.api.ModInfoDecorator#onDrawListEntry(int, int, float, int, int, int, int, boolean, com.mumfrey.liteloader.core.ModInfo, int, int, int) | 113 | + * @see com.mumfrey.liteloader.api.ModInfoDecorator |
114 | + * #onDrawListEntry(int, int, float, int, int, int, int, boolean, | ||
115 | + * com.mumfrey.liteloader.core.ModInfo, int, int, int) | ||
102 | */ | 116 | */ |
103 | @Override | 117 | @Override |
104 | - public void onDrawListEntry(int mouseX, int mouseY, float partialTicks, int xPosition, int yPosition, int width, int height, boolean selected, ModInfo<?> mod, int gradientColour, int titleColour, int statusColour) | 118 | + public void onDrawListEntry(int mouseX, int mouseY, float partialTicks, int xPosition, int yPosition, int width, int height, boolean selected, |
119 | + ModInfo<?> mod, int gradientColour, int titleColour, int statusColour) | ||
105 | { | 120 | { |
106 | } | 121 | } |
107 | } | 122 | } |
src/client/java/com/mumfrey/liteloader/client/api/ObjectFactoryClient.java
@@ -96,7 +96,7 @@ class ObjectFactoryClient implements ObjectFactory<Minecraft, IntegratedServer> | @@ -96,7 +96,7 @@ class ObjectFactoryClient implements ObjectFactory<Minecraft, IntegratedServer> | ||
96 | if (this.engine == null) | 96 | if (this.engine == null) |
97 | { | 97 | { |
98 | this.engine = new GameEngineClient(); | 98 | this.engine = new GameEngineClient(); |
99 | - } | 99 | + } |
100 | 100 | ||
101 | return this.engine; | 101 | return this.engine; |
102 | } | 102 | } |
@@ -118,7 +118,7 @@ class ObjectFactoryClient implements ObjectFactory<Minecraft, IntegratedServer> | @@ -118,7 +118,7 @@ class ObjectFactoryClient implements ObjectFactory<Minecraft, IntegratedServer> | ||
118 | if (this.clientPluginChannels == null) | 118 | if (this.clientPluginChannels == null) |
119 | { | 119 | { |
120 | this.clientPluginChannels = new ClientPluginChannelsClient(); | 120 | this.clientPluginChannels = new ClientPluginChannelsClient(); |
121 | - } | 121 | + } |
122 | 122 | ||
123 | return this.clientPluginChannels; | 123 | return this.clientPluginChannels; |
124 | } | 124 | } |
@@ -129,7 +129,7 @@ class ObjectFactoryClient implements ObjectFactory<Minecraft, IntegratedServer> | @@ -129,7 +129,7 @@ class ObjectFactoryClient implements ObjectFactory<Minecraft, IntegratedServer> | ||
129 | if (this.serverPluginChannels == null) | 129 | if (this.serverPluginChannels == null) |
130 | { | 130 | { |
131 | this.serverPluginChannels = new ServerPluginChannels(); | 131 | this.serverPluginChannels = new ServerPluginChannels(); |
132 | - } | 132 | + } |
133 | 133 | ||
134 | return this.serverPluginChannels; | 134 | return this.serverPluginChannels; |
135 | } | 135 | } |
src/client/java/com/mumfrey/liteloader/client/gui/GuiCheckbox.java
@@ -27,14 +27,23 @@ public class GuiCheckbox extends GuiButton | @@ -27,14 +27,23 @@ public class GuiCheckbox extends GuiButton | ||
27 | { | 27 | { |
28 | minecraft.getTextureManager().bindTexture(LiteLoaderBrandingProvider.ABOUT_TEXTURE); | 28 | minecraft.getTextureManager().bindTexture(LiteLoaderBrandingProvider.ABOUT_TEXTURE); |
29 | glColor4f(1.0F, 1.0F, 1.0F, 1.0F); | 29 | glColor4f(1.0F, 1.0F, 1.0F, 1.0F); |
30 | - this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; | 30 | + this.hovered = mouseX >= this.xPosition |
31 | + && mouseY >= this.yPosition | ||
32 | + && mouseX < this.xPosition + this.width | ||
33 | + && mouseY < this.yPosition + this.height; | ||
31 | 34 | ||
32 | this.drawTexturedModalRect(this.xPosition, this.yPosition, this.checked ? 134 : 122, 80, 12, 12); | 35 | this.drawTexturedModalRect(this.xPosition, this.yPosition, this.checked ? 134 : 122, 80, 12, 12); |
33 | this.mouseDragged(minecraft, mouseX, mouseY); | 36 | this.mouseDragged(minecraft, mouseX, mouseY); |
34 | 37 | ||
35 | int colour = 0xE0E0E0; | 38 | int colour = 0xE0E0E0; |
36 | - if (!this.enabled) colour = 0xA0A0A0; | ||
37 | - else if (this.hovered) colour = 0xFFFFA0; | 39 | + if (!this.enabled) |
40 | + { | ||
41 | + colour = 0xA0A0A0; | ||
42 | + } | ||
43 | + else if (this.hovered) | ||
44 | + { | ||
45 | + colour = 0xFFFFA0; | ||
46 | + } | ||
38 | 47 | ||
39 | this.drawString(minecraft.fontRendererObj, this.displayString, this.xPosition + 16, this.yPosition + 2, colour); | 48 | this.drawString(minecraft.fontRendererObj, this.displayString, this.xPosition + 16, this.yPosition + 2, colour); |
40 | } | 49 | } |
src/client/java/com/mumfrey/liteloader/client/gui/GuiHoverLabel.java
@@ -36,7 +36,10 @@ public class GuiHoverLabel extends GuiButton | @@ -36,7 +36,10 @@ public class GuiHoverLabel extends GuiButton | ||
36 | { | 36 | { |
37 | if (this.visible) | 37 | if (this.visible) |
38 | { | 38 | { |
39 | - this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; | 39 | + this.hovered = mouseX >= this.xPosition |
40 | + && mouseY >= this.yPosition | ||
41 | + && mouseX < this.xPosition + this.width | ||
42 | + && mouseY < this.yPosition + this.height; | ||
40 | this.fontRenderer.drawString(this.displayString, this.xPosition, this.yPosition, this.hovered ? this.hoverColour : this.colour); | 43 | this.fontRenderer.drawString(this.displayString, this.xPosition, this.yPosition, this.hovered ? this.hoverColour : this.colour); |
41 | } | 44 | } |
42 | else | 45 | else |
src/client/java/com/mumfrey/liteloader/client/gui/GuiLiteLoaderPanel.java
@@ -36,30 +36,45 @@ import com.mumfrey.liteloader.modconfig.ConfigPanel; | @@ -36,30 +36,45 @@ import com.mumfrey.liteloader.modconfig.ConfigPanel; | ||
36 | import com.mumfrey.liteloader.util.render.Icon; | 36 | import com.mumfrey.liteloader.util.render.Icon; |
37 | 37 | ||
38 | /** | 38 | /** |
39 | - * GUI screen which displays info about loaded mods and also allows them to be enabled and | ||
40 | - * disabled. An instance of this class is created every time the main menu is displayed and is | ||
41 | - * drawn as an overlay until the tab is clicked, at which point it becomes the active GUI screen | ||
42 | - * and draws the parent main menu screen as its background to give the appearance of being | ||
43 | - * overlaid on the main menu. | 39 | + * GUI screen which displays info about loaded mods and also allows them to be |
40 | + * enabled and disabled. An instance of this class is created every time the | ||
41 | + * main menu is displayed and is drawn as an overlay until the tab is clicked, | ||
42 | + * at which point it becomes the active GUI screen and draws the parent main | ||
43 | + * menu screen as its background to give the appearance of being overlaid on the | ||
44 | + * main menu. | ||
44 | * | 45 | * |
45 | * @author Adam Mummery-Smith | 46 | * @author Adam Mummery-Smith |
46 | */ | 47 | */ |
47 | public class GuiLiteLoaderPanel extends GuiScreen | 48 | public class GuiLiteLoaderPanel extends GuiScreen |
48 | { | 49 | { |
49 | - static final int LEFT_EDGE = 80; | ||
50 | - static final int MARGIN = 12; | ||
51 | - static final int TAB_WIDTH = 20; | ||
52 | - static final int TAB_HEIGHT = 40; | ||
53 | - static final int TAB_TOP = 20; | ||
54 | - static final int PANEL_TOP = 83; | ||
55 | - static final int PANEL_BOTTOM = 26; | 50 | + static final int WHITE = 0xFFFFFFFF; |
51 | + static final int OPAQUE = 0xFF000000; | ||
52 | + static final int NOTIFICATION_TOOLTIP_FOREGROUND = 0xFFFFFF; | ||
53 | + static final int NOTIFICATION_TOOLTIP_BACKGROUND = 0xB0000099; | ||
54 | + static final int ERROR_TOOLTIP_FOREGROUND = 0xFF5555; | ||
55 | + static final int ERROR_TOOLTIP_BACKGROUND = 0xB0330000; | ||
56 | + static final int HEADER_HR_COLOUR = 0xFF999999; | ||
57 | + static final int HEADER_TEXT_COLOUR = GuiLiteLoaderPanel.WHITE; | ||
58 | + static final int HEADER_TEXT_COLOUR_SUB = 0xFFAAAAAA; | ||
59 | + static final int TOOLTIP_FOREGROUND = 0xFFFFFF; | ||
60 | + static final int TOOLTIP_FOREGROUND_SUB = 0xCCCCCC; | ||
61 | + static final int TOOLTIP_BACKGROUND = 0xB0000000; | ||
62 | + | ||
63 | + static final int LEFT_EDGE = 80; | ||
64 | + static final int MARGIN = 12; | ||
65 | + static final int TAB_WIDTH = 20; | ||
66 | + static final int TAB_HEIGHT = 40; | ||
67 | + static final int TAB_TOP = 20; | ||
68 | + static final int PANEL_TOP = 83; | ||
69 | + static final int PANEL_BOTTOM = 26; | ||
56 | 70 | ||
57 | private static final double TWEEN_RATE = 0.08; | 71 | private static final double TWEEN_RATE = 0.08; |
58 | 72 | ||
59 | private static boolean displayErrorToolTip = true; | 73 | private static boolean displayErrorToolTip = true; |
60 | 74 | ||
61 | /** | 75 | /** |
62 | - * Reference to the main menu which this screen is either overlaying or using as its background | 76 | + * Reference to the main menu which this screen is either overlaying or |
77 | + * using as its background. | ||
63 | */ | 78 | */ |
64 | private GuiScreen parentScreen; | 79 | private GuiScreen parentScreen; |
65 | 80 | ||
@@ -84,7 +99,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -84,7 +99,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
84 | private double tweenAmount = 0.0; | 99 | private double tweenAmount = 0.0; |
85 | 100 | ||
86 | /** | 101 | /** |
87 | - * Since we don't get real mouse events we have to simulate them by tracking the mouse state | 102 | + * Since we don't get real mouse events we have to simulate them by tracking |
103 | + * the mouse state. | ||
88 | */ | 104 | */ |
89 | private boolean mouseDown, toggled, toggleable; | 105 | private boolean mouseDown, toggled, toggleable; |
90 | 106 | ||
@@ -131,7 +147,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -131,7 +147,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
131 | * @param parentScreen | 147 | * @param parentScreen |
132 | * @param mods | 148 | * @param mods |
133 | */ | 149 | */ |
134 | - public GuiLiteLoaderPanel(Minecraft minecraft, GuiScreen parentScreen, LiteLoaderMods mods, LoaderEnvironment environment, LoaderProperties properties, ConfigManager configManager, boolean showTab) | 150 | + public GuiLiteLoaderPanel(Minecraft minecraft, GuiScreen parentScreen, LiteLoaderMods mods, LoaderEnvironment environment, |
151 | + LoaderProperties properties, ConfigManager configManager, boolean showTab) | ||
135 | { | 152 | { |
136 | this.mc = minecraft; | 153 | this.mc = minecraft; |
137 | this.fontRendererObj = minecraft.fontRendererObj; | 154 | this.fontRendererObj = minecraft.fontRendererObj; |
@@ -148,7 +165,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -148,7 +165,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
148 | 165 | ||
149 | this.initBranding(); | 166 | this.initBranding(); |
150 | 167 | ||
151 | - this.currentPanel = this.modsPanel = new GuiPanelMods(this, minecraft, mods, environment, configManager, this.brandColour, this.modInfoDecorators); | 168 | + this.currentPanel = this.modsPanel = new GuiPanelMods(this, minecraft, mods, environment, configManager, |
169 | + this.brandColour, this.modInfoDecorators); | ||
152 | this.settingsPanel = new GuiPanelSettings(this, minecraft); | 170 | this.settingsPanel = new GuiPanelSettings(this, minecraft); |
153 | 171 | ||
154 | this.startupErrorCount = mods.getStartupErrorCount(); | 172 | this.startupErrorCount = mods.getStartupErrorCount(); |
@@ -181,7 +199,7 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -181,7 +199,7 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
181 | if (brandingProvider.getBrandingColour() != 0 && brandingProvider.getPriority() > brandingColourProviderPriority) | 199 | if (brandingProvider.getBrandingColour() != 0 && brandingProvider.getPriority() > brandingColourProviderPriority) |
182 | { | 200 | { |
183 | brandingColourProviderPriority = brandingProvider.getPriority(); | 201 | brandingColourProviderPriority = brandingProvider.getPriority(); |
184 | - this.brandColour = 0xFF000000 | brandingProvider.getBrandingColour(); | 202 | + this.brandColour = GuiLiteLoaderPanel.OPAQUE | brandingProvider.getBrandingColour(); |
185 | } | 203 | } |
186 | 204 | ||
187 | ResourceLocation logoResource = brandingProvider.getLogoResource(); | 205 | ResourceLocation logoResource = brandingProvider.getLogoResource(); |
@@ -271,11 +289,13 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -271,11 +289,13 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
271 | 289 | ||
272 | this.currentPanel.setSize(this.width - LEFT_EDGE, this.height); | 290 | this.currentPanel.setSize(this.width - LEFT_EDGE, this.height); |
273 | 291 | ||
274 | - this.buttonList.add(new GuiHoverLabel(2, LEFT_EDGE + MARGIN, this.height - PANEL_BOTTOM + 9, this.fontRendererObj, I18n.format("gui.about.taboptions"), this.brandColour)); | 292 | + this.buttonList.add(new GuiHoverLabel(2, LEFT_EDGE + MARGIN, this.height - PANEL_BOTTOM + 9, this.fontRendererObj, |
293 | + I18n.format("gui.about.taboptions"), this.brandColour)); | ||
275 | 294 | ||
276 | if (LiteLoaderVersion.getUpdateSite().canCheckForUpdate() && this.mc.theWorld == null && !this.isSnapshot) | 295 | if (LiteLoaderVersion.getUpdateSite().canCheckForUpdate() && this.mc.theWorld == null && !this.isSnapshot) |
277 | { | 296 | { |
278 | - this.buttonList.add(new GuiHoverLabel(3, LEFT_EDGE + MARGIN + 38 + this.fontRendererObj.getStringWidth(this.versionText) + 6, 50, this.fontRendererObj, I18n.format("gui.about.checkupdates"), this.brandColour)); | 297 | + this.buttonList.add(new GuiHoverLabel(3, LEFT_EDGE + MARGIN + 38 + this.fontRendererObj.getStringWidth(this.versionText) + 6, 50, |
298 | + this.fontRendererObj, I18n.format("gui.about.checkupdates"), this.brandColour)); | ||
279 | } | 299 | } |
280 | 300 | ||
281 | Keyboard.enableRepeatEvents(true); | 301 | Keyboard.enableRepeatEvents(true); |
@@ -288,7 +308,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -288,7 +308,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
288 | } | 308 | } |
289 | 309 | ||
290 | /* (non-Javadoc) | 310 | /* (non-Javadoc) |
291 | - * @see net.minecraft.client.gui.GuiScreen#setWorldAndResolution(net.minecraft.client.Minecraft, int, int) | 311 | + * @see net.minecraft.client.gui.GuiScreen |
312 | + * #setWorldAndResolution(net.minecraft.client.Minecraft, int, int) | ||
292 | */ | 313 | */ |
293 | @Override | 314 | @Override |
294 | public void setWorldAndResolution(Minecraft minecraft, int width, int height) | 315 | public void setWorldAndResolution(Minecraft minecraft, int width, int height) |
@@ -363,11 +384,15 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -363,11 +384,15 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
363 | int offsetMouseX = mouseX - (int)xOffset; | 384 | int offsetMouseX = mouseX - (int)xOffset; |
364 | 385 | ||
365 | // Handle mouse stuff here since we won't get mouse events when not the active GUI | 386 | // Handle mouse stuff here since we won't get mouse events when not the active GUI |
366 | - boolean mouseOverTab = this.showTab && (offsetMouseX > LEFT_EDGE - TAB_WIDTH && offsetMouseX < LEFT_EDGE && mouseY > TAB_TOP && mouseY < TAB_TOP + TAB_HEIGHT); | 387 | + boolean mouseOverTab = this.showTab && (offsetMouseX > LEFT_EDGE - TAB_WIDTH |
388 | + && offsetMouseX < LEFT_EDGE | ||
389 | + && mouseY > TAB_TOP | ||
390 | + && mouseY < TAB_TOP + TAB_HEIGHT); | ||
367 | this.handleMouseClick(offsetMouseX, mouseY, partialTicks, active, mouseOverTab); | 391 | this.handleMouseClick(offsetMouseX, mouseY, partialTicks, active, mouseOverTab); |
368 | 392 | ||
369 | // Calculate the tab opacity, not framerate adjusted because we don't really care | 393 | // Calculate the tab opacity, not framerate adjusted because we don't really care |
370 | - this.tabOpacity = mouseOverTab || alwaysExpandTab || this.startupErrorCount > 0 || this.notification != null || this.isOpen() ? 0.5F : Math.max(0.0F, this.tabOpacity - partialTicks * 0.1F); | 394 | + this.tabOpacity = mouseOverTab || alwaysExpandTab || this.startupErrorCount > 0 || this.notification != null |
395 | + || this.isOpen() ? 0.5F : Math.max(0.0F, this.tabOpacity - partialTicks * 0.1F); | ||
371 | 396 | ||
372 | // Draw the panel contents | 397 | // Draw the panel contents |
373 | this.drawPanel(offsetMouseX, mouseY, partialTicks, active, xOffset); | 398 | this.drawPanel(offsetMouseX, mouseY, partialTicks, active, xOffset); |
@@ -391,12 +416,12 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -391,12 +416,12 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
391 | glTranslatef(xOffset, 0.0F, 0.0F); | 416 | glTranslatef(xOffset, 0.0F, 0.0F); |
392 | 417 | ||
393 | // Draw the background and left edge | 418 | // Draw the background and left edge |
394 | - drawRect(LEFT_EDGE, 0, this.width, this.height, 0xB0000000); | 419 | + drawRect(LEFT_EDGE, 0, this.width, this.height, GuiLiteLoaderPanel.TOOLTIP_BACKGROUND); |
395 | 420 | ||
396 | if (this.showTab) | 421 | if (this.showTab) |
397 | { | 422 | { |
398 | - drawRect(LEFT_EDGE, 0, LEFT_EDGE + 1, TAB_TOP, 0xFFFFFFFF); | ||
399 | - drawRect(LEFT_EDGE, TAB_TOP + TAB_HEIGHT, LEFT_EDGE + 1, this.height, 0xFFFFFFFF); | 423 | + drawRect(LEFT_EDGE, 0, LEFT_EDGE + 1, TAB_TOP, GuiLiteLoaderPanel.WHITE); |
424 | + drawRect(LEFT_EDGE, TAB_TOP + TAB_HEIGHT, LEFT_EDGE + 1, this.height, GuiLiteLoaderPanel.WHITE); | ||
400 | 425 | ||
401 | this.mc.getTextureManager().bindTexture(LiteLoaderBrandingProvider.ABOUT_TEXTURE); | 426 | this.mc.getTextureManager().bindTexture(LiteLoaderBrandingProvider.ABOUT_TEXTURE); |
402 | glDrawTexturedRect(LEFT_EDGE - TAB_WIDTH, TAB_TOP, TAB_WIDTH + 1, TAB_HEIGHT, 80, 80, 122, 160, 0.5F + this.tabOpacity); | 427 | glDrawTexturedRect(LEFT_EDGE - TAB_WIDTH, TAB_TOP, TAB_WIDTH + 1, TAB_HEIGHT, 80, 80, 122, 160, 0.5F + this.tabOpacity); |
@@ -411,7 +436,7 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -411,7 +436,7 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
411 | } | 436 | } |
412 | else | 437 | else |
413 | { | 438 | { |
414 | - drawRect(LEFT_EDGE, 0, LEFT_EDGE + 1, this.height, 0xFFFFFFFF); | 439 | + drawRect(LEFT_EDGE, 0, LEFT_EDGE + 1, this.height, GuiLiteLoaderPanel.WHITE); |
415 | } | 440 | } |
416 | 441 | ||
417 | // Only draw the panel contents if we are actually open | 442 | // Only draw the panel contents if we are actually open |
@@ -470,14 +495,15 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -470,14 +495,15 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
470 | glDrawTexturedRect(right - this.iconCoords.getIconWidth(), MARGIN, this.iconCoords, 1.0F); | 495 | glDrawTexturedRect(right - this.iconCoords.getIconWidth(), MARGIN, this.iconCoords, 1.0F); |
471 | 496 | ||
472 | // Draw header text | 497 | // Draw header text |
473 | - this.fontRendererObj.drawString(this.versionText, left + 38, 50, 0xFFFFFFFF); | ||
474 | - this.fontRendererObj.drawString(this.activeModText, left + 38, 60, 0xFFAAAAAA); | 498 | + this.fontRendererObj.drawString(this.versionText, left + 38, 50, GuiLiteLoaderPanel.HEADER_TEXT_COLOUR); |
499 | + this.fontRendererObj.drawString(this.activeModText, left + 38, 60, GuiLiteLoaderPanel.HEADER_TEXT_COLOUR_SUB); | ||
475 | 500 | ||
476 | // Draw top and bottom horizontal rules | 501 | // Draw top and bottom horizontal rules |
477 | - drawRect(left, 80, right, 81, 0xFF999999); | ||
478 | - drawRect(left, this.height - bottom + 2, right, this.height - bottom + 3, 0xFF999999); | 502 | + drawRect(left, 80, right, 81, GuiLiteLoaderPanel.HEADER_HR_COLOUR); |
503 | + drawRect(left, this.height - bottom + 2, right, this.height - bottom + 3, GuiLiteLoaderPanel.HEADER_HR_COLOUR); | ||
479 | 504 | ||
480 | - this.mouseOverLogo = (mouseY > MARGIN && mouseY < MARGIN + this.logoCoords.getIconHeight() && mouseX > left && mouseX < left + this.logoCoords.getIconWidth()); | 505 | + this.mouseOverLogo = (mouseY > MARGIN && mouseY < MARGIN + this.logoCoords.getIconHeight() |
506 | + && mouseX > left && mouseX < left + this.logoCoords.getIconWidth()); | ||
481 | return this.mouseOverLogo; | 507 | return this.mouseOverLogo; |
482 | } | 508 | } |
483 | 509 | ||
@@ -487,8 +513,10 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -487,8 +513,10 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
487 | 513 | ||
488 | if (mouseOverTab && this.tweenAmount < 0.01) | 514 | if (mouseOverTab && this.tweenAmount < 0.01) |
489 | { | 515 | { |
490 | - GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, LiteLoader.getVersionDisplayString(), mouseX, mouseY, this.width, this.height, 0xFFFFFF, 0xB0000000); | ||
491 | - GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, this.activeModText, mouseX, mouseY + 13, this.width, this.height, 0xCCCCCC, 0xB0000000); | 516 | + GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, LiteLoader.getVersionDisplayString(), mouseX, mouseY, this.width, this.height, |
517 | + GuiLiteLoaderPanel.TOOLTIP_FOREGROUND, GuiLiteLoaderPanel.TOOLTIP_BACKGROUND); | ||
518 | + GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, this.activeModText, mouseX, mouseY + 13, this.width, this.height, | ||
519 | + GuiLiteLoaderPanel.TOOLTIP_FOREGROUND_SUB, GuiLiteLoaderPanel.TOOLTIP_BACKGROUND); | ||
492 | 520 | ||
493 | if (annoyingTip) | 521 | if (annoyingTip) |
494 | { | 522 | { |
@@ -505,16 +533,19 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -505,16 +533,19 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
505 | { | 533 | { |
506 | if (this.startupErrorCount > 0) | 534 | if (this.startupErrorCount > 0) |
507 | { | 535 | { |
508 | - GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, I18n.format("gui.error.tooltip", this.startupErrorCount, this.criticalErrorCount), left, top, this.width, this.height, 0xFF5555, 0xB0330000); | 536 | + GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, I18n.format("gui.error.tooltip", this.startupErrorCount, this.criticalErrorCount), |
537 | + left, top, this.width, this.height, GuiLiteLoaderPanel.ERROR_TOOLTIP_FOREGROUND, GuiLiteLoaderPanel.ERROR_TOOLTIP_BACKGROUND); | ||
509 | } | 538 | } |
510 | else if (this.notification != null) | 539 | else if (this.notification != null) |
511 | { | 540 | { |
512 | - GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, this.notification, left, top, this.width, this.height, 0xFFFFFF, 0xB0000099); | 541 | + GuiLiteLoaderPanel.drawTooltip(this.fontRendererObj, this.notification, left, top, this.width, this.height, |
542 | + GuiLiteLoaderPanel.NOTIFICATION_TOOLTIP_FOREGROUND, GuiLiteLoaderPanel.NOTIFICATION_TOOLTIP_BACKGROUND); | ||
513 | } | 543 | } |
514 | } | 544 | } |
515 | 545 | ||
516 | /* (non-Javadoc) | 546 | /* (non-Javadoc) |
517 | - * @see net.minecraft.client.gui.GuiScreen#actionPerformed(net.minecraft.client.gui.GuiButton) | 547 | + * @see net.minecraft.client.gui.GuiScreen |
548 | + * #actionPerformed(net.minecraft.client.gui.GuiButton) | ||
518 | */ | 549 | */ |
519 | @Override | 550 | @Override |
520 | protected void actionPerformed(GuiButton button) | 551 | protected void actionPerformed(GuiButton button) |
@@ -586,9 +617,13 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -586,9 +617,13 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
586 | protected void mouseReleased(int mouseX, int mouseY, int button) | 617 | protected void mouseReleased(int mouseX, int mouseY, int button) |
587 | { | 618 | { |
588 | if (button == -1) | 619 | if (button == -1) |
620 | + { | ||
589 | this.currentPanel.mouseMoved(mouseX - LEFT_EDGE, mouseY); | 621 | this.currentPanel.mouseMoved(mouseX - LEFT_EDGE, mouseY); |
622 | + } | ||
590 | else | 623 | else |
624 | + { | ||
591 | this.currentPanel.mouseReleased(mouseX - LEFT_EDGE, mouseY, button); | 625 | this.currentPanel.mouseReleased(mouseX - LEFT_EDGE, mouseY, button); |
626 | + } | ||
592 | 627 | ||
593 | if (!this.currentPanel.stealFocus()) | 628 | if (!this.currentPanel.stealFocus()) |
594 | { | 629 | { |
@@ -661,7 +696,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -661,7 +696,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
661 | } | 696 | } |
662 | 697 | ||
663 | /** | 698 | /** |
664 | - * Callback for the "config" button, display the config panel for the currently selected mod | 699 | + * Callback for the "config" button, display the config panel for the |
700 | + * currently selected mod. | ||
665 | */ | 701 | */ |
666 | void openConfigPanel(ConfigPanel panel, LiteMod mod) | 702 | void openConfigPanel(ConfigPanel panel, LiteMod mod) |
667 | { | 703 | { |
@@ -694,7 +730,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -694,7 +730,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
694 | } | 730 | } |
695 | 731 | ||
696 | /** | 732 | /** |
697 | - * Draw a tooltip at the specified location and clip to screenWidth and screenHeight | 733 | + * Draw a tooltip at the specified location and clip to screenWidth and |
734 | + * screenHeight | ||
698 | * | 735 | * |
699 | * @param fontRenderer | 736 | * @param fontRenderer |
700 | * @param tooltipText | 737 | * @param tooltipText |
@@ -705,13 +742,14 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -705,13 +742,14 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
705 | * @param colour | 742 | * @param colour |
706 | * @param backgroundColour | 743 | * @param backgroundColour |
707 | */ | 744 | */ |
708 | - public static void drawTooltip(FontRenderer fontRenderer, String tooltipText, int mouseX, int mouseY, int screenWidth, int screenHeight, int colour, int backgroundColour) | 745 | + public static void drawTooltip(FontRenderer fontRenderer, String tooltipText, int mouseX, int mouseY, int screenWidth, int screenHeight, |
746 | + int colour, int backgroundColour) | ||
709 | { | 747 | { |
710 | int textSize = fontRenderer.getStringWidth(tooltipText); | 748 | int textSize = fontRenderer.getStringWidth(tooltipText); |
711 | mouseX = Math.max(0, Math.min(screenWidth - 4, mouseX - 4)); | 749 | mouseX = Math.max(0, Math.min(screenWidth - 4, mouseX - 4)); |
712 | mouseY = Math.max(0, Math.min(screenHeight - 16, mouseY)); | 750 | mouseY = Math.max(0, Math.min(screenHeight - 16, mouseY)); |
713 | drawRect(mouseX - textSize - 2, mouseY, mouseX + 2, mouseY + 12, backgroundColour); | 751 | drawRect(mouseX - textSize - 2, mouseY, mouseX + 2, mouseY + 12, backgroundColour); |
714 | - fontRenderer.drawStringWithShadow(tooltipText, mouseX - textSize, mouseY + 2, colour); // TODO OBF MCPTEST drawStringWithShadow - func_175063_a | 752 | + fontRenderer.drawStringWithShadow(tooltipText, mouseX - textSize, mouseY + 2, colour); |
715 | } | 753 | } |
716 | 754 | ||
717 | 755 |
src/client/java/com/mumfrey/liteloader/client/gui/GuiPanelAbout.java
@@ -23,13 +23,15 @@ import com.mumfrey.liteloader.util.SortableValue; | @@ -23,13 +23,15 @@ import com.mumfrey.liteloader.util.SortableValue; | ||
23 | import com.mumfrey.liteloader.util.render.Icon; | 23 | import com.mumfrey.liteloader.util.render.Icon; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | - * "About LiteLoader" panel which docks in the mod info screen and lists information about the installed APIs | 26 | + * "About LiteLoader" panel which docks in the mod info screen and lists |
27 | + * information about the installed APIs. | ||
27 | * | 28 | * |
28 | * @author Adam Mummery-Smith | 29 | * @author Adam Mummery-Smith |
29 | */ | 30 | */ |
30 | class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | 31 | class GuiPanelAbout extends GuiPanel implements ScrollPanelContent |
31 | { | 32 | { |
32 | - public static final IconAbsolute apiIconCoords = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, "api_icon", 32, 32, 192, 144, 256, 208); | 33 | + public static final IconAbsolute apiIconCoords = new IconAbsolute(LiteLoaderBrandingProvider.ABOUT_TEXTURE, "api_icon", |
34 | + 32, 32, 192, 144, 256, 208); | ||
33 | 35 | ||
34 | private static final int ROW_HEIGHT = 40; | 36 | private static final int ROW_HEIGHT = 40; |
35 | 37 | ||
@@ -51,7 +53,8 @@ class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | @@ -51,7 +53,8 @@ class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | ||
51 | 53 | ||
52 | this.sortBrandingProviders(); | 54 | this.sortBrandingProviders(); |
53 | 55 | ||
54 | - this.scrollPane.addControl(new GuiHoverLabel(-2, 38, 22 + this.brandings.size() * GuiPanelAbout.ROW_HEIGHT, this.mc.fontRendererObj, "\247n" + MCP_URI.toString(), this.parent.getBrandColour())); | 56 | + this.scrollPane.addControl(new GuiHoverLabel(-2, 38, 22 + this.brandings.size() * GuiPanelAbout.ROW_HEIGHT, this.mc.fontRendererObj, |
57 | + "\247n" + MCP_URI.toString(), this.parent.getBrandColour())); | ||
55 | } | 58 | } |
56 | 59 | ||
57 | /** | 60 | /** |
@@ -66,9 +69,10 @@ class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | @@ -66,9 +69,10 @@ class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | ||
66 | BrandingProvider brandingProvider = LiteLoader.getCustomisationProvider(api, BrandingProvider.class); | 69 | BrandingProvider brandingProvider = LiteLoader.getCustomisationProvider(api, BrandingProvider.class); |
67 | if (brandingProvider != null) | 70 | if (brandingProvider != null) |
68 | { | 71 | { |
69 | - sortedBrandingProviders.add(new SortableValue<BrandingProvider>(Integer.MAX_VALUE - brandingProvider.getPriority(), 0, brandingProvider)); | 72 | + sortedBrandingProviders.add(new SortableValue<BrandingProvider>(Integer.MAX_VALUE - brandingProvider.getPriority(), 0, |
73 | + brandingProvider)); | ||
70 | } | 74 | } |
71 | - } | 75 | + } |
72 | 76 | ||
73 | int brandingIndex = 0; | 77 | int brandingIndex = 0; |
74 | 78 | ||
@@ -80,7 +84,8 @@ class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | @@ -80,7 +84,8 @@ class GuiPanelAbout extends GuiPanel implements ScrollPanelContent | ||
80 | URI homepage = brandingProvider.getHomepage(); | 84 | URI homepage = brandingProvider.getHomepage(); |
81 | if (homepage != null) | 85 | if (homepage != null) |
82 | { | 86 | { |
83 | - this.scrollPane.addControl(new GuiHoverLabel(brandingIndex, 38, 22 + brandingIndex * GuiPanelAbout.ROW_HEIGHT, this.mc.fontRendererObj, "\247n" + homepage, this.parent.getBrandColour())); | 87 | + this.scrollPane.addControl(new GuiHoverLabel(brandingIndex, 38, 22 + brandingIndex * GuiPanelAbout.ROW_HEIGHT, |
88 | + this.mc.fontRendererObj, "\247n" + homepage, this.parent.getBrandColour())); | ||
84 | } | 89 | } |
85 | 90 | ||
86 | brandingIndex++; | 91 | brandingIndex++; |
src/client/java/com/mumfrey/liteloader/client/gui/GuiPanelConfigContainer.java
@@ -11,8 +11,9 @@ import com.mumfrey.liteloader.modconfig.ConfigPanel; | @@ -11,8 +11,9 @@ import com.mumfrey.liteloader.modconfig.ConfigPanel; | ||
11 | import com.mumfrey.liteloader.modconfig.ConfigPanelHost; | 11 | import com.mumfrey.liteloader.modconfig.ConfigPanelHost; |
12 | 12 | ||
13 | /** | 13 | /** |
14 | - * Config panel container, this handles drawing the configuration panel chrome and also hosts the | ||
15 | - * configuration panels themselves to support scrolling and stuff | 14 | + * Config panel container, this handles drawing the configuration panel chrome |
15 | + * and also hosts the configuration panels themselves to support scrolling and | ||
16 | + * stuff. | ||
16 | * | 17 | * |
17 | * @author Adam Mummery-Smith | 18 | * @author Adam Mummery-Smith |
18 | */ | 19 | */ |
@@ -186,7 +187,8 @@ class GuiPanelConfigContainer extends GuiPanel implements ConfigPanelHost | @@ -186,7 +187,8 @@ class GuiPanelConfigContainer extends GuiPanel implements ConfigPanelHost | ||
186 | 187 | ||
187 | // Update and draw scroll bar | 188 | // Update and draw scroll bar |
188 | this.scrollBar.setMaxValue(this.totalHeight - this.innerHeight); | 189 | this.scrollBar.setMaxValue(this.totalHeight - this.innerHeight); |
189 | - this.scrollBar.drawScrollBar(mouseX, mouseY, partialTicks, this.width - MARGIN - 5, TOP, 5, this.innerHeight, Math.max(this.innerHeight, this.totalHeight)); | 190 | + this.scrollBar.drawScrollBar(mouseX, mouseY, partialTicks, this.width - MARGIN - 5, TOP, 5, this.innerHeight, |
191 | + Math.max(this.innerHeight, this.totalHeight)); | ||
190 | 192 | ||
191 | // Draw other buttons | 193 | // Draw other buttons |
192 | super.draw(mouseX, mouseY, partialTicks); | 194 | super.draw(mouseX, mouseY, partialTicks); |
@@ -221,7 +223,9 @@ class GuiPanelConfigContainer extends GuiPanel implements ConfigPanelHost | @@ -221,7 +223,9 @@ class GuiPanelConfigContainer extends GuiPanel implements ConfigPanelHost | ||
221 | if (mouseButton == 0) | 223 | if (mouseButton == 0) |
222 | { | 224 | { |
223 | if (this.scrollBar.wasMouseOver()) | 225 | if (this.scrollBar.wasMouseOver()) |
226 | + { | ||
224 | this.scrollBar.setDragging(true); | 227 | this.scrollBar.setDragging(true); |
228 | + } | ||
225 | } | 229 | } |
226 | 230 | ||
227 | super.mousePressed(mouseX, mouseY, mouseButton); | 231 | super.mousePressed(mouseX, mouseY, mouseButton); |
src/client/java/com/mumfrey/liteloader/client/gui/GuiPanelLiteLoaderLog.java
@@ -89,9 +89,12 @@ class GuiPanelLiteLoaderLog extends GuiPanel implements ScrollPanelContent | @@ -89,9 +89,12 @@ class GuiPanelLiteLoaderLog extends GuiPanel implements ScrollPanelContent | ||
89 | { | 89 | { |
90 | super.setSize(width, height); | 90 | super.setSize(width, height); |
91 | 91 | ||
92 | - this.controls.add(new GuiButton(0, this.width - 59 - MARGIN, this.height - BOTTOM + 9, 60, 20, I18n.format("gui.done"))); | ||
93 | - this.controls.add(this.btnUpload = new GuiButton(1, this.width - 145 - MARGIN, this.height - BOTTOM + 9, 80, 20, I18n.format("gui.log.postlog"))); | ||
94 | - this.controls.add(this.chkScale = new GuiCheckbox(2, MARGIN, this.height - BOTTOM + 15, I18n.format("gui.log.scalecheckbox"))); | 92 | + this.controls.add(new GuiButton(0, this.width - 59 - MARGIN, this.height - BOTTOM + 9, 60, 20, |
93 | + I18n.format("gui.done"))); | ||
94 | + this.controls.add(this.btnUpload = new GuiButton(1, this.width - 145 - MARGIN, this.height - BOTTOM + 9, 80, 20, | ||
95 | + I18n.format("gui.log.postlog"))); | ||
96 | + this.controls.add(this.chkScale = new GuiCheckbox(2, MARGIN, this.height - BOTTOM + 15, | ||
97 | + I18n.format("gui.log.scalecheckbox"))); | ||
95 | 98 | ||
96 | this.chkScale.checked = GuiPanelLiteLoaderLog.useNativeRes; | 99 | this.chkScale.checked = GuiPanelLiteLoaderLog.useNativeRes; |
97 | 100 | ||
@@ -142,7 +145,8 @@ class GuiPanelLiteLoaderLog extends GuiPanel implements ScrollPanelContent | @@ -142,7 +145,8 @@ class GuiPanelLiteLoaderLog extends GuiPanel implements ScrollPanelContent | ||
142 | { | 145 | { |
143 | LiteLoaderLogger.info("Log file upload succeeded, url is %s", this.logURL); | 146 | LiteLoaderLogger.info("Log file upload succeeded, url is %s", this.logURL); |
144 | int urlWidth = this.mc.fontRendererObj.getStringWidth(this.logURL); | 147 | int urlWidth = this.mc.fontRendererObj.getStringWidth(this.logURL); |
145 | - this.controls.add(new GuiHoverLabel(3, xMid - (urlWidth / 2), this.height / 2, this.mc.fontRendererObj, "\247n" + this.logURL, this.parent.getBrandColour())); | 148 | + this.controls.add(new GuiHoverLabel(3, xMid - (urlWidth / 2), this.height / 2, this.mc.fontRendererObj, "\247n" + this.logURL, |
149 | + this.parent.getBrandColour())); | ||
146 | } | 150 | } |
147 | else | 151 | else |
148 | { | 152 | { |
src/client/java/com/mumfrey/liteloader/client/gui/GuiPanelMods.java
@@ -26,7 +26,7 @@ import com.mumfrey.liteloader.modconfig.ConfigPanel; | @@ -26,7 +26,7 @@ import com.mumfrey.liteloader.modconfig.ConfigPanel; | ||
26 | * @author Adam Mummery-Smith | 26 | * @author Adam Mummery-Smith |
27 | */ | 27 | */ |
28 | public class GuiPanelMods extends GuiPanel implements ModListContainer | 28 | public class GuiPanelMods extends GuiPanel implements ModListContainer |
29 | -{ | 29 | +{ |
30 | private static final int SCROLLBAR_WIDTH = 5; | 30 | private static final int SCROLLBAR_WIDTH = 5; |
31 | 31 | ||
32 | private final GuiLiteLoaderPanel parentScreen; | 32 | private final GuiLiteLoaderPanel parentScreen; |
@@ -58,7 +58,8 @@ public class GuiPanelMods extends GuiPanel implements ModListContainer | @@ -58,7 +58,8 @@ public class GuiPanelMods extends GuiPanel implements ModListContainer | ||
58 | */ | 58 | */ |
59 | private GuiSimpleScrollBar scrollBar = new GuiSimpleScrollBar(); | 59 | private GuiSimpleScrollBar scrollBar = new GuiSimpleScrollBar(); |
60 | 60 | ||
61 | - public GuiPanelMods(GuiLiteLoaderPanel parentScreen, Minecraft minecraft, LiteLoaderMods mods, LoaderEnvironment environment, ConfigManager configManager, int brandColour, List<ModInfoDecorator> decorators) | 61 | + public GuiPanelMods(GuiLiteLoaderPanel parentScreen, Minecraft minecraft, LiteLoaderMods mods, LoaderEnvironment environment, |
62 | + ConfigManager configManager, int brandColour, List<ModInfoDecorator> decorators) | ||
62 | { | 63 | { |
63 | super(minecraft); | 64 | super(minecraft); |
64 | 65 | ||
@@ -106,8 +107,10 @@ public class GuiPanelMods extends GuiPanel implements ModListContainer | @@ -106,8 +107,10 @@ public class GuiPanelMods extends GuiPanel implements ModListContainer | ||
106 | int rightPanelLeftEdge = MARGIN + 4 + (this.width - MARGIN - MARGIN - 4) / 2; | 107 | int rightPanelLeftEdge = MARGIN + 4 + (this.width - MARGIN - MARGIN - 4) / 2; |
107 | 108 | ||
108 | this.controls.clear(); | 109 | this.controls.clear(); |
109 | - this.controls.add(this.btnToggle = new GuiButton(0, rightPanelLeftEdge, this.height - GuiLiteLoaderPanel.PANEL_BOTTOM - 24, 90, 20, I18n.format("gui.enablemod"))); | ||
110 | - this.controls.add(this.btnConfig = new GuiButton(1, rightPanelLeftEdge + 92, this.height - GuiLiteLoaderPanel.PANEL_BOTTOM - 24, 69, 20, I18n.format("gui.modsettings"))); | 110 | + this.controls.add(this.btnToggle = new GuiButton(0, rightPanelLeftEdge, this.height - GuiLiteLoaderPanel.PANEL_BOTTOM - 24, 90, 20, |
111 | + I18n.format("gui.enablemod"))); | ||
112 | + this.controls.add(this.btnConfig = new GuiButton(1, rightPanelLeftEdge + 92, this.height - GuiLiteLoaderPanel.PANEL_BOTTOM - 24, 69, 20, | ||
113 | + I18n.format("gui.modsettings"))); | ||
111 | 114 | ||
112 | this.modList.setSize(width, height); | 115 | this.modList.setSize(width, height); |
113 | } | 116 | } |
@@ -252,7 +255,8 @@ public class GuiPanelMods extends GuiPanel implements ModListContainer | @@ -252,7 +255,8 @@ public class GuiPanelMods extends GuiPanel implements ModListContainer | ||
252 | */ | 255 | */ |
253 | private void drawModsList(int mouseX, int mouseY, float partialTicks, int width, int height) | 256 | private void drawModsList(int mouseX, int mouseY, float partialTicks, int width, int height) |
254 | { | 257 | { |
255 | - this.scrollBar.drawScrollBar(mouseX, mouseY, partialTicks, MARGIN + width - SCROLLBAR_WIDTH, GuiLiteLoaderPanel.PANEL_TOP, SCROLLBAR_WIDTH, height, this.listHeight); | 258 | + this.scrollBar.drawScrollBar(mouseX, mouseY, partialTicks, MARGIN + width - SCROLLBAR_WIDTH, GuiLiteLoaderPanel.PANEL_TOP, SCROLLBAR_WIDTH, |
259 | + height, this.listHeight); | ||
256 | 260 | ||
257 | // clip outside of scroll area | 261 | // clip outside of scroll area |
258 | glEnableClipping(MARGIN, MARGIN + width - SCROLLBAR_WIDTH - 1, GuiLiteLoaderPanel.PANEL_TOP, this.height - GuiLiteLoaderPanel.PANEL_BOTTOM); | 262 | glEnableClipping(MARGIN, MARGIN + width - SCROLLBAR_WIDTH - 1, GuiLiteLoaderPanel.PANEL_TOP, this.height - GuiLiteLoaderPanel.PANEL_BOTTOM); |
src/client/java/com/mumfrey/liteloader/client/gui/GuiPanelUpdateCheck.java
@@ -22,6 +22,8 @@ import com.mumfrey.liteloader.update.UpdateSite; | @@ -22,6 +22,8 @@ import com.mumfrey.liteloader.update.UpdateSite; | ||
22 | */ | 22 | */ |
23 | class GuiPanelUpdateCheck extends GuiPanel | 23 | class GuiPanelUpdateCheck extends GuiPanel |
24 | { | 24 | { |
25 | + private static final int WHITE = 0xFFFFFFFF; | ||
26 | + | ||
25 | /** | 27 | /** |
26 | * URI to open if a new version is available | 28 | * URI to open if a new version is available |
27 | */ | 29 | */ |
@@ -51,7 +53,8 @@ class GuiPanelUpdateCheck extends GuiPanel | @@ -51,7 +53,8 @@ class GuiPanelUpdateCheck extends GuiPanel | ||
51 | 53 | ||
52 | private boolean canForceUpdate, updateForced; | 54 | private boolean canForceUpdate, updateForced; |
53 | 55 | ||
54 | - public GuiPanelUpdateCheck(GuiLiteLoaderPanel parentScreen, Minecraft minecraft, UpdateSite updateSite, String updateName, LoaderProperties properties) | 56 | + public GuiPanelUpdateCheck(GuiLiteLoaderPanel parentScreen, Minecraft minecraft, UpdateSite updateSite, String updateName, |
57 | + LoaderProperties properties) | ||
55 | { | 58 | { |
56 | super(minecraft); | 59 | super(minecraft); |
57 | 60 | ||
@@ -67,9 +70,12 @@ class GuiPanelUpdateCheck extends GuiPanel | @@ -67,9 +70,12 @@ class GuiPanelUpdateCheck extends GuiPanel | ||
67 | { | 70 | { |
68 | super.setSize(width, height); | 71 | super.setSize(width, height); |
69 | 72 | ||
70 | - this.controls.add(new GuiButton(0, this.width - 99 - MARGIN, this.height - BOTTOM + 9, 100, 20, this.updateForced ? I18n.format("gui.exitgame") : I18n.format("gui.done"))); | ||
71 | - this.controls.add(this.btnCheck = new GuiButton(1, MARGIN + 16, TOP + 16, 100, 20, I18n.format("gui.checknow"))); | ||
72 | - this.controls.add(this.btnDownload = new GuiButton(2, MARGIN + 16, TOP + 118, 100, 20, this.canForceUpdate ? I18n.format("gui.forceupdate") : I18n.format("gui.downloadupdate"))); | 73 | + this.controls.add(new GuiButton(0, this.width - 99 - MARGIN, this.height - BOTTOM + 9, 100, 20, |
74 | + this.updateForced ? I18n.format("gui.exitgame") : I18n.format("gui.done"))); | ||
75 | + this.controls.add(this.btnCheck = new GuiButton(1, MARGIN + 16, TOP + 16, 100, 20, | ||
76 | + I18n.format("gui.checknow"))); | ||
77 | + this.controls.add(this.btnDownload = new GuiButton(2, MARGIN + 16, TOP + 118, 100, 20, | ||
78 | + this.canForceUpdate ? I18n.format("gui.forceupdate") : I18n.format("gui.downloadupdate"))); | ||
73 | } | 79 | } |
74 | 80 | ||
75 | @Override | 81 | @Override |
@@ -78,7 +84,7 @@ class GuiPanelUpdateCheck extends GuiPanel | @@ -78,7 +84,7 @@ class GuiPanelUpdateCheck extends GuiPanel | ||
78 | FontRenderer fontRenderer = this.mc.fontRendererObj; | 84 | FontRenderer fontRenderer = this.mc.fontRendererObj; |
79 | 85 | ||
80 | // Draw panel title | 86 | // Draw panel title |
81 | - fontRenderer.drawString(this.panelTitle, MARGIN, TOP - 14, 0xFFFFFFFF); | 87 | + fontRenderer.drawString(this.panelTitle, MARGIN, TOP - 14, GuiPanelUpdateCheck.WHITE); |
82 | 88 | ||
83 | // Draw top and bottom horizontal bars | 89 | // Draw top and bottom horizontal bars |
84 | drawRect(MARGIN, TOP - 4, this.width - MARGIN, TOP - 3, 0xFF999999); | 90 | drawRect(MARGIN, TOP - 4, this.width - MARGIN, TOP - 3, 0xFF999999); |
@@ -90,23 +96,25 @@ class GuiPanelUpdateCheck extends GuiPanel | @@ -90,23 +96,25 @@ class GuiPanelUpdateCheck extends GuiPanel | ||
90 | if (this.updateSite.isCheckInProgress()) | 96 | if (this.updateSite.isCheckInProgress()) |
91 | { | 97 | { |
92 | this.drawThrobber(MARGIN, TOP + 40, this.throb); | 98 | this.drawThrobber(MARGIN, TOP + 40, this.throb); |
93 | - fontRenderer.drawString(I18n.format("gui.updates.status.checking", ""), MARGIN + 18, TOP + 44, 0xFFFFFFFF); | 99 | + fontRenderer.drawString(I18n.format("gui.updates.status.checking", ""), MARGIN + 18, TOP + 44, GuiPanelUpdateCheck.WHITE); |
94 | } | 100 | } |
95 | else if (this.updateSite.isCheckComplete()) | 101 | else if (this.updateSite.isCheckComplete()) |
96 | { | 102 | { |
97 | boolean success = this.updateSite.isCheckSucceess(); | 103 | boolean success = this.updateSite.isCheckSucceess(); |
98 | String status = success ? I18n.format("gui.updates.status.success") : I18n.format("gui.updates.status.failed"); | 104 | String status = success ? I18n.format("gui.updates.status.success") : I18n.format("gui.updates.status.failed"); |
99 | - fontRenderer.drawString(I18n.format("gui.updates.status.checking", status), MARGIN + 18, TOP + 44, 0xFFFFFFFF); | 105 | + fontRenderer.drawString(I18n.format("gui.updates.status.checking", status), MARGIN + 18, TOP + 44, GuiPanelUpdateCheck.WHITE); |
100 | 106 | ||
101 | if (success) | 107 | if (success) |
102 | { | 108 | { |
103 | - fontRenderer.drawString(I18n.format("gui.updates.available.title"), MARGIN + 18, TOP + 70, 0xFFFFFFFF); | 109 | + fontRenderer.drawString(I18n.format("gui.updates.available.title"), MARGIN + 18, TOP + 70, GuiPanelUpdateCheck.WHITE); |
104 | if (this.updateSite.isUpdateAvailable()) | 110 | if (this.updateSite.isUpdateAvailable()) |
105 | { | 111 | { |
106 | this.btnDownload.visible = !this.updateForced; | 112 | this.btnDownload.visible = !this.updateForced; |
107 | - fontRenderer.drawString(I18n.format("gui.updates.available.newversion"), MARGIN + 18, TOP + 84, 0xFFFFFFFF); | ||
108 | - fontRenderer.drawString(I18n.format("gui.updates.available.version", this.updateSite.getAvailableVersion()), MARGIN + 18, TOP + 94, 0xFFFFFFFF); | ||
109 | - fontRenderer.drawString(I18n.format("gui.updates.available.date", this.updateSite.getAvailableVersionDate()), MARGIN + 18, TOP + 104, 0xFFFFFFFF); | 113 | + fontRenderer.drawString(I18n.format("gui.updates.available.newversion"), MARGIN + 18, TOP + 84, GuiPanelUpdateCheck.WHITE); |
114 | + fontRenderer.drawString(I18n.format("gui.updates.available.version", this.updateSite.getAvailableVersion()), | ||
115 | + MARGIN + 18, TOP + 94, GuiPanelUpdateCheck.WHITE); | ||
116 | + fontRenderer.drawString(I18n.format("gui.updates.available.date", this.updateSite.getAvailableVersionDate()), | ||
117 | + MARGIN + 18, TOP + 104, GuiPanelUpdateCheck.WHITE); | ||
110 | 118 | ||
111 | if (this.updateForced) | 119 | if (this.updateForced) |
112 | { | 120 | { |
@@ -115,13 +123,13 @@ class GuiPanelUpdateCheck extends GuiPanel | @@ -115,13 +123,13 @@ class GuiPanelUpdateCheck extends GuiPanel | ||
115 | } | 123 | } |
116 | else | 124 | else |
117 | { | 125 | { |
118 | - fontRenderer.drawString(I18n.format("gui.updates.available.nonewversion"), MARGIN + 18, TOP + 84, 0xFFFFFFFF); | 126 | + fontRenderer.drawString(I18n.format("gui.updates.available.nonewversion"), MARGIN + 18, TOP + 84, GuiPanelUpdateCheck.WHITE); |
119 | } | 127 | } |
120 | } | 128 | } |
121 | } | 129 | } |
122 | else | 130 | else |
123 | { | 131 | { |
124 | - fontRenderer.drawString(I18n.format("gui.updates.status.idle"), MARGIN + 18, TOP + 44, 0xFFFFFFFF); | 132 | + fontRenderer.drawString(I18n.format("gui.updates.status.idle"), MARGIN + 18, TOP + 44, GuiPanelUpdateCheck.WHITE); |
125 | } | 133 | } |
126 | 134 | ||
127 | super.draw(mouseX, mouseY, partialTicks); | 135 | super.draw(mouseX, mouseY, partialTicks); |
src/client/java/com/mumfrey/liteloader/client/gui/GuiScrollPanel.java
@@ -129,7 +129,8 @@ class GuiScrollPanel extends GuiPanel | @@ -129,7 +129,8 @@ class GuiScrollPanel extends GuiPanel | ||
129 | glPopMatrix(); | 129 | glPopMatrix(); |
130 | 130 | ||
131 | // Update and draw scroll bar | 131 | // Update and draw scroll bar |
132 | - this.scrollBar.drawScrollBar(mouseX, mouseY, partialTicks, this.left + this.width - 5, this.top, 5, this.height, Math.max(this.height, this.contentHeight)); | 132 | + this.scrollBar.drawScrollBar(mouseX, mouseY, partialTicks, this.left + this.width - 5, this.top, 5, this.height, |
133 | + Math.max(this.height, this.contentHeight)); | ||
133 | } | 134 | } |
134 | 135 | ||
135 | @Override | 136 | @Override |
@@ -153,7 +154,9 @@ class GuiScrollPanel extends GuiPanel | @@ -153,7 +154,9 @@ class GuiScrollPanel extends GuiPanel | ||
153 | if (mouseButton == 0) | 154 | if (mouseButton == 0) |
154 | { | 155 | { |
155 | if (this.scrollBar.wasMouseOver()) | 156 | if (this.scrollBar.wasMouseOver()) |
157 | + { | ||
156 | this.scrollBar.setDragging(true); | 158 | this.scrollBar.setDragging(true); |
159 | + } | ||
157 | } | 160 | } |
158 | } | 161 | } |
159 | 162 |
src/client/java/com/mumfrey/liteloader/client/gui/GuiSimpleScrollBar.java
@@ -51,7 +51,8 @@ public class GuiSimpleScrollBar extends Gui | @@ -51,7 +51,8 @@ public class GuiSimpleScrollBar extends Gui | ||
51 | } | 51 | } |
52 | 52 | ||
53 | /** | 53 | /** |
54 | - * Set the scroll value, the value is clamped between 0 and the current max value | 54 | + * Set the scroll value, the value is clamped between 0 and the current max |
55 | + * value. | ||
55 | */ | 56 | */ |
56 | public void setValue(int value) | 57 | public void setValue(int value) |
57 | { | 58 | { |
@@ -59,7 +60,8 @@ public class GuiSimpleScrollBar extends Gui | @@ -59,7 +60,8 @@ public class GuiSimpleScrollBar extends Gui | ||
59 | } | 60 | } |
60 | 61 | ||
61 | /** | 62 | /** |
62 | - * Offset the scroll value by the specified amount, the value is clamped between 0 and the current max value | 63 | + * Offset the scroll value by the specified amount, the value is clamped |
64 | + * between 0 and the current max value. | ||
63 | */ | 65 | */ |
64 | public void offsetValue(int offset) | 66 | public void offsetValue(int offset) |
65 | { | 67 | { |
src/client/java/com/mumfrey/liteloader/client/gui/ScrollPanelContent.java
@@ -6,7 +6,7 @@ public interface ScrollPanelContent | @@ -6,7 +6,7 @@ public interface ScrollPanelContent | ||
6 | { | 6 | { |
7 | public abstract int getScrollPanelContentHeight(GuiScrollPanel source); | 7 | public abstract int getScrollPanelContentHeight(GuiScrollPanel source); |
8 | 8 | ||
9 | - public abstract void drawScrollPanelContent(GuiScrollPanel source, int mouseX, int mouseY, float partialTicks, int scrollAmount, int visibleHeight); | 9 | + public abstract void drawScrollPanelContent(GuiScrollPanel source, int mouseX, int mouseY, float partialTicks, int scrollAmt, int visibleHeight); |
10 | 10 | ||
11 | public abstract void scrollPanelActionPerformed(GuiScrollPanel source, GuiButton control); | 11 | public abstract void scrollPanelActionPerformed(GuiScrollPanel source, GuiButton control); |
12 | 12 |
src/client/java/com/mumfrey/liteloader/client/gui/modlist/GuiModInfoPanel.java
@@ -59,7 +59,8 @@ public class GuiModInfoPanel extends Gui | @@ -59,7 +59,8 @@ public class GuiModInfoPanel extends Gui | ||
59 | 59 | ||
60 | drawRect(xPosition + 5, yPos, xPosition + width, yPos + 1, GuiModInfoPanel.DIVIDER_COLOUR); yPos += 4; // divider | 60 | drawRect(xPosition + 5, yPos, xPosition + width, yPos + 1, GuiModInfoPanel.DIVIDER_COLOUR); yPos += 4; // divider |
61 | 61 | ||
62 | - this.fontRenderer.drawString(I18n.format("gui.about.authors") + ": \2477" + this.modInfo.getAuthor(), xPosition + 5, yPos, GuiModInfoPanel.AUTHORS_COLOUR); yPos += 10; | 62 | + this.fontRenderer.drawString(I18n.format("gui.about.authors") + ": \2477" + this.modInfo.getAuthor(), xPosition + 5, yPos, |
63 | + GuiModInfoPanel.AUTHORS_COLOUR); yPos += 10; | ||
63 | if (!Strings.isNullOrEmpty(this.modInfo.getURL())) | 64 | if (!Strings.isNullOrEmpty(this.modInfo.getURL())) |
64 | { | 65 | { |
65 | this.fontRenderer.drawString(this.modInfo.getURL(), xPosition + 5, yPos, GuiModListPanel.BLEND_2THRDS & this.brandColour); yPos += 10; | 66 | this.fontRenderer.drawString(this.modInfo.getURL(), xPosition + 5, yPos, GuiModListPanel.BLEND_2THRDS & this.brandColour); yPos += 10; |
src/client/java/com/mumfrey/liteloader/client/gui/modlist/GuiModListPanel.java
@@ -106,7 +106,8 @@ public class GuiModListPanel extends Gui | @@ -106,7 +106,8 @@ public class GuiModListPanel extends Gui | ||
106 | int titleColour = this.getTitleColour(selected); | 106 | int titleColour = this.getTitleColour(selected); |
107 | int statusColour = this.getStatusColour(selected); | 107 | int statusColour = this.getStatusColour(selected); |
108 | 108 | ||
109 | - this.drawGradientRect(xPosition, yPosition, xPosition + width, yPosition + GuiModListPanel.PANEL_HEIGHT, gradientColour, GuiModListPanel.GRADIENT_COLOUR2); | 109 | + this.drawGradientRect(xPosition, yPosition, xPosition + width, yPosition + GuiModListPanel.PANEL_HEIGHT, gradientColour, |
110 | + GuiModListPanel.GRADIENT_COLOUR2); | ||
110 | 111 | ||
111 | String titleText = this.owner.getTitleText(); | 112 | String titleText = this.owner.getTitleText(); |
112 | String versionText = this.owner.getVersionText(); | 113 | String versionText = this.owner.getVersionText(); |
@@ -128,7 +129,8 @@ public class GuiModListPanel extends Gui | @@ -128,7 +129,8 @@ public class GuiModListPanel extends Gui | ||
128 | 129 | ||
129 | for (ModInfoDecorator decorator : this.decorators) | 130 | for (ModInfoDecorator decorator : this.decorators) |
130 | { | 131 | { |
131 | - decorator.onDrawListEntry(mouseX, mouseY, partialTicks, xPosition, yPosition, width, GuiModListPanel.PANEL_HEIGHT, selected, this.modInfo, gradientColour, titleColour, statusColour); | 132 | + decorator.onDrawListEntry(mouseX, mouseY, partialTicks, xPosition, yPosition, width, GuiModListPanel.PANEL_HEIGHT, selected, |
133 | + this.modInfo, gradientColour, titleColour, statusColour); | ||
132 | } | 134 | } |
133 | } | 135 | } |
134 | 136 | ||
@@ -172,7 +174,8 @@ public class GuiModListPanel extends Gui | @@ -172,7 +174,8 @@ public class GuiModListPanel extends Gui | ||
172 | if (tooltipText != null) | 174 | if (tooltipText != null) |
173 | { | 175 | { |
174 | glDisableClipping(); | 176 | glDisableClipping(); |
175 | - GuiLiteLoaderPanel.drawTooltip(this.fontRenderer, tooltipText, mouseX, mouseY, 4096, 4096, GuiModListPanel.WHITE, GuiModListPanel.BLEND_HALF & GuiModListPanel.BLACK); | 177 | + GuiLiteLoaderPanel.drawTooltip(this.fontRenderer, tooltipText, mouseX, mouseY, 4096, 4096, GuiModListPanel.WHITE, |
178 | + GuiModListPanel.BLEND_HALF & GuiModListPanel.BLACK); | ||
176 | glEnableClipping(); | 179 | glEnableClipping(); |
177 | } | 180 | } |
178 | 181 | ||
@@ -187,7 +190,10 @@ public class GuiModListPanel extends Gui | @@ -187,7 +190,10 @@ public class GuiModListPanel extends Gui | ||
187 | */ | 190 | */ |
188 | protected int getGradientColour(boolean selected) | 191 | protected int getGradientColour(boolean selected) |
189 | { | 192 | { |
190 | - return GuiModListPanel.BLEND_2THRDS & (this.owner.isErrored() ? (selected ? GuiModListPanel.ERROR_GRADIENT_COLOUR : GuiModListPanel.ERROR_GRADIENT_COLOUR2) : (selected ? (this.owner.isExternal() ? GuiModListPanel.EXTERNAL_ENTRY_COLOUR : this.brandColour) : GuiModListPanel.BLACK)); | 193 | + return GuiModListPanel.BLEND_2THRDS |
194 | + & (this.owner.isErrored() | ||
195 | + ? (selected ? GuiModListPanel.ERROR_GRADIENT_COLOUR : GuiModListPanel.ERROR_GRADIENT_COLOUR2) | ||
196 | + : (selected ? (this.owner.isExternal() ? GuiModListPanel.EXTERNAL_ENTRY_COLOUR : this.brandColour) : GuiModListPanel.BLACK)); | ||
191 | } | 197 | } |
192 | 198 | ||
193 | /** | 199 | /** |
src/client/java/com/mumfrey/liteloader/client/gui/modlist/GuiModListPanelInvalid.java
@@ -11,7 +11,8 @@ public class GuiModListPanelInvalid extends GuiModListPanel | @@ -11,7 +11,8 @@ public class GuiModListPanelInvalid extends GuiModListPanel | ||
11 | { | 11 | { |
12 | private static final int BAD_PANEL_HEIGHT = 22; | 12 | private static final int BAD_PANEL_HEIGHT = 22; |
13 | 13 | ||
14 | - public GuiModListPanelInvalid(ModListEntry owner, FontRenderer fontRenderer, int brandColour, ModInfo<?> modInfo, List<ModInfoDecorator> decorators) | 14 | + public GuiModListPanelInvalid(ModListEntry owner, FontRenderer fontRenderer, int brandColour, ModInfo<?> modInfo, |
15 | + List<ModInfoDecorator> decorators) | ||
15 | { | 16 | { |
16 | super(owner, fontRenderer, brandColour, modInfo, decorators); | 17 | super(owner, fontRenderer, brandColour, modInfo, decorators); |
17 | } | 18 | } |
src/client/java/com/mumfrey/liteloader/client/gui/modlist/ModList.java
@@ -38,7 +38,8 @@ public class ModList | @@ -38,7 +38,8 @@ public class ModList | ||
38 | 38 | ||
39 | private boolean hasConfig = false; | 39 | private boolean hasConfig = false; |
40 | 40 | ||
41 | - public ModList(ModListContainer container, Minecraft minecraft, LiteLoaderMods mods, LoaderEnvironment environment, ConfigManager configManager, int brandColour, List<ModInfoDecorator> decorators) | 41 | + public ModList(ModListContainer container, Minecraft minecraft, LiteLoaderMods mods, LoaderEnvironment environment, ConfigManager configManager, |
42 | + int brandColour, List<ModInfoDecorator> decorators) | ||
42 | { | 43 | { |
43 | this.container = container; | 44 | this.container = container; |
44 | this.configManager = configManager; | 45 | this.configManager = configManager; |
@@ -53,7 +54,8 @@ public class ModList | @@ -53,7 +54,8 @@ public class ModList | ||
53 | * @param brandColour | 54 | * @param brandColour |
54 | * @param decorators | 55 | * @param decorators |
55 | */ | 56 | */ |
56 | - protected void populate(Minecraft minecraft, LiteLoaderMods mods, LoaderEnvironment environment, int brandColour, List<ModInfoDecorator> decorators) | 57 | + protected void populate(Minecraft minecraft, LiteLoaderMods mods, LoaderEnvironment environment, int brandColour, |
58 | + List<ModInfoDecorator> decorators) | ||
57 | { | 59 | { |
58 | // Add mods to this treeset first, in order to sort them | 60 | // Add mods to this treeset first, in order to sort them |
59 | Map<String, ModListEntry> sortedMods = new TreeMap<String, ModListEntry>(); | 61 | Map<String, ModListEntry> sortedMods = new TreeMap<String, ModListEntry>(); |
@@ -94,7 +96,9 @@ public class ModList | @@ -94,7 +96,9 @@ public class ModList | ||
94 | 96 | ||
95 | // Select the first mod in the list | 97 | // Select the first mod in the list |
96 | if (this.mods.size() > 0) | 98 | if (this.mods.size() > 0) |
99 | + { | ||
97 | this.selectedMod = this.mods.get(0); | 100 | this.selectedMod = this.mods.get(0); |
101 | + } | ||
98 | } | 102 | } |
99 | 103 | ||
100 | public GuiLiteLoaderPanel getParentScreen() | 104 | public GuiLiteLoaderPanel getParentScreen() |
@@ -156,7 +160,10 @@ public class ModList | @@ -156,7 +160,10 @@ public class ModList | ||
156 | this.scrollSelectedModIntoView(); | 160 | this.scrollSelectedModIntoView(); |
157 | return true; | 161 | return true; |
158 | } | 162 | } |
159 | - else if (keyCode == Keyboard.KEY_SPACE || keyCode == Keyboard.KEY_RETURN || keyCode == Keyboard.KEY_NUMPADENTER || keyCode == Keyboard.KEY_RIGHT) | 163 | + else if (keyCode == Keyboard.KEY_SPACE |
164 | + || keyCode == Keyboard.KEY_RETURN | ||
165 | + || keyCode == Keyboard.KEY_NUMPADENTER | ||
166 | + || keyCode == Keyboard.KEY_RIGHT) | ||
160 | { | 167 | { |
161 | this.toggleSelectedMod(); | 168 | this.toggleSelectedMod(); |
162 | return true; | 169 | return true; |
src/client/java/com/mumfrey/liteloader/client/gui/modlist/ModListEntry.java
@@ -15,8 +15,9 @@ import com.mumfrey.liteloader.interfaces.LoadableMod; | @@ -15,8 +15,9 @@ import com.mumfrey.liteloader.interfaces.LoadableMod; | ||
15 | import com.mumfrey.liteloader.launch.LoaderEnvironment; | 15 | import com.mumfrey.liteloader.launch.LoaderEnvironment; |
16 | 16 | ||
17 | /** | 17 | /** |
18 | - * Represents a mod in the mod info screen, keeps track of mod information and provides methods | ||
19 | - * for displaying the mod in the mod list and drawing the selected mod info | 18 | + * Represents a mod in the mod info screen, keeps track of mod information and |
19 | + * provides methods for displaying the mod in the mod list and drawing the | ||
20 | + * selected mod info. | ||
20 | * | 21 | * |
21 | * @author Adam Mummery-Smith | 22 | * @author Adam Mummery-Smith |
22 | */ | 23 | */ |
@@ -56,13 +57,15 @@ public class ModListEntry | @@ -56,13 +57,15 @@ public class ModListEntry | ||
56 | private Set<String> missingAPIs; | 57 | private Set<String> missingAPIs; |
57 | 58 | ||
58 | /** | 59 | /** |
59 | - * Whether the mod can be toggled, not all mods support this, eg. internal mods | 60 | + * Whether the mod can be toggled, not all mods support this, eg. internal |
61 | + * mods | ||
60 | */ | 62 | */ |
61 | private boolean canBeToggled; | 63 | private boolean canBeToggled; |
62 | 64 | ||
63 | /** | 65 | /** |
64 | - * Whether the mod WILL be enabled on the next startup, if the mod is active and has been disabled this | ||
65 | - * will be false, and if it's currently disabled by has been toggled then it will be true | 66 | + * Whether the mod WILL be enabled on the next startup, if the mod is active |
67 | + * and has been disabled this will be false, and if it's currently disabled | ||
68 | + * by has been toggled then it will be true. | ||
66 | */ | 69 | */ |
67 | private boolean willBeEnabled; | 70 | private boolean willBeEnabled; |
68 | 71 | ||
@@ -85,7 +88,8 @@ public class ModListEntry | @@ -85,7 +88,8 @@ public class ModListEntry | ||
85 | * @param decorators | 88 | * @param decorators |
86 | * @param modInfo | 89 | * @param modInfo |
87 | */ | 90 | */ |
88 | - ModListEntry(ModList modList, LiteLoaderMods mods, LoaderEnvironment environment, FontRenderer fontRenderer, int brandColour, List<ModInfoDecorator> decorators, ModInfo<?> modInfo) | 91 | + ModListEntry(ModList modList, LiteLoaderMods mods, LoaderEnvironment environment, FontRenderer fontRenderer, int brandColour, |
92 | + List<ModInfoDecorator> decorators, ModInfo<?> modInfo) | ||
89 | { | 93 | { |
90 | this.modList = modList; | 94 | this.modList = modList; |
91 | this.mods = mods; | 95 | this.mods = mods; |
@@ -94,7 +98,7 @@ public class ModListEntry | @@ -94,7 +98,7 @@ public class ModListEntry | ||
94 | this.isActive = modInfo.isActive(); | 98 | this.isActive = modInfo.isActive(); |
95 | this.isValid = modInfo.isValid(); | 99 | this.isValid = modInfo.isValid(); |
96 | this.canBeToggled = modInfo.isToggleable() && mods.getEnabledModsList().saveAllowed(); | 100 | this.canBeToggled = modInfo.isToggleable() && mods.getEnabledModsList().saveAllowed(); |
97 | - this.willBeEnabled = mods.isModEnabled(this.modInfo.getIdentifier());; | 101 | + this.willBeEnabled = mods.isModEnabled(this.modInfo.getIdentifier()); |
98 | this.isExternal = modInfo.getContainer().isExternalJar(); | 102 | this.isExternal = modInfo.getContainer().isExternalJar(); |
99 | this.isErrored = modInfo.getStartupErrors() != null && modInfo.getStartupErrors().size() > 0; | 103 | this.isErrored = modInfo.getStartupErrors() != null && modInfo.getStartupErrors().size() > 0; |
100 | 104 | ||
@@ -140,7 +144,9 @@ public class ModListEntry | @@ -140,7 +144,9 @@ public class ModListEntry | ||
140 | public void onTick() | 144 | public void onTick() |
141 | { | 145 | { |
142 | if (this.doubleClickTime > 0) | 146 | if (this.doubleClickTime > 0) |
147 | + { | ||
143 | this.doubleClickTime--; | 148 | this.doubleClickTime--; |
149 | + } | ||
144 | } | 150 | } |
145 | 151 | ||
146 | public void mousePressed(int mouseX, int mouseY, int mouseButton) | 152 | public void mousePressed(int mouseX, int mouseY, int mouseButton) |
src/client/java/com/mumfrey/liteloader/client/gui/startup/LoadingBar.java
@@ -118,7 +118,7 @@ public class LoadingBar extends LoadingProgress | @@ -118,7 +118,7 @@ public class LoadingBar extends LoadingProgress | ||
118 | 118 | ||
119 | protected void _initTextures() | 119 | protected void _initTextures() |
120 | { | 120 | { |
121 | - this.minecraftMessage = LoadingBar.LOADING_MESSAGE_2; | 121 | + this.minecraftMessage = LoadingBar.LOADING_MESSAGE_2; |
122 | } | 122 | } |
123 | 123 | ||
124 | @Override | 124 | @Override |
@@ -166,14 +166,15 @@ public class LoadingBar extends LoadingProgress | @@ -166,14 +166,15 @@ public class LoadingBar extends LoadingProgress | ||
166 | { | 166 | { |
167 | if (this.fontRenderer == null) | 167 | if (this.fontRenderer == null) |
168 | { | 168 | { |
169 | - this.fontRenderer = new FontRenderer(this.minecraft.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.textureManager, false); | 169 | + this.fontRenderer = new FontRenderer(this.minecraft.gameSettings, new ResourceLocation("textures/font/ascii.png"), |
170 | + this.textureManager, false); | ||
170 | this.fontRenderer.onResourceManagerReload(this.minecraft.getResourceManager()); | 171 | this.fontRenderer.onResourceManagerReload(this.minecraft.getResourceManager()); |
171 | } | 172 | } |
172 | 173 | ||
173 | double totalProgress = this.totalMinecraftProgress + this.totalLiteLoaderProgress; | 174 | double totalProgress = this.totalMinecraftProgress + this.totalLiteLoaderProgress; |
174 | double progress = (this.minecraftProgress + this.liteLoaderProgress) / totalProgress; | 175 | double progress = (this.minecraftProgress + this.liteLoaderProgress) / totalProgress; |
175 | 176 | ||
176 | - // if (progress >= 1.0) LoadingBar.message = "Preparing..."; | 177 | +// if (progress >= 1.0) LoadingBar.message = "Preparing..."; |
177 | 178 | ||
178 | this.render(progress); | 179 | this.render(progress); |
179 | } | 180 | } |
@@ -308,15 +309,15 @@ public class LoadingBar extends LoadingProgress | @@ -308,15 +309,15 @@ public class LoadingBar extends LoadingProgress | ||
308 | glAlphaFunc(GL_GREATER, 0.0F); | 309 | glAlphaFunc(GL_GREATER, 0.0F); |
309 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 310 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
310 | 311 | ||
311 | - // tessellator.startDrawingQuads(); | ||
312 | - // tessellator.setColorRGBA(0, 0, 0, 32); | ||
313 | - // tessellator.addVertex(0.0D, scaledHeight, 0.0D); | ||
314 | - // tessellator.setColorRGBA(0, 0, 0, 180); | ||
315 | - // tessellator.addVertex(0.0D + scaledWidth, scaledHeight, 0.0D); | ||
316 | - // tessellator.setColorRGBA(0, 0, 0, 0); | ||
317 | - // tessellator.addVertex(0.0D + scaledWidth, (scaledHeight / 10), 0.0D); | ||
318 | - // tessellator.addVertex(0.0D, scaledHeight - (scaledHeight / 3), 0.0D); | ||
319 | - // tessellator.draw(); | 312 | +// tessellator.startDrawingQuads(); |
313 | +// tessellator.setColorRGBA(0, 0, 0, 32); | ||
314 | +// tessellator.addVertex(0.0D, scaledHeight, 0.0D); | ||
315 | +// tessellator.setColorRGBA(0, 0, 0, 180); | ||
316 | +// tessellator.addVertex(0.0D + scaledWidth, scaledHeight, 0.0D); | ||
317 | +// tessellator.setColorRGBA(0, 0, 0, 0); | ||
318 | +// tessellator.addVertex(0.0D + scaledWidth, (scaledHeight / 10), 0.0D); | ||
319 | +// tessellator.addVertex(0.0D, scaledHeight - (scaledHeight / 3), 0.0D); | ||
320 | +// tessellator.draw(); | ||
320 | 321 | ||
321 | worldRenderer.startDrawingQuads(); | 322 | worldRenderer.startDrawingQuads(); |
322 | worldRenderer.setColorRGBA(this.barLuma, this.barLuma, this.barLuma, 128); // TODO OBF MCPTEST func_178961_b - setColorRGBA | 323 | worldRenderer.setColorRGBA(this.barLuma, this.barLuma, this.barLuma, 128); // TODO OBF MCPTEST func_178961_b - setColorRGBA |
@@ -346,7 +347,7 @@ public class LoadingBar extends LoadingProgress | @@ -346,7 +347,7 @@ public class LoadingBar extends LoadingProgress | ||
346 | 347 | ||
347 | glEnableAlphaTest(); | 348 | glEnableAlphaTest(); |
348 | glAlphaFunc(GL_GREATER, 0.1F); | 349 | glAlphaFunc(GL_GREATER, 0.1F); |
349 | - // glFlush(); | 350 | +// glFlush(); |
350 | 351 | ||
351 | this.minecraft.updateDisplay(); // TODO OBF MCPTEST updateDisplay - func_175601_h | 352 | this.minecraft.updateDisplay(); // TODO OBF MCPTEST updateDisplay - func_175601_h |
352 | } | 353 | } |
@@ -365,8 +366,9 @@ public class LoadingBar extends LoadingProgress | @@ -365,8 +366,9 @@ public class LoadingBar extends LoadingProgress | ||
365 | } | 366 | } |
366 | 367 | ||
367 | /** | 368 | /** |
368 | - * Find the most common (approx) colour in the image and assign it to the bar, reduces the palette to 9-bit by | ||
369 | - * stripping the the 5 LSB from each byte to create a 9-bit palette index in the form RRRGGGBBB | 369 | + * Find the most common (approx) colour in the image and assign it to the |
370 | + * bar, reduces the palette to 9-bit by stripping the the 5 LSB from each | ||
371 | + * byte to create a 9-bit palette index in the form RRRGGGBBB | ||
370 | * | 372 | * |
371 | * @param textureData | 373 | * @param textureData |
372 | */ | 374 | */ |
src/client/java/com/mumfrey/liteloader/client/overlays/IGuiTextField.java
@@ -3,7 +3,8 @@ package com.mumfrey.liteloader.client.overlays; | @@ -3,7 +3,8 @@ package com.mumfrey.liteloader.client.overlays; | ||
3 | import com.mumfrey.liteloader.transformers.access.Accessor; | 3 | import com.mumfrey.liteloader.transformers.access.Accessor; |
4 | 4 | ||
5 | /** | 5 | /** |
6 | - * Adapter for GuiTextField to expose internal properties, mainly to allow sensible subclassing | 6 | + * Adapter for GuiTextField to expose internal properties, mainly to allow |
7 | + * sensible subclassing. | ||
7 | * | 8 | * |
8 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
9 | */ | 10 | */ |
@@ -23,13 +24,13 @@ public interface IGuiTextField | @@ -23,13 +24,13 @@ public interface IGuiTextField | ||
23 | @Accessor("#5") public abstract void setHeight(int height); | 24 | @Accessor("#5") public abstract void setHeight(int height); |
24 | 25 | ||
25 | @Accessor("#12") public abstract boolean isEnabled(); | 26 | @Accessor("#12") public abstract boolean isEnabled(); |
26 | - // @Accessor("#12") public abstract void setEnabled(boolean enabled); // built in | 27 | +// @Accessor("#12") public abstract void setEnabled(boolean enabled); // built in |
27 | 28 | ||
28 | @Accessor("#13") public abstract int getLineScrollOffset(); | 29 | @Accessor("#13") public abstract int getLineScrollOffset(); |
29 | 30 | ||
30 | @Accessor("#16") public abstract int getTextColor(); | 31 | @Accessor("#16") public abstract int getTextColor(); |
31 | - // @Accessor("#16") public abstract void setTextColor(int color); // built in | 32 | +// @Accessor("#16") public abstract void setTextColor(int color); // built in |
32 | 33 | ||
33 | @Accessor("#17") public abstract int getDisabledTextColour(); | 34 | @Accessor("#17") public abstract int getDisabledTextColour(); |
34 | - // @Accessor("#17") public abstract void setDisabledTextColour(int color); // built in | 35 | +// @Accessor("#17") public abstract void setDisabledTextColour(int color); // built in |
35 | } | 36 | } |
src/client/java/com/mumfrey/liteloader/client/transformers/CrashReportTransformer.java
@@ -31,7 +31,8 @@ public class CrashReportTransformer extends ClassTransformer | @@ -31,7 +31,8 @@ public class CrashReportTransformer extends ClassTransformer | ||
31 | } | 31 | } |
32 | 32 | ||
33 | /** | 33 | /** |
34 | - * Inject the additional callback for populating the crash report into the CallableJVMFlags class | 34 | + * Inject the additional callback for populating the crash report into the |
35 | + * CallableJVMFlags class. | ||
35 | * | 36 | * |
36 | * @param basicClass basic class | 37 | * @param basicClass basic class |
37 | * @return transformed class | 38 | * @return transformed class |
@@ -58,14 +59,17 @@ public class CrashReportTransformer extends ClassTransformer | @@ -58,14 +59,17 @@ public class CrashReportTransformer extends ClassTransformer | ||
58 | { | 59 | { |
59 | InsnList code = new InsnList(); | 60 | InsnList code = new InsnList(); |
60 | code.add(new VarInsnNode(Opcodes.ALOAD, 1)); | 61 | code.add(new VarInsnNode(Opcodes.ALOAD, 1)); |
61 | - code.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "com/mumfrey/liteloader/core/LiteLoader", "populateCrashReport", "(Ljava/lang/Object;)V", false)); | 62 | + code.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "com/mumfrey/liteloader/core/LiteLoader", "populateCrashReport", |
63 | + "(Ljava/lang/Object;)V", false)); | ||
62 | 64 | ||
63 | ListIterator<AbstractInsnNode> insns = ctor.instructions.iterator(); | 65 | ListIterator<AbstractInsnNode> insns = ctor.instructions.iterator(); |
64 | while (insns.hasNext()) | 66 | while (insns.hasNext()) |
65 | { | 67 | { |
66 | AbstractInsnNode insnNode = insns.next(); | 68 | AbstractInsnNode insnNode = insns.next(); |
67 | if (insnNode.getOpcode() == Opcodes.RETURN) | 69 | if (insnNode.getOpcode() == Opcodes.RETURN) |
70 | + { | ||
68 | ctor.instructions.insertBefore(insnNode, code); | 71 | ctor.instructions.insertBefore(insnNode, code); |
72 | + } | ||
69 | } | 73 | } |
70 | } | 74 | } |
71 | } | 75 | } |
src/client/java/com/mumfrey/liteloader/client/transformers/MinecraftTransformer.java
@@ -86,6 +86,6 @@ public class MinecraftTransformer extends AccessorTransformer | @@ -86,6 +86,6 @@ public class MinecraftTransformer extends AccessorTransformer | ||
86 | 86 | ||
87 | method.instructions = insns; | 87 | method.instructions = insns; |
88 | 88 | ||
89 | - if (!found) LiteLoaderLogger.severe("MinecraftTransformer failed to find the INIT injection point, the game will probably crash pretty soon."); | 89 | + if (!found) LiteLoaderLogger.severe("MinecraftTransformer failed to find INIT injection point, the game will probably crash pretty soon."); |
90 | } | 90 | } |
91 | } | 91 | } |
src/client/java/com/mumfrey/liteloader/client/util/PrivateFieldsClient.java
@@ -21,19 +21,21 @@ import com.mumfrey.liteloader.core.runtime.Obf; | @@ -21,19 +21,21 @@ import com.mumfrey.liteloader.core.runtime.Obf; | ||
21 | import com.mumfrey.liteloader.util.PrivateFields; | 21 | import com.mumfrey.liteloader.util.PrivateFields; |
22 | 22 | ||
23 | @SuppressWarnings("rawtypes") | 23 | @SuppressWarnings("rawtypes") |
24 | -public class PrivateFieldsClient<P, T> extends PrivateFields<P, T> | 24 | +public final class PrivateFieldsClient<P, T> extends PrivateFields<P, T> |
25 | { | 25 | { |
26 | private PrivateFieldsClient(Class<P> owner, Obf obf) | 26 | private PrivateFieldsClient(Class<P> owner, Obf obf) |
27 | { | 27 | { |
28 | super(owner, obf); | 28 | super(owner, obf); |
29 | } | 29 | } |
30 | 30 | ||
31 | + // CHECKSTYLE:OFF | ||
32 | + | ||
31 | public static final PrivateFieldsClient<RenderManager, Map> entityRenderMap = new PrivateFieldsClient<RenderManager, Map> (RenderManager.class, Obf.entityRenderMap); | 33 | public static final PrivateFieldsClient<RenderManager, Map> entityRenderMap = new PrivateFieldsClient<RenderManager, Map> (RenderManager.class, Obf.entityRenderMap); |
32 | public static final PrivateFieldsClient<NetHandlerLoginClient, NetworkManager> netManager = new PrivateFieldsClient<NetHandlerLoginClient, NetworkManager> (NetHandlerLoginClient.class, Obf.networkManager); | 34 | public static final PrivateFieldsClient<NetHandlerLoginClient, NetworkManager> netManager = new PrivateFieldsClient<NetHandlerLoginClient, NetworkManager> (NetHandlerLoginClient.class, Obf.networkManager); |
33 | - public static final PrivateFieldsClient<RegistrySimple, Map> registryObjects = new PrivateFieldsClient<RegistrySimple, Map> (RegistrySimple.class, Obf.registryObjects); | ||
34 | - public static final PrivateFieldsClient<RegistryNamespaced, ObjectIntIdentityMap> underlyingIntegerMap = new PrivateFieldsClient<RegistryNamespaced, ObjectIntIdentityMap>(RegistryNamespaced.class, Obf.underlyingIntegerMap); | ||
35 | - public static final PrivateFieldsClient<ObjectIntIdentityMap, IdentityHashMap> identityMap = new PrivateFieldsClient<ObjectIntIdentityMap, IdentityHashMap> (ObjectIntIdentityMap.class, Obf.identityMap); | ||
36 | - public static final PrivateFieldsClient<ObjectIntIdentityMap, List> objectList = new PrivateFieldsClient<ObjectIntIdentityMap, List> (ObjectIntIdentityMap.class, Obf.objectList); | 35 | + public static final PrivateFieldsClient<RegistrySimple, Map> registryObjects = new PrivateFieldsClient<RegistrySimple, Map> (RegistrySimple.class, Obf.registryObjects); |
36 | + public static final PrivateFieldsClient<RegistryNamespaced, ObjectIntIdentityMap> underlyingIntegerMap = new PrivateFieldsClient<RegistryNamespaced, ObjectIntIdentityMap>(RegistryNamespaced.class, Obf.underlyingIntegerMap); | ||
37 | + public static final PrivateFieldsClient<ObjectIntIdentityMap, IdentityHashMap> identityMap = new PrivateFieldsClient<ObjectIntIdentityMap, IdentityHashMap> (ObjectIntIdentityMap.class, Obf.identityMap); | ||
38 | + public static final PrivateFieldsClient<ObjectIntIdentityMap, List> objectList = new PrivateFieldsClient<ObjectIntIdentityMap, List> (ObjectIntIdentityMap.class, Obf.objectList); | ||
37 | public static final PrivateFieldsClient<TileEntityRendererDispatcher, Map> specialRendererMap = new PrivateFieldsClient<TileEntityRendererDispatcher, Map> (TileEntityRendererDispatcher.class, Obf.mapSpecialRenderers); | 39 | public static final PrivateFieldsClient<TileEntityRendererDispatcher, Map> specialRendererMap = new PrivateFieldsClient<TileEntityRendererDispatcher, Map> (TileEntityRendererDispatcher.class, Obf.mapSpecialRenderers); |
38 | public static final PrivateFieldsClient<TileEntity, Map> tileEntityNameToClassMap = new PrivateFieldsClient<TileEntity, Map> (TileEntity.class, Obf.tileEntityNameToClassMap); | 40 | public static final PrivateFieldsClient<TileEntity, Map> tileEntityNameToClassMap = new PrivateFieldsClient<TileEntity, Map> (TileEntity.class, Obf.tileEntityNameToClassMap); |
39 | public static final PrivateFieldsClient<TileEntity, Map> tileEntityClassToNameMap = new PrivateFieldsClient<TileEntity, Map> (TileEntity.class, Obf.tileEntityClassToNameMap); | 41 | public static final PrivateFieldsClient<TileEntity, Map> tileEntityClassToNameMap = new PrivateFieldsClient<TileEntity, Map> (TileEntity.class, Obf.tileEntityClassToNameMap); |
src/client/java/com/mumfrey/liteloader/client/util/render/IconAbsolute.java
@@ -22,12 +22,14 @@ public class IconAbsolute implements IconTextured | @@ -22,12 +22,14 @@ public class IconAbsolute implements IconTextured | ||
22 | private float vCoord; | 22 | private float vCoord; |
23 | private float vCoord2; | 23 | private float vCoord2; |
24 | 24 | ||
25 | - public IconAbsolute(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, float uCoord2, float vCoord2) | 25 | + public IconAbsolute(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, float uCoord2, |
26 | + float vCoord2) | ||
26 | { | 27 | { |
27 | this(textureResource, displayText, width, height, uCoord, vCoord, uCoord2, vCoord2, 256); | 28 | this(textureResource, displayText, width, height, uCoord, vCoord, uCoord2, vCoord2, 256); |
28 | } | 29 | } |
29 | 30 | ||
30 | - public IconAbsolute(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, float uCoord2, float vCoord2, int texMapSize) | 31 | + public IconAbsolute(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, float uCoord2, |
32 | + float vCoord2, int texMapSize) | ||
31 | { | 33 | { |
32 | this.textureResource = textureResource; | 34 | this.textureResource = textureResource; |
33 | this.displayText = displayText; | 35 | this.displayText = displayText; |
src/client/java/com/mumfrey/liteloader/client/util/render/IconAbsoluteClickable.java
@@ -6,12 +6,14 @@ import com.mumfrey.liteloader.util.render.IconClickable; | @@ -6,12 +6,14 @@ import com.mumfrey.liteloader.util.render.IconClickable; | ||
6 | 6 | ||
7 | public abstract class IconAbsoluteClickable extends IconAbsolute implements IconClickable | 7 | public abstract class IconAbsoluteClickable extends IconAbsolute implements IconClickable |
8 | { | 8 | { |
9 | - public IconAbsoluteClickable(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, float uCoord2, float vCoord2) | 9 | + public IconAbsoluteClickable(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, |
10 | + float uCoord2, float vCoord2) | ||
10 | { | 11 | { |
11 | super(textureResource, displayText, width, height, uCoord, vCoord, uCoord2, vCoord2); | 12 | super(textureResource, displayText, width, height, uCoord, vCoord, uCoord2, vCoord2); |
12 | } | 13 | } |
13 | 14 | ||
14 | - public IconAbsoluteClickable(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, float uCoord2, float vCoord2, int texMapSize) | 15 | + public IconAbsoluteClickable(ResourceLocation textureResource, String displayText, int width, int height, float uCoord, float vCoord, |
16 | + float uCoord2, float vCoord2, int texMapSize) | ||
15 | { | 17 | { |
16 | super(textureResource, displayText, width, height, uCoord, vCoord, uCoord2, vCoord2, texMapSize); | 18 | super(textureResource, displayText, width, height, uCoord, vCoord, uCoord2, vCoord2, texMapSize); |
17 | } | 19 | } |
src/client/java/com/mumfrey/liteloader/gl/GL.java
@@ -14,24 +14,29 @@ import org.lwjgl.util.glu.GLU; | @@ -14,24 +14,29 @@ import org.lwjgl.util.glu.GLU; | ||
14 | /** | 14 | /** |
15 | * Convenience class for working with Mojang's GLStateManager: | 15 | * Convenience class for working with Mojang's GLStateManager: |
16 | * | 16 | * |
17 | - * It would be pretty tolerable to work with GLStateManager as a static import were it not for the fact that you still need to | ||
18 | - * import the GL namespaces themselves from LWJGL in order to get the constants, and also have to deal with the fact that | ||
19 | - * GLStateManager's methods don't have "gl-style" names, making it annoying to work with. This class is designed to function as | ||
20 | - * an adapter to allow changeover to be more painless. Using this class means that the following code: | 17 | + * <p>It would be pretty tolerable to work with GLStateManager as a static |
18 | + * import were it not for the fact that you still need to import the GL | ||
19 | + * namespaces themselves from LWJGL in order to get the constants, and also have | ||
20 | + * to deal with the fact that GLStateManager's methods don't have "gl-style" | ||
21 | + * names, making it annoying to work with. This class is designed to function as | ||
22 | + * an adapter to allow changeover to be more painless. Using this class means | ||
23 | + * that the following code:</p> | ||
21 | * | 24 | * |
22 | - * glEnable(GL_BLEND); | ||
23 | - * glAlphaFunc(GL_GREATER, 0.0F); | 25 | + * <pre><code>glEnable(GL_BLEND); |
26 | + * glAlphaFunc(GL_GREATER, 0.0F);</code></pre> | ||
24 | * | 27 | * |
25 | - * becomes: | 28 | + * <p>becomes:</p> |
26 | * | 29 | * |
27 | - * glEnableBlend(); | ||
28 | - * glAlphaFunc(GL_GREATER, 0.0F); | 30 | + * <pre><code>glEnableBlend(); |
31 | + * glAlphaFunc(GL_GREATER, 0.0F);</code></pre> | ||
29 | * | 32 | * |
30 | - * Notice that the glAlphaFunc invokation remains unchanged, and the glEnable call simply gets replaced with a logical equivalent | ||
31 | - * which invokes the GLStateManager method behind the scenes. | 33 | + * <p>Notice that the <tt>glAlphaFunc</tt> invocation remains unchanged, and the |
34 | + * <tt>glEnable</tt> call simply gets replaced with a logical equivalent which | ||
35 | + * invokes the GLStateManager method behind the scenes.</p> | ||
32 | * | 36 | * |
33 | - * To use this class, simply replace existing static imports in your classes with this single static import, then change glEnable | ||
34 | - * and glDisable calls accordingly. | 37 | + * <p>To use this class, simply replace existing static imports in your classes |
38 | + * with this single static import, then change <tt>glEnable</tt> and <tt> | ||
39 | + * glDisable</tt> calls accordingly. | ||
35 | * | 40 | * |
36 | * @author Adam Mummery-Smith | 41 | * @author Adam Mummery-Smith |
37 | */ | 42 | */ |
@@ -1178,7 +1183,8 @@ public class GL | @@ -1178,7 +1183,8 @@ public class GL | ||
1178 | return GL11.glGetBoolean(pname); | 1183 | return GL11.glGetBoolean(pname); |
1179 | } | 1184 | } |
1180 | 1185 | ||
1181 | - public static void gluProject(float objx, float objy, float objz, FloatBuffer modelMatrix, FloatBuffer projMatrix, IntBuffer viewport, FloatBuffer winPos) | 1186 | + public static void gluProject(float objx, float objy, float objz, FloatBuffer modelMatrix, FloatBuffer projMatrix, IntBuffer viewport, |
1187 | + FloatBuffer winPos) | ||
1182 | { | 1188 | { |
1183 | GLU.gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winPos); | 1189 | GLU.gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winPos); |
1184 | } | 1190 | } |
src/client/java/com/mumfrey/liteloader/gl/GLClippingPlanes.java
@@ -8,11 +8,13 @@ import org.lwjgl.BufferUtils; | @@ -8,11 +8,13 @@ import org.lwjgl.BufferUtils; | ||
8 | import org.lwjgl.util.Rectangle; | 8 | import org.lwjgl.util.Rectangle; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | - * OpenGL clipping plane convenience functions. We prefer to clip rectangular GUI regions in Minecraft using | ||
12 | - * clipping rather than scissor because scissor is a nuisance to work with, primarily because it works in | ||
13 | - * "window" (OpenGL window) coordinates and doesn't respect the current transformation matrix. Using clipping | ||
14 | - * planes we can specify clipping edges in "Minecraft screen coordinates", can optionally clip on only one or | ||
15 | - * two axes, and also don't need to worry about the current transform. | 11 | + * OpenGL clipping plane convenience functions. We prefer to clip rectangular |
12 | + * GUI regions in Minecraft using clipping rather than scissor because scissor | ||
13 | + * is a nuisance to work with, primarily because it works in "window" (OpenGL | ||
14 | + * window) coordinates and doesn't respect the current transformation matrix. | ||
15 | + * Using clipping planes we can specify clipping edges in "Minecraft screen | ||
16 | + * coordinates", can optionally clip on only one or two axes, and also don't | ||
17 | + * need to worry about the current transform. | ||
16 | * | 18 | * |
17 | * @author Adam Mummery-Smith | 19 | * @author Adam Mummery-Smith |
18 | */ | 20 | */ |
@@ -44,7 +46,7 @@ public final class GLClippingPlanes | @@ -44,7 +46,7 @@ public final class GLClippingPlanes | ||
44 | 46 | ||
45 | private static int totalClippingPlanes = glGetInteger(GL_MAX_CLIP_PLANES); | 47 | private static int totalClippingPlanes = glGetInteger(GL_MAX_CLIP_PLANES); |
46 | 48 | ||
47 | - // private static int frame = 0; | 49 | +// private static int frame = 0; |
48 | 50 | ||
49 | static | 51 | static |
50 | { | 52 | { |
src/client/java/com/mumfrey/liteloader/resources/InternalResourcePack.java
@@ -12,7 +12,8 @@ import net.minecraft.client.resources.data.IMetadataSerializer; | @@ -12,7 +12,8 @@ import net.minecraft.client.resources.data.IMetadataSerializer; | ||
12 | import net.minecraft.util.ResourceLocation; | 12 | import net.minecraft.util.ResourceLocation; |
13 | 13 | ||
14 | /** | 14 | /** |
15 | - * Resource pack which returns resources using Class::getResourceAsStream() on the specified class | 15 | + * Resource pack which returns resources using Class::getResourceAsStream() on |
16 | + * the specified class. | ||
16 | * | 17 | * |
17 | * @author Adam Mummery-Smith | 18 | * @author Adam Mummery-Smith |
18 | */ | 19 | */ |
@@ -50,7 +51,8 @@ public class InternalResourcePack implements IResourcePack | @@ -50,7 +51,8 @@ public class InternalResourcePack implements IResourcePack | ||
50 | } | 51 | } |
51 | 52 | ||
52 | /* (non-Javadoc) | 53 | /* (non-Javadoc) |
53 | - * @see net.minecraft.client.resources.IResourcePack#getInputStream(net.minecraft.util.ResourceLocation) | 54 | + * @see net.minecraft.client.resources.IResourcePack |
55 | + * #getInputStream(net.minecraft.util.ResourceLocation) | ||
54 | */ | 56 | */ |
55 | @Override | 57 | @Override |
56 | public InputStream getInputStream(ResourceLocation resourceLocation) throws IOException | 58 | public InputStream getInputStream(ResourceLocation resourceLocation) throws IOException |
@@ -63,11 +65,13 @@ public class InternalResourcePack implements IResourcePack | @@ -63,11 +65,13 @@ public class InternalResourcePack implements IResourcePack | ||
63 | */ | 65 | */ |
64 | private InputStream getResourceStream(ResourceLocation resourceLocation) | 66 | private InputStream getResourceStream(ResourceLocation resourceLocation) |
65 | { | 67 | { |
66 | - return this.resourceClass.getResourceAsStream(String.format("/assets/%s/%s", resourceLocation.getResourceDomain(), resourceLocation.getResourcePath())); | 68 | + return this.resourceClass.getResourceAsStream(String.format("/assets/%s/%s", |
69 | + resourceLocation.getResourceDomain(), resourceLocation.getResourcePath())); | ||
67 | } | 70 | } |
68 | 71 | ||
69 | /* (non-Javadoc) | 72 | /* (non-Javadoc) |
70 | - * @see net.minecraft.client.resources.IResourcePack#resourceExists(net.minecraft.util.ResourceLocation) | 73 | + * @see net.minecraft.client.resources.IResourcePack#resourceExists( |
74 | + * net.minecraft.util.ResourceLocation) | ||
71 | */ | 75 | */ |
72 | @Override | 76 | @Override |
73 | public boolean resourceExists(ResourceLocation resourceLocation) | 77 | public boolean resourceExists(ResourceLocation resourceLocation) |
@@ -85,7 +89,9 @@ public class InternalResourcePack implements IResourcePack | @@ -85,7 +89,9 @@ public class InternalResourcePack implements IResourcePack | ||
85 | } | 89 | } |
86 | 90 | ||
87 | /* (non-Javadoc) | 91 | /* (non-Javadoc) |
88 | - * @see net.minecraft.client.resources.IResourcePack#getPackMetadata(net.minecraft.client.resources.data.IMetadataSerializer, java.lang.String) | 92 | + * @see net.minecraft.client.resources.IResourcePack#getPackMetadata( |
93 | + * net.minecraft.client.resources.data.IMetadataSerializer, | ||
94 | + * java.lang.String) | ||
89 | */ | 95 | */ |
90 | @Override | 96 | @Override |
91 | public IMetadataSection getPackMetadata(IMetadataSerializer par1MetadataSerializer, String par2Str) throws IOException | 97 | public IMetadataSection getPackMetadata(IMetadataSerializer par1MetadataSerializer, String par2Str) throws IOException |
src/client/java/com/mumfrey/liteloader/resources/ModResourcePack.java
@@ -30,7 +30,9 @@ public class ModResourcePack extends FileResourcePack | @@ -30,7 +30,9 @@ public class ModResourcePack extends FileResourcePack | ||
30 | } | 30 | } |
31 | 31 | ||
32 | /* (non-Javadoc) | 32 | /* (non-Javadoc) |
33 | - * @see net.minecraft.client.resources.AbstractResourcePack#getPackMetadata(net.minecraft.client.resources.data.IMetadataSerializer, java.lang.String) | 33 | + * @see net.minecraft.client.resources.AbstractResourcePack#getPackMetadata( |
34 | + * net.minecraft.client.resources.data.IMetadataSerializer, | ||
35 | + * java.lang.String) | ||
34 | */ | 36 | */ |
35 | @Override | 37 | @Override |
36 | public IMetadataSection getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException | 38 | public IMetadataSection getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException |
src/client/java/com/mumfrey/liteloader/resources/ModResourcePackDir.java
@@ -30,7 +30,9 @@ public class ModResourcePackDir extends FolderResourcePack | @@ -30,7 +30,9 @@ public class ModResourcePackDir extends FolderResourcePack | ||
30 | } | 30 | } |
31 | 31 | ||
32 | /* (non-Javadoc) | 32 | /* (non-Javadoc) |
33 | - * @see net.minecraft.client.resources.AbstractResourcePack#getPackMetadata(net.minecraft.client.resources.data.IMetadataSerializer, java.lang.String) | 33 | + * @see net.minecraft.client.resources.AbstractResourcePack#getPackMetadata( |
34 | + * net.minecraft.client.resources.data.IMetadataSerializer, | ||
35 | + * java.lang.String) | ||
34 | */ | 36 | */ |
35 | @Override | 37 | @Override |
36 | public IMetadataSection getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException | 38 | public IMetadataSection getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException |
src/client/java/com/mumfrey/liteloader/util/InputManager.java
@@ -26,7 +26,8 @@ import com.mumfrey.liteloader.launch.LoaderProperties; | @@ -26,7 +26,8 @@ import com.mumfrey.liteloader.launch.LoaderProperties; | ||
26 | import com.mumfrey.liteloader.util.jinput.ComponentRegistry; | 26 | import com.mumfrey.liteloader.util.jinput.ComponentRegistry; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | - * Mod input class, aggregates functionality from LiteLoader's mod key registration functions and JInputLib | 29 | + * Mod input class, aggregates functionality from LiteLoader's mod key |
30 | + * registration functions and JInputLib. | ||
30 | * | 31 | * |
31 | * @author Adam Mummery-Smith | 32 | * @author Adam Mummery-Smith |
32 | */ | 33 | */ |
@@ -55,8 +56,8 @@ public final class InputManager extends Input | @@ -55,8 +56,8 @@ public final class InputManager extends Input | ||
55 | private final List<KeyBinding> modKeyBindings = new ArrayList<KeyBinding>(); | 56 | private final List<KeyBinding> modKeyBindings = new ArrayList<KeyBinding>(); |
56 | 57 | ||
57 | /** | 58 | /** |
58 | - * Map of mod key bindings to their key codes, stored so that we don't need to cast from | ||
59 | - * string in the properties file every tick | 59 | + * Map of mod key bindings to their key codes, stored so that we don't need |
60 | + * to cast from string in the properties file every tick. | ||
60 | */ | 61 | */ |
61 | private final Map<KeyBinding, Integer> storedModKeyBindings = new HashMap<KeyBinding, Integer>(); | 62 | private final Map<KeyBinding, Integer> storedModKeyBindings = new HashMap<KeyBinding, Integer>(); |
62 | 63 | ||
@@ -130,7 +131,8 @@ public final class InputManager extends Input | @@ -130,7 +131,8 @@ public final class InputManager extends Input | ||
130 | { | 131 | { |
131 | try | 132 | try |
132 | { | 133 | { |
133 | - binding.setKeyCode(Integer.parseInt(this.keyMapSettings.getProperty(binding.getKeyDescription(), String.valueOf(binding.getKeyCode())))); | 134 | + int code = Integer.parseInt(this.keyMapSettings.getProperty(binding.getKeyDescription(), String.valueOf(binding.getKeyCode()))); |
135 | + binding.setKeyCode(code); | ||
134 | } | 136 | } |
135 | catch (NumberFormatException ex) {} | 137 | catch (NumberFormatException ex) {} |
136 | } | 138 | } |
@@ -148,7 +150,8 @@ public final class InputManager extends Input | @@ -148,7 +150,8 @@ public final class InputManager extends Input | ||
148 | } | 150 | } |
149 | 151 | ||
150 | /** | 152 | /** |
151 | - * Unregisters a registered keybind with the game settings class, thus removing it from the "controls" screen | 153 | + * Unregisters a registered keybind with the game settings class, thus |
154 | + * removing it from the "controls" screen. | ||
152 | * | 155 | * |
153 | * @param binding | 156 | * @param binding |
154 | */ | 157 | */ |
@@ -218,7 +221,8 @@ public final class InputManager extends Input | @@ -218,7 +221,8 @@ public final class InputManager extends Input | ||
218 | { | 221 | { |
219 | try | 222 | try |
220 | { | 223 | { |
221 | - this.keyMapSettings.store(new FileWriter(this.keyMapSettingsFile), "Mod key mappings for LiteLoader mods, stored here to avoid losing settings stored in options.txt"); | 224 | + this.keyMapSettings.store(new FileWriter(this.keyMapSettingsFile), |
225 | + "Mod key mappings for LiteLoader mods, stored here to avoid losing settings stored in options.txt"); | ||
222 | } | 226 | } |
223 | catch (IOException ex) {} | 227 | catch (IOException ex) {} |
224 | } | 228 | } |
@@ -233,18 +237,21 @@ public final class InputManager extends Input | @@ -233,18 +237,21 @@ public final class InputManager extends Input | ||
233 | } | 237 | } |
234 | 238 | ||
235 | /** | 239 | /** |
236 | - * Returns a handle to the event described by descriptor (or null if no component is found matching the | ||
237 | - * descriptor. Retrieving an event via this method adds the controller (if found) to the polling list and | ||
238 | - * causes it to raise events against the specified handler. | 240 | + * Returns a handle to the event described by descriptor (or null if no |
241 | + * component is found matching the descriptor. Retrieving an event via this | ||
242 | + * method adds the controller (if found) to the polling list and causes it | ||
243 | + * to raise events against the specified handler. | ||
239 | * | 244 | * |
240 | - * This method returns an {@link InputEvent} which is passed as an argument to the relevant callback on | ||
241 | - * the supplied handler in order to identify the event. For example: | 245 | + * <p>This method returns an {@link InputEvent} which is passed as an |
246 | + * argument to the relevant callback on the supplied handler in order to | ||
247 | + * identify the event. For example:</p> | ||
242 | * | 248 | * |
243 | - * this.joystickButton = input.getEvent(descriptor, this); | 249 | + * <code>this.joystickButton = input.getEvent(descriptor, this);</code> |
244 | * | 250 | * |
245 | - * then in onAxisEvent | 251 | + * <p>then in onAxisEvent</p> |
246 | * | 252 | * |
247 | - * if (source == this.joystickButton) // do something with button | 253 | + * <code>if (source == this.joystickButton) // do something with button |
254 | + * </code> | ||
248 | * | 255 | * |
249 | * @param descriptor | 256 | * @param descriptor |
250 | * @param handler | 257 | * @param handler |
src/client/java/com/mumfrey/liteloader/util/ModUtilities.java
@@ -79,7 +79,8 @@ public abstract class ModUtilities | @@ -79,7 +79,8 @@ public abstract class ModUtilities | ||
79 | } | 79 | } |
80 | else | 80 | else |
81 | { | 81 | { |
82 | - LiteLoaderLogger.warning("Attempted to set renderer %s for entity class %s but the operation failed", renderer.getClass().getSimpleName(), entityClass.getSimpleName()); | 82 | + LiteLoaderLogger.warning("Attempted to set renderer %s for entity class %s but the operation failed", |
83 | + renderer.getClass().getSimpleName(), entityClass.getSimpleName()); | ||
83 | } | 84 | } |
84 | } | 85 | } |
85 | 86 | ||
@@ -90,13 +91,15 @@ public abstract class ModUtilities | @@ -90,13 +91,15 @@ public abstract class ModUtilities | ||
90 | 91 | ||
91 | try | 92 | try |
92 | { | 93 | { |
93 | - Map<Class<? extends TileEntity>, TileEntitySpecialRenderer> specialRendererMap = PrivateFieldsClient.specialRendererMap.get(tileEntityRenderer); | 94 | + Map<Class<? extends TileEntity>, TileEntitySpecialRenderer> specialRendererMap |
95 | + = PrivateFieldsClient.specialRendererMap.get(tileEntityRenderer); | ||
94 | specialRendererMap.put(tileEntityClass, renderer); | 96 | specialRendererMap.put(tileEntityClass, renderer); |
95 | renderer.setRendererDispatcher(tileEntityRenderer); | 97 | renderer.setRendererDispatcher(tileEntityRenderer); |
96 | } | 98 | } |
97 | catch (Exception ex) | 99 | catch (Exception ex) |
98 | { | 100 | { |
99 | - LiteLoaderLogger.warning("Attempted to set renderer %s for tile entity class %s but the operation failed", renderer.getClass().getSimpleName(), tileEntityClass.getSimpleName()); | 101 | + LiteLoaderLogger.warning("Attempted to set renderer %s for tile entity class %s but the operation failed", |
102 | + renderer.getClass().getSimpleName(), tileEntityClass.getSimpleName()); | ||
100 | } | 103 | } |
101 | } | 104 | } |
102 | 105 | ||
@@ -213,7 +216,8 @@ public abstract class ModUtilities | @@ -213,7 +216,8 @@ public abstract class ModUtilities | ||
213 | /** | 216 | /** |
214 | * Abstraction helper function | 217 | * Abstraction helper function |
215 | * | 218 | * |
216 | - * @param fieldName Name of field to get, returned unmodified if in debug mode | 219 | + * @param fieldName Name of field to get, returned unmodified if in debug |
220 | + * mode | ||
217 | * @return Obfuscated field name if present | 221 | * @return Obfuscated field name if present |
218 | * @deprecated use ObfuscationUtilities.getObfuscatedFieldName instead | 222 | * @deprecated use ObfuscationUtilities.getObfuscatedFieldName instead |
219 | */ | 223 | */ |
@@ -272,7 +276,8 @@ public abstract class ModUtilities | @@ -272,7 +276,8 @@ public abstract class ModUtilities | ||
272 | return null; | 276 | return null; |
273 | } | 277 | } |
274 | 278 | ||
275 | - private static void setFinalStaticField(Field field, Object value) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException | 279 | + private static void setFinalStaticField(Field field, Object value) |
280 | + throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException | ||
276 | { | 281 | { |
277 | Field modifiers = Field.class.getDeclaredField("modifiers"); | 282 | Field modifiers = Field.class.getDeclaredField("modifiers"); |
278 | modifiers.setAccessible(true); | 283 | modifiers.setAccessible(true); |
src/debug/java/com/mumfrey/liteloader/debug/LoginManager.java
@@ -61,28 +61,33 @@ public class LoginManager | @@ -61,28 +61,33 @@ public class LoginManager | ||
61 | private File jsonFile; | 61 | private File jsonFile; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | - * Username read from the auth JSON file, we use this as the default in the login dialog in | ||
65 | - * case login fails. This is stored in the JSON even if authentication is not successful so that | ||
66 | - * we can display the same username next time | 64 | + * Username read from the auth JSON file, we use this as the default in the |
65 | + * login dialog in case login fails. This is stored in the JSON even if | ||
66 | + * authentication is not successful so that we can display the same username | ||
67 | + * next time. | ||
67 | */ | 68 | */ |
68 | private String defaultUsername; | 69 | private String defaultUsername; |
69 | 70 | ||
70 | /** | 71 | /** |
71 | - * Minecraft screen name read from the auth JSON file. Use this as default in case the login fails | ||
72 | - * or is skipped (when offline) so that at least the Minecraft client has a sensible display name. | ||
73 | - * Defaults to user.name when not specified | 72 | + * Minecraft screen name read from the auth JSON file. Use this as default |
73 | + * in case the login fails or is skipped (when offline) so that at least the | ||
74 | + * Minecraft client has a sensible display name. | ||
75 | + * | ||
76 | + * <p>Defaults to user.name when not specified</p> | ||
74 | */ | 77 | */ |
75 | private String defaultDisplayName = System.getProperty("user.name"); | 78 | private String defaultDisplayName = System.getProperty("user.name"); |
76 | 79 | ||
77 | /** | 80 | /** |
78 | - * True if login should not be attempted, skips the authentication attempt and the login dialog | 81 | + * True if login should not be attempted, skips the authentication attempt |
82 | + * and the login dialog. | ||
79 | */ | 83 | */ |
80 | private boolean offline = false; | 84 | private boolean offline = false; |
81 | 85 | ||
82 | /** | 86 | /** |
83 | - * If authentication fails with token then the first attempt will be to use the user/pass specified | ||
84 | - * on the command line (if any). This flag is set AFTER that first attempt so that we know to display | ||
85 | - * the login dialog anyway (eg. the login on the command line was bad) | 87 | + * If authentication fails with token then the first attempt will be to use |
88 | + * the user/pass specified on the command line (if any). This flag is set | ||
89 | + * <b>after</b> that first attempt so that we know to display the login | ||
90 | + * dialog anyway (eg. the login on the command line was bad). | ||
86 | */ | 91 | */ |
87 | private boolean forceShowLoginDialog = false; | 92 | private boolean forceShowLoginDialog = false; |
88 | 93 | ||
@@ -100,8 +105,8 @@ public class LoginManager | @@ -100,8 +105,8 @@ public class LoginManager | ||
100 | } | 105 | } |
101 | 106 | ||
102 | /** | 107 | /** |
103 | - * When authenticaion fails, we regenerate the auth service and agent because trying again with the same | ||
104 | - * client data will fail. | 108 | + * When authenticaion fails, we regenerate the auth service and agent |
109 | + * because trying again with the same client data will fail. | ||
105 | */ | 110 | */ |
106 | public void resetAuth() | 111 | public void resetAuth() |
107 | { | 112 | { |
@@ -181,18 +186,24 @@ public class LoginManager | @@ -181,18 +186,24 @@ public class LoginManager | ||
181 | } | 186 | } |
182 | 187 | ||
183 | /** | 188 | /** |
184 | - * Attempt to login. If authentication data are found on disk then tries first to log in with | ||
185 | - * the stored token. If the token login fails then attempts to log in with the username and password | ||
186 | - * specified. If no user or pass are specified or if they fail then displays a login dialog to | ||
187 | - * allow the user to login. If login succeeds then the token is stored on disk and the method | ||
188 | - * returns. | 189 | + * Attempt to login. If authentication data are found on disk then tries |
190 | + * first to log in with the stored token. If the token login fails then | ||
191 | + * attempts to log in with the username and password specified. If no user | ||
192 | + * or pass are specified or if they fail then displays a login dialog to | ||
193 | + * allow the user to login. If login succeeds then the token is stored on | ||
194 | + * disk and the method returns. | ||
189 | * | 195 | * |
190 | - * If the user presses cancel in the login dialog then the method returns false. | 196 | + * <p>If the user presses cancel in the login dialog then the method returns |
197 | + * false.</p> | ||
191 | * | 198 | * |
192 | - * @param username User name to log in with if token login fails, if null displays the login dialog immediately | ||
193 | - * @param password Password to log in with if token login fails, if null displays the login dialog immediately | ||
194 | - * @param remainingTries Number of loops to go through before giving up, decremented for each try, specify -1 for unlimited | ||
195 | - * @return false if the user presses cancel in the login dialog, otherwise returns true | 199 | + * @param username User name to log in with if token login fails, if null |
200 | + * displays the login dialog immediately | ||
201 | + * @param password Password to log in with if token login fails, if null | ||
202 | + * displays the login dialog immediately | ||
203 | + * @param remainingTries Number of loops to go through before giving up, | ||
204 | + * decremented for each try, specify -1 for unlimited | ||
205 | + * @return false if the user presses cancel in the login dialog, otherwise | ||
206 | + * returns true | ||
196 | */ | 207 | */ |
197 | public boolean login(String username, String password, int remainingTries) | 208 | public boolean login(String username, String password, int remainingTries) |
198 | { | 209 | { |
@@ -246,7 +257,14 @@ public class LoginManager | @@ -246,7 +257,14 @@ public class LoginManager | ||
246 | 257 | ||
247 | if (this.offline) | 258 | if (this.offline) |
248 | { | 259 | { |
249 | - if (JOptionPane.showConfirmDialog(null, "<html>You have chosen to work offline. You will never be prompted to log in again.<br /><br />If you would like to re-enable login please delete the file <span style=\"color: #0000FF\">.auth.json</span> from the working dir<br />or press Cancel to return to the login dialog.</html>", "Confirm work offline", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.CANCEL_OPTION) | 260 | + if (JOptionPane.showConfirmDialog(null, "<html>You have chosen to work offline. " |
261 | + + "You will never be prompted to log in again.<br /><br />" | ||
262 | + + "If you would like to re-enable login please delete the file <span style=\"color: #0000FF\">.auth.json</span> " | ||
263 | + + "from the working dir<br />" | ||
264 | + + "or press Cancel to return to the login dialog.</html>", | ||
265 | + "Confirm work offline", | ||
266 | + JOptionPane.OK_CANCEL_OPTION, | ||
267 | + JOptionPane.INFORMATION_MESSAGE) == JOptionPane.CANCEL_OPTION) | ||
250 | { | 268 | { |
251 | this.offline = false; | 269 | this.offline = false; |
252 | remainingTries = Math.max(remainingTries, 3); | 270 | remainingTries = Math.max(remainingTries, 3); |
@@ -329,7 +347,8 @@ public class LoginManager | @@ -329,7 +347,8 @@ public class LoginManager | ||
329 | public String getUserProperties() | 347 | public String getUserProperties() |
330 | { | 348 | { |
331 | PropertyMap userProperties = this.authentication.getUserProperties(); | 349 | PropertyMap userProperties = this.authentication.getUserProperties(); |
332 | - return userProperties != null ? (new GsonBuilder()).registerTypeAdapter(PropertyMap.class, new UserPropertiesSerializer()).create().toJson(userProperties) : "{}"; | 350 | + return userProperties != null ? (new GsonBuilder()).registerTypeAdapter(PropertyMap.class, |
351 | + new UserPropertiesSerializer()).create().toJson(userProperties) : "{}"; | ||
333 | } | 352 | } |
334 | 353 | ||
335 | class UserPropertiesSerializer implements JsonSerializer<PropertyMap> | 354 | class UserPropertiesSerializer implements JsonSerializer<PropertyMap> |
@@ -376,21 +395,27 @@ public class LoginManager | @@ -376,21 +395,27 @@ public class LoginManager | ||
376 | // default ctor for Gson | 395 | // default ctor for Gson |
377 | } | 396 | } |
378 | 397 | ||
379 | - public AuthData(YggdrasilAuthenticationService authService, YggdrasilUserAuthentication authentication, boolean workOffline, String defaultUserName, String defaultDisplayName) | 398 | + public AuthData(YggdrasilAuthenticationService authService, YggdrasilUserAuthentication authentication, boolean workOffline, |
399 | + String defaultUserName, String defaultDisplayName) | ||
380 | { | 400 | { |
381 | this.clientToken = authService.getClientToken(); | 401 | this.clientToken = authService.getClientToken(); |
382 | this.credentials = authentication.saveForStorage(); | 402 | this.credentials = authentication.saveForStorage(); |
383 | this.workOffline = workOffline; | 403 | this.workOffline = workOffline; |
384 | 404 | ||
385 | if (defaultUserName != null && !this.credentials.containsKey("username")) | 405 | if (defaultUserName != null && !this.credentials.containsKey("username")) |
406 | + { | ||
386 | this.credentials.put("username", defaultUserName); | 407 | this.credentials.put("username", defaultUserName); |
408 | + } | ||
387 | 409 | ||
388 | if (defaultDisplayName != null && !this.credentials.containsKey("displayName")) | 410 | if (defaultDisplayName != null && !this.credentials.containsKey("displayName")) |
411 | + { | ||
389 | this.credentials.put("displayName", defaultDisplayName); | 412 | this.credentials.put("displayName", defaultDisplayName); |
413 | + } | ||
390 | } | 414 | } |
391 | 415 | ||
392 | /** | 416 | /** |
393 | - * Called after Gson deserialisation to check that deserialisation was successful | 417 | + * Called after Gson deserialisation to check that deserialisation was |
418 | + * successful. | ||
394 | */ | 419 | */ |
395 | public boolean validate() | 420 | public boolean validate() |
396 | { | 421 | { |
@@ -426,7 +451,8 @@ public class LoginManager | @@ -426,7 +451,8 @@ public class LoginManager | ||
426 | 451 | ||
427 | public String getDisplayName() | 452 | public String getDisplayName() |
428 | { | 453 | { |
429 | - return this.credentials != null && this.credentials.containsKey("displayName") ? this.credentials.get("displayName").toString() : System.getProperty("user.name"); | 454 | + return this.credentials != null && this.credentials.containsKey("displayName") |
455 | + ? this.credentials.get("displayName").toString() : System.getProperty("user.name"); | ||
430 | } | 456 | } |
431 | } | 457 | } |
432 | } | 458 | } |
src/debug/java/com/mumfrey/liteloader/debug/LoginPanel.java
@@ -20,7 +20,8 @@ import javax.swing.border.EmptyBorder; | @@ -20,7 +20,8 @@ import javax.swing.border.EmptyBorder; | ||
20 | import javax.swing.border.TitledBorder; | 20 | import javax.swing.border.TitledBorder; |
21 | 21 | ||
22 | /** | 22 | /** |
23 | - * JPanel displayed in a JDialog to prompt the user for login credentials for minecraft | 23 | + * JPanel displayed in a JDialog to prompt the user for login credentials for |
24 | + * minecraft. | ||
24 | * | 25 | * |
25 | * @author Adam Mummery-Smith | 26 | * @author Adam Mummery-Smith |
26 | */ | 27 | */ |
@@ -77,7 +78,8 @@ public class LoginPanel extends JPanel | @@ -77,7 +78,8 @@ public class LoginPanel extends JPanel | ||
77 | 78 | ||
78 | this.panelCentre = new JPanel(); | 79 | this.panelCentre = new JPanel(); |
79 | this.panelCentre.setOpaque(false); | 80 | this.panelCentre.setOpaque(false); |
80 | - this.panelCentre.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Yggdrasil Login", TitledBorder.LEADING, TitledBorder.TOP, null, Color.WHITE)); | 81 | + this.panelCentre.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Yggdrasil Login", |
82 | + TitledBorder.LEADING, TitledBorder.TOP, null, Color.WHITE)); | ||
81 | this.panelLoginLayout = new GridBagLayout(); | 83 | this.panelLoginLayout = new GridBagLayout(); |
82 | this.panelLoginLayout.columnWidths = new int[] {30, 80, 120, 120, 30}; | 84 | this.panelLoginLayout.columnWidths = new int[] {30, 80, 120, 120, 30}; |
83 | this.panelLoginLayout.rowHeights = new int[] {24, 32, 32, 32}; | 85 | this.panelLoginLayout.rowHeights = new int[] {24, 32, 32, 32}; |
@@ -115,7 +117,8 @@ public class LoginPanel extends JPanel | @@ -115,7 +117,8 @@ public class LoginPanel extends JPanel | ||
115 | this.txtPassword.setText(password); | 117 | this.txtPassword.setText(password); |
116 | 118 | ||
117 | this.btnLogin = new JButton("Log in"); | 119 | this.btnLogin = new JButton("Log in"); |
118 | - this.btnLogin.addActionListener(new ActionListener() { | 120 | + this.btnLogin.addActionListener(new ActionListener() |
121 | + { | ||
119 | @Override public void actionPerformed(ActionEvent e) | 122 | @Override public void actionPerformed(ActionEvent e) |
120 | { | 123 | { |
121 | LoginPanel.this.onLoginClick(); | 124 | LoginPanel.this.onLoginClick(); |
@@ -123,7 +126,8 @@ public class LoginPanel extends JPanel | @@ -123,7 +126,8 @@ public class LoginPanel extends JPanel | ||
123 | }); | 126 | }); |
124 | 127 | ||
125 | this.btnCancel = new JButton("Cancel"); | 128 | this.btnCancel = new JButton("Cancel"); |
126 | - this.btnCancel.addActionListener(new ActionListener() { | 129 | + this.btnCancel.addActionListener(new ActionListener() |
130 | + { | ||
127 | @Override public void actionPerformed(ActionEvent e) | 131 | @Override public void actionPerformed(ActionEvent e) |
128 | { | 132 | { |
129 | LoginPanel.this.onCancelClick(); | 133 | LoginPanel.this.onCancelClick(); |
@@ -225,9 +229,13 @@ public class LoginPanel extends JPanel | @@ -225,9 +229,13 @@ public class LoginPanel extends JPanel | ||
225 | if (this.txtUsername.getText().length() > 0) | 229 | if (this.txtUsername.getText().length() > 0) |
226 | { | 230 | { |
227 | if (this.txtPassword.getText().length() > 0) | 231 | if (this.txtPassword.getText().length() > 0) |
232 | + { | ||
228 | this.txtUsername.select(0, this.txtUsername.getText().length()); | 233 | this.txtUsername.select(0, this.txtUsername.getText().length()); |
234 | + } | ||
229 | else | 235 | else |
236 | + { | ||
230 | this.txtPassword.requestFocusInWindow(); | 237 | this.txtPassword.requestFocusInWindow(); |
238 | + } | ||
231 | } | 239 | } |
232 | } | 240 | } |
233 | 241 |
src/debug/java/com/mumfrey/liteloader/debug/Start.java
@@ -18,7 +18,8 @@ import com.mumfrey.liteloader.launch.LiteLoaderTweakerServer; | @@ -18,7 +18,8 @@ import com.mumfrey.liteloader.launch.LiteLoaderTweakerServer; | ||
18 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | 18 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; |
19 | 19 | ||
20 | /** | 20 | /** |
21 | - * Wrapper class for LaunchWrapper Main class, which logs in using Yggdrasil first so that online shizzle can be tested | 21 | + * Wrapper class for LaunchWrapper Main class, which logs in using Yggdrasil |
22 | + * first so that online shizzle can be tested. | ||
22 | * | 23 | * |
23 | * @author Adam Mummery-Smith | 24 | * @author Adam Mummery-Smith |
24 | */ | 25 | */ |
@@ -48,8 +49,9 @@ public abstract class Start | @@ -48,8 +49,9 @@ public abstract class Start | ||
48 | } | 49 | } |
49 | 50 | ||
50 | /** | 51 | /** |
51 | - * Process the launch-time args, since we may be being launched by GradleStart we need to parse | ||
52 | - * out any values passed in and ensure we replace them with our own | 52 | + * Process the launch-time args, since we may be being launched by |
53 | + * GradleStart we need to parse out any values passed in and ensure we | ||
54 | + * replace them with our own. | ||
53 | */ | 55 | */ |
54 | private static String[] processArgs(String[] args) | 56 | private static String[] processArgs(String[] args) |
55 | { | 57 | { |
@@ -77,14 +79,17 @@ public abstract class Start | @@ -77,14 +79,17 @@ public abstract class Start | ||
77 | for (String arg : args) | 79 | for (String arg : args) |
78 | { | 80 | { |
79 | if (target.equalsIgnoreCase(arg)) | 81 | if (target.equalsIgnoreCase(arg)) |
82 | + { | ||
80 | return true; | 83 | return true; |
84 | + } | ||
81 | } | 85 | } |
82 | 86 | ||
83 | return false; | 87 | return false; |
84 | } | 88 | } |
85 | 89 | ||
86 | /** | 90 | /** |
87 | - * Read the args from the command line into the qualified and unqualified collections | 91 | + * Read the args from the command line into the qualified and unqualified |
92 | + * collections. | ||
88 | */ | 93 | */ |
89 | private static void parseArgs(String[] args, List<String> unqualifiedArgs, Map<String, Set<String>> qualifiedArgs) | 94 | private static void parseArgs(String[] args, List<String> unqualifiedArgs, Map<String, Set<String>> qualifiedArgs) |
90 | { | 95 | { |
@@ -166,7 +171,9 @@ public abstract class Start | @@ -166,7 +171,9 @@ public abstract class Start | ||
166 | } | 171 | } |
167 | 172 | ||
168 | if (!Start.MULTI_VALUE_ARGS.contains(qualifier)) | 173 | if (!Start.MULTI_VALUE_ARGS.contains(qualifier)) |
174 | + { | ||
169 | args.clear(); | 175 | args.clear(); |
176 | + } | ||
170 | 177 | ||
171 | args.add(arg); | 178 | args.add(arg); |
172 | } | 179 | } |
src/main/java/com/mumfrey/liteloader/Configurable.java
@@ -3,15 +3,16 @@ package com.mumfrey.liteloader; | @@ -3,15 +3,16 @@ package com.mumfrey.liteloader; | ||
3 | import com.mumfrey.liteloader.modconfig.ConfigPanel; | 3 | import com.mumfrey.liteloader.modconfig.ConfigPanel; |
4 | 4 | ||
5 | /** | 5 | /** |
6 | - * Interface for mods which want to provide a configuration panel inside the "mod info" screen | 6 | + * Interface for mods which want to provide a configuration panel inside the |
7 | + * "mod info" screen. | ||
7 | * | 8 | * |
8 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
9 | */ | 10 | */ |
10 | public interface Configurable | 11 | public interface Configurable |
11 | { | 12 | { |
12 | /** | 13 | /** |
13 | - * Get the class of the configuration panel to use, the returned class must have a | ||
14 | - * default (no-arg) constructor | 14 | + * Get the class of the configuration panel to use, the returned class must |
15 | + * have a default (no-arg) constructor | ||
15 | * | 16 | * |
16 | * @return configuration panel class | 17 | * @return configuration panel class |
17 | */ | 18 | */ |
src/main/java/com/mumfrey/liteloader/LiteMod.java
@@ -20,15 +20,17 @@ public interface LiteMod extends Exposable, Listener | @@ -20,15 +20,17 @@ public interface LiteMod extends Exposable, Listener | ||
20 | public abstract String getVersion(); | 20 | public abstract String getVersion(); |
21 | 21 | ||
22 | /** | 22 | /** |
23 | - * Do startup stuff here, minecraft is not fully initialised when this function is called so mods *must not* | ||
24 | - * interact with minecraft in any way here | 23 | + * Do startup stuff here, minecraft is not fully initialised when this |
24 | + * function is called so mods <b>must not</b> interact with minecraft in any | ||
25 | + * way here. | ||
25 | * | 26 | * |
26 | * @param configPath Configuration path to use | 27 | * @param configPath Configuration path to use |
27 | */ | 28 | */ |
28 | public abstract void init(File configPath); | 29 | public abstract void init(File configPath); |
29 | 30 | ||
30 | /** | 31 | /** |
31 | - * Called when the loader detects that a version change has happened since this mod was last loaded | 32 | + * Called when the loader detects that a version change has happened since |
33 | + * this mod was last loaded. | ||
32 | * | 34 | * |
33 | * @param version new version | 35 | * @param version new version |
34 | * @param configPath Path for the new version-specific config | 36 | * @param configPath Path for the new version-specific config |
src/main/java/com/mumfrey/liteloader/PacketHandler.java
@@ -18,11 +18,15 @@ public interface PacketHandler extends LiteMod | @@ -18,11 +18,15 @@ public interface PacketHandler extends LiteMod | ||
18 | public List<Class<? extends Packet>> getHandledPackets(); | 18 | public List<Class<? extends Packet>> getHandledPackets(); |
19 | 19 | ||
20 | /** | 20 | /** |
21 | - * @param netHandler The vanilla nethandler which will handle this packet if not cancelled | 21 | + * @param netHandler The vanilla nethandler which will handle this packet if |
22 | + * not cancelled | ||
22 | * @param packet Incoming packet | 23 | * @param packet Incoming packet |
23 | - * @return True to allow further processing of this packet, including other PacketHandlers and eventually the vanilla netHandler, to inhibit further | ||
24 | - * processing return false. You may choose to return false and then invoke the vanilla handler method on the supplied INetHandler if you wish to | ||
25 | - * inhibit later PacketHandlers but preserve vanilla behaviour. | 24 | + * @return True to allow further processing of this packet, including other |
25 | + * PacketHandlers and eventually the vanilla netHandler, to inhibit | ||
26 | + * further processing return false. You may choose to return false and | ||
27 | + * then invoke the vanilla handler method on the supplied INetHandler | ||
28 | + * if you wish to inhibit later PacketHandlers but preserve vanilla | ||
29 | + * behaviour. | ||
26 | */ | 30 | */ |
27 | public abstract boolean handlePacket(INetHandler netHandler, Packet packet); | 31 | public abstract boolean handlePacket(INetHandler netHandler, Packet packet); |
28 | } | 32 | } |
src/main/java/com/mumfrey/liteloader/Permissible.java
@@ -11,9 +11,11 @@ import com.mumfrey.liteloader.permissions.PermissionsManagerClient; | @@ -11,9 +11,11 @@ import com.mumfrey.liteloader.permissions.PermissionsManagerClient; | ||
11 | public interface Permissible extends LiteMod | 11 | public interface Permissible extends LiteMod |
12 | { | 12 | { |
13 | /** | 13 | /** |
14 | - * Returns the node name of the mod, replicated permissions will be of the form mod.<name>.permission.node so this | ||
15 | - * method must return a valid name for use in permission nodes. This method must also return the same value every | ||
16 | - * time it is called since permissible names are not necessarily cached. | 14 | + * Returns the node name of the mod, replicated permissions will be of the |
15 | + * form mod.<name>.permission.node so this method must return a valid name | ||
16 | + * for use in permission nodes. This method must also return the same value | ||
17 | + * every time it is called since permissible names are not necessarily | ||
18 | + * cached. | ||
17 | * | 19 | * |
18 | * @return Permissible name | 20 | * @return Permissible name |
19 | */ | 21 | */ |
@@ -27,9 +29,10 @@ public interface Permissible extends LiteMod | @@ -27,9 +29,10 @@ public interface Permissible extends LiteMod | ||
27 | public abstract float getPermissibleModVersion(); | 29 | public abstract float getPermissibleModVersion(); |
28 | 30 | ||
29 | /** | 31 | /** |
30 | - * Called by the permissions manager at initialisation to instruct the mod to populate the list of permissions it | ||
31 | - * supports. This method should call back against the supplied permissions manager to register the permissions to | ||
32 | - * be sent to the server when connecting. | 32 | + * Called by the permissions manager at initialisation to instruct the mod |
33 | + * to populate the list of permissions it supports. This method should call | ||
34 | + * back against the supplied permissions manager to register the permissions | ||
35 | + * to be sent to the server when connecting. | ||
33 | * | 36 | * |
34 | * @param permissionsManager Client permissions manager | 37 | * @param permissionsManager Client permissions manager |
35 | */ | 38 | */ |
@@ -43,7 +46,8 @@ public interface Permissible extends LiteMod | @@ -43,7 +46,8 @@ public interface Permissible extends LiteMod | ||
43 | public abstract void onPermissionsCleared(PermissionsManager manager); | 46 | public abstract void onPermissionsCleared(PermissionsManager manager); |
44 | 47 | ||
45 | /** | 48 | /** |
46 | - * Called when the permissions are changed (eg. when new permissions are received from the server) | 49 | + * Called when the permissions are changed (eg. when new permissions are |
50 | + * received from the server) | ||
47 | * | 51 | * |
48 | * @param manager | 52 | * @param manager |
49 | */ | 53 | */ |
src/main/java/com/mumfrey/liteloader/PlayerInteractionListener.java
@@ -6,8 +6,8 @@ import net.minecraft.util.EnumFacing; | @@ -6,8 +6,8 @@ import net.minecraft.util.EnumFacing; | ||
6 | import net.minecraft.util.MovingObjectPosition.MovingObjectType; | 6 | import net.minecraft.util.MovingObjectPosition.MovingObjectType; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | - * Interface for mods which want to observe the player's "interaction" status (player mouse clicks), allows block interaction | ||
10 | - * events to be cancelled. | 9 | + * Interface for mods which want to observe the player's "interaction" status |
10 | + * (player mouse clicks), allows block interaction events to be cancelled. | ||
11 | * | 11 | * |
12 | * @author Adam Mummery-Smith | 12 | * @author Adam Mummery-Smith |
13 | */ | 13 | */ |
@@ -23,28 +23,36 @@ public interface PlayerInteractionListener extends LiteMod | @@ -23,28 +23,36 @@ public interface PlayerInteractionListener extends LiteMod | ||
23 | } | 23 | } |
24 | 24 | ||
25 | /** | 25 | /** |
26 | - * Called when the player clicks but does not "hit" a block, the trace position is raytraced to the player's current view | ||
27 | - * distance and represents the block which the player is "looking at". This method is NOT called when the player right clicks | ||
28 | - * with an empty hand. | 26 | + * Called when the player clicks but does not "hit" a block, the trace |
27 | + * position is raytraced to the player's current view distance and | ||
28 | + * represents the block which the player is "looking at". This method is | ||
29 | + * <b>not</b> called when the player right clicks with an empty hand. | ||
29 | * | 30 | * |
30 | * @param player Player | 31 | * @param player Player |
31 | * @param button Mouse button the user clicked | 32 | * @param button Mouse button the user clicked |
32 | * @param tracePos Raytraced location of the block which was hit | 33 | * @param tracePos Raytraced location of the block which was hit |
33 | * @param traceSideHit Raytraced side hit | 34 | * @param traceSideHit Raytraced side hit |
34 | - * @param traceHitType Type of hit, will be MISS if the trace expired without hitting anything (eg. the player clicked the sky) | 35 | + * @param traceHitType Type of hit, will be MISS if the trace expired |
36 | + * without hitting anything (eg. the player clicked the sky) | ||
35 | */ | 37 | */ |
36 | - public abstract void onPlayerClickedAir(EntityPlayerMP player, MouseButton button, BlockPos tracePos, EnumFacing traceSideHit, MovingObjectType traceHitType); | 38 | + public abstract void onPlayerClickedAir(EntityPlayerMP player, MouseButton button, BlockPos tracePos, EnumFacing traceSideHit, |
39 | + MovingObjectType traceHitType); | ||
37 | 40 | ||
38 | /** | 41 | /** |
39 | - * Calls when the player clicks and hits a block, usually indicates that the player is digging or placing a block, although | ||
40 | - * a block placement does not necessarily succeed. Return true from this callback to allow the action to proceed, or false to | ||
41 | - * cancel the action. Cancelling the action does not prevent further handlers from receiving the event. | 42 | + * Calls when the player clicks and hits a block, usually indicates that the |
43 | + * player is digging or placing a block, although a block placement does not | ||
44 | + * necessarily succeed. Return true from this callback to allow the action | ||
45 | + * to proceed, or false to cancel the action. Cancelling the action does not | ||
46 | + * prevent further handlers from receiving the event. | ||
42 | * | 47 | * |
43 | * @param player Player | 48 | * @param player Player |
44 | - * @param button Mouse button that was pressed (left = dig, right = interact/place) | ||
45 | - * @param hitPos Block which was *hit*. Note that block placement will normally be at hitPos.offset(sideHit) | 49 | + * @param button Mouse button that was pressed, left = dig, right = interact |
50 | + * @param hitPos Block which was *hit*. Note that block placement will | ||
51 | + * normally be at hitPos.offset(sideHit) | ||
46 | * @param sideHit Side of the block which was hit | 52 | * @param sideHit Side of the block which was hit |
47 | - * @return true to allow the action to be processed (another listener may still inhibit the action), return false to cancel the action (other listeners will still be notified) | 53 | + * @return true to allow the action to be processed (another listener may |
54 | + * still inhibit the action), return false to cancel the action (other | ||
55 | + * listeners will still be notified) | ||
48 | */ | 56 | */ |
49 | public abstract boolean onPlayerClickedBlock(EntityPlayerMP player, MouseButton button, BlockPos hitPos, EnumFacing sideHit); | 57 | public abstract boolean onPlayerClickedBlock(EntityPlayerMP player, MouseButton button, BlockPos hitPos, EnumFacing sideHit); |
50 | } | 58 | } |
src/main/java/com/mumfrey/liteloader/PlayerMoveListener.java
@@ -18,9 +18,10 @@ public interface PlayerMoveListener extends LiteMod | @@ -18,9 +18,10 @@ public interface PlayerMoveListener extends LiteMod | ||
18 | * @param playerMP Player moving | 18 | * @param playerMP Player moving |
19 | * @param from Player's previous recorded position | 19 | * @param from Player's previous recorded position |
20 | * @param to Position the player is attempting to move to | 20 | * @param to Position the player is attempting to move to |
21 | - * @param newPos Set this position to teleport the player to newPos instead of processing the original move | ||
22 | - * | ||
23 | - * @return false to cancel the event or true to allow the movement to be processed as normal or newPos to be applied | 21 | + * @param newPos Set this position to teleport the player to newPos instead |
22 | + * of processing the original move | ||
23 | + * @return false to cancel the event or true to allow the movement to be | ||
24 | + * processed as normal or newPos to be applied | ||
24 | */ | 25 | */ |
25 | public abstract boolean onPlayerMove(EntityPlayerMP playerMP, Position from, Position to, ReturnValue<Position> newPos); | 26 | public abstract boolean onPlayerMove(EntityPlayerMP playerMP, Position from, Position to, ReturnValue<Position> newPos); |
26 | } | 27 | } |
src/main/java/com/mumfrey/liteloader/PluginChannelListener.java
@@ -12,7 +12,8 @@ import com.mumfrey.liteloader.core.CommonPluginChannelListener; | @@ -12,7 +12,8 @@ import com.mumfrey.liteloader.core.CommonPluginChannelListener; | ||
12 | public interface PluginChannelListener extends LiteMod, CommonPluginChannelListener | 12 | public interface PluginChannelListener extends LiteMod, CommonPluginChannelListener |
13 | { | 13 | { |
14 | /** | 14 | /** |
15 | - * Called when a custom payload packet arrives on a channel this mod has registered | 15 | + * Called when a custom payload packet arrives on a channel this mod has |
16 | + * registered. | ||
16 | * | 17 | * |
17 | * @param channel Channel on which the custom payload was received | 18 | * @param channel Channel on which the custom payload was received |
18 | * @param data Custom payload data | 19 | * @param data Custom payload data |
src/main/java/com/mumfrey/liteloader/PreJoinGameListener.java
@@ -5,18 +5,19 @@ import net.minecraft.network.play.server.S01PacketJoinGame; | @@ -5,18 +5,19 @@ import net.minecraft.network.play.server.S01PacketJoinGame; | ||
5 | 5 | ||
6 | 6 | ||
7 | /** | 7 | /** |
8 | - * Interface for mods which wish to be notified when the player connects to a server (or local game) | 8 | + * Interface for mods which wish to be notified when the player connects to a |
9 | + * server (or local game). | ||
9 | * | 10 | * |
10 | * @author Adam Mummery-Smith | 11 | * @author Adam Mummery-Smith |
11 | */ | 12 | */ |
12 | public interface PreJoinGameListener extends LiteMod | 13 | public interface PreJoinGameListener extends LiteMod |
13 | { | 14 | { |
14 | /** | 15 | /** |
15 | - * Called before login. NOTICE: as of 1.8 the return value of this method has a different meaning! | 16 | + * Called before login. NOTICE: as of 1.8 the return value of this method |
17 | + * has a different meaning! | ||
16 | * | 18 | * |
17 | * @param netHandler Net handler | 19 | * @param netHandler Net handler |
18 | * @param joinGamePacket Join game packet | 20 | * @param joinGamePacket Join game packet |
19 | - * | ||
20 | * @return true to allow login to continue, false to cancel login | 21 | * @return true to allow login to continue, false to cancel login |
21 | */ | 22 | */ |
22 | public abstract boolean onPreJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket); | 23 | public abstract boolean onPreJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket); |
src/main/java/com/mumfrey/liteloader/Priority.java
@@ -6,8 +6,8 @@ import java.lang.annotation.RetentionPolicy; | @@ -6,8 +6,8 @@ import java.lang.annotation.RetentionPolicy; | ||
6 | import java.lang.annotation.Target; | 6 | import java.lang.annotation.Target; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | - * Priority declaration for LiteMods, used when sorting listener lists. Default value if no Priority annotation | ||
10 | - * is specified is 1000. | 9 | + * Priority declaration for LiteMods, used when sorting listener lists. Default |
10 | + * value if no Priority annotation is specified is 1000. | ||
11 | * | 11 | * |
12 | * @author Adam Mummery-Smith | 12 | * @author Adam Mummery-Smith |
13 | */ | 13 | */ |
src/main/java/com/mumfrey/liteloader/ServerChatFilter.java
@@ -11,7 +11,8 @@ import net.minecraft.network.play.client.C01PacketChatMessage; | @@ -11,7 +11,8 @@ import net.minecraft.network.play.client.C01PacketChatMessage; | ||
11 | public interface ServerChatFilter extends LiteMod | 11 | public interface ServerChatFilter extends LiteMod |
12 | { | 12 | { |
13 | /** | 13 | /** |
14 | - * Chat filter function, return false to filter this packet, true to pass the packet | 14 | + * Chat filter function, return false to filter this packet, true to pass |
15 | + * the packet. | ||
15 | * | 16 | * |
16 | * @param chatPacket Chat packet to examine | 17 | * @param chatPacket Chat packet to examine |
17 | * @param message Chat message | 18 | * @param message Chat message |
src/main/java/com/mumfrey/liteloader/ServerCommandProvider.java
@@ -11,8 +11,9 @@ import net.minecraft.command.ServerCommandManager; | @@ -11,8 +11,9 @@ import net.minecraft.command.ServerCommandManager; | ||
11 | public interface ServerCommandProvider extends LiteMod | 11 | public interface ServerCommandProvider extends LiteMod |
12 | { | 12 | { |
13 | /** | 13 | /** |
14 | - * Allows the mod to provide commands to the server command manager my invoking commandManager.registerCommand() to | ||
15 | - * provide new commands for single player and lan worlds | 14 | + * Allows the mod to provide commands to the server command manager by |
15 | + * invoking commandManager.registerCommand() to provide new commands for | ||
16 | + * single player and lan worlds | ||
16 | * | 17 | * |
17 | * @param commandManager | 18 | * @param commandManager |
18 | */ | 19 | */ |
src/main/java/com/mumfrey/liteloader/ServerPlayerListener.java
@@ -5,15 +5,17 @@ import net.minecraft.entity.player.EntityPlayerMP; | @@ -5,15 +5,17 @@ import net.minecraft.entity.player.EntityPlayerMP; | ||
5 | import com.mojang.authlib.GameProfile; | 5 | import com.mojang.authlib.GameProfile; |
6 | 6 | ||
7 | /** | 7 | /** |
8 | - * Interface for mods which want to handle players joining and leaving a LAN game (or single player game) | 8 | + * Interface for mods which want to handle players joining and leaving a LAN |
9 | + * game (or single player game) | ||
9 | * | 10 | * |
10 | * @author Adam Mummery-Smith | 11 | * @author Adam Mummery-Smith |
11 | */ | 12 | */ |
12 | public interface ServerPlayerListener extends LiteMod | 13 | public interface ServerPlayerListener extends LiteMod |
13 | { | 14 | { |
14 | /** | 15 | /** |
15 | - * Called when a player connects to the server and the EntityPlayerMP instance is created, the player has not logged | ||
16 | - * in at this point and may be disconnected if login fails | 16 | + * Called when a player connects to the server and the EntityPlayerMP |
17 | + * instance is created, the player has not logged in at this point and may | ||
18 | + * be disconnected if login fails. | ||
17 | * | 19 | * |
18 | * @param player Player attempting to connect | 20 | * @param player Player attempting to connect |
19 | * @param profile Player's GameProfile from the authentication service | 21 | * @param profile Player's GameProfile from the authentication service |
@@ -21,19 +23,22 @@ public interface ServerPlayerListener extends LiteMod | @@ -21,19 +23,22 @@ public interface ServerPlayerListener extends LiteMod | ||
21 | public abstract void onPlayerConnect(EntityPlayerMP player, GameProfile profile); | 23 | public abstract void onPlayerConnect(EntityPlayerMP player, GameProfile profile); |
22 | 24 | ||
23 | /** | 25 | /** |
24 | - * Called once the player has successfully logged in and all player variables are initialised and replicated | 26 | + * Called once the player has successfully logged in and all player |
27 | + * variables are initialised and replicated. | ||
25 | * | 28 | * |
26 | * @param player Player connected | 29 | * @param player Player connected |
27 | */ | 30 | */ |
28 | public abstract void onPlayerLoggedIn(EntityPlayerMP player); | 31 | public abstract void onPlayerLoggedIn(EntityPlayerMP player); |
29 | 32 | ||
30 | /** | 33 | /** |
31 | - * Called when a player respawns. This event is raised when a player respawns after dying or conquers the end | 34 | + * Called when a player respawns. This event is raised when a player |
35 | + * respawns after dying or conquers the end. | ||
32 | * | 36 | * |
33 | * @param player New player instance | 37 | * @param player New player instance |
34 | * @param oldPlayer Old player instance being discarded | 38 | * @param oldPlayer Old player instance being discarded |
35 | * @param newDimension Dimension the player is respawning in | 39 | * @param newDimension Dimension the player is respawning in |
36 | - * @param playerWonTheGame True if the player conquered the end (this respawn is NOT as the result of a death) | 40 | + * @param playerWonTheGame True if the player conquered the end (this |
41 | + * respawn is NOT as the result of a death) | ||
37 | */ | 42 | */ |
38 | public abstract void onPlayerRespawn(EntityPlayerMP player, EntityPlayerMP oldPlayer, int newDimension, boolean playerWonTheGame); | 43 | public abstract void onPlayerRespawn(EntityPlayerMP player, EntityPlayerMP oldPlayer, int newDimension, boolean playerWonTheGame); |
39 | 44 |
src/main/java/com/mumfrey/liteloader/ServerPluginChannelListener.java
@@ -6,14 +6,16 @@ import net.minecraft.network.PacketBuffer; | @@ -6,14 +6,16 @@ import net.minecraft.network.PacketBuffer; | ||
6 | import com.mumfrey.liteloader.core.CommonPluginChannelListener; | 6 | import com.mumfrey.liteloader.core.CommonPluginChannelListener; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | - * Interface for mods which want to use plugin channels on the (integrated) server side | 9 | + * Interface for mods which want to use plugin channels on the (integrated) |
10 | + * server side. | ||
10 | * | 11 | * |
11 | * @author Adam Mummery-Smith | 12 | * @author Adam Mummery-Smith |
12 | */ | 13 | */ |
13 | public interface ServerPluginChannelListener extends CommonPluginChannelListener | 14 | public interface ServerPluginChannelListener extends CommonPluginChannelListener |
14 | { | 15 | { |
15 | /** | 16 | /** |
16 | - * Called when a custom payload packet arrives on a channel this mod has registered | 17 | + * Called when a custom payload packet arrives on a channel this mod has |
18 | + * registered. | ||
17 | * | 19 | * |
18 | * @param sender Player object which is the source of this message | 20 | * @param sender Player object which is the source of this message |
19 | * @param channel Channel on which the custom payload was received | 21 | * @param channel Channel on which the custom payload was received |
src/main/java/com/mumfrey/liteloader/ShutdownListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | /** | 3 | /** |
4 | - * Interface for mods that want to receive an event when the game is shutting down due to a user request. They do | ||
5 | - * not receive the callback when the VM is terminating for other reasons, use a regular VM shutdownhook for that. | 4 | + * Interface for mods that want to receive an event when the game is shutting |
5 | + * down due to a user request. They do not receive the callback when the VM is | ||
6 | + * terminating for other reasons, use a regular VM shutdownhook for that. | ||
6 | * | 7 | * |
7 | * @author Adam Mummery-Smith | 8 | * @author Adam Mummery-Smith |
8 | */ | 9 | */ |
src/main/java/com/mumfrey/liteloader/api/BrandingProvider.java
@@ -9,94 +9,108 @@ import com.mumfrey.liteloader.util.render.Icon; | @@ -9,94 +9,108 @@ import com.mumfrey.liteloader.util.render.Icon; | ||
9 | /** | 9 | /** |
10 | * LiteLoader Extensible API - Branding Provider | 10 | * LiteLoader Extensible API - Branding Provider |
11 | * | 11 | * |
12 | - * The Branding Provider manages loader branding alterations for a particular API. This is an optional | ||
13 | - * API component which allows an API to specify customisations and additions to the loader environment | ||
14 | - * in order to provide a more comfortable integration for the API. | 12 | + * <p>The Branding Provider manages loader branding alterations for a particular |
13 | + * API. This is an optional API component which allows an API to specify | ||
14 | + * customisations and additions to the loader environment in order to provide a | ||
15 | + * more comfortable integration for the API.</p> | ||
15 | * | 16 | * |
16 | - * Since some branding options simply stack (like the API copyright notices for example) all APIs will | ||
17 | - * be allowed to supply this information, however other options (like the main logo image) can only be | ||
18 | - * set by one API. To determine which API should be used to set this information, the getPriority() | ||
19 | - * method will be called and used to sort branding providers by priority, with highest priority winning. | 17 | + * <p>Since some branding options simply stack (like the API copyright notices |
18 | + * for example) all APIs will be allowed to supply this information, however | ||
19 | + * other options (like the main logo image) can only be set by one API. To | ||
20 | + * determine which API should be used to set this information, the getPriority() | ||
21 | + * method will be called and used to sort branding providers by priority, with | ||
22 | + * highest priority winning.</p> | ||
20 | * | 23 | * |
21 | - * All branding options may return a null/not set value, allowing a branding provider to only override | ||
22 | - * the branding features it wishes. Some options require a non-null value to be returned from a set of | ||
23 | - * methods in order to take effect. eg. the logo option requires non-null return values from BOTH the | ||
24 | - * getLogoResource() and getLogoCoords() methods. | 24 | + * <p>All branding options may return a null/not set value, allowing a branding |
25 | + * provider to only override the branding features it wishes. Some options | ||
26 | + * require a non-null value to be returned from a set of methods in order to | ||
27 | + * take effect. eg. the logo option requires non-null return values from BOTH | ||
28 | + * the getLogoResource() and getLogoCoords() methods.</p> | ||
25 | * | 29 | * |
26 | * @author Adam Mummery-Smith | 30 | * @author Adam Mummery-Smith |
27 | */ | 31 | */ |
28 | public interface BrandingProvider extends CustomisationProvider | 32 | public interface BrandingProvider extends CustomisationProvider |
29 | { | 33 | { |
30 | /** | 34 | /** |
31 | - * Get the priority of this provider, higher numbers take precedence. Some brandings can only be set | ||
32 | - * by one provider (eg. the main "about" logo) so the branding provider with the highest priority will | ||
33 | - * be the one which gets control of that feature. | 35 | + * Get the priority of this provider, higher numbers take precedence. Some |
36 | + * brandings can only be set by one provider (eg. the main "about" logo) so | ||
37 | + * the branding provider with the highest priority will be the one which | ||
38 | + * gets control of that feature. | ||
34 | */ | 39 | */ |
35 | public abstract int getPriority(); | 40 | public abstract int getPriority(); |
36 | 41 | ||
37 | /** | 42 | /** |
38 | - * Get the primary branding colour for this API, the branding provider should return 0 if it | ||
39 | - * does not wish to override the branding colour. The branding colour is used for the mod list | ||
40 | - * entries and hyper-links within the about GUI panels, the colour returned should be fully opaque. | 43 | + * Get the primary branding colour for this API, the branding provider |
44 | + * should return 0 if it does not wish to override the branding colour. The | ||
45 | + * branding colour is used for the mod list entries and hyper-links within | ||
46 | + * the about GUI panels, the colour returned should be fully opaque. | ||
41 | */ | 47 | */ |
42 | public abstract int getBrandingColour(); | 48 | public abstract int getBrandingColour(); |
43 | 49 | ||
44 | /** | 50 | /** |
45 | - * Get the resource to use for the main logo, the API with the highest priority gets to define the | ||
46 | - * logo, this method can return null if this API does not want to override the logo | 51 | + * Get the resource to use for the main logo, the API with the highest |
52 | + * priority gets to define the logo, this method can return null if this API | ||
53 | + * does not want to override the logo. | ||
47 | */ | 54 | */ |
48 | public abstract ResourceLocation getLogoResource(); | 55 | public abstract ResourceLocation getLogoResource(); |
49 | 56 | ||
50 | /** | 57 | /** |
51 | - * Gets the coordinates of the logo as an IIcon instance, only called if getLogoResource() returns | ||
52 | - * a non-null value and the logo will only be used if BOTH methods return a valid object. | 58 | + * Gets the coordinates of the logo as an IIcon instance, only called if |
59 | + * getLogoResource() returns a non-null value and the logo will only be used | ||
60 | + * if BOTH methods return a valid object. | ||
53 | */ | 61 | */ |
54 | public abstract Icon getLogoCoords(); | 62 | public abstract Icon getLogoCoords(); |
55 | 63 | ||
56 | /** | 64 | /** |
57 | - * Get the resource to use for the icon logo (the chicken in the default setup), the API with the | ||
58 | - * highest priority gets to define the icon logo, this method can return null if this API does not | ||
59 | - * want to override the icon | 65 | + * Get the resource to use for the icon logo (the chicken in the default |
66 | + * setup), the API with the highest priority gets to define the icon logo, | ||
67 | + * this method can return null if this API does not want to override the | ||
68 | + * icon. | ||
60 | */ | 69 | */ |
61 | public abstract ResourceLocation getIconResource(); | 70 | public abstract ResourceLocation getIconResource(); |
62 | 71 | ||
63 | /** | 72 | /** |
64 | - * Gets the coordinates of the icon logo as an IIcon instance, only called if getIconResource() | ||
65 | - * returns a non-null value and the icon will only be used if BOTH methods return a valid object. | 73 | + * Gets the coordinates of the icon logo as an IIcon instance, only called |
74 | + * if getIconResource() returns a non-null value and the icon will only be | ||
75 | + * used if BOTH methods return a valid object. | ||
66 | */ | 76 | */ |
67 | public abstract Icon getIconCoords(); | 77 | public abstract Icon getIconCoords(); |
68 | 78 | ||
69 | /** | 79 | /** |
70 | - * Get the display name for this API, used on the "about" screen, must not return null | 80 | + * Get the display name for this API, used on the "about" screen, must not |
81 | + * return null. | ||
71 | */ | 82 | */ |
72 | public abstract String getDisplayName(); | 83 | public abstract String getDisplayName(); |
73 | 84 | ||
74 | /** | 85 | /** |
75 | - * Get the copyright text for this API, used on the "about" screen, must not return null | 86 | + * Get the copyright text for this API, used on the "about" screen, must not |
87 | + * return null. | ||
76 | */ | 88 | */ |
77 | public abstract String getCopyrightText(); | 89 | public abstract String getCopyrightText(); |
78 | 90 | ||
79 | /** | 91 | /** |
80 | - * Get the main home page URL for this API, used on the "about" screen, must not return null | 92 | + * Get the main home page URL for this API, used on the "about" screen, must |
93 | + * not return null. | ||
81 | */ | 94 | */ |
82 | public abstract URI getHomepage(); | 95 | public abstract URI getHomepage(); |
83 | 96 | ||
84 | /** | 97 | /** |
85 | - * If you wish to display a clickable twitter icon next to the API information in the "about" panel | ||
86 | - * then you must return values from this method as well as getTwitterAvatarResource() and | 98 | + * If you wish to display a clickable twitter icon next to the API |
99 | + * information in the "about" panel then you must return values from this | ||
100 | + * method as well as getTwitterAvatarResource() and | ||
87 | * getTwitterAvatarCoords(). Return the twitter user name here. | 101 | * getTwitterAvatarCoords(). Return the twitter user name here. |
88 | */ | 102 | */ |
89 | public abstract String getTwitterUserName(); | 103 | public abstract String getTwitterUserName(); |
90 | 104 | ||
91 | /** | 105 | /** |
92 | - * If you wish to display a clickable twitter icon next to the API information, return the icon | ||
93 | - * resource here. | 106 | + * If you wish to display a clickable twitter icon next to the API |
107 | + * information, return the icon resource here. | ||
94 | */ | 108 | */ |
95 | public abstract ResourceLocation getTwitterAvatarResource(); | 109 | public abstract ResourceLocation getTwitterAvatarResource(); |
96 | 110 | ||
97 | /** | 111 | /** |
98 | - * If you wish to display a clickable twitter icon next to the API information, return the icon | ||
99 | - * coordinates here. | 112 | + * If you wish to display a clickable twitter icon next to the API |
113 | + * information, return the icon coordinates here. | ||
100 | */ | 114 | */ |
101 | public abstract Icon getTwitterAvatarCoords(); | 115 | public abstract Icon getTwitterAvatarCoords(); |
102 | } | 116 | } |
src/main/java/com/mumfrey/liteloader/api/ContainerRegistry.java
@@ -36,7 +36,8 @@ public interface ContainerRegistry | @@ -36,7 +36,8 @@ public interface ContainerRegistry | ||
36 | } | 36 | } |
37 | 37 | ||
38 | /** | 38 | /** |
39 | - * Register an enabled container, removes the container from the disabled containers list if present | 39 | + * Register an enabled container, removes the container from the disabled |
40 | + * containers list if present. | ||
40 | */ | 41 | */ |
41 | public abstract void registerEnabledContainer(LoadableMod<?> container); | 42 | public abstract void registerEnabledContainer(LoadableMod<?> container); |
42 | 43 |
src/main/java/com/mumfrey/liteloader/api/CoreProvider.java
@@ -9,10 +9,11 @@ import com.mumfrey.liteloader.core.LiteLoaderMods; | @@ -9,10 +9,11 @@ import com.mumfrey.liteloader.core.LiteLoaderMods; | ||
9 | /** | 9 | /** |
10 | * LiteLoader Extensible API - API Core Provider | 10 | * LiteLoader Extensible API - API Core Provider |
11 | * | 11 | * |
12 | - * Core Providers are objects whose lifecycle is equivalent to the run time of game and thus the entire | ||
13 | - * lifecycle of your API, they are instanced early in the loader startup process. CoreProviders can implement | ||
14 | - * any Observer interface as appropriate and are automatically considered when allocating Observers to | ||
15 | - * callback lists | 12 | + * Core Providers are objects whose lifecycle is equivalent to the run time of |
13 | + * game and thus the entire lifecycle of your API, they are instanced early in | ||
14 | + * the loader startup process. CoreProviders can implement any Observer | ||
15 | + * interface as appropriate and are automatically considered when allocating | ||
16 | + * Observers to callback lists. | ||
16 | * | 17 | * |
17 | * @author Adam Mummery-Smith | 18 | * @author Adam Mummery-Smith |
18 | */ | 19 | */ |
@@ -21,33 +22,39 @@ public interface CoreProvider extends TickObserver, WorldObserver, ShutdownObser | @@ -21,33 +22,39 @@ public interface CoreProvider extends TickObserver, WorldObserver, ShutdownObser | ||
21 | public abstract void onInit(); | 22 | public abstract void onInit(); |
22 | 23 | ||
23 | /** | 24 | /** |
24 | - * During the postInit phase, the mods which were discovered during preInit phase are initialised and the | ||
25 | - * interfaces are allocated. This callback is invoked at the very start of the postInit phase, before mods | ||
26 | - * are initialised but after the point at which it is safe to assume it's ok to access game classes. This | ||
27 | - * is the first point at which the Minecraft game instance should be referenced. Be aware that certain game | ||
28 | - * classes (such as the EntityRenderer) are NOT initialised at this point. | 25 | + * During the postInit phase, the mods which were discovered during preInit |
26 | + * phase are initialised and the interfaces are allocated. This callback is | ||
27 | + * invoked at the very start of the postInit phase, before mods are | ||
28 | + * initialised but after the point at which it is safe to assume it's ok to | ||
29 | + * access game classes. This is the first point at which the Minecraft game | ||
30 | + * instance should be referenced. Be aware that certain game classes (such | ||
31 | + * as the EntityRenderer) are NOT initialised at this point. | ||
29 | * | 32 | * |
30 | * @param engine | 33 | * @param engine |
31 | */ | 34 | */ |
32 | public abstract void onPostInit(GameEngine<?, ?> engine); | 35 | public abstract void onPostInit(GameEngine<?, ?> engine); |
33 | 36 | ||
34 | /** | 37 | /** |
35 | - * Once the mods are initialised and the interfaces have been allocated, this callback is invoked to allow | ||
36 | - * the CoreProvider to perform any tasks which should be performed in the postInit phase but after mods | ||
37 | - * have been initialised. | 38 | + * Once the mods are initialised and the interfaces have been allocated, |
39 | + * this callback is invoked to allow the CoreProvider to perform any tasks | ||
40 | + * which should be performed in the postInit phase but after mods have been | ||
41 | + * initialised. | ||
38 | * | 42 | * |
39 | * @param mods | 43 | * @param mods |
40 | */ | 44 | */ |
41 | public abstract void onPostInitComplete(LiteLoaderMods mods); | 45 | public abstract void onPostInitComplete(LiteLoaderMods mods); |
42 | 46 | ||
43 | /** | 47 | /** |
44 | - * Called once startup is complete and the game loop begins running. This callback is invoked immediately | ||
45 | - * prior to the first "tick" event and immediately AFTER the the "late init" phase for mods (InitCompleteListener) | 48 | + * Called once startup is complete and the game loop begins running. This |
49 | + * callback is invoked immediately prior to the first "tick" event and | ||
50 | + * immediately <b>after</b> the the "late init" phase for mods | ||
51 | + * (InitCompleteListener). | ||
46 | */ | 52 | */ |
47 | public abstract void onStartupComplete(); | 53 | public abstract void onStartupComplete(); |
48 | 54 | ||
49 | /** | 55 | /** |
50 | - * Called immediately on joining a single or multi-player world when the JoinGame packet is received. Only called on the client. | 56 | + * Called immediately on joining a single or multi-player world when the |
57 | + * JoinGame packet is received. Only called on the client. | ||
51 | * | 58 | * |
52 | * @param netHandler | 59 | * @param netHandler |
53 | * @param loginPacket | 60 | * @param loginPacket |
src/main/java/com/mumfrey/liteloader/api/CustomisationProvider.java
1 | package com.mumfrey.liteloader.api; | 1 | package com.mumfrey.liteloader.api; |
2 | 2 | ||
3 | /** | 3 | /** |
4 | - * Base interface for loader customisation providers, has to be here so that we don't load branding provider classes too soon | 4 | + * Base interface for loader customisation providers, has to be here so that we |
5 | + * don't load branding provider classes too soon. | ||
5 | * | 6 | * |
6 | * @author Adam Mummery-Smith | 7 | * @author Adam Mummery-Smith |
7 | */ | 8 | */ |
src/main/java/com/mumfrey/liteloader/api/EnumerationObserver.java
@@ -11,8 +11,9 @@ import com.mumfrey.liteloader.interfaces.TweakContainer; | @@ -11,8 +11,9 @@ import com.mumfrey.liteloader.interfaces.TweakContainer; | ||
11 | /** | 11 | /** |
12 | * LiteLoader Extensible API - Enumeration observer | 12 | * LiteLoader Extensible API - Enumeration observer |
13 | * | 13 | * |
14 | - * EnumerationObserver receive callbacks when mod containers are enumerated. Instances of this class MUST be returned from | ||
15 | - * getPreInitObservers in order to work | 14 | + * EnumerationObserver receive callbacks when mod containers are enumerated. |
15 | + * Instances of this class <b>must</b> be returned from getPreInitObservers in | ||
16 | + * order to work. | ||
16 | * | 17 | * |
17 | * @author Adam Mummery-Smith | 18 | * @author Adam Mummery-Smith |
18 | */ | 19 | */ |
@@ -27,7 +28,8 @@ public interface EnumerationObserver extends Observer | @@ -27,7 +28,8 @@ public interface EnumerationObserver extends Observer | ||
27 | public abstract void onRegisterEnabledContainer(LoaderEnumerator enumerator, LoadableMod<?> container); | 28 | public abstract void onRegisterEnabledContainer(LoaderEnumerator enumerator, LoadableMod<?> container); |
28 | 29 | ||
29 | /** | 30 | /** |
30 | - * Called upon registration for every discovered container which is currently disabled, either because | 31 | + * Called upon registration for every discovered container which is |
32 | + * currently disabled, either because | ||
31 | * | 33 | * |
32 | * @param enumerator | 34 | * @param enumerator |
33 | * @param container | 35 | * @param container |
@@ -36,7 +38,8 @@ public interface EnumerationObserver extends Observer | @@ -36,7 +38,8 @@ public interface EnumerationObserver extends Observer | ||
36 | public abstract void onRegisterDisabledContainer(LoaderEnumerator enumerator, LoadableMod<?> container, DisabledReason reason); | 38 | public abstract void onRegisterDisabledContainer(LoaderEnumerator enumerator, LoadableMod<?> container, DisabledReason reason); |
37 | 39 | ||
38 | /** | 40 | /** |
39 | - * Called AFTER registration of an ENABLED container (eg. onRegisterEnabledContainer will be called first) if that container also | 41 | + * Called AFTER registration of an ENABLED container (eg. |
42 | + * onRegisterEnabledContainer will be called first) if that container also | ||
40 | * contains tweaks. | 43 | * contains tweaks. |
41 | * | 44 | * |
42 | * @param enumerator | 45 | * @param enumerator |
@@ -45,10 +48,14 @@ public interface EnumerationObserver extends Observer | @@ -45,10 +48,14 @@ public interface EnumerationObserver extends Observer | ||
45 | public abstract void onRegisterTweakContainer(LoaderEnumerator enumerator, TweakContainer<File> container); | 48 | public abstract void onRegisterTweakContainer(LoaderEnumerator enumerator, TweakContainer<File> container); |
46 | 49 | ||
47 | /** | 50 | /** |
48 | - * Called when a mod container is added to the pending mods list. This does not mean that the specific mod will actually be instanced since | ||
49 | - * the mod can still be disabled via the exclusion list (this is to allow entire containers to be disabled or just individual mods) and so | ||
50 | - * if you wish to observe actual mod instantiation you should still provide a {@link ResourceObserver}. However this event expresses a | ||
51 | - * declaration by the enumerator of an intention to load the specified mod. | 51 | + * Called when a mod container is added to the pending mods list. This does |
52 | + * not mean that the specific mod will actually be instanced since the mod | ||
53 | + * can still be disabled via the exclusion list (this is to allow entire | ||
54 | + * containers to be disabled or just individual mods) and so if you wish to | ||
55 | + * observe actual mod instantiation you should still provide a | ||
56 | + * {@link com.mumfrey.liteloader.client.ResourceObserver}. However this | ||
57 | + * event expresses a declaration by the enumerator of an intention to load | ||
58 | + * the specified mod. | ||
52 | * | 59 | * |
53 | * @param enumerator | 60 | * @param enumerator |
54 | * @param mod | 61 | * @param mod |
src/main/java/com/mumfrey/liteloader/api/EnumeratorModule.java
@@ -7,10 +7,12 @@ import com.mumfrey.liteloader.launch.LoaderProperties; | @@ -7,10 +7,12 @@ import com.mumfrey.liteloader.launch.LoaderProperties; | ||
7 | import net.minecraft.launchwrapper.LaunchClassLoader; | 7 | import net.minecraft.launchwrapper.LaunchClassLoader; |
8 | 8 | ||
9 | /** | 9 | /** |
10 | - * LiteLoader Extensible API - Interface for objects which can enumerate mods in places | 10 | + * LiteLoader Extensible API - Interface for objects which can enumerate mods in |
11 | + * places. | ||
11 | * | 12 | * |
12 | - * EnumeratorModules plug into the LoaderEnumerator and are used to discover mod containers in various | ||
13 | - * locations, for example searching in a specific folder for particular files. | 13 | + * <p>EnumeratorModules plug into the LoaderEnumerator and are used to discover |
14 | + * mod containers in various locations, for example searching in a specific | ||
15 | + * folder for particular files.</p> | ||
14 | * | 16 | * |
15 | * @author Adam Mummery-Smith | 17 | * @author Adam Mummery-Smith |
16 | */ | 18 | */ |
@@ -29,11 +31,13 @@ public interface EnumeratorModule | @@ -29,11 +31,13 @@ public interface EnumeratorModule | ||
29 | public abstract void writeSettings(LoaderEnvironment environment, LoaderProperties properties); | 31 | public abstract void writeSettings(LoaderEnvironment environment, LoaderProperties properties); |
30 | 32 | ||
31 | /** | 33 | /** |
32 | - * Find loadable mods in this enumerator's domain, the enumerator module should call back against the enumerator | ||
33 | - * itself to register containers it discovers using the registerModContainer() and registerTweakContainer() | 34 | + * Find loadable mods in this enumerator's domain, the enumerator module |
35 | + * should call back against the enumerator itself to register containers it | ||
36 | + * discovers using the registerModContainer() and registerTweakContainer() | ||
34 | * callbacks. | 37 | * callbacks. |
35 | * | 38 | * |
36 | - * This method is called during loader PREINIT phase so **DO NOT USE ANY GAME CLASSES HERE**! | 39 | + * <p>This method is called during loader PREINIT phase so <b>do not use any |
40 | + * game classes here</b>!</p> | ||
37 | * | 41 | * |
38 | * @param enumerator | 42 | * @param enumerator |
39 | * @param profile | 43 | * @param profile |
@@ -41,9 +45,10 @@ public interface EnumeratorModule | @@ -41,9 +45,10 @@ public interface EnumeratorModule | ||
41 | public abstract void enumerate(ModularEnumerator enumerator, String profile); | 45 | public abstract void enumerate(ModularEnumerator enumerator, String profile); |
42 | 46 | ||
43 | /** | 47 | /** |
44 | - * The enumerator module should inject (as required) any discovered containers into the classpath | 48 | + * The enumerator module should inject (as required) any discovered |
49 | + * containers into the classpath. | ||
45 | * | 50 | * |
46 | - * This method is called during the loader INIT phase | 51 | + * <p>This method is called during the loader INIT phase.</p> |
47 | * | 52 | * |
48 | * @param enumerator | 53 | * @param enumerator |
49 | * @param classLoader | 54 | * @param classLoader |
@@ -51,10 +56,10 @@ public interface EnumeratorModule | @@ -51,10 +56,10 @@ public interface EnumeratorModule | ||
51 | public abstract void injectIntoClassLoader(ModularEnumerator enumerator, LaunchClassLoader classLoader); | 56 | public abstract void injectIntoClassLoader(ModularEnumerator enumerator, LaunchClassLoader classLoader); |
52 | 57 | ||
53 | /** | 58 | /** |
54 | - * The enumerator module should callback against the enumerator using the registerModsFrom() callback to | ||
55 | - * register mods from discovered containers | 59 | + * The enumerator module should callback against the enumerator using the |
60 | + * registerModsFrom() callback to register mods from discovered containers. | ||
56 | * | 61 | * |
57 | - * This method is called during the loader INIT phase | 62 | + * <p>This method is called during the loader INIT phase</p> |
58 | * | 63 | * |
59 | * @param enumerator | 64 | * @param enumerator |
60 | * @param classLoader | 65 | * @param classLoader |
src/main/java/com/mumfrey/liteloader/api/EnumeratorPlugin.java
@@ -7,7 +7,8 @@ import com.mumfrey.liteloader.launch.LoaderEnvironment; | @@ -7,7 +7,8 @@ import com.mumfrey.liteloader.launch.LoaderEnvironment; | ||
7 | import com.mumfrey.liteloader.launch.LoaderProperties; | 7 | import com.mumfrey.liteloader.launch.LoaderProperties; |
8 | 8 | ||
9 | /** | 9 | /** |
10 | - * LiteLoader Extensible API - Interface for objects which can interact with the enumeration process, not yet available to APIs | 10 | + * LiteLoader Extensible API - Interface for objects which can interact with the |
11 | + * enumeration process, not yet available to APIs. | ||
11 | * | 12 | * |
12 | * @author Adam Mummery-Smith | 13 | * @author Adam Mummery-Smith |
13 | */ | 14 | */ |
@@ -24,7 +25,7 @@ public interface EnumeratorPlugin | @@ -24,7 +25,7 @@ public interface EnumeratorPlugin | ||
24 | * @param container Container to inspect | 25 | * @param container Container to inspect |
25 | * @param classloader ClassLoader for this container | 26 | * @param classloader ClassLoader for this container |
26 | * @param validator Mod class validator | 27 | * @param validator Mod class validator |
27 | - * @return | 28 | + * @return list of classes in the container |
28 | */ | 29 | */ |
29 | public abstract <T> List<Class<? extends T>> getClasses(LoadableMod<?> container, ClassLoader classloader, ModClassValidator validator); | 30 | public abstract <T> List<Class<? extends T>> getClasses(LoadableMod<?> container, ClassLoader classloader, ModClassValidator validator); |
30 | 31 |
src/main/java/com/mumfrey/liteloader/api/InterfaceProvider.java
@@ -5,8 +5,8 @@ import com.mumfrey.liteloader.core.InterfaceRegistrationDelegate; | @@ -5,8 +5,8 @@ import com.mumfrey.liteloader.core.InterfaceRegistrationDelegate; | ||
5 | /** | 5 | /** |
6 | * LiteLoader Extensible API - Interface Provider | 6 | * LiteLoader Extensible API - Interface Provider |
7 | * | 7 | * |
8 | - * InterfaceProviders are able to advertise and provide Listener interfaces which can be implemented | ||
9 | - * by mods or other Listener-derived classes | 8 | + * InterfaceProviders are able to advertise and provide Listener interfaces |
9 | + * which can be implemented by mods or other Listener-derived classes. | ||
10 | * | 10 | * |
11 | * @author Adam Mummery-Smith | 11 | * @author Adam Mummery-Smith |
12 | */ | 12 | */ |
@@ -18,8 +18,8 @@ public interface InterfaceProvider | @@ -18,8 +18,8 @@ public interface InterfaceProvider | ||
18 | public abstract Class<? extends Listener> getListenerBaseType(); | 18 | public abstract Class<? extends Listener> getListenerBaseType(); |
19 | 19 | ||
20 | /** | 20 | /** |
21 | - * The provider should call back against the supplied delegate in order to advertise the interfaces | ||
22 | - * it provides. | 21 | + * The provider should call back against the supplied delegate in order to |
22 | + * advertise the interfaces it provides. | ||
23 | * | 23 | * |
24 | * @param delegate | 24 | * @param delegate |
25 | */ | 25 | */ |
src/main/java/com/mumfrey/liteloader/api/Listener.java
1 | package com.mumfrey.liteloader.api; | 1 | package com.mumfrey.liteloader.api; |
2 | 2 | ||
3 | /** | 3 | /** |
4 | - * LiteLoader Extensible API - Listener is the base interface for (counter-intuitively) consumable Listener interfaces, in | ||
5 | - * that derived interfaces are consumable (from the point of view of the providers) but actual implementors consume the events | ||
6 | - * thus advertised by implementing those interfaces, making them themselves the consumers. Okay so that's probably pretty | ||
7 | - * confusing but I can't think of any better terminology so it's staying :) | 4 | + * LiteLoader Extensible API - Listener is the base interface for |
5 | + * (counter-intuitively) consumable Listener interfaces, in that derived | ||
6 | + * interfaces are consumable (from the point of view of the providers) but | ||
7 | + * actual implementors consume the events thus advertised by implementing those | ||
8 | + * interfaces, making them themselves the consumers. Okay so that's probably | ||
9 | + * pretty confusing but I can't think of any better terminology so it's | ||
10 | + * staying :) | ||
8 | * | 11 | * |
9 | * @author Adam Mummery-Smith | 12 | * @author Adam Mummery-Smith |
10 | */ | 13 | */ |
src/main/java/com/mumfrey/liteloader/api/LiteAPI.java
@@ -8,18 +8,22 @@ import com.mumfrey.liteloader.launch.LoaderProperties; | @@ -8,18 +8,22 @@ import com.mumfrey.liteloader.launch.LoaderProperties; | ||
8 | /** | 8 | /** |
9 | * LiteLoader Extensible API - main Mod API | 9 | * LiteLoader Extensible API - main Mod API |
10 | * | 10 | * |
11 | - * Implementors of this class don't really do anything except provide instances of other classes which make up the API proper. | ||
12 | - * Where possible, instance things as LATE as possible (eg. do not instance your CoreProviders in the constructor or init()) because | ||
13 | - * it's possible to screw up the game startup if things get loaded out of order, in general it's best to instance things only at | ||
14 | - * the earliest point in time at which they are needed. | 11 | + * <p>Implementors of this class don't really do anything except provide |
12 | + * instances of other classes which make up the API proper. Where possible, | ||
13 | + * instance things as <em>late</em> as possible (eg. do not instance your | ||
14 | + * CoreProviders in the constructor or init()) because it's possible to screw up | ||
15 | + * the game startup if things get loaded out of order, in general it's best to | ||
16 | + * instance things only at the earliest point in time at which they are needed. | ||
17 | + * </p> | ||
15 | * | 18 | * |
16 | * @author Adam Mummery-Smith | 19 | * @author Adam Mummery-Smith |
17 | */ | 20 | */ |
18 | public interface LiteAPI | 21 | public interface LiteAPI |
19 | { | 22 | { |
20 | /** | 23 | /** |
21 | - * Initialise this API, the API should do as little processing as possible here, but should also cache | ||
22 | - * the supplied environment and properties instances for later use | 24 | + * Initialise this API, the API should do as little processing as possible |
25 | + * here, but should also cache the supplied environment and properties | ||
26 | + * instances for later use. | ||
23 | * | 27 | * |
24 | * @param environment | 28 | * @param environment |
25 | * @param properties | 29 | * @param properties |
@@ -27,7 +31,8 @@ public interface LiteAPI | @@ -27,7 +31,8 @@ public interface LiteAPI | ||
27 | public abstract void init(LoaderEnvironment environment, LoaderProperties properties); | 31 | public abstract void init(LoaderEnvironment environment, LoaderProperties properties); |
28 | 32 | ||
29 | /** | 33 | /** |
30 | - * Get the identifier for this API, the identifier is used to retrieve the API and match it against specified mod API dependencies | 34 | + * Get the identifier for this API, the identifier is used to retrieve the |
35 | + * API and match it against specified mod API dependencies. | ||
31 | */ | 36 | */ |
32 | public abstract String getIdentifier(); | 37 | public abstract String getIdentifier(); |
33 | 38 | ||
@@ -42,50 +47,63 @@ public interface LiteAPI | @@ -42,50 +47,63 @@ public interface LiteAPI | ||
42 | public abstract String getVersion(); | 47 | public abstract String getVersion(); |
43 | 48 | ||
44 | /** | 49 | /** |
45 | - * Get the revision number of this API. Unlike the version number, the revision number should only change when an incompatible | ||
46 | - * change is made to the APIs interfaces, it is also used when a mod specifies an API dependency using the api@revision syntax | 50 | + * Get the revision number of this API. Unlike the version number, the |
51 | + * revision number should only change when an incompatible change is made to | ||
52 | + * the APIs interfaces, it is also used when a mod specifies an API | ||
53 | + * dependency using the api@revision syntax. | ||
47 | */ | 54 | */ |
48 | public abstract int getRevision(); | 55 | public abstract int getRevision(); |
49 | 56 | ||
50 | /** | 57 | /** |
51 | - * Should return an array of required transformer names, these transformers will be injected UPSTREAM. Can return null. | 58 | + * Should return an array of required transformer names, these transformers |
59 | + * will be injected UPSTREAM. Can return null. | ||
52 | */ | 60 | */ |
53 | public abstract String[] getRequiredTransformers(); | 61 | public abstract String[] getRequiredTransformers(); |
54 | 62 | ||
55 | /** | 63 | /** |
56 | - * Should return an array of required transformer names, these transformers will be injected DOWNSTREAM. Can return null. | 64 | + * Should return an array of required transformer names, these transformers |
65 | + * will be injected DOWNSTREAM. Can return null. | ||
57 | */ | 66 | */ |
58 | public abstract String[] getRequiredDownstreamTransformers(); | 67 | public abstract String[] getRequiredDownstreamTransformers(); |
59 | 68 | ||
60 | /** | 69 | /** |
61 | - * Return a mod class prefix supported by this API, can return null if an API just wants to use "LiteMod" as a standard class name prefix | 70 | + * Return a mod class prefix supported by this API, can return null if an |
71 | + * API just wants to use "LiteMod" as a standard class name prefix | ||
62 | */ | 72 | */ |
63 | public abstract String getModClassPrefix(); | 73 | public abstract String getModClassPrefix(); |
64 | 74 | ||
65 | /** | 75 | /** |
66 | - * Should return a list of Enumerator modules to be injected, can return null if the API doesn't want to inject any additonal modules | 76 | + * Should return a list of Enumerator modules to be injected, can return |
77 | + * null if the API doesn't want to inject any additonal modules | ||
67 | */ | 78 | */ |
68 | public abstract List<EnumeratorModule> getEnumeratorModules(); | 79 | public abstract List<EnumeratorModule> getEnumeratorModules(); |
69 | 80 | ||
70 | /** | 81 | /** |
71 | - * Should return a list of CoreProviders for this API, can return null if the API doesn't have any CoreProviders, (almost) guaranteed to only be called once | 82 | + * Should return a list of CoreProviders for this API, can return null if |
83 | + * the API doesn't have any CoreProviders, (almost) guaranteed to only be | ||
84 | + * called once. | ||
72 | */ | 85 | */ |
73 | public abstract List<CoreProvider> getCoreProviders(); | 86 | public abstract List<CoreProvider> getCoreProviders(); |
74 | 87 | ||
75 | /** | 88 | /** |
76 | - * Should return a list of InterfaceProviders for this API, can return null if the API doesn't have any InterfaceProviders, (almost) guaranteed to only be called once | 89 | + * Should return a list of InterfaceProviders for this API, can return null |
90 | + * if the API doesn't have any InterfaceProviders, (almost) guaranteed to | ||
91 | + * only be called once | ||
77 | */ | 92 | */ |
78 | public abstract List<InterfaceProvider> getInterfaceProviders(); | 93 | public abstract List<InterfaceProvider> getInterfaceProviders(); |
79 | 94 | ||
80 | /** | 95 | /** |
81 | - * Should return a list of Observers which are safe to instantiate during pre-init, for example EnumerationObservers. Can return null if the API doesn't have any | ||
82 | - * Observers. | 96 | + * Should return a list of Observers which are safe to instantiate during |
97 | + * pre-init, for example EnumerationObservers. Can return null if the API | ||
98 | + * doesn't have any Observers. | ||
83 | */ | 99 | */ |
84 | public abstract List<Observer> getPreInitObservers(); | 100 | public abstract List<Observer> getPreInitObservers(); |
85 | 101 | ||
86 | /** | 102 | /** |
87 | - * Should return a list of Observers for this API, can return null if the API doesn't have any Observers, (almost) guaranteed to only be called once. This list may | ||
88 | - * include Observers returned by getPreInitObservers if the observers are still required. | 103 | + * Should return a list of Observers for this API, can return null if the |
104 | + * API doesn't have any Observers, (almost) guaranteed to only be called | ||
105 | + * once. This list may include Observers returned by getPreInitObservers if | ||
106 | + * the observers are still required. | ||
89 | */ | 107 | */ |
90 | public abstract List<Observer> getObservers(); | 108 | public abstract List<Observer> getObservers(); |
91 | 109 |
src/main/java/com/mumfrey/liteloader/api/ModClassValidator.java
1 | package com.mumfrey.liteloader.api; | 1 | package com.mumfrey.liteloader.api; |
2 | 2 | ||
3 | /** | 3 | /** |
4 | - * Interface for object which validates whether a supplied mod class can be loaded | 4 | + * Interface for object which validates whether a supplied mod class can be |
5 | + * loaded. | ||
5 | * | 6 | * |
6 | * @author Adam Mummery-Smith | 7 | * @author Adam Mummery-Smith |
7 | */ | 8 | */ |
src/main/java/com/mumfrey/liteloader/api/ModInfoDecorator.java
@@ -8,7 +8,8 @@ import com.mumfrey.liteloader.util.render.IconTextured; | @@ -8,7 +8,8 @@ import com.mumfrey.liteloader.util.render.IconTextured; | ||
8 | /** | 8 | /** |
9 | * LiteLoader Extensible API - Branding Provider | 9 | * LiteLoader Extensible API - Branding Provider |
10 | * | 10 | * |
11 | - * Decorator for ModInfo classes, to alter the appearance of ModInfo entries in the mod list | 11 | + * Decorator for ModInfo classes, to alter the appearance of ModInfo entries in |
12 | + * the mod list. | ||
12 | * | 13 | * |
13 | * @author Adam Mummery-Smith | 14 | * @author Adam Mummery-Smith |
14 | */ | 15 | */ |
@@ -23,10 +24,12 @@ public interface ModInfoDecorator extends CustomisationProvider | @@ -23,10 +24,12 @@ public interface ModInfoDecorator extends CustomisationProvider | ||
23 | public abstract void addIcons(ModInfo<?> mod, List<IconTextured> icons); | 24 | public abstract void addIcons(ModInfo<?> mod, List<IconTextured> icons); |
24 | 25 | ||
25 | /** | 26 | /** |
26 | - * Allows this decorator to modify the status text for the specified mod, return null if no modification required | 27 | + * Allows this decorator to modify the status text for the specified mod, |
28 | + * return null if no modification required. | ||
27 | * | 29 | * |
28 | * @param statusText | 30 | * @param statusText |
29 | - * @return new status text or NULL to indicate the text should remain default | 31 | + * @return new status text or NULL to indicate the text should remain |
32 | + * default | ||
30 | */ | 33 | */ |
31 | public abstract String modifyStatusText(ModInfo<?> mod, String statusText); | 34 | public abstract String modifyStatusText(ModInfo<?> mod, String statusText); |
32 | 35 | ||
@@ -45,5 +48,6 @@ public interface ModInfoDecorator extends CustomisationProvider | @@ -45,5 +48,6 @@ public interface ModInfoDecorator extends CustomisationProvider | ||
45 | * @param titleColour | 48 | * @param titleColour |
46 | * @param statusColour | 49 | * @param statusColour |
47 | */ | 50 | */ |
48 | - public abstract void onDrawListEntry(int mouseX, int mouseY, float partialTicks, int xPosition, int yPosition, int width, int height, boolean selected, ModInfo<?> mod, int gradientColour, int titleColour, int statusColour); | 51 | + public abstract void onDrawListEntry(int mouseX, int mouseY, float partialTicks, int xPosition, int yPosition, int width, int height, |
52 | + boolean selected, ModInfo<?> mod, int gradientColour, int titleColour, int statusColour); | ||
49 | } | 53 | } |
src/main/java/com/mumfrey/liteloader/api/ModLoadObserver.java
@@ -9,21 +9,22 @@ import com.mumfrey.liteloader.interfaces.LoadableMod; | @@ -9,21 +9,22 @@ import com.mumfrey.liteloader.interfaces.LoadableMod; | ||
9 | /** | 9 | /** |
10 | * LiteLoader Extensible API - Mod Load Observer | 10 | * LiteLoader Extensible API - Mod Load Observer |
11 | * | 11 | * |
12 | - * ModLoadObservers receive callbacks when mod loading events are occurring, prior to init and other | ||
13 | - * loader-managed processes | 12 | + * ModLoadObservers receive callbacks when mod loading events are occurring, |
13 | + * prior to init and other loader-managed processes. | ||
14 | * | 14 | * |
15 | * @author Adam Mummery-Smith | 15 | * @author Adam Mummery-Smith |
16 | */ | 16 | */ |
17 | public interface ModLoadObserver extends Observer | 17 | public interface ModLoadObserver extends Observer |
18 | { | 18 | { |
19 | /** | 19 | /** |
20 | - * Called immediately after a mod instance is created, throw an exception from this method in | ||
21 | - * order to prevent further initialisation | 20 | + * Called immediately after a mod instance is created, throw an exception |
21 | + * from this method in order to prevent further initialisation. | ||
22 | */ | 22 | */ |
23 | public abstract void onModLoaded(LiteMod mod); | 23 | public abstract void onModLoaded(LiteMod mod); |
24 | 24 | ||
25 | /** | 25 | /** |
26 | - * Called after a mod is instanced and has been successfully added to the active mods list | 26 | + * Called after a mod is instanced and has been successfully added to the |
27 | + * active mods list. | ||
27 | * | 28 | * |
28 | * @param handle Mod handle | 29 | * @param handle Mod handle |
29 | */ | 30 | */ |
src/main/java/com/mumfrey/liteloader/api/Observer.java
@@ -3,8 +3,10 @@ package com.mumfrey.liteloader.api; | @@ -3,8 +3,10 @@ package com.mumfrey.liteloader.api; | ||
3 | /** | 3 | /** |
4 | * LiteLoader Extensible API - Observer base interface | 4 | * LiteLoader Extensible API - Observer base interface |
5 | * | 5 | * |
6 | - * Observers are essentially "core listeners" which are objects which make up the core a of a particular API implementation | ||
7 | - * and sink events generated by the Loader or by other observable components. See the derived interfaces for more detail. | 6 | + * <p>Observers are essentially "core listeners" which are objects which make up |
7 | + * the core a of a particular API implementation and sink events generated by | ||
8 | + * the Loader or by other observable components. See the derived interfaces for | ||
9 | + * more detail.</p> | ||
8 | * | 10 | * |
9 | * @author Adam Mummery-Smith | 11 | * @author Adam Mummery-Smith |
10 | */ | 12 | */ |
src/main/java/com/mumfrey/liteloader/api/PostRenderObserver.java
@@ -3,7 +3,8 @@ package com.mumfrey.liteloader.api; | @@ -3,7 +3,8 @@ package com.mumfrey.liteloader.api; | ||
3 | /** | 3 | /** |
4 | * LiteLoader Extensible API - Post-render Observers | 4 | * LiteLoader Extensible API - Post-render Observers |
5 | * | 5 | * |
6 | - * PostRenderObservers receive the onPostRender event every frame, allowing "draw-on-top" behaviour for API components | 6 | + * <p>PostRenderObservers receive the onPostRender event every frame, allowing |
7 | + * "draw-on-top" behaviour for API components.</p> | ||
7 | * | 8 | * |
8 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
9 | */ | 10 | */ |
src/main/java/com/mumfrey/liteloader/api/ShutdownObserver.java
@@ -3,8 +3,9 @@ package com.mumfrey.liteloader.api; | @@ -3,8 +3,9 @@ package com.mumfrey.liteloader.api; | ||
3 | /** | 3 | /** |
4 | * LiteLoader Extensible API - ShutDownObserver | 4 | * LiteLoader Extensible API - ShutDownObserver |
5 | * | 5 | * |
6 | - * ShutDownObservers receive an event when the game is shutting down due to a user request. They do NOT receive the | ||
7 | - * callback when the VM is terminating, use a regular VM shutdownhook for that. | 6 | + * ShutDownObservers receive an event when the game is shutting down due to a |
7 | + * user request. They do NOT receive the callback when the VM is terminating, | ||
8 | + * use a regular VM shutdownhook for that. | ||
8 | * | 9 | * |
9 | * @author Adam Mummery-Smith | 10 | * @author Adam Mummery-Smith |
10 | */ | 11 | */ |
src/main/java/com/mumfrey/liteloader/api/TranslationProvider.java
@@ -8,12 +8,14 @@ package com.mumfrey.liteloader.api; | @@ -8,12 +8,14 @@ package com.mumfrey.liteloader.api; | ||
8 | public interface TranslationProvider extends CustomisationProvider | 8 | public interface TranslationProvider extends CustomisationProvider |
9 | { | 9 | { |
10 | /** | 10 | /** |
11 | - * Translate the supplied key or return NULL if the provider has no translation for the specified key | 11 | + * Translate the supplied key or return NULL if the provider has no |
12 | + * translation for the specified key | ||
12 | */ | 13 | */ |
13 | public abstract String translate(String key, Object... args); | 14 | public abstract String translate(String key, Object... args); |
14 | 15 | ||
15 | /** | 16 | /** |
16 | - * Translate the supplied key to the specified locale, or return NULL if the provider has no translation for this key | 17 | + * Translate the supplied key to the specified locale, or return NULL if the |
18 | + * provider has no translation for this key | ||
17 | */ | 19 | */ |
18 | public abstract String translate(String locale, String key, Object... args); | 20 | public abstract String translate(String locale, String key, Object... args); |
19 | } | 21 | } |
src/main/java/com/mumfrey/liteloader/api/WorldObserver.java
@@ -5,8 +5,8 @@ import net.minecraft.world.World; | @@ -5,8 +5,8 @@ import net.minecraft.world.World; | ||
5 | /** | 5 | /** |
6 | * LiteLoader Extensible API - WorldObserver | 6 | * LiteLoader Extensible API - WorldObserver |
7 | * | 7 | * |
8 | - * WorldObservers receive a callback when the Minecraft.theWorld reference changes, beware the value is allowed | ||
9 | - * to be null | 8 | + * <p>WorldObservers receive a callback when the Minecraft.theWorld reference |
9 | + * changes, beware the value is allowed to be null.</p> | ||
10 | * | 10 | * |
11 | * @author Adam Mummery-Smith | 11 | * @author Adam Mummery-Smith |
12 | */ | 12 | */ |
src/main/java/com/mumfrey/liteloader/api/manager/APIAdapter.java
@@ -8,7 +8,8 @@ import com.mumfrey.liteloader.api.Observer; | @@ -8,7 +8,8 @@ import com.mumfrey.liteloader.api.Observer; | ||
8 | import com.mumfrey.liteloader.interfaces.InterfaceRegistry; | 8 | import com.mumfrey.liteloader.interfaces.InterfaceRegistry; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | - * API Adapter provides convenience methods for invoking actions on ALL registered APIs | 11 | + * API Adapter provides convenience methods for invoking actions on ALL |
12 | + * registered APIs | ||
12 | * | 13 | * |
13 | * @author Adam Mummery-Smith | 14 | * @author Adam Mummery-Smith |
14 | */ | 15 | */ |
@@ -20,7 +21,8 @@ public interface APIAdapter | @@ -20,7 +21,8 @@ public interface APIAdapter | ||
20 | public abstract List<String> getRequiredTransformers(); | 21 | public abstract List<String> getRequiredTransformers(); |
21 | 22 | ||
22 | /** | 23 | /** |
23 | - * Aggregate and return required downstream transformers from all registered APIs | 24 | + * Aggregate and return required downstream transformers from all registered |
25 | + * APIs | ||
24 | */ | 26 | */ |
25 | public abstract List<String> getRequiredDownstreamTransformers(); | 27 | public abstract List<String> getRequiredDownstreamTransformers(); |
26 | 28 | ||
@@ -30,22 +32,27 @@ public interface APIAdapter | @@ -30,22 +32,27 @@ public interface APIAdapter | ||
30 | public abstract void registerInterfaces(InterfaceRegistry interfaceManager); | 32 | public abstract void registerInterfaces(InterfaceRegistry interfaceManager); |
31 | 33 | ||
32 | /** | 34 | /** |
33 | - * Get the CoreProviders for the specified API. Consuming classes should call this method instead of calling API::getCoreProviders() | ||
34 | - * directly since getCoreProviders() should only be invoked once and the resulting collection is cached by the API Adapter | 35 | + * Get the CoreProviders for the specified API. Consuming classes should |
36 | + * call this method instead of calling API::getCoreProviders() directly | ||
37 | + * since getCoreProviders() should only be invoked once and the resulting | ||
38 | + * collection is cached by the API Adapter | ||
35 | */ | 39 | */ |
36 | public abstract List<CoreProvider> getCoreProviders(); | 40 | public abstract List<CoreProvider> getCoreProviders(); |
37 | 41 | ||
38 | /** | 42 | /** |
39 | - * Get the observers for the specified API. Consuming classes should call this method instead of calling API::getObservers() directly | ||
40 | - * since getObservers() should only be invoked once and the resulting list is cached by the API Adapter | 43 | + * Get the observers for the specified API. Consuming classes should call |
44 | + * this method instead of calling API::getObservers() directly since | ||
45 | + * getObservers() should only be invoked once and the resulting list is | ||
46 | + * cached by the API Adapter | ||
41 | * | 47 | * |
42 | * @param api API to get observers for | 48 | * @param api API to get observers for |
43 | */ | 49 | */ |
44 | public abstract List<? extends Observer> getObservers(LiteAPI api); | 50 | public abstract List<? extends Observer> getObservers(LiteAPI api); |
45 | 51 | ||
46 | /** | 52 | /** |
47 | - * Get the observers for the specified API which implement the specified Observer interface. Always returns a valid list (even if | ||
48 | - * empty) and doesn't return null. | 53 | + * Get the observers for the specified API which implement the specified |
54 | + * Observer interface. Always returns a valid list (even if empty) and | ||
55 | + * doesn't return null. | ||
49 | * | 56 | * |
50 | * @param api API to get observers for | 57 | * @param api API to get observers for |
51 | * @param observerType type of observer to search for | 58 | * @param observerType type of observer to search for |
@@ -53,8 +60,9 @@ public interface APIAdapter | @@ -53,8 +60,9 @@ public interface APIAdapter | ||
53 | public abstract <T extends Observer> List<T> getObservers(LiteAPI api, Class<T> observerType); | 60 | public abstract <T extends Observer> List<T> getObservers(LiteAPI api, Class<T> observerType); |
54 | 61 | ||
55 | /** | 62 | /** |
56 | - * Get the observers for all registered APIs which implement the specified Observer interface. Always returns a valid list (even if | ||
57 | - * empty) and doesn't return null. Also includes core providers | 63 | + * Get the observers for all registered APIs which implement the specified |
64 | + * Observer interface. Always returns a valid list (even if empty) and | ||
65 | + * doesn't return null. Also includes core providers | ||
58 | * | 66 | * |
59 | * @param observerType type of observer to search for | 67 | * @param observerType type of observer to search for |
60 | */ | 68 | */ |
src/main/java/com/mumfrey/liteloader/api/manager/APIProvider.java
@@ -21,7 +21,8 @@ public interface APIProvider | @@ -21,7 +21,8 @@ public interface APIProvider | ||
21 | /** | 21 | /** |
22 | * Returns true if the specified API is available | 22 | * Returns true if the specified API is available |
23 | * | 23 | * |
24 | - * @param identifier API identifier (case sensitive) or API identifier-plus-minrevision in the form "identifier@minver" | 24 | + * @param identifier API identifier (case sensitive) or API |
25 | + * identifier-plus-minrevision in the form "identifier@minver" | ||
25 | */ | 26 | */ |
26 | public abstract boolean isAPIAvailable(String identifier); | 27 | public abstract boolean isAPIAvailable(String identifier); |
27 | 28 |
src/main/java/com/mumfrey/liteloader/api/manager/APIProviderBasic.java
@@ -56,7 +56,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -56,7 +56,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
56 | } | 56 | } |
57 | 57 | ||
58 | /* (non-Javadoc) | 58 | /* (non-Javadoc) |
59 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#getRequiredTransformers() | 59 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
60 | + * #getRequiredTransformers() | ||
60 | */ | 61 | */ |
61 | @Override | 62 | @Override |
62 | public List<String> getRequiredTransformers() | 63 | public List<String> getRequiredTransformers() |
@@ -76,7 +77,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -76,7 +77,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
76 | } | 77 | } |
77 | 78 | ||
78 | /* (non-Javadoc) | 79 | /* (non-Javadoc) |
79 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#getRequiredDownstreamTransformers() | 80 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
81 | + * #getRequiredDownstreamTransformers() | ||
80 | */ | 82 | */ |
81 | @Override | 83 | @Override |
82 | public List<String> getRequiredDownstreamTransformers() | 84 | public List<String> getRequiredDownstreamTransformers() |
@@ -96,7 +98,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -96,7 +98,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
96 | } | 98 | } |
97 | 99 | ||
98 | /* (non-Javadoc) | 100 | /* (non-Javadoc) |
99 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#getObservers(com.mumfrey.liteloader.api.LiteAPI) | 101 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
102 | + * #getObservers(com.mumfrey.liteloader.api.LiteAPI) | ||
100 | */ | 103 | */ |
101 | @Override | 104 | @Override |
102 | public List<? extends Observer> getObservers(LiteAPI api) | 105 | public List<? extends Observer> getObservers(LiteAPI api) |
@@ -152,7 +155,9 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -152,7 +155,9 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
152 | for (CoreProvider coreProvider : this.getCoreProviders()) | 155 | for (CoreProvider coreProvider : this.getCoreProviders()) |
153 | { | 156 | { |
154 | if (observerType.isAssignableFrom(coreProvider.getClass()) && !matchingObservers.contains(coreProvider)) | 157 | if (observerType.isAssignableFrom(coreProvider.getClass()) && !matchingObservers.contains(coreProvider)) |
158 | + { | ||
155 | matchingObservers.add((T)coreProvider); | 159 | matchingObservers.add((T)coreProvider); |
160 | + } | ||
156 | } | 161 | } |
157 | 162 | ||
158 | return matchingObservers; | 163 | return matchingObservers; |
@@ -178,7 +183,9 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -178,7 +183,9 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
178 | } | 183 | } |
179 | 184 | ||
180 | /* (non-Javadoc) | 185 | /* (non-Javadoc) |
181 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#registerInterfaceProviders(com.mumfrey.liteloader.core.InterfaceManager) | 186 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
187 | + * #registerInterfaceProviders( | ||
188 | + * com.mumfrey.liteloader.core.InterfaceManager) | ||
182 | */ | 189 | */ |
183 | @Override | 190 | @Override |
184 | public void registerInterfaces(InterfaceRegistry interfaceManager) | 191 | public void registerInterfaces(InterfaceRegistry interfaceManager) |
@@ -224,7 +231,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -224,7 +231,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
224 | } | 231 | } |
225 | 232 | ||
226 | /* (non-Javadoc) | 233 | /* (non-Javadoc) |
227 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#isAPIAvailable(java.lang.String) | 234 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
235 | + * #isAPIAvailable(java.lang.String) | ||
228 | */ | 236 | */ |
229 | @Override | 237 | @Override |
230 | public boolean isAPIAvailable(String identifier) | 238 | public boolean isAPIAvailable(String identifier) |
@@ -242,7 +250,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -242,7 +250,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
242 | } | 250 | } |
243 | 251 | ||
244 | /* (non-Javadoc) | 252 | /* (non-Javadoc) |
245 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#isAPIAvailable(java.lang.String, int) | 253 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
254 | + * #isAPIAvailable(java.lang.String, int) | ||
246 | */ | 255 | */ |
247 | @Override | 256 | @Override |
248 | public boolean isAPIAvailable(String identifier, int minRevision) | 257 | public boolean isAPIAvailable(String identifier, int minRevision) |
@@ -254,7 +263,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -254,7 +263,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
254 | } | 263 | } |
255 | 264 | ||
256 | /* (non-Javadoc) | 265 | /* (non-Javadoc) |
257 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#getAPI(java.lang.String) | 266 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
267 | + * #getAPI(java.lang.String) | ||
258 | */ | 268 | */ |
259 | @Override | 269 | @Override |
260 | public LiteAPI getAPI(String identifier) | 270 | public LiteAPI getAPI(String identifier) |
@@ -263,7 +273,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -263,7 +273,8 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
263 | } | 273 | } |
264 | 274 | ||
265 | /* (non-Javadoc) | 275 | /* (non-Javadoc) |
266 | - * @see com.mumfrey.liteloader.api.manager.APIProvider#getAPI(java.lang.Class) | 276 | + * @see com.mumfrey.liteloader.api.manager.APIProvider |
277 | + * #getAPI(java.lang.Class) | ||
267 | */ | 278 | */ |
268 | @SuppressWarnings("unchecked") | 279 | @SuppressWarnings("unchecked") |
269 | @Override | 280 | @Override |
@@ -274,7 +285,9 @@ class APIProviderBasic implements APIProvider, APIAdapter | @@ -274,7 +285,9 @@ class APIProviderBasic implements APIProvider, APIAdapter | ||
274 | for (LiteAPI api : this.apis) | 285 | for (LiteAPI api : this.apis) |
275 | { | 286 | { |
276 | if (apiClass.isAssignableFrom(api.getClass())) | 287 | if (apiClass.isAssignableFrom(api.getClass())) |
288 | + { | ||
277 | return (T)api; | 289 | return (T)api; |
290 | + } | ||
278 | } | 291 | } |
279 | } | 292 | } |
280 | catch (NullPointerException ex1) {} | 293 | catch (NullPointerException ex1) {} |
src/main/java/com/mumfrey/liteloader/api/manager/APIRegistry.java
@@ -17,8 +17,8 @@ import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | @@ -17,8 +17,8 @@ import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | ||
17 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger.Verbosity; | 17 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger.Verbosity; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | - * This is where we register API classes during early startup before baking the registered list into an | ||
21 | - * APIProvider instance | 20 | + * This is where we register API classes during early startup before baking the |
21 | + * registered list into an APIProvider instance | ||
22 | * | 22 | * |
23 | * @author Adam Mummery-Smith | 23 | * @author Adam Mummery-Smith |
24 | */ | 24 | */ |
@@ -44,7 +44,8 @@ public final class APIRegistry | @@ -44,7 +44,8 @@ public final class APIRegistry | ||
44 | } | 44 | } |
45 | 45 | ||
46 | /** | 46 | /** |
47 | - * Register an API class, throws an exception if the API list has already been baked | 47 | + * Register an API class, throws an exception if the API list has already |
48 | + * been baked. | ||
48 | * | 49 | * |
49 | * @param apiClass | 50 | * @param apiClass |
50 | */ | 51 | */ |
@@ -52,7 +53,8 @@ public final class APIRegistry | @@ -52,7 +53,8 @@ public final class APIRegistry | ||
52 | { | 53 | { |
53 | if (this.baked != null) | 54 | if (this.baked != null) |
54 | { | 55 | { |
55 | - throw new InvalidAPIStateException("Unable to register API provider '" + apiClass + "' because the API state is now frozen, this probably means you are registering an API too late in the initialisation process"); | 56 | + throw new InvalidAPIStateException("Unable to register API provider '" + apiClass |
57 | + + "' because the API state is now frozen, this probably means you are registering an API too late in the initialisation process"); | ||
56 | } | 58 | } |
57 | 59 | ||
58 | if (!this.registeredAPIClasses.contains(apiClass)) | 60 | if (!this.registeredAPIClasses.contains(apiClass)) |
@@ -93,7 +95,8 @@ public final class APIRegistry | @@ -93,7 +95,8 @@ public final class APIRegistry | ||
93 | } | 95 | } |
94 | 96 | ||
95 | Class<? extends LiteAPI> conflictingAPIClass = this.instances.get(identifier).getClass(); | 97 | Class<? extends LiteAPI> conflictingAPIClass = this.instances.get(identifier).getClass(); |
96 | - LiteLoaderLogger.severe("API identifier clash while registering '%s', identifier '%s' clashes with '%s'", apiClassName, identifier, conflictingAPIClass); | 98 | + LiteLoaderLogger.severe("API identifier clash while registering '%s', identifier '%s' clashes with '%s'", apiClassName, |
99 | + identifier, conflictingAPIClass); | ||
97 | } | 100 | } |
98 | catch (ClassNotFoundException ex) | 101 | catch (ClassNotFoundException ex) |
99 | { | 102 | { |
@@ -133,7 +136,9 @@ public final class APIRegistry | @@ -133,7 +136,9 @@ public final class APIRegistry | ||
133 | } | 136 | } |
134 | 137 | ||
135 | /** | 138 | /** |
136 | - * Bakes all currently registered API classes to a new APIProvider containing the API instances | 139 | + * Bakes all currently registered API classes to a new APIProvider |
140 | + * containing the API instances. | ||
141 | + * | ||
137 | * @throws InvalidAPIStateException if the API list was already baked | 142 | * @throws InvalidAPIStateException if the API list was already baked |
138 | */ | 143 | */ |
139 | public APIProvider bake() throws InvalidAPIStateException | 144 | public APIProvider bake() throws InvalidAPIStateException |
src/main/java/com/mumfrey/liteloader/common/GameEngine.java
@@ -9,8 +9,10 @@ import net.minecraft.server.MinecraftServer; | @@ -9,8 +9,10 @@ import net.minecraft.server.MinecraftServer; | ||
9 | /** | 9 | /** |
10 | * @author Adam Mummery-Smith | 10 | * @author Adam Mummery-Smith |
11 | * | 11 | * |
12 | - * @param <TClient> Type of the client runtime, "Minecraft" on client and null on the server | ||
13 | - * @param <TServer> Type of the server runtime, "IntegratedServer" on the client, "MinecraftServer" on the server | 12 | + * @param <TClient> Type of the client runtime, "Minecraft" on client and null |
13 | + * on the server | ||
14 | + * @param <TServer> Type of the server runtime, "IntegratedServer" on the | ||
15 | + * client, "MinecraftServer" on the server | ||
14 | */ | 16 | */ |
15 | public interface GameEngine<TClient, TServer extends MinecraftServer> | 17 | public interface GameEngine<TClient, TServer extends MinecraftServer> |
16 | { | 18 | { |
@@ -20,7 +22,8 @@ public interface GameEngine<TClient, TServer extends MinecraftServer> | @@ -20,7 +22,8 @@ public interface GameEngine<TClient, TServer extends MinecraftServer> | ||
20 | public abstract boolean isClient(); | 22 | public abstract boolean isClient(); |
21 | 23 | ||
22 | /** | 24 | /** |
23 | - * True if the current environment is a server environment, always true on dedicated and true in single player | 25 | + * True if the current environment is a server environment, always true on |
26 | + * dedicated and true in single player. | ||
24 | */ | 27 | */ |
25 | public abstract boolean isServer(); | 28 | public abstract boolean isServer(); |
26 | 29 | ||
@@ -60,12 +63,14 @@ public interface GameEngine<TClient, TServer extends MinecraftServer> | @@ -60,12 +63,14 @@ public interface GameEngine<TClient, TServer extends MinecraftServer> | ||
60 | public abstract Profiler getProfiler(); | 63 | public abstract Profiler getProfiler(); |
61 | 64 | ||
62 | /** | 65 | /** |
63 | - * Get the keybinding list, only supported on client will throw an exception on the server | 66 | + * Get the keybinding list, only supported on client will throw an exception |
67 | + * on the server. | ||
64 | */ | 68 | */ |
65 | public abstract List<KeyBinding> getKeyBindings(); | 69 | public abstract List<KeyBinding> getKeyBindings(); |
66 | 70 | ||
67 | /** | 71 | /** |
68 | - * Set the keybinding list, only supported on client will throw an exception on the server | 72 | + * Set the keybinding list, only supported on client will throw an exception |
73 | + * on the server. | ||
69 | * | 74 | * |
70 | * @param keyBindings | 75 | * @param keyBindings |
71 | */ | 76 | */ |
src/main/java/com/mumfrey/liteloader/common/LoadingProgress.java
@@ -29,7 +29,7 @@ public abstract class LoadingProgress | @@ -29,7 +29,7 @@ public abstract class LoadingProgress | ||
29 | 29 | ||
30 | public static void setMessage(String format, String... args) | 30 | public static void setMessage(String format, String... args) |
31 | { | 31 | { |
32 | - if (LoadingProgress.instance != null) LoadingProgress.instance._setMessage(String.format(format, args)); | 32 | + if (LoadingProgress.instance != null) LoadingProgress.instance._setMessage(String.format(format, (Object[])args)); |
33 | } | 33 | } |
34 | 34 | ||
35 | public static void setMessage(String message) | 35 | public static void setMessage(String message) |
@@ -39,7 +39,7 @@ public abstract class LoadingProgress | @@ -39,7 +39,7 @@ public abstract class LoadingProgress | ||
39 | 39 | ||
40 | public static void incLiteLoaderProgress(String format, String... args) | 40 | public static void incLiteLoaderProgress(String format, String... args) |
41 | { | 41 | { |
42 | - if (LoadingProgress.instance != null) LoadingProgress.instance._incLiteLoaderProgress(String.format(format, args)); | 42 | + if (LoadingProgress.instance != null) LoadingProgress.instance._incLiteLoaderProgress(String.format(format, (Object[])args)); |
43 | } | 43 | } |
44 | 44 | ||
45 | public static void incLiteLoaderProgress(String message) | 45 | public static void incLiteLoaderProgress(String message) |
src/main/java/com/mumfrey/liteloader/common/Resources.java
@@ -10,7 +10,9 @@ public interface Resources<TResourceManager, TResourcePack> | @@ -10,7 +10,9 @@ public interface Resources<TResourceManager, TResourcePack> | ||
10 | public abstract void refreshResources(boolean force); | 10 | public abstract void refreshResources(boolean force); |
11 | 11 | ||
12 | /** | 12 | /** |
13 | - * Get the resource manager for the current environment, returns the SimpleReloadableResourceManager on client and ModResourceManager on the server | 13 | + * Get the resource manager for the current environment, returns the |
14 | + * SimpleReloadableResourceManager on client and ModResourceManager on the | ||
15 | + * server. | ||
14 | */ | 16 | */ |
15 | public abstract TResourceManager getResourceManager(); | 17 | public abstract TResourceManager getResourceManager(); |
16 | 18 |