mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-11-17 10:55:13 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
392d2ace8a
commit
464e44de85
76 files changed
+1717
-1863
No files matched your search
@@ -1,9 +1,10 @@
|
||||
package com.gtnewhorizon.structurelib;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.gtnewhorizon.structurelib.structure.IStructureElement;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
/**
|
||||
* Subscribers are <b>required</b> to not keep reference to these events, nor to depend on values of these events after
|
||||
@@ -12,10 +13,11 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
* All of these events will be fired on the {@link net.minecraftforge.common.MinecraftForge#EVENT_BUS}, if they are
|
||||
* enabled by {@link StructureLibAPI#enableInstrument(Object)}.
|
||||
* <p>
|
||||
* All public stuff in this class and its enclosed classes are considered part of the public API.
|
||||
* Backwards compatibility is maintained to the maximum extend possible.
|
||||
* All public stuff in this class and its enclosed classes are considered part of the public API. Backwards
|
||||
* compatibility is maintained to the maximum extend possible.
|
||||
*/
|
||||
public abstract class StructureEvent extends Event {
|
||||
|
||||
/*
|
||||
* In case the event is passed to another thread for processing.
|
||||
*/
|
||||
@@ -35,20 +37,21 @@ public abstract class StructureEvent extends Event {
|
||||
* Fired <b>just before</b> any structure element is visited.
|
||||
*/
|
||||
public static final class StructureElementVisitedEvent extends StructureEvent {
|
||||
|
||||
private final World world;
|
||||
private final int x, y, z;
|
||||
private final int a, b, c;
|
||||
private final IStructureElement<?> element;
|
||||
|
||||
/**
|
||||
* Fire this event on {@link MinecraftForge#EVENT_BUS} by populating it with given arguments.
|
||||
* Do nothing if instrumenting isn't enabled for current thread.
|
||||
* Fire this event on {@link MinecraftForge#EVENT_BUS} by populating it with given arguments. Do nothing if
|
||||
* instrumenting isn't enabled for current thread.
|
||||
* <p>
|
||||
* Any {@link Exception} thrown by event listeners will be logged and ignored. {@link Error} will be propagated
|
||||
* as is.
|
||||
*/
|
||||
public static void fireEvent(
|
||||
World world, int x, int y, int z, int a, int b, int c, IStructureElement<?> element) {
|
||||
public static void fireEvent(World world, int x, int y, int z, int a, int b, int c,
|
||||
IStructureElement<?> element) {
|
||||
if (StructureLibAPI.isInstrumentEnabled()) {
|
||||
try {
|
||||
MinecraftForge.EVENT_BUS.post(new StructureElementVisitedEvent(world, x, y, z, a, b, c, element));
|
||||
@@ -58,8 +61,8 @@ public abstract class StructureEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
StructureElementVisitedEvent(
|
||||
World world, int x, int y, int z, int a, int b, int c, IStructureElement<?> element) {
|
||||
StructureElementVisitedEvent(World world, int x, int y, int z, int a, int b, int c,
|
||||
IStructureElement<?> element) {
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@@ -107,14 +110,22 @@ public abstract class StructureEvent extends Event {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StructureElementVisitedEvent{" + "a="
|
||||
+ a + ", b="
|
||||
+ b + ", c="
|
||||
+ c + ", element="
|
||||
+ element + ", world="
|
||||
+ getWorld() + ", x="
|
||||
+ getX() + ", y="
|
||||
+ getY() + ", z="
|
||||
+ getZ() + '}';
|
||||
+ a
|
||||
+ ", b="
|
||||
+ b
|
||||
+ ", c="
|
||||
+ c
|
||||
+ ", element="
|
||||
+ element
|
||||
+ ", world="
|
||||
+ getWorld()
|
||||
+ ", x="
|
||||
+ getX()
|
||||
+ ", y="
|
||||
+ getY()
|
||||
+ ", z="
|
||||
+ getZ()
|
||||
+ '}';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user