Model improvements
This commit is contained in:
@@ -6,8 +6,10 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -16,6 +18,8 @@ import refinedstorage.RefinedStorageGui;
|
||||
import refinedstorage.tile.TileDetector;
|
||||
|
||||
public class BlockDetector extends BlockNode {
|
||||
public static final AxisAlignedBB AABB_DETECTOR = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 4D / 16D, 1.0D);
|
||||
|
||||
public static final PropertyBool POWERED = PropertyBool.create("powered");
|
||||
|
||||
public BlockDetector() {
|
||||
@@ -35,6 +39,11 @@ public class BlockDetector extends BlockNode {
|
||||
.withProperty(POWERED, ((TileDetector) world.getTileEntity(pos)).isPowered());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
return AABB_DETECTOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
return new TileDetector();
|
||||
@@ -74,6 +83,11 @@ public class BlockDetector extends BlockNode {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return null;
|
||||
|
||||
@@ -8,13 +8,17 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.RefinedStorageGui;
|
||||
import refinedstorage.tile.TileSolderer;
|
||||
|
||||
public class BlockSolderer extends BlockNode {
|
||||
public static final AxisAlignedBB AABB_SOLDERER = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 14D / 16D, 1.0D);
|
||||
|
||||
public static final PropertyBool WORKING = PropertyBool.create("working");
|
||||
|
||||
public BlockSolderer() {
|
||||
@@ -35,6 +39,11 @@ public class BlockSolderer extends BlockNode {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
return AABB_SOLDERER;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return super.createBlockStateBuilder()
|
||||
@@ -42,6 +51,12 @@ public class BlockSolderer extends BlockNode {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return super.getActualState(state, world, pos)
|
||||
.withProperty(WORKING, ((TileSolderer) world.getTileEntity(pos)).isWorking());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
|
||||
@@ -76,6 +76,11 @@ public class BlockWirelessTransmitter extends BlockNode {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasConnectivityState() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return null;
|
||||
|
||||
@@ -102,11 +102,6 @@ public class ClientProxy extends CommonProxy {
|
||||
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_STACK, new ModelResourceLocation("refinedstorage:stack_upgrade", "inventory"));
|
||||
|
||||
// Blocks
|
||||
ModelLoader.setCustomStateMapper(RefinedStorageBlocks.SOLDERER, (new StateMap.Builder())
|
||||
.ignore(RefinedStorageBlocks.SOLDERER.WORKING)
|
||||
.build()
|
||||
);
|
||||
|
||||
ModelLoader.setCustomStateMapper(RefinedStorageBlocks.GRID, (new StateMap.Builder())
|
||||
.ignore(RefinedStorageBlocks.GRID.TYPE)
|
||||
.build());
|
||||
|
||||
Reference in New Issue
Block a user