2017-05-07 00:18:59 +00:00
|
|
|
/*
|
2017-05-01 13:32:39 +00:00
|
|
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
2022-01-01 00:07:26 +00:00
|
|
|
* Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission.
|
2017-05-01 13:32:39 +00:00
|
|
|
* Send enquiries to dratcliffe@gmail.com
|
|
|
|
*/
|
|
|
|
package dan200.computercraft.shared.turtle.blocks;
|
|
|
|
|
2019-03-27 18:59:02 +00:00
|
|
|
import dan200.computercraft.api.turtle.TurtleSide;
|
2017-05-01 13:32:39 +00:00
|
|
|
import dan200.computercraft.shared.computer.blocks.BlockComputerBase;
|
|
|
|
import dan200.computercraft.shared.computer.blocks.TileComputerBase;
|
|
|
|
import dan200.computercraft.shared.computer.core.ComputerFamily;
|
2019-03-27 18:59:02 +00:00
|
|
|
import dan200.computercraft.shared.turtle.core.TurtleBrain;
|
|
|
|
import dan200.computercraft.shared.turtle.items.ITurtleItem;
|
2018-12-27 11:32:29 +00:00
|
|
|
import dan200.computercraft.shared.turtle.items.TurtleItemFactory;
|
2021-10-13 16:46:29 +00:00
|
|
|
import dan200.computercraft.shared.util.WaterloggableHelpers;
|
2021-08-03 20:46:53 +00:00
|
|
|
import net.minecraft.core.BlockPos;
|
|
|
|
import net.minecraft.core.Direction;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
|
|
|
import net.minecraft.world.entity.Entity;
|
|
|
|
import net.minecraft.world.entity.LivingEntity;
|
|
|
|
import net.minecraft.world.entity.player.Player;
|
|
|
|
import net.minecraft.world.entity.projectile.AbstractHurtingProjectile;
|
|
|
|
import net.minecraft.world.item.ItemStack;
|
|
|
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
|
|
|
import net.minecraft.world.level.BlockGetter;
|
|
|
|
import net.minecraft.world.level.Explosion;
|
|
|
|
import net.minecraft.world.level.Level;
|
|
|
|
import net.minecraft.world.level.LevelAccessor;
|
2022-05-22 14:03:01 +00:00
|
|
|
import net.minecraft.world.level.block.*;
|
2021-08-03 20:46:53 +00:00
|
|
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
|
|
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
|
|
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
|
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
|
|
import net.minecraft.world.level.block.state.StateDefinition;
|
|
|
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|
|
|
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
|
|
|
import net.minecraft.world.level.material.FluidState;
|
|
|
|
import net.minecraft.world.phys.Vec3;
|
|
|
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
|
|
|
import net.minecraft.world.phys.shapes.Shapes;
|
|
|
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
2021-11-30 22:48:37 +00:00
|
|
|
import net.minecraftforge.registries.RegistryObject;
|
2017-05-01 13:32:39 +00:00
|
|
|
|
2017-05-06 23:07:42 +00:00
|
|
|
import javax.annotation.Nonnull;
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
import javax.annotation.Nullable;
|
2017-05-06 23:07:42 +00:00
|
|
|
|
2021-11-03 09:34:21 +00:00
|
|
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.WATERLOGGED;
|
|
|
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.getFluidStateForPlacement;
|
2019-06-08 12:36:31 +00:00
|
|
|
|
2021-08-03 20:46:53 +00:00
|
|
|
public class BlockTurtle extends BlockComputerBase<TileTurtle> implements SimpleWaterloggedBlock
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
2017-05-01 13:32:39 +00:00
|
|
|
|
2021-08-03 20:46:53 +00:00
|
|
|
private static final VoxelShape DEFAULT_SHAPE = Shapes.box(
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
0.125, 0.125, 0.125,
|
|
|
|
0.875, 0.875, 0.875
|
|
|
|
);
|
|
|
|
|
2021-08-03 20:46:53 +00:00
|
|
|
private final BlockEntityTicker<TileTurtle> clientTicker = ( level, pos, state, computer ) -> computer.clientTick();
|
|
|
|
|
|
|
|
public BlockTurtle( Properties settings, ComputerFamily family, RegistryObject<BlockEntityType<TileTurtle>> type )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
super( settings, family, type );
|
2021-01-09 19:22:58 +00:00
|
|
|
registerDefaultState( getStateDefinition().any()
|
|
|
|
.setValue( FACING, Direction.NORTH )
|
|
|
|
.setValue( WATERLOGGED, false )
|
2017-05-01 13:32:39 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-03 20:46:53 +00:00
|
|
|
protected void createBlockStateDefinition( StateDefinition.Builder<Block, BlockState> builder )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
builder.add( FACING, WATERLOGGED );
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|
|
|
|
|
2022-05-01 11:09:38 +00:00
|
|
|
@Nonnull
|
|
|
|
@Override
|
2022-05-02 15:21:56 +00:00
|
|
|
@Deprecated
|
2022-05-01 11:09:38 +00:00
|
|
|
public BlockState mirror( BlockState state, Mirror mirrorIn )
|
|
|
|
{
|
|
|
|
return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nonnull
|
|
|
|
@Override
|
2022-05-02 15:21:56 +00:00
|
|
|
@Deprecated
|
2022-05-01 11:09:38 +00:00
|
|
|
public BlockState rotate( BlockState state, Rotation rot )
|
|
|
|
{
|
|
|
|
return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) );
|
|
|
|
}
|
|
|
|
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
@Nonnull
|
2017-05-01 13:32:39 +00:00
|
|
|
@Override
|
2017-05-07 00:42:32 +00:00
|
|
|
@Deprecated
|
2021-08-03 20:46:53 +00:00
|
|
|
public RenderShape getRenderShape( @Nonnull BlockState state )
|
2017-09-18 07:20:54 +00:00
|
|
|
{
|
2021-08-03 20:46:53 +00:00
|
|
|
return RenderShape.ENTITYBLOCK_ANIMATED;
|
2017-09-18 07:20:54 +00:00
|
|
|
}
|
|
|
|
|
2017-05-06 23:07:42 +00:00
|
|
|
@Nonnull
|
2017-05-01 13:32:39 +00:00
|
|
|
@Override
|
2017-05-07 00:42:32 +00:00
|
|
|
@Deprecated
|
2021-08-03 20:46:53 +00:00
|
|
|
public VoxelShape getShape( @Nonnull BlockState state, BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
2021-08-03 20:46:53 +00:00
|
|
|
BlockEntity tile = world.getBlockEntity( pos );
|
2021-08-08 11:44:56 +00:00
|
|
|
Vec3 offset = tile instanceof TileTurtle turtle ? turtle.getRenderOffset( 1.0f ) : Vec3.ZERO;
|
2021-08-03 20:46:53 +00:00
|
|
|
return offset.equals( Vec3.ZERO ) ? DEFAULT_SHAPE : DEFAULT_SHAPE.move( offset.x, offset.y, offset.z );
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|
|
|
|
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
@Nullable
|
2017-05-01 13:32:39 +00:00
|
|
|
@Override
|
2021-08-03 20:46:53 +00:00
|
|
|
public BlockState getStateForPlacement( BlockPlaceContext placement )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
2021-01-09 19:22:58 +00:00
|
|
|
return defaultBlockState()
|
|
|
|
.setValue( FACING, placement.getHorizontalDirection() )
|
2021-10-13 16:46:29 +00:00
|
|
|
.setValue( WATERLOGGED, getFluidStateForPlacement( placement ) );
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|
|
|
|
|
2017-05-06 23:07:42 +00:00
|
|
|
@Nonnull
|
2017-05-01 13:32:39 +00:00
|
|
|
@Override
|
2017-05-07 00:42:32 +00:00
|
|
|
@Deprecated
|
2020-07-11 19:36:10 +00:00
|
|
|
public FluidState getFluidState( @Nonnull BlockState state )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
2021-10-13 16:46:29 +00:00
|
|
|
return WaterloggableHelpers.getFluidState( state );
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|
|
|
|
|
2019-03-29 21:21:39 +00:00
|
|
|
@Nonnull
|
2018-12-27 11:32:29 +00:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
2021-08-03 20:46:53 +00:00
|
|
|
public BlockState updateShape( @Nonnull BlockState state, @Nonnull Direction side, @Nonnull BlockState otherState, @Nonnull LevelAccessor world, @Nonnull BlockPos pos, @Nonnull BlockPos otherPos )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
2021-10-13 16:46:29 +00:00
|
|
|
WaterloggableHelpers.updateShape( state, world, pos );
|
Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.
Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:
- Flatten everything. For instance, there are now three instances of
BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
more BlockPeripheral (thank heavens) - there's separate block classes
for each peripheral type.
- Remove pretty much all legacy code. As we're breaking world
compatibility anyway, we can remove all the code to load worlds from
1.4 days.
- The command system is largely rewriten to take advantage of 1.13's
new system. It's very fancy!
- WidgetTerminal now uses Minecraft's "GUI listener" system.
- BREAKING CHANGE: All the codes in keys.lua are different, due to the
move to LWJGL 3. Hopefully this won't have too much of an impact.
I don't want to map to the old key codes on the Java side, as there
always ends up being small but slight inconsistencies. IMO it's
better to make a clean break - people should be using keys rather
than hard coding the constants anyway.
- commands.list now allows fetching sub-commands. The ROM has already
been updated to allow fancy usage such as commands.time.set("noon").
- Turtles, modems and cables can be waterlogged.
2019-04-02 12:27:27 +00:00
|
|
|
return state;
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-08 11:44:56 +00:00
|
|
|
public void setPlacedBy( @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nullable LivingEntity entity, @Nonnull ItemStack stack )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
2021-08-08 11:44:56 +00:00
|
|
|
super.setPlacedBy( world, pos, state, entity, stack );
|
2019-03-27 18:59:02 +00:00
|
|
|
|
2021-08-03 20:46:53 +00:00
|
|
|
BlockEntity tile = world.getBlockEntity( pos );
|
2021-08-08 11:44:56 +00:00
|
|
|
if( !world.isClientSide && tile instanceof TileTurtle turtle )
|
2017-05-01 13:32:39 +00:00
|
|
|
{
|
2021-08-08 11:44:56 +00:00
|
|
|
if( entity instanceof Player player ) turtle.setOwningPlayer( player.getGameProfile() );
|
2019-03-27 18:59:02 +00:00
|
|
|
|
2021-08-08 11:44:56 +00:00
|
|
|
if( stack.getItem() instanceof ITurtleItem item )
|
2019-03-27 18:59:02 +00:00
|
|
|
{
|
|
|
|
// Set Upgrades
|
|
|
|
for( TurtleSide side : TurtleSide.values() )
|
|
|
|
{
|
|
|
|
turtle.getAccess().setUpgrade( side, item.getUpgrade( stack, side ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
turtle.getAccess().setFuelLevel( item.getFuelLevel( stack ) );
|
|
|
|
|
|
|
|
// Set colour
|
|
|
|
int colour = item.getColour( stack );
|
|
|
|
if( colour != -1 ) turtle.getAccess().setColour( colour );
|
|
|
|
|
|
|
|
// Set overlay
|
|
|
|
ResourceLocation overlay = item.getOverlay( stack );
|
|
|
|
if( overlay != null ) ((TurtleBrain) turtle.getAccess()).setOverlay( overlay );
|
|
|
|
}
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-27 11:32:29 +00:00
|
|
|
|
|
|
|
@Override
|
2021-08-03 20:46:53 +00:00
|
|
|
public float getExplosionResistance( BlockState state, BlockGetter world, BlockPos pos, Explosion explosion )
|
2018-12-27 11:32:29 +00:00
|
|
|
{
|
2023-05-03 22:38:12 +00:00
|
|
|
Entity exploder = explosion == null ? null : explosion.getExploder();
|
2021-08-03 20:46:53 +00:00
|
|
|
if( getFamily() == ComputerFamily.ADVANCED || exploder instanceof LivingEntity || exploder instanceof AbstractHurtingProjectile )
|
2018-12-27 11:32:29 +00:00
|
|
|
{
|
|
|
|
return 2000;
|
|
|
|
}
|
|
|
|
|
2020-07-11 19:36:10 +00:00
|
|
|
return super.getExplosionResistance( state, world, pos, explosion );
|
2018-12-27 11:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Nonnull
|
2019-01-25 22:03:44 +00:00
|
|
|
@Override
|
|
|
|
protected ItemStack getItem( TileComputerBase tile )
|
2018-12-27 11:32:29 +00:00
|
|
|
{
|
2021-08-08 11:44:56 +00:00
|
|
|
return tile instanceof TileTurtle turtle ? TurtleItemFactory.create( turtle ) : ItemStack.EMPTY;
|
2018-12-27 11:32:29 +00:00
|
|
|
}
|
2021-08-03 20:46:53 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
@Nullable
|
|
|
|
public <U extends BlockEntity> BlockEntityTicker<U> getTicker( @Nonnull Level level, @Nonnull BlockState state, @Nonnull BlockEntityType<U> type )
|
|
|
|
{
|
|
|
|
return level.isClientSide ? BaseEntityBlock.createTickerHelper( type, this.type.get(), clientTicker ) : super.getTicker( level, state, type );
|
|
|
|
}
|
2017-05-01 13:32:39 +00:00
|
|
|
}
|