From e67f111ec4dbb9c5575a286b262241ee5e2762e5 Mon Sep 17 00:00:00 2001 From: toad-dev <748280+toad-dev@users.noreply.github.com> Date: Sun, 4 Sep 2022 18:12:11 -0700 Subject: [PATCH] Fix os.epoch("ingame") throwing "Unsupported operation" Fixes #123 --- src/main/java/dan200/computercraft/core/apis/OSAPI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/dan200/computercraft/core/apis/OSAPI.java b/src/main/java/dan200/computercraft/core/apis/OSAPI.java index de91b75cb..632646b16 100644 --- a/src/main/java/dan200/computercraft/core/apis/OSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/OSAPI.java @@ -403,7 +403,7 @@ public final int day( Optional args ) throws LuaException * * If called with {@code local}, returns the number of milliseconds since 1 * January 1970 in the server's local timezone. * - * @param args The locale to get the milliseconds for. Defaults to {@code dan200.computercraft.ingame} if not set. + * @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set. * @return The milliseconds since the epoch depending on the selected locale. * @throws LuaException If an invalid locale is passed. * @cc.since 1.80pr1 @@ -418,7 +418,7 @@ public final int day( Optional args ) throws LuaException @LuaFunction public final long epoch( Optional args ) throws LuaException { - switch( args.orElse( "dan200.computercraft.ingame" ).toLowerCase( Locale.ROOT ) ) + switch( args.orElse( "ingame" ).toLowerCase( Locale.ROOT ) ) { case "utc": { @@ -432,7 +432,7 @@ public final long epoch( Optional args ) throws LuaException Calendar c = Calendar.getInstance(); return getEpochForCalendar( c ); } - case "dan200.computercraft.ingame": + case "ingame": // Get in-game epoch synchronized( alarms ) {