Skip to content

Commit

Permalink
Merge pull request #2 from bsixel/GateMergeEvent
Browse files Browse the repository at this point in the history
Removed worldName from event
  • Loading branch information
bsixel authored Dec 21, 2020
2 parents a68cd7c + 67b7ec5 commit 57a14af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/mod/gcewing/sg/event/SGMergeEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class SGMergeEvent extends Event {
Private because the event should be read-only - including both the gatePosition and address
in case changes are made to gate address generation
*/
private final String worldName;
private final BlockPos gatePosition;
private final String address;
private final boolean merged;
Expand All @@ -20,24 +19,19 @@ public class SGMergeEvent extends Event {
/**
* Fired when a Stargate is merged or unmerged (the multiblock structure is completed or broken)
*/
public SGMergeEvent(String worldName, String address, boolean merged, BlockPos gatePosition, World world) {
this.worldName = worldName;
public SGMergeEvent(String address, boolean merged, BlockPos gatePosition, World world) {
this.gatePosition = gatePosition;
this.address = address;
this.merged = merged;
this.world = world;
}

public static SGMergeEvent fireEvent(String worldName, String address, boolean merged, BlockPos gatePosition, World world) {
SGMergeEvent event = new SGMergeEvent(worldName, address, merged, gatePosition, world);
public static SGMergeEvent fireEvent(String address, boolean merged, BlockPos gatePosition, World world) {
SGMergeEvent event = new SGMergeEvent(address, merged, gatePosition, world);
MinecraftForge.EVENT_BUS.post(event);
return event;
}

public String getWorldName() {
return worldName;
}

public BlockPos getGatePosition() {
return gatePosition;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mod/gcewing/sg/tileentity/SGBaseTE.java
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ public void setMerged(boolean state) {
if (logStargateEvents) {
log.info(String.format("STARGATE %s %s %s %s", action, name, pos, address));
}
SGMergeEvent.fireEvent(name, this.homeAddress, isMerged, this.pos, getWorld());
SGMergeEvent.fireEvent(this.homeAddress, isMerged, this.pos, getWorld());
if (state) {
GeneralAddressRegistry.addAddress(world, this.homeAddress);
} else {
Expand Down

0 comments on commit 57a14af

Please sign in to comment.