Skip to content

Commit

Permalink
refactor: BlockPos from UtilsPosBlock; add: normally named IGrowable …
Browse files Browse the repository at this point in the history
…and IPlantable wrappers to BlockPos; add: EntityPos and ItemPos placeholders (WIP); refactor: WorldPos from UtilsPosWorld (WIP);
  • Loading branch information
MJaroslav committed Feb 14, 2024
1 parent f4a5a05 commit 4aa6e8b
Show file tree
Hide file tree
Showing 8 changed files with 271 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.github.mjaroslav.mjutils.pos.BlockPos;
import io.github.mjaroslav.mjutils.pos.Pos;
import io.github.mjaroslav.mjutils.pos.WorldPos;
import io.github.mjaroslav.mjutils.util.BlockAABBSet;
import io.github.mjaroslav.mjutils.util.Pos;
import io.github.mjaroslav.mjutils.util.game.UtilsPosBlock;
import io.github.mjaroslav.mjutils.util.game.UtilsPosWorld;
import io.github.mjaroslav.sharedjava.format.ColorFormat;
import io.github.mjaroslav.sharedjava.format.Colors;
import lombok.experimental.UtilityClass;
Expand Down Expand Up @@ -39,7 +39,7 @@ public void renderBlocksCollisions(@NotNull Pos pos, int blockRadius) {
min.forEachBox(max, i -> {
list.clear();
colorCounter = 0;
UtilsPosBlock.addCollisionBoxesToList(UtilsPosWorld.getBlock(world, i), world, i, mask, list, null);
BlockPos.addCollisionBoxesToList(WorldPos.getBlock(world, i), world, i, mask, list, null);
list.forEach(box -> {
cycleDebugLinesColor(BlockAABBSet.isDeadZoned(box, i.getX().intValue(), i.getY().intValue(),
i.getZ().intValue()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import io.github.mjaroslav.mjutils.item.Stacks;
import io.github.mjaroslav.mjutils.lib.General.Creative.BlockBreaking;
import io.github.mjaroslav.mjutils.lib.General.Debug.BlockCollisionHighlighting;
import io.github.mjaroslav.mjutils.util.Pos;
import io.github.mjaroslav.mjutils.util.Pos.Mutable;
import io.github.mjaroslav.mjutils.pos.Pos;
import io.github.mjaroslav.mjutils.pos.Pos.Mutable;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.val;
Expand Down

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/main/java/io/github/mjaroslav/mjutils/pos/EntityPos.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.github.mjaroslav.mjutils.pos;

import lombok.experimental.UtilityClass;

@UtilityClass
public class EntityPos {
// TODO: WIP
}
8 changes: 8 additions & 0 deletions src/main/java/io/github/mjaroslav/mjutils/pos/ItemPos.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.github.mjaroslav.mjutils.pos;

import lombok.experimental.UtilityClass;

@UtilityClass
public class ItemPos {
// TODO: WIP
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.mjaroslav.mjutils.util;
package io.github.mjaroslav.mjutils.pos;

import com.google.common.collect.AbstractIterator;
import io.github.mjaroslav.sharedjava.tuple.Triplet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.mjaroslav.mjutils.util.game;
package io.github.mjaroslav.mjutils.pos;

import io.github.mjaroslav.sharedjava.tuple.Triplet;
import lombok.experimental.UtilityClass;
Expand All @@ -9,7 +9,7 @@

// TODO: MAKE DOCS AND MAKE FULL IT
@UtilityClass
public class UtilsPosWorld {
public class WorldPos {
public Block getBlock(@NotNull IBlockAccess owner, @NotNull Triplet<? extends Number, ? extends Number, ? extends Number> pos) {
return owner.getBlock(pos.getX().intValue(), pos.getY().intValue(), pos.getZ().intValue());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.mjaroslav.mjutils.util.object.game;

import io.github.mjaroslav.mjutils.asm.mixin.accessors.AccessorExplosion;
import io.github.mjaroslav.mjutils.util.Pos;
import io.github.mjaroslav.mjutils.pos.Pos;
import lombok.Getter;
import lombok.Setter;
import lombok.val;
Expand All @@ -15,8 +15,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import static io.github.mjaroslav.mjutils.util.game.UtilsPosBlock.*;
import static io.github.mjaroslav.mjutils.util.game.UtilsPosWorld.*;
import static io.github.mjaroslav.mjutils.pos.BlockPos.*;
import static io.github.mjaroslav.mjutils.pos.WorldPos.*;

@Getter
@Setter
Expand Down

0 comments on commit 4aa6e8b

Please sign in to comment.