aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-03-12 15:37:41 +0100
committerLéa Gris <lea.gris@noiraude.net>2021-03-12 15:37:41 +0100
commit9a5aa6f3f3a64c46b2a4f119f965f0c755d26cd2 (patch)
tree0347e4a8a532af1d40385832d9c59bfbd3766922 /src/main/java
parent6bda527a33fe4a7a5496cbb3185a04087293a18d (diff)
downloadGT5-Unofficial-9a5aa6f3f3a64c46b2a4f119f965f0c755d26cd2.tar.gz
GT5-Unofficial-9a5aa6f3f3a64c46b2a4f119f965f0c755d26cd2.tar.bz2
GT5-Unofficial-9a5aa6f3f3a64c46b2a4f119f965f0c755d26cd2.zip
requested changes
- Fix modifiers order - Fix redundant string literal - Fix indentation - fix missing run()
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java5
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java6
-rw-r--r--src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java34
3 files changed, 23 insertions, 22 deletions
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
index 3a8bbdfd70..158b53068d 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
@@ -3,8 +3,8 @@ package gregtech.api.interfaces.tileentity;
import cofh.api.energy.IEnergyReceiver;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.api.util.GT_Utility;
+import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.common.GT_Pollution;
import ic2.api.energy.tile.IEnergySink;
import net.minecraft.init.Blocks;
@@ -118,7 +118,8 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd
.setStrength(tStrength)
.setSmoking(true)
.setPosition(tX + 0.5, tY + 0.5, tZ + 0.5)
- .setWorld(tWorld);
+ .setWorld(tWorld)
+ .run();
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
index 59011d27a8..e6c24ec4b1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
@@ -456,9 +456,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
ForgeDirection.getOrientation(i).offsetZ / 5.0
)
.setPosition(
- aX - 0.5 + XSTR_INSTANCE.nextFloat(),
- aY - 0.5 + XSTR_INSTANCE.nextFloat(),
- aZ - 0.5 + XSTR_INSTANCE.nextFloat()
+ aX - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aY - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat()
).run()
);
}
diff --git a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java
index 0989e4da54..109a534d0d 100644
--- a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java
+++ b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java
@@ -11,7 +11,7 @@ import java.util.function.Consumer;
@SuppressWarnings("unused")
public abstract class WorldSpawnedEventBuilder implements Runnable {
-
+ private static final String ILLEGAL_STATE_STR1 = "Position, identifier and world must be set";
/* Variables */
private World world;
@@ -77,7 +77,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
/* Abstract Classes */
- private static abstract class EntityWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder implements IEntityWorldSpawnedEvent {
+ private abstract static class EntityWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder implements IEntityWorldSpawnedEvent {
private Entity entity;
@@ -93,7 +93,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- private static abstract class PositionedEntityWorldSpawnedEventBuilder extends EntityWorldSpawnedEventBuilder implements IPositionedWorldSpawnedEvent {
+ private abstract static class PositionedEntityWorldSpawnedEventBuilder extends EntityWorldSpawnedEventBuilder implements IPositionedWorldSpawnedEvent {
private Vec3 position;
@@ -116,7 +116,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
- private static abstract class PositionedWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder implements IPositionedWorldSpawnedEvent {
+ private abstract static class PositionedWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder implements IPositionedWorldSpawnedEvent {
private Vec3 position;
public Vec3 getPosition() {
@@ -134,7 +134,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- private static abstract class StringIdentifierPositionedWorldSpawnedEventBuilder extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent {
+ private abstract static class StringIdentifierPositionedWorldSpawnedEventBuilder extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent {
private String identifier;
@Override
@@ -149,7 +149,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- private static abstract class SoundStringIdentifierPositionedWorldSpawnedEventBuilder extends StringIdentifierPositionedWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent {
+ private abstract static class SoundStringIdentifierPositionedWorldSpawnedEventBuilder extends StringIdentifierPositionedWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent {
private float pitch;
private float volume;
@@ -179,7 +179,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
/* Implementations */
- public final static class ParticleEventBuilder extends StringIdentifierPositionedWorldSpawnedEventBuilder {
+ public static final class ParticleEventBuilder extends StringIdentifierPositionedWorldSpawnedEventBuilder {
private Vec3 motion;
@@ -230,7 +230,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- public final static class SoundEffectEventBuilder extends SoundStringIdentifierPositionedWorldSpawnedEventBuilder {
+ public static final class SoundEffectEventBuilder extends SoundStringIdentifierPositionedWorldSpawnedEventBuilder {
@Override
public SoundEffectEventBuilder setWorld(World world) {
@@ -265,7 +265,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
@Override
public void run() {
if (getPosition() == null || getIdentifier() == null || getWorld() == null)
- throw new IllegalStateException("Position, identifier and world must be set");
+ throw new IllegalStateException(ILLEGAL_STATE_STR1);
getWorld().playSoundEffect(
getPosition().xCoord, getPosition().yCoord, getPosition().zCoord,
@@ -275,7 +275,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- public final static class SoundEventBuilder extends SoundStringIdentifierPositionedWorldSpawnedEventBuilder {
+ public static final class SoundEventBuilder extends SoundStringIdentifierPositionedWorldSpawnedEventBuilder {
private boolean proximity;
@@ -321,7 +321,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
@Override
public void run() {
if (getPosition() == null || getIdentifier() == null || getWorld() == null)
- throw new IllegalStateException("Position, identifier and world must be set");
+ throw new IllegalStateException(ILLEGAL_STATE_STR1);
getWorld().playSound(
getPosition().xCoord, getPosition().yCoord, getPosition().zCoord,
@@ -334,7 +334,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
/**
* Positional Data is rounded down due to this targeting a block.
*/
- public final static class RecordEffectEventBuilder extends StringIdentifierPositionedWorldSpawnedEventBuilder {
+ public static final class RecordEffectEventBuilder extends StringIdentifierPositionedWorldSpawnedEventBuilder {
@Override
public RecordEffectEventBuilder setWorld(World world) {
@@ -359,7 +359,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
@Override
public void run() {
if (getPosition() == null || getIdentifier() == null || getWorld() == null)
- throw new IllegalStateException("Position, identifier and world must be set");
+ throw new IllegalStateException(ILLEGAL_STATE_STR1);
getWorld().playRecord(
getIdentifier(),
@@ -368,7 +368,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- public final static class ExplosionEffectEventBuilder extends PositionedEntityWorldSpawnedEventBuilder {
+ public static final class ExplosionEffectEventBuilder extends PositionedEntityWorldSpawnedEventBuilder {
private boolean isFlaming, isSmoking;
private float strength;
@@ -427,7 +427,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
/**
* Positional Data is rounded down due to this targeting a block.
*/
- public final static class ExtinguishFireEffectEventBuilder extends PositionedWorldSpawnedEventBuilder implements IEntityPlayerWorldSpawnedEvent {
+ public static final class ExtinguishFireEffectEventBuilder extends PositionedWorldSpawnedEventBuilder implements IEntityPlayerWorldSpawnedEvent {
private int side;
private EntityPlayer entityPlayer;
@@ -476,7 +476,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- public final static class SoundAtEntityEventBuilder extends EntityWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent {
+ public static final class SoundAtEntityEventBuilder extends EntityWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent {
private float pitch;
private float volume;
@@ -534,7 +534,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
}
- public final static class SoundToNearExceptEventBuilder extends WorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent, IEntityPlayerWorldSpawnedEvent {
+ public static final class SoundToNearExceptEventBuilder extends WorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent, IEntityPlayerWorldSpawnedEvent {
private float pitch;
private float volume;