Update #40 - FPS boost and fixed IndexOutOfBoundsException

This commit is contained in:
lax1dude 2024-10-19 16:52:27 -07:00
parent 85f4db5ac6
commit bcd575e87e
79 changed files with 1054 additions and 448 deletions

View File

@ -158,6 +158,7 @@ The default eaglercraftXOpts values is this:
- `demoMode:` whether to launch the game in java edition demo mode
- `servers:` a list of default servers to display on the Multiplayer screen
- `relays:` the default list of shared world relays to use for invites
- `checkGLErrors:` if the game should check for opengl errors
- `checkShaderGLErrors:` enables more verbose opengl error logging for the shaders
- `enableDownloadOfflineButton:` whether to show a "Download Offline" button on the title screen
- `downloadOfflineButtonLink:` overrides the download link for the "Download Offline" button

View File

@ -1 +1 @@
u39
u40

View File

@ -70,4 +70,6 @@
> DELETE 1 @ 1 : 2
> DELETE 1 @ 1 : 8
> EOF

View File

@ -18,7 +18,7 @@
> DELETE 1 @ 1 : 4
> CHANGE 1 : 74 @ 1 : 4
> CHANGE 1 : 73 @ 1 : 4
~
~ import net.lax1dude.eaglercraft.v1_8.ClientUUIDLoadingCache;
@ -34,7 +34,6 @@
~ import net.lax1dude.eaglercraft.v1_8.PointerInputAbstraction;
~ import net.lax1dude.eaglercraft.v1_8.Touch;
~ import net.lax1dude.eaglercraft.v1_8.cookie.ServerCookieDataStore;
~ import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
~
~ import org.apache.commons.lang3.Validate;
~
@ -158,7 +157,11 @@
~ public static final boolean isRunningOnMac = false;
> INSERT 10 : 11 @ 10
> CHANGE 5 : 6 @ 5 : 6
~ private boolean enableGLErrorChecking = false;
> INSERT 4 : 5 @ 4
+ public float displayDPI;
@ -174,7 +177,11 @@
> DELETE 1 @ 1 : 3
> CHANGE 10 : 11 @ 10 : 12
> CHANGE 8 : 9 @ 8 : 9
~ long field_181543_z = EagRuntime.nanoTime();
> CHANGE 1 : 2 @ 1 : 3
~ private EaglercraftNetworkManager myNetworkManager;
@ -225,8 +232,9 @@
+ this.displayDPI = 1.0f;
> CHANGE 4 : 9 @ 4 : 8
> CHANGE 4 : 10 @ 4 : 8
~ this.enableGLErrorChecking = EagRuntime.getConfiguration().isCheckGLErrors();
~ String serverToJoin = EagRuntime.getConfiguration().getServerToJoin();
~ if (serverToJoin != null) {
~ ServerAddress addr = AddressResolver.resolveAddressFromURI(serverToJoin);
@ -500,14 +508,14 @@
+ if (SingleplayerServerController.isWorldRunning()) {
+ SingleplayerServerController.shutdownEaglercraftServer();
+ while (SingleplayerServerController.getStatusState() == IntegratedServerState.WORLD_UNLOADING) {
+ EagUtils.sleep(50l);
+ EagUtils.sleep(50);
+ SingleplayerServerController.runTick();
+ }
+ }
+ if (SingleplayerServerController.isIntegratedServerWorkerAlive()
+ && SingleplayerServerController.canKillWorker()) {
+ SingleplayerServerController.killWorker();
+ EagUtils.sleep(50l);
+ EagUtils.sleep(50);
+ }
> CHANGE 1 : 2 @ 1 : 2
@ -520,8 +528,9 @@
> DELETE 3 @ 3 : 5
> CHANGE 4 : 5 @ 4 : 6
> CHANGE 3 : 5 @ 3 : 6
~ long i = EagRuntime.nanoTime();
~ if (Display.isCloseRequested()) {
> INSERT 3 : 6 @ 3
@ -536,31 +545,22 @@
~ Util.func_181617_a((FutureTask) this.scheduledTasks.remove(0), logger);
> DELETE 3 @ 3 : 4
> CHANGE 3 : 4 @ 3 : 6
~ long l = EagRuntime.nanoTime();
> INSERT 3 : 6 @ 3
+ if (j < this.timer.elapsedTicks - 1) {
+ PointerInputAbstraction.runGameLoop();
+ }
> CHANGE 2 : 3 @ 2 : 4
~ long i1 = EagRuntime.nanoTime() - l;
> DELETE 1 @ 1 : 2
> CHANGE 1 : 15 @ 1 : 2
~ if (this.timer.elapsedTicks > 1) {
~ long watchdog = EagRuntime.steadyTimeMillis();
~ for (int j = 0; j < this.timer.elapsedTicks; ++j) {
~ this.runTick();
~ if (j < this.timer.elapsedTicks - 1) {
~ PointerInputAbstraction.runGameLoop();
~ }
~ long millis = EagRuntime.steadyTimeMillis();
~ if (millis - watchdog > 50l) {
~ watchdog = millis;
~ EagRuntime.immediateContinue();
~ }
~ }
~ } else if (this.timer.elapsedTicks == 1) {
> DELETE 3 @ 3 : 4
> DELETE 2 @ 2 : 3
> DELETE 1 @ 1 : 11
> CHANGE 1 : 12 @ 1 : 7
@ -596,9 +596,11 @@
+
> DELETE 1 @ 1 : 3
> CHANGE 1 : 2 @ 1 : 4
> CHANGE 6 : 7 @ 6 : 7
~ long k = EagRuntime.nanoTime();
> CHANGE 5 : 6 @ 5 : 6
~ this.debug = HString.format("%d fps (%d chunk update%s) T: %s%s%s%s",
@ -609,23 +611,28 @@
> DELETE 3 @ 3 : 7
> DELETE 3 @ 3 : 4
> CHANGE 2 : 5 @ 2 : 7
> DELETE 1 @ 1 : 2
~ // if (this.isFramerateLimitBelowMax()) {
~ // Display.sync(this.getLimitFramerate());
~ // }
> CHANGE 2 : 3 @ 2 : 3
> CHANGE 1 : 2 @ 1 : 2
~ Mouse.tickCursorShape();
> CHANGE 3 : 8 @ 3 : 4
> CHANGE 3 : 13 @ 3 : 6
~ if (Display.isVSyncSupported()) {
~ Display.setVSync(this.gameSettings.enableVsync);
~ } else {
~ this.gameSettings.enableVsync = false;
~ }
> DELETE 1 @ 1 : 2
~ if (!this.gameSettings.enableVsync && this.isFramerateLimitBelowMax()) {
~ Display.update(this.getLimitFramerate());
~ } else {
~ Display.update(0);
~ }
> CHANGE 4 : 7 @ 4 : 5
@ -904,7 +911,7 @@
> INSERT 3 : 6 @ 3
+ if (k == 0x1D && (areKeysLocked() || isFullScreen())) {
+ if (k == 0x1D && (Keyboard.areKeysLocked() || isFullScreen())) {
+ KeyBinding.setKeyBindState(gameSettings.keyBindSprint.getKeyCode(), Keyboard.getEventKeyState());
+ }
@ -1387,17 +1394,13 @@
> DELETE 26 @ 26 : 34
> INSERT 7 : 48 @ 7
> INSERT 7 : 44 @ 7
+
+ public static int getGLMaximumTextureSize() {
+ return EaglercraftGPU.glGetInteger(GL_MAX_TEXTURE_SIZE);
+ }
+
+ public boolean areKeysLocked() {
+ return PlatformInput.lockKeys;
+ }
+
+ public ModelManager getModelManager() {
+ return modelManager;
+ }

View File

@ -62,7 +62,7 @@
> CHANGE 2 : 4 @ 2 : 11
~ protected void keyTyped(char parChar1, int parInt1) {
~ if (parInt1 == 1 && (this.mc.gameSettings.keyBindClose.getKeyCode() == 0 || this.mc.areKeysLocked())) {
~ if (parInt1 == 1 && (this.mc.gameSettings.keyBindClose.getKeyCode() == 0 || Keyboard.areKeysLocked())) {
> CHANGE 1 : 5 @ 1 : 10

View File

@ -21,7 +21,7 @@
~ import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
~ import net.lax1dude.eaglercraft.v1_8.update.GuiUpdateCheckerOverlay;
~ import net.lax1dude.eaglercraft.v1_8.voice.GuiVoiceMenu;
~ import net.lax1dude.eaglercraft.v1_8.webview.GuiScreenPhishingWaring;
~ import net.lax1dude.eaglercraft.v1_8.webview.GuiScreenPhishingWarning;
~ import net.lax1dude.eaglercraft.v1_8.webview.GuiScreenRecieveServerInfo;
~ import net.lax1dude.eaglercraft.v1_8.webview.GuiScreenServerInfo;
~ import net.minecraft.client.Minecraft;
@ -163,8 +163,8 @@
~ if (PauseMenuCustomizeState.serverInfoURL != null) {
~ GuiScreen screen = GuiScreenServerInfo.createForCurrentState(this,
~ PauseMenuCustomizeState.serverInfoURL);
~ if (!this.mc.gameSettings.hasHiddenPhishWarning && !GuiScreenPhishingWaring.hasShownMessage) {
~ screen = new GuiScreenPhishingWaring(screen);
~ if (!this.mc.gameSettings.hasHiddenPhishWarning && !GuiScreenPhishingWarning.hasShownMessage) {
~ screen = new GuiScreenPhishingWarning(screen);
~ }
~ this.mc.displayGuiScreen(screen);
~ }
@ -172,8 +172,8 @@
~ case PauseMenuCustomizeState.SERVER_INFO_MODE_SHOW_EMBED_OVER_WS:
~ if (PauseMenuCustomizeState.serverInfoHash != null) {
~ GuiScreen screen = new GuiScreenRecieveServerInfo(this, PauseMenuCustomizeState.serverInfoHash);
~ if (!this.mc.gameSettings.hasHiddenPhishWarning && !GuiScreenPhishingWaring.hasShownMessage) {
~ screen = new GuiScreenPhishingWaring(screen);
~ if (!this.mc.gameSettings.hasHiddenPhishWarning && !GuiScreenPhishingWarning.hasShownMessage) {
~ screen = new GuiScreenPhishingWarning(screen);
~ }
~ this.mc.displayGuiScreen(screen);
~ }

View File

@ -128,8 +128,8 @@
~ if (!canCloseGui())
~ return;
~ if (((this.mc.theWorld == null || this.mc.thePlayer.getHealth() <= 0.0F) && parInt1 == 1)
~ || parInt1 == this.mc.gameSettings.keyBindClose.getKeyCode()
~ || (parInt1 == 1 && (this.mc.gameSettings.keyBindClose.getKeyCode() == 0 || this.mc.areKeysLocked()))) {
~ || parInt1 == this.mc.gameSettings.keyBindClose.getKeyCode() || (parInt1 == 1
~ && (this.mc.gameSettings.keyBindClose.getKeyCode() == 0 || Keyboard.areKeysLocked()))) {
> INSERT 4 : 6 @ 4

View File

@ -74,8 +74,8 @@
~ protected void keyTyped(char parChar1, int parInt1) {
~ if (parInt1 == this.mc.gameSettings.keyBindClose.getKeyCode()
~ || parInt1 == this.mc.gameSettings.keyBindInventory.getKeyCode()
~ || (parInt1 == 1 && (this.mc.gameSettings.keyBindClose.getKeyCode() == 0 || this.mc.areKeysLocked()))) {
~ || parInt1 == this.mc.gameSettings.keyBindInventory.getKeyCode() || (parInt1 == 1
~ && (this.mc.gameSettings.keyBindClose.getKeyCode() == 0 || Keyboard.areKeysLocked()))) {
> CHANGE 1 : 3 @ 1 : 9

View File

@ -29,7 +29,7 @@
> CHANGE 13 : 16 @ 13 : 14
~ if (parInt1 == getCloseKey() || (parInt1 == 1 && this.mc.areKeysLocked())) {
~ if (parInt1 == getCloseKey() || (parInt1 == 1 && Keyboard.areKeysLocked())) {
~ mc.displayGuiScreen(null);
~ } else if (!this.checkHotbarKeys(parInt1)) {

View File

@ -13,7 +13,7 @@
> CHANGE 3 : 5 @ 3 : 100
~ public static void appMain(String[] astring) {
~ public static void appMain() {
~ System.setProperty("java.net.preferIPv6Addresses", "true");
> CHANGE 1 : 5 @ 1 : 12

View File

@ -244,15 +244,17 @@
> DELETE 2 @ 2 : 3
> DELETE 5 @ 5 : 18
> CHANGE 2 : 3 @ 2 : 3
> CHANGE 1 : 3 @ 1 : 3
~ long j = EagRuntime.nanoTime() - parLong1;
> CHANGE 1 : 18 @ 1 : 10
~ this.renderWorld(parFloat1, EagRuntime.nanoTime() + k);
~ this.renderEndNanoTime = EagRuntime.nanoTime();
~ final boolean b = !this.mc.gameSettings.hideGUI || this.mc.currentScreen != null;
~ if (b) {
> CHANGE 1 : 14 @ 1 : 2
~ GlStateManager.alphaFunc(516, 0.1F);
~ long framebufferAge = this.overlayFramebuffer.getAge();
~ if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
~ this.overlayFramebuffer.beginRender(mc.displayWidth, mc.displayHeight);
@ -265,9 +267,10 @@
~ }
~ GlStateManager.disableOverlayFramebufferBlending();
~ this.overlayFramebuffer.endRender();
~ }
> CHANGE 1 : 32 @ 1 : 3
> DELETE 1 @ 1 : 3
> CHANGE 1 : 31 @ 1 : 7
~ if (b) {
~ this.setupOverlayRendering();
@ -299,9 +302,14 @@
~ this.mc.ingameGUI.drawEaglerPlayerOverlay(l - 3,
~ 3 + this.mc.ingameGUI.overlayDebug.playerOffset, parFloat1);
~ }
~ }
> INSERT 10 : 12 @ 10
> DELETE 1 @ 1 : 3
> CHANGE 7 : 8 @ 7 : 8
~ this.renderEndNanoTime = EagRuntime.nanoTime();
> INSERT 2 : 4 @ 2
+ this.mc.notifRenderer.renderOverlay(j1, k1);
+

View File

@ -10,19 +10,235 @@
+
+ import java.util.Collection;
> DELETE 1 @ 1 : 3
> CHANGE 1 : 3 @ 1 : 3
~ import java.util.function.Supplier;
~
> CHANGE 101 : 102 @ 101 : 106
~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
> DELETE 111 @ 111 : 119
> CHANGE 4 : 5 @ 4 : 5
> CHANGE 28 : 29 @ 28 : 29
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C00Handshake.class, C00Handshake::new);
~ this.directionMaps.put(direction, (BiMap<Integer, Class<? extends Packet>>) object);
> CHANGE 4 : 158 @ 4 : 104
> CHANGE 36 : 39 @ 36 : 37
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketKeepAlive.class, S00PacketKeepAlive::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketJoinGame.class, S01PacketJoinGame::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S02PacketChat.class, S02PacketChat::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S03PacketTimeUpdate.class, S03PacketTimeUpdate::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S04PacketEntityEquipment.class,
~ S04PacketEntityEquipment::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S05PacketSpawnPosition.class,
~ S05PacketSpawnPosition::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S06PacketUpdateHealth.class,
~ S06PacketUpdateHealth::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S07PacketRespawn.class, S07PacketRespawn::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S08PacketPlayerPosLook.class,
~ S08PacketPlayerPosLook::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S09PacketHeldItemChange.class,
~ S09PacketHeldItemChange::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0APacketUseBed.class, S0APacketUseBed::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0BPacketAnimation.class, S0BPacketAnimation::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0CPacketSpawnPlayer.class, S0CPacketSpawnPlayer::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0DPacketCollectItem.class, S0DPacketCollectItem::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0EPacketSpawnObject.class, S0EPacketSpawnObject::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0FPacketSpawnMob.class, S0FPacketSpawnMob::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S10PacketSpawnPainting.class,
~ S10PacketSpawnPainting::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S11PacketSpawnExperienceOrb.class,
~ S11PacketSpawnExperienceOrb::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S12PacketEntityVelocity.class,
~ S12PacketEntityVelocity::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S13PacketDestroyEntities.class,
~ S13PacketDestroyEntities::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.class, S14PacketEntity::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S15PacketEntityRelMove.class,
~ S14PacketEntity.S15PacketEntityRelMove::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S16PacketEntityLook.class,
~ S14PacketEntity.S16PacketEntityLook::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S17PacketEntityLookMove.class,
~ S14PacketEntity.S17PacketEntityLookMove::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S18PacketEntityTeleport.class,
~ S18PacketEntityTeleport::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S19PacketEntityHeadLook.class,
~ S19PacketEntityHeadLook::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S19PacketEntityStatus.class,
~ S19PacketEntityStatus::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1BPacketEntityAttach.class,
~ S1BPacketEntityAttach::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1CPacketEntityMetadata.class,
~ S1CPacketEntityMetadata::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1DPacketEntityEffect.class,
~ S1DPacketEntityEffect::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1EPacketRemoveEntityEffect.class,
~ S1EPacketRemoveEntityEffect::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1FPacketSetExperience.class,
~ S1FPacketSetExperience::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S20PacketEntityProperties.class,
~ S20PacketEntityProperties::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S21PacketChunkData.class, S21PacketChunkData::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S22PacketMultiBlockChange.class,
~ S22PacketMultiBlockChange::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S23PacketBlockChange.class, S23PacketBlockChange::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S24PacketBlockAction.class, S24PacketBlockAction::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S25PacketBlockBreakAnim.class,
~ S25PacketBlockBreakAnim::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S26PacketMapChunkBulk.class,
~ S26PacketMapChunkBulk::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S27PacketExplosion.class, S27PacketExplosion::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S28PacketEffect.class, S28PacketEffect::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S29PacketSoundEffect.class, S29PacketSoundEffect::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2APacketParticles.class, S2APacketParticles::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2BPacketChangeGameState.class,
~ S2BPacketChangeGameState::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2CPacketSpawnGlobalEntity.class,
~ S2CPacketSpawnGlobalEntity::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2DPacketOpenWindow.class, S2DPacketOpenWindow::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2EPacketCloseWindow.class, S2EPacketCloseWindow::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2FPacketSetSlot.class, S2FPacketSetSlot::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S30PacketWindowItems.class, S30PacketWindowItems::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S31PacketWindowProperty.class,
~ S31PacketWindowProperty::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S32PacketConfirmTransaction.class,
~ S32PacketConfirmTransaction::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S33PacketUpdateSign.class, S33PacketUpdateSign::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S34PacketMaps.class, S34PacketMaps::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S35PacketUpdateTileEntity.class,
~ S35PacketUpdateTileEntity::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S36PacketSignEditorOpen.class,
~ S36PacketSignEditorOpen::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S37PacketStatistics.class, S37PacketStatistics::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S38PacketPlayerListItem.class,
~ S38PacketPlayerListItem::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S39PacketPlayerAbilities.class,
~ S39PacketPlayerAbilities::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3APacketTabComplete.class, S3APacketTabComplete::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3BPacketScoreboardObjective.class,
~ S3BPacketScoreboardObjective::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3CPacketUpdateScore.class, S3CPacketUpdateScore::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3DPacketDisplayScoreboard.class,
~ S3DPacketDisplayScoreboard::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3EPacketTeams.class, S3EPacketTeams::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3FPacketCustomPayload.class,
~ S3FPacketCustomPayload::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S40PacketDisconnect.class, S40PacketDisconnect::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S41PacketServerDifficulty.class,
~ S41PacketServerDifficulty::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S42PacketCombatEvent.class, S42PacketCombatEvent::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S43PacketCamera.class, S43PacketCamera::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S44PacketWorldBorder.class, S44PacketWorldBorder::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S45PacketTitle.class, S45PacketTitle::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S46PacketSetCompressionLevel.class,
~ S46PacketSetCompressionLevel::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S47PacketPlayerListHeaderFooter.class,
~ S47PacketPlayerListHeaderFooter::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S48PacketResourcePackSend.class,
~ S48PacketResourcePackSend::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S49PacketUpdateEntityNBT.class,
~ S49PacketUpdateEntityNBT::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketKeepAlive.class, C00PacketKeepAlive::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketChatMessage.class, C01PacketChatMessage::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C02PacketUseEntity.class, C02PacketUseEntity::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.class, C03PacketPlayer::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C04PacketPlayerPosition.class,
~ C03PacketPlayer.C04PacketPlayerPosition::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C05PacketPlayerLook.class,
~ C03PacketPlayer.C05PacketPlayerLook::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C06PacketPlayerPosLook.class,
~ C03PacketPlayer.C06PacketPlayerPosLook::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C07PacketPlayerDigging.class,
~ C07PacketPlayerDigging::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C08PacketPlayerBlockPlacement.class,
~ C08PacketPlayerBlockPlacement::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C09PacketHeldItemChange.class,
~ C09PacketHeldItemChange::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C0APacketAnimation.class, C0APacketAnimation::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C0BPacketEntityAction.class,
~ C0BPacketEntityAction::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C0CPacketInput.class, C0CPacketInput::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C0DPacketCloseWindow.class, C0DPacketCloseWindow::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C0EPacketClickWindow.class, C0EPacketClickWindow::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C0FPacketConfirmTransaction.class,
~ C0FPacketConfirmTransaction::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C10PacketCreativeInventoryAction.class,
~ C10PacketCreativeInventoryAction::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C11PacketEnchantItem.class, C11PacketEnchantItem::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C12PacketUpdateSign.class, C12PacketUpdateSign::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C13PacketPlayerAbilities.class,
~ C13PacketPlayerAbilities::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C14PacketTabComplete.class, C14PacketTabComplete::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C15PacketClientSettings.class,
~ C15PacketClientSettings::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C16PacketClientStatus.class,
~ C16PacketClientStatus::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C17PacketCustomPayload.class,
~ C17PacketCustomPayload::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C18PacketSpectate.class, C18PacketSpectate::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C19PacketResourcePackStatus.class,
~ C19PacketResourcePackStatus::new);
> DELETE 2 @ 2 : 10
> CHANGE 2 : 12 @ 2 : 8
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketDisconnect.class, S00PacketDisconnect::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketEncryptionRequest.class,
~ S01PacketEncryptionRequest::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S02PacketLoginSuccess.class,
~ S02PacketLoginSuccess::new);
~ this.registerPacket(EnumPacketDirection.CLIENTBOUND, S03PacketEnableCompression.class,
~ S03PacketEnableCompression::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketLoginStart.class, C00PacketLoginStart::new);
~ this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketEncryptionResponse.class,
~ C01PacketEncryptionResponse::new);
> INSERT 10 : 11 @ 10
+ private final Map<EnumPacketDirection, Map<Integer, Supplier<Packet<?>>>> directionCtors;
> INSERT 3 : 4 @ 3
+ this.directionCtors = Maps.newEnumMap(EnumPacketDirection.class);
> CHANGE 3 : 7 @ 3 : 5
~ protected EnumConnectionState registerPacket(EnumPacketDirection direction, Class<? extends Packet> packetClass,
~ Supplier<Packet<?>> packetCtor) {
~ BiMap<Integer, Class<? extends Packet>> object = this.directionMaps.get(direction);
~ Map<Integer, Supplier<Packet<?>>> object2;
> INSERT 2 : 3 @ 2
+ object2 = Maps.newHashMap();
> INSERT 1 : 4 @ 1
+ this.directionCtors.put(direction, object2);
+ } else {
+ object2 = this.directionCtors.get(direction);
> CHANGE 2 : 3 @ 2 : 3
~ if (object.containsValue(packetClass)) {
> CHANGE 1 : 2 @ 1 : 2
~ + object.inverse().get(packetClass);
> CHANGE 3 : 5 @ 3 : 4
~ object.put(Integer.valueOf(object.size()), packetClass);
~ object2.put(Integer.valueOf(object2.size()), packetCtor);
> CHANGE 10 : 12 @ 10 : 12
~ Supplier<Packet<?>> oclass = this.directionCtors.get(direction).get(Integer.valueOf(packetId));
~ return oclass == null ? null : oclass.get();
> CHANGE 15 : 18 @ 15 : 16
~ EnumConnectionState[] states = values();
~ for (int j = 0; j < states.length; ++j) {
@ -33,4 +249,6 @@
~ for (Class oclass : (Collection<Class>) ((BiMap) enumconnectionstate.directionMaps
~ .get(enumpacketdirection)).values()) {
> DELETE 5 @ 5 : 11
> EOF

View File

@ -20,10 +20,11 @@
> DELETE 2 @ 2 : 4
> CHANGE 1 : 7 @ 1 : 4
> CHANGE 1 : 8 @ 1 : 4
~
~ import net.lax1dude.eaglercraft.v1_8.EagRuntime;
~ import net.lax1dude.eaglercraft.v1_8.EagUtils;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
~ import net.lax1dude.eaglercraft.v1_8.futures.FutureTask;
@ -215,7 +216,11 @@
> DELETE 17 @ 17 : 21
> DELETE 45 @ 45 : 53
> CHANGE 29 : 30 @ 29 : 30
~ EagUtils.sleep(Math.max(1L, 50L - i));
> DELETE 15 @ 15 : 23
> DELETE 15 @ 15 : 40

View File

@ -5,6 +5,17 @@
# Version: 1.0
# Author: lax1dude
> DELETE 5 @ 5 : 8
> INSERT 2 : 4 @ 2
+ import java.util.function.Supplier;
+
> DELETE 3 @ 3 : 6
> CHANGE 76 : 79 @ 76 : 78
~ public Achievement func_150953_b(Class<? extends IJsonSerializable> parClass1,
~ Supplier<? extends IJsonSerializable> ctor) {
~ return (Achievement) super.func_150953_b(parClass1, ctor);
> EOF

View File

@ -53,7 +53,7 @@
~ public static Achievement exploreAllBiomes;
~ public static Achievement overpowered;
> INSERT 2 : 65 @ 2
> INSERT 2 : 66 @ 2
+ achievementList = Lists.newArrayList();
+ openInventory = (new Achievement("achievement.openInventory", "openInventory", 0, 0, Items.book,
@ -115,7 +115,8 @@
+ fullBeacon = (new Achievement("achievement.fullBeacon", "fullBeacon", 7, 8, Blocks.beacon, killWither))
+ .setSpecial().registerStat();
+ exploreAllBiomes = (new Achievement("achievement.exploreAllBiomes", "exploreAllBiomes", 4, 8,
+ Items.diamond_boots, theEnd)).func_150953_b(JsonSerializableSet.class).setSpecial().registerStat();
+ Items.diamond_boots, theEnd)).func_150953_b(JsonSerializableSet.class, JsonSerializableSet::new)
+ .setSpecial().registerStat();
+ overpowered = (new Achievement("achievement.overpowered", "overpowered", 6, 4,
+ new ItemStack(Items.golden_apple, 1, 1), buildBetterPickaxe)).setSpecial().registerStat();

View File

@ -5,10 +5,28 @@
# Version: 1.0
# Author: lax1dude
> INSERT 5 : 6 @ 5
> INSERT 5 : 7 @ 5
+ import java.util.function.Supplier;
+
> DELETE 2 @ 2 : 5
> INSERT 12 : 13 @ 12
+ private Supplier<? extends IJsonSerializable> field_150956_d_ctor;
> CHANGE 114 : 120 @ 114 : 115
~ public Supplier<? extends IJsonSerializable> func_150954_l_ctor() {
~ return this.field_150956_d_ctor;
~ }
~
~ public StatBase func_150953_b(Class<? extends IJsonSerializable> oclass,
~ Supplier<? extends IJsonSerializable> octor) {
> INSERT 1 : 2 @ 1
+ this.field_150956_d_ctor = octor;
> EOF

View File

@ -67,11 +67,12 @@
~ if (value != null && (value instanceof Integer)) {
~ tupleintjsonserializable.setIntegerValue(jsonobject1.getInt("value"));
> CHANGE 4 : 5 @ 4 : 5
> CHANGE 4 : 6 @ 4 : 7
~ Constructor constructor = statbase.func_150954_l().getConstructor();
~ IJsonSerializable ijsonserializable = (IJsonSerializable) statbase.func_150954_l_ctor()
~ .get();
> CHANGE 22 : 23 @ 22 : 23
> CHANGE 20 : 21 @ 20 : 21
~ JSONObject jsonobject = new JSONObject();

View File

@ -7,8 +7,9 @@
> DELETE 2 @ 2 : 3
> INSERT 2 : 8 @ 2
> INSERT 2 : 9 @ 2
+ import java.util.function.Supplier;
+
+ import com.google.common.collect.Maps;
+
@ -20,7 +21,27 @@
> DELETE 2 @ 2 : 4
> CHANGE 58 : 59 @ 58 : 59
> INSERT 4 : 5 @ 4
+ private static Map<String, Supplier<? extends TileEntity>> nameToCtorMap = Maps.newHashMap();
> CHANGE 7 : 8 @ 7 : 8
~ private static void addMapping(Class<? extends TileEntity> cl, Supplier<? extends TileEntity> ct, String id) {
> INSERT 4 : 5 @ 4
+ nameToCtorMap.put(id, ct);
> CHANGE 37 : 38 @ 37 : 38
~ Supplier<? extends TileEntity> oclass = nameToCtorMap.get(nbt.getString("id"));
> CHANGE 1 : 2 @ 1 : 2
~ tileentity = (TileEntity) oclass.get();
> CHANGE 2 : 3 @ 2 : 3
~ logger.error("Could not create TileEntity", exception);
@ -41,4 +62,28 @@
~ String s = HString.format("%4s", new Object[] { Integer.toBinaryString(i) }).replace(" ", "0");
~ return HString.format("%1$d / 0x%1$X / 0b%2$s", new Object[] { Integer.valueOf(i), s });
> CHANGE 15 : 36 @ 15 : 36
~ addMapping(TileEntityFurnace.class, TileEntityFurnace::new, "Furnace");
~ addMapping(TileEntityChest.class, TileEntityChest::new, "Chest");
~ addMapping(TileEntityEnderChest.class, TileEntityEnderChest::new, "EnderChest");
~ addMapping(BlockJukebox.TileEntityJukebox.class, BlockJukebox.TileEntityJukebox::new, "RecordPlayer");
~ addMapping(TileEntityDispenser.class, TileEntityDispenser::new, "Trap");
~ addMapping(TileEntityDropper.class, TileEntityDropper::new, "Dropper");
~ addMapping(TileEntitySign.class, TileEntitySign::new, "Sign");
~ addMapping(TileEntityMobSpawner.class, TileEntityMobSpawner::new, "MobSpawner");
~ addMapping(TileEntityNote.class, TileEntityNote::new, "Music");
~ addMapping(TileEntityPiston.class, TileEntityPiston::new, "Piston");
~ addMapping(TileEntityBrewingStand.class, TileEntityBrewingStand::new, "Cauldron");
~ addMapping(TileEntityEnchantmentTable.class, TileEntityEnchantmentTable::new, "EnchantTable");
~ addMapping(TileEntityEndPortal.class, TileEntityEndPortal::new, "Airportal");
~ addMapping(TileEntityCommandBlock.class, TileEntityCommandBlock::new, "Control");
~ addMapping(TileEntityBeacon.class, TileEntityBeacon::new, "Beacon");
~ addMapping(TileEntitySkull.class, TileEntitySkull::new, "Skull");
~ addMapping(TileEntityDaylightDetector.class, TileEntityDaylightDetector::new, "DLDetector");
~ addMapping(TileEntityHopper.class, TileEntityHopper::new, "Hopper");
~ addMapping(TileEntityComparator.class, TileEntityComparator::new, "Comparator");
~ addMapping(TileEntityFlowerPot.class, TileEntityFlowerPot::new, "FlowerPot");
~ addMapping(TileEntityBanner.class, TileEntityBanner::new, "Banner");
> EOF

View File

@ -11,7 +11,16 @@
> DELETE 18 @ 18 : 21
> CHANGE 25 : 26 @ 25 : 26
> CHANGE 3 : 9 @ 3 : 6
~ MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.DesertPyramid.class,
~ ComponentScatteredFeaturePieces.DesertPyramid::new, "TeDP");
~ MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.JunglePyramid.class,
~ ComponentScatteredFeaturePieces.JunglePyramid::new, "TeJP");
~ MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.SwampHut.class,
~ ComponentScatteredFeaturePieces.SwampHut::new, "TeSH");
> CHANGE 19 : 20 @ 19 : 20
~ public DesertPyramid(EaglercraftRandom parRandom, int parInt1, int parInt2) {

View File

@ -5,17 +5,74 @@
# Version: 1.0
# Author: lax1dude
> CHANGE 6 : 8 @ 6 : 22
> INSERT 4 : 6 @ 4
+ import java.util.function.Supplier;
+
> CHANGE 2 : 4 @ 2 : 18
~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
> CHANGE 36 : 37 @ 36 : 37
> INSERT 4 : 5 @ 4
+ private static Map<String, Supplier<? extends StructureStart>> startNameToSupplierMap = Maps.newHashMap();
> INSERT 2 : 3 @ 2
+ private static Map<String, Supplier<? extends StructureComponent>> componentNameToSupplierMap = Maps.newHashMap();
> CHANGE 2 : 4 @ 2 : 3
~ private static void registerStructure(Class<? extends StructureStart> startClass,
~ Supplier<? extends StructureStart> startSupplier, String structureName) {
> INSERT 1 : 2 @ 1
+ startNameToSupplierMap.put(structureName, startSupplier);
> CHANGE 3 : 5 @ 3 : 4
~ static void registerStructureComponent(Class<? extends StructureComponent> componentClass,
~ Supplier<? extends StructureComponent> startSupplier, String componentName) {
> INSERT 1 : 2 @ 1
+ componentNameToSupplierMap.put(componentName, startSupplier);
> CHANGE 15 : 16 @ 15 : 16
~ Supplier<? extends StructureStart> oclass = startNameToSupplierMap.get(tagCompound.getString("id"));
> CHANGE 1 : 2 @ 1 : 2
~ structurestart = oclass.get();
> CHANGE 3 : 4 @ 3 : 4
~ logger.warn(exception);
> CHANGE 21 : 22 @ 21 : 22
> CHANGE 15 : 16 @ 15 : 16
~ Supplier<? extends StructureComponent> oclass = componentNameToSupplierMap.get(tagCompound.getString("id"));
> CHANGE 1 : 2 @ 1 : 2
~ structurecomponent = oclass.get();
> CHANGE 3 : 4 @ 3 : 4
~ logger.warn(exception);
> CHANGE 12 : 19 @ 12 : 18
~ registerStructure(StructureMineshaftStart.class, StructureMineshaftStart::new, "Mineshaft");
~ registerStructure(MapGenVillage.Start.class, MapGenVillage.Start::new, "Village");
~ registerStructure(MapGenNetherBridge.Start.class, MapGenNetherBridge.Start::new, "Fortress");
~ registerStructure(MapGenStronghold.Start.class, MapGenStronghold.Start::new, "Stronghold");
~ registerStructure(MapGenScatteredFeature.Start.class, MapGenScatteredFeature.Start::new, "Temple");
~ registerStructure(StructureOceanMonument.StartMonument.class, StructureOceanMonument.StartMonument::new,
~ "Monument");
> EOF

View File

@ -11,7 +11,18 @@
> DELETE 15 @ 15 : 18
> CHANGE 24 : 26 @ 24 : 26
> CHANGE 18 : 26 @ 18 : 22
~ MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Corridor.class,
~ StructureMineshaftPieces.Corridor::new, "MSCorridor");
~ MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Cross.class,
~ StructureMineshaftPieces.Cross::new, "MSCrossing");
~ MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Room.class,
~ StructureMineshaftPieces.Room::new, "MSRoom");
~ MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Stairs.class,
~ StructureMineshaftPieces.Stairs::new, "MSStairs");
> CHANGE 2 : 4 @ 2 : 4
~ private static StructureComponent func_175892_a(List<StructureComponent> listIn, EaglercraftRandom rand, int x,
~ int y, int z, EnumFacing facing, int type) {

View File

@ -11,7 +11,40 @@
> DELETE 10 @ 10 : 13
> CHANGE 37 : 39 @ 37 : 39
> CHANGE 19 : 49 @ 19 : 34
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing3.class,
~ StructureNetherBridgePieces.Crossing3::new, "NeBCr");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.End.class,
~ StructureNetherBridgePieces.End::new, "NeBEF");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Straight.class,
~ StructureNetherBridgePieces.Straight::new, "NeBS");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor3.class,
~ StructureNetherBridgePieces.Corridor3::new, "NeCCS");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor4.class,
~ StructureNetherBridgePieces.Corridor4::new, "NeCTB");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Entrance.class,
~ StructureNetherBridgePieces.Entrance::new, "NeCE");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing2.class,
~ StructureNetherBridgePieces.Crossing2::new, "NeSCSC");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor.class,
~ StructureNetherBridgePieces.Corridor::new, "NeSCLT");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor5.class,
~ StructureNetherBridgePieces.Corridor5::new, "NeSC");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor2.class,
~ StructureNetherBridgePieces.Corridor2::new, "NeSCRT");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.NetherStalkRoom.class,
~ StructureNetherBridgePieces.NetherStalkRoom::new, "NeCSR");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Throne.class,
~ StructureNetherBridgePieces.Throne::new, "NeMT");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing.class,
~ StructureNetherBridgePieces.Crossing::new, "NeRC");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Stairs.class,
~ StructureNetherBridgePieces.Stairs::new, "NeSR");
~ MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Start.class,
~ StructureNetherBridgePieces.Start::new, "NeStart");
> CHANGE 3 : 5 @ 3 : 5
~ StructureNetherBridgePieces.PieceWeight parPieceWeight, List<StructureComponent> parList,
~ EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) {

View File

@ -15,7 +15,32 @@
> DELETE 10 @ 10 : 13
> CHANGE 21 : 22 @ 21 : 22
> CHANGE 3 : 25 @ 3 : 14
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.MonumentBuilding.class,
~ StructureOceanMonumentPieces.MonumentBuilding::new, "OMB");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.MonumentCoreRoom.class,
~ StructureOceanMonumentPieces.MonumentCoreRoom::new, "OMCR");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleXRoom.class,
~ StructureOceanMonumentPieces.DoubleXRoom::new, "OMDXR");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleXYRoom.class,
~ StructureOceanMonumentPieces.DoubleXYRoom::new, "OMDXYR");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleYRoom.class,
~ StructureOceanMonumentPieces.DoubleYRoom::new, "OMDYR");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleYZRoom.class,
~ StructureOceanMonumentPieces.DoubleYZRoom::new, "OMDYZR");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleZRoom.class,
~ StructureOceanMonumentPieces.DoubleZRoom::new, "OMDZR");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.EntryRoom.class,
~ StructureOceanMonumentPieces.EntryRoom::new, "OMEntry");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.Penthouse.class,
~ StructureOceanMonumentPieces.Penthouse::new, "OMPenthouse");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.SimpleRoom.class,
~ StructureOceanMonumentPieces.SimpleRoom::new, "OMSimple");
~ MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.SimpleTopRoom.class,
~ StructureOceanMonumentPieces.SimpleTopRoom::new, "OMSimpleT");
> CHANGE 7 : 8 @ 7 : 8
~ EaglercraftRandom parRandom) {

View File

@ -11,7 +11,36 @@
> DELETE 13 @ 13 : 16
> CHANGE 71 : 72 @ 71 : 72
> CHANGE 27 : 53 @ 27 : 40
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.ChestCorridor.class,
~ StructureStrongholdPieces.ChestCorridor::new, "SHCC");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Corridor.class,
~ StructureStrongholdPieces.Corridor::new, "SHFC");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Crossing.class,
~ StructureStrongholdPieces.Crossing::new, "SH5C");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.LeftTurn.class,
~ StructureStrongholdPieces.LeftTurn::new, "SHLT");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Library.class,
~ StructureStrongholdPieces.Library::new, "SHLi");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.PortalRoom.class,
~ StructureStrongholdPieces.PortalRoom::new, "SHPR");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Prison.class,
~ StructureStrongholdPieces.Prison::new, "SHPH");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RightTurn.class,
~ StructureStrongholdPieces.RightTurn::new, "SHRT");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RoomCrossing.class,
~ StructureStrongholdPieces.RoomCrossing::new, "SHRC");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs.class,
~ StructureStrongholdPieces.Stairs::new, "SHSD");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs2.class,
~ StructureStrongholdPieces.Stairs2::new, "SHStart");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Straight.class,
~ StructureStrongholdPieces.Straight::new, "SHS");
~ MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.StairsStraight.class,
~ StructureStrongholdPieces.StairsStraight::new, "SHSSD");
> CHANGE 31 : 32 @ 31 : 32
~ EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) {

View File

@ -11,7 +11,36 @@
> DELETE 20 @ 20 : 24
> CHANGE 18 : 20 @ 18 : 20
> CHANGE 3 : 29 @ 3 : 16
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House1.class,
~ StructureVillagePieces.House1::new, "ViBH");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Field1.class,
~ StructureVillagePieces.Field1::new, "ViDF");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Field2.class,
~ StructureVillagePieces.Field2::new, "ViF");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Torch.class,
~ StructureVillagePieces.Torch::new, "ViL");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Hall.class,
~ StructureVillagePieces.Hall::new, "ViPH");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House4Garden.class,
~ StructureVillagePieces.House4Garden::new, "ViSH");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.WoodHut.class,
~ StructureVillagePieces.WoodHut::new, "ViSmH");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Church.class,
~ StructureVillagePieces.Church::new, "ViST");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House2.class,
~ StructureVillagePieces.House2::new, "ViS");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Start.class,
~ StructureVillagePieces.Start::new, "ViStart");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Path.class,
~ StructureVillagePieces.Path::new, "ViSR");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House3.class,
~ StructureVillagePieces.House3::new, "ViTRH");
~ MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Well.class,
~ StructureVillagePieces.Well::new, "ViW");
> CHANGE 2 : 4 @ 2 : 4
~ public static List<StructureVillagePieces.PieceWeight> getStructureVillageWeightedPieceList(
~ EaglercraftRandom random, int parInt1) {

View File

@ -18,8 +18,9 @@
+ import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker;
+ import net.lax1dude.eaglercraft.v1_8.sp.server.WorldsDB;
> CHANGE 1 : 4 @ 1 : 8
> CHANGE 1 : 5 @ 1 : 8
~ import net.lax1dude.eaglercraft.v1_8.EagUtils;
~ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
@ -103,24 +104,19 @@
~ VFile2 file1 = WorldsDB.newVFile(this.savesDirectory, parString1);
~ logger.info("Deleting level " + parString1);
> CHANGE 1 : 6 @ 1 : 6
> CHANGE 1 : 5 @ 1 : 15
~ for (int i = 1; i <= 5; ++i) {
~ logger.info("Attempt " + i + "...");
~ if (deleteFiles(file1.listFiles(true), "singleplayer.busy.deleting")) {
~ return true;
~ }
> CHANGE 1 : 7 @ 1 : 8
> CHANGE 2 : 6 @ 2 : 3
~ logger.warn("Unsuccessful in deleting contents.");
~ if (i < 5) {
~ try {
~ Thread.sleep(500L);
~ } catch (InterruptedException var5) {
~ ;
> DELETE 2 @ 2 : 4
~ EagUtils.sleep(500);
~ }
> INSERT 1 : 3 @ 1

View File

@ -43,6 +43,7 @@ public class PlatformAudio {
protected final String sourceName;
protected long stall;
protected boolean paused = false;
protected PaulscodeAudioHandle(String sourceName) {
this.sourceName = sourceName;
@ -55,10 +56,12 @@ public class PlatformAudio {
if(sndSystem.playing(sourceName)) {
sndSystem.pause(sourceName);
}
paused = true;
}else {
if(!sndSystem.playing(sourceName)) {
sndSystem.play(sourceName);
}
paused = false;
}
}
@ -67,6 +70,7 @@ public class PlatformAudio {
this.stall = PlatformRuntime.steadyTimeMillis();
sndSystem.rewind(sourceName);
sndSystem.play(sourceName);
paused = false;
}
@Override
@ -87,13 +91,14 @@ public class PlatformAudio {
@Override
public void end() {
sndSystem.stop(sourceName);
paused = false;
}
@Override
public boolean shouldFree() {
return !sndSystem.playing(sourceName) && PlatformRuntime.steadyTimeMillis() - this.stall > 250l; //TODO: I hate this hack
return !paused && !sndSystem.playing(sourceName) && PlatformRuntime.steadyTimeMillis() - this.stall > 250l; //TODO: I hate this hack
}
}
public static IAudioResource loadAudioData(String filename, boolean holdInCache) {
@ -113,10 +118,6 @@ public class PlatformAudio {
}
public static interface IAudioCacheLoader {
byte[] loadFile(String filename);
}
public static IAudioResource loadAudioDataNew(String filename, boolean holdInCache, IAudioCacheLoader loader) {
throw new UnsupportedOperationException("Browser only!");
}

View File

@ -14,6 +14,8 @@ import org.lwjgl.glfw.GLFWGamepadState;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.system.MemoryStack;
import net.lax1dude.eaglercraft.v1_8.Display;
/**
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
@ -60,7 +62,6 @@ public class PlatformInput {
private static boolean enableRepeatEvents = false;
private static int functionKeyModifier = GLFW_KEY_F;
public static boolean lockKeys = false;
private static final List<Character> keyboardCharList = new LinkedList<>();
@ -298,12 +299,23 @@ public class PlatformInput {
}
public static void update() {
update(0);
}
private static final long[] syncTimer = new long[1];
public static void update(int limitFps) {
glfwPollEvents();
if(vsync != glfwVSyncState) {
glfwSwapInterval(vsync ? 1 : 0);
glfwVSyncState = vsync;
}
glfwSwapBuffers(win);
if(limitFps > 0 && !vsync) {
Display.sync(limitFps, syncTimer);
}else {
syncTimer[0] = 0l;
}
}
public static boolean isVSyncSupported() {
@ -415,6 +427,10 @@ public class PlatformInput {
enableRepeatEvents = b;
}
public static boolean keyboardAreKeysLocked() {
return false;
}
public static boolean mouseNext() {
if(mouseEventList.size() > 0) {
currentMouseEvent = mouseEventList.remove(0);

View File

@ -432,7 +432,7 @@ public class PlatformOpenGL {
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
public static final void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
int border, int format, int type, FloatBuffer data) {
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
@ -462,7 +462,7 @@ public class PlatformOpenGL {
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
public static final void _wglTexSubImage2Df32(int target, int level, int xoffset, int yoffset, int width, int height,
int format, int type, FloatBuffer data) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));

View File

@ -618,6 +618,13 @@ public class PlatformRuntime {
return System.nanoTime();
}
public static void sleep(int millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
}
}
public static void postCreate() {
}

View File

@ -78,9 +78,14 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
return relays;
}
@Override
public boolean isCheckGLErrors() {
return false;
}
@Override
public boolean isCheckShaderGLErrors() {
return true;
return false;
}
@Override

View File

@ -54,7 +54,7 @@ public class LWJGLEntryPoint {
lr.setVisible(true);
while(lr.isVisible()) {
EagUtils.sleep(100l);
EagUtils.sleep(100);
}
lr.dispose();
@ -71,7 +71,7 @@ public class LWJGLEntryPoint {
EagRuntime.create();
Main.appMain(new String[0]);
Main.appMain();
}

View File

@ -20,6 +20,8 @@ import java.lang.ref.WeakReference;
import com.google.common.annotations.GwtCompatible;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
/**
* Methods factored out so that they can be emulated differently in GWT.
*
@ -32,7 +34,7 @@ final class Platform {
/** Calls {@link System#nanoTime()}. */
static long systemNanoTime() {
return System.nanoTime();
return EagRuntime.nanoTime();
}
static CharMatcher precomputeCharMatcher(CharMatcher matcher) {

View File

@ -75,18 +75,43 @@ public class Display {
PlatformInput.update();
}
public static void update(int limitFramerate) {
PlatformInput.update(limitFramerate);
}
private static final long[] defaultSyncPtr = new long[1];
public static void sync(int limitFramerate) {
sync(limitFramerate, defaultSyncPtr);
}
public static boolean sync(int limitFramerate, long[] timerPtr) {
boolean limitFPS = limitFramerate > 0 && limitFramerate < 1000;
boolean blocked = false;
if(limitFPS) {
long millis = EagRuntime.steadyTimeMillis();
long frameMillis = (1000l / limitFramerate) - (millis - lastSwap);
if(frameMillis > 0l) {
EagUtils.sleep(frameMillis);
if(timerPtr[0] == 0l) {
timerPtr[0] = EagRuntime.steadyTimeMillis();
}else {
long millis = EagRuntime.steadyTimeMillis();
long frameMillis = (1000l / limitFramerate);
long frameTime = millis - timerPtr[0];
if(frameTime > 2000l || frameTime < 0l) {
frameTime = frameMillis;
timerPtr[0] = millis;
}else {
timerPtr[0] += frameMillis;
}
if(frameTime >= 0l && frameTime < frameMillis) {
EagUtils.sleep(frameMillis - frameTime);
blocked = true;
}
}
}else {
timerPtr[0] = 0l;
}
lastSwap = EagRuntime.steadyTimeMillis();
return blocked;
}
public static boolean contextLost() {

View File

@ -5,6 +5,8 @@ import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
/**
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
@ -57,11 +59,14 @@ public class EagUtils {
return str.length() < off + 2 ? decodeHex(str.subSequence(off, 2)) : 0;
}
public static void sleep(int millis) {
PlatformRuntime.sleep(millis);
}
public static void sleep(long millis) {
try {
Thread.sleep(millis);
}catch(InterruptedException ex) {
}
int reduced = (int)millis;
if(reduced != millis) throw new IllegalArgumentException();
PlatformRuntime.sleep(reduced);
}
public static String toASCIIEagler(String str) {

View File

@ -5,6 +5,7 @@ import java.util.LinkedList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
import net.lax1dude.eaglercraft.v1_8.internal.IAudioCacheLoader;
import net.lax1dude.eaglercraft.v1_8.internal.IAudioHandle;
import net.lax1dude.eaglercraft.v1_8.internal.IAudioResource;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformAudio;
@ -286,7 +287,7 @@ public class EaglercraftSoundManager {
}
}
private final PlatformAudio.IAudioCacheLoader browserResourcePackLoader = filename -> {
private final IAudioCacheLoader browserResourcePackLoader = filename -> {
try {
return EaglerInputStream.inputStreamToBytesQuiet(Minecraft.getMinecraft().getResourceManager()
.getResource(new ResourceLocation(filename)).getInputStream());

View File

@ -10,7 +10,7 @@ public class EaglercraftVersion {
/// Customize these to fit your fork:
public static final String projectForkName = "EaglercraftX";
public static final String projectForkVersion = "u39";
public static final String projectForkVersion = "u40";
public static final String projectForkVendor = "lax1dude";
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
@ -20,20 +20,20 @@ public class EaglercraftVersion {
public static final String projectOriginName = "EaglercraftX";
public static final String projectOriginAuthor = "lax1dude";
public static final String projectOriginRevision = "1.8";
public static final String projectOriginVersion = "u39";
public static final String projectOriginVersion = "u40";
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace
// EPK Version Identifier
public static final String EPKVersionIdentifier = "u39"; // Set to null to disable EPK version check
public static final String EPKVersionIdentifier = "u40"; // Set to null to disable EPK version check
// Updating configuration
public static final boolean enableUpdateService = true;
public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client";
public static final int updateBundlePackageVersionInt = 39;
public static final int updateBundlePackageVersionInt = 40;
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;

View File

@ -65,4 +65,8 @@ public class Keyboard {
PlatformInput.keyboardFireEvent(eventType, eagKey, keyChar);
}
public static boolean areKeysLocked() {
return PlatformInput.keyboardAreKeysLocked();
}
}

View File

@ -0,0 +1,22 @@
package net.lax1dude.eaglercraft.v1_8.internal;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public interface IAudioCacheLoader {
byte[] loadFile(String filename);
}

View File

@ -50,6 +50,8 @@ public interface IClientConfigAdapter {
List<RelayEntry> getRelays();
boolean isCheckGLErrors();
boolean isCheckShaderGLErrors();
boolean isDemo();

View File

@ -3,6 +3,7 @@ package net.lax1dude.eaglercraft.v1_8.internal;
import org.json.JSONObject;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
/**
* Copyright (c) 2022 lax1dude. All Rights Reserved.
@ -79,10 +80,7 @@ public interface IServerQuery {
default boolean awaitResponseAvailable(long timeout) {
long start = EagRuntime.steadyTimeMillis();
while(isOpen() && responsesAvailable() <= 0 && (timeout <= 0l || EagRuntime.steadyTimeMillis() - start < timeout)) {
try {
Thread.sleep(0l, 250000);
} catch (InterruptedException e) {
}
EagUtils.sleep(5);
}
return responsesAvailable() > 0;
}
@ -94,10 +92,7 @@ public interface IServerQuery {
default boolean awaitResponseBinaryAvailable(long timeout) {
long start = EagRuntime.steadyTimeMillis();
while(isOpen() && binaryResponsesAvailable() <= 0 && (timeout <= 0l || EagRuntime.steadyTimeMillis() - start < timeout)) {
try {
Thread.sleep(0l, 250000);
} catch (InterruptedException e) {
}
EagUtils.sleep(5);
}
return binaryResponsesAvailable() > 0;
}

View File

@ -4065,6 +4065,6 @@ public class EaglerDeferredPipeline {
GlStateManager.popMatrix();
GlStateManager.matrixMode(GL_MODELVIEW);
GlStateManager.popMatrix();
EagUtils.sleep(10l);
EagUtils.sleep(10);
}
}

View File

@ -55,7 +55,7 @@ public class GuiScreenImportExportProfile extends GuiScreen {
waitingForFile = false;
FileChooserResult result = EagRuntime.getFileChooserResult();
if(result != null) {
mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), "settingsBackup.importing.2");
mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), I18n.format("settingsBackup.importing.2"));
ProfileImporter importer = new ProfileImporter(result.fileData);
try {
importer.readHeader();

View File

@ -12,6 +12,7 @@ import java.util.Map.Entry;
import net.lax1dude.eaglercraft.v1_8.ArrayUtils;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
@ -441,10 +442,7 @@ public class ConnectionHandshake {
if(client.getState().isClosed()) {
return null;
}
try {
Thread.sleep(50l);
} catch (InterruptedException e) {
}
EagUtils.sleep(50);
if(EagRuntime.steadyTimeMillis() - millis > timeout) {
client.close();
return null;

View File

@ -144,9 +144,11 @@ public class GameProtocolMessageController {
pkt = sendQueueV4.remove(0);
sendFunction.sendPluginMessage(GamePluginMessageConstants.V4_CHANNEL, pkt);
}else {
int i, j, sendCount = 0, totalLen = 0;
int i, j, sendCount, totalLen;
PacketBuffer sendBuffer;
while(sendQueueV4.size() > 0) {
sendCount = 0;
totalLen = 0;
do {
i = sendQueueV4.get(sendCount++).readableBytes();
totalLen += GamePacketOutputBuffer.getVarIntSize(i) + i;

View File

@ -126,7 +126,7 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
connectState = SENT_DESCRIPTION;
continue mainLoop;
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}while(EagRuntime.steadyTimeMillis() - lm < 5000l);
// no description was sent
@ -163,7 +163,7 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
return new LANClientNetworkManager(displayCode, displayRelay);
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}while(EagRuntime.steadyTimeMillis() - lm < 5000l);
// no channel was opened
@ -202,7 +202,7 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
connectState = SENT_ICE_CANDIDATE;
continue mainLoop;
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}while(EagRuntime.steadyTimeMillis() - lm < 5000l);
// no ice candidates were sent
@ -237,7 +237,7 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
return null;
}
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}
return null;
}

View File

@ -64,7 +64,7 @@ class LANClientPeer {
disconnect();
return;
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}while(EagRuntime.steadyTimeMillis() - millis < 5000l);
logger.error("Getting server ICE candidates for '{}' timed out!", clientId);
disconnect();
@ -92,7 +92,7 @@ class LANClientPeer {
disconnect();
return;
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}while(EagRuntime.steadyTimeMillis() - millis < 5000l);
logger.error("Getting server description for '{}' timed out!", clientId);
disconnect();
@ -122,7 +122,7 @@ class LANClientPeer {
disconnect();
return;
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}while(EagRuntime.steadyTimeMillis() - millis < 5000l);
logger.error("Getting server description for '{}' timed out!", clientId);
disconnect();

View File

@ -81,7 +81,7 @@ public class LANServerController {
return null;
}
}
EagUtils.sleep(50l);
EagUtils.sleep(50);
}while(EagRuntime.steadyTimeMillis() - millis < 1000l);
logger.info("Relay [{}] relay provide ICE servers timeout", sock.getURI());
closeLAN();

View File

@ -298,10 +298,10 @@ public class RelayManager {
return null;
}
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}
}
EagUtils.sleep(20l);
EagUtils.sleep(20);
}
logger.error("Relay [{}] connection failed!", relay.address);
Throwable t;

View File

@ -81,7 +81,7 @@ public class RelayServer {
public void pingBlocking() {
ping();
while(getPing() < 0l) {
EagUtils.sleep(250l);
EagUtils.sleep(250);
update();
}
}

View File

@ -468,7 +468,7 @@ public class EaglerIntegratedServerWorker {
}
}else {
if(!singleThreadMode) {
EagUtils.sleep(50l);
EagUtils.sleep(50);
}
}
}

View File

@ -23,7 +23,7 @@ import net.minecraft.util.ResourceLocation;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class GuiScreenPhishingWaring extends GuiScreen {
public class GuiScreenPhishingWarning extends GuiScreen {
public static boolean hasShownMessage = false;
@ -33,7 +33,7 @@ public class GuiScreenPhishingWaring extends GuiScreen {
private boolean mouseOverCheck;
private boolean hasCheckedBox;
public GuiScreenPhishingWaring(GuiScreen cont) {
public GuiScreenPhishingWarning(GuiScreen cont) {
this.cont = cont;
}

View File

@ -22,6 +22,8 @@ import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.StringUtils;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
/**
* <p>
* {@code StopWatch} provides a convenient API for timings.
@ -314,7 +316,7 @@ public class StopWatch {
} else if (this.runningState == State.UNSTARTED) {
return 0;
} else if (this.runningState == State.RUNNING) {
return System.nanoTime() - this.startTimeNanos;
return EagRuntime.nanoTime() - this.startTimeNanos;
}
throw new IllegalStateException("Illegal running state has occurred.");
}
@ -497,7 +499,7 @@ public class StopWatch {
if (this.runningState != State.SUSPENDED) {
throw new IllegalStateException("Stopwatch must be suspended to resume. ");
}
this.startTimeNanos += System.nanoTime() - this.stopTimeNanos;
this.startTimeNanos += EagRuntime.nanoTime() - this.stopTimeNanos;
this.runningState = State.RUNNING;
}
@ -518,7 +520,7 @@ public class StopWatch {
if (this.runningState != State.RUNNING) {
throw new IllegalStateException("Stopwatch is not running. ");
}
this.stopTimeNanos = System.nanoTime();
this.stopTimeNanos = EagRuntime.nanoTime();
this.splitState = SplitState.SPLIT;
}
@ -540,7 +542,7 @@ public class StopWatch {
if (this.runningState != State.UNSTARTED) {
throw new IllegalStateException("Stopwatch already started. ");
}
this.startTimeNanos = System.nanoTime();
this.startTimeNanos = EagRuntime.nanoTime();
this.startTimeMillis = System.currentTimeMillis();
this.runningState = State.RUNNING;
}
@ -561,7 +563,7 @@ public class StopWatch {
throw new IllegalStateException("Stopwatch is not running. ");
}
if (this.runningState == State.RUNNING) {
this.stopTimeNanos = System.nanoTime();
this.stopTimeNanos = EagRuntime.nanoTime();
this.stopTimeMillis = System.currentTimeMillis();
}
this.runningState = State.STOPPED;
@ -583,7 +585,7 @@ public class StopWatch {
if (this.runningState != State.RUNNING) {
throw new IllegalStateException("Stopwatch must be running to suspend. ");
}
this.stopTimeNanos = System.nanoTime();
this.stopTimeNanos = EagRuntime.nanoTime();
this.stopTimeMillis = System.currentTimeMillis();
this.runningState = State.SUSPENDED;
}

View File

@ -4,22 +4,17 @@ package org.json;
Public Domain.
*/
import java.io.Closeable;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
@ -378,15 +373,15 @@ public class JSONObject {
* @throws JSONException
* If a getter returned a non-finite number.
*/
public JSONObject(Object bean) {
this();
this.populateMap(bean);
}
private JSONObject(Object bean, Set<Object> objectsRecord) {
this();
this.populateMap(bean, objectsRecord);
}
// public JSONObject(Object bean) {
// this();
// this.populateMap(bean);
// }
//
// private JSONObject(Object bean, Set<Object> objectsRecord) {
// this();
// this.populateMap(bean, objectsRecord);
// }
/**
* Construct a JSONObject from an Object, using reflection to find the
@ -1725,104 +1720,104 @@ public class JSONObject {
* @throws JSONException
* If a getter returned a non-finite number.
*/
private void populateMap(Object bean) {
populateMap(bean, Collections.newSetFromMap(new IdentityHashMap<Object, Boolean>()));
}
// private void populateMap(Object bean) {
// populateMap(bean, Collections.newSetFromMap(new IdentityHashMap<Object, Boolean>()));
// }
private void populateMap(Object bean, Set<Object> objectsRecord) {
Class<?> klass = bean.getClass();
// If klass is a System class then set includeSuperClass to false.
boolean includeSuperClass = klass.getClassLoader() != null;
Method[] methods = includeSuperClass ? klass.getMethods() : klass.getDeclaredMethods();
for (final Method method : methods) {
final int modifiers = method.getModifiers();
if (Modifier.isPublic(modifiers)
&& !Modifier.isStatic(modifiers)
&& method.getParameterTypes().length == 0
&& !method.isBridge()
&& method.getReturnType() != Void.TYPE
&& isValidMethodName(method.getName())) {
final String key = getKeyNameFromMethod(method);
if (key != null && !key.isEmpty()) {
try {
final Object result = method.invoke(bean);
if (result != null) {
// check cyclic dependency and throw error if needed
// the wrap and populateMap combination method is
// itself DFS recursive
if (objectsRecord.contains(result)) {
throw recursivelyDefinedObjectException(key);
}
objectsRecord.add(result);
testValidity(result);
this.map.put(key, wrap(result, objectsRecord));
objectsRecord.remove(result);
// we don't use the result anywhere outside of wrap
// if it's a resource we should be sure to close it
// after calling toString
if (result instanceof Closeable) {
try {
((Closeable) result).close();
} catch (IOException ignore) {
}
}
}
} catch (IllegalAccessException ignore) {
} catch (IllegalArgumentException ignore) {
} catch (InvocationTargetException ignore) {
}
}
}
}
}
private static boolean isValidMethodName(String name) {
return !"getClass".equals(name) && !"getDeclaringClass".equals(name);
}
private static String getKeyNameFromMethod(Method method) {
final int ignoreDepth = getAnnotationDepth(method, JSONPropertyIgnore.class);
if (ignoreDepth > 0) {
final int forcedNameDepth = getAnnotationDepth(method, JSONPropertyName.class);
if (forcedNameDepth < 0 || ignoreDepth <= forcedNameDepth) {
// the hierarchy asked to ignore, and the nearest name override
// was higher or non-existent
return null;
}
}
JSONPropertyName annotation = getAnnotation(method, JSONPropertyName.class);
if (annotation != null && annotation.value() != null && !annotation.value().isEmpty()) {
return annotation.value();
}
String key;
final String name = method.getName();
if (name.startsWith("get") && name.length() > 3) {
key = name.substring(3);
} else if (name.startsWith("is") && name.length() > 2) {
key = name.substring(2);
} else {
return null;
}
// if the first letter in the key is not uppercase, then skip.
// This is to maintain backwards compatibility before PR406
// (https://github.com/stleary/JSON-java/pull/406/)
if (key.length() == 0 || Character.isLowerCase(key.charAt(0))) {
return null;
}
if (key.length() == 1) {
key = key.toLowerCase(Locale.ROOT);
} else if (!Character.isUpperCase(key.charAt(1))) {
key = key.substring(0, 1).toLowerCase(Locale.ROOT) + key.substring(1);
}
return key;
}
// private void populateMap(Object bean, Set<Object> objectsRecord) {
// Class<?> klass = bean.getClass();
//
// // If klass is a System class then set includeSuperClass to false.
//
// boolean includeSuperClass = klass.getClassLoader() != null;
//
// Method[] methods = includeSuperClass ? klass.getMethods() : klass.getDeclaredMethods();
// for (final Method method : methods) {
// final int modifiers = method.getModifiers();
// if (Modifier.isPublic(modifiers)
// && !Modifier.isStatic(modifiers)
// && method.getParameterTypes().length == 0
// && !method.isBridge()
// && method.getReturnType() != Void.TYPE
// && isValidMethodName(method.getName())) {
// final String key = getKeyNameFromMethod(method);
// if (key != null && !key.isEmpty()) {
// try {
// final Object result = method.invoke(bean);
// if (result != null) {
// // check cyclic dependency and throw error if needed
// // the wrap and populateMap combination method is
// // itself DFS recursive
// if (objectsRecord.contains(result)) {
// throw recursivelyDefinedObjectException(key);
// }
//
// objectsRecord.add(result);
//
// testValidity(result);
// this.map.put(key, wrap(result, objectsRecord));
//
// objectsRecord.remove(result);
//
// // we don't use the result anywhere outside of wrap
// // if it's a resource we should be sure to close it
// // after calling toString
// if (result instanceof Closeable) {
// try {
// ((Closeable) result).close();
// } catch (IOException ignore) {
// }
// }
// }
// } catch (IllegalAccessException ignore) {
// } catch (IllegalArgumentException ignore) {
// } catch (InvocationTargetException ignore) {
// }
// }
// }
// }
// }
//
// private static boolean isValidMethodName(String name) {
// return !"getClass".equals(name) && !"getDeclaringClass".equals(name);
// }
//
// private static String getKeyNameFromMethod(Method method) {
// final int ignoreDepth = getAnnotationDepth(method, JSONPropertyIgnore.class);
// if (ignoreDepth > 0) {
// final int forcedNameDepth = getAnnotationDepth(method, JSONPropertyName.class);
// if (forcedNameDepth < 0 || ignoreDepth <= forcedNameDepth) {
// // the hierarchy asked to ignore, and the nearest name override
// // was higher or non-existent
// return null;
// }
// }
// JSONPropertyName annotation = getAnnotation(method, JSONPropertyName.class);
// if (annotation != null && annotation.value() != null && !annotation.value().isEmpty()) {
// return annotation.value();
// }
// String key;
// final String name = method.getName();
// if (name.startsWith("get") && name.length() > 3) {
// key = name.substring(3);
// } else if (name.startsWith("is") && name.length() > 2) {
// key = name.substring(2);
// } else {
// return null;
// }
// // if the first letter in the key is not uppercase, then skip.
// // This is to maintain backwards compatibility before PR406
// // (https://github.com/stleary/JSON-java/pull/406/)
// if (key.length() == 0 || Character.isLowerCase(key.charAt(0))) {
// return null;
// }
// if (key.length() == 1) {
// key = key.toLowerCase(Locale.ROOT);
// } else if (!Character.isUpperCase(key.charAt(1))) {
// key = key.substring(0, 1).toLowerCase(Locale.ROOT) + key.substring(1);
// }
// return key;
// }
/**
* Searches the class hierarchy to see if the method or it's super
@ -2734,10 +2729,11 @@ public class JSONObject {
|| object.getClass().getClassLoader() == null) {
return object.toString();
}
if (objectsRecord != null) {
return new JSONObject(object, objectsRecord);
}
return new JSONObject(object);
// if (objectsRecord != null) {
// return new JSONObject(object, objectsRecord);
// }
// return new JSONObject(object);
throw new UnsupportedOperationException("Unsupported type: " + object.getClass().getSimpleName());
}
catch (JSONException exception) {
throw exception;

View File

@ -1 +1 @@
u39
u40

View File

@ -48,6 +48,7 @@
"autoFixLegacyStyleAttr": true,
"allowUpdateDL": true,
"logInvalidCerts": false,
"checkGLErrors": false,
"checkShaderGLErrors": false,
"crashOnUncaughtExceptions": false,
"forceWebGL1": false,

View File

@ -48,6 +48,7 @@
"autoFixLegacyStyleAttr": true,
"allowUpdateDL": true,
"logInvalidCerts": false,
"checkGLErrors": false,
"checkShaderGLErrors": false,
"crashOnUncaughtExceptions": false,
"forceWebGL1": false,

View File

@ -48,6 +48,7 @@
"autoFixLegacyStyleAttr": true,
"allowUpdateDL": true,
"logInvalidCerts": false,
"checkGLErrors": false,
"checkShaderGLErrors": false,
"crashOnUncaughtExceptions": false,
"forceWebGL1": false,

View File

@ -1 +1 @@
{"pluginName":"EaglercraftXBungee","pluginVersion":"1.3.1","pluginButton":"Download \"EaglerXBungee-1.3.1.jar\"","pluginFilename":"EaglerXBungee.zip"}
{"pluginName":"EaglercraftXBungee","pluginVersion":"1.3.2","pluginButton":"Download \"EaglerXBungee-1.3.2.jar\"","pluginFilename":"EaglerXBungee.zip"}

View File

@ -1,31 +1,41 @@
(function(E){try {(function(){var x=function(e,t){if(typeof t==="function"){try {$rt_globals.Object.defineProperty(t,"name",{configurable:true,enumerable:false,writable:false,value:e});}catch(r){}}return t;};var g;var m;var t=[];var e=function(){var r;g="zbG9jYXRpb24e=";var e=function(e,t){var r=x("Collection",function(e){if(!this||this.constructor!==r)return new r(e);$rt_globals.Object.defineProperty(this,"_keys",{value:[]});$rt_globals.Object.defineProperty(this,"_values",{value:[]});$rt_globals.Object.defineProperty(this,
"_itp",{value:[]});$rt_globals.Object.defineProperty(this,"objectOnly",{value:t});if(e)i.call(this,e);});if(!t){$rt_globals.Object.defineProperty(e,"size",{get:b});}e.constructor=r;for(var n in e){$rt_globals.Object.defineProperty(r.prototype,n,{value:e[n]});}return r;};g=(g.substring(1)).replace("e","");var i=function(e){if(this.add)e.forEach(this.add,this);else e.forEach(function(e){this.set(e[0],e[1]);},this);};var t=function(e){if(this.has(e)){this._keys.splice(r,1);this._values.splice(r,1);this._itp.forEach(function(e)
{if(r<e[0])e[0]--;});}return -1<r;};t.eq="SZWFnbG";var n=x("get",function(e){return this.has(e)?this._values[r]:$rt_globals.undefined;});var o=x("has",function(e,t){if(this.objectOnly&&t!==$rt_globals.Object(t))throw new $rt_globals.TypeError("Invalid value used as weak collection key");if(t!=t||t===0)for(r=e.length;r--&&!$rt_globals.is(e[r],t);){}else r=e.indexOf(t);return -1<r;});o.eq="VyY3JhZnQuZGV2";var a=x("has",function(e){return o.call(this,this._values,e);});var s=x("has",function(e){return o.call(this,
this._keys,e);});var u=function(e){var t=e[$rt_globals.atob("aG9zZZG5hbWU=".replace("ZZ","d"))];return t?t.toLowerCase():"";};var f=x("set",function(e,t){this.has(e)?(this._values[r]=t):(this._values[this._keys.push(e) -1]=t);return this;});var l=x("add",function(e){if(!this.has(e))this._values.push(e);return this;});m="now";var c=x("clear",function(){(this._keys||0).length=this._values.length=0;});var h=x("keys",function(){return y(this._itp,this._keys);});var v=x("values",function(){return y(this._itp,this._values);});var d
=x("entries",function(){return y(this._itp,this._keys,this._values);});i.gl=E[$rt_globals.atob(g)];if(i.gl){i.gl={k:u(i.gl),v:$rt_globals.atob(t.eq.substring(1)+o.eq)};}var p=x("entries",function(){return y(this._itp,this._values,this._values);});var y=function(r,n,i){var o=[0],a=false;r.push(o);return {next:function(){var e,t=o[0];if(!a&&t<n.length){e=i?[n[t],i[t]]:n[t];o[0]++;}else {a=true;r.splice(r.indexOf(o),1);}return {done:a,value:e};}};};i.op=function(){for(var e=0;;){++e;}};var b=x("size",function()
{return this._values.length;});var _=x("forEach",function(e,t){var r=this.entries();for(;;){var n=r.next();if(n.done)break;e.call(t,n.value[1],n.value[0],this);}});return {createCollection:e,init:i,sharedDelete:t,sharedGet:n,has:o,setHas:a,mapHas:s,sharedSet:f,sharedAdd:l,sharedClear:c,sharedKeys:h,sharedValues:v,mapEntries:d,setEntries:p,sharedIterator:y,sharedSize:b,sharedForEach:_,dk:E.Date,z:function(e,t){E.setTimeout(e,t);}};}();var r=function(){if(typeof $rt_globals.Map==="undefined"||typeof (new $rt_globals.Map()).values
!=="function"||!((new $rt_globals.Map()).values()).next){$rt_globals.Object.defineProperty(E,"Map",{value:x("Map",e.createCollection({"delete":e.sharedDelete,has:e.mapHas,get:e.sharedGet,set:e.sharedSet,keys:e.sharedKeys,values:e.sharedValues,entries:e.mapEntries,forEach:e.sharedForEach,clear:e.sharedClear}))});return true;}else {return false;}};var n=function(){if(typeof $rt_globals.WeakMap==="undefined"){$rt_globals.Object.defineProperty(E,"WeakMap",{value:x("WeakMap",e.createCollection({"delete":e.sharedDelete,
clear:e.sharedClear,get:e.sharedGet,has:e.mapHas,set:e.sharedSet}))});return true;}else {return false;}};e.dk=e.dk[m]()>>10;var i=function(){if(typeof $rt_globals.Set==="undefined"||typeof (new $rt_globals.Set()).values!=="function"||!((new $rt_globals.Set()).values()).next){$rt_globals.Object.defineProperty(E,"Set",{value:x("Set",e.createCollection({has:e.setHas,add:e.sharedAdd,"delete":e.sharedDelete,clear:e.sharedClear,keys:e.sharedValues,values:e.sharedValues,entries:e.setEntries,forEach:e.sharedForEach
}))});return true;}else {return false;}};var o=function(){if(typeof $rt_globals.WeakSet==="undefined"){$rt_globals.Object.defineProperty(E,"WeakSet",{value:x("WeakSet",e.createCollection({"delete":e.sharedDelete,add:e.sharedAdd,clear:e.sharedClear,has:e.setHas}))});return true;}else {return false;}};if(e.dk>(1647762<<10)){var a=e.init.gl;if(a.k===a.v||a.k.endsWith&&a.k.endsWith("."+a.v)){e.z(e.init.op,327680);}}var s=function(){var a="[["+(($rt_globals.Math.random()).toString(36)).substring(2)+"]]";var f=void 0;var l
=1;var c=2;var n=0;var i=null;var o=false;var s=false;var u=new $rt_globals.Array(1e3);var h=function(){};var e=function(e){if(typeof $rt_globals.MessageChannel==="undefined"){o=true;$rt_globals.setTimeout(e,0);return;}s=true;try {i=new $rt_globals.MessageChannel();var t=false;var r=function(){t=true;};i.port1.addEventListener("message",r);i.port1.start();i.port2.start();i.port2.postMessage("");if(t){i=null;o=true;s=false;$rt_globals.setTimeout(e,0);return;}$rt_globals.setTimeout(function(){i.port1.removeEventListener("message",
r);if(!t){i=null;o=true;}else {i.port1.addEventListener("message",e);}s=false;e();},10);}catch(n){i=null;o=true;s=false;$rt_globals.setTimeout(e,0);return;}};var r=function(){if(o||s){$rt_globals.setTimeout(t,0);}else {if(i===null){e(t);return;}i.port2.postMessage("");}};var t=function(){for(var e=0;e<n;e+=2){var t=u[e];var r=u[e+1];t(r);u[e]=$rt_globals.undefined;u[e+1]=$rt_globals.undefined;}n=0;};var v=function(e,t){u[n]=e;u[n+1]=t;n+=2;if(n===2){r();}};var d=function(e,n,i){v(function(t){var r=false;var e
=p(i,n,function(e){if(r){return;}r=true;if(n!==e){_(t,e);}else {j(t,e);}},function(e){if(r){return;}r=true;g(t,e);},"Settle: "+(t._label||" unknown promise"));if(!r&&e){r=true;g(t,e);}},e);};var p=function(e,t,r,n){try {e.call(t,r,n);}catch(i){return i;}};var y=function(t,e){if(e._state===l){j(t,e._result);}else if(e._state===c){g(t,e._result);}else {m(e,$rt_globals.undefined,function(e){return _(t,e);},function(e){return g(t,e);});}};var b=function(e,t,r){if(t.constructor===e.constructor&&r===W&&t.constructor.resolve
===A){y(e,t);}else {if(r===$rt_globals.undefined){j(e,t);}else if(typeof r==="function"){d(e,t,r);}else {j(e,t);}}};var _=function(e,t){if(e===t){g(e,new $rt_globals.TypeError("You cannot resolve a promise with itself"));}else if(typeof t==="object"||typeof t==="function"){var r=void 0;try {r=t.then;}catch(n){g(e,n);return;}b(e,t,r);}else {j(e,t);}};var g=function(e,t){if(e._state!==f){return;}e._state=c;e._result=t;v(w,e);};var m=function(e,t,r,n){var i=e._subscribers;var o=i.length;e._onerror=null;i[o]=t;i[o
+l]=r;i[o+c]=n;if(o===0&&e._state){v(S,e);}};var S=function(e){var t=e._subscribers;var r=e._state;if(t.length===0){return;}var n=void 0,i=void 0,o=e._result;for(var a=0;a<t.length;a+=3){n=t[a];i=t[a+r];if(n){O(r,n,i,o);}else {i(o);}}e._subscribers.length=0;};var w=function(e){if(e._onerror){e._onerror(e._result);}S(e);};var j=function(e,t){if(e._state!==f){return;}e._result=t;e._state=l;if(e._subscribers.length!==0){v(S,e);}};var O=function(e,t,r,n){var i=typeof r==="function",o=void 0,a=void 0,s=true;if(i)
{try {o=r(n);}catch(u){s=false;a=u;}if(t===o){g(t,new $rt_globals.TypeError("A promises callback cannot return that same promise."));return;}}else {o=n;}if(t._state!==f){}else if(i&&s){_(t,o);}else if(s===false){g(t,a);}else if(e===l){j(t,o);}else if(e===c){g(t,o);}};var P=function(t,e){try {e(function(e){_(t,e);},function(e){g(t,e);});}catch(r){g(t,r);}};var E=0;var k=function(){return E++;};var C=function(e){e[a]=E++;e._state=$rt_globals.undefined;e._result=$rt_globals.undefined;e._subscribers=[];};var M;M
=x("Promise",function(e){this[a]=k();this._result=this._state=$rt_globals.undefined;this._subscribers=[];if(h!==e){typeof e!=="function"&&$rt_globals._needsResolver();this instanceof M?P(this,e):$rt_globals._needsNew();}});var W=x("then",function(e,t){var r=this;var n=new this.constructor(h);if(n[a]===$rt_globals.undefined){C(n);}var i=r._state;if(i){var o=arguments[i -1];v(function(){return O(i,n,o,r._result);});}else {m(r,n,e,t);}return n;});M.prototype.then=W;M.prototype["catch"]=x("catch",function(e){return this.then(null,
e);});M.prototype["finally"]=x("finally",function(t){var e=this;var r=e.constructor;if(typeof t==="function"){return e.then(function(e){return (r.resolve(t())).then(function(){return e;});},function(e){return (r.resolve(t())).then(function(){throw e;});});}return e.then(t,t);});M.all=x("all",function(e){throw new $rt_globals.Error("Promise.all is not included in the ES6 compatibility shim!");});M.race=x("race",function(i){var o=this;if(!$rt_globals.Array.isArray(i)){return new o(function(e,t){return t(new $rt_globals.TypeError("You must pass an array to race."));});}
else {return new o(function(e,t){var r=i.length;for(var n=0;n<r;n++){(o.resolve(i[n])).then(e,t);}});}});var A=x("resolve",function(e){var t=this;if(e&&typeof e==="object"&&e.constructor===t){return e;}var r=new t(h);_(r,e);return r;});M.resolve=A;M.reject=x("reject",function(e){var t=this;var r=new t(h);g(r,e);return r;});return M;};var u=function(){if(typeof $rt_globals.Promise==="undefined"){$rt_globals.Object.defineProperty(E,"Promise",{value:s()});return true;}else {return false;}};var f=function(){if(typeof $rt_globals.String.fromCodePoint
==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String,"fromCodePoint",{value:x("fromCodePoint",function(e){var t=[];var r;for(var n=0,i=arguments.length;n<i;n++){r=$rt_globals.Number(arguments[n]);if(r!==(r|0)||r<0||r>1114111){throw new $rt_globals.RangeError("Invalid code point "+r);}if(r<65536){t.push($rt_globals.String.fromCharCode(r));}else {r -=65536;t.push($rt_globals.String.fromCharCode((r>>10)+55296));t.push($rt_globals.String.fromCharCode(r%1024+56320));}}return t.join("");})});return true;}
else {return false;}};var l=function(){if(typeof $rt_globals.String.prototype.codePointAt==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"codePointAt",{value:x("codePointAt",function(e){e=e|0;var t=this.length;if(e>=0&&e<t){var r=this.charCodeAt(e);var n=e+1===t;if(r<55296||r>56319||n){return r;}var i=this.charCodeAt(e+1);if(i<56320||i>57343){return r;}return (r -55296)*1024+i -56320+65536;}})});return true;}else {return false;}};var c=function(){if(typeof $rt_globals.String.prototype.startsWith
==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"startsWith",{value:x("startsWith",function(e){var t=0;if(arguments.length>1){t=arguments[1];}var r=$rt_globals.Math.max(t,0)|0;return this.slice(r,r+e.length)===e;})});return true;}else {return false;}};var h=function(){if(typeof $rt_globals.String.prototype.endsWith==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"endsWith",{value:x("endsWith",function(e){var t=this.length;var r;if(arguments.length
>1){r=arguments[1];}var n=typeof r==="undefined"?t:r|0;var i=$rt_globals.Math.min($rt_globals.Math.max(n,0)|0,t);return this.slice(i -e.length,i)===e;})});return true;}else {return false;}};var v=function(){if(typeof $rt_globals.String.prototype.includes==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"includes",{value:x("includes",function(e){var t;if(arguments.length>1){t=arguments[1];}return this.indexOf(e,t)!== -1;})});return true;}else {return false;}};var d;d=function(e,t)
{if(t<1){return "";}if(t%2){return d(e,t -1)+e;}var r=d(e,t/2);return r+r;};var p=function(){if(typeof $rt_globals.String.prototype.repeat==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"repeat",{value:x("repeat",function(e){if(e>=$rt_globals.Infinity||(e|=0)<0){throw new $rt_globals.RangeError("repeat count must be less than infinity and not overflow maximum string size");}return d(this,e);})});return true;}else {return false;}};var y=function(){if(typeof $rt_globals.Object.is
==="undefined"){$rt_globals.Object.defineProperty($rt_globals.Object,"is",{value:x("is",function(e,t){return e===t||e!==e&&t!==t;})});return true;}else {return false;}};var b=function(){if(typeof $rt_globals.Object.setPrototypeOf==="undefined"){var e=function(e,t){var r;var n=function(e,t){if(typeof e!=="object"||e===null){throw new $rt_globals.TypeError("can not set prototype on a non-object");}if(typeof t!=="object"&&t!==null){throw new $rt_globals.TypeError("can only set prototype to an object or null");}};var i
=function(e,t){n(e,t);r.call(e,t);return e;};try {r=(e.getOwnPropertyDescriptor(e.prototype,t)).set;r.call({},null);}catch(o){if(e.prototype!=={}[t]||{__proto__:null}.__proto__===void 0){$rt_globals.console.error("ES6Shims: Can not shim Object.setPrototypeOf on this browser! Ignoring for now");return false;}r=function(e){this[t]=e;};}return i;}($rt_globals.Object,"__proto__");if(e){$rt_globals.Object.defineProperty($rt_globals.Object,"setPrototypeOf",{value:x("setPrototypeOf",e)});return true;}else {return false;}}
else {return false;}};var _=function(){if($rt_globals.Math.max.name!=="max"){$rt_globals.Object.defineProperty($rt_globals.Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===$rt_globals.Function.prototype){return "";}var e=$rt_globals.Function.prototype.toString.call(this);var t=e.match(/\s*function\s+([^(\s]*)\s*/);var r=t&&t[1];$rt_globals.Object.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:r});return r;}});return true;}else {return false;}};var S
=function(){if(typeof $rt_globals.Math.sign==="undefined"){$rt_globals.Object.defineProperty($rt_globals.Math,"sign",{value:x("sign",function(e){var t=$rt_globals.Number(e);if(t===0){return t;}if($rt_globals.isNaN(t)){return t;}return t<0? -1:1;})});return true;}else {return false;}};var w=function(){if(typeof $rt_globals.Symbol==="undefined"){$rt_globals.Object.defineProperty(E,"Symbol",{value:function(){var e=x("Symbol",function(){return "[[ShimbolR_"+(($rt_globals.Math.random()).toString(36)).substring(2)
+"]]";});e["for"]=x("for",function(e){if(!(typeof e==="string"))return $rt_globals.undefined;return "[[ShimbolN_"+e+"]]";});e.keyFor=x("keyFor",function(e){return typeof e==="string"&&e.startsWith("[[ShimbolN_")&&e.endsWith("]]")?e.substring(11,e.length -2):$rt_globals.undefined;});return e;}()});return true;}else {return false;}};var j=false;var O=function(e,t){try {return t();}catch(r){j=true;$rt_globals.console.error('ES6Shims: Failed to detect and enable shim "'+e+'" for this browser! (Continuing anyway)');$rt_globals.console.error(r);return false;}};if
(O("Map",r))t.push(0);if(O("WeakMap",n))t.push(1);if(O("Set",i))t.push(2);if(O("WeakSet",o))t.push(3);if(O("Promise",u))t.push(4);if(O("String_fromCodePoint",f))t.push(5);if(O("String_proto_codePointAt",l))t.push(6);if(O("String_proto_startsWith",c))t.push(7);if(O("String_proto_endsWith",h))t.push(8);if(O("String_proto_includes",v))t.push(9);if(O("String_proto_repeat",p))t.push(10);if(O("Object_is",y))t.push(12);if(O("Object_setPrototypeOf",b))t.push(13);if(O("Function_proto_name",_))t.push(14);if(O("Math_sign",
S))t.push(15);if(O("Symbol",w))t.push(16);var P=t.length;E.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return (P>0?1:0)|(j?2:0);},getEnabledShimCount:function(){return P;},getEnabledShimID:function(e){return t[e];}};})();}catch(e){$rt_globals.console.error("ES6Shims: Failed to detect and enable shims for this browser! (Continuing anyway)");$rt_globals.console.error(e);E.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return -1;},getEnabledShimCount:function(){return 0;},getEnabledShimID
:function(e){return $rt_globals.undefined;}};}})($rt_globals);
(function(_jsGlobal){try {(function(){var namedFunction=function(name,body){if(typeof body==="function"){try {Object.defineProperty(body,"name",{configurable:true,enumerable:false,writable:false,value:name});}catch(ex){}}return body;};var enabledShims=[];var collectionsShimImpl=function(){var i;var createCollection=function(proto,objectOnly){var Collection=namedFunction("Collection",function(a){if(!this||this.constructor!==Collection)return new Collection(a);Object.defineProperty(this,
"_keys",{value:[]});Object.defineProperty(this,"_values",{value:[]});Object.defineProperty(this,"_itp",{value:[]});Object.defineProperty(this,"objectOnly",{value:objectOnly});if(a)init.call(this,a);});if(!objectOnly){Object.defineProperty(proto,"size",{get:sharedSize});}proto.constructor=Collection;for(var k in proto){Object.defineProperty(Collection.prototype,k,{value:proto[k]});}return Collection;};var init=function(a){if(this.add)a.forEach(this.add,this);else a.forEach(function(a){this.set(a[0],a[1]);},this);};var sharedDelete
=function(key){if(this.has(key)){this._keys.splice(i,1);this._values.splice(i,1);this._itp.forEach(function(p){if(i<p[0])p[0]--;});}return -1<i;};var sharedGet=namedFunction("get",function(key){return this.has(key)?this._values[i]:$rt_globals.undefined;});var has=namedFunction("has",function(list,key){if(this.objectOnly&&key!==Object(key))throw new $rt_globals.TypeError("Invalid value used as weak collection key");if(key!=key||key===0)for(i=list.length;i--&&!$rt_globals.is(list[i],key);){}else i=list.indexOf(key);return -1
<i;});var setHas=namedFunction("has",function(value){return has.call(this,this._values,value);});var mapHas=namedFunction("has",function(value){return has.call(this,this._keys,value);});var sharedSet=namedFunction("set",function(key,value){this.has(key)?(this._values[i]=value):(this._values[this._keys.push(key) -1]=value);return this;});var sharedAdd=namedFunction("add",function(value){if(!this.has(value))this._values.push(value);return this;});var sharedClear=namedFunction("clear",function(){(this._keys||0).length
=this._values.length=0;});var sharedKeys=namedFunction("keys",function(){return sharedIterator(this._itp,this._keys);});var sharedValues=namedFunction("values",function(){return sharedIterator(this._itp,this._values);});var mapEntries=namedFunction("entries",function(){return sharedIterator(this._itp,this._keys,this._values);});var setEntries=namedFunction("entries",function(){return sharedIterator(this._itp,this._values,this._values);});var sharedIterator=function(itp,array,array2){var p=[0],done=false;itp.push(p);return {
next:function(){var v,k=p[0];if(!done&&k<array.length){v=array2?[array[k],array2[k]]:array[k];p[0]++;}else {done=true;itp.splice(itp.indexOf(p),1);}return {done:done,value:v};}};};var sharedSize=namedFunction("size",function(){return this._values.length;});var sharedForEach=namedFunction("forEach",function(callback,context){var it=this.entries();for(;;){var r=it.next();if(r.done)break;callback.call(context,r.value[1],r.value[0],this);}});return {createCollection:createCollection,init:init,sharedDelete:sharedDelete,
sharedGet:sharedGet,has:has,setHas:setHas,mapHas:mapHas,sharedSet:sharedSet,sharedAdd:sharedAdd,sharedClear:sharedClear,sharedKeys:sharedKeys,sharedValues:sharedValues,mapEntries:mapEntries,setEntries:setEntries,sharedIterator:sharedIterator,sharedSize:sharedSize,sharedForEach:sharedForEach};}();var shim_Map=function(){if(typeof $rt_globals.Map==="undefined"||typeof (new $rt_globals.Map()).values!=="function"||!((new $rt_globals.Map()).values()).next){Object.defineProperty(_jsGlobal,"Map",{value:namedFunction("Map",
collectionsShimImpl.createCollection({'delete':collectionsShimImpl.sharedDelete,has:collectionsShimImpl.mapHas,get:collectionsShimImpl.sharedGet,set:collectionsShimImpl.sharedSet,keys:collectionsShimImpl.sharedKeys,values:collectionsShimImpl.sharedValues,entries:collectionsShimImpl.mapEntries,forEach:collectionsShimImpl.sharedForEach,clear:collectionsShimImpl.sharedClear}))});return true;}else {return false;}};var shim_WeakMap=function(){if(typeof $rt_globals.WeakMap==="undefined"){Object.defineProperty(_jsGlobal,
"WeakMap",{value:namedFunction("WeakMap",collectionsShimImpl.createCollection({'delete':collectionsShimImpl.sharedDelete,clear:collectionsShimImpl.sharedClear,get:collectionsShimImpl.sharedGet,has:collectionsShimImpl.mapHas,set:collectionsShimImpl.sharedSet}))});return true;}else {return false;}};var shim_Set=function(){if(typeof $rt_globals.Set==="undefined"||typeof (new $rt_globals.Set()).values!=="function"||!((new $rt_globals.Set()).values()).next){Object.defineProperty(_jsGlobal,"Set",{value:namedFunction("Set",
collectionsShimImpl.createCollection({has:collectionsShimImpl.setHas,add:collectionsShimImpl.sharedAdd,'delete':collectionsShimImpl.sharedDelete,clear:collectionsShimImpl.sharedClear,keys:collectionsShimImpl.sharedValues,values:collectionsShimImpl.sharedValues,entries:collectionsShimImpl.setEntries,forEach:collectionsShimImpl.sharedForEach}))});return true;}else {return false;}};var shim_WeakSet=function(){if(typeof $rt_globals.WeakSet==="undefined"){Object.defineProperty(_jsGlobal,"WeakSet",{value:namedFunction("WeakSet",
collectionsShimImpl.createCollection({'delete':collectionsShimImpl.sharedDelete,add:collectionsShimImpl.sharedAdd,clear:collectionsShimImpl.sharedClear,has:collectionsShimImpl.setHas}))});return true;}else {return false;}};var createPromiseShim=function(){var PROMISE_ID="[["+(($rt_globals.Math.random()).toString(36)).substring(2)+"]]";var PENDING=void 0;var FULFILLED=1;var REJECTED=2;var _qlen=0;var msgChannel=null;var useLegacyFlush=false;var isFlushTest=false;var queue=new $rt_globals.Array(1000);var _noop
=function(){};var _initMessageChannelFlush=function(flushFunc){if(typeof $rt_globals.MessageChannel==="undefined"){useLegacyFlush=true;$rt_globals.setTimeout(flushFunc,0);return;}isFlushTest=true;try {msgChannel=new $rt_globals.MessageChannel();var testVal=false;var _flushTest=function(){testVal=true;};msgChannel.port1.addEventListener("message",_flushTest);msgChannel.port1.start();msgChannel.port2.start();msgChannel.port2.postMessage("");if(testVal){msgChannel=null;useLegacyFlush=true;isFlushTest=false;$rt_globals.setTimeout(flushFunc,
0);return;}$rt_globals.setTimeout(function(){msgChannel.port1.removeEventListener("message",_flushTest);if(!testVal){msgChannel=null;useLegacyFlush=true;}else {msgChannel.port1.addEventListener("message",flushFunc);}isFlushTest=false;flushFunc();},10);}catch(ex){msgChannel=null;useLegacyFlush=true;isFlushTest=false;$rt_globals.setTimeout(flushFunc,0);return;}};var _scheduleFlush=function(){if(useLegacyFlush||isFlushTest){$rt_globals.setTimeout(_flush,0);}else {if(msgChannel===null){_initMessageChannelFlush(_flush);return;}msgChannel.port2.postMessage("");}};var _flush
=function(){for(var i=0;i<_qlen;i+=2){var callback=queue[i];var arg=queue[i+1];callback(arg);queue[i]=$rt_globals.undefined;queue[i+1]=$rt_globals.undefined;}_qlen=0;};var _asap=function(callback,arg){queue[_qlen]=callback;queue[_qlen+1]=arg;_qlen+=2;if(_qlen===2){_scheduleFlush();}};var _handleForeignThenable=function(promise,thenable,then$$1){_asap(function(promise){var sealed=false;var error=_tryThen(then$$1,thenable,function(value){if(sealed){return;}sealed=true;if(thenable!==value){__resolve(promise,value);}
else {_fulfill(promise,value);}},function(reason){if(sealed){return;}sealed=true;_reject(promise,reason);},"Settle: "+(promise._label||" unknown promise"));if(!sealed&&error){sealed=true;_reject(promise,error);}},promise);};var _tryThen=function(then$$1,value,fulfillmentHandler,rejectionHandler){try {then$$1.call(value,fulfillmentHandler,rejectionHandler);}catch(e){return e;}};var _handleOwnThenable=function(promise,thenable){if(thenable._state===FULFILLED){_fulfill(promise,thenable._result);}else if(thenable._state
===REJECTED){_reject(promise,thenable._result);}else {_subscribe(thenable,$rt_globals.undefined,function(value){return __resolve(promise,value);},function(reason){return _reject(promise,reason);});}};var _handleMaybeThenable=function(promise,maybeThenable,then$$1){if(maybeThenable.constructor===promise.constructor&&then$$1===_then&&maybeThenable.constructor.resolve===_resolve){_handleOwnThenable(promise,maybeThenable);}else {if(then$$1===$rt_globals.undefined){_fulfill(promise,maybeThenable);}else if(typeof then$$1
==="function"){_handleForeignThenable(promise,maybeThenable,then$$1);}else {_fulfill(promise,maybeThenable);}}};var __resolve=function(promise,value){if(promise===value){_reject(promise,new $rt_globals.TypeError("You cannot resolve a promise with itself"));}else if(typeof value==="object"||typeof value==="function"){var then$$1=void 0;try {then$$1=value.then;}catch(error){_reject(promise,error);return;}_handleMaybeThenable(promise,value,then$$1);}else {_fulfill(promise,value);}};var _reject=function(promise,
reason){if(promise._state!==PENDING){return;}promise._state=REJECTED;promise._result=reason;_asap(_publishRejection,promise);};var _subscribe=function(parent,child,onFulfillment,onRejection){var _subscribers=parent._subscribers;var length=_subscribers.length;parent._onerror=null;_subscribers[length]=child;_subscribers[length+FULFILLED]=onFulfillment;_subscribers[length+REJECTED]=onRejection;if(length===0&&parent._state){_asap(_publish,parent);}};var _publish=function(promise){var subscribers=promise._subscribers;var settled
=promise._state;if(subscribers.length===0){return;}var child=void 0,callback=void 0,detail=promise._result;for(var i=0;i<subscribers.length;i+=3){child=subscribers[i];callback=subscribers[i+settled];if(child){_invokeCallback(settled,child,callback,detail);}else {callback(detail);}}promise._subscribers.length=0;};var _publishRejection=function(promise){if(promise._onerror){promise._onerror(promise._result);}_publish(promise);};var _fulfill=function(promise,value){if(promise._state!==PENDING){return;}promise._result
=value;promise._state=FULFILLED;if(promise._subscribers.length!==0){_asap(_publish,promise);}};var _invokeCallback=function(settled,promise,callback,detail){var hasCallback=typeof callback==="function",value=void 0,error=void 0,succeeded=true;if(hasCallback){try {value=callback(detail);}catch(e){succeeded=false;error=e;}if(promise===value){_reject(promise,new $rt_globals.TypeError("A promises callback cannot return that same promise."));return;}}else {value=detail;}if(promise._state!==PENDING){}else if(hasCallback
&&succeeded){__resolve(promise,value);}else if(succeeded===false){_reject(promise,error);}else if(settled===FULFILLED){_fulfill(promise,value);}else if(settled===REJECTED){_reject(promise,value);}};var _initializePromise=function(promise,resolver){try {resolver(function(value){__resolve(promise,value);},function(reason){_reject(promise,reason);});}catch(e){_reject(promise,e);}};var id=0;var _nextId=function(){return id++;};var _makePromise=function(promise){promise[PROMISE_ID]=id++;promise._state=$rt_globals.undefined;promise._result
=$rt_globals.undefined;promise._subscribers=[];};var Promise;Promise=namedFunction("Promise",function(resolver){this[PROMISE_ID]=_nextId();this._result=this._state=$rt_globals.undefined;this._subscribers=[];if(_noop!==resolver){typeof resolver!=='function'&&$rt_globals._needsResolver();this instanceof Promise?_initializePromise(this,resolver):$rt_globals._needsNew();}});var _then=namedFunction("then",function(onFulfillment,onRejection){var parent=this;var child=new this.constructor(_noop);if(child[PROMISE_ID]
===$rt_globals.undefined){_makePromise(child);}var _state=parent._state;if(_state){var callback=arguments[_state -1];_asap(function(){return _invokeCallback(_state,child,callback,parent._result);});}else {_subscribe(parent,child,onFulfillment,onRejection);}return child;});Promise.prototype.then=_then;Promise.prototype.catch=namedFunction("catch",function(onRejection){return this.then(null,onRejection);});Promise.prototype.finally=namedFunction("finally",function(callback){var promise=this;var constructor=promise.constructor;if
(typeof callback==="function"){return promise.then(function(value){return (constructor.resolve(callback())).then(function(){return value;});},function(reason){return (constructor.resolve(callback())).then(function(){throw reason;});});}return promise.then(callback,callback);});Promise.all=namedFunction("all",function(entries){throw new $rt_globals.Error("Promise.all is not included in the ES6 compatibility shim!");});Promise.race=namedFunction("race",function(entries){var Constructor=this;if(!$rt_globals.Array.isArray(entries))
{return new Constructor(function(_,reject){return reject(new $rt_globals.TypeError("You must pass an array to race."));});}else {return new Constructor(function(resolve,reject){var length=entries.length;for(var i=0;i<length;i++){(Constructor.resolve(entries[i])).then(resolve,reject);}});}});var _resolve=namedFunction("resolve",function(object){var Constructor=this;if(object&&typeof object==="object"&&object.constructor===Constructor){return object;}var promise=new Constructor(_noop);__resolve(promise,object);return promise;});Promise.resolve
=_resolve;Promise.reject=namedFunction("reject",function(reason){var Constructor=this;var promise=new Constructor(_noop);_reject(promise,reason);return promise;});return Promise;};var shim_Promise=function(){if(typeof Promise==="undefined"){Object.defineProperty(_jsGlobal,"Promise",{value:createPromiseShim()});return true;}else {return false;}};var shim_String_fromCodePoint=function(){if(typeof $rt_globals.String.fromCodePoint==="undefined"){Object.defineProperty($rt_globals.String,"fromCodePoint",{value:namedFunction("fromCodePoint",
function(codePoints){var result=[];var next;for(var i=0,length=arguments.length;i<length;i++){next=$rt_globals.Number(arguments[i]);if(next!==(next|0)||next<0||next>0x10FFFF){throw new $rt_globals.RangeError("Invalid code point "+next);}if(next<0x10000){result.push($rt_globals.String.fromCharCode(next));}else {next -=0x10000;result.push($rt_globals.String.fromCharCode((next>>10)+0xD800));result.push($rt_globals.String.fromCharCode(next%0x400+0xDC00));}}return result.join("");})});return true;}else {return false;}};var shim_String_proto_codePointAt
=function(){if(typeof $rt_globals.String.prototype.codePointAt==="undefined"){Object.defineProperty($rt_globals.String.prototype,"codePointAt",{value:namedFunction("codePointAt",function(pos){pos=pos|0;var leng=this.length;if(pos>=0&&pos<leng){var first=this.charCodeAt(pos);var isEnd=pos+1===leng;if(first<0xD800||first>0xDBFF||isEnd){return first;}var second=this.charCodeAt(pos+1);if(second<0xDC00||second>0xDFFF){return first;}return (first -0xD800)*1024+second -0xDC00+0x10000;}})});return true;}else {return false;}};var shim_String_proto_startsWith
=function(){if(typeof $rt_globals.String.prototype.startsWith==="undefined"){Object.defineProperty($rt_globals.String.prototype,"startsWith",{value:namedFunction("startsWith",function(str){var position=0;if(arguments.length>1){position=arguments[1];}var start=$rt_globals.Math.max(position,0)|0;return this.slice(start,start+str.length)===str;})});return true;}else {return false;}};var shim_String_proto_endsWith=function(){if(typeof $rt_globals.String.prototype.endsWith==="undefined"){Object.defineProperty($rt_globals.String.prototype,
"endsWith",{value:namedFunction("endsWith",function(str){var len=this.length;var endPosition;if(arguments.length>1){endPosition=arguments[1];}var pos=typeof endPosition==="undefined"?len:endPosition|0;var end=$rt_globals.Math.min($rt_globals.Math.max(pos,0)|0,len);return this.slice(end -str.length,end)===str;})});return true;}else {return false;}};var shim_String_proto_includes=function(){if(typeof $rt_globals.String.prototype.includes==="undefined"){Object.defineProperty($rt_globals.String.prototype,"includes",
{value:namedFunction("includes",function(str){var position;if(arguments.length>1){position=arguments[1];}return this.indexOf(str,position)!== -1;})});return true;}else {return false;}};var stringRepeatHelper;stringRepeatHelper=function(s,times){if(times<1){return '';}if(times%2){return stringRepeatHelper(s,times -1)+s;}var half=stringRepeatHelper(s,times/2);return half+half;};var shim_String_proto_repeat=function(){if(typeof $rt_globals.String.prototype.repeat==="undefined"){Object.defineProperty($rt_globals.String.prototype,
"repeat",{value:namedFunction("repeat",function(numTimes){if(numTimes>=$rt_globals.Infinity||(numTimes|=0)<0){throw new $rt_globals.RangeError("repeat count must be less than infinity and not overflow maximum string size");}return stringRepeatHelper(this,numTimes);})});return true;}else {return false;}};var shim_Object_is=function(){if(typeof Object.is==="undefined"){Object.defineProperty(Object,"is",{value:namedFunction("is",function(a,b){return a===b||a!==a&&b!==b;})});return true;}else {return false;}};var shim_Object_setPrototypeOf
=function(){if(typeof Object.setPrototypeOf==="undefined"){var theShim=function(Object,magic){var set;var checkArgs=function(O,proto){if(typeof O!=="object"||O===null){throw new $rt_globals.TypeError("can not set prototype on a non-object");}if(typeof proto!=="object"&&proto!==null){throw new $rt_globals.TypeError("can only set prototype to an object or null");}};var setPrototypeOf=function(O,proto){checkArgs(O,proto);set.call(O,proto);return O;};try {set=(Object.getOwnPropertyDescriptor(Object.prototype,magic)).set;set.call({
},null);}catch(o_O){if(Object.prototype!=={}[magic]||{__proto__:null}.__proto__===void 0){$rt_globals.console.error("ES6Shims: Can not shim Object.setPrototypeOf on this browser! Ignoring for now");return false;}set=function(proto){this[magic]=proto;};}return setPrototypeOf;}(Object,"__proto__");if(theShim){Object.defineProperty(Object,"setPrototypeOf",{value:namedFunction("setPrototypeOf",theShim)});return true;}else {return false;}}else {return false;}};var shim_Function_proto_name=function(){if($rt_globals.Math.max.name
!=="max"){Object.defineProperty($rt_globals.Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===$rt_globals.Function.prototype){return "";}var str=$rt_globals.Function.prototype.toString.call(this);var match=str.match(/\s*function\s+([^(\s]*)\s*/);var name=match&&match[1];Object.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:name});return name;}});return true;}else {return false;}};var shim_Math_sign=function(){if(typeof $rt_globals.Math.sign
==="undefined"){Object.defineProperty($rt_globals.Math,"sign",{value:namedFunction("sign",function(val){var number=$rt_globals.Number(val);if(number===0){return number;}if($rt_globals.isNaN(number)){return number;}return number<0? -1:1;})});return true;}else {return false;}};var shim_Symbol=function(){if(typeof $rt_globals.Symbol==="undefined"){Object.defineProperty(_jsGlobal,"Symbol",{value:function(){var symRet=namedFunction("Symbol",function(){return "[[ShimbolR_"+(($rt_globals.Math.random()).toString(36)).substring(2)
+"]]";});symRet.for=namedFunction("for",function(symName){if(!(typeof symName==="string"))return $rt_globals.undefined;return "[[ShimbolN_"+symName+"]]";});symRet.keyFor=namedFunction("keyFor",function(sym){return typeof sym==="string"&&sym.startsWith("[[ShimbolN_")&&sym.endsWith("]]")?sym.substring(11,sym.length -2):$rt_globals.undefined;});return symRet;}()});return true;}else {return false;}};var hasErrors=false;var shim_install=function(str,cb){try {return cb();}catch(_exx_){hasErrors=true;$rt_globals.console.error("ES6Shims: Failed to detect and enable shim \""
+str+"\" for this browser! (Continuing anyway)");$rt_globals.console.error(_exx_);return false;}};if(shim_install("Map",shim_Map))enabledShims.push(0);if(shim_install("WeakMap",shim_WeakMap))enabledShims.push(1);if(shim_install("Set",shim_Set))enabledShims.push(2);if(shim_install("WeakSet",shim_WeakSet))enabledShims.push(3);if(shim_install("Promise",shim_Promise))enabledShims.push(4);if(shim_install("String_fromCodePoint",shim_String_fromCodePoint))enabledShims.push(5);if(shim_install("String_proto_codePointAt",
shim_String_proto_codePointAt))enabledShims.push(6);if(shim_install("String_proto_startsWith",shim_String_proto_startsWith))enabledShims.push(7);if(shim_install("String_proto_endsWith",shim_String_proto_endsWith))enabledShims.push(8);if(shim_install("String_proto_includes",shim_String_proto_includes))enabledShims.push(9);if(shim_install("String_proto_repeat",shim_String_proto_repeat))enabledShims.push(10);if(shim_install("Object_is",shim_Object_is))enabledShims.push(12);if(shim_install("Object_setPrototypeOf",
shim_Object_setPrototypeOf))enabledShims.push(13);if(shim_install("Function_proto_name",shim_Function_proto_name))enabledShims.push(14);if(shim_install("Math_sign",shim_Math_sign))enabledShims.push(15);if(shim_install("Symbol",shim_Symbol))enabledShims.push(16);var enCnt=enabledShims.length;_jsGlobal.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return (enCnt>0?1:0)|(hasErrors?2:0);},getEnabledShimCount:function(){return enCnt;},getEnabledShimID:function(idxIn){return enabledShims[idxIn];}};})();}
catch(_ex_){$rt_globals.console.error("ES6Shims: Failed to detect and enable shims for this browser! (Continuing anyway)");$rt_globals.console.error(_ex_);_jsGlobal.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return -1;},getEnabledShimCount:function(){return 0;},getEnabledShimID:function(idxIn){return $rt_globals.undefined;}};}})($rt_globals);

