mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #2192 from MellowArpeggiation/sync-recipes
fix interaction max distance issue with detailed hitboxes
This commit is contained in:
commit
e9b809d9dc
@ -443,8 +443,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
|||||||
y = pos[1];
|
y = pos[1];
|
||||||
z = pos[2];
|
z = pos[2];
|
||||||
|
|
||||||
for(AxisAlignedBB aabb :this.bounding) {
|
ForgeDirection rot = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP);
|
||||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP));
|
|
||||||
|
for(AxisAlignedBB aabb : this.bounding) {
|
||||||
|
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, rot);
|
||||||
|
|
||||||
if(entityBounding.intersectsWith(boxlet)) {
|
if(entityBounding.intersectsWith(boxlet)) {
|
||||||
list.add(boxlet);
|
list.add(boxlet);
|
||||||
@ -469,6 +471,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
|||||||
return AxisAlignedBB.getBoundingBox(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ).offset(x + 0.5, y + 0.5, z + 0.5);
|
return AxisAlignedBB.getBoundingBox(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ).offset(x + 0.5, y + 0.5, z + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't mutate the xyz parameters, or the interaction max distance will bite you
|
||||||
@Override
|
@Override
|
||||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec) {
|
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec) {
|
||||||
if(!this.useDetailedHitbox()) {
|
if(!this.useDetailedHitbox()) {
|
||||||
@ -480,12 +483,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
|||||||
if(pos == null)
|
if(pos == null)
|
||||||
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
|
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
|
||||||
|
|
||||||
x = pos[0];
|
ForgeDirection rot = ForgeDirection.getOrientation(world.getBlockMetadata(pos[0], pos[1], pos[2]) - offset).getRotation(ForgeDirection.UP);
|
||||||
y = pos[1];
|
|
||||||
z = pos[2];
|
|
||||||
|
|
||||||
for(AxisAlignedBB aabb :this.bounding) {
|
for(AxisAlignedBB aabb : this.bounding) {
|
||||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP));
|
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, pos[0] + 0.5, pos[1], pos[2] + 0.5, rot);
|
||||||
|
|
||||||
MovingObjectPosition intercept = boxlet.calculateIntercept(startVec, endVec);
|
MovingObjectPosition intercept = boxlet.calculateIntercept(startVec, endVec);
|
||||||
if(intercept != null) {
|
if(intercept != null) {
|
||||||
@ -529,10 +530,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
|||||||
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
|
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
|
||||||
float exp = 0.002F;
|
float exp = 0.002F;
|
||||||
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
ForgeDirection rot = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP);
|
||||||
|
|
||||||
ICustomBlockHighlight.setup();
|
ICustomBlockHighlight.setup();
|
||||||
for(AxisAlignedBB aabb : this.bounding) RenderGlobal.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(meta - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
for(AxisAlignedBB aabb : this.bounding) RenderGlobal.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, rot).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||||
ICustomBlockHighlight.cleanup();
|
ICustomBlockHighlight.cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user