Compare commits

...

14 Commits

Author SHA1 Message Date
nossr50
182e228ebd add missing TURTLE_HELMET to tier 1 ingredients in potions.yml fixes #5143 2025-03-09 17:20:53 -07:00
nossr50
bc6e4bc056 fix Folia throwing IllegalArgumentException 2025-03-09 16:35:20 -07:00
nossr50
44b22559fb Revert "github actions should use Java 21"
This reverts commit 571a60f7a798bf916c9236663b3d8231c7085a8d.
2025-03-09 15:57:46 -07:00
nossr50
0408040d7a Revert "bump world-edit dependency version"
This reverts commit 363ae7351f2eb8ada733eafcc0f94a2a725a3ef3.
2025-03-09 15:56:21 -07:00
nossr50
571a60f7a7 github actions should use Java 21 2025-03-09 15:49:59 -07:00
nossr50
b2bf29cae2 tweaks to start up msg 2025-03-09 15:49:26 -07:00
nossr50
6ad9d97236 Fix mcMMO trying to load incompatible potions on older versions 2025-03-09 15:45:32 -07:00
nossr50
6df73e522e Add missing entries to potion.yml for Breeze_Rod 2025-03-09 15:45:18 -07:00
nossr50
e6f3d63923 fix FoliaLib not being shaded into compiled jar 2025-03-09 14:20:20 -07:00
nossr50
871374ce84 adventure API bump 2025-03-09 14:18:19 -07:00
nossr50
363ae7351f bump world-edit dependency version 2025-03-09 14:08:33 -07:00
nossr50
be0570fccb cleanup pom.xml and reduce noise in build 2025-03-09 13:57:17 -07:00
nossr50
9d5566ae0e update FoliaLib repo for build instructions fixes #5162 2025-03-09 13:47:52 -07:00
nossr50
125aefacbb fix github actions 2025-03-09 13:40:43 -07:00
48 changed files with 225 additions and 119 deletions

View File

@ -29,11 +29,11 @@ jobs:
# 1. Check out the current working tree
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
# 2. Setup Java 17 JDK (Adopt)
- name: Java 17 setup
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: jdk
@ -41,7 +41,7 @@ jobs:
# 3. Setup local Maven package cache to speed up building
- name: Cache Maven packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

View File

@ -1,3 +1,16 @@
Version 2.2.033
Added Breeze_Rod entries to potions.yml for Awkward potion (see notes)
Added missing TURTLE_HELMET entry to potions.yml for Tier 1 ingredients
Added missing Wind Charging potion entries to potions.yml (see notes)
Fixed bug where mcMMO would attempt to load potions that required ingredients or effects from newer versions of Minecraft
mcMMO is a little more specific during start up of how many potions it loaded, it will now report on incompatible potions from being on an older game version.
NOTES:
You will have to update your potions.yml manually to receive these changes, it is highly recommended that if you haven't customized this file that you simply just delete it, mcMMO will generate a new one on the next start up and it will contain all the missing entries.
If you have customized this file, you can find the "default" version of this file here on the mcMMO github repo: https://github.com/mcMMO-Dev/mcMMO/blob/master/src/main/resources/potions.yml
You can use this file to compare it to your own and make the manual changes needed to get the new entries.
After making the changes to potions.yml (either via deleting it or not...) mcMMO should now recognize the Wind Charging potion and the Awkward potion created from Breeze Rods
Version 2.2.032
Fixed bug where Roll would throw exceptions with certain CMI interactions
Blast Mining no longer drops infested block variants

41
pom.xml
View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.2.032</version>
<version>2.2.033-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>
@ -76,6 +76,15 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<propertiesEncoding>UTF-8</propertiesEncoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
@ -162,7 +171,7 @@
<include>net.kyori:option</include>
<include>net.kyori:adventure-text-serializer-craftbukkit</include>
<include>co.aikar:acf-bukkit</include>
<include>com.tcoded:FoliaLib</include>
<include>com.github.technicallycoded:FoliaLib</include>
</includes>
</artifactSet>
<relocations>
@ -259,15 +268,15 @@
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>devmart-other</id>
<url>https://nexuslite.gcnt.net/repos/other/</url>
</repository>
<!-- MockBukkit -->
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
@ -280,7 +289,7 @@
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>LATEST</version>
<version>5.3.0</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -308,37 +317,37 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json-legacy-impl</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId>
<version>4.17.0</version>
<version>4.19.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
@ -448,9 +457,9 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.tcoded</groupId>
<groupId>com.github.technicallycoded</groupId>
<artifactId>FoliaLib</artifactId>
<version>0.3.1</version>
<version>dev-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -64,10 +64,10 @@ public class ConvertDatabaseCommand implements CommandExecutor {
mcMMO.getDatabaseManager().saveUser(profile);
}
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
mcMMO.p.getFoliaLib().getImpl().runAsync(new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()));
mcMMO.p.getFoliaLib().getScheduler().runAsync(new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()));
return true;
}
return false;

View File

@ -36,10 +36,10 @@ public class ConvertExperienceCommand implements CommandExecutor {
UserManager.saveAll();
UserManager.clearAll();
mcMMO.p.getFoliaLib().getImpl().runLater(new FormulaConversionTask(sender, newType), 1);
mcMMO.p.getFoliaLib().getScheduler().runLater(new FormulaConversionTask(sender, newType), 1);
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
return true;

View File

@ -244,7 +244,7 @@ public class PtpCommand implements TabExecutor {
if (warmup > 0) {
teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup));
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(teleportingPlayer, new TeleportationWarmup(mcMMOPlayer, mcMMOTarget), 20 * warmup);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(teleportingPlayer, new TeleportationWarmup(mcMMOPlayer, mcMMOTarget), 20 * warmup);
} else {
EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer);
}

View File

