mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Another small cleanup
This commit is contained in:
1 parent
39fd0ed3b8
commit
5378f730fe
7 files changed
+6
-17
No files matched your search
@@ -17,7 +17,6 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.subtile.TileEntitySpecialFlower;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class SubTileManastar extends TileEntitySpecialFlower {
|
||||
@@ -46,7 +45,7 @@ public class SubTileManastar extends TileEntitySpecialFlower {
|
||||
}
|
||||
} else {
|
||||
int mana = 0;
|
||||
for (Direction dir : MathHelper.HORIZONTALS) {
|
||||
for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
BlockPos pos = getEffectivePos().offset(dir);
|
||||
if (getWorld().isBlockLoaded(pos)) {
|
||||
TileEntity tile = getWorld().getTileEntity(pos);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class TileSparkChanger extends TileSimpleInventory {
|
||||
|
||||
ItemStack changeStack = itemHandler.getStackInSlot(0);
|
||||
List<ISparkAttachable> attachables = new ArrayList<>();
|
||||
for (Direction dir : MathHelper.HORIZONTALS) {
|
||||
for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
TileEntity tile = world.getTileEntity(pos.offset(dir));
|
||||
if (tile instanceof ISparkAttachable) {
|
||||
ISparkAttachable attach = (ISparkAttachable) tile;
|
||||
|
||||
@@ -19,7 +19,6 @@ import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -40,7 +39,7 @@ public class TileDistributor extends TileMod implements IManaReceiver, ITickable
|
||||
return;
|
||||
}
|
||||
validPools.clear();
|
||||
for (Direction dir : MathHelper.HORIZONTALS) {
|
||||
for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
BlockPos pos = this.pos.offset(dir);
|
||||
if (world.isBlockLoaded(pos)) {
|
||||
TileEntity tileAt = world.getTileEntity(pos);
|
||||
|
||||
@@ -54,7 +54,6 @@ import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
import vazkii.botania.common.item.ItemManaTablet;
|
||||
@@ -299,7 +298,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
|
||||
int bellowCount = 0;
|
||||
if (outputting) {
|
||||
for (Direction dir : MathHelper.HORIZONTALS) {
|
||||
for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
TileEntity tile = world.getTileEntity(pos.offset(dir));
|
||||
if (tile instanceof TileBellows && ((TileBellows) tile).getLinkedTile() == this) {
|
||||
bellowCount++;
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
public final class MathHelper {
|
||||
public static final Direction[] HORIZONTALS = { Direction.SOUTH, Direction.WEST, Direction.NORTH, Direction.EAST };
|
||||
|
||||
public static float pointDistanceSpace(double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||
return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2));
|
||||
@@ -46,10 +45,4 @@ public final class MathHelper {
|
||||
return c1 & ~0xFFFFFF | r << 16 | g << 8 | b;
|
||||
}
|
||||
|
||||
private static final String[] ORDINAL_SUFFIXES = new String[] { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" };
|
||||
|
||||
public static String numberToOrdinal(int i) {
|
||||
return i % 100 == 11 || i % 100 == 12 || i % 100 == 13 ? i + "th" : i + ORDINAL_SUFFIXES[i % 10];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class EntityPoolMinecart extends AbstractMinecartEntity {
|
||||
public void moveMinecartOnRail(BlockPos pos) {
|
||||
super.moveMinecartOnRail(pos);
|
||||
|
||||
for (Direction dir : vazkii.botania.common.core.helper.MathHelper.HORIZONTALS) {
|
||||
for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
BlockPos posP = pos.offset(dir);
|
||||
Block block = world.getBlockState(posP).getBlock();
|
||||
if (block == ModBlocks.pump) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.ModTags;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -108,7 +107,7 @@ public class ItemTerraformRod extends Item implements IManaUsingItem, IBlockProv
|
||||
if (ModTags.Blocks.TERRAFORMABLE.contains(state.getBlock())) {
|
||||
List<BlockPos> airBlocks = new ArrayList<>();
|
||||
|
||||
for (Direction dir : MathHelper.HORIZONTALS) {
|
||||
for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
BlockPos pos_ = pos.offset(dir);
|
||||
BlockState state_ = world.getBlockState(pos_);
|
||||
Block block_ = state_.getBlock();
|
||||
|
||||
Reference in new issue
Block a user