1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +00:00
CC-Tweaked/projects/common/src/main/java/dan200/computercraft/shared/peripheral/printer
Jonathan Coates 3112f455ae
Support arguments being coerced from strings
In this case, we use Lua's tostring(x) semantics (well, modulo
metamethods), instead of Java's Object.toString(x) call. This ensures
that values are formatted (mostly) consistently between Lua and Java
methods.

 - Add IArguments.getStringCoerced, which uses Lua's tostring semantics.

 - Add a Coerced<T> wrapper type, which says to use the .getXCoerced
   methods. I'm not thrilled about this interface - there's definitely
   an argument for using annotations - but this is probably more
   consistent for now.

 - Convert existing methods to use this call.

Closes #1445
2023-05-20 18:54:22 +01:00
..
PrinterBlock.java License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00
PrinterBlockEntity.java License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00
PrinterMenu.java License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00
PrinterPeripheral.java Support arguments being coerced from strings 2023-05-20 18:54:22 +01:00