@ -110,7 +110,7 @@ public class McRankCommand implements TabExecutor {
boolean useBoard = mcMMO.p.getGeneralConfig().getScoreboardsEnabled() && (sender instanceof Player) && (mcMMO.p.getGeneralConfig().getRankUseBoard());
boolean useChat = !useBoard || mcMMO.p.getGeneralConfig().getRankUseChat();
mcMMO.p.getFoliaLib().getImpl().runAsync(new McRankCommandAsyncTask(playerName, sender, useBoard, useChat));
mcMMO.p.getFoliaLib().getScheduler().runAsync(new McRankCommandAsyncTask(playerName, sender, useBoard, useChat));
}
private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) {

View File

@ -127,7 +127,7 @@ public class McTopCommand implements TabExecutor {
boolean useBoard = (sender instanceof Player) && (mcMMO.p.getGeneralConfig().getTopUseBoard());
boolean useChat = !useBoard || mcMMO.p.getGeneralConfig().getTopUseChat();
mcMMO.p.getFoliaLib().getImpl().runAsync(new McTopCommandAsyncTask(page, skill, sender, useBoard, useChat));
mcMMO.p.getFoliaLib().getScheduler().runAsync(new McTopCommandAsyncTask(page, skill, sender, useBoard, useChat));
}
private PrimarySkillType extractSkill(CommandSender sender, String skillName) {

View File

@ -4,6 +4,7 @@ import com.gmail.nossr50.config.LegacyConfigLoader;
import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.LogUtils;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.Material;
@ -14,6 +15,7 @@ import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.VisibleForTesting;
import java.io.File;
@ -26,6 +28,14 @@ import static com.gmail.nossr50.util.ItemUtils.setItemName;
import static com.gmail.nossr50.util.PotionUtil.*;
public class PotionConfig extends LegacyConfigLoader {
private static final String BREEZE_ROD_STR = "BREEZE_ROD";
private static final String INFESTED_EFFECT_STR = "INFESTED";
private static final String WEAVING_EFFECT_STR = "WEAVING";
private static final String OOZING_EFFECT_STR = "OOZING";
private static final String WIND_CHARGED_EFFECT_STR = "WIND_CHARGED";
private static final String SLIME_BLOCK_STR = "SLIME_BLOCK";
private static final String COBWEB_STR = "COBWEB";
private static final String STONE_STR = "STONE";
private final List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<>();
private final List<ItemStack> concoctionsIngredientsTierTwo = new ArrayList<>();
@ -35,6 +45,17 @@ public class PotionConfig extends LegacyConfigLoader {
private final List<ItemStack> concoctionsIngredientsTierSix = new ArrayList<>();
private final List<ItemStack> concoctionsIngredientsTierSeven = new ArrayList<>();
private final List<ItemStack> concoctionsIngredientsTierEight = new ArrayList<>();
private final AlchemyPotionConfigResult INCOMPATIBLE_POTION_RESULT = new AlchemyPotionConfigResult(null,
AlchemyPotionConfigResultType.INCOMPATIBLE);
private final AlchemyPotionConfigResult ERROR_POTION_RESULT = new AlchemyPotionConfigResult(null,
AlchemyPotionConfigResultType.ERROR);
record AlchemyPotionConfigResult(AlchemyPotion alchemyPotion, AlchemyPotionConfigResultType resultType) {}
enum AlchemyPotionConfigResultType {
LOADED,
INCOMPATIBLE,
ERROR;
}
/**
* Map of potion names to AlchemyPotion objects.
@ -93,39 +114,46 @@ public class PotionConfig extends LegacyConfigLoader {
}
}
}
/**
* Find the Potions configuration section and load all defined potions.
*/
int loadPotionMap() {
ConfigurationSection potionSection = config.getConfigurationSection("Potions");
int potionsLoaded = 0;
int incompatible = 0;
int failures = 0;
for (String potionName : potionSection.getKeys(false)) {
AlchemyPotion potion = loadPotion(potionSection.getConfigurationSection(potionName));
AlchemyPotionConfigResult alchemyPotionConfigResult = loadPotion(potionSection.getConfigurationSection(potionName));
AlchemyPotion potion = alchemyPotionConfigResult.alchemyPotion;
if (potion != null) {
alchemyPotions.put(potionName, potion);
potionsLoaded++;
} else {
failures++;
if (alchemyPotionConfigResult.resultType == AlchemyPotionConfigResultType.INCOMPATIBLE) {
incompatible++;
} else {
failures++;
}
}
}
mcMMO.p.getLogger().info("Loaded " + potionsLoaded + " Alchemy potions, skipped " + failures + ".");
int totalPotions = potionsLoaded + incompatible + failures;
mcMMO.p.getLogger().info("Loaded " + potionsLoaded + " of " + totalPotions + " Alchemy potions.");
if (incompatible > 0) {
mcMMO.p.getLogger().info("Skipped " + incompatible + " Alchemy potions that require a newer" +
" Minecraft game version.");
}
if (failures > 0) {
mcMMO.p.getLogger().info("Failed to load " + failures + " Alchemy potions that encountered errors while loading.");
}
return potionsLoaded;
}
/**
* Parse a ConfigurationSection representing a AlchemyPotion.
* Returns null if input cannot be parsed.
*
* @param potion_section ConfigurationSection to be parsed.
*
* @return Parsed AlchemyPotion.
*/
private AlchemyPotion loadPotion(ConfigurationSection potion_section) {
private @NotNull AlchemyPotionConfigResult loadPotion(ConfigurationSection potion_section) {
try {
final String key = potion_section.getName();
@ -159,7 +187,7 @@ public class PotionConfig extends LegacyConfigLoader {
if (potionMeta == null) {
mcMMO.p.getLogger().severe("PotionConfig: Failed to get PotionMeta for " + key + ", from configuration section:" +
" " + potion_section);
return null;
return ERROR_POTION_RESULT;
}
// extended and upgraded seem to be mutually exclusive
@ -173,14 +201,14 @@ public class PotionConfig extends LegacyConfigLoader {
if (potionTypeStr == null) {
mcMMO.p.getLogger().severe("PotionConfig: Missing PotionType for " + key + ", from configuration section:" +
" " + potion_section);
return null;
return ERROR_POTION_RESULT;
}
// This works via side effects
// TODO: Redesign later, side effects are stupid
if(!setPotionType(potionMeta, potionTypeStr, upgraded, extended)) {
mcMMO.p.getLogger().severe("PotionConfig: Failed to set parameters of potion for " + key + ": " + potionTypeStr);
return null;
return ERROR_POTION_RESULT;
}
final List<String> lore = new ArrayList<>();
@ -194,6 +222,12 @@ public class PotionConfig extends LegacyConfigLoader {
if (potion_section.contains("Effects")) {
for (String effect : potion_section.getStringList("Effects")) {
String[] parts = effect.split(" ");
if (isTrickyTrialsPotionEffect(parts[0])
&& !mcMMO.getCompatibilityManager().getMinecraftGameVersion().isAtLeast(1, 21, 0)) {
LogUtils.debug(mcMMO.p.getLogger(), "Skipping potion effect " + effect +" because it is not" +
" compatible with the current Minecraft game version.");
return INCOMPATIBLE_POTION_RESULT;
}
PotionEffectType type = parts.length > 0 ? PotionEffectType.getByName(parts[0]) : null;
int amplifier = parts.length > 1 ? Integer.parseInt(parts[1]) : 0;
@ -217,12 +251,19 @@ public class PotionConfig extends LegacyConfigLoader {
final Map<ItemStack, String> children = new HashMap<>();
if (potion_section.contains("Children")) {
for (String child : potion_section.getConfigurationSection("Children").getKeys(false)) {
ItemStack ingredient = loadIngredient(child);
for (String childIngredient : potion_section.getConfigurationSection("Children").getKeys(false)) {
// Breeze Rod was only for potions after 1.21.0
if (isTrickyTrialsIngredient(childIngredient)
&& !mcMMO.getCompatibilityManager().getMinecraftGameVersion().isAtLeast(1, 21, 0)) {
continue;
}
ItemStack ingredient = loadIngredient(childIngredient);
if (ingredient != null) {
children.put(ingredient, potion_section.getConfigurationSection("Children").getString(child));
children.put(ingredient,
potion_section.getConfigurationSection("Children").getString(childIngredient));
} else {
mcMMO.p.getLogger().severe("PotionConfig: Failed to parse child for potion " + key + ": " + child);
mcMMO.p.getLogger().severe(
"PotionConfig: Failed to parse child for potion " + key + ": " + childIngredient);
}
}
}
@ -231,14 +272,25 @@ public class PotionConfig extends LegacyConfigLoader {
// TODO: Might not need to .setItemMeta
itemStack.setItemMeta(potionMeta);
return new AlchemyPotion(potion_section.getName(), itemStack, children);
return new AlchemyPotionConfigResult(new AlchemyPotion(potion_section.getName(), itemStack, children),
AlchemyPotionConfigResultType.LOADED);
} catch (Exception e) {
mcMMO.p.getLogger().warning("PotionConfig: Failed to load Alchemy potion: " + potion_section.getName());
e.printStackTrace();
return null;
return ERROR_POTION_RESULT;
}
}
private static boolean isTrickyTrialsIngredient(String ingredientStr) {
return ingredientStr.equalsIgnoreCase(BREEZE_ROD_STR) || ingredientStr.equalsIgnoreCase(SLIME_BLOCK_STR)
|| ingredientStr.equalsIgnoreCase(COBWEB_STR) || ingredientStr.equalsIgnoreCase(STONE_STR);
}
private static boolean isTrickyTrialsPotionEffect(String effectStr) {
return effectStr.equalsIgnoreCase(INFESTED_EFFECT_STR) || effectStr.equalsIgnoreCase(WEAVING_EFFECT_STR)
|| effectStr.equalsIgnoreCase(OOZING_EFFECT_STR) || effectStr.equalsIgnoreCase(WIND_CHARGED_EFFECT_STR);
}
private boolean setPotionType(PotionMeta potionMeta, String potionTypeStr, boolean upgraded, boolean extended) {
final PotionType potionType = matchPotionType(potionTypeStr, upgraded, extended);

View File

@ -1472,7 +1472,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` ADD `uuid` varchar(36) NULL DEFAULT NULL");
statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` ADD UNIQUE INDEX `uuid` (`uuid`) USING BTREE");
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new GetUUIDUpdatesRequired(), 100); // wait until after first purge
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new GetUUIDUpdatesRequired(), 100); // wait until after first purge
}
mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS);

View File

@ -963,7 +963,7 @@ public class McMMOPlayer implements Identified {
}
setToolPreparationMode(tool, false);
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new AbilityDisableTask(this, superAbilityType), (long) ticks * Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new AbilityDisableTask(this, superAbilityType), (long) ticks * Misc.TICK_CONVERSION_FACTOR);
}
public void processAbilityActivation(@NotNull PrimarySkillType primarySkillType) {
@ -1021,7 +1021,7 @@ public class McMMOPlayer implements Identified {
}
setToolPreparationMode(tool, true);
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new ToolLowerTask(this, tool), 4 * Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new ToolLowerTask(this, tool), 4 * Misc.TICK_CONVERSION_FACTOR);
}
}

View File

@ -108,16 +108,16 @@ public class PlayerProfile {
}
public void scheduleAsyncSave() {
mcMMO.p.getFoliaLib().getImpl().runAsync(new PlayerProfileSaveTask(this, false));
mcMMO.p.getFoliaLib().getScheduler().runAsync(new PlayerProfileSaveTask(this, false));
}
public void scheduleAsyncSaveDelay() {
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileSaveTask(this, false), 20);
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileSaveTask(this, false), 20);
}
@Deprecated
public void scheduleSyncSaveDelay() {
mcMMO.p.getFoliaLib().getImpl().runLater(new PlayerProfileSaveTask(this, true), 20);
mcMMO.p.getFoliaLib().getScheduler().runLater(new PlayerProfileSaveTask(this, true), 20);
}
public void save(boolean useSync) {
@ -143,7 +143,7 @@ public class PlayerProfile {
//Back out of async saving if we detect a server shutdown, this is not always going to be caught
if (mcMMO.isServerShutdownExecuted() || useSync)
mcMMO.p.getFoliaLib().getImpl().runNextTick(new PlayerProfileSaveTask(this, true));
mcMMO.p.getFoliaLib().getScheduler().runNextTick(new PlayerProfileSaveTask(this, true));
else
scheduleAsyncSave();

View File

@ -135,7 +135,7 @@ public class BlockListener implements Listener {
final BlockFace direction = event.getDirection();
for (final Block block : event.getBlocks()) {
mcMMO.p.getFoliaLib().getImpl().runAtLocation(block.getLocation(), t -> {
mcMMO.p.getFoliaLib().getScheduler().runAtLocation(block.getLocation(), t -> {
final Block movedBlock = block.getRelative(direction);
if (BlockUtils.isWithinWorldBounds(movedBlock)) {

View File

@ -216,7 +216,7 @@ public class EntityListener implements Listener {
entity.setMetadata(MetadataConstants.METADATA_KEY_TRAVELING_BLOCK, MetadataConstants.MCMMO_METADATA_VALUE);
TravelingBlockMetaCleanup metaCleanupTask = new TravelingBlockMetaCleanup(entity, pluginRef);
mcMMO.p.getFoliaLib().getImpl().runAtEntityTimer(entity, metaCleanupTask, 20, 20*60); //6000 ticks is 5 minutes
mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(entity, metaCleanupTask, 20, 20*60); //6000 ticks is 5 minutes
} else if (isTracked) {
BlockUtils.setUnnaturalBlock(block);
entity.removeMetadata(MetadataConstants.METADATA_KEY_TRAVELING_BLOCK, pluginRef);

View File

@ -461,7 +461,7 @@ public class InventoryListener implements Listener {
return;
}
mcMMO.p.getFoliaLib().getImpl().runAtEntity(whoClicked, new PlayerUpdateInventoryTask((Player) whoClicked));
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(whoClicked, new PlayerUpdateInventoryTask((Player) whoClicked));
}
}

View File

@ -146,7 +146,7 @@ public class PlayerListener implements Listener {
new MobHealthDisplayUpdaterTask(attacker).run();
// set the name back
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(attacker, () -> MobHealthbarUtils.handleMobHealthbars(attacker, 0, mcMMO.p), 1);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(attacker, () -> MobHealthbarUtils.handleMobHealthbars(attacker, 0, mcMMO.p), 1);
}
/**
@ -575,7 +575,7 @@ public class PlayerListener implements Listener {
Player player = event.getPlayer();
//Delay loading for 3 seconds in case the player has a save task running, its hacky but it should do the trick
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileLoadingTask(player), 60);
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 60);
if (mcMMO.p.getGeneralConfig().getMOTDEnabled() && Permissions.motd(player)) {
Motd.displayAll(player);

View File

@ -30,7 +30,7 @@ public class WorldListener implements Listener {
return;
// Using 50 ms later as I do not know of a way to run one tick later (safely)
plugin.getFoliaLib().getImpl().runLater(() -> {
plugin.getFoliaLib().getScheduler().runLater(() -> {
for (BlockState blockState : event.getBlocks()) {
mcMMO.getUserBlockTracker().setEligible(blockState);
}

View File

@ -247,7 +247,7 @@ public class mcMMO extends JavaPlugin {
formulaManager = new FormulaManager();
for (Player player : getServer().getOnlinePlayers()) {
getFoliaLib().getImpl().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
LogUtils.debug(mcMMO.p.getLogger(), "Version " + getDescription().getVersion() + " is enabled!");
@ -385,7 +385,7 @@ public class mcMMO extends JavaPlugin {
}
LogUtils.debug(mcMMO.p.getLogger(), "Canceling all tasks...");
getFoliaLib().getImpl().cancelAllTasks(); // This removes our tasks
getFoliaLib().getScheduler().cancelAllTasks(); // This removes our tasks
LogUtils.debug(mcMMO.p.getLogger(), "Unregister all events...");
HandlerList.unregisterAll(this); // Cancel event registrations
@ -613,7 +613,7 @@ public class mcMMO extends JavaPlugin {
}
private void registerCustomRecipes() {
getFoliaLib().getImpl().runLater(() -> {
getFoliaLib().getScheduler().runLater(() -> {
if (generalConfig.getChimaeraEnabled()) {
getServer().addRecipe(ChimaeraWing.getChimaeraWingRecipe());
}
@ -627,18 +627,18 @@ public class mcMMO extends JavaPlugin {
long saveIntervalTicks = Math.max(minute, generalConfig.getSaveInterval() * minute);
getFoliaLib().getImpl().runTimer(new SaveTimerTask(), saveIntervalTicks, saveIntervalTicks);
getFoliaLib().getScheduler().runTimer(new SaveTimerTask(), saveIntervalTicks, saveIntervalTicks);
// Cleanup the backups folder
getFoliaLib().getImpl().runAsync(new CleanBackupsTask());
getFoliaLib().getScheduler().runAsync(new CleanBackupsTask());
// Old & Powerless User remover
long purgeIntervalTicks = generalConfig.getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
if (purgeIntervalTicks == 0) {
getFoliaLib().getImpl().runLaterAsync(new UserPurgeTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
getFoliaLib().getScheduler().runLaterAsync(new UserPurgeTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
} else if (purgeIntervalTicks > 0) {
getFoliaLib().getImpl().runTimerAsync(new UserPurgeTask(), purgeIntervalTicks, purgeIntervalTicks);
getFoliaLib().getScheduler().runTimerAsync(new UserPurgeTask(), purgeIntervalTicks, purgeIntervalTicks);
}
// Automatically remove old members from parties
@ -646,22 +646,22 @@ public class mcMMO extends JavaPlugin {
long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
if (kickIntervalTicks == 0) {
getFoliaLib().getImpl().runLater(new PartyAutoKickTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
getFoliaLib().getScheduler().runLater(new PartyAutoKickTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
} else if (kickIntervalTicks > 0) {
getFoliaLib().getImpl().runTimer(new PartyAutoKickTask(), kickIntervalTicks, kickIntervalTicks);
getFoliaLib().getScheduler().runTimer(new PartyAutoKickTask(), kickIntervalTicks, kickIntervalTicks);
}
}
// Update power level tag scoreboards
getFoliaLib().getImpl().runTimer(new PowerLevelUpdatingTask(), 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
getFoliaLib().getScheduler().runTimer(new PowerLevelUpdatingTask(), 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
// Clear the registered XP data so players can earn XP again
if (ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {
getFoliaLib().getImpl().runTimer(new ClearRegisteredXPGainTask(), 60, 60);
getFoliaLib().getScheduler().runTimer(new ClearRegisteredXPGainTask(), 60, 60);
}
if (mcMMO.p.getAdvancedConfig().allowPlayerTips()) {
getFoliaLib().getImpl().runTimer(new NotifySquelchReminderTask(), 60, ((20 * 60) * 60));
getFoliaLib().getScheduler().runTimer(new NotifySquelchReminderTask(), 60, ((20 * 60) * 60));
}
}

View File

@ -15,7 +15,7 @@ public class SaveTimerTask extends CancellableRunnable {
int count = 1;
for (McMMOPlayer mcMMOPlayer : UserManager.getPlayers()) {
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileSaveTask(mcMMOPlayer.getProfile(), false), count);
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileSaveTask(mcMMOPlayer.getProfile(), false), count);
count++;
}

View File

@ -32,7 +32,7 @@ public class McRankCommandAsyncTask extends CancellableRunnable {
public void run() {
Map<PrimarySkillType, Integer> skills = mcMMO.getDatabaseManager().readRank(playerName);
mcMMO.p.getFoliaLib().getImpl().runNextTick(new McRankCommandDisplayTask(skills, sender, playerName, useBoard, useChat));
mcMMO.p.getFoliaLib().getScheduler().runNextTick(new McRankCommandDisplayTask(skills, sender, playerName, useBoard, useChat));
}
}

View File

@ -35,6 +35,6 @@ public class McTopCommandAsyncTask extends CancellableRunnable {
public void run() {
final List<PlayerStat> userStats = mcMMO.getDatabaseManager().readLeaderboard(skill, page, 10);
mcMMO.p.getFoliaLib().getImpl().runNextTick(new MctopCommandDisplayTask(userStats, page, skill, sender, useBoard, useChat));
mcMMO.p.getFoliaLib().getScheduler().runNextTick(new MctopCommandDisplayTask(userStats, page, skill, sender, useBoard, useChat));
}
}

View File

@ -21,6 +21,6 @@ public class DatabaseConversionTask extends CancellableRunnable {
public void run() {
sourceDatabase.convertUsers(mcMMO.getDatabaseManager());
mcMMO.p.getFoliaLib().getImpl().runNextTick(t -> sender.sendMessage(message));
mcMMO.p.getFoliaLib().getScheduler().runNextTick(t -> sender.sendMessage(message));
}
}

View File

@ -110,11 +110,11 @@ public class UUIDUpdateAsyncTask extends CancellableRunnable {
// Bukkit runnables don't let themselves reschedule themselves, so we are a pseudo bukkit runnable.
private void runTaskLaterAsynchronously(mcMMO plugin, int delay) {
plugin.getFoliaLib().getImpl().runLaterAsync(this, delay);
plugin.getFoliaLib().getScheduler().runLaterAsync(this, delay);
}
public void start() {
plugin.getFoliaLib().getImpl().runAsync(this);
plugin.getFoliaLib().getScheduler().runAsync(this);
}
private static UUID toUUID(String id) {

View File

@ -52,7 +52,7 @@ public class PlayerProfileLoadingTask extends CancellableRunnable {
// If successful, schedule the apply
if (profile.isLoaded()) {
mcMMO.p.getFoliaLib().getImpl().runAtEntity(player, new ApplySuccessfulProfile(new McMMOPlayer(player, profile)));
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(player, new ApplySuccessfulProfile(new McMMOPlayer(player, profile)));
EventUtils.callPlayerProfileLoadEvent(player, profile);
return;
}
@ -73,7 +73,7 @@ public class PlayerProfileLoadingTask extends CancellableRunnable {
// Increment attempt counter and try
attempt++;
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileLoadingTask(player, attempt), (100 + (attempt * 100L)));
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player, attempt), (100 + (attempt * 100L)));
}
private class ApplySuccessfulProfile extends CancellableRunnable {
@ -103,7 +103,7 @@ public class PlayerProfileLoadingTask extends CancellableRunnable {
if (mcMMO.p.getGeneralConfig().getShowStatsAfterLogin()) {
ScoreboardManager.enablePlayerStatsScoreboard(player);
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new McScoreboardKeepTask(player), Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new McScoreboardKeepTask(player), Misc.TICK_CONVERSION_FACTOR);
}
}

View File

@ -63,7 +63,7 @@ public class AbilityDisableTask extends CancellableRunnable {
SkillUtils.sendSkillMessage(player, NotificationType.SUPER_ABILITY_ALERT_OTHERS, ability.getAbilityPlayerOff());
}
if (!mcMMO.isServerShutdownExecuted()) {
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new AbilityCooldownTask(mcMMOPlayer, ability), (long) PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new AbilityCooldownTask(mcMMOPlayer, ability), (long) PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
}
}

View File

@ -76,7 +76,7 @@ public class AlchemyBrewTask extends CancellableRunnable {
fuel--;
Alchemy.brewingStandMap.put(brewingStand.getLocation(), this);
mcMMO.p.getFoliaLib().getImpl().runAtLocationTimer(brewingStand.getLocation(), this, 1, 1);
mcMMO.p.getFoliaLib().getScheduler().runAtLocationTimer(brewingStand.getLocation(), this, 1, 1);
}
@Override

View File

@ -46,6 +46,6 @@ public class AwardCombatXpTask extends CancellableRunnable {
}
final double finalDamage = damage;
mcMMO.p.getFoliaLib().getImpl().runAtEntity(mcMMOPlayer.getPlayer(), task -> mcMMOPlayer.beginXpGain(primarySkillType, (int) (finalDamage * baseXp), xpGainReason, XPGainSource.SELF));
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(mcMMOPlayer.getPlayer(), task -> mcMMOPlayer.beginXpGain(primarySkillType, (int) (finalDamage * baseXp), xpGainReason, XPGainSource.SELF));
}
}

View File

@ -54,7 +54,7 @@ public class DelayedCropReplant extends CancellableRunnable {
PlantAnchorType plantAnchorType = PlantAnchorType.NORMAL;
//Remove the metadata marking the block as recently replanted
mcMMO.p.getFoliaLib().getImpl().runAtLocationLater(blockBreakEvent.getBlock().getLocation(), new markPlantAsOld(blockBreakEvent.getBlock().getLocation()), 10);
mcMMO.p.getFoliaLib().getScheduler().runAtLocationLater(blockBreakEvent.getBlock().getLocation(), new markPlantAsOld(blockBreakEvent.getBlock().getLocation()), 10);
if (blockBreakEvent.isCancelled()) {
wasImmaturePlant = true;
@ -101,7 +101,7 @@ public class DelayedCropReplant extends CancellableRunnable {
//Play an effect
ParticleEffectUtils.playGreenThumbEffect(cropLocation);
mcMMO.p.getFoliaLib().getImpl().runAtLocationLater(newState.getLocation(), new PhysicsBlockUpdate(newState.getBlock(), cropFace, plantAnchorType), 1);
mcMMO.p.getFoliaLib().getScheduler().runAtLocationLater(newState.getLocation(), new PhysicsBlockUpdate(newState.getBlock(), cropFace, plantAnchorType), 1);
}
}

View File

@ -110,7 +110,7 @@ public class AcrobaticsManager extends SkillManager {
applyXpGain((float) (damage * Acrobatics.dodgeXpModifier), XPGainReason.PVE);
mob.setMetadata(MetadataConstants.METADATA_KEY_DODGE_TRACKER, new FixedMetadataValue(mcMMO.p, count + 1));
MobDodgeMetaCleanup metaCleanupTask = new MobDodgeMetaCleanup(mob, mcMMO.p);
mcMMO.p.getFoliaLib().getImpl().runAtEntityTimer(mob, metaCleanupTask, 20, 20*60); //one minute
mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(mob, metaCleanupTask, 20, 20*60); //one minute
}
} else {
applyXpGain((float) (damage * Acrobatics.dodgeXpModifier), XPGainReason.PVE);

View File

@ -13,9 +13,9 @@ import java.util.Map;
public final class Alchemy {
public static final int INGREDIENT_SLOT = 3;
public static int catalysisMaxBonusLevel = mcMMO.p.getAdvancedConfig().getCatalysisMaxBonusLevel();
public static double catalysisMinSpeed = mcMMO.p.getAdvancedConfig().getCatalysisMinSpeed();
public static double catalysisMaxSpeed = mcMMO.p.getAdvancedConfig().getCatalysisMaxSpeed();
public static int catalysisMaxBonusLevel = mcMMO.p.getAdvancedConfig().getCatalysisMaxBonusLevel();
public static double catalysisMinSpeed = mcMMO.p.getAdvancedConfig().getCatalysisMinSpeed();
public static double catalysisMaxSpeed = mcMMO.p.getAdvancedConfig().getCatalysisMaxSpeed();
public static Map<Location, AlchemyBrewTask> brewingStandMap = new HashMap<>();

View File

@ -343,14 +343,14 @@ public final class AlchemyPotionBrewer {
}
public static void scheduleCheck(@NotNull BrewingStand brewingStand) {
mcMMO.p.getFoliaLib().getImpl().runAtLocation(
mcMMO.p.getFoliaLib().getScheduler().runAtLocation(
brewingStand.getLocation(), new AlchemyBrewCheckTask(brewingStand));
}
public static void scheduleUpdate(Inventory inventory) {
for (HumanEntity humanEntity : inventory.getViewers()) {
if (humanEntity instanceof Player) {
mcMMO.p.getFoliaLib().getImpl().runAtEntity(humanEntity, new PlayerUpdateInventoryTask((Player) humanEntity));
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(humanEntity, new PlayerUpdateInventoryTask((Player) humanEntity));
}
}
}

View File

@ -96,7 +96,7 @@ public class ArcheryManager extends SkillManager {
Location dazedLocation = defender.getLocation();
dazedLocation.setPitch(90 - Misc.getRandom().nextInt(181));
mcMMO.p.getFoliaLib().getImpl().teleportAsync(defender, dazedLocation);
mcMMO.p.getFoliaLib().getScheduler().teleportAsync(defender, dazedLocation);
defender.addPotionEffect(new PotionEffect(getNauseaPotionEffectType(), 20 * 10, 10));
if (NotificationManager.doesPlayerUseNotifications(defender)) {

View File

@ -15,7 +15,7 @@ public class TrackedEntity extends CancellableRunnable {
this.livingEntity = livingEntity;
this.id = livingEntity.getUniqueId();
mcMMO.p.getFoliaLib().getImpl().runAtEntityTimer(livingEntity, this, 12000, 12000);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(livingEntity, this, 12000, 12000);
}
@Override

View File

@ -252,7 +252,7 @@ public class FishingManager extends SkillManager {
}
public void masterAngler(@NotNull FishHook hook, int lureLevel) {
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(hook, new MasterAnglerTask(hook, this, lureLevel), 1); //We run later to get the lure bonus applied
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(hook, new MasterAnglerTask(hook, this, lureLevel), 1); //We run later to get the lure bonus applied
}
/**

View File

@ -122,7 +122,7 @@ public class HerbalismManager extends SkillManager {
}
CheckBushAge checkBushAge = new CheckBushAge(blockState.getBlock(), mmoPlayer, xpReward);
mcMMO.p.getFoliaLib().getImpl().runAtLocationLater(blockState.getLocation(), checkBushAge, 1);
mcMMO.p.getFoliaLib().getScheduler().runAtLocationLater(blockState.getLocation(), checkBushAge, 1);
}
}
}
@ -331,7 +331,7 @@ public class HerbalismManager extends SkillManager {
DelayedHerbalismXPCheckTask delayedHerbalismXPCheckTask = new DelayedHerbalismXPCheckTask(mmoPlayer, delayedChorusBlocks);
//Large delay because the tree takes a while to break
mcMMO.p.getFoliaLib().getImpl().runAtEntity(mmoPlayer.getPlayer(), delayedHerbalismXPCheckTask); //Calculate Chorus XP + Bonus Drops 1 tick later
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(mmoPlayer.getPlayer(), delayedHerbalismXPCheckTask); //Calculate Chorus XP + Bonus Drops 1 tick later
}
}
@ -789,7 +789,7 @@ public class HerbalismManager extends SkillManager {
*/
private void startReplantTask(int desiredCropAge, BlockBreakEvent blockBreakEvent, BlockState cropState, boolean isImmature) {
//Mark the plant as recently replanted to avoid accidental breakage
mcMMO.p.getFoliaLib().getImpl().runAtLocationLater(blockBreakEvent.getBlock().getLocation(), new DelayedCropReplant(blockBreakEvent, cropState, desiredCropAge, isImmature), 2 * Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtLocationLater(blockBreakEvent.getBlock().getLocation(), new DelayedCropReplant(blockBreakEvent, cropState, desiredCropAge, isImmature), 2 * Misc.TICK_CONVERSION_FACTOR);
blockBreakEvent.getBlock().setMetadata(MetadataConstants.METADATA_KEY_REPLANT, new RecentlyReplantedCropMeta(mcMMO.p, true));
}

View File

@ -170,7 +170,7 @@ public class MiningManager extends SkillManager {
mmoPlayer.setAbilityDATS(SuperAbilityType.BLAST_MINING, System.currentTimeMillis());
mmoPlayer.setAbilityInformed(SuperAbilityType.BLAST_MINING, false);
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(mmoPlayer.getPlayer(), new AbilityCooldownTask(mmoPlayer, SuperAbilityType.BLAST_MINING), (long) SuperAbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(mmoPlayer.getPlayer(), new AbilityCooldownTask(mmoPlayer, SuperAbilityType.BLAST_MINING), (long) SuperAbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
}
private boolean isInfestedBlock(String material) {

View File

@ -95,7 +95,7 @@ public class SwordsManager extends SkillManager {
RuptureTaskMeta ruptureTaskMeta = new RuptureTaskMeta(mcMMO.p, ruptureTask);
mcMMO.p.getFoliaLib().getImpl().runAtEntityTimer(target, ruptureTask, 1, 1);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(target, ruptureTask, 1, 1);
target.setMetadata(MetadataConstants.METADATA_KEY_RUPTURE, ruptureTaskMeta);
// if (mmoPlayer.useChatNotifications()) {

View File

@ -27,7 +27,7 @@ public class TrackedTamingEntity extends CancellableRunnable {
if (tamingCOTWLength > 0) {
int length = tamingCOTWLength * Misc.TICK_CONVERSION_FACTOR;
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(livingEntity, this, length);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(livingEntity, this, length);
}
}

View File

@ -112,7 +112,7 @@ public final class ChimaeraWing {
if (warmup > 0) {
NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup));
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new ChimaeraWingWarmup(mcMMOPlayer), 20 * warmup);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new ChimaeraWingWarmup(mcMMOPlayer), 20 * warmup);
} else {
chimaeraExecuteTeleport();
}
@ -123,15 +123,15 @@ public final class ChimaeraWing {
if (mcMMO.p.getGeneralConfig().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) {
// player.teleport(player.getBedSpawnLocation());
mcMMO.p.getFoliaLib().getImpl().teleportAsync(player, player.getBedSpawnLocation());
mcMMO.p.getFoliaLib().getScheduler().teleportAsync(player, player.getBedSpawnLocation());
} else {
Location spawnLocation = player.getWorld().getSpawnLocation();
if (spawnLocation.getBlock().getType() == Material.AIR) {
// player.teleport(spawnLocation);
mcMMO.p.getFoliaLib().getImpl().teleportAsync(player, spawnLocation);
mcMMO.p.getFoliaLib().getScheduler().teleportAsync(player, spawnLocation);
} else {
// player.teleport(player.getWorld().getHighestBlockAt(spawnLocation).getLocation());
mcMMO.p.getFoliaLib().getImpl().teleportAsync(player, player.getWorld().getHighestBlockAt(spawnLocation).getLocation());
mcMMO.p.getFoliaLib().getScheduler().teleportAsync(player, player.getWorld().getHighestBlockAt(spawnLocation).getLocation());
}
}

View File

@ -358,7 +358,7 @@ public final class EventUtils {
}
// teleportingPlayer.teleport(targetPlayer);
mcMMO.p.getFoliaLib().getImpl().teleportAsync(teleportingPlayer, targetPlayer.getLocation());
mcMMO.p.getFoliaLib().getScheduler().teleportAsync(teleportingPlayer, targetPlayer.getLocation());
teleportingPlayer.sendMessage(LocaleLoader.getString("Party.Teleport.Player", targetPlayer.getName()));
targetPlayer.sendMessage(LocaleLoader.getString("Party.Teleport.Target", teleportingPlayer.getName()));

View File

@ -117,7 +117,7 @@ public final class Misc {
if (player != null) {
UserManager.remove(player);
mcMMO.p.getFoliaLib().getImpl().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
mcMMO.p.getFoliaLib().getScheduler().runLaterAsync(new PlayerProfileLoadingTask(player), 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
}

View File

@ -80,7 +80,7 @@ public final class MobHealthbarUtils {
target.setMetadata(MetadataConstants.METADATA_KEY_NAME_VISIBILITY, new FixedMetadataValue(mcMMO.p, false));
}
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(target, new MobHealthDisplayUpdaterTask(target), (long) displayTime * Misc.TICK_CONVERSION_FACTOR); // Clear health display after 3 seconds
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(target, new MobHealthDisplayUpdaterTask(target), (long) displayTime * Misc.TICK_CONVERSION_FACTOR); // Clear health display after 3 seconds
}
}

View File

@ -75,7 +75,7 @@ public class ExperienceBarManager {
return;
ExperienceBarHideTask experienceBarHideTask = new ExperienceBarHideTask(this, mcMMOPlayer, primarySkillType);
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(mcMMOPlayer.getPlayer(), experienceBarHideTask, (long) delaySeconds * Misc.TICK_CONVERSION_FACTOR);
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(mcMMOPlayer.getPlayer(), experienceBarHideTask, (long) delaySeconds * Misc.TICK_CONVERSION_FACTOR);
experienceBarHideTaskHashMap.put(primarySkillType, experienceBarHideTask);
}

View File

@ -305,7 +305,7 @@ public class NotificationManager {
.hoverEvent(levelMilestoneHover);
// TODO: Update system msg API
mcMMO.p.getFoliaLib().getImpl().runNextTick(
mcMMO.p.getFoliaLib().getScheduler().runNextTick(
t -> audience.sendMessage(component));
}
}
@ -341,7 +341,7 @@ public class NotificationManager {
String localeMessage = LocaleLoader.getString("Broadcasts.PowerLevelUpMilestone", mmoPlayer.getPlayer().getDisplayName(), powerLevel);
Component message = LegacyComponentSerializer.legacySection().deserialize(localeMessage).hoverEvent(levelMilestoneHover);
mcMMO.p.getFoliaLib().getImpl().runNextTick(t -> audience.sendMessage(message));
mcMMO.p.getFoliaLib().getScheduler().runNextTick(t -> audience.sendMessage(message));
}
}
}

View File

@ -122,7 +122,7 @@ public class ScoreboardWrapper {
public void doSidebarUpdateSoon() {
if (updateTask == null) {
// To avoid spamming the scheduler, store the instance and run 2 ticks later
updateTask = mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new ScoreboardQuickUpdate(), 2L);
updateTask = mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new ScoreboardQuickUpdate(), 2L);
}
}
@ -130,7 +130,7 @@ public class ScoreboardWrapper {
if (cooldownTask == null) {
// Repeat every 5 seconds.
// Cancels once all cooldowns are done, using stopCooldownUpdating().
cooldownTask = mcMMO.p.getFoliaLib().getImpl().runAtEntityTimer(player, new ScoreboardCooldownTask(), 5 * Misc.TICK_CONVERSION_FACTOR, 5 * Misc.TICK_CONVERSION_FACTOR);
cooldownTask = mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(player, new ScoreboardCooldownTask(), 5 * Misc.TICK_CONVERSION_FACTOR, 5 * Misc.TICK_CONVERSION_FACTOR);
}
}
@ -212,7 +212,7 @@ public class ScoreboardWrapper {
}
player.setScoreboard(scoreboard);
revertTask = mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new ScoreboardChangeTask(), ticks);
revertTask = mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(player, new ScoreboardChangeTask(), ticks);
// TODO is there any way to do the time that looks acceptable?
// player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Timer", StringUtils.capitalize(sidebarType.toString().toLowerCase(Locale.ENGLISH)), ticks / 20F));
@ -420,7 +420,7 @@ public class ScoreboardWrapper {
NotificationManager.sendPlayerInformationChatOnlyPrefixed(player, "Scoreboard.Recovery");
initBoard(); //Start over
mcMMO.p.getFoliaLib().getImpl().runAtEntity(player, t -> ScoreboardManager.retryLastSkillBoard(player));
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(player, t -> ScoreboardManager.retryLastSkillBoard(player));
}
}

View File

@ -914,7 +914,7 @@ public final class CombatUtils {
baseXP *= multiplier;
if (baseXP > 0) {
mcMMO.p.getFoliaLib().getImpl().runAtEntity(target, new AwardCombatXpTask(mcMMOPlayer, primarySkillType, baseXP, target, xpGainReason));
mcMMO.p.getFoliaLib().getScheduler().runAtEntity(target, new AwardCombatXpTask(mcMMOPlayer, primarySkillType, baseXP, target, xpGainReason));
}
}
@ -1056,6 +1056,6 @@ public final class CombatUtils {
* @param arrow the projectile
*/
public static void delayArrowMetaCleanup(@NotNull Arrow arrow) {
mcMMO.p.getFoliaLib().getImpl().runLater(() -> ProjectileUtils.cleanupProjectileMetadata(arrow), 20*120);
mcMMO.p.getFoliaLib().getScheduler().runLater(() -> ProjectileUtils.cleanupProjectileMetadata(arrow), 20*120);
}
}

View File

@ -45,7 +45,7 @@ public class RankUtils {
if (newLevel == innerMap.get(playerRankInSkill)) {
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(mcMMOPlayer.getPlayer(), skillUnlockNotificationTask, (count * 100L));
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(mcMMOPlayer.getPlayer(), skillUnlockNotificationTask, (count * 100L));
count++;
}

View File

@ -4,6 +4,7 @@
###
Concoctions:
Tier_One_Ingredients:
- BREEZE_ROD
- BLAZE_POWDER
- FERMENTED_SPIDER_EYE
- GHAST_TEAR
@ -22,6 +23,7 @@ Concoctions:
- STONE
- SLIME_BLOCK
- COBWEB
- TURTLE_HELMET
Tier_Two_Ingredients:
- CARROT
- SLIME_BALL
@ -70,6 +72,7 @@ Potions:
PotionData:
PotionType: WATER
Children:
BREEZE_ROD: POTION_OF_MUNDANE
SPIDER_EYE: POTION_OF_MUNDANE
FERMENTED_SPIDER_EYE: POTION_OF_WEAKNESS
GLOWSTONE_DUST: POTION_OF_THICK
@ -87,6 +90,7 @@ Potions:
PotionData:
PotionType: UNCRAFTABLE
Children:
BREEZE_ROD: POTION_OF_MUNDANE
SPIDER_EYE: POTION_OF_MUNDANE
FERMENTED_SPIDER_EYE: POTION_OF_WEAKNESS
GLOWSTONE_DUST: POTION_OF_THICK
@ -116,6 +120,7 @@ Potions:
PotionData:
PotionType: AWKWARD
Children:
BREEZE_ROD: POTION_OF_WIND_CHARGING
QUARTZ: POTION_OF_ABSORPTION
GUNPOWDER: SPLASH_POTION_OF_AWKWARD
BROWN_MUSHROOM: POTION_OF_NAUSEA
@ -698,6 +703,7 @@ Potions:
PotionData:
PotionType: WATER
Children:
BREEZE_ROD: SPLASH_POTION_OF_MUNDANE
SUGAR: SPLASH_POTION_OF_MUNDANE
BLAZE_POWDER: SPLASH_POTION_OF_MUNDANE
GHAST_TEAR: SPLASH_POTION_OF_MUNDANE
@ -1304,6 +1310,7 @@ Potions:
PotionData:
PotionType: WATER
Children:
BREEZE_ROD: LINGERING_POTION_OF_MUNDANE
REDSTONE: LINGERING_POTION_OF_MUNDANE
GLISTERING_MELON_SLICE: LINGERING_POTION_OF_MUNDANE
GHAST_TEAR: LINGERING_POTION_OF_MUNDANE
@ -1843,6 +1850,31 @@ Potions:
PotionData:
PotionType: UNCRAFTABLE
Effects: ["WEAVING 0 3000"]
POTION_OF_WIND_CHARGING:
Name: Potion of Wind Charging
Material: POTION
Color: 0xBDC9FF
PotionData:
PotionType: UNCRAFTABLE
Effects: [ "WIND_CHARGED 0 3600" ]
Children:
GUNPOWDER: SPLASH_POTION_OF_WIND_CHARGING
SPLASH_POTION_OF_WIND_CHARGING:
Name: Splash Potion of Wind Charging
Material: SPLASH_POTION
Color: 0xBDC9FF
PotionData:
PotionType: UNCRAFTABLE
Effects: [ "WIND_CHARGED 0 2500" ]
Children:
DRAGON_BREATH: LINGERING_POTION_OF_WIND_CHARGING
LINGERING_POTION_WIND_CHARGING:
Name: Lingering Potion of Wind Charging
Material: LINGERING_POTION
Color: 0xBDC9FF
PotionData:
PotionType: UNCRAFTABLE
Effects: [ "WIND_CHARGED 0 3000" ]
POTION_OF_OOZING:
Name: Potion of Oozing
Material: POTION