Skip to content

Commit

Permalink
Check only enabled Permissions for Range
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wStorm committed Jun 14, 2021
1 parent b43c647 commit e67ae3a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/com/dre/brewery/BCauldron.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ public boolean fill(Player player, Block block) {
return false;
}

// If the Water_Cauldron type exists and the cauldron is on last level
if (LegacyUtil.WATER_CAULDRON != null && cauldron.getLevel() == 1) {
// Empty Cauldron
P.p.log("Empty Cauldron");
block.setType(Material.CAULDRON);
bcauldrons.remove(block);
} else {
P.p.log("Setting level to : " + (cauldron.getLevel() - 1));
cauldron.setLevel(cauldron.getLevel() - 1);

// Update the new Level to the Block
Expand Down
1 change: 1 addition & 0 deletions src/com/dre/brewery/BDistiller.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ private boolean prepareForDistillables(BrewingStand stand) {
if (P.use1_11) {
// The trick below doesnt work in 1.11, but we dont need it anymore
// This should only happen with older Brews that have been made with the old Potion Color System
// This causes standard potions to not brew in the brewing stand if put together with Brews, but the bubble animation will play
stand.setBrewingTime(Short.MAX_VALUE);
} else {
// Brewing time is sent and stored as short
Expand Down
5 changes: 0 additions & 5 deletions src/com/dre/brewery/listeners/CauldronListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public void onCauldronChange(CauldronLevelChangeEvent event) {
BlockState newState = event.getNewState();
Material newType = newState.getType();

P.p.log("OldType: " + currentType + " NewType: " + newType);


if (currentType == Material.WATER_CAULDRON) {
if (newType != Material.WATER_CAULDRON) {
// Change from water to anything else
Expand All @@ -43,8 +40,6 @@ public void onCauldronChange(CauldronLevelChangeEvent event) {
Levelled oldCauldron = ((Levelled) event.getBlock().getBlockData());
Levelled newCauldron = ((Levelled) newState.getBlockData());

P.p.log("OldLevel: " + oldCauldron.getLevel() + " Newlevel: " + newCauldron.getLevel());

// Water Level increased somehow, might be Bucket, Bottle, Rain, etc.
if (newCauldron.getLevel() > oldCauldron.getLevel()) {
BCauldron.remove(event.getBlock());
Expand Down
1 change: 1 addition & 0 deletions src/com/dre/brewery/utility/PermissionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public static int getAlcRecovery(Permissible player) {
*/
public static int getRangedPermission(Permissible player, String subPermission) {
Optional<PermissionAttachmentInfo> found = player.getEffectivePermissions().stream().
filter(PermissionAttachmentInfo::getValue). // Only active permissions
filter(x -> x.getPermission().startsWith(subPermission)).
findFirst();

Expand Down

0 comments on commit e67ae3a

Please sign in to comment.