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

66 lines
1.9 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;
import net.minecraft.block.enums.SlabType;
2019-03-04 12:40:14 +01:00
import net.minecraft.entity.Entity;
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-01-16 12:35:46 +01:00
public abstract class USlab<T extends Block> extends SlabBlock {
2019-03-04 12:40:14 +01:00
protected final T modelBlock;
2020-01-16 12:35:46 +01:00
public USlab(T model, Block.Settings settings) {
super(settings);
this.modelBlock = model;
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 modelBlock.isTranslucent(state, world, pos);
2019-03-04 12:40:14 +01:00
}
@Override
2020-01-16 12:35:46 +01:00
public boolean isAir(BlockState state) {
return modelBlock.isAir(state);
2019-03-04 12:40:14 +01:00
}
2020-01-16 12:35:46 +01:00
public boolean isDouble(BlockState state) {
return state.get(TYPE) == SlabType.DOUBLE;
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) {
modelBlock.scheduledTick(state, 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) {
modelBlock.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) {
modelBlock.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) {
modelBlock.onEntityCollision(state, 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 modelBlock.calcBlockBreakingDelta(state, player, worldIn, pos);
2019-03-04 12:40:14 +01:00
}
}