mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-13 19:50:31 +00:00
Merge pull request #476 from SquidDev-CC/ComputerCraft/hotfix/printer-clear
Fix the printer overwriting the current page
This commit is contained in:
commit
c8673473ef
@ -493,21 +493,6 @@ public class TilePrinter extends TilePeripheralBase
|
|||||||
ItemStack paperStack = m_inventory.get( i );
|
ItemStack paperStack = m_inventory.get( i );
|
||||||
if( !paperStack.isEmpty() && isPaper(paperStack) )
|
if( !paperStack.isEmpty() && isPaper(paperStack) )
|
||||||
{
|
{
|
||||||
// Decrement ink
|
|
||||||
inkStack.shrink( 1 );
|
|
||||||
if( inkStack.isEmpty() )
|
|
||||||
{
|
|
||||||
m_inventory.set( 0, ItemStack.EMPTY );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decrement paper
|
|
||||||
paperStack.shrink( 1 );
|
|
||||||
if( paperStack.isEmpty() )
|
|
||||||
{
|
|
||||||
m_inventory.set( i, ItemStack.EMPTY );
|
|
||||||
updateAnim();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup the new page
|
// Setup the new page
|
||||||
int colour = inkStack.getItemDamage();
|
int colour = inkStack.getItemDamage();
|
||||||
if( colour >= 0 && colour < 16 ) {
|
if( colour >= 0 && colour < 16 ) {
|
||||||
@ -532,6 +517,21 @@ public class TilePrinter extends TilePeripheralBase
|
|||||||
m_pageTitle = "";
|
m_pageTitle = "";
|
||||||
}
|
}
|
||||||
m_page.setCursorPos( 0, 0 );
|
m_page.setCursorPos( 0, 0 );
|
||||||
|
|
||||||
|
// Decrement ink
|
||||||
|
inkStack.shrink( 1 );
|
||||||
|
if( inkStack.isEmpty() )
|
||||||
|
{
|
||||||
|
m_inventory.set( 0, ItemStack.EMPTY );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decrement paper
|
||||||
|
paperStack.shrink( 1 );
|
||||||
|
if( paperStack.isEmpty() )
|
||||||
|
{
|
||||||
|
m_inventory.set( i, ItemStack.EMPTY );
|
||||||
|
updateAnim();
|
||||||
|
}
|
||||||
|
|
||||||
markDirty();
|
markDirty();
|
||||||
m_printing = true;
|
m_printing = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user