Java Code Examples for net.minecraft.util.StringUtils#isNullOrEmpty()

The following examples show how to use net.minecraft.util.StringUtils#isNullOrEmpty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MixinNBTUtil.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @author Sk1er
 * @reason Not proper null checks
 */
@Overwrite
public static GameProfile readGameProfileFromNBT(NBTTagCompound compound) {
    String s = null;
    String s1 = null;

    if (compound.hasKey("Name", 8)) s = compound.getString("Name");
    if (compound.hasKey("Id", 8)) s1 = compound.getString("Id");

    if (StringUtils.isNullOrEmpty(s) && StringUtils.isNullOrEmpty(s1)) {
        return null;
    } else {
        UUID uuid = null;
        if (s1 != null)
            try {
                uuid = UUID.fromString(s1);
            } catch (Throwable ignored) {
            }

        GameProfile gameprofile = new GameProfile(uuid, s);

        if (compound.hasKey("Properties", 10)) {
            NBTTagCompound nbttagcompound = compound.getCompoundTag("Properties");

            for (String s2 : nbttagcompound.getKeySet()) {
                NBTTagList nbttaglist = nbttagcompound.getTagList(s2, 10);

                int bound = nbttaglist.tagCount();
                for (int i = 0; i < bound; i++) {
                    NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
                    String s3 = nbttagcompound1.getString("Value");
                    gameprofile.getProperties().put(s2, nbttagcompound1.hasKey("Signature", 8) ?
                        new Property(s2, s3, nbttagcompound1.getString("Signature")) : new Property(s2, s3));
                }
            }
        }

        return gameprofile;
    }
}
 
Example 2
Source File: WrapperStringUtils.java    From ClientBase with MIT License 4 votes vote down vote up
public static boolean isNullOrEmpty(String var0) {
    return StringUtils.isNullOrEmpty(var0);
}
 
Example 3
Source File: ToggleSprintStatus.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ToggleSprintStatus(JsonHolder data, int ordinal) {
    super(data, ordinal);
    sprintEnabledText = data.optString("sprintEnabledText");
    if (StringUtils.isNullOrEmpty(sprintEnabledText)) sprintEnabledText = "ToggleSprint Enabled";
    height = 10;
}