Skip to content

Commit

Permalink
Fix being able to open fusion reactor GUI via reactor glass
Browse files Browse the repository at this point in the history
  • Loading branch information
pupnewfster committed Apr 18, 2021
1 parent 9796eef commit 7d83fd5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public boolean hasFormedMultiblock() {

@Override
public boolean structuralGuiAccessAllowed() {
return hasFormedMultiblock() && !clientActiveMultiblock.contains("fusion") && !clientActiveMultiblock.contains("evaporation");
return hasFormedMultiblock() && structuralGuiAccessAllowed(clientActiveMultiblock);
}

protected boolean structuralGuiAccessAllowed(@Nonnull String multiblock) {
return !multiblock.contains("fusion") && !multiblock.contains("evaporation");
}

@Override
Expand Down Expand Up @@ -103,7 +107,7 @@ protected void onUpdateServer() {
public ActionResultType onActivate(PlayerEntity player, Hand hand, ItemStack stack) {
for (Map.Entry<MultiblockManager<?>, Structure> entry : structures.entrySet()) {
IMultiblock<?> master = entry.getValue().getController();
if (master != null && getMultiblockData(entry.getKey()).isFormed()) {
if (master != null && getMultiblockData(entry.getKey()).isFormed() && structuralGuiAccessAllowed(master.getManager().getName().toLowerCase(Locale.ROOT))) {
// make sure this block is on the structure first
if (entry.getValue().getMultiblockData().getBounds().getRelativeLocation(getBlockPos()).isWall()) {
return master.onActivate(player, hand, stack);
Expand Down

0 comments on commit 7d83fd5

Please sign in to comment.