mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
StringBuilder, rename local, javadocs
This commit is contained in:
parent
c4b48df0ee
commit
d32a077359
@ -290,7 +290,7 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
private String toReadable(String string) {
|
private String toReadable(String string) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
for (String s : string.split("_")) {
|
for (String s : string.split("_")) {
|
||||||
builder.append(s.substring(0, 1) + s.substring(1).toLowerCase());
|
builder.append(s.substring(0, 1)).append(s.substring(1).toLowerCase());
|
||||||
}
|
}
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
@ -305,11 +305,11 @@ public class FlagWatcher {
|
|||||||
if (itemStack == null) {
|
if (itemStack == null) {
|
||||||
// Find the item to replace it with
|
// Find the item to replace it with
|
||||||
if (getDisguise().getEntity() instanceof LivingEntity) {
|
if (getDisguise().getEntity() instanceof LivingEntity) {
|
||||||
EntityEquipment enquipment = ((LivingEntity) getDisguise().getEntity()).getEquipment();
|
EntityEquipment equipment = ((LivingEntity) getDisguise().getEntity()).getEquipment();
|
||||||
if (slot == 4) {
|
if (slot == 4) {
|
||||||
itemStack = enquipment.getItemInHand();
|
itemStack = equipment.getItemInHand();
|
||||||
} else {
|
} else {
|
||||||
itemStack = enquipment.getArmorContents()[slot];
|
itemStack = equipment.getArmorContents()[slot];
|
||||||
}
|
}
|
||||||
if (itemStack != null && itemStack.getTypeId() == 0) {
|
if (itemStack != null && itemStack.getTypeId() == 0) {
|
||||||
itemStack = null;
|
itemStack = null;
|
||||||
|
@ -350,7 +350,6 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
|
|||||||
// Parse to horse color
|
// Parse to horse color
|
||||||
} else if (param.getSimpleName().equals("Color")) {
|
} else if (param.getSimpleName().equals("Color")) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("a horse color", valueString, methodName);
|
throw parseToException("a horse color", valueString, methodName);
|
||||||
|
@ -30,7 +30,6 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Zombie;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffect;
|
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
import com.comphenix.protocol.PacketType;
|
||||||
@ -175,8 +174,7 @@ public class DisguiseUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Sends
|
* Sends entity removal packets, as this disguise was removed
|
||||||
* entity removal packets, as this disguise was removed
|
|
||||||
*/
|
*/
|
||||||
public static void destroyEntity(TargetedDisguise disguise) {
|
public static void destroyEntity(TargetedDisguise disguise) {
|
||||||
try {
|
try {
|
||||||
@ -461,8 +459,7 @@ public class DisguiseUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Resends
|
* Resends the entity to this specific player
|
||||||
* the entity to this specific player
|
|
||||||
*/
|
*/
|
||||||
public static void refreshTracker(TargetedDisguise disguise, String player) {
|
public static void refreshTracker(TargetedDisguise disguise, String player) {
|
||||||
if (disguise.getEntity() != null && disguise.getEntity().isValid()) {
|
if (disguise.getEntity() != null && disguise.getEntity().isValid()) {
|
||||||
@ -495,8 +492,7 @@ public class DisguiseUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param A
|
* A convenience method for me to refresh trackers in other plugins
|
||||||
* convidence method for me to refresh trackers in other plugins
|
|
||||||
*/
|
*/
|
||||||
public static void refreshTrackers(Entity entity) {
|
public static void refreshTrackers(Entity entity) {
|
||||||
if (entity.isValid()) {
|
if (entity.isValid()) {
|
||||||
@ -532,8 +528,7 @@ public class DisguiseUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Resends
|
* Resends the entity to all the watching players, which is where the magic begins
|
||||||
* the entity to all the watching players, which is where the magic begins
|
|
||||||
*/
|
*/
|
||||||
public static void refreshTrackers(TargetedDisguise disguise) {
|
public static void refreshTrackers(TargetedDisguise disguise) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user