Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import java.util.ArrayList;

public interface AreaBox {
default ArrayList<BlockPos> getArea(Direction dir, BlockPos anchor, BlockPos negative, BlockPos positive){
public final class AreaBox {
public static ArrayList<BlockPos> getArea(Direction dir, BlockPos anchor, BlockPos negative, BlockPos positive){
ArrayList<BlockPos> blocks = new ArrayList<>();

for(int x = negative.getX(); x <= positive.getX(); x++)
Expand All @@ -17,7 +17,7 @@ default ArrayList<BlockPos> getArea(Direction dir, BlockPos anchor, BlockPos neg
return blocks;
}

default ArrayList<BlockPos> getAreaFromFacing(Direction dir, BlockPos anchor, int size, int depth){
public static ArrayList<BlockPos> getAreaFromFacing(Direction dir, BlockPos anchor, int size, int depth){
switch(dir) {
case SOUTH:
return getArea(dir, anchor, new BlockPos(-size, -size, -depth), new BlockPos(size, size, 0));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.unix_supremacist.item;

import io.github.unix_supremacist.interfaces.AreaBox;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
Expand All @@ -10,7 +9,9 @@

import java.util.ArrayList;

public class DestructionItem extends AbstractEmpowerableItem implements AreaBox {
import static io.github.unix_supremacist.interfaces.AreaBox.getAreaFromFacing;

public class DestructionItem extends AbstractEmpowerableItem {
protected final int[] MODES;
private final int maxWidth;
private final int maxDepth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

import java.util.ArrayList;

public class PhilosophersStoneItem extends AbstractEmpowerableItem implements AreaBox, TransmuteEntity {
import static io.github.unix_supremacist.interfaces.AreaBox.getAreaFromFacing;

public class PhilosophersStoneItem extends AbstractEmpowerableItem implements TransmuteEntity {
public PhilosophersStoneItem(Properties properties) {
super(properties, 3);
}
Expand Down