1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 12:10:30 +00:00

Merge branch 'mc-1.18.x' into mc-1.19.x

This commit is contained in:
Jonathan Coates 2022-10-14 22:09:13 +01:00
commit bc79100a2f
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
10 changed files with 69 additions and 9 deletions

View File

@ -53,4 +53,4 @@ the generated documentation [can be browsed online](https://tweaked.cc/javadoc/)
[ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge"
[forum]: https://forums.computercraft.cc/
[GitHub Discussions]: https://github.com/cc-tweaked/CC-Tweaked/discussions
[IRC]: http://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"
[IRC]: https://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"

View File

@ -157,7 +157,7 @@ dependencies {
extraModsRuntimeOnly fg.deobf("mezz.jei:jei-1.19.2-forge:11.3.0.262")
extraModsCompileOnly fg.deobf("maven.modrinth:oculus:1.2.5")
shade 'org.squiddev:Cobalt:0.5.5'
shade 'org.squiddev:Cobalt:0.5.7'
shade 'io.netty:netty-codec-http:4.1.76.Final'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'

View File

@ -201,4 +201,4 @@ This is, I'm afraid, left as an exercise to the reader.
[Ring Buffer]: https://en.wikipedia.org/wiki/Circular_buffer "Circular buffer - Wikipedia"
[Sine Wave]: https://en.wikipedia.org/wiki/Sine_wave "Sine wave - Wikipedia"
[GitHub Discussions]: https://github.com/cc-tweaked/CC-Tweaked/discussions
[IRC]: http://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"
[IRC]: https://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"

View File

@ -51,4 +51,4 @@ CC: Tweaked lives on [GitHub]. If you've got any ideas, feedback or bugs please
[ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge"
[lua]: https://www.lua.org/ "Lua's main website"
[GitHub Discussions]: https://github.com/cc-tweaked/CC-Tweaked/discussions
[IRC]: http://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"
[IRC]: https://webchat.esper.net/?channels=computercraft "#computercraft on EsperNet"

View File

@ -625,6 +625,15 @@ final class ComputerExecutor
}
}
void printState( StringBuilder out )
{
out.append( "Enqueued command: " ).append( command ).append( '\n' );
out.append( "Enqueued events: " ).append( eventQueue.size() ).append( '\n' );
ILuaMachine machine = this.machine;
if( machine != null ) machine.printExecutionState( out );
}
private void displayFailure( String message, String extra )
{
Terminal terminal = computer.getTerminal();

View File

@ -575,18 +575,22 @@ public final class ComputerThread
StringBuilder builder = new StringBuilder()
.append( "Terminating computer #" ).append( executor.getComputer().getID() )
.append( " due to timeout (running for " ).append( time * 1e-9 )
.append( " seconds). This is NOT a bug, but may mean a computer is misbehaving. " )
.append( " seconds). This is NOT a bug, but may mean a computer is misbehaving.\n" )
.append( "Thread " )
.append( owner.getName() )
.append( " is currently " )
.append( owner.getState() );
.append( owner.getState() )
.append( '\n' );
Object blocking = LockSupport.getBlocker( owner );
if( blocking != null ) builder.append( "\n on " ).append( blocking );
if( blocking != null ) builder.append( " on " ).append( blocking ).append( '\n' );
for( StackTraceElement element : owner.getStackTrace() )
{
builder.append( "\n at " ).append( element );
builder.append( " at " ).append( element ).append( '\n' );
}
executor.printState( builder );
ComputerCraft.log.warn( builder.toString() );
}
}

View File

@ -214,6 +214,20 @@ public class CobaltLuaMachine implements ILuaMachine
}
}
@Override
public void printExecutionState( StringBuilder out )
{
LuaState state = this.state;
if( state == null )
{
out.append( "CobaltLuaMachine is terminated\n" );
}
else
{
state.printExecutionState( out );
}
}
@Override
public void close()
{

View File

@ -61,6 +61,15 @@ public interface ILuaMachine
*/
MachineResult handleEvent( @Nullable String eventName, @Nullable Object[] arguments );
/**
* Print some information about the internal execution state.
* <p>
* This function is purely intended for debugging, its output should not be relied on in any way.
*
* @param out The buffer to write to.
*/
void printExecutionState( StringBuilder out );
/**
* Close the Lua machine, aborting any running functions and deleting the internal state.
*/

View File

@ -48,6 +48,7 @@
"commands.computercraft.dump.synopsis": "Geef de status van computers weer.",
"commands.computercraft.dump.desc": "Geef de status van alle computers of specifieke informatie over \\u00e9\\u00e9n computer weer. Je kunt een instance-id (bijv. 123), computer-id (bijv. #123) of computer-label (bijv. \\\"@Mijn Computer\\\") opgeven.",
"commands.computercraft.dump.action": "Geef meer informatie over deze computer weer",
"commands.computercraft.dump.open_path": "Toon de bestanden van deze computer",
"commands.computercraft.shutdown.synopsis": "Sluit computers af op afstand.",
"commands.computercraft.shutdown.desc": "Sluit alle genoemde computers af, of geen enkele wanneer niet gespecificeerd. Je kunt een instance-id (bijv. 123), computer-id (bijv. #123) of computer-label (bijv. \\\"@Mijn Computer\\\") opgeven.",
"commands.computercraft.shutdown.done": "%s/%s computers afgesloten",
@ -109,5 +110,23 @@
"tracking_field.computercraft.coroutines_dead.name": "Coroutines verwijderd",
"gui.computercraft.tooltip.copy": "Kopiëren naar klembord",
"gui.computercraft.tooltip.computer_id": "Computer ID: %s",
"gui.computercraft.tooltip.disk_id": "Diskette ID: %s"
"gui.computercraft.tooltip.disk_id": "Diskette ID: %s",
"gui.computercraft.tooltip.turn_on": "Zet deze computer aan",
"gui.computercraft.tooltip.turn_off": "Zet deze computer uit",
"gui.computercraft.tooltip.terminate": "Stop het huidige programma",
"gui.computercraft.upload.success": "Upload Geslaagd",
"gui.computercraft.upload.success.msg": "%d files geuploaded.",
"gui.computercraft.upload.failed": "Upload Mislukt",
"gui.computercraft.upload.failed.out_of_space": "Niet genoeg ruimte op deze computer om deze bestanden op te slaan.",
"gui.computercraft.upload.failed.computer_off": "Je moet de computer aanzetten alvorens je bestanden upload.",
"gui.computercraft.upload.failed.too_much": "Je bestanden zijn te groot om te uploaden.",
"gui.computercraft.upload.failed.name_too_long": "De namen van je bestanden zijn te lang om te uploaden.",
"gui.computercraft.upload.failed.too_many_files": "Je kan niet zoveel files tegelijk uploaden.",
"gui.computercraft.upload.failed.overwrite_dir": "De map %s kon niet worden geupload, er bestaat al een map met deze naam.",
"gui.computercraft.upload.failed.generic": "Uploaden van bestanden mislukt (%s)",
"gui.computercraft.upload.failed.corrupted": "De bestanden zijn beschadigd tijdens de upload. Probeer het opnieuw.",
"gui.computercraft.upload.overwrite": "Bestanden zullen worden overschreven.",
"gui.computercraft.upload.overwrite.detail": "De volgende bestanden zullen tijdens de upload worden overschreven. Doorgaan?%s",
"gui.computercraft.upload.overwrite_button": "Overschrijven",
"gui.computercraft.pocket_computer_overlay": "Zakcomputer open. Druk op ESC om te sluiten."
}

View File

@ -211,6 +211,11 @@ public class FakeComputerManager
}
}
@Override
public void printExecutionState( StringBuilder out )
{
}
@Override
public void close()
{