22w38a Made better crash message for no webgl 2.0

This commit is contained in:
LAX1DUDE 2022-09-21 23:13:57 -07:00
parent 1ff73b29b0
commit 8356ae7763
17 changed files with 54220 additions and 53934 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>eaglercraft-sp</name>
<name>eaglercraft</name>
<comment>Project eaglercraft-unified created by Buildship.</comment>
<projects>
</projects>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

@ -1504,12 +1504,14 @@ public class Minecraft implements Runnable {
} else {
this.entityRenderer.startup = 0;
this.entityRenderer.preStartup = 0;
this.entityRenderer.asdfghjkl = false;
}
if(!this.gameSettings.adderall || !yeeState) {
if(!(this.gameSettings.adderall || entityRenderer.asdfghjkl) || !yeeState) {
this.entityRenderer.startup = 0;
this.entityRenderer.preStartup = 0;
this.gameSettings.adderall = false;
this.entityRenderer.asdfghjkl = false;
}
if(this.theWorld == null) {

View File

@ -1197,6 +1197,8 @@ public class EntityRenderer {
private int updateCounter = 0;
private int randomOffset = (int)(System.currentTimeMillis() % 100000l);
public boolean asdfghjkl = false;
private void addRainParticles() {
float var1 = this.mc.theWorld.getRainStrength(1.0F);
@ -1267,7 +1269,7 @@ public class EntityRenderer {
}
}
if(mc.gameSettings.adderall) {
if(mc.gameSettings.adderall || asdfghjkl) {
if(startup == 0) {
var3.ambientTickCountdown = random.nextInt(12000);
}
@ -1396,7 +1398,7 @@ public class EntityRenderer {
l = Block.blocksList[random.nextInt(256)];
}while(l == null || !(l.isOpaqueCube() || l.renderAsNormalBlock() || l.getRenderType() == 0 ||
l.getRenderType() == 27 || l.getRenderType() == 35 || l == Block.portal));
EntityFallingSand itm = new EntityFallingSand(var3, x + var4 + 0.5, yy + 1, z + var6 + 0.5, l.blockID, 0);
EntityFallingSand itm = new EntityFallingSand(var3, x + var4 + 0.5, yy + 0.5, z + var6 + 0.5, l.blockID, 0);
itm.entityId = --var3.ghostEntityId;
itm.ghost = true;
var3.spawnEntityInWorld(itm);
@ -1405,7 +1407,7 @@ public class EntityRenderer {
do {
l = Item.itemsList[random.nextInt(384)];
}while(l == null);
EntityItem itm = new EntityItem(var3, x + var4 + 0.5, yy + 1, z + var6 + 0.5, new ItemStack(l, 1));
EntityItem itm = new EntityItem(var3, x + var4 + 0.5, yy + 1.0, z + var6 + 0.5, new ItemStack(l, 1));
itm.entityId = --var3.ghostEntityId;
itm.ghost = true;
var3.spawnEntityInWorld(itm);

View File

@ -1162,9 +1162,29 @@ public class NetClientHandler extends NetHandler {
}
public void handleLevelSound(Packet62LevelSound par1Packet62LevelSound) {
this.mc.theWorld.playSound(par1Packet62LevelSound.getEffectX(), par1Packet62LevelSound.getEffectY(), par1Packet62LevelSound.getEffectZ(), par1Packet62LevelSound.getSoundName(), par1Packet62LevelSound.getVolume(),
String name = par1Packet62LevelSound.getSoundName();
if("~!EAG.adderall.start".equals(name)) {
if(mc.yeeState) {
mc.entityRenderer.asdfghjkl = true;
mc.entityRenderer.preStartup = 100000;
}
}else if("~!EAG.adderall.start_instant".equals(name)) {
if(mc.yeeState) {
mc.entityRenderer.asdfghjkl = true;
if(mc.entityRenderer.startup < 1700) {
mc.entityRenderer.preStartup = 100000;
mc.entityRenderer.startup = 1700;
}
}
}else if("~!EAG.adderall.stop".equals(name)) {
if(mc.yeeState) {
mc.entityRenderer.asdfghjkl = false;
}
}else {
this.mc.theWorld.playSound(par1Packet62LevelSound.getEffectX(), par1Packet62LevelSound.getEffectY(), par1Packet62LevelSound.getEffectZ(), name, par1Packet62LevelSound.getVolume(),
par1Packet62LevelSound.getPitch(), false);
}
}
public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) {
if ("MC|TrList".equals(par1Packet250CustomPayload.channel)) {

View File

@ -275,7 +275,7 @@ public class SoundManager {
}
if(this.options.soundVolume > 0.0F && par3 > 0.0F) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.gameSettings.adderall) {
if(mc.gameSettings.adderall || mc.entityRenderer.asdfghjkl) {
if(mc.entityRenderer.startup > 300) {
String rp = remapAdl.get(par1Str);
if(rp != null) {
@ -334,7 +334,7 @@ public class SoundManager {
public void playSound(String par1Str, float par2, float par3, float par4, float par5, float par6) {
if(this.options.soundVolume > 0.0F && par5 > 0.0F) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.gameSettings.adderall) {
if(mc.gameSettings.adderall || mc.entityRenderer.asdfghjkl) {
if(mc.entityRenderer.startup > 300) {
String rp = remapAdl.get(par1Str);
if(rp != null) {

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@ import org.teavm.jso.dom.html.HTMLCanvasElement;
import org.teavm.jso.typedarrays.Float32Array;
import org.teavm.jso.typedarrays.Uint8Array;
import net.lax1dude.eaglercraft.Client;
import net.lax1dude.eaglercraft.adapter.teavm.WebGL2RenderingContext;
import net.lax1dude.eaglercraft.adapter.teavm.WebGLVertexArray;
@ -23,8 +24,8 @@ public class DetectAnisotropicGlitch {
WebGL2RenderingContext ctx = (WebGL2RenderingContext) cvs.getContext("webgl2");
if(ctx == null) {
Window.alert("WebGL 2 is not supported in this browser! Eaglercraft cannot start.");
throw new UnsupportedOperationException("WebGL 2 is not supported in this browser!");
Client.showIncompatibleScreen("WebGL 2.0 is not supported on this device!");
throw new UnsupportedOperationException("WebGL 2 is not supported on this device!");
}
if(ctx.getExtension("EXT_texture_filter_anisotropic") != null) {

View File

@ -88,6 +88,7 @@ import org.teavm.jso.workers.Worker;
import net.lax1dude.eaglercraft.AssetRepository;
import net.lax1dude.eaglercraft.Base64;
import net.lax1dude.eaglercraft.Client;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.EaglerProfile;
@ -281,14 +282,21 @@ public class EaglerAdapterImpl2 {
canvasStyle.setProperty("image-rendering", "pixelated");
canvas.setWidth(sw);
canvas.setHeight(sh);
SelfDefence.init(canvas);
rootElement.appendChild(canvas);
try {
doc.exitPointerLock();
}catch(Throwable t) {
Client.showIncompatibleScreen("Mouse cursor lock is not available on this device!");
throw new RuntimeException("Mouse cursor lock is not available on this device!");
}
SelfDefence.init(canvas);
renderingCanvas = (HTMLCanvasElement)doc.createElement("canvas");
renderingCanvas.setWidth(sw);
renderingCanvas.setHeight(sh);
frameBuffer = (CanvasRenderingContext2D) canvas.getContext("2d");
webgl = (WebGL2RenderingContext) renderingCanvas.getContext("webgl2", youEagler());
if(webgl == null) {
Client.showIncompatibleScreen("WebGL 2.0 is not supported on this device!");
throw new RuntimeException("WebGL 2.0 is not supported in your browser ("+getNavString("userAgent")+")");
}
@ -483,6 +491,7 @@ public class EaglerAdapterImpl2 {
}
public static final void removeEventHandlers() {
try {
win.removeEventListener("contextmenu", contextmenu);
win.removeEventListener("mousedown", mousedown);
win.removeEventListener("mouseup", mouseup);
@ -491,6 +500,9 @@ public class EaglerAdapterImpl2 {
win.removeEventListener("keyup", keyup);
win.removeEventListener("keypress", keypress);
win.removeEventListener("wheel", wheel);
}catch(Throwable t) {
}
try {
String screenImg = canvas.toDataURL("image/png");
canvas.delete();
HTMLImageElement newImage = (HTMLImageElement) doc.createElement("img");
@ -498,6 +510,8 @@ public class EaglerAdapterImpl2 {
newImage.setWidth(parent.getClientWidth());
newImage.setHeight(parent.getClientHeight());
parent.appendChild(newImage);
}catch(Throwable t) {
}
}
private static LinkedList<MouseEvent> mouseEvents = new LinkedList();

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long