Fixed being able to place doors and torches on inverted cloud slabs and stairs

This commit is contained in:
Sollace 2019-02-24 19:41:17 +02:00
parent 86c336dcee
commit a9485a82b3
3 changed files with 27 additions and 1 deletions

View file

@ -96,7 +96,7 @@ public class BlockCloud extends Block implements ICloudBlock, ITillable {
@Deprecated
@Override
public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) {
if (side == EnumFacing.UP && world.getBlockState(pos.up()).getBlock() instanceof ICloudBlock) {
if (side == EnumFacing.UP && (variant == CloudType.ENCHANTED || world.getBlockState(pos.up()).getBlock() instanceof ICloudBlock)) {
return true;
}

View file

@ -6,6 +6,7 @@ import java.util.Random;
import javax.annotation.Nullable;
import com.minelittlepony.unicopia.CloudType;
import com.minelittlepony.unicopia.forgebullshit.FUF;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
@ -94,6 +95,18 @@ public abstract class BlockCloudSlab<T extends Block & ICloudBlock> extends Bloc
return modelBlock.getRenderLayer();
}
@SuppressWarnings("deprecation")
@Override
public boolean isTopSolid(IBlockState state) {
return getCloudMaterialType(state) == CloudType.ENCHANTED && super.isTopSolid(state);
}
@SuppressWarnings("deprecation")
@FUF(reason = "...Really?")
public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return getCloudMaterialType(base_state) == CloudType.ENCHANTED && super.isSideSolid(base_state, world, pos, side);
}
@Override
public boolean isPassable(IBlockAccess worldIn, BlockPos pos) {
return super.isPassable(worldIn, pos);

View file

@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Nullable;
import com.minelittlepony.unicopia.CloudType;
import com.minelittlepony.unicopia.forgebullshit.FUF;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
@ -116,6 +117,18 @@ public class BlockCloudStairs extends BlockStairs implements ICloudBlock {
return super.collisionRayTrace(blockState, worldIn, pos, start, end);
}
@SuppressWarnings("deprecation")
@Override
public boolean isTopSolid(IBlockState state) {
return getCloudMaterialType(state) == CloudType.ENCHANTED && super.isTopSolid(state);
}
@SuppressWarnings("deprecation")
@FUF(reason = "...Really?")
public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return getCloudMaterialType(base_state) == CloudType.ENCHANTED && super.isSideSolid(base_state, world, pos, side);
}
@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) {
state = state.getActualState(world, pos);