From fe07ea3e9fc520eee4d74b8094b08c51e5b9c524 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 12 Jul 2013 06:36:55 +1200 Subject: [PATCH] Introducing the new watcher values --- .../disguise/DisguiseTypes/Values.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/me/libraryaddict/disguise/DisguiseTypes/Values.java diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Values.java b/src/me/libraryaddict/disguise/DisguiseTypes/Values.java new file mode 100644 index 00000000..a9371c4b --- /dev/null +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Values.java @@ -0,0 +1,50 @@ +package me.libraryaddict.disguise.DisguiseTypes; + +import java.util.HashMap; + +import net.minecraft.server.v1_6_R2.IAttribute; + +public class Values { + + private static HashMap> metaValues = new HashMap>(); + private static HashMap> attributesValues = new HashMap>(); + private DisguiseType type; + + public Values(DisguiseType type) { + this.type = type; + metaValues.put(this.type, new HashMap()); + attributesValues.put(this.type, new HashMap()); + } + + public void setMetaValue(int no, Object value) { + metaValues.get(type).put(no, value); + } + + public static HashMap getMetaValues(DisguiseType type) { + if (type == DisguiseType.DONKEY || type == DisguiseType.MULE || type == DisguiseType.ZOMBIE_HORSE + || type == DisguiseType.SKELETON_HORSE) + type = DisguiseType.HORSE; + if (type == DisguiseType.MINECART_CHEST || type == DisguiseType.MINECART_FURNACE || type == DisguiseType.MINECART_HOPPER + || type == DisguiseType.MINECART_TNT || type == DisguiseType.MINECART_MOB_SPAWNER) + type = DisguiseType.MINECART_RIDEABLE; + if (type == DisguiseType.WITHER_SKELETON) + type = DisguiseType.SKELETON; + return metaValues.get(type); + } + + public void setAttributesValue(IAttribute no, Double value) { + attributesValues.get(type).put(no.a(), value); + } + + public static HashMap getAttributesValues(DisguiseType type) { + if (type == DisguiseType.DONKEY || type == DisguiseType.MULE || type == DisguiseType.ZOMBIE_HORSE + || type == DisguiseType.SKELETON_HORSE) + type = DisguiseType.HORSE; + if (type == DisguiseType.MINECART_CHEST || type == DisguiseType.MINECART_FURNACE || type == DisguiseType.MINECART_HOPPER + || type == DisguiseType.MINECART_TNT || type == DisguiseType.MINECART_MOB_SPAWNER) + type = DisguiseType.MINECART_RIDEABLE; + if (type == DisguiseType.WITHER_SKELETON) + type = DisguiseType.SKELETON; + return attributesValues.get(type); + } +}