Fixed isInvulnerability check in PacketsManager
This commit is contained in:
parent
099e9ad5a3
commit
cbf4e3fc03
@ -42,9 +42,9 @@ import com.comphenix.protocol.events.PacketContainer;
|
||||
public class DisguiseListener implements Listener {
|
||||
|
||||
private String currentVersion;
|
||||
private HashMap<String, Boolean[]> disguiseClone = new HashMap<String, Boolean[]>();
|
||||
private HashMap<String, Disguise> disguiseEntity = new HashMap<String, Disguise>();
|
||||
private HashMap<String, BukkitRunnable> disguiseRunnable = new HashMap<String, BukkitRunnable>();
|
||||
private HashMap<String, Boolean[]> disguiseClone = new HashMap<>();
|
||||
private HashMap<String, Disguise> disguiseEntity = new HashMap<>();
|
||||
private HashMap<String, BukkitRunnable> disguiseRunnable = new HashMap<>();
|
||||
private String latestVersion;
|
||||
private LibsDisguises plugin;
|
||||
|
||||
|
@ -12,10 +12,9 @@ public class LibsDisguisesCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
sender.sendMessage(ChatColor.DARK_GREEN
|
||||
+ "This server is running "
|
||||
+ "Lib's Disguises "
|
||||
+ (sender.getName().equals("libraryaddict") ? "v"
|
||||
+ Bukkit.getPluginManager().getPlugin("LibsDisguises").getDescription().getVersion() + " " : "")
|
||||
+ "by libraryaddict");
|
||||
+ "Lib's Disguises v."
|
||||
+ Bukkit.getPluginManager().getPlugin("LibsDisguises").getDescription().getVersion()
|
||||
+ "by libraryaddict, maintained by NavidK0");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher;
|
||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||
import me.libraryaddict.disguise.utilities.LibsProfileLookup;
|
||||
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
||||
import me.libraryaddict.disguise.utilities.ReflectionManager.LibVersion;
|
||||
|
||||
public class PlayerDisguise extends TargetedDisguise {
|
||||
private LibsProfileLookup currentLookup;
|
||||
|
@ -16,7 +16,6 @@ import me.libraryaddict.disguise.disguisetypes.MiscDisguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.MobDisguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.RabbitType;
|
||||
import me.libraryaddict.disguise.utilities.ReflectionManager.LibVersion;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
|
@ -54,6 +54,7 @@ import com.comphenix.protocol.wrappers.WrappedAttribute.Builder;
|
||||
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
|
||||
import com.comphenix.protocol.wrappers.WrappedGameProfile;
|
||||
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
|
||||
import net.minecraft.server.v1_8_R2.DamageSource;
|
||||
|
||||
public class PacketsManager {
|
||||
/**
|
||||
@ -583,7 +584,7 @@ public class PacketsManager {
|
||||
"maxNoDamageTicks").getInt(nmsEntity);
|
||||
} else {
|
||||
hasInvun = (Boolean) ReflectionManager.getNmsMethod("Entity", "isInvulnerable")
|
||||
.invoke(nmsEntity);
|
||||
.invoke(nmsEntity, DamageSource.GENERIC);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
|
@ -91,6 +91,12 @@ MiscDisguisesForLiving: true
|
||||
# Turn this to true to have players undisguised when switching worlds
|
||||
UndisguiseOnWorldChange: false
|
||||
|
||||
# Should players with the proper permission be able to see through disguises?
|
||||
SeeThroughDisguises: true
|
||||
|
||||
# Should the disguised entity's name go through disguises? (Not including players)
|
||||
EntityNameThroughDisguise: false
|
||||
|
||||
# This will help performance, especially with CPU
|
||||
# Due to safety reasons, self disguises can never have their packets disabled.
|
||||
PacketsEnabled:
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: LibsDisguises
|
||||
main: me.libraryaddict.disguise.LibsDisguises
|
||||
version: 8.3
|
||||
version: 8.4
|
||||
author: libraryaddict
|
||||
authors: [Byteflux, Navid K.]
|
||||
depend: [ProtocolLib]
|
||||
@ -39,6 +39,9 @@ commands:
|
||||
permission: libsdisguises.seecmd.disguiseclone
|
||||
|
||||
permissions:
|
||||
libsdisguises.seethrough:
|
||||
description: Allows player to see through disguises.
|
||||
default: false
|
||||
libsdisguises.seecmd:
|
||||
description: See all commands in tab-completion
|
||||
default: true
|
||||
@ -77,3 +80,4 @@ permissions:
|
||||
description: See the /undisguiseradius command in tab-completion
|
||||
libsdisguises.seecmd.disguiseclone:
|
||||
description: See the /disguiseclone command in tab-completion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user