Created
January 14, 2014 16:16
-
-
Save tryb4/8420899 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void b_applyTag(Block b, String tag, String value, Plugin host) | |
{ | |
b.setMetadata(tag, new FixedMetadataValue(host, value)); | |
} | |
public static String b_getTag(Block b, String tag) | |
{ | |
if (b.getMetadata(tag) != null) | |
{ | |
for (MetadataValue val : b.getMetadata(tag)) | |
{ | |
return val.asString(); | |
} | |
} | |
return "NO_DATA_RECIEVED"; | |
} | |
public static void b_removeTag(Block b, String tag, Plugin host) | |
{ | |
if (b.getMetadata(tag) != null) | |
{ | |
b.removeMetadata(tag, host); | |
} | |
} | |
public static void e_applyTag(Entity e, String tag, String value, Plugin host) | |
{ | |
e.setMetadata(tag, new FixedMetadataValue(host, value)); | |
} | |
public static String e_getTag(Entity e, String tag) | |
{ | |
if (e.getMetadata(tag) != null) | |
{ | |
for (MetadataValue val : e.getMetadata(tag)) | |
{ | |
return val.asString(); | |
} | |
} | |
return "NO_DATA_RECIEVED"; | |
} | |
public static void e_removeTag(Entity e, String tag, Plugin host) | |
{ | |
if (e.getMetadata(tag) != null) | |
{ | |
e.removeMetadata(tag, host); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment