9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-29 03:49:07 +00:00

update README

This commit is contained in:
XiaoMoMi
2024-08-26 01:11:35 +08:00
parent 63f445a7b3
commit ec6dcc85bb
27 changed files with 111 additions and 113 deletions

View File

@@ -47,7 +47,6 @@ import net.momirealms.customfishing.bukkit.sender.BukkitSenderFactory;
import net.momirealms.customfishing.bukkit.statistic.BukkitStatisticsManager;
import net.momirealms.customfishing.bukkit.storage.BukkitStorageManager;
import net.momirealms.customfishing.bukkit.totem.BukkitTotemManager;
import net.momirealms.customfishing.common.dependency.CustomFishingProperties;
import net.momirealms.customfishing.common.dependency.Dependency;
import net.momirealms.customfishing.common.dependency.DependencyManagerImpl;
import net.momirealms.customfishing.common.helper.VersionHelper;

View File

@@ -172,8 +172,8 @@ public class BukkitActionManager implements ActionManager<Player> {
List<String> messages = ListUtils.toList(args);
return context -> {
if (Math.random() > chance) return;
List<String> replaced = plugin.getPlaceholderManager().parse(context.getHolder(), messages, context.placeholderMap());
Audience audience = plugin.getSenderFactory().getAudience(context.getHolder());
List<String> replaced = plugin.getPlaceholderManager().parse(context.holder(), messages, context.placeholderMap());
Audience audience = plugin.getSenderFactory().getAudience(context.holder());
for (String text : replaced) {
audience.sendMessage(AdventureHelper.miniMessage(text));
}
@@ -184,8 +184,8 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
String random = messages.get(RandomUtils.generateRandomInt(0, messages.size() - 1));
random = BukkitPlaceholderManager.getInstance().parse(context.getHolder(), random, context.placeholderMap());
Audience audience = plugin.getSenderFactory().getAudience(context.getHolder());
random = BukkitPlaceholderManager.getInstance().parse(context.holder(), random, context.placeholderMap());
Audience audience = plugin.getSenderFactory().getAudience(context.holder());
audience.sendMessage(AdventureHelper.miniMessage(random));
};
});
@@ -193,7 +193,7 @@ public class BukkitActionManager implements ActionManager<Player> {
List<String> messages = ListUtils.toList(args);
return context -> {
if (Math.random() > chance) return;
List<String> replaced = plugin.getPlaceholderManager().parse(context.getHolder(), messages, context.placeholderMap());
List<String> replaced = plugin.getPlaceholderManager().parse(context.holder(), messages, context.placeholderMap());
for (Player player : Bukkit.getOnlinePlayers()) {
Audience audience = plugin.getSenderFactory().getAudience(player);
for (String text : replaced) {
@@ -209,7 +209,7 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
double realRange = range.evaluate(context);
Player owner = context.getHolder();
Player owner = context.holder();
Location location = requireNonNull(context.arg(ContextKeys.LOCATION));
for (Player player : location.getWorld().getPlayers()) {
if (LocationUtils.getDistance(player.getLocation(), location) <= realRange) {
@@ -238,7 +238,7 @@ public class BukkitActionManager implements ActionManager<Player> {
List<String> commands = ListUtils.toList(args);
return context -> {
if (Math.random() > chance) return;
List<String> replaced = BukkitPlaceholderManager.getInstance().parse(context.getHolder(), commands, context.placeholderMap());
List<String> replaced = BukkitPlaceholderManager.getInstance().parse(context.holder(), commands, context.placeholderMap());
plugin.getScheduler().sync().run(() -> {
for (String text : replaced) {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), text);
@@ -250,12 +250,12 @@ public class BukkitActionManager implements ActionManager<Player> {
List<String> commands = ListUtils.toList(args);
return context -> {
if (Math.random() > chance) return;
List<String> replaced = BukkitPlaceholderManager.getInstance().parse(context.getHolder(), commands, context.placeholderMap());
List<String> replaced = BukkitPlaceholderManager.getInstance().parse(context.holder(), commands, context.placeholderMap());
plugin.getScheduler().sync().run(() -> {
for (String text : replaced) {
context.getHolder().performCommand(text);
context.holder().performCommand(text);
}
}, context.getHolder().getLocation());
}, context.holder().getLocation());
};
});
registerAction("random-command", (args, chance) -> {
@@ -263,7 +263,7 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
String random = commands.get(ThreadLocalRandom.current().nextInt(commands.size()));
random = BukkitPlaceholderManager.getInstance().parse(context.getHolder(), random, context.placeholderMap());
random = BukkitPlaceholderManager.getInstance().parse(context.holder(), random, context.placeholderMap());
String finalRandom = random;
plugin.getScheduler().sync().run(() -> {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), finalRandom);
@@ -276,7 +276,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> range = MathValue.auto(section.get("range"));
return context -> {
if (Math.random() > chance) return;
Player owner = context.getHolder();
Player owner = context.holder();
double realRange = range.evaluate(context);
Location location = requireNonNull(context.arg(ContextKeys.LOCATION));
for (Player player : location.getWorld().getPlayers()) {
@@ -299,7 +299,7 @@ public class BukkitActionManager implements ActionManager<Player> {
private void registerCloseInvAction() {
registerAction("close-inv", (args, chance) -> condition -> {
if (Math.random() > chance) return;
condition.getHolder().closeInventory();
condition.holder().closeInventory();
});
}
@@ -308,8 +308,8 @@ public class BukkitActionManager implements ActionManager<Player> {
String text = (String) args;
return context -> {
if (Math.random() > chance) return;
Audience audience = plugin.getSenderFactory().getAudience(context.getHolder());
Component component = AdventureHelper.miniMessage(plugin.getPlaceholderManager().parse(context.getHolder(), text, context.placeholderMap()));
Audience audience = plugin.getSenderFactory().getAudience(context.holder());
Component component = AdventureHelper.miniMessage(plugin.getPlaceholderManager().parse(context.holder(), text, context.placeholderMap()));
audience.sendActionBar(component);
};
});
@@ -318,8 +318,8 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
String random = texts.get(RandomUtils.generateRandomInt(0, texts.size() - 1));
random = plugin.getPlaceholderManager().parse(context.getHolder(), random, context.placeholderMap());
Audience audience = plugin.getSenderFactory().getAudience(context.getHolder());
random = plugin.getPlaceholderManager().parse(context.holder(), random, context.placeholderMap());
Audience audience = plugin.getSenderFactory().getAudience(context.holder());
audience.sendActionBar(AdventureHelper.miniMessage(random));
};
});
@@ -329,7 +329,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> range = MathValue.auto(section.get("range"));
return context -> {
if (Math.random() > chance) return;
Player owner = context.getHolder();
Player owner = context.holder();
Location location = requireNonNull(context.arg(ContextKeys.LOCATION));
double realRange = range.evaluate(context);
for (Player player : location.getWorld().getPlayers()) {
@@ -353,7 +353,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
if (Math.random() > chance) return;
final Player player = context.getHolder();
final Player player = context.holder();
ExperienceOrb entity = player.getLocation().getWorld().spawn(player.getLocation().clone().add(0,0.5,0), ExperienceOrb.class);
entity.setExperience((int) value.evaluate(context));
};
@@ -362,7 +362,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
if (Math.random() > chance) return;
final Player player = context.getHolder();
final Player player = context.holder();
player.giveExp((int) Math.round(value.evaluate(context)));
Audience audience = plugin.getSenderFactory().getAudience(player);
AdventureHelper.playSound(audience, Sound.sound(Key.key("minecraft:entity.experience_orb.pickup"), Sound.Source.PLAYER, 1, 1));
@@ -372,7 +372,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
if (Math.random() > chance) return;
Player player = context.getHolder();
Player player = context.holder();
player.setLevel((int) Math.max(0, player.getLevel() + value.evaluate(context)));
};
});
@@ -383,7 +383,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
if (Math.random() > chance) return;
Player player = context.getHolder();
Player player = context.holder();
player.setFoodLevel((int) (player.getFoodLevel() + value.evaluate(context)));
};
});
@@ -391,7 +391,7 @@ public class BukkitActionManager implements ActionManager<Player> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
if (Math.random() > chance) return;
Player player = context.getHolder();
Player player = context.holder();
player.setSaturation((float) (player.getSaturation() + value.evaluate(context)));
};
});
@@ -404,7 +404,7 @@ public class BukkitActionManager implements ActionManager<Player> {
int amount = section.getInt("amount", 1);
return context -> {
if (Math.random() > chance) return;
Player player = context.getHolder();
Player player = context.holder();
boolean tempHand = mainOrOff;
EquipmentSlot hand = context.arg(ContextKeys.SLOT);
if (hand == EquipmentSlot.OFF_HAND || hand == EquipmentSlot.HAND) {
@@ -426,7 +426,7 @@ public class BukkitActionManager implements ActionManager<Player> {
int amount = section.getInt("amount", 1);
return context -> {
if (Math.random() > chance) return;
Player player = context.getHolder();
Player player = context.holder();
EquipmentSlot tempSlot = slot;
EquipmentSlot equipmentSlot = context.arg(ContextKeys.SLOT);
if (equipmentSlot != null) {
@@ -441,9 +441,9 @@ public class BukkitActionManager implements ActionManager<Player> {
if (itemStack.getItemMeta() == null)
return;
if (amount > 0) {
plugin.getItemManager().decreaseDamage(context.getHolder(), itemStack, amount);
plugin.getItemManager().decreaseDamage(context.holder(), itemStack, amount);
} else {
plugin.getItemManager().increaseDamage(context.getHolder(), itemStack, -amount, true);
plugin.getItemManager().increaseDamage(context.holder(), itemStack, -amount, true);
}
};
} else {
@@ -458,7 +458,7 @@ public class BukkitActionManager implements ActionManager<Player> {
boolean toInventory = section.getBoolean("to-inventory", false);
return context -> {
if (Math.random() > chance) return;
Player player = context.getHolder();
Player player = context.holder();
ItemStack itemStack = plugin.getItemManager().buildAny(context, id);
if (itemStack != null) {
int maxStack = itemStack.getMaxStackSize();
@@ -632,7 +632,7 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
if (!VaultHook.isHooked()) return;
VaultHook.deposit(context.getHolder(), value.evaluate(context));
VaultHook.deposit(context.holder(), value.evaluate(context));
};
});
registerAction("take-money", (args, chance) -> {
@@ -640,7 +640,7 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
if (!VaultHook.isHooked()) return;
VaultHook.withdraw(context.getHolder(), value.evaluate(context));
VaultHook.withdraw(context.holder(), value.evaluate(context));
};
});
}
@@ -657,7 +657,7 @@ public class BukkitActionManager implements ActionManager<Player> {
);
return context -> {
if (Math.random() > chance) return;
context.getHolder().addPotionEffect(potionEffect);
context.holder().addPotionEffect(potionEffect);
};
} else {
plugin.getPluginLogger().warn("Invalid value type: " + args.getClass().getSimpleName() + " found at potion-effect action which is expected to be `Section`");
@@ -677,7 +677,7 @@ public class BukkitActionManager implements ActionManager<Player> {
);
return context -> {
if (Math.random() > chance) return;
Audience audience = plugin.getSenderFactory().getAudience(context.getHolder());
Audience audience = plugin.getSenderFactory().getAudience(context.holder());
AdventureHelper.playSound(audience, sound);
};
} else {
@@ -697,7 +697,7 @@ public class BukkitActionManager implements ActionManager<Player> {
return context -> {
if (Math.random() > chance) return;
Optional.ofNullable(plugin.getIntegrationManager().getLevelerProvider(pluginName)).ifPresentOrElse(it -> {
it.addXp(context.getHolder(), target, value.evaluate(context));
it.addXp(context.holder(), target, value.evaluate(context));
}, () -> plugin.getPluginLogger().warn("Plugin (" + pluginName + "'s) level is not compatible. Please double check if it's a problem caused by pronunciation."));
};
} else {
@@ -717,7 +717,7 @@ public class BukkitActionManager implements ActionManager<Player> {
int fadeOut = section.getInt("fade-out", 10);
return context -> {
if (Math.random() > chance) return;
final Player player = context.getHolder();
final Player player = context.holder();
Audience audience = plugin.getSenderFactory().getAudience(player);
AdventureHelper.sendTitle(audience,
AdventureHelper.miniMessage(title.render(context)),
@@ -743,7 +743,7 @@ public class BukkitActionManager implements ActionManager<Player> {
if (Math.random() > chance) return;
TextValue<Player> title = TextValue.auto(titles.get(RandomUtils.generateRandomInt(0, titles.size() - 1)));
TextValue<Player> subtitle = TextValue.auto(subtitles.get(RandomUtils.generateRandomInt(0, subtitles.size() - 1)));
final Player player = context.getHolder();
final Player player = context.holder();
Audience audience = plugin.getSenderFactory().getAudience(player);
AdventureHelper.sendTitle(audience,
AdventureHelper.miniMessage(title.render(context)),
@@ -803,7 +803,7 @@ public class BukkitActionManager implements ActionManager<Player> {
String finalItemID = itemID;
return context -> {
if (Math.random() > chance) return;
Player owner = context.getHolder();
Player owner = context.holder();
Location location = position ? requireNonNull(context.arg(ContextKeys.OTHER_LOCATION)).clone() : owner.getLocation().clone();
location.add(x.evaluate(context), y.evaluate(context) - 1, z.evaluate(context));
if (opposite) location.setYaw(-owner.getLocation().getYaw());
@@ -851,7 +851,7 @@ public class BukkitActionManager implements ActionManager<Player> {
int range = section.getInt("range", 16);
return context -> {
if (Math.random() > chance) return;
Player owner = context.getHolder();
Player owner = context.holder();
Location location = position ? requireNonNull(context.arg(ContextKeys.OTHER_LOCATION)).clone() : owner.getLocation().clone();
location.add(x.evaluate(context), y.evaluate(context), z.evaluate(context));
FakeArmorStand armorStand = SparrowHeart.getInstance().createFakeArmorStand(location);
@@ -915,9 +915,9 @@ public class BukkitActionManager implements ActionManager<Player> {
context.arg(ContextKeys.SURROUNDING, previous);
}
if (loots.isEmpty()) {
plugin.getSenderFactory().wrap(context.getHolder()).sendMessage(TranslationManager.render(MessageConstants.COMMAND_FISH_FINDER_NO_LOOT.build()));
plugin.getSenderFactory().wrap(context.holder()).sendMessage(TranslationManager.render(MessageConstants.COMMAND_FISH_FINDER_NO_LOOT.build()));
} else {
plugin.getSenderFactory().wrap(context.getHolder()).sendMessage(TranslationManager.render(MessageConstants.COMMAND_FISH_FINDER_POSSIBLE_LOOTS.arguments(AdventureHelper.miniMessage(stringJoiner.toString())).build()));
plugin.getSenderFactory().wrap(context.holder()).sendMessage(TranslationManager.render(MessageConstants.COMMAND_FISH_FINDER_POSSIBLE_LOOTS.arguments(AdventureHelper.miniMessage(stringJoiner.toString())).build()));
}
};
});

View File

@@ -239,13 +239,13 @@ public class BukkitBlockManager implements BlockManager, Listener {
blockData = blockProviders.get("vanilla").blockData(context, blockID, config.dataModifier());
}
Location hookLocation = requireNonNull(context.arg(ContextKeys.OTHER_LOCATION));
Location playerLocation = requireNonNull(context.getHolder()).getLocation();
Location playerLocation = requireNonNull(context.holder()).getLocation();
FallingBlock fallingBlock = hookLocation.getWorld().spawn(hookLocation, FallingBlock.class);
fallingBlock.setBlockData(blockData);
fallingBlock.getPersistentDataContainer().set(
requireNonNull(NamespacedKey.fromString("block", plugin.getBoostrap())),
PersistentDataType.STRING,
id + ";" + context.getHolder().getName()
id + ";" + context.holder().getName()
);
double d0 = playerLocation.getX() - hookLocation.getX();
double d1 = playerLocation.getY() - hookLocation.getY();

View File

@@ -67,7 +67,7 @@ import net.momirealms.customfishing.bukkit.totem.particle.ParticleSetting;
import net.momirealms.customfishing.bukkit.util.ItemStackUtils;
import net.momirealms.customfishing.bukkit.util.ParticleUtils;
import net.momirealms.customfishing.common.config.node.Node;
import net.momirealms.customfishing.common.dependency.CustomFishingProperties;
import net.momirealms.customfishing.common.plugin.CustomFishingProperties;
import net.momirealms.customfishing.common.helper.AdventureHelper;
import net.momirealms.customfishing.common.helper.VersionHelper;
import net.momirealms.customfishing.common.item.AbstractItem;

View File

@@ -105,7 +105,7 @@ public class BukkitEntityManager implements EntityManager {
String id = context.arg(ContextKeys.ID);
EntityConfig config = requireNonNull(entities.get(id), "Entity " + id + " not found");
Location hookLocation = requireNonNull(context.arg(ContextKeys.OTHER_LOCATION));
Location playerLocation = requireNonNull(context.getHolder().getLocation());
Location playerLocation = requireNonNull(context.holder().getLocation());
String entityID = config.entityID();
Entity entity;
if (entityID.contains(":")) {

View File

@@ -134,7 +134,7 @@ public class BukkitItemManager implements ItemManager, Listener {
@NotNull
@Override
public ItemStack build(@NotNull Context<Player> context, @NotNull CustomFishingItem item) {
ItemStack itemStack = getOriginalStack(context.getHolder(), item.material());
ItemStack itemStack = getOriginalStack(context.holder(), item.material());
if (itemStack.getType() == Material.AIR) return itemStack;
itemStack.setAmount(Math.max(1, (int) item.amount().evaluate(context)));
Item<ItemStack> wrappedItemStack = factory.wrap(itemStack);
@@ -146,7 +146,7 @@ public class BukkitItemManager implements ItemManager, Listener {
@Override
public ItemStack buildAny(@NotNull Context<Player> context, @NotNull String item) {
return getOriginalStack(context.getHolder(), item);
return getOriginalStack(context.holder(), item);
}
@NotNull
@@ -174,7 +174,7 @@ public class BukkitItemManager implements ItemManager, Listener {
String id = requireNonNull(context.arg(ContextKeys.ID));
ItemStack itemStack;
if (id.equals("vanilla")) {
itemStack = SparrowHeart.getInstance().getFishingLoot(context.getHolder(), hook, rod).stream().findAny().orElseThrow(() -> new RuntimeException("new EntityItem would throw if for whatever reason (mostly shitty datapacks) the fishing loot turns out to be empty"));
itemStack = SparrowHeart.getInstance().getFishingLoot(context.holder(), hook, rod).stream().findAny().orElseThrow(() -> new RuntimeException("new EntityItem would throw if for whatever reason (mostly shitty datapacks) the fishing loot turns out to be empty"));
} else {
itemStack = requireNonNull(buildInternal(context, id));
}
@@ -183,7 +183,7 @@ public class BukkitItemManager implements ItemManager, Listener {
return null;
}
Player player = context.getHolder();
Player player = context.holder();
Location playerLocation = player.getLocation();
Location hookLocation = requireNonNull(context.arg(ContextKeys.OTHER_LOCATION));

View File

@@ -361,9 +361,9 @@ public class BukkitMarketManager implements MarketManager, Listener {
ActionManager.trigger(gui.context, sellDenyActions);
}
} else if (element.getSymbol() == sellAllSlot) {
List<ItemStack> itemStacksToSell = storageContentsToList(gui.context.getHolder().getInventory().getStorageContents());
List<ItemStack> itemStacksToSell = storageContentsToList(gui.context.holder().getInventory().getStorageContents());
if (sellFishingBag) {
Optional<UserData> optionalUserData = BukkitCustomFishingPlugin.getInstance().getStorageManager().getOnlineUser(gui.context.getHolder().getUniqueId());
Optional<UserData> optionalUserData = BukkitCustomFishingPlugin.getInstance().getStorageManager().getOnlineUser(gui.context.holder().getUniqueId());
optionalUserData.ifPresent(userData -> itemStacksToSell.addAll(storageContentsToList(userData.holder().getInventory().getStorageContents())));
}
Pair<Integer, Double> pair = getItemsToSell(gui.context, itemStacksToSell);

View File

@@ -91,8 +91,8 @@ public class MarketGUI {
}
public void show() {
context.getHolder().openInventory(inventory);
SparrowHeart.getInstance().updateInventoryTitle(context.getHolder(), AdventureHelper.componentToJson(AdventureHelper.miniMessage(manager.title.render(context))));
context.holder().openInventory(inventory);
SparrowHeart.getInstance().updateInventoryTitle(context.holder(), AdventureHelper.componentToJson(AdventureHelper.miniMessage(manager.title.render(context))));
}
@Nullable
@@ -132,9 +132,9 @@ public class MarketGUI {
MarketDynamicGUIElement sellAllElement = (MarketDynamicGUIElement) getElement(manager.sellAllSlot);
if (sellAllElement != null && !sellAllElement.getSlots().isEmpty()) {
List<ItemStack> itemStacksToSell = manager.storageContentsToList(context.getHolder().getInventory().getStorageContents());
List<ItemStack> itemStacksToSell = manager.storageContentsToList(context.holder().getInventory().getStorageContents());
if (manager.sellFishingBag) {
Optional<UserData> optionalUserData = BukkitCustomFishingPlugin.getInstance().getStorageManager().getOnlineUser(context.getHolder().getUniqueId());
Optional<UserData> optionalUserData = BukkitCustomFishingPlugin.getInstance().getStorageManager().getOnlineUser(context.holder().getUniqueId());
optionalUserData.ifPresent(userData -> itemStacksToSell.addAll(manager.storageContentsToList(userData.holder().getInventory().getStorageContents())));
}
Pair<Integer, Double> pair = manager.getItemsToSell(context, itemStacksToSell);
@@ -190,7 +190,7 @@ public class MarketGUI {
for (int slot : itemElement.getSlots()) {
ItemStack itemStack = inventory.getItem(slot);
if (itemStack != null && itemStack.getType() != Material.AIR) {
PlayerUtils.giveItem(context.getHolder(), itemStack, itemStack.getAmount());
PlayerUtils.giveItem(context.holder(), itemStack, itemStack.getAmount());
inventory.setItem(slot, new ItemStack(Material.AIR));
}
}

View File

@@ -248,8 +248,8 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
List<String> items = ListUtils.toList(section.get("item"));
return context -> {
ItemStack itemStack = mainOrOff ?
context.getHolder().getInventory().getItemInMainHand()
: context.getHolder().getInventory().getItemInOffHand();
context.holder().getInventory().getItemInMainHand()
: context.holder().getInventory().getItemInOffHand();
String id = plugin.getItemManager().getItemID(itemStack);
if (items.contains(id) && itemStack.getAmount() >= amount) return true;
if (runActions) ActionManager.trigger(context, actions);
@@ -274,7 +274,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
plugin.getPluginLogger().warn("Plugin (" + pluginName + "'s) level is not compatible. Please double check if it's a problem caused by pronunciation.");
return true;
}
if (levelerProvider.getLevel(context.getHolder(), target) >= level)
if (levelerProvider.getLevel(context.holder(), target) >= level)
return true;
if (runActions) ActionManager.trigger(context, actions);
return false;
@@ -693,7 +693,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
registerRequirement("level", (args, actions, runActions) -> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
int current = context.getHolder().getLevel();
int current = context.holder().getLevel();
if (current >= value.evaluate(context, true))
return true;
if (runActions) ActionManager.trigger(context, actions);
@@ -706,7 +706,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
registerRequirement("money", (args, actions, runActions) -> {
MathValue<Player> value = MathValue.auto(args);
return context -> {
double current = VaultHook.getBalance(context.getHolder());
double current = VaultHook.getBalance(context.holder());
if (current >= value.evaluate(context, true))
return true;
if (runActions) ActionManager.trigger(context, actions);
@@ -823,7 +823,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
String key = section.getString("key");
int time = section.getInt("time");
return context -> {
if (!plugin.getCoolDownManager().isCoolDown(context.getHolder().getUniqueId(), key, time))
if (!plugin.getCoolDownManager().isCoolDown(context.holder().getUniqueId(), key, time))
return true;
if (runActions) ActionManager.trigger(context, actions);
return false;
@@ -854,7 +854,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
List<String> perms = ListUtils.toList(args);
return context -> {
for (String perm : perms)
if (context.getHolder().hasPermission(perm))
if (context.holder().hasPermission(perm))
return true;
if (runActions) ActionManager.trigger(context, actions);
return false;
@@ -864,7 +864,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
List<String> perms = ListUtils.toList(args);
return context -> {
for (String perm : perms)
if (context.getHolder().hasPermission(perm)) {
if (context.holder().hasPermission(perm)) {
if (runActions) ActionManager.trigger(context, actions);
return false;
}
@@ -1145,7 +1145,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
String operator = potions.substring(split[0].length(), potions.length() - split[1].length());
return context -> {
int level = -1;
PotionEffect potionEffect = context.getHolder().getPotionEffect(type);
PotionEffect potionEffect = context.holder().getPotionEffect(type);
if (potionEffect != null) {
level = potionEffect.getAmplifier();
}