本文整理匯總了Java中net.minecraft.util.math.AxisAlignedBB.union方法的典型用法代碼示例。如果您正苦於以下問題:Java AxisAlignedBB.union方法的具體用法?Java AxisAlignedBB.union怎麽用?Java AxisAlignedBB.union使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.util.math.AxisAlignedBB
的用法示例。
在下文中一共展示了AxisAlignedBB.union方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBoundingBox
import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
state = getActualState(state, source, pos);
AxisAlignedBB def = new AxisAlignedBB(6.5/16, 6.5/16, 6.5/16, 9.5/16, 9.5/16, 9.5/16);
if(state.getValue(NORTH) || state.getValue(STRAIGHT_NS)){
def = def.union(new AxisAlignedBB(6.5/16, 6.5/16, 0, 9.5/16, 9.5/16, 6.5/16));
}
if(state.getValue(SOUTH) || state.getValue(STRAIGHT_NS)){
def = def.union(new AxisAlignedBB(6.5/16, 6.5/16, 9.5/16, 9.5/16, 9.5/16, 1));
}
if(state.getValue(EAST) || state.getValue(STRAIGHT_WE)){
def = def.union(new AxisAlignedBB(0, 6.5/16, 6.5/16, 6.5/16, 9.5/16, 9.5/16));
}
if(state.getValue(WEST) || state.getValue(STRAIGHT_WE)){
def = def.union(new AxisAlignedBB(9.5/16, 6.5/16, 6.5/16, 1, 9.5/16, 9.5/16));
}
if(state.getValue(UP) || state.getValue(STRAIGHT_UD)){
def = def.union(new AxisAlignedBB(6.5/16, 9.5/16, 6.5/16, 9.5/16, 1, 9.5/16));
}
if(state.getValue(DOWN) || state.getValue(STRAIGHT_UD)){
def = def.union(new AxisAlignedBB(6.5/16, 0, 6.5/16, 9.5/16, 6.5/16, 9.5/16));
}
return def;
}