Skip to content

Commit

Permalink
Fix os.epoch("ingame") throwing "Unsupported operation"
Browse files Browse the repository at this point in the history
Fixes #123
  • Loading branch information
toad-dev committed Sep 5, 2022
1 parent 55625c7 commit e67f111
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/dan200/computercraft/core/apis/OSAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public final int day( Optional<String> 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
Expand All @@ -418,7 +418,7 @@ public final int day( Optional<String> args ) throws LuaException
@LuaFunction
public final long epoch( Optional<String> args ) throws LuaException
{
switch( args.orElse( "dan200.computercraft.ingame" ).toLowerCase( Locale.ROOT ) )
switch( args.orElse( "ingame" ).toLowerCase( Locale.ROOT ) )
{
case "utc":
{
Expand All @@ -432,7 +432,7 @@ public final long epoch( Optional<String> args ) throws LuaException
Calendar c = Calendar.getInstance();
return getEpochForCalendar( c );
}
case "dan200.computercraft.ingame":
case "ingame":
// Get in-game epoch
synchronized( alarms )
{
Expand Down

0 comments on commit e67f111

Please sign in to comment.