use of mcmultipart.api.container.IPartInfo in project LogisticsPipes by RS485.
the class LPMicroblockBlock method addDestroyEffects.
@Override
@SideOnly(Side.CLIENT)
@ModDependentMethod(modId = LPConstants.mcmpModID)
public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager manager) {
Pair<Vec3d, Vec3d> vectors = RayTraceHelper.getRayTraceVectors(MCMultiPart.proxy.getPlayer());
RayTraceResult hit = collisionRayTrace(getDefaultState(), world, pos, vectors.getLeft(), vectors.getRight());
if (hit != null && hit.subHit >= 0) {
IPartInfo part = getTile(world, pos).get().get(MCMultiPart.slotRegistry.getValue(hit.subHit)).get();
if (!part.getPart().addDestroyEffects(part, manager)) {
IBlockState state = part.getPart().getActualState(part.getPartWorld(), pos, part);
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
for (int k = 0; k < 4; ++k) {
double xOff = (i + 0.5D) / 4.0D;
double yOff = (j + 0.5D) / 4.0D;
double zOff = (k + 0.5D) / 4.0D;
manager.addEffect(new ParticleDigging(world, pos.getX() + xOff, pos.getY() + yOff, pos.getZ() + zOff, xOff - 0.5D, yOff - 0.5D, zOff - 0.5D, state) {
}.setBlockPos(pos));
}
}
}
}
return true;
}
return false;
}
Aggregations