Commit 6e6559c6ad98a8ca39880f276b8198d8614b242a
1 parent
4dc2ac38
LiteLoader for 1.4.6
Showing
4 changed files
with
31 additions
and
174 deletions
java/com/mumfrey/liteloader/RenderListener.java
... | ... | @@ -14,7 +14,20 @@ public interface RenderListener extends LiteMod |
14 | 14 | */ |
15 | 15 | public abstract void onRender(); |
16 | 16 | |
17 | + /** | |
18 | + * Called immediately before the current GUI is rendered | |
19 | + * | |
20 | + * @param currentScreen Current screen (if any) | |
21 | + */ | |
17 | 22 | public abstract void onRenderGui(GuiScreen currentScreen); |
18 | 23 | |
24 | + /** | |
25 | + * Called when the world is rendered | |
26 | + */ | |
19 | 27 | public abstract void onRenderWorld(); |
28 | + | |
29 | + /** | |
30 | + * Called immediately after the world/camera transform is initialised | |
31 | + */ | |
32 | + public abstract void onSetupCameraTransform(); | |
20 | 33 | } | ... | ... |
java/com/mumfrey/liteloader/core/FilteringClassLoader.java deleted
100644 → 0
1 | -package com.mumfrey.liteloader.core; | |
2 | - | |
3 | -import java.io.IOException; | |
4 | -import java.io.InputStream; | |
5 | -import java.net.URL; | |
6 | -import java.net.URLClassLoader; | |
7 | -import java.util.Enumeration; | |
8 | - | |
9 | -import net.minecraft.client.Minecraft; | |
10 | - | |
11 | -public class FilteringClassLoader extends URLClassLoader | |
12 | -{ | |
13 | - public FilteringClassLoader() | |
14 | - { | |
15 | - super(new URL[0], Minecraft.class.getClassLoader()); | |
16 | - } | |
17 | - | |
18 | - /* (non-Javadoc) | |
19 | - * @see java.lang.ClassLoader#loadClass(java.lang.String) | |
20 | - */ | |
21 | - @Override | |
22 | - public Class<?> loadClass(String name) throws ClassNotFoundException | |
23 | - { | |
24 | - System.out.println("Parent is trying to load class " + name); | |
25 | - return super.loadClass(name); | |
26 | - } | |
27 | - | |
28 | - /* (non-Javadoc) | |
29 | - * @see java.lang.ClassLoader#findClass(java.lang.String) | |
30 | - */ | |
31 | - @Override | |
32 | - protected Class<?> findClass(String name) throws ClassNotFoundException | |
33 | - { | |
34 | - System.out.println("findClass " + name); | |
35 | - // TODO Auto-generated method stub | |
36 | - return super.findClass(name); | |
37 | - } | |
38 | - | |
39 | - /* (non-Javadoc) | |
40 | - * @see java.lang.ClassLoader#getResource(java.lang.String) | |
41 | - */ | |
42 | - @Override | |
43 | - public URL getResource(String name) | |
44 | - { | |
45 | - System.out.println("getResource " + name); | |
46 | - // TODO Auto-generated method stub | |
47 | - return super.getResource(name); | |
48 | - } | |
49 | - | |
50 | - /* (non-Javadoc) | |
51 | - * @see java.lang.ClassLoader#getResources(java.lang.String) | |
52 | - */ | |
53 | - @Override | |
54 | - public Enumeration<URL> getResources(String name) throws IOException | |
55 | - { | |
56 | - System.out.println("getResources " + name); | |
57 | - // TODO Auto-generated method stub | |
58 | - return super.getResources(name); | |
59 | - } | |
60 | - | |
61 | - /* (non-Javadoc) | |
62 | - * @see java.lang.ClassLoader#findResource(java.lang.String) | |
63 | - */ | |
64 | - @Override | |
65 | - public URL findResource(String name) | |
66 | - { | |
67 | - System.out.println("findResource " + name); | |
68 | - // TODO Auto-generated method stub | |
69 | - return super.findResource(name); | |
70 | - } | |
71 | - | |
72 | - /* (non-Javadoc) | |
73 | - * @see java.lang.ClassLoader#findResources(java.lang.String) | |
74 | - */ | |
75 | - @Override | |
76 | - public Enumeration<URL> findResources(String name) throws IOException | |
77 | - { | |
78 | - System.out.println("findResources " + name); | |
79 | - // TODO Auto-generated method stub | |
80 | - return super.findResources(name); | |
81 | - } | |
82 | - | |
83 | - /* (non-Javadoc) | |
84 | - * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String) | |
85 | - */ | |
86 | - @Override | |
87 | - public InputStream getResourceAsStream(String name) | |
88 | - { | |
89 | - System.out.println("getResourceAsStream " + name); | |
90 | - // TODO Auto-generated method stub | |
91 | - return super.getResourceAsStream(name); | |
92 | - } | |
93 | - | |
94 | - /* (non-Javadoc) | |
95 | - * @see java.lang.ClassLoader#getPackage(java.lang.String) | |
96 | - */ | |
97 | - @Override | |
98 | - protected Package getPackage(String name) | |
99 | - { | |
100 | - System.out.println("getPackage " + name); | |
101 | - // TODO Auto-generated method stub | |
102 | - return super.getPackage(name); | |
103 | - } | |
104 | - | |
105 | - /* (non-Javadoc) | |
106 | - * @see java.lang.ClassLoader#getPackages() | |
107 | - */ | |
108 | - @Override | |
109 | - protected Package[] getPackages() | |
110 | - { | |
111 | - System.out.println("getPackages"); | |
112 | - // TODO Auto-generated method stub | |
113 | - return super.getPackages(); | |
114 | - } | |
115 | - | |
116 | - /* (non-Javadoc) | |
117 | - * @see java.lang.ClassLoader#findLibrary(java.lang.String) | |
118 | - */ | |
119 | - @Override | |
120 | - protected String findLibrary(String libname) | |
121 | - { | |
122 | - System.out.println("findLibrary " + libname); | |
123 | - // TODO Auto-generated method stub | |
124 | - return super.findLibrary(libname); | |
125 | - } | |
126 | - | |
127 | - /* (non-Javadoc) | |
128 | - * @see java.lang.ClassLoader#setDefaultAssertionStatus(boolean) | |
129 | - */ | |
130 | - @Override | |
131 | - public synchronized void setDefaultAssertionStatus(boolean enabled) | |
132 | - { | |
133 | - System.out.println("setDefaultAssertionStatus " + enabled); | |
134 | - // TODO Auto-generated method stub | |
135 | - super.setDefaultAssertionStatus(enabled); | |
136 | - } | |
137 | - | |
138 | - /* (non-Javadoc) | |
139 | - * @see java.lang.ClassLoader#setPackageAssertionStatus(java.lang.String, boolean) | |
140 | - */ | |
141 | - @Override | |
142 | - public synchronized void setPackageAssertionStatus(String packageName, boolean enabled) | |
143 | - { | |
144 | - System.out.println("setPackageAssertionStatus " + packageName + " " + enabled); | |
145 | - // TODO Auto-generated method stub | |
146 | - super.setPackageAssertionStatus(packageName, enabled); | |
147 | - } | |
148 | - | |
149 | - /* (non-Javadoc) | |
150 | - * @see java.lang.ClassLoader#setClassAssertionStatus(java.lang.String, boolean) | |
151 | - */ | |
152 | - @Override | |
153 | - public synchronized void setClassAssertionStatus(String className, boolean enabled) | |
154 | - { | |
155 | - System.out.println("setClassAssertionStatus " + className + " " + enabled); | |
156 | - // TODO Auto-generated method stub | |
157 | - super.setClassAssertionStatus(className, enabled); | |
158 | - } | |
159 | - | |
160 | - /* (non-Javadoc) | |
161 | - * @see java.lang.ClassLoader#clearAssertionStatus() | |
162 | - */ | |
163 | - @Override | |
164 | - public synchronized void clearAssertionStatus() | |
165 | - { | |
166 | - System.out.println("clearAssertionStatus"); | |
167 | - // TODO Auto-generated method stub | |
168 | - super.clearAssertionStatus(); | |
169 | - } | |
170 | -} |
java/com/mumfrey/liteloader/core/HookProfiler.java
... | ... | @@ -139,7 +139,12 @@ public class HookProfiler extends Profiler |
139 | 139 | { |
140 | 140 | loader.onRender(); |
141 | 141 | } |
142 | - | |
142 | + | |
143 | + if ("frustrum".equalsIgnoreCase(sectionName) && "level".equalsIgnoreCase(sectionStack.getLast())) | |
144 | + { | |
145 | + loader.onSetupCameraTransform(); | |
146 | + } | |
147 | + | |
143 | 148 | if ("animateTick".equals(sectionName)) tick = true; |
144 | 149 | sectionStack.add(sectionName); |
145 | 150 | super.startSection(sectionName); | ... | ... |
java/com/mumfrey/liteloader/core/LiteLoader.java
... | ... | @@ -28,7 +28,7 @@ import net.minecraft.src.Timer; |
28 | 28 | * LiteLoader is a simple loader which provides tick events to loaded mods |
29 | 29 | * |
30 | 30 | * @author Adam Mummery-Smith |
31 | - * @version 1.4.5_02 | |
31 | + * @version 1.4.6 | |
32 | 32 | */ |
33 | 33 | @SuppressWarnings("rawtypes") |
34 | 34 | public final class LiteLoader implements FilenameFilter |
... | ... | @@ -36,7 +36,7 @@ public final class LiteLoader implements FilenameFilter |
36 | 36 | /** |
37 | 37 | * Liteloader version |
38 | 38 | */ |
39 | - private static final String LOADER_VERSION = "1.4.5_02"; | |
39 | + private static final String LOADER_VERSION = "1.4.6"; | |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Loader revision, can be used by mods to determine whether the loader is sufficiently up-to-date |
... | ... | @@ -48,7 +48,7 @@ public final class LiteLoader implements FilenameFilter |
48 | 48 | * against the version.txt value in mod files to prevent outdated mods being |
49 | 49 | * loaded!!! |
50 | 50 | */ |
51 | - private static final String[] SUPPORTED_VERSIONS = { "1.4.4", "1.4.5" }; | |
51 | + private static final String[] SUPPORTED_VERSIONS = { "1.4.6" }; | |
52 | 52 | |
53 | 53 | /** |
54 | 54 | * LiteLoader is a singleton, this is the singleton instance |
... | ... | @@ -995,6 +995,15 @@ public final class LiteLoader implements FilenameFilter |
995 | 995 | } |
996 | 996 | |
997 | 997 | /** |
998 | + * Called immediately after the world/camera transform is initialised | |
999 | + */ | |
1000 | + public void onSetupCameraTransform() | |
1001 | + { | |
1002 | + for (RenderListener renderListener : renderListeners) | |
1003 | + renderListener.onSetupCameraTransform(); | |
1004 | + } | |
1005 | + | |
1006 | + /** | |
998 | 1007 | * Callback from the tick hook, ticks all tickable mods |
999 | 1008 | * |
1000 | 1009 | * @param tick True if this is a new tick (otherwise it's just a new frame) | ... | ... |