Skip to content

Commit

Permalink
hide secondary beacon effect if level < 4
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Nov 23, 2023
1 parent 7db6c3a commit def0ee3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ public interface BeaconBlockEntityAccess {
@Accessor("secondaryPower")
MobEffect wthit_secondaryPower();

@Accessor("levels")
int wthit_levels();

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void appendBody(ITooltip tooltip, IBlockAccessor accessor, IPluginConfig
public void appendData(IDataWriter data, IServerAccessor<BeaconBlockEntity> accessor, IPluginConfig config) {
if (config.getBoolean(Options.ATTRIBUTE_BEACON_EFFECTS)) data.add(Data.class, res -> {
var beacon = (BeaconBlockEntity & BeaconBlockEntityAccess) accessor.getTarget();
res.add(new Data(beacon.wthit_primaryPower(), beacon.wthit_secondaryPower()));
res.add(new Data(beacon.wthit_primaryPower(), beacon.wthit_levels() >= 4 ? beacon.wthit_secondaryPower() : null));
});
}

Expand Down

0 comments on commit def0ee3

Please sign in to comment.