Fixed isInvulnerability check in PacketsManager

This commit is contained in:
NavidK0 2015-03-28 19:05:53 -04:00
parent 099e9ad5a3
commit cbf4e3fc03
7 changed files with 44 additions and 36 deletions

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
@ -221,4 +220,4 @@ public class PlayerDisguise extends TargetedDisguise {
public PlayerDisguise silentlyRemovePlayer(String playername) {
return (PlayerDisguise) super.silentlyRemovePlayer(playername);
}
}
}

View File

@ -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;

View File

@ -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();

View File

@ -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:
@ -121,4 +127,4 @@ PacketsEnabled:
# Disable this if you don't mind crashing everytime you see someone riding something disguised as a non-living entity
Riding: true
# When disguised as a wither skull, it sends a look packet every tick so that the wither skull is facing the right way.
WitherSkull: true
WitherSkull: true

View File

@ -1,45 +1,48 @@
name: LibsDisguises
main: me.libraryaddict.disguise.LibsDisguises
version: 8.3
version: 8.4
author: libraryaddict
authors: [Byteflux, Navid K.]
depend: [ProtocolLib]
commands:
libsdisguises:
libsdisguises:
permission: libsdisguises.seecmd.libsdisguises
disguise:
disguise:
aliases: [d, dis]
permission: libsdisguises.seecmd.disguise
disguiseentity:
disguiseentity:
aliases: [dentity, disentity]
permission: libsdisguises.seecmd.disguiseentity
disguisehelp:
disguisehelp:
aliases: [dhelp, dishelp]
permission: libsdisguises.seecmd.disguisehelp
disguiseplayer:
disguiseplayer:
aliases: [dplayer, displayer]
permission: libsdisguises.seecmd.disguiseplayer
disguiseradius:
disguiseradius:
aliases: [disradius, dradius]
permission: libsdisguises.seecmd.disguiseradius
undisguise:
undisguise:
aliases: [u, und, undis]
permission: libsdisguises.seecmd.undisguise
undisguiseentity:
undisguiseentity:
aliases: [undisentity, undentity]
permission: libsdisguises.seecmd.undisguiseentity
undisguiseplayer:
undisguiseplayer:
aliases: [undisplayer, undplayer]
permission: libsdisguises.seecmd.undisguiseplayer
undisguiseradius:
undisguiseradius:
aliases: [undisradius, undradius]
permission: libsdisguises.seecmd.undisguiseradius
disguiseclone:
disguiseclone:
aliases: [disguisec, disc, disclone, dclone, clonedisguise, clonedis, cdisguise, cdis]
permission: libsdisguises.seecmd.disguiseclone
permissions:
libsdisguises.seecmd:
libsdisguises.seethrough:
description: Allows player to see through disguises.
default: false
libsdisguises.seecmd:
description: See all commands in tab-completion
default: true
children:
@ -55,25 +58,26 @@ permissions:
libsdisguises.seecmd.undisguiseradius: true
libsdisguises.seecmd.disguiseclone: true
libsdisguises.seecmd.libsdisguises:
libsdisguises.seecmd.libsdisguises:
description: See the /libsdisguises command in tab-completion
libsdisguises.seecmd.disguise:
libsdisguises.seecmd.disguise:
description: See the /disguise command in tab-completion
libsdisguises.seecmd.disguiseentity:
libsdisguises.seecmd.disguiseentity:
description: See the /disguiseentity command in tab-completion
libsdisguises.seecmd.disguisehelp:
libsdisguises.seecmd.disguisehelp:
description: See the /disguisehelp command in tab-completion
libsdisguises.seecmd.disguiseplayer:
libsdisguises.seecmd.disguiseplayer:
description: See the /disguiseplayer command in tab-completion
libsdisguises.seecmd.disguiseradius:
libsdisguises.seecmd.disguiseradius:
description: See the /disguiseradius command in tab-completion
libsdisguises.seecmd.undisguise:
libsdisguises.seecmd.undisguise:
description: See the /undisguise command in tab-completion
libsdisguises.seecmd.undisguiseentity:
libsdisguises.seecmd.undisguiseentity:
description: See the /undisguiseentity command in tab-completion
libsdisguises.seecmd.undisguiseplayer:
libsdisguises.seecmd.undisguiseplayer:
description: See the /undisguiseplayer command in tab-completion
libsdisguises.seecmd.undisguiseradius:
libsdisguises.seecmd.undisguiseradius:
description: See the /undisguiseradius command in tab-completion
libsdisguises.seecmd.disguiseclone:
libsdisguises.seecmd.disguiseclone:
description: See the /disguiseclone command in tab-completion