Sort by name

This commit is contained in:
Andrew 2013-08-09 09:14:44 +12:00
parent e80523c59f
commit 66be1f8fa9
3 changed files with 69 additions and 69 deletions

View file

@ -73,6 +73,19 @@ public class DisguiseAPI {
return hearSelfDisguise;
}
public static void disguiseNextEntity(Disguise disguise) {
if (disguise == null)
return;
try {
Field field = net.minecraft.server.v1_6_R2.Entity.class.getDeclaredField("entityCount");
field.setAccessible(true);
int id = field.getInt(null);
disguises.put(id, disguise);
} catch (Exception ex) {
ex.printStackTrace();
}
}
/**
* @param Player
* - The player to disguise
@ -103,19 +116,6 @@ public class DisguiseAPI {
setupPlayer((Player) entity);
}
public static void disguiseNextEntity(Disguise disguise) {
if (disguise == null)
return;
try {
Field field = net.minecraft.server.v1_6_R2.Entity.class.getDeclaredField("entityCount");
field.setAccessible(true);
int id = field.getInt(null);
disguises.put(id, disguise);
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void enableSounds(boolean isSoundsEnabled) {
if (soundsEnabled != isSoundsEnabled) {
soundsEnabled = isSoundsEnabled;

View file

@ -155,6 +155,58 @@ public class Disguise {
watcher = tempWatcher;
}
public boolean equals(Disguise disguise) {
if (getType() != disguise.getType())
return false;
if (replaceSounds() != disguise.replaceSounds())
return false;
if (!getWatcher().equals(disguise.getWatcher()))
return false;
return true;
}
public org.bukkit.entity.Entity getEntity() {
return entity;
}
protected EntityPlayer[] getPerverts() {
EntityTrackerEntry entry = (EntityTrackerEntry) ((WorldServer) ((CraftEntity) entity).getHandle().world).tracker.trackedEntities
.get(entity.getEntityId());
if (entry != null) {
EntityPlayer[] players = (EntityPlayer[]) entry.trackedPlayers.toArray(new EntityPlayer[entry.trackedPlayers.size()]);
return players;
}
return new EntityPlayer[0];
}
public BukkitRunnable getScheduler() {
return runnable;
}
public DisguiseType getType() {
return disguiseType;
}
public FlagWatcher getWatcher() {
return watcher;
}
public boolean isMiscDisguise() {
return this instanceof MiscDisguise;
}
public boolean isMobDisguise() {
return this instanceof MobDisguise;
}
public boolean isPlayerDisguise() {
return this instanceof PlayerDisguise;
}
public boolean replaceSounds() {
return replaceSounds;
}
public void setEntity(final org.bukkit.entity.Entity entity) {
if (this.entity != null)
throw new RuntimeException("This disguise is already in use! Try .clone()");
@ -279,58 +331,6 @@ public class Disguise {
runnable.runTaskTimer(plugin, 1, 1);
}
public boolean equals(Disguise disguise) {
if (getType() != disguise.getType())
return false;
if (replaceSounds() != disguise.replaceSounds())
return false;
if (!getWatcher().equals(disguise.getWatcher()))
return false;
return true;
}
public org.bukkit.entity.Entity getEntity() {
return entity;
}
protected EntityPlayer[] getPerverts() {
EntityTrackerEntry entry = (EntityTrackerEntry) ((WorldServer) ((CraftEntity) entity).getHandle().world).tracker.trackedEntities
.get(entity.getEntityId());
if (entry != null) {
EntityPlayer[] players = (EntityPlayer[]) entry.trackedPlayers.toArray(new EntityPlayer[entry.trackedPlayers.size()]);
return players;
}
return new EntityPlayer[0];
}
public BukkitRunnable getScheduler() {
return runnable;
}
public DisguiseType getType() {
return disguiseType;
}
public FlagWatcher getWatcher() {
return watcher;
}
public boolean isMiscDisguise() {
return this instanceof MiscDisguise;
}
public boolean isMobDisguise() {
return this instanceof MobDisguise;
}
public boolean isPlayerDisguise() {
return this instanceof PlayerDisguise;
}
public boolean replaceSounds() {
return replaceSounds;
}
public void setReplaceSounds(boolean areSoundsReplaced) {
replaceSounds = areSoundsReplaced;
}

View file

@ -60,10 +60,6 @@ public class Values {
declared = classType;
}
public EnumEntitySize getEntitySize() {
return enumEntitySize;
}
public HashMap<String, Double> getAttributesValues() {
return attributesValues;
}
@ -72,6 +68,10 @@ public class Values {
return declared;
}
public EnumEntitySize getEntitySize() {
return enumEntitySize;
}
public HashMap<Integer, Object> getMetaValues() {
return metaValues;
}