1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-28 20:37:38 +00:00

Started work on upgrading to 1.16.1. Not in a compilable state yet

This commit is contained in:
Alex Evelyn
2020-07-07 13:27:13 -04:00
parent cb66ef7e30
commit 605e1f6b9b
513 changed files with 48117 additions and 534 deletions

View File

@@ -36,19 +36,19 @@ public abstract class BlockGeneric extends Block implements BlockEntityProvider
@Override
@Deprecated
public final void onBlockRemoved( @Nonnull BlockState block, @Nonnull World world, @Nonnull BlockPos pos, BlockState replace, boolean bool )
public final void onStateReplaced( @Nonnull BlockState block, @Nonnull World world, @Nonnull BlockPos pos, BlockState replace, boolean bool )
{
if( block.getBlock() == replace.getBlock() ) return;
BlockEntity tile = world.getBlockEntity( pos );
super.onBlockRemoved( block, world, pos, replace, bool );
super.onStateReplaced( block, world, pos, replace, bool );
world.removeBlockEntity( pos );
if( tile instanceof TileGeneric ) ((TileGeneric) tile).destroy();
}
@Override
@Deprecated
public final boolean activate( BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit )
public final boolean onUse( BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit )
{
BlockEntity tile = world.getBlockEntity( pos );
return tile instanceof TileGeneric && ((TileGeneric) tile).onActivate( player, hand, hit );
@@ -65,7 +65,7 @@ public abstract class BlockGeneric extends Block implements BlockEntityProvider
@Override
@Deprecated
public void onScheduledTick( BlockState state, World world, BlockPos pos, Random rand )
public void scheduledTick( BlockState state, World world, BlockPos pos, Random rand )
{
BlockEntity te = world.getBlockEntity( pos );
if( te instanceof TileGeneric ) ((TileGeneric) te).blockTick();

View File

@@ -50,7 +50,7 @@ public class ClientTerminal implements ITerminal
public void readDescription( CompoundTag nbt )
{
m_colour = nbt.getBoolean( "colour" );
if( nbt.containsKey( "terminal" ) )
if( nbt.contains( "terminal" ) )
{
CompoundTag terminal = nbt.getCompound( "terminal" );
resizeTerminal( terminal.getInt( "term_width" ), terminal.getInt( "term_height" ) );

View File

@@ -32,9 +32,9 @@ public class ColourableRecipe extends SpecialCraftingRecipe
{
boolean hasColourable = false;
boolean hasDye = false;
for( int i = 0; i < inv.getInvSize(); i++ )
for( int i = 0; i < inv.size(); i++ )
{
ItemStack stack = inv.getInvStack( i );
ItemStack stack = inv.getStack( i );
if( stack.isEmpty() ) continue;
if( stack.getItem() instanceof IColouredItem )
@@ -63,9 +63,9 @@ public class ColourableRecipe extends SpecialCraftingRecipe
ColourTracker tracker = new ColourTracker();
for( int i = 0; i < inv.getInvSize(); i++ )
for( int i = 0; i < inv.size(); i++ )
{
ItemStack stack = inv.getInvStack( i );
ItemStack stack = inv.getStack( i );
if( stack.isEmpty() ) continue;

View File

@@ -7,14 +7,14 @@
package dan200.computercraft.shared.common;
import dan200.computercraft.shared.util.InventoryUtil;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.Hand;
import javax.annotation.Nonnull;
public class ContainerHeldItem extends Container
public class ContainerHeldItem extends ScreenHandler
{
private final ItemStack m_stack;
private final Hand m_hand;

View File

@@ -28,7 +28,7 @@ public interface IColouredItem
static int getColourBasic( ItemStack stack )
{
CompoundTag tag = stack.getTag();
return tag != null && tag.containsKey( NBT_COLOUR ) ? tag.getInt( NBT_COLOUR ) : -1;
return tag != null && tag.contains( NBT_COLOUR ) ? tag.getInt( NBT_COLOUR ) : -1;
}
static void setColourBasic( ItemStack stack, int colour )