mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
More proper Laser Relay bounding boxes.
This only took me about 200 bajillion hours too.
This commit is contained in:
parent
14f388fc55
commit
26d5d94f39
2 changed files with 30 additions and 1 deletions
|
@ -19,7 +19,7 @@ group = "de.ellpeck.actuallyadditions"
|
||||||
archivesBaseName = "ActuallyAdditions"
|
archivesBaseName = "ActuallyAdditions"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.9.4-12.17.0.1951"
|
version = "1.9.4-12.17.0.1957"
|
||||||
runDir = "idea"
|
runDir = "idea"
|
||||||
|
|
||||||
mappings = "snapshot_20160519"
|
mappings = "snapshot_20160519"
|
||||||
|
|
|
@ -28,11 +28,22 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockLaserRelay extends BlockContainerBase{
|
public class BlockLaserRelay extends BlockContainerBase{
|
||||||
|
|
||||||
|
//This took way too much fiddling around. I'm not good with numbers.
|
||||||
|
private static final float F = 1/16F;
|
||||||
|
private static final AxisAlignedBB AABB_UP = new AxisAlignedBB(2*F, 0, 2*F, 1-2*F, 1-F, 1-2*F);
|
||||||
|
private static final AxisAlignedBB AABB_DOWN = new AxisAlignedBB(2*F, F, 2*F, 1-2*F, 1, 1-2*F);
|
||||||
|
private static final AxisAlignedBB AABB_NORTH = new AxisAlignedBB(2*F, F, F, 1-2*F, 1-F, 1);
|
||||||
|
private static final AxisAlignedBB AABB_EAST = new AxisAlignedBB(0, F, 2*F, 1-F, 1-F, 1-2*F);
|
||||||
|
private static final AxisAlignedBB AABB_SOUTH = new AxisAlignedBB(2*F, F, 0, 1-2*F, 1-F, 1-F);
|
||||||
|
private static final AxisAlignedBB AABB_WEST = new AxisAlignedBB(F, F, 2*F, 1, 1-F, 1-2*F);
|
||||||
|
|
||||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
|
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
|
||||||
private final Type type;
|
private final Type type;
|
||||||
|
|
||||||
|
@ -46,6 +57,24 @@ public class BlockLaserRelay extends BlockContainerBase{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||||
|
switch(this.getMetaFromState(state)){
|
||||||
|
case 1:
|
||||||
|
return AABB_UP;
|
||||||
|
case 2:
|
||||||
|
return AABB_NORTH;
|
||||||
|
case 3:
|
||||||
|
return AABB_SOUTH;
|
||||||
|
case 4:
|
||||||
|
return AABB_WEST;
|
||||||
|
case 5:
|
||||||
|
return AABB_EAST;
|
||||||
|
default:
|
||||||
|
return AABB_DOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube(IBlockState state){
|
public boolean isFullCube(IBlockState state){
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue