mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
parent
22a738bace
commit
8c52884ac6
@ -2,6 +2,7 @@ Version 2.1.163
|
|||||||
Fixed the translate URL pointing to the wrong place (thanks chew)
|
Fixed the translate URL pointing to the wrong place (thanks chew)
|
||||||
Fixed a bug where FlatFile databases would always attempt a UUID conversion task every save operation (every 10 minutes) causing console spam
|
Fixed a bug where FlatFile databases would always attempt a UUID conversion task every save operation (every 10 minutes) causing console spam
|
||||||
mcMMO will no longer throw errors when incoming XP is below 0 (it will just silently cancel the operation)
|
mcMMO will no longer throw errors when incoming XP is below 0 (it will just silently cancel the operation)
|
||||||
|
COTW Summoned entities are now removed when the chunk they are in is unloaded (prevents some exploits)
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
I often test in SQL environments so I missed this bug, reminder to come bother me on discord if you find any annoying bugs!
|
I often test in SQL environments so I missed this bug, reminder to come bother me on discord if you find any annoying bugs!
|
||||||
|
30
src/main/java/com/gmail/nossr50/listeners/ChunkListener.java
Normal file
30
src/main/java/com/gmail/nossr50/listeners/ChunkListener.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -570,6 +570,7 @@ public class TamingManager extends SkillManager {
|
|||||||
|
|
||||||
//Remove from existence
|
//Remove from existence
|
||||||
if(livingEntity != null && livingEntity.isValid()) {
|
if(livingEntity != null && livingEntity.isValid()) {
|
||||||
|
mcMMO.getCompatibilityManager().getPersistentDataLayer().removeMobFlags(livingEntity);
|
||||||
livingEntity.setHealth(0);
|
livingEntity.setHealth(0);
|
||||||
livingEntity.remove();
|
livingEntity.remove();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user