mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-06 16:33:00 +00:00
Merge branch 'fabric' into 1.17-alpha
This commit is contained in:
@@ -18,7 +18,6 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -35,6 +34,11 @@ public abstract class BlockGeneric extends BlockWithEntity
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BlockEntityType<? extends TileGeneric> getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType( BlockState state )
|
||||
{
|
||||
@@ -94,8 +98,12 @@ public abstract class BlockGeneric extends BlockWithEntity
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity createBlockEntity( @Nonnull BlockView world )
|
||||
public BlockEntity createBlockEntity( BlockPos pos, BlockState state )
|
||||
{
|
||||
return type.instantiate();
|
||||
if ( this.type != null )
|
||||
{
|
||||
return type.instantiate( pos, state );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,11 +36,6 @@ public class ContainerHeldItem extends ScreenHandler
|
||||
.copy();
|
||||
}
|
||||
|
||||
public static ContainerHeldItem createPrintout( int id, PlayerInventory inventory, PacketByteBuf data )
|
||||
{
|
||||
return createPrintout( id, inventory, new HeldItemContainerData( data ) );
|
||||
}
|
||||
|
||||
public static ContainerHeldItem createPrintout( int id, PlayerInventory inventory, HeldItemContainerData data )
|
||||
{
|
||||
return new ContainerHeldItem( ComputerCraftRegistry.ModContainers.PRINTOUT, id, inventory.player, data.getHand() );
|
||||
|
||||
@@ -8,6 +8,8 @@ package dan200.computercraft.shared.common;
|
||||
|
||||
import dan200.computercraft.core.terminal.Terminal;
|
||||
import dan200.computercraft.shared.network.client.TerminalState;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class TileGeneric extends BlockEntity implements BlockEntityClientSerializable
|
||||
{
|
||||
public TileGeneric( BlockEntityType<? extends TileGeneric> type )
|
||||
public TileGeneric( BlockEntityType<? extends TileGeneric> type, BlockPos pos, BlockState state )
|
||||
{
|
||||
super( type );
|
||||
super( type, pos, state );
|
||||
}
|
||||
|
||||
public void destroy()
|
||||
|
||||
Reference in New Issue
Block a user