mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 21:52:59 +00:00 
			
		
		
		
	Merge pull request #458 from SquidDev-CC/hotfix/block-shapes
Fix BlockFaceShape not being overridden for turtles and peripherals
This commit is contained in:
		| @@ -12,6 +12,7 @@ import dan200.computercraft.shared.peripheral.modem.TileCable; | ||||
| import net.minecraft.block.Block; | ||||
| import net.minecraft.block.properties.PropertyBool; | ||||
| import net.minecraft.block.properties.PropertyEnum; | ||||
| import net.minecraft.block.state.BlockFaceShape; | ||||
| import net.minecraft.block.state.BlockStateContainer; | ||||
| import net.minecraft.block.state.IBlockState; | ||||
| import net.minecraft.item.Item; | ||||
| @@ -251,4 +252,26 @@ public class BlockCable extends BlockPeripheralBase | ||||
|     { | ||||
|         return new TileCable(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isOpaqueCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isFullCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public BlockFaceShape getBlockFaceShape( IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side ) | ||||
|     { | ||||
|         return BlockFaceShape.UNDEFINED; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -16,6 +16,7 @@ import dan200.computercraft.shared.peripheral.speaker.TileSpeaker; | ||||
| import dan200.computercraft.shared.util.DirectionUtil; | ||||
| import net.minecraft.block.properties.PropertyDirection; | ||||
| import net.minecraft.block.properties.PropertyEnum; | ||||
| import net.minecraft.block.state.BlockFaceShape; | ||||
| import net.minecraft.block.state.BlockStateContainer; | ||||
| import net.minecraft.block.state.IBlockState; | ||||
| import net.minecraft.entity.EntityLivingBase; | ||||
| @@ -612,4 +613,29 @@ public class BlockPeripheral extends BlockPeripheralBase | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isOpaqueCube( IBlockState state ) | ||||
|     { | ||||
|         PeripheralType type = getPeripheralType( state ); | ||||
|         return type == PeripheralType.DiskDrive || type == PeripheralType.Printer | ||||
|             || type == PeripheralType.Monitor || type == PeripheralType.AdvancedMonitor | ||||
|             || type == PeripheralType.Speaker; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isFullCube( IBlockState state ) | ||||
|     { | ||||
|         return isOpaqueCube( state ); | ||||
|     } | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public BlockFaceShape getBlockFaceShape( IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side ) | ||||
|     { | ||||
|         return isOpaqueCube( state ) ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -31,20 +31,6 @@ public abstract class BlockPeripheralBase extends BlockDirectional | ||||
|     protected abstract PeripheralType getPeripheralType( IBlockState state ); | ||||
|     protected abstract TilePeripheralBase createTile( PeripheralType type ); | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isOpaqueCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isFullCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public final boolean canPlaceBlockOnSide( @Nonnull World world, @Nonnull BlockPos pos, EnumFacing side ) | ||||
|     { | ||||
|   | ||||
| @@ -12,11 +12,12 @@ import dan200.computercraft.shared.peripheral.common.BlockPeripheralBase; | ||||
| import dan200.computercraft.shared.peripheral.common.TilePeripheralBase; | ||||
| import net.minecraft.block.properties.PropertyBool; | ||||
| import net.minecraft.block.properties.PropertyDirection; | ||||
| import net.minecraft.block.state.BlockFaceShape; | ||||
| import net.minecraft.block.state.BlockStateContainer; | ||||
| import net.minecraft.block.state.IBlockState; | ||||
| import net.minecraft.tileentity.TileEntity; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.util.EnumFacing; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.world.IBlockAccess; | ||||
|  | ||||
| import javax.annotation.Nonnull; | ||||
| @@ -114,4 +115,26 @@ public class BlockAdvancedModem extends BlockPeripheralBase | ||||
|     { | ||||
|         return new TileAdvancedModem(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isOpaqueCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isFullCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public BlockFaceShape getBlockFaceShape( IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side ) | ||||
|     { | ||||
|         return BlockFaceShape.UNDEFINED; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -13,6 +13,7 @@ import dan200.computercraft.shared.computer.core.ComputerFamily; | ||||
| import dan200.computercraft.shared.util.DirectionUtil; | ||||
| import net.minecraft.block.material.Material; | ||||
| import net.minecraft.block.properties.PropertyDirection; | ||||
| import net.minecraft.block.state.BlockFaceShape; | ||||
| import net.minecraft.block.state.BlockStateContainer; | ||||
| import net.minecraft.block.state.IBlockState; | ||||
| import net.minecraft.entity.EntityLivingBase; | ||||
| @@ -75,6 +76,14 @@ public class BlockTurtle extends BlockComputerBase | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public BlockFaceShape getBlockFaceShape( IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side ) | ||||
|     { | ||||
|         return BlockFaceShape.UNDEFINED; | ||||
|     } | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     protected BlockStateContainer createBlockState() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Daniel Ratcliffe
					Daniel Ratcliffe