more various changes from my TODO list

This commit is contained in:
LAX1DUDE 2022-09-01 23:44:01 -07:00
parent 4ce8cb2118
commit 8e62c673b4
11 changed files with 62 additions and 25 deletions

1
.gitignore vendored
View file

@ -32,3 +32,4 @@ sp-relay/src/main/java/META-INF
zip-generator/out
zip-generator/src/main/java/META-INF
*.iml
crash_report_override.txt

View file

@ -2,7 +2,7 @@ eaglercraft is an AOT compiled port of mojang's minecraft 1.5.2 designed to run
§1this §1was §1created §1by §1calder §1young §1(lax1dude)§r
§4ingame §4voice §4chat §4service §4created §4by §4ayunami2000§r
§4project §4currently §4maintained §4by §4ayunami2000§r
compiling the javascript and emulating the JRE is largely made possible by the TeaVM project, created by Alexey Andreev and is available for free at §nhttp://teavm.org/§r under Apache License 2.0

View file

@ -1287,8 +1287,14 @@ public class EaglerAdapterImpl2 {
public static final void setMasterVolume(float v) {
ss.setMasterVolume(v);
}
public static final void setMusicVolume(float v) {
// used in browser
}
private static int playbackId = 0;
public static final int beginPlayback(String fileName, float x, float y, float z, float volume, float pitch) {
return beginPlayback(fileName, x, y, z, volume, pitch, false);
}
public static final int beginPlayback(String fileName, float x, float y, float z, float volume, float pitch, boolean ayunamiAddedThisBoolean) {
int id = ++playbackId;
URL loc = null;
if((loc = getResourceURL(fileName)) != null) {
@ -1308,6 +1314,9 @@ public class EaglerAdapterImpl2 {
return id;
}
public static final int beginPlaybackStatic(String fileName, float volume, float pitch) {
return beginPlaybackStatic(fileName, volume, pitch, false);
}
public static final int beginPlaybackStatic(String fileName, float volume, float pitch, boolean ayunamiAddedThisBoolean) {
int id = ++playbackId;
URL loc = null;
if((loc = getResourceURL(fileName)) != null) {
@ -1361,6 +1370,9 @@ public class EaglerAdapterImpl2 {
public static final boolean isPlaying(int id) {
return ss.playing("sound_"+id);
}
public static final void fireTitleMusicEvent(boolean b, float f) {
// used in browser
}
public static final void openConsole() {
EventQueue.invokeLater(new Runnable() {
@ -1968,4 +1980,8 @@ public class EaglerAdapterImpl2 {
return true;
}
public static final byte[] downloadURL(String url) {
return null;
}
}

View file

@ -6,7 +6,7 @@ public class ConfigConstants {
public static boolean profanity = false;
public static final String version = "22w35a";
public static final String version = "22w35b";
public static final String mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/lax1dude/eaglercraft";

View file

@ -145,6 +145,7 @@ public class EffectPipeline {
glDepthMask(false);
_wglDrawArrays(_wGL_TRIANGLES, 0, 6);
glColorMask(true, true, true, false);
glDepthMask(true);
_wglBindFramebuffer(_wGL_FRAMEBUFFER, null);
_wglViewport(0, 0, viewportW, viewportH);
}
@ -155,6 +156,9 @@ public class EffectPipeline {
private static long timer = 0l;
public static void drawNoise(int viewportW, int viewportH, float intensity) {
if(noiseProgram == null) {
return;
}
// three guesses to figure out what this does

View file

@ -1503,10 +1503,12 @@ public class Minecraft implements Runnable {
this.myNetworkManager.processReadPackets();
} else {
this.entityRenderer.startup = 0;
this.entityRenderer.preStartup = 0;
}
if(!this.gameSettings.adderall || !yeeState) {
this.entityRenderer.startup = 0;
this.entityRenderer.preStartup = 0;
this.gameSettings.adderall = false;
}

View file

@ -159,6 +159,7 @@ public class EntityRenderer {
public int debugViewDirection;
public int startup = 0;
public int preStartup = 0;
public EntityRenderer(Minecraft par1Minecraft) {
this.mc = par1Minecraft;
@ -1270,6 +1271,10 @@ public class EntityRenderer {
if(startup == 0) {
var3.ambientTickCountdown = random.nextInt(12000);
}
++preStartup;
if(preStartup < 300) {
return;
}
++startup;
int k = 60 - (startup / 5);
if(k < 10) k = 10;

View file

@ -331,18 +331,20 @@ public class GuiMainMenu extends GuiScreen {
EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE);
EaglerAdapter.glDepthMask(false);
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
byte var5 = 8;
byte var5 = ConfigConstants.panoramaBlur ? (byte)8 : (byte)1;
for (int var6 = 0; var6 < var5 * var5; ++var6) {
EaglerAdapter.glPushMatrix();
float var7 = ((float) (var6 % var5) / (float) var5 - 0.5F) / 64.0F;
float var8 = ((float) (var6 / var5) / (float) var5 - 0.5F) / 64.0F;
float var9 = 0.0F;
EaglerAdapter.glTranslatef(var7, var8, var9);
if (ConfigConstants.panoramaBlur) {
EaglerAdapter.glPushMatrix();
float var7 = ((float) (var6 % var5) / (float) var5 - 0.5F) / 64.0F;
float var8 = ((float) (var6 / var5) / (float) var5 - 0.5F) / 64.0F;
float var9 = 0.0F;
EaglerAdapter.glTranslatef(var7, var8, var9);
float panTimer = (float)(System.currentTimeMillis() - start) * 0.03f;
EaglerAdapter.glRotatef(MathHelper.sin(panTimer / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F);
EaglerAdapter.glRotatef(-(panTimer) * 0.1F, 0.0F, 1.0F, 0.0F);
float panTimer = (float)(System.currentTimeMillis() - start) * 0.03f;
EaglerAdapter.glRotatef(MathHelper.sin(panTimer / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F);
EaglerAdapter.glRotatef(-(panTimer) * 0.1F, 0.0F, 1.0F, 0.0F);
}
for (int var10 = 0; var10 < 6; ++var10) {
EaglerAdapter.glPushMatrix();
@ -383,7 +385,9 @@ public class GuiMainMenu extends GuiScreen {
EaglerAdapter.glPopMatrix();
}
EaglerAdapter.glPopMatrix();
if (ConfigConstants.panoramaBlur) {
EaglerAdapter.glPopMatrix();
}
EaglerAdapter.glColorMask(true, true, true, false);
}

View file

@ -44,18 +44,17 @@ public class StringTranslate {
}
private void loadLanguage(Properties par1Properties, String par2Str) throws IOException {
BufferedReader var3 = null;
String[] var3 = EaglerAdapter.fileContents("/lang/" + par2Str + ".lang").replace('\r', '\n')
.replaceAll("\n+", "\n").split("\n");
var3 = new BufferedReader(new InputStreamReader(EaglerAdapter.loadResource("/lang/" + par2Str + ".lang"), "UTF-8"));
for (String var4 = var3.readLine(); var4 != null; var4 = var3.readLine()) {
for (String var4 : var3) {
var4 = var4.trim();
if (!var4.startsWith("#")) {
String[] var5 = var4.split("=");
if (!var4.isEmpty() && !var4.startsWith("#")) {
int var5 = var4.indexOf('=');
if (var5 != null && var5.length == 2) {
par1Properties.setProperty(var5[0], var5[1]);
if (var5 != -1) {
par1Properties.setProperty(var4.substring(0, var5), var4.substring(var5 + 1));
}
}
}

View file

@ -25,7 +25,7 @@ public class ZipGenerator {
System.out.println();
try {
if(!net.lax1dude.eaglercraft.v1_8.buildtools.Java11Check.classLoadCheck()) {
if(!(boolean) Class.forName("net.lax1dude.eaglercraft.v1_8.buildtools.Java11Check").getMethod("classLoadCheck").invoke(null)) {
throw new RuntimeException("wtf?");
}
}catch(Throwable t) {
@ -48,6 +48,12 @@ public class ZipGenerator {
System.out.println("Loading 'javascript/classes.js'");
String classesJs = FileUtils.readFileToString(new File("javascript/classes.js"), "UTF-8").replaceFirst("\\/\\/# sourceMappingURL=.*(\\r\\n|\\r|\\n)*", "").trim();
File f = new File("crash_report_override.txt");
if(f.isFile()) {
classesJs = classesJs.replace("If this has happened more than once then please copy the text on this screen and publish"
+ " it in the issues feed of this fork\\'s GitHub repository.", FileUtils.readFileToString(f, "UTF-8").trim());
}
System.out.println("Loading 'javascript/classes_server.js'");
String classesServerJs = FileUtils.readFileToString(new File("javascript/classes_server.js"), "UTF-8").replaceFirst("\\/\\/# sourceMappingURL=.*(\\r\\n|\\r|\\n)*", "").trim();
@ -67,8 +73,8 @@ public class ZipGenerator {
FileUtils.writeStringToFile(new File("stable-download/Offline_Download_Version.html"), offlineTemplate, "UTF-8");
System.out.println("Copying 'javascript/classes.js' to 'stable-download/web/classes.js'");
FileUtils.copyFile(new File("javascript/classes.js"), new File("stable-download/web/classes.js"));
System.out.println("Writing 'javascript/classes.js' to 'stable-download/web/classes.js'");
FileUtils.writeStringToFile(new File("stable-download/web/classes.js"), classesJs, "UTF-8");
System.out.println("Copying 'javascript/classes.js.map' to 'stable-download/web/classes.js.map'");
FileUtils.copyFile(new File("javascript/classes.js.map"), new File("stable-download/web/classes.js.map"));

Binary file not shown.