Skip to content

Commit

Permalink
Merge pull request Sefiraat#206 from JWJUN233233/master
Browse files Browse the repository at this point in the history
修复网络事件报错
  • Loading branch information
balugaq authored Feb 1, 2025
2 parents 1c1c4d7 + 6bcc70c commit 9e93afb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class NetworkRootLocateStorageEvent extends Event {
private final StorageType storageType;
private final boolean inputAble;
private final boolean outputAble;
public NetworkRootLocateStorageEvent(NetworkRoot root, StorageType storageType, boolean inputAble, boolean outputAble) {
super();
public NetworkRootLocateStorageEvent(NetworkRoot root, StorageType storageType, boolean inputAble, boolean outputAble, boolean isSync) {
super(!isSync);
this.root = root;
this.storageType = storageType;
this.inputAble = inputAble;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class NetworkRootReadyEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final NetworkRoot root;
public NetworkRootReadyEvent(NetworkRoot root) {
super();
super(true);
this.root = root;
}
@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ public Set<BarrelIdentity> getBarrels() {
}

this.barrels = barrelSet;
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.BARREL, true, true);
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.BARREL, true, true, Bukkit.isPrimaryThread());
Bukkit.getPluginManager().callEvent(event);
return barrelSet;
}
Expand Down Expand Up @@ -633,7 +633,7 @@ public Map<StorageUnitData, Location> getCargoStorageUnitDatas() {
}

this.cargoStorageUnitDatas = dataSet;
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.DRAWER, true, true);
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.DRAWER, true, true, Bukkit.isPrimaryThread());
Bukkit.getPluginManager().callEvent(event);
return dataSet;
}
Expand Down Expand Up @@ -1418,7 +1418,7 @@ public Set<BarrelIdentity> getInputAbleBarrels() {
}

this.inputAbleBarrels = barrelSet;
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.BARREL, true, false);
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.BARREL, true, false, Bukkit.isPrimaryThread());
Bukkit.getPluginManager().callEvent(event);
return barrelSet;
}
Expand Down Expand Up @@ -1488,7 +1488,7 @@ public Set<BarrelIdentity> getOutputAbleBarrels() {
}

this.outputAbleBarrels = barrelSet;
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.BARREL, false, true);
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.BARREL, false, true, Bukkit.isPrimaryThread());
Bukkit.getPluginManager().callEvent(event);
return barrelSet;
}
Expand Down Expand Up @@ -1531,7 +1531,7 @@ public Map<StorageUnitData, Location> getInputAbleCargoStorageUnitDatas() {
}

this.inputAbleCargoStorageUnitDatas = dataSet;
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.DRAWER, true, false);
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.DRAWER, true, false, Bukkit.isPrimaryThread());
Bukkit.getPluginManager().callEvent(event);
return dataSet;
}
Expand Down Expand Up @@ -1574,7 +1574,7 @@ public Map<StorageUnitData, Location> getOutputAbleCargoStorageUnitDatas() {
}

this.outputAbleCargoStorageUnitDatas = dataSet;
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.DRAWER, false, true);
NetworkRootLocateStorageEvent event = new NetworkRootLocateStorageEvent(this, StorageType.DRAWER, false, true, Bukkit.isPrimaryThread());
Bukkit.getPluginManager().callEvent(event);
return dataSet;
}
Expand Down

0 comments on commit 9e93afb

Please sign in to comment.