Fix ender dragon

This commit is contained in:
Esmorall 2020-07-01 13:55:55 -03:00
parent a9c911e6fe
commit b59498c0e3
No known key found for this signature in database
GPG Key ID: 3F4DD7CEC746EEB3
4 changed files with 6 additions and 15 deletions

View File

@ -13,6 +13,7 @@ import net.minecraft.server.v1_14_R1.EntityPlayer;
import net.minecraft.server.v1_14_R1.MinecraftServer;
import net.minecraft.server.v1_14_R1.WorldServer;
import net.minecraft.server.v1_14_R1.PlayerChunkMap.EntityTracker;
import net.minecraft.server.v1_14_R1.EntityComplexPart;
import net.minecraft.server.v1_14_R1.EntityArmorStand;
import net.minecraft.server.v1_14_R1.EntityEnderDragon;
import net.minemora.entitytrackerfixer.EntityTrackerFixer;
@ -61,7 +62,7 @@ public class UntrackerTask extends BukkitRunnable {
try {
for(EntityTracker et : cps.playerChunkMap.trackedEntities.values()) {
net.minecraft.server.v1_14_R1.Entity nmsEnt = (net.minecraft.server.v1_14_R1.Entity) trackerField.get(et);
if(nmsEnt instanceof EntityPlayer || nmsEnt instanceof EntityEnderDragon) {
if(nmsEnt instanceof EntityPlayer || nmsEnt instanceof EntityEnderDragon || nmsEnt instanceof EntityComplexPart) {
continue;
}
if(nmsEnt instanceof EntityArmorStand && nmsEnt.getBukkitEntity().getCustomName() != null) {
@ -95,15 +96,6 @@ public class UntrackerTask extends BukkitRunnable {
cps.playerChunkMap.trackedEntities.remove(id);
}
/*
new BukkitRunnable() {
@Override
public void run() {
NMSEntityTracker.untrackEntities(cps, toRemove);
}
}.runTask(EntityTrackerFixer.plugin);
*/
if(ConfigMain.isLogToConsole()) {
EntityTrackerFixer.plugin.getLogger().info("Untracked " + removed + " entities in " + worldName);
}

View File

@ -1,7 +1,5 @@
package net.minemora.entitytrackerfixer.v1_15_R1;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
import org.bukkit.plugin.Plugin;
import net.minemora.entitytrackerfixer.config.ConfigMain;

View File

@ -15,6 +15,7 @@ import net.minecraft.server.v1_15_R1.EntityPlayer;
import net.minecraft.server.v1_15_R1.MinecraftServer;
import net.minecraft.server.v1_15_R1.WorldServer;
import net.minecraft.server.v1_15_R1.PlayerChunkMap.EntityTracker;
import net.minecraft.server.v1_15_R1.EntityComplexPart;
import net.minemora.entitytrackerfixer.EntityTrackerFixer;
import net.minemora.entitytrackerfixer.config.ConfigMain;
import net.minemora.entitytrackerfixer.util.ReflectionUtils;
@ -59,7 +60,7 @@ public class UntrackerTask extends BukkitRunnable {
try {
for(EntityTracker et : cps.playerChunkMap.trackedEntities.values()) {
net.minecraft.server.v1_15_R1.Entity nmsEnt = (net.minecraft.server.v1_15_R1.Entity) trackerField.get(et);
if(nmsEnt instanceof EntityPlayer || nmsEnt instanceof EntityEnderDragon) {
if(nmsEnt instanceof EntityPlayer || nmsEnt instanceof EntityEnderDragon || nmsEnt instanceof EntityComplexPart) {
continue;
}
if(nmsEnt instanceof EntityArmorStand && nmsEnt.getBukkitEntity().getCustomName() != null) {

View File

@ -8,9 +8,9 @@ import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
import org.bukkit.scheduler.BukkitRunnable;
import net.minecraft.server.v1_16_R1.EntityItemFrame;
import net.minecraft.server.v1_16_R1.ChunkProviderServer;
import net.minecraft.server.v1_16_R1.EntityArmorStand;
import net.minecraft.server.v1_16_R1.EntityComplexPart;
import net.minecraft.server.v1_16_R1.EntityEnderDragon;
import net.minecraft.server.v1_16_R1.EntityPlayer;
import net.minecraft.server.v1_16_R1.MinecraftServer;
@ -61,7 +61,7 @@ public class UntrackerTask extends BukkitRunnable {
try {
for(EntityTracker et : cps.playerChunkMap.trackedEntities.values()) {
net.minecraft.server.v1_16_R1.Entity nmsEnt = (net.minecraft.server.v1_16_R1.Entity) trackerField.get(et);
if(nmsEnt instanceof EntityPlayer || nmsEnt instanceof EntityItemFrame || nmsEnt instanceof EntityEnderDragon) {
if(nmsEnt instanceof EntityPlayer || nmsEnt instanceof EntityEnderDragon || nmsEnt instanceof EntityComplexPart) {
continue;
}
if(nmsEnt instanceof EntityArmorStand && nmsEnt.getBukkitEntity().getCustomName() != null) {