2020-04-15 14:22:03 +02:00
|
|
|
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;
|
2020-05-05 22:26:00 +02:00
|
|
|
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;
|
|
|
|
|
2020-05-05 22:26:00 +02:00
|
|
|
public abstract class AbstractSlabBlock extends SlabBlock {
|
2019-03-04 12:40:14 +01:00
|
|
|
|
2020-04-26 13:46:49 +02:00
|
|
|
protected final BlockState modelState;
|
2019-03-04 12:40:14 +01:00
|
|
|
|
2020-04-26 13:46:49 +02:00
|
|
|
public AbstractSlabBlock(BlockState inherited, Block.Settings settings) {
|
2020-01-16 12:35:46 +01:00
|
|
|
super(settings);
|
2020-04-26 13:46:49 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
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) {
|
2020-05-05 22:26:00 +02:00
|
|
|
return modelState.calcBlockBreakingDelta(player, worldIn, pos);
|
2019-03-04 12:40:14 +01:00
|
|
|
}
|
|
|
|
}
|