mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-09-06 12:27:56 +00:00
fix: some tile write nbt returns
This commit is contained in:
@@ -35,7 +35,7 @@ import static dan200.computercraft.client.gui.FixedWidthFontRenderer.*;
|
|||||||
import static net.minecraft.client.util.GlAllocationUtils.allocateByteBuffer;
|
import static net.minecraft.client.util.GlAllocationUtils.allocateByteBuffer;
|
||||||
|
|
||||||
public class TileEntityMonitorRenderer implements BlockEntityRenderer<TileMonitor>
|
public class TileEntityMonitorRenderer implements BlockEntityRenderer<TileMonitor>
|
||||||
{ //FIXME get rid of GL Calls. Buffered things or whatever, more research needed.
|
{
|
||||||
/**
|
/**
|
||||||
* {@link TileMonitor#RENDER_MARGIN}, but a tiny bit of additional padding to ensure that there is no space between the monitor frame and contents.
|
* {@link TileMonitor#RENDER_MARGIN}, but a tiny bit of additional padding to ensure that there is no space between the monitor frame and contents.
|
||||||
*/
|
*/
|
||||||
|
@@ -334,7 +334,6 @@ public abstract class TileComputerBase extends TileGeneric implements IComputerT
|
|||||||
@Override
|
@Override
|
||||||
public NbtCompound writeNbt( @Nonnull NbtCompound nbt )
|
public NbtCompound writeNbt( @Nonnull NbtCompound nbt )
|
||||||
{
|
{
|
||||||
super.writeNbt( nbt );
|
|
||||||
// Save ID, label and power state
|
// Save ID, label and power state
|
||||||
if( computerID >= 0 )
|
if( computerID >= 0 )
|
||||||
{
|
{
|
||||||
@@ -345,7 +344,7 @@ public abstract class TileComputerBase extends TileGeneric implements IComputerT
|
|||||||
nbt.putString( NBT_LABEL, label );
|
nbt.putString( NBT_LABEL, label );
|
||||||
}
|
}
|
||||||
nbt.putBoolean( NBT_ON, on );
|
nbt.putBoolean( NBT_ON, on );
|
||||||
return nbt;
|
return super.writeNbt( nbt );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -124,7 +124,6 @@ public final class TileDiskDrive extends TileGeneric implements DefaultInventory
|
|||||||
@Override
|
@Override
|
||||||
public NbtCompound writeNbt( @Nonnull NbtCompound nbt )
|
public NbtCompound writeNbt( @Nonnull NbtCompound nbt )
|
||||||
{
|
{
|
||||||
super.writeNbt( nbt );
|
|
||||||
if( customName != null )
|
if( customName != null )
|
||||||
{
|
{
|
||||||
nbt.putString( NBT_NAME, Text.Serializer.toJson( customName ) );
|
nbt.putString( NBT_NAME, Text.Serializer.toJson( customName ) );
|
||||||
@@ -136,7 +135,7 @@ public final class TileDiskDrive extends TileGeneric implements DefaultInventory
|
|||||||
diskStack.writeNbt( item );
|
diskStack.writeNbt( item );
|
||||||
nbt.put( NBT_ITEM, item );
|
nbt.put( NBT_ITEM, item );
|
||||||
}
|
}
|
||||||
return nbt;
|
return super.writeNbt( nbt );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -329,13 +329,12 @@ public class TileWiredModemFull extends TileGeneric implements IPeripheralTile
|
|||||||
@Override
|
@Override
|
||||||
public NbtCompound writeNbt( NbtCompound nbt )
|
public NbtCompound writeNbt( NbtCompound nbt )
|
||||||
{
|
{
|
||||||
super.writeNbt( nbt );
|
|
||||||
nbt.putBoolean( NBT_PERIPHERAL_ENABLED, peripheralAccessAllowed );
|
nbt.putBoolean( NBT_PERIPHERAL_ENABLED, peripheralAccessAllowed );
|
||||||
for( int i = 0; i < peripherals.length; i++ )
|
for( int i = 0; i < peripherals.length; i++ )
|
||||||
{
|
{
|
||||||
peripherals[i].write( nbt, Integer.toString( i ) );
|
peripherals[i].write( nbt, Integer.toString( i ) );
|
||||||
}
|
}
|
||||||
return nbt;
|
return super.writeNbt( nbt );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -307,14 +307,13 @@ public class TileMonitor extends TileGeneric implements IPeripheralTile
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public NbtCompound writeNbt( NbtCompound tag )
|
public NbtCompound writeNbt( NbtCompound nbt )
|
||||||
{
|
{
|
||||||
super.writeNbt( tag );
|
nbt.putInt( NBT_X, xIndex );
|
||||||
tag.putInt( NBT_X, xIndex );
|
nbt.putInt( NBT_Y, yIndex );
|
||||||
tag.putInt( NBT_Y, yIndex );
|
nbt.putInt( NBT_WIDTH, width );
|
||||||
tag.putInt( NBT_WIDTH, width );
|
nbt.putInt( NBT_HEIGHT, height );
|
||||||
tag.putInt( NBT_HEIGHT, height );
|
return super.writeNbt( nbt );
|
||||||
return tag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override //TODO: make BlockEntityRenderer work with this, i guess.
|
// @Override //TODO: make BlockEntityRenderer work with this, i guess.
|
||||||
|
Reference in New Issue
Block a user