Skip to content

Commit

Permalink
feat(utils): AABBUtils moveTo methods support Vec3i and Position
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Jul 20, 2022
1 parent b65e665 commit 8c0f206
Showing 1 changed file with 7 additions and 2 deletions.
@@ -1,6 +1,7 @@
package org.auioc.mcmod.arnicalib.utils.game;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Position;
import net.minecraft.core.Vec3i;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
Expand All @@ -16,11 +17,15 @@ static AABB moveTo(AABB aabb, double x, double y, double z) {
);
}

static AABB moveTo(AABB aabb, Position pos) {
return moveTo(aabb, pos.x(), pos.y(), pos.z());
}

static AABB moveTo(AABB aabb, int x, int y, int z) {
return moveTo(aabb, x + 0.5D, y, x + 0.5D);
}

static AABB moveTo(AABB aabb, BlockPos pos) {
static AABB moveTo(AABB aabb, Vec3i pos) {
return moveTo(aabb, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D);
}

Expand Down

0 comments on commit 8c0f206

Please sign in to comment.