Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into tridentsxbows

This commit is contained in:
nossr50
2020-12-17 15:10:53 -08:00
10 changed files with 74 additions and 11 deletions

View File

@ -125,8 +125,6 @@ public class ExperienceManager {
* @param xp Experience amount to process
*/
public void beginXpGain(@NotNull PrimarySkillType primarySkillType, float xp, @NotNull XPGainReason xpGainReason, @NotNull XPGainSource xpGainSource) {
Validate.isTrue(xp >= 0.0, "XP gained should be greater than or equal to zero.");
if (xp <= 0.0) {
return;
}

View File

@ -6,7 +6,7 @@ public class McMMOUrl {
public static final String urlPatreon = "https://www.patreon.com/nossr50";
public static final String urlWiki = "https://www.mcmmo.org/wiki/";
public static final String urlSpigot = "http://spigot.mcmmo.org";
public static final String urlTranslate = "https://www.mcmmo.org/translate/";
public static final String urlTranslate = "https://translate.mcmmo.org/";
public static String getUrl(McMMOWebLinks webLinks)
{

View File

@ -0,0 +1,30 @@
package com.gmail.nossr50.listeners;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.compat.layers.persistentdata.MobMetaFlagType;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkUnloadEvent;
public class ChunkListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onChunkUnload(ChunkUnloadEvent event) {
for(Entity entity : event.getChunk().getEntities()) {
if(entity instanceof LivingEntity) {
LivingEntity livingEntity = (LivingEntity) entity;
if(mcMMO.getCompatibilityManager().getPersistentDataLayer().hasMobFlag(MobMetaFlagType.COTW_SUMMONED_MOB, livingEntity)) {
//Remove from existence
if(livingEntity.isValid()) {
mcMMO.getCompatibilityManager().getPersistentDataLayer().removeMobFlags(livingEntity);
livingEntity.setHealth(0);
livingEntity.remove();
}
}
}
}
}
}

View File

@ -559,6 +559,7 @@ public class mcMMO extends JavaPlugin {
pluginManager.registerEvents(new InventoryListener(this), this);
pluginManager.registerEvents(new SelfListener(this), this);
pluginManager.registerEvents(new WorldListener(this), this);
pluginManager.registerEvents(new ChunkListener(), this);
// pluginManager.registerEvents(new CommandListener(this), this);
}

View File

@ -102,6 +102,7 @@ public class UUIDUpdateAsyncTask implements Runnable {
if (position == userNames.size()) {
mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS);
awaiter.countDown();
plugin.getLogger().info("UUID checks completed");
} else
this.runTaskLaterAsynchronously(plugin, Misc.TICK_CONVERSION_FACTOR * DELAY_PERIOD); // Schedule next batch
}

View File

@ -113,6 +113,7 @@ public final class AlchemyPotionBrewer {
}
List<AlchemyPotion> inputList = new ArrayList<>();
ItemStack[] outputList = new ItemStack[3];
for (int i = 0; i < 3; i++) {
ItemStack item = inventory.getItem(i);
@ -127,7 +128,7 @@ public final class AlchemyPotionBrewer {
inputList.add(input);
if (output != null) {
inventory.setItem(i, output.toItemStack(item.getAmount()).clone());
outputList[i] = output.toItemStack(item.getAmount()).clone();
}
}
@ -138,6 +139,12 @@ public final class AlchemyPotionBrewer {
return;
}
for (int i = 0; i < 3; i++) {
if(outputList[i] != null) {
inventory.setItem(i, outputList[i]);
}
}
removeIngredient(inventory, player);
for (AlchemyPotion input : inputList) {

View File

@ -570,6 +570,7 @@ public class TamingManager extends SkillManager {
//Remove from existence
if(livingEntity != null && livingEntity.isValid()) {
mcMMO.getCompatibilityManager().getPersistentDataLayer().removeMobFlags(livingEntity);
livingEntity.setHealth(0);
livingEntity.remove();
}

View File

@ -11,3 +11,4 @@ Upgrades_Finished:
FIX_SPELLING_NETHERITE_REPAIR: false
FIX_NETHERITE_SALVAGE_QUANTITIES: false
ADD_SQL_2_2: false
ADD_UUIDS: false