Check only enabled Permissions for Range

This commit is contained in:
Sn0wStorm 2021-06-14 22:52:52 +02:00
parent b43c647c5f
commit e67ae3a770
4 changed files with 3 additions and 7 deletions

View File

@ -182,13 +182,12 @@ public class BCauldron {
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

View File

@ -220,6 +220,7 @@ public class BDistiller {
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

View File

@ -29,9 +29,6 @@ public class CauldronListener implements Listener {
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
@ -43,8 +40,6 @@ public class CauldronListener implements Listener {
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());

View File

@ -118,6 +118,7 @@ public class PermissionUtil {
*/
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();