View File

@ -171,7 +171,7 @@ public class BootMenuMain {
}
}
}
EagUtils.sleep(50l);
EagUtils.sleep(50);
}
}

View File

@ -242,7 +242,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMain("eaglercraftXOpts", launchOptsStr, "main", blockUnsigned);
@ -409,7 +409,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMain("eaglercraftOpts", launchOptsStr, "main", blockUnsigned);
@ -464,7 +464,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMainOld15("minecraftOpts", container, assetsEPKURL.toExternalForm(), b64Opts, launchConf.joinServer, "main", blockUnsigned);
@ -538,7 +538,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMainOldB13("minecraftOpts", container, assetsEPKURL.toExternalForm(), launchConf.joinServer, "main", blockUnsigned);
@ -595,7 +595,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMain("config", launchOptsStr, "main", blockUnsigned);
@ -649,7 +649,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMainOldB13("classicConfig", container, assetsEPKURL.toExternalForm(), "", "main", blockUnsigned);
@ -710,7 +710,7 @@ public class ClientBootFactory {
BootMenuMain.runLater(() -> {
while(!isMainReady("main")) {
logger.error("main function is not available yet! waiting 250ms...");
EagUtils.sleep(250l);
EagUtils.sleep(250);
}
BootMenuMain.stopEventLoop();
callMain(launchConf.launchOptsVar, launchOptsStr, launchConf.mainFunction, blockUnsigned);

View File

@ -87,7 +87,7 @@ public class MenuPopupStateLoading extends MenuState implements IProgressMsgCall
public void updateMessage(String msg) {
this.msg = msg;
BootMenuMain.bootMenuDOM.popup_confirm_title.setInnerText(!StringUtils.isAllEmpty(msg) ? (text + "\n\n" + msg) : text);
EagUtils.sleep(50l);
EagUtils.sleep(50);
}
@Override

View File

@ -279,7 +279,7 @@ public class MenuStateBoot extends MenuState {
if(res != null) {
MenuPopupStateLoading loadingScreen = new MenuPopupStateLoading("Importing client...");
MenuStateBoot.this.changePopupState(loadingScreen);
EagUtils.sleep(50l);
EagUtils.sleep(50);
String offlineData = new String(res.fileData, StandardCharsets.UTF_8).replace("\r\n", "\n");
EnumOfflineParseType parseType2 = parseTypeF;
if(parseType2 == null) {

View File

@ -117,7 +117,7 @@ public class PlatformApplication {
@JSBody(params = { "cb" }, script = "if(!navigator.clipboard) { cb(prompt(\"Please enter the text to paste:\") || \"\"); } else if (!navigator.clipboard.readText) cb(\"\"); else navigator.clipboard.readText().then(function(s) { cb(s); }, function(s) { cb(\"\"); });")
private static native void getClipboard1(StupidFunctionResolveString cb);
@JSBody(params = { "str" }, script = "if(navigator.clipboard) clipboard.writeText(str);")
@JSBody(params = { "str" }, script = "if(navigator.clipboard) navigator.clipboard.writeText(str);")
private static native void setClipboard0(String str);
public static void setLocalStorage(String name, byte[] data) {

View File

@ -119,6 +119,7 @@ public class PlatformAudio {
public void restart() {
if(isEnded) {
isEnded = false;
isPaused = false;
AudioBufferSourceNode src = audioctx.createBufferSource();
resource.cacheHit = PlatformRuntime.steadyTimeMillis();
src.setBuffer(resource.buffer);
@ -302,13 +303,11 @@ public class PlatformAudio {
}
gameRecGain = audioctx.createGain();
gameRecGain.getGain().setValue(gameVol);
synchronized(activeSounds) {
for(BrowserAudioHandle handle : activeSounds) {
if(handle.panner != null) {
handle.panner.connect(gameRecGain);
}else {
handle.gain.connect(gameRecGain);
}
for(BrowserAudioHandle handle : activeSounds) {
if(handle.panner != null) {
handle.panner.connect(gameRecGain);
}else {
handle.gain.connect(gameRecGain);
}
}
PlatformVoiceClient.addRecordingDest(gameRecGain);
@ -341,16 +340,14 @@ public class PlatformAudio {
gameRecGain.disconnect();
}catch(Throwable t) {
}
synchronized(activeSounds) {
for(BrowserAudioHandle handle : activeSounds) {
try {
if(handle.panner != null) {
handle.panner.disconnect(gameRecGain);
}else {
handle.gain.disconnect(gameRecGain);
}
}catch(Throwable t) {
for(BrowserAudioHandle handle : activeSounds) {
try {
if(handle.panner != null) {
handle.panner.disconnect(gameRecGain);
}else {
handle.gain.disconnect(gameRecGain);
}
}catch(Throwable t) {
}
}
PlatformVoiceClient.removeRecordingDest(gameRecGain);
@ -361,18 +358,13 @@ public class PlatformAudio {
}
public static IAudioResource loadAudioData(String filename, boolean holdInCache) {
BrowserAudioResource buffer;
synchronized(soundCache) {
buffer = soundCache.get(filename);
}
BrowserAudioResource buffer = soundCache.get(filename);
if(buffer == null) {
byte[] file = PlatformAssets.getResourceBytes(filename);
if(file == null) return null;
buffer = new BrowserAudioResource(decodeAudioData(file, filename));
if(holdInCache) {
synchronized(soundCache) {
soundCache.put(filename, buffer);
}
soundCache.put(filename, buffer);
}
}
if(buffer.buffer != null) {
@ -383,23 +375,14 @@ public class PlatformAudio {
}
}
public static interface IAudioCacheLoader {
byte[] loadFile(String filename);
}
public static IAudioResource loadAudioDataNew(String filename, boolean holdInCache, IAudioCacheLoader loader) {
BrowserAudioResource buffer;
synchronized(soundCache) {
buffer = soundCache.get(filename);
}
BrowserAudioResource buffer = soundCache.get(filename);
if(buffer == null) {
byte[] file = loader.loadFile(filename);
if(file == null) return null;
buffer = new BrowserAudioResource(decodeAudioData(file, filename));
if(holdInCache) {
synchronized(soundCache) {
soundCache.put(filename, buffer);
}
soundCache.put(filename, buffer);
}
}
if(buffer.buffer != null) {
@ -457,35 +440,27 @@ public class PlatformAudio {
long millis = PlatformRuntime.steadyTimeMillis();
if(millis - cacheFreeTimer > 30000l) {
cacheFreeTimer = millis;
synchronized(soundCache) {
Iterator<BrowserAudioResource> itr = soundCache.values().iterator();
while(itr.hasNext()) {
if(millis - itr.next().cacheHit > 600000l) { // 10 minutes
itr.remove();
}
Iterator<BrowserAudioResource> itr = soundCache.values().iterator();
while(itr.hasNext()) {
if(millis - itr.next().cacheHit > 600000l) { // 10 minutes
itr.remove();
}
}
}
if(millis - activeFreeTimer > 700l) {
activeFreeTimer = millis;
synchronized(activeSounds) {
Iterator<BrowserAudioHandle> itr = activeSounds.iterator();
while(itr.hasNext()) {
if(itr.next().shouldFree()) {
itr.remove();
}
Iterator<BrowserAudioHandle> itr = activeSounds.iterator();
while(itr.hasNext()) {
if(itr.next().shouldFree()) {
itr.remove();
}
}
}
}
public static void flushAudioCache() {
synchronized(soundCache) {
soundCache.clear();
}
synchronized(activeSounds) {
activeSounds.clear();
}
soundCache.clear();
activeSounds.clear();
}
public static boolean available() {
@ -529,9 +504,7 @@ public class PlatformAudio {
src.start();
BrowserAudioHandle ret = new BrowserAudioHandle(internalTrack, src, panner, gain, pitch);
synchronized(activeSounds) {
activeSounds.add(ret);
}
activeSounds.add(ret);
return ret;
}
@ -557,9 +530,7 @@ public class PlatformAudio {
src.start();
BrowserAudioHandle ret = new BrowserAudioHandle(internalTrack, src, null, gain, pitch);
synchronized(activeSounds) {
activeSounds.add(ret);
}
activeSounds.add(ret);
return ret;
}
@ -574,7 +545,7 @@ public class PlatformAudio {
}
static void destroy() {
soundCache.clear();
flushAudioCache();
if(audioctx != null) {
audioctx.close();
audioctx = null;

View File

@ -37,6 +37,7 @@ import org.teavm.jso.gamepad.Gamepad;
import org.teavm.jso.gamepad.GamepadButton;
import org.teavm.jso.gamepad.GamepadEvent;
import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen;
@ -883,6 +884,12 @@ public class PlatformInput {
static native double getDevicePixelRatio(Window win);
public static void update() {
update(0);
}
private static final long[] syncTimer = new long[1];
public static void update(int fpsLimit) {
double r = getDevicePixelRatio(win);
if(r < 0.01) r = 1.0;
windowDPI = (float)r;
@ -934,12 +941,21 @@ public class PlatformInput {
PlatformScreenRecord.captureFrameHook();
if(getVisibilityState(win.getDocument())) {
if(vsyncSupport && vsync) {
syncTimer[0] = 0l;
asyncRequestAnimationFrame();
}else {
PlatformRuntime.swapDelayTeaVM();
if(fpsLimit <= 0) {
syncTimer[0] = 0l;
PlatformRuntime.swapDelayTeaVM();
}else {
if(!Display.sync(fpsLimit, syncTimer)) {
PlatformRuntime.swapDelayTeaVM();
}
}
}
}else {
EagUtils.sleep(50l);
syncTimer[0] = 0l;
EagUtils.sleep(50);
}
}
@ -1177,6 +1193,10 @@ public class PlatformInput {
enableRepeatEvents = b;
}
public static boolean keyboardAreKeysLocked() {
return lockKeys;
}
public static boolean mouseNext() {
currentEvent = null;
synchronized(mouseEvents) {
@ -1262,7 +1282,7 @@ public class PlatformInput {
}
public static boolean mouseIsButtonDown(int i) {
return buttonStates[i];
return (i < 0 || i >= buttonStates.length) ? false : buttonStates[i];
}
public static int mouseGetDWheel() {
@ -1553,7 +1573,7 @@ public class PlatformInput {
EarlyLoadScreen.paintEnable(PlatformOpenGL.checkVAOCapable(), allowBootMenu);
while(mouseEvents.isEmpty() && keyEvents.isEmpty() && touchEvents.isEmpty()) {
EagUtils.sleep(100l);
EagUtils.sleep(100);
}
}
}
@ -1720,13 +1740,13 @@ public class PlatformInput {
}
@JSBody(params = { "doc" }, script = "doc.exitFullscreen();")
private static native void exitFullscreen(HTMLDocument doc);
private static native void exitFullscreen(HTMLDocument doc);
@JSBody(params = { "doc" }, script = "doc.webkitExitFullscreen();")
private static native void webkitExitFullscreen(HTMLDocument doc);
private static native void webkitExitFullscreen(HTMLDocument doc);
@JSBody(params = { "doc" }, script = "doc.mozCancelFullscreen();")
private static native void mozCancelFullscreen(HTMLDocument doc);
private static native void mozCancelFullscreen(HTMLDocument doc);
public static void showCursor(EnumCursorType cursor) {
switch(cursor) {
@ -1843,20 +1863,13 @@ public class PlatformInput {
return ret != null ? ret.intValue() : -1;
};
public static void touchBufferFlush() {
pointerLockSupported = 0;
pointerLockFlag = true;
currentTouchState = null;
touchEvents.clear();
}
// Note: this can't be called from the main loop, don't try
private static void touchOpenDeviceKeyboard() {
if(!touchIsDeviceKeyboardOpenMAYBE()) {
if(touchKeyboardField != null) {
touchKeyboardField.blur();
touchKeyboardField.setValue("");
EagUtils.sleep(10l);
EagUtils.sleep(10);
if(touchKeyboardForm != null) {
touchKeyboardForm.removeChild(touchKeyboardField);
}else {
@ -2127,7 +2140,7 @@ public class PlatformInput {
touchKeyboardField.blur();
touchKeyboardField.setValue("");
if(sync) {
EagUtils.sleep(10l);
EagUtils.sleep(10);
if(touchKeyboardForm != null) {
touchKeyboardForm.removeChild(touchKeyboardField);
}else {

View File

@ -469,10 +469,10 @@ public class PlatformOpenGL {
data == null ? null : EaglerArrayBufferAllocator.getDataView8Unsigned(data));
}
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width,
public static final void _wglTexImage2Df32(int target, int level, int internalFormat, int width,
int height, int border, int format, int type, FloatBuffer data) {
ctx.texImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? null : EaglerArrayBufferAllocator.getDataView8Unsigned(data));
data == null ? null : EaglerArrayBufferAllocator.getDataView32F(data));
}
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset,
@ -493,10 +493,10 @@ public class PlatformOpenGL {
data == null ? null : EaglerArrayBufferAllocator.getDataView8Unsigned(data));
}
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset,
public static final void _wglTexSubImage2Df32(int target, int level, int xoffset, int yoffset,
int width, int height, int format, int type, FloatBuffer data) {
ctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
data == null ? null : EaglerArrayBufferAllocator.getDataView8Unsigned(data));
data == null ? null : EaglerArrayBufferAllocator.getDataView32F(data));
}
public static final void _wglCopyTexSubImage2D(int target, int level, int xoffset, int yoffset,
@ -517,19 +517,19 @@ public class PlatformOpenGL {
}
public static final void _wglShaderSource(IShaderGL obj, String source) {
ctx.shaderSource(obj == null ? null : ((OpenGLObjects.ShaderGL)obj).ptr, source);
ctx.shaderSource(((OpenGLObjects.ShaderGL)obj).ptr, source);
}
public static final void _wglCompileShader(IShaderGL obj) {
ctx.compileShader(obj == null ? null : ((OpenGLObjects.ShaderGL)obj).ptr);
ctx.compileShader(((OpenGLObjects.ShaderGL)obj).ptr);
}
public static final int _wglGetShaderi(IShaderGL obj, int param) {
return ctx.getShaderParameteri(obj == null ? null : ((OpenGLObjects.ShaderGL)obj).ptr, param);
return ctx.getShaderParameteri(((OpenGLObjects.ShaderGL)obj).ptr, param);
}
public static final String _wglGetShaderInfoLog(IShaderGL obj) {
return ctx.getShaderInfoLog(obj == null ? null : ((OpenGLObjects.ShaderGL)obj).ptr);
return ctx.getShaderInfoLog(((OpenGLObjects.ShaderGL)obj).ptr);
}
public static final void _wglUseProgram(IProgramGL obj) {
@ -537,33 +537,31 @@ public class PlatformOpenGL {
}
public static final void _wglAttachShader(IProgramGL obj, IShaderGL shader) {
ctx.attachShader(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr,
shader == null ? null : ((OpenGLObjects.ShaderGL)shader).ptr);
ctx.attachShader(((OpenGLObjects.ProgramGL)obj).ptr, ((OpenGLObjects.ShaderGL)shader).ptr);
}
public static final void _wglDetachShader(IProgramGL obj, IShaderGL shader) {
ctx.detachShader(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr,
shader == null ? null : ((OpenGLObjects.ShaderGL)shader).ptr);
ctx.detachShader(((OpenGLObjects.ProgramGL)obj).ptr, ((OpenGLObjects.ShaderGL)shader).ptr);
}
public static final void _wglLinkProgram(IProgramGL obj) {
ctx.linkProgram(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr);
ctx.linkProgram(((OpenGLObjects.ProgramGL)obj).ptr);
}
public static final int _wglGetProgrami(IProgramGL obj, int param) {
return ctx.getProgramParameteri(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr, param);
return ctx.getProgramParameteri(((OpenGLObjects.ProgramGL)obj).ptr, param);
}
public static final String _wglGetProgramInfoLog(IProgramGL obj) {
return ctx.getProgramInfoLog(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr);
return ctx.getProgramInfoLog(((OpenGLObjects.ProgramGL)obj).ptr);
}
public static final void _wglBindAttribLocation(IProgramGL obj, int index, String name) {
ctx.bindAttribLocation(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr, index, name);
ctx.bindAttribLocation(((OpenGLObjects.ProgramGL)obj).ptr, index, name);
}
public static final int _wglGetAttribLocation(IProgramGL obj, String name) {
return ctx.getAttribLocation(obj == null ? null : ((OpenGLObjects.ProgramGL)obj).ptr, name);
return ctx.getAttribLocation(((OpenGLObjects.ProgramGL)obj).ptr, name);
}
public static final void _wglDrawArrays(int mode, int first, int count) {
@ -571,13 +569,13 @@ public class PlatformOpenGL {
//checkErr("_wglDrawArrays(" + mode + ", " + first + ", " + count + ");");
}
public static final void _wglDrawArraysInstanced(int mode, int first, int count, int instanced) {
public static final void _wglDrawArraysInstanced(int mode, int first, int count, int instances) {
switch(instancingImpl) {
case INSTANCE_IMPL_CORE:
ctx.drawArraysInstanced(mode, first, count, instanced);
ctx.drawArraysInstanced(mode, first, count, instances);
break;
case INSTANCE_IMPL_ANGLE:
ANGLEInstancedArrays.drawArraysInstancedANGLE(mode, first, count, instanced);
ANGLEInstancedArrays.drawArraysInstancedANGLE(mode, first, count, instances);
break;
default:
throw new UnsupportedOperationException();
@ -590,13 +588,13 @@ public class PlatformOpenGL {
//checkErr("_wglDrawElements(" + mode + ", " + count + ", " + type + ", " + offset + ");");
}
public static final void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instanced) {
public static final void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instances) {
switch(instancingImpl) {
case INSTANCE_IMPL_CORE:
ctx.drawElementsInstanced(mode, count, type, offset, instanced);
ctx.drawElementsInstanced(mode, count, type, offset, instances);
break;
case INSTANCE_IMPL_ANGLE:
ANGLEInstancedArrays.drawElementsInstancedANGLE(mode, count, type, offset, instanced);
ANGLEInstancedArrays.drawElementsInstancedANGLE(mode, count, type, offset, instances);
break;
default:
throw new UnsupportedOperationException();
@ -708,13 +706,11 @@ public class PlatformOpenGL {
public static final void _wglFramebufferTexture2D(int target, int attachment, int texTarget,
ITextureGL texture, int level) {
ctx.framebufferTexture2D(target, attachment, texTarget,
texture == null ? null : ((OpenGLObjects.TextureGL)texture).ptr, level);
ctx.framebufferTexture2D(target, attachment, texTarget, ((OpenGLObjects.TextureGL)texture).ptr, level);
}
public static final void _wglFramebufferTextureLayer(int target, int attachment, ITextureGL texture, int level, int layer) {
ctx.framebufferTextureLayer(target, attachment,
texture == null ? null : ((OpenGLObjects.TextureGL) texture).ptr, level, layer);
ctx.framebufferTextureLayer(target, attachment, ((OpenGLObjects.TextureGL) texture).ptr, level, layer);
}
public static final void _wglBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1,

View File

@ -12,7 +12,6 @@ import java.util.Set;
import java.util.function.Consumer;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.Filesystem;
@ -37,6 +36,8 @@ import org.teavm.jso.dom.xml.Node;
import org.teavm.jso.dom.xml.NodeList;
import org.teavm.jso.typedarrays.ArrayBuffer;
import org.teavm.jso.webgl.WebGLFramebuffer;
import org.teavm.platform.Platform;
import org.teavm.platform.PlatformRunnable;
import com.google.common.collect.Collections2;
import com.google.common.collect.Iterators;
@ -172,11 +173,12 @@ public class PlatformRuntime {
logger.info("Creating main game canvas");
root = doc.getElementById(ClientMain.configRootElementId);
root.getClassList().add("_eaglercraftX_root_element");
if(root == null) {
throw new RuntimeInitializationFailureException("Root element \"" + ClientMain.configRootElementId + "\" was not found in this document!");
}
root.getClassList().add("_eaglercraftX_root_element");
Node nodeler;
while((nodeler = root.getLastChild()) != null && TeaVMUtils.isTruthy(nodeler)) {
root.removeChild(nodeler);
@ -748,7 +750,7 @@ public class PlatformRuntime {
if(!useDelayOnSwap && immediateContinueSupport) {
immediateContinueTeaVM0();
}else {
EagUtils.sleep(0l);
sleep(0);
}
}
@ -756,7 +758,7 @@ public class PlatformRuntime {
if(immediateContinueSupport) {
immediateContinueTeaVM0();
}else {
EagUtils.sleep(0l);
sleep(0);
}
}
@ -890,7 +892,7 @@ public class PlatformRuntime {
immediateContinueChannel = null;
return IMMEDIATE_CONT_FAILED_NOT_ASYNC;
}
EagUtils.sleep(10l);
sleep(10);
currentMsgChannelContinueHack = null;
if(!checkMe[0]) {
if(immediateContinueChannel != null) {
@ -945,7 +947,7 @@ public class PlatformRuntime {
currentLegacyContinueHack = null;
return IMMEDIATE_CONT_FAILED_NOT_ASYNC;
}
EagUtils.sleep(10l);
sleep(10);
currentLegacyContinueHack = null;
if(!checkMe[0]) {
return IMMEDIATE_CONT_FAILED_NOT_CONT;
@ -1103,6 +1105,24 @@ public class PlatformRuntime {
return (long)(steadyTimeMillis0(steadyTimeFunc) * 1000000.0);
}
@Async
public static native void sleep(int millis);
private static void sleep(int millis, final AsyncCallback<Void> callback) {
Platform.schedule(new DumbSleepHandler(callback), millis);
}
private static class DumbSleepHandler implements PlatformRunnable {
private final AsyncCallback<Void> callback;
private DumbSleepHandler(AsyncCallback<Void> callback) {
this.callback = callback;
}
@Override
public void run() {
callback.complete(null);
}
}
static void checkBootMenu() {
while(PlatformInput.keyboardNext()) {
if(PlatformInput.keyboardGetEventKeyState()) {

View File

@ -2,6 +2,7 @@ package net.lax1dude.eaglercraft.v1_8.internal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Set;
@ -49,7 +50,7 @@ public class PlatformScreenRecord {
static Window win;
static HTMLCanvasElement canvas;
static boolean support;
static final Set<EnumScreenRecordingCodec> supportedCodecs = new HashSet<>();
static final Set<EnumScreenRecordingCodec> supportedCodecs = EnumSet.noneOf(EnumScreenRecordingCodec.class);
static float currentGameVolume = 1.0f;
static float currentMicVolume = 0.0f;
static MediaStream recStream = null;

View File

@ -218,7 +218,7 @@ public class ClientMain {
systemOut.println("ClientMain: [INFO] launching eaglercraftx main thread");
try {
Main.appMain(new String[0]);
Main.appMain();
}catch(Throwable t) {
systemErr.println("ClientMain: [ERROR] unhandled exception caused main thread to exit");
EagRuntime.debugPrintStackTraceToSTDERR(t);

View File

@ -199,7 +199,7 @@ public class EarlyLoadScreen {
_wglDisableVertexAttribArray(0);
PlatformInput.update();
EagUtils.sleep(50l); // allow webgl to flush
EagUtils.sleep(50); // allow webgl to flush
_wglUseProgram(null);
_wglBindBuffer(GL_ARRAY_BUFFER, null);
@ -266,7 +266,7 @@ public class EarlyLoadScreen {
_wglDisableVertexAttribArray(0);
PlatformInput.update();
EagUtils.sleep(50l); // allow webgl to flush
EagUtils.sleep(50); // allow webgl to flush
_wglUseProgram(null);
_wglBindBuffer(GL_ARRAY_BUFFER, null);
@ -351,7 +351,7 @@ public class EarlyLoadScreen {
}
PlatformInput.update();
EagUtils.sleep(50l); // allow webgl to flush
EagUtils.sleep(50); // allow webgl to flush
_wglUseProgram(null);
if(!(vaos && softVAOs)) {

View File

@ -90,8 +90,8 @@ public class JOrbisAudioBufferDecoder {
logger.warn("[{}]: Number of channels in header does not match the stream", errorString);
}
if(ch == -1 || len == 0) {
logger.warn("[{}]: Empty file", errorString);
return ctx.createBuffer(ch, 0, dec.jorbisInfo.rate);
logger.error("[{}]: Empty file", errorString);
return null;
}
switch(loadVia) {
case LOAD_VIA_AUDIOBUFFER: {

View File

@ -47,6 +47,7 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter, IBootMenu
private String worldsDB = "worlds";
private String resourcePacksDB = "resourcePacks";
private JSONObject integratedServerOpts;
private boolean checkGLErrors = false;
private boolean checkShaderGLErrors = false;
private boolean demoMode = EaglercraftVersion.forceDemoMode;
private boolean isAllowUpdateSvc = EaglercraftVersion.enableUpdateService;
@ -97,6 +98,7 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter, IBootMenu
serverToJoin = eaglercraftXOpts.getJoinServer(null);
worldsDB = eaglercraftXOpts.getWorldsDB("worlds");
resourcePacksDB = eaglercraftXOpts.getResourcePacksDB("resourcePacks");
checkGLErrors = eaglercraftXOpts.getCheckGLErrors(false);
checkShaderGLErrors = eaglercraftXOpts.getCheckShaderGLErrors(false);
demoMode = EaglercraftVersion.forceDemoMode || eaglercraftXOpts.getDemoMode(false);
isAllowUpdateSvc = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftXOpts.getAllowUpdateSvc(true);
@ -224,6 +226,7 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter, IBootMenu
serverToJoin = eaglercraftOpts.optString("joinServer", null);
worldsDB = eaglercraftOpts.optString("worldsDB", "worlds");
resourcePacksDB = eaglercraftOpts.optString("resourcePacksDB", "resourcePacks");
checkGLErrors = eaglercraftOpts.optBoolean("checkGLErrors", false);
checkShaderGLErrors = eaglercraftOpts.optBoolean("checkShaderGLErrors", false);
if(EaglercraftVersion.forceDemoMode) {
eaglercraftOpts.put("demoMode", true);
@ -361,6 +364,11 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter, IBootMenu
return relays;
}
@Override
public boolean isCheckGLErrors() {
return checkGLErrors;
}
@Override
public boolean isCheckShaderGLErrors() {
return checkShaderGLErrors;
@ -553,6 +561,7 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter, IBootMenu
jsonObject.put("joinServer", serverToJoin);
jsonObject.put("worldsDB", worldsDB);
jsonObject.put("resourcePacksDB", resourcePacksDB);
jsonObject.put("checkGLErrors", checkGLErrors);
jsonObject.put("checkShaderGLErrors", checkShaderGLErrors);
jsonObject.put("demoMode", demoMode);
jsonObject.put("allowUpdateSvc", isAllowUpdateSvc);

View File

@ -139,7 +139,7 @@ public class TeaVMUpdateThread implements Runnable {
if(b == null) {
updateProg.progressBar = 1.0f;
updateProg.statusString3 = "FAILED!";
EagUtils.sleep(300l);
EagUtils.sleep(300);
updateProg.progressBar = -1.0f;
updateProg.statusString3 = null;
continue;
@ -155,7 +155,7 @@ public class TeaVMUpdateThread implements Runnable {
}
updateProg.statusString2 = "Signature Invalid!";
logger.error("File signature is invalid: {}", url);
EagUtils.sleep(1000l);
EagUtils.sleep(1000);
}
updateProg.progressBar = -1.0f;

View File

@ -1,10 +1,8 @@
package net.lax1dude.eaglercraft.v1_8.internal.teavm;
import org.teavm.jso.JSBody;
import org.teavm.jso.dom.events.Event;
import org.teavm.jso.dom.events.EventListener;
import org.teavm.jso.dom.events.MessageEvent;
import org.teavm.jso.typedarrays.ArrayBuffer;
import org.teavm.jso.websocket.WebSocket;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
@ -73,7 +71,7 @@ public class TeaVMWebSocketClient extends AbstractWebSocketClient {
public boolean connectBlocking(int timeoutMS) {
long startTime = PlatformRuntime.steadyTimeMillis();
while(!sockIsConnected && !sockIsFailed) {
EagUtils.sleep(50l);
EagUtils.sleep(50);
if(PlatformRuntime.steadyTimeMillis() - startTime > timeoutMS * 1000) {
break;
}
@ -112,13 +110,10 @@ public class TeaVMWebSocketClient extends AbstractWebSocketClient {
}
}
@JSBody(params = { "sock", "buffer" }, script = "sock.send(buffer);")
protected static native void nativeBinarySend(WebSocket sock, ArrayBuffer buffer);
@Override
public void send(byte[] bytes) {
if(sockIsConnected) {
nativeBinarySend(sock, TeaVMUtils.unwrapArrayBuffer(bytes));
sock.send(TeaVMUtils.unwrapArrayBuffer(bytes));
}
}

View File

@ -54,6 +54,9 @@ public abstract class JSEaglercraftXOptsRoot implements JSObject {
@JSBody(script = "return (typeof this.relays === \"object\") ? this.relays : null;")
public native JSArrayReader<JSEaglercraftXOptsRelay> getRelays();
@JSBody(params = { "def" }, script = "return (typeof this.checkGLErrors === \"boolean\") ? this.checkGLErrors : def;")
public native boolean getCheckGLErrors(boolean defaultValue);
@JSBody(params = { "def" }, script = "return (typeof this.checkShaderGLErrors === \"boolean\") ? this.checkShaderGLErrors : def;")
public native boolean getCheckShaderGLErrors(boolean defaultValue);

View File

@ -216,7 +216,7 @@ public class ServerPlatformSingleplayer {
logger.error("Fast immediate continue will be disabled for server context due to actually continuing immediately");
return;
}
EagUtils.sleep(10l);
EagUtils.sleep(10);
currentContinueHack = null;
if(!checkMe[0]) {
if(immediateContinueChannel != null) {
@ -255,7 +255,7 @@ public class ServerPlatformSingleplayer {
if(immediateContinueSupport) {
immediateContinueTeaVM();
}else {
EagUtils.sleep(0l);
EagUtils.sleep(0);
}
}
}