mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-08-22 22:53:01 +02:00
I don't think I need to cancel riding packets. Might be 1.6.4 specific. Anyone care to test?
This commit is contained in:
parent
d93f689356
commit
8363b23deb
|
@ -28,7 +28,6 @@ public class DisguiseConfig {
|
||||||
private static boolean miscDisguisesForLivingEnabled;
|
private static boolean miscDisguisesForLivingEnabled;
|
||||||
private static boolean modifyBoundingBox;
|
private static boolean modifyBoundingBox;
|
||||||
private static boolean movementEnabled;
|
private static boolean movementEnabled;
|
||||||
private static boolean ridingEnabled;
|
|
||||||
private static boolean sendsEntityMetadata;
|
private static boolean sendsEntityMetadata;
|
||||||
private static boolean sendVelocity;
|
private static boolean sendVelocity;
|
||||||
private static boolean showNameAboveHead;
|
private static boolean showNameAboveHead;
|
||||||
|
@ -76,7 +75,6 @@ public class DisguiseConfig {
|
||||||
setEquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Equipment"));
|
setEquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Equipment"));
|
||||||
setAnimationPacketsEnabled(config.getBoolean("PacketsEnabled.Animation"));
|
setAnimationPacketsEnabled(config.getBoolean("PacketsEnabled.Animation"));
|
||||||
setBedPacketsEnabled(config.getBoolean("PacketsEnabled.Bed"));
|
setBedPacketsEnabled(config.getBoolean("PacketsEnabled.Bed"));
|
||||||
setRidingPacketsEnabled(config.getBoolean("PacketsEnabled.Riding"));
|
|
||||||
setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus"));
|
setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus"));
|
||||||
setCollectPacketsEnabled(config.getBoolean("PacketsEnabled.Collect"));
|
setCollectPacketsEnabled(config.getBoolean("PacketsEnabled.Collect"));
|
||||||
setMetadataPacketsEnabled(config.getBoolean("PacketsEnabled.Metadata"));
|
setMetadataPacketsEnabled(config.getBoolean("PacketsEnabled.Metadata"));
|
||||||
|
@ -183,10 +181,6 @@ public class DisguiseConfig {
|
||||||
return showNameAboveHead;
|
return showNameAboveHead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isRidingPacketsEnabled() {
|
|
||||||
return ridingEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isSelfDisguisesSoundsReplaced() {
|
public static boolean isSelfDisguisesSoundsReplaced() {
|
||||||
return hearSelfDisguise;
|
return hearSelfDisguise;
|
||||||
}
|
}
|
||||||
|
@ -371,13 +365,6 @@ public class DisguiseConfig {
|
||||||
showNameAboveHead = showNames;
|
showNameAboveHead = showNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRidingPacketsEnabled(boolean enabled) {
|
|
||||||
if (enabled != isRidingPacketsEnabled()) {
|
|
||||||
ridingEnabled = enabled;
|
|
||||||
PacketsManager.setupMainPacketsListener();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setSheepDyeable(boolean color) {
|
public static void setSheepDyeable(boolean color) {
|
||||||
colorizeSheep = color;
|
colorizeSheep = color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1112,9 +1112,6 @@ public class PacketsManager {
|
||||||
{
|
{
|
||||||
packetsToListen.add(PacketType.Play.Server.ENTITY_METADATA);
|
packetsToListen.add(PacketType.Play.Server.ENTITY_METADATA);
|
||||||
}
|
}
|
||||||
if (DisguiseConfig.isRidingPacketsEnabled()) {
|
|
||||||
packetsToListen.add(PacketType.Play.Server.ATTACH_ENTITY);
|
|
||||||
}
|
|
||||||
if (DisguiseConfig.isCollectPacketsEnabled()) {
|
if (DisguiseConfig.isCollectPacketsEnabled()) {
|
||||||
packetsToListen.add(PacketType.Play.Server.COLLECT);
|
packetsToListen.add(PacketType.Play.Server.COLLECT);
|
||||||
}
|
}
|
||||||
|
@ -1150,8 +1147,8 @@ public class PacketsManager {
|
||||||
final Player observer = event.getPlayer();
|
final Player observer = event.getPlayer();
|
||||||
// First get the entity, the one sending this packet
|
// First get the entity, the one sending this packet
|
||||||
StructureModifier<Entity> entityModifer = event.getPacket().getEntityModifier(observer.getWorld());
|
StructureModifier<Entity> entityModifer = event.getPacket().getEntityModifier(observer.getWorld());
|
||||||
org.bukkit.entity.Entity entity = entityModifer.read((PacketType.Play.Server.COLLECT == event.getPacketType()
|
org.bukkit.entity.Entity entity = entityModifer
|
||||||
|| PacketType.Play.Server.ATTACH_ENTITY == event.getPacketType() ? 1 : 0));
|
.read((PacketType.Play.Server.COLLECT == event.getPacketType() ? 1 : 0));
|
||||||
// If the entity is the same as the sender. Don't disguise!
|
// If the entity is the same as the sender. Don't disguise!
|
||||||
// Prevents problems and there is no advantage to be gained.
|
// Prevents problems and there is no advantage to be gained.
|
||||||
if (entity == observer)
|
if (entity == observer)
|
||||||
|
@ -1246,12 +1243,6 @@ public class PacketsManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sentPacket.getType() == PacketType.Play.Server.ATTACH_ENTITY) {
|
|
||||||
if (disguise.getType().isMisc()) {
|
|
||||||
packets = new PacketContainer[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Else if the packet is sending entity metadata
|
// Else if the packet is sending entity metadata
|
||||||
else if (sentPacket.getType() == PacketType.Play.Server.ENTITY_METADATA) {
|
else if (sentPacket.getType() == PacketType.Play.Server.ENTITY_METADATA) {
|
||||||
if (DisguiseConfig.isMetadataPacketsEnabled()) {
|
if (DisguiseConfig.isMetadataPacketsEnabled()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user