Apply spotless

This commit is contained in:
glowredman committed 2022-12-15 00:44:24 +01:00
1 parent 362bf402bc
commit 048a6f55b2
12 files changed
+35 -51

No files matched your search

@@ -14,8 +14,7 @@ import net.minecraft.world.World;
* moving structure when moved through the {@link Relocator}. No other action besides
* implementation of this interface is needed for the block to function.
*/
public interface IFrame
{
public interface IFrame {
/**
* Used to check if this frame block is allowed to grab
* a block on the given side.
@@ -47,4 +46,4 @@ public interface IFrame
* @return True if the side can be grabbed by a frame block.
*/
boolean stickIn(World w, int x, int y, int z, int side);
}
}
@@ -14,8 +14,7 @@ import net.minecraft.world.World;
* implement the IFrame interface. This class must be registered in
* the {@link RelocationAPI}.
*/
public interface IFrameInteraction extends IFrame
{
public interface IFrameInteraction extends IFrame {
/**
* Check to see if this interaction can be executed at the given
* coordinates.
@@ -28,4 +27,4 @@ public interface IFrameInteraction extends IFrame
* location.
*/
boolean canInteract(World w, int x, int y, int z);
}
}
@@ -17,8 +17,7 @@ import net.minecraft.world.World;
* placement. This class can be registered through the
* {@link RelocationAPI}.
*/
public interface IFramePlacement
{
public interface IFramePlacement {
/**
* Called sequentially on all registered IFrameBlockPlacements on
* the frame item block's onItemUse function, until one returns true.
@@ -32,5 +31,6 @@ public interface IFramePlacement
* @param hit The exact hit position of the click.
* @return True if something happened. This will subsequently block the actual placement of the block.
*/
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, Vector3 hit);
}
public boolean onItemUse(
ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, Vector3 hit);
}
@@ -14,8 +14,7 @@ import net.minecraft.util.Vec3;
* <br><br>
* It is recommended that mods access this class within a soft dependency class.
*/
public abstract class MCFramesAPI
{
public abstract class MCFramesAPI {
/**
* This field will contain an implementor of this API if Relocation is installed.
*/
@@ -80,4 +79,4 @@ public abstract class MCFramesAPI
* @return The object position if anything from the frame model was hit.
*/
public abstract MovingObjectPosition raytraceFrame(double x, double y, double z, int mask, Vec3 start, Vec3 end);
}
}
@@ -5,16 +5,14 @@
*/
package mrtjp.mcframes.api;
import java.util.Set;
import mrtjp.relocation.api.BlockPos;
import net.minecraft.world.World;
import java.util.Set;
/**
* Helper class used to resolve frame structures.
*/
public abstract class StickResolver
{
public abstract class StickResolver {
/**
* Method used to obtain the block coordinates of every block that is part of the same
* framed structure as the one that was given as an argument.
@@ -28,4 +26,4 @@ public abstract class StickResolver
* @return A set of all block coordinates that are part of the structure that the input block was in.
*/
public abstract Set<BlockPos> getStructure(World world, int x, int y, int z, BlockPos... exclusions);
}
}
@@ -4,7 +4,5 @@
* All rights reserved.
*/
//@API(owner = "MCFrames", provides = "MCFrames|API", apiVersion = "GRADLETOKEN_VERSION")
// @API(owner = "MCFrames", provides = "MCFrames|API", apiVersion = "GRADLETOKEN_VERSION")
package mrtjp.mcframes.api;
import cpw.mods.fml.common.API;
@@ -9,31 +9,26 @@ package mrtjp.relocation.api;
* Lightweight block position object used to keep dependencies confined
* to the api package, used by some of the API's methods.
*/
public class BlockPos
{
public class BlockPos {
public int x;
public int y;
public int z;
public BlockPos(int x, int y, int z)
{
public BlockPos(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public boolean equals(Object obj)
{
if(!(obj instanceof BlockPos)) return false;
else
{
public boolean equals(Object obj) {
if (!(obj instanceof BlockPos)) return false;
else {
BlockPos o2 = (BlockPos) obj;
return this.x == o2.x && this.y == o2.y && this.z == o2.z;
}
}
public int hashCode()
{
return (this.x^this.z)*31+this.y;
public int hashCode() {
return (this.x ^ this.z) * 31 + this.y;
}
}
}
@@ -19,8 +19,7 @@ package mrtjp.relocation.api;
* can only happen server-side.
*
*/
public interface IMovementCallback
{
public interface IMovementCallback {
/**
* Called once move starts. The descriptor contains methods that
* describe the state of the current movement that this callback
@@ -42,4 +41,4 @@ public interface IMovementCallback
* Called when the movement completes, and all blocks have moved over.
*/
void onMovementFinished();
}
}
@@ -12,8 +12,7 @@ package mrtjp.relocation.api;
* Results of all methods is only valid during movement, undefined otherwise. Use
* isMoving() to check before using any values from this.
*/
public interface IMovementDescriptor
{
public interface IMovementDescriptor {
/**
* @return True if the structure is moving.
*/
@@ -28,4 +27,4 @@ public interface IMovementDescriptor
* @return The size of the moving structure, zero if it is no longer moving.
*/
int getSize();
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.World;
* Interface for an object that manages the movement of blocks and tiles that are
* registered to it. This class should be registered through the {@link RelocationAPI}.
*/
public interface ITileMover
{
public interface ITileMover {
/**
* Used to check if the block at the given position can move. This
* method is only called if the specified block is tied to this
@@ -60,4 +59,4 @@ public interface ITileMover
* @param z The z coordinate.
*/
void postMove(World w, int x, int y, int z);
}
}
@@ -14,8 +14,7 @@ import net.minecraft.world.World;
* <br><br>
* It is recommended that mods access this class within a soft dependency class.
*/
public abstract class RelocationAPI
{
public abstract class RelocationAPI {
/**
* This field will contain an implementor of this API if Relocation is installed.
*/
@@ -90,4 +89,4 @@ public abstract class RelocationAPI
* @return True if the block is currently moving.
*/
public abstract boolean isMoving(World world, int x, int y, int z);
}
}
@@ -5,16 +5,14 @@
*/
package mrtjp.relocation.api;
import net.minecraft.world.World;
import java.util.Set;
import net.minecraft.world.World;
/**
* Helper class used to queue and execute the movement of a set of blocks.
* See {@link mrtjp.mcframes.TileMotor} for usage.
*/
public abstract class Relocator
{
public abstract class Relocator {
/**
* Pushes an instance of the Relocator onto the stack.
* Must be called before using any methods.
@@ -76,7 +74,9 @@ public abstract class Relocator
* @throws IllegalStateException If the Relocator is not on the stack.
*/
public abstract void addBlock(int x, int y, int z);
public abstract void addBlock(BlockPos bc);
public abstract void addBlocks(Set<BlockPos> blocks);
/**
@@ -90,4 +90,4 @@ public abstract class Relocator
* or are invalid.
*/
public abstract boolean execute();
}
}