Unicopia/src/main/java/com/minelittlepony/unicopia/block/AbstractSlabBlock.java

67 lines
2 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia.block;
2019-03-04 12:40:14 +01:00
import java.util.Random;
import net.minecraft.block.Block;
2020-01-16 12:35:46 +01:00
import net.minecraft.block.BlockState;
import net.minecraft.block.SlabBlock;
2019-03-04 12:40:14 +01:00
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
2020-01-16 12:35:46 +01:00
import net.minecraft.entity.player.PlayerEntity;
2020-04-22 16:28:20 +02:00
import net.minecraft.server.world.ServerWorld;
2019-03-04 12:40:14 +01:00
import net.minecraft.util.math.BlockPos;
2020-01-16 12:35:46 +01:00
import net.minecraft.world.BlockView;
2019-03-04 12:40:14 +01:00
import net.minecraft.world.World;
public abstract class AbstractSlabBlock extends SlabBlock {
2019-03-04 12:40:14 +01:00
protected final BlockState modelState;
2019-03-04 12:40:14 +01:00
public AbstractSlabBlock(BlockState inherited, Block.Settings settings) {
2020-01-16 12:35:46 +01:00
super(settings);
modelState = inherited;
2019-03-04 12:40:14 +01:00
}
@Deprecated
@Override
2020-01-16 12:35:46 +01:00
public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) {
return modelState.isTranslucent(world, pos);
}
@Override
public boolean allowsSpawning(BlockState state, BlockView view, BlockPos pos, EntityType<?> type) {
return modelState.allowsSpawning(view, pos, type);
2019-03-04 12:40:14 +01:00
}
@Override
2020-01-16 12:35:46 +01:00
public boolean isAir(BlockState state) {
return modelState.isAir();
2019-03-04 12:40:14 +01:00
}
@Override
2020-04-22 16:28:20 +02:00
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) {
modelState.scheduledTick(world, pos, rand);
2019-03-04 12:40:14 +01:00
}
@Override
2020-01-16 12:35:46 +01:00
public void onLandedUpon(World w, BlockPos pos, Entity entity, float fallDistance) {
modelState.getBlock().onLandedUpon(w, pos, entity, fallDistance);
2019-03-04 12:40:14 +01:00
}
@Override
2020-01-16 12:35:46 +01:00
public void onEntityLand(BlockView w, Entity entity) {
modelState.getBlock().onEntityLand(w, entity);
2019-03-04 12:40:14 +01:00
}
@Override
2020-01-16 12:35:46 +01:00
public void onEntityCollision(BlockState state, World w, BlockPos pos, Entity entity) {
modelState.onEntityCollision(w, pos, entity);
2019-03-04 12:40:14 +01:00
}
@Deprecated
@Override
2020-01-16 12:35:46 +01:00
public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView worldIn, BlockPos pos) {
return modelState.calcBlockBreakingDelta(player, worldIn, pos);
2019-03-04 12:40:14 +01:00
}
}