ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java

49 lines
1.8 KiB
Java
Raw Normal View History

2016-05-16 22:52:27 +02:00
/*
* This file ("BlockItemViewer.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2017-01-01 16:23:26 +01:00
* © 2015-2017 Ellpeck
2016-05-16 22:52:27 +02:00
*/
2016-05-08 21:09:58 +02:00
package de.ellpeck.actuallyadditions.mod.blocks;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface;
2024-03-02 21:23:08 +01:00
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
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.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
2016-05-08 21:09:58 +02:00
2021-08-30 02:01:35 +02:00
import javax.annotation.Nullable;
public class BlockItemInterface extends BlockContainerBase {
public BlockItemInterface() {
2024-03-02 21:23:08 +01:00
super(ActuallyBlocks.defaultPickProps());
2016-05-08 21:09:58 +02:00
}
2024-03-02 21:23:08 +01:00
@Nullable
2023-01-19 16:27:56 +01:00
@Override
2024-03-02 21:23:08 +01:00
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new TileEntityItemInterface(pos, state);
2023-01-19 16:27:56 +01:00
}
@Nullable
@Override
2024-03-02 21:23:08 +01:00
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> entityType) {
return level.isClientSide? TileEntityItemInterface::clientTick : TileEntityItemInterface::serverTick;
2016-05-08 21:09:58 +02:00
}
@Override
2024-03-02 21:23:08 +01:00
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
return VoxelShapes.ITEM_VIEWER_SHAPE;
2016-05-08 21:09:58 +02:00
}
}