Add MineCart sounds

This commit is contained in:
libraryaddict 2020-11-20 07:18:48 +13:00
parent ca17028aef
commit c96a799e9f
2 changed files with 104 additions and 91 deletions

View File

@ -33,14 +33,14 @@ public class MetaIndex<Y> {
/** /**
* The color of the Area Effect Cloud as RGB integer * The color of the Area Effect Cloud as RGB integer
*/ */
public static MetaIndex<Integer> AREA_EFFECT_CLOUD_COLOR = new MetaIndex<>(AreaEffectCloudWatcher.class, 1, public static MetaIndex<Integer> AREA_EFFECT_CLOUD_COLOR =
Color.BLACK.asRGB()); new MetaIndex<>(AreaEffectCloudWatcher.class, 1, Color.BLACK.asRGB());
/** /**
* Ignore radius and show effect as single point, not area * Ignore radius and show effect as single point, not area
*/ */
public static MetaIndex<Boolean> AREA_EFFECT_IGNORE_RADIUS = new MetaIndex<>(AreaEffectCloudWatcher.class, 2, public static MetaIndex<Boolean> AREA_EFFECT_IGNORE_RADIUS =
false); new MetaIndex<>(AreaEffectCloudWatcher.class, 2, false);
/** /**
* The type of particle to display * The type of particle to display
@ -53,12 +53,12 @@ public class MetaIndex<Y> {
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_OLD = new MetaIndex<>(AreaEffectCloudWatcher.class, 3, 0); public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_OLD = new MetaIndex<>(AreaEffectCloudWatcher.class, 3, 0);
@NmsRemovedIn(NmsVersion.v1_13) @NmsRemovedIn(NmsVersion.v1_13)
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_1_OLD = new MetaIndex<>(AreaEffectCloudWatcher.class, 4, public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_1_OLD =
0); new MetaIndex<>(AreaEffectCloudWatcher.class, 4, 0);
@NmsRemovedIn(NmsVersion.v1_13) @NmsRemovedIn(NmsVersion.v1_13)
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_2_OLD = new MetaIndex<>(AreaEffectCloudWatcher.class, 5, public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_2_OLD =
0); new MetaIndex<>(AreaEffectCloudWatcher.class, 5, 0);
/** /**
* The size of the area * The size of the area
@ -68,26 +68,26 @@ public class MetaIndex<Y> {
/** /**
* Armorstand body eular vector * Armorstand body eular vector
*/ */
public static MetaIndex<Vector3F> ARMORSTAND_BODY = new MetaIndex<>(ArmorStandWatcher.class, 2, public static MetaIndex<Vector3F> ARMORSTAND_BODY =
new Vector3F(0, 0, 0)); new MetaIndex<>(ArmorStandWatcher.class, 2, new Vector3F(0, 0, 0));
/** /**
* Armorstand head eular vector * Armorstand head eular vector
*/ */
public static MetaIndex<Vector3F> ARMORSTAND_HEAD = new MetaIndex<>(ArmorStandWatcher.class, 1, public static MetaIndex<Vector3F> ARMORSTAND_HEAD =
new Vector3F(0, 0, 0)); new MetaIndex<>(ArmorStandWatcher.class, 1, new Vector3F(0, 0, 0));
/** /**
* Armorstand left arm eular vector * Armorstand left arm eular vector
*/ */
public static MetaIndex<Vector3F> ARMORSTAND_LEFT_ARM = new MetaIndex<>(ArmorStandWatcher.class, 3, public static MetaIndex<Vector3F> ARMORSTAND_LEFT_ARM =
new Vector3F(-10, 0, -10)); new MetaIndex<>(ArmorStandWatcher.class, 3, new Vector3F(-10, 0, -10));
/** /**
* Armorstand left leg eular vector * Armorstand left leg eular vector
*/ */
public static MetaIndex<Vector3F> ARMORSTAND_LEFT_LEG = new MetaIndex<>(ArmorStandWatcher.class, 5, public static MetaIndex<Vector3F> ARMORSTAND_LEFT_LEG =
new Vector3F(-1, 0, -1)); new MetaIndex<>(ArmorStandWatcher.class, 5, new Vector3F(-1, 0, -1));
/** /**
* Armorstand metadata * Armorstand metadata
@ -97,14 +97,14 @@ public class MetaIndex<Y> {
/** /**
* Armorstand right arm eular vector * Armorstand right arm eular vector
*/ */
public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_ARM = new MetaIndex<>(ArmorStandWatcher.class, 4, public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_ARM =
new Vector3F(-15, 0, 10)); new MetaIndex<>(ArmorStandWatcher.class, 4, new Vector3F(-15, 0, 10));
/** /**
* Armorstand right leg eular vector * Armorstand right leg eular vector
*/ */
public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_LEG = new MetaIndex<>(ArmorStandWatcher.class, 6, public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_LEG =
new Vector3F(1, 0, 1)); new MetaIndex<>(ArmorStandWatcher.class, 6, new Vector3F(1, 0, 1));
/** /**
* If the arrow is a critical strike * If the arrow is a critical strike
@ -188,8 +188,8 @@ public class MetaIndex<Y> {
/** /**
* No visible effect * No visible effect
*/ */
public static MetaIndex<BlockPosition> DOLPHIN_TREASURE_POS = new MetaIndex<>(DolphinWatcher.class, 0, public static MetaIndex<BlockPosition> DOLPHIN_TREASURE_POS =
BlockPosition.ORIGIN); new MetaIndex<>(DolphinWatcher.class, 0, BlockPosition.ORIGIN);
/** /**
* No visible effect * No visible effect
*/ */
@ -203,11 +203,11 @@ public class MetaIndex<Y> {
/** /**
* The itemstack of the dropped item, must be set * The itemstack of the dropped item, must be set
*/ */
public static MetaIndex<ItemStack> DROPPED_ITEM = new MetaIndex<>(DroppedItemWatcher.class, 0, public static MetaIndex<ItemStack> DROPPED_ITEM =
new ItemStack(Material.AIR)); new MetaIndex<>(DroppedItemWatcher.class, 0, new ItemStack(Material.AIR));
public static MetaIndex<Optional<BlockPosition>> ENDER_CRYSTAL_BEAM = new MetaIndex<>(EnderCrystalWatcher.class, 0, public static MetaIndex<Optional<BlockPosition>> ENDER_CRYSTAL_BEAM =
Optional.empty()); new MetaIndex<>(EnderCrystalWatcher.class, 0, Optional.empty());
/** /**
* If the ender crystal has a plate * If the ender crystal has a plate
@ -217,8 +217,8 @@ public class MetaIndex<Y> {
public static MetaIndex<Integer> ENDER_DRAGON_PHASE = new MetaIndex<>(EnderDragonWatcher.class, 0, 10); public static MetaIndex<Integer> ENDER_DRAGON_PHASE = new MetaIndex<>(EnderDragonWatcher.class, 0, 10);
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<ItemStack> ENDER_SIGNAL_ITEM = new MetaIndex<>(EnderSignalWatcher.class, 0, public static MetaIndex<ItemStack> ENDER_SIGNAL_ITEM =
new ItemStack(Material.AIR)); new MetaIndex<>(EnderSignalWatcher.class, 0, new ItemStack(Material.AIR));
/** /**
* If the enderman is screaming * If the enderman is screaming
@ -231,8 +231,8 @@ public class MetaIndex<Y> {
/** /**
* What block the enderman is holding * What block the enderman is holding
*/ */
public static MetaIndex<Optional<WrappedBlockData>> ENDERMAN_ITEM = new MetaIndex<>(EndermanWatcher.class, 0, public static MetaIndex<Optional<WrappedBlockData>> ENDERMAN_ITEM =
Optional.empty()); new MetaIndex<>(EndermanWatcher.class, 0, Optional.empty());
public static MetaIndex<Integer> ENTITY_AIR_TICKS = new MetaIndex<>(FlagWatcher.class, 1, 300); public static MetaIndex<Integer> ENTITY_AIR_TICKS = new MetaIndex<>(FlagWatcher.class, 1, 300);
@ -240,8 +240,8 @@ public class MetaIndex<Y> {
* The custom name of the entity, empty if not set * The custom name of the entity, empty if not set
*/ */
@NmsAddedIn(NmsVersion.v1_13) @NmsAddedIn(NmsVersion.v1_13)
public static MetaIndex<Optional<WrappedChatComponent>> ENTITY_CUSTOM_NAME = new MetaIndex<>(FlagWatcher.class, 2, public static MetaIndex<Optional<WrappedChatComponent>> ENTITY_CUSTOM_NAME =
Optional.empty()); new MetaIndex<>(FlagWatcher.class, 2, Optional.empty());
/** /**
* The custom name of the entity, empty if not set * The custom name of the entity, empty if not set
*/ */
@ -275,12 +275,12 @@ public class MetaIndex<Y> {
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<EntityPose> ENTITY_POSE = new MetaIndex<>(FlagWatcher.class, 6, EntityPose.STANDING); public static MetaIndex<EntityPose> ENTITY_POSE = new MetaIndex<>(FlagWatcher.class, 6, EntityPose.STANDING);
public static MetaIndex<BlockPosition> FALLING_BLOCK_POSITION = new MetaIndex<>(FallingBlockWatcher.class, 0, public static MetaIndex<BlockPosition> FALLING_BLOCK_POSITION =
BlockPosition.ORIGIN); new MetaIndex<>(FallingBlockWatcher.class, 0, BlockPosition.ORIGIN);
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<ItemStack> FIREBALL_ITEM = new MetaIndex<>(FireballWatcher.class, 0, public static MetaIndex<ItemStack> FIREBALL_ITEM =
new ItemStack(Material.AIR)); new MetaIndex<>(FireballWatcher.class, 0, new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> FIREWORK_ITEM = new MetaIndex<>(FireworkWatcher.class, 0, public static MetaIndex<ItemStack> FIREWORK_ITEM = new MetaIndex<>(FireworkWatcher.class, 0,
new ItemStack(NmsVersion.v1_13.isSupported() ? Material.FIREWORK_ROCKET : Material.AIR)); new ItemStack(NmsVersion.v1_13.isSupported() ? Material.FIREWORK_ROCKET : Material.AIR));
@ -291,8 +291,8 @@ public class MetaIndex<Y> {
public static MetaIndex<Integer> FIREWORK_ATTACHED_ENTITY_OLD = new MetaIndex<>(FireworkWatcher.class, 1, 0); public static MetaIndex<Integer> FIREWORK_ATTACHED_ENTITY_OLD = new MetaIndex<>(FireworkWatcher.class, 1, 0);
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<OptionalInt> FIREWORK_ATTACHED_ENTITY = new MetaIndex<>(FireworkWatcher.class, 1, public static MetaIndex<OptionalInt> FIREWORK_ATTACHED_ENTITY =
OptionalInt.empty()); new MetaIndex<>(FireworkWatcher.class, 1, OptionalInt.empty());
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<Boolean> FIREWORK_SHOT_AT_ANGLE = new MetaIndex<>(FireworkWatcher.class, 2, false); public static MetaIndex<Boolean> FIREWORK_SHOT_AT_ANGLE = new MetaIndex<>(FireworkWatcher.class, 2, false);
@ -338,8 +338,8 @@ public class MetaIndex<Y> {
/** /**
* If horse has chest, set for donkey * If horse has chest, set for donkey
*/ */
public static MetaIndex<Boolean> HORSE_CHESTED_CARRYING_CHEST = new MetaIndex<>(ChestedHorseWatcher.class, 0, public static MetaIndex<Boolean> HORSE_CHESTED_CARRYING_CHEST =
false); new MetaIndex<>(ChestedHorseWatcher.class, 0, false);
@NmsRemovedIn(NmsVersion.v1_14) @NmsRemovedIn(NmsVersion.v1_14)
public static MetaIndex<Integer> HORSE_ARMOR = new MetaIndex<>(HorseWatcher.class, 1, 0); public static MetaIndex<Integer> HORSE_ARMOR = new MetaIndex<>(HorseWatcher.class, 1, 0);
@ -356,8 +356,8 @@ public class MetaIndex<Y> {
/** /**
* Owner of the horse, no visual effect * Owner of the horse, no visual effect
*/ */
public static MetaIndex<Optional<UUID>> HORSE_OWNER = new MetaIndex<>(AbstractHorseWatcher.class, 1, public static MetaIndex<Optional<UUID>> HORSE_OWNER =
Optional.empty()); new MetaIndex<>(AbstractHorseWatcher.class, 1, Optional.empty());
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<Byte> ILLAGER_SPELL = new MetaIndex<>(IllagerWizardWatcher.class, 0, (byte) 0); public static MetaIndex<Byte> ILLAGER_SPELL = new MetaIndex<>(IllagerWizardWatcher.class, 0, (byte) 0);
@ -375,8 +375,8 @@ public class MetaIndex<Y> {
/** /**
* The itemstack inside the itemframe * The itemstack inside the itemframe
*/ */
public static MetaIndex<ItemStack> ITEMFRAME_ITEM = new MetaIndex<>(ItemFrameWatcher.class, 0, public static MetaIndex<ItemStack> ITEMFRAME_ITEM =
new ItemStack(Material.AIR)); new MetaIndex<>(ItemFrameWatcher.class, 0, new ItemStack(Material.AIR));
/** /**
* The itemstack rotation inside the itemframe * The itemstack rotation inside the itemframe
@ -415,8 +415,8 @@ public class MetaIndex<Y> {
public static MetaIndex<Integer> LIVING_STINGS = new MetaIndex<>(LivingWatcher.class, 5, 0); public static MetaIndex<Integer> LIVING_STINGS = new MetaIndex<>(LivingWatcher.class, 5, 0);
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<Optional<BlockPosition>> LIVING_BED_POSITION = new MetaIndex<>(LivingWatcher.class, 6, public static MetaIndex<Optional<BlockPosition>> LIVING_BED_POSITION =
Optional.empty()); new MetaIndex<>(LivingWatcher.class, 6, Optional.empty());
/** /**
* If there is no carpet, -1. Otherwise it's a color enum value * If there is no carpet, -1. Otherwise it's a color enum value
@ -456,8 +456,8 @@ public class MetaIndex<Y> {
*/ */
public static MetaIndex<String> MINECART_COMMAND_STRING = new MetaIndex<>(MinecartCommandWatcher.class, 0, ""); public static MetaIndex<String> MINECART_COMMAND_STRING = new MetaIndex<>(MinecartCommandWatcher.class, 0, "");
public static MetaIndex<WrappedChatComponent> MINECART_COMMAND_LAST_OUTPUT = new MetaIndex<>( public static MetaIndex<WrappedChatComponent> MINECART_COMMAND_LAST_OUTPUT =
MinecartCommandWatcher.class, 1, WrappedChatComponent.fromText("")); new MetaIndex<>(MinecartCommandWatcher.class, 1, WrappedChatComponent.fromText(""));
/** /**
* If the minecart furnace is fueled and burning * If the minecart furnace is fueled and burning
@ -525,11 +525,11 @@ public class MetaIndex<Y> {
public static MetaIndex<Byte> PLAYER_SKIN = new MetaIndex<>(PlayerWatcher.class, 2, (byte) 127); public static MetaIndex<Byte> PLAYER_SKIN = new MetaIndex<>(PlayerWatcher.class, 2, (byte) 127);
public static MetaIndex<NbtBase> PLAYER_LEFT_SHOULDER_ENTITY = new MetaIndex<>(PlayerWatcher.class, 4, public static MetaIndex<NbtBase> PLAYER_LEFT_SHOULDER_ENTITY =
NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None")); new MetaIndex<>(PlayerWatcher.class, 4, NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None"));
public static MetaIndex<NbtBase> PLAYER_RIGHT_SHOULDER_ENTITY = new MetaIndex<>(PlayerWatcher.class, 5, public static MetaIndex<NbtBase> PLAYER_RIGHT_SHOULDER_ENTITY =
NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None")); new MetaIndex<>(PlayerWatcher.class, 5, NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None"));
public static MetaIndex<Boolean> POLAR_BEAR_STANDING = new MetaIndex<>(PolarBearWatcher.class, 0, false); public static MetaIndex<Boolean> POLAR_BEAR_STANDING = new MetaIndex<>(PolarBearWatcher.class, 0, false);
@ -542,8 +542,8 @@ public class MetaIndex<Y> {
public static MetaIndex<Byte> SHEEP_WOOL = new MetaIndex<>(SheepWatcher.class, 0, (byte) 0); public static MetaIndex<Byte> SHEEP_WOOL = new MetaIndex<>(SheepWatcher.class, 0, (byte) 0);
public static MetaIndex<Optional<BlockPosition>> SHULKER_ATTACHED = new MetaIndex<>(ShulkerWatcher.class, 1, public static MetaIndex<Optional<BlockPosition>> SHULKER_ATTACHED =
Optional.empty()); new MetaIndex<>(ShulkerWatcher.class, 1, Optional.empty());
public static MetaIndex<Byte> SHULKER_COLOR = new MetaIndex<>(ShulkerWatcher.class, 3, (byte) 16); public static MetaIndex<Byte> SHULKER_COLOR = new MetaIndex<>(ShulkerWatcher.class, 3, (byte) 16);
@ -569,17 +569,17 @@ public class MetaIndex<Y> {
public static MetaIndex<Byte> SPIDER_CLIMB = new MetaIndex<>(SpiderWatcher.class, 0, (byte) 0); public static MetaIndex<Byte> SPIDER_CLIMB = new MetaIndex<>(SpiderWatcher.class, 0, (byte) 0);
public static MetaIndex<ItemStack> SPLASH_POTION_ITEM = new MetaIndex<>(SplashPotionWatcher.class, 0, public static MetaIndex<ItemStack> SPLASH_POTION_ITEM =
new ItemStack(Material.SPLASH_POTION)); new MetaIndex<>(SplashPotionWatcher.class, 0, new ItemStack(Material.SPLASH_POTION));
public static MetaIndex<Byte> TAMEABLE_META = new MetaIndex<>(TameableWatcher.class, 0, (byte) 0); public static MetaIndex<Byte> TAMEABLE_META = new MetaIndex<>(TameableWatcher.class, 0, (byte) 0);
public static MetaIndex<Optional<UUID>> TAMEABLE_OWNER = new MetaIndex<>(TameableWatcher.class, 1, public static MetaIndex<Optional<UUID>> TAMEABLE_OWNER =
Optional.empty()); new MetaIndex<>(TameableWatcher.class, 1, Optional.empty());
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<ItemStack> THROWABLE_ITEM = new MetaIndex<>(ThrowableWatcher.class, 0, public static MetaIndex<ItemStack> THROWABLE_ITEM =
new ItemStack(Material.AIR)); new MetaIndex<>(ThrowableWatcher.class, 0, new ItemStack(Material.AIR));
public static MetaIndex<Integer> TIPPED_ARROW_COLOR = new MetaIndex<>(TippedArrowWatcher.class, 0, -1); public static MetaIndex<Integer> TIPPED_ARROW_COLOR = new MetaIndex<>(TippedArrowWatcher.class, 0, -1);
@ -592,15 +592,15 @@ public class MetaIndex<Y> {
public static MetaIndex<Integer> TROPICAL_FISH_VARIANT = new MetaIndex<>(TropicalFishWatcher.class, 0, 0); public static MetaIndex<Integer> TROPICAL_FISH_VARIANT = new MetaIndex<>(TropicalFishWatcher.class, 0, 0);
public static MetaIndex<BlockPosition> TURTLE_HOME_POSITION = new MetaIndex<>(TurtleWatcher.class, 0, public static MetaIndex<BlockPosition> TURTLE_HOME_POSITION =
BlockPosition.ORIGIN); new MetaIndex<>(TurtleWatcher.class, 0, BlockPosition.ORIGIN);
public static MetaIndex<Boolean> TURTLE_HAS_EGG = new MetaIndex<>(TurtleWatcher.class, 1, false); public static MetaIndex<Boolean> TURTLE_HAS_EGG = new MetaIndex<>(TurtleWatcher.class, 1, false);
public static MetaIndex<Boolean> TURTLE_UNKNOWN_3 = new MetaIndex<>(TurtleWatcher.class, 2, false); public static MetaIndex<Boolean> TURTLE_UNKNOWN_3 = new MetaIndex<>(TurtleWatcher.class, 2, false);
public static MetaIndex<BlockPosition> TURTLE_TRAVEL_POSITION = new MetaIndex<>(TurtleWatcher.class, 3, public static MetaIndex<BlockPosition> TURTLE_TRAVEL_POSITION =
BlockPosition.ORIGIN); new MetaIndex<>(TurtleWatcher.class, 3, BlockPosition.ORIGIN);
public static MetaIndex<Boolean> TURTLE_UNKNOWN_1 = new MetaIndex<>(TurtleWatcher.class, 4, false); public static MetaIndex<Boolean> TURTLE_UNKNOWN_1 = new MetaIndex<>(TurtleWatcher.class, 4, false);
@ -655,8 +655,8 @@ public class MetaIndex<Y> {
public static MetaIndex<Integer> ZOMBIE_PLACEHOLDER = new MetaIndex<>(ZombieWatcher.class, 1, 0); public static MetaIndex<Integer> ZOMBIE_PLACEHOLDER = new MetaIndex<>(ZombieWatcher.class, 1, 0);
@NmsRemovedIn(NmsVersion.v1_14) @NmsRemovedIn(NmsVersion.v1_14)
public static MetaIndex<Integer> ZOMBIE_VILLAGER_PROFESSION_OLD = new MetaIndex<>(ZombieVillagerWatcher.class, 1, public static MetaIndex<Integer> ZOMBIE_VILLAGER_PROFESSION_OLD =
0); new MetaIndex<>(ZombieVillagerWatcher.class, 1, 0);
@NmsAddedIn(NmsVersion.v1_14) @NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<VillagerData> ZOMBIE_VILLAGER_PROFESSION = new MetaIndex<>(ZombieVillagerWatcher.class, 1, public static MetaIndex<VillagerData> ZOMBIE_VILLAGER_PROFESSION = new MetaIndex<>(ZombieVillagerWatcher.class, 1,
@ -694,8 +694,9 @@ public class MetaIndex<Y> {
private static void orderMetaIndexes() { private static void orderMetaIndexes() {
for (MetaIndex flagType : values()) { for (MetaIndex flagType : values()) {
if (flagType.getFlagWatcher() == FlagWatcher.class) if (flagType.getFlagWatcher() == FlagWatcher.class) {
continue; continue;
}
flagType._index += getNoIndexes(ReflectionManager.getSuperClass(flagType.getFlagWatcher())); flagType._index += getNoIndexes(ReflectionManager.getSuperClass(flagType.getFlagWatcher()));
} }
@ -710,8 +711,10 @@ public class MetaIndex<Y> {
HashMap<Class, Integer> maxValues = new HashMap<>(); HashMap<Class, Integer> maxValues = new HashMap<>();
for (MetaIndex type : values()) { for (MetaIndex type : values()) {
if (maxValues.containsKey(type.getFlagWatcher()) && maxValues.get(type.getFlagWatcher()) > type.getIndex()) if (maxValues.containsKey(type.getFlagWatcher()) &&
maxValues.get(type.getFlagWatcher()) > type.getIndex()) {
continue; continue;
}
maxValues.put(type.getFlagWatcher(), type.getIndex()); maxValues.put(type.getFlagWatcher(), type.getIndex());
} }
@ -723,11 +726,13 @@ public class MetaIndex<Y> {
MetaIndex found = null; MetaIndex found = null;
for (MetaIndex type : values()) { for (MetaIndex type : values()) {
if (type.getIndex() != i) if (type.getIndex() != i) {
continue; continue;
}
if (!ReflectionManager.isAssignableFrom(entry.getKey(), type.getFlagWatcher())) if (!ReflectionManager.isAssignableFrom(entry.getKey(), type.getFlagWatcher())) {
continue; continue;
}
if (found != null) { if (found != null) {
DisguiseUtilities.getLogger().severe(entry.getKey().getSimpleName() + DisguiseUtilities.getLogger().severe(entry.getKey().getSimpleName() +
@ -740,8 +745,9 @@ public class MetaIndex<Y> {
found = type; found = type;
} }
if (found != null) if (found != null) {
continue; continue;
}
DisguiseUtilities.getLogger() DisguiseUtilities.getLogger()
.severe(entry.getKey().getSimpleName() + " has no FlagType registered for the index " + i); .severe(entry.getKey().getSimpleName() + " has no FlagType registered for the index " + i);
@ -762,15 +768,19 @@ public class MetaIndex<Y> {
try { try {
for (Field field : MetaIndex.class.getFields()) { for (Field field : MetaIndex.class.getFields()) {
if (field.getType() != MetaIndex.class) if (field.getType() != MetaIndex.class) {
continue; continue;
}
MetaIndex index = (MetaIndex) field.get(null); MetaIndex index = (MetaIndex) field.get(null);
try {
toPrint.add(index.toString()); toPrint.add(index.toString());
} catch (Exception ex) {
ex.printStackTrace();
} }
} }
catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@ -797,11 +807,13 @@ public class MetaIndex<Y> {
*/ */
public static MetaIndex getMetaIndex(Class<? extends FlagWatcher> watcherClass, int flagNo) { public static MetaIndex getMetaIndex(Class<? extends FlagWatcher> watcherClass, int flagNo) {
for (MetaIndex type : values()) { for (MetaIndex type : values()) {
if (type.getIndex() != flagNo) if (type.getIndex() != flagNo) {
continue; continue;
}
if (!ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher())) if (!ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher())) {
continue; continue;
}
return type; return type;
} }
@ -817,8 +829,9 @@ public class MetaIndex<Y> {
ArrayList<MetaIndex> list = new ArrayList<>(); ArrayList<MetaIndex> list = new ArrayList<>();
for (MetaIndex type : values()) { for (MetaIndex type : values()) {
if (type == null || !ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher())) if (type == null || !ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher())) {
continue; continue;
}
list.add(type); list.add(type);
} }
@ -832,8 +845,9 @@ public class MetaIndex<Y> {
int found = 0; int found = 0;
for (MetaIndex type : values()) { for (MetaIndex type : values()) {
if (type.getFlagWatcher() != c) if (type.getFlagWatcher() != c) {
continue; continue;
}
found++; found++;
} }
@ -865,8 +879,7 @@ public class MetaIndex<Y> {
return (MetaIndex) field.get(null); return (MetaIndex) field.get(null);
} }
} } catch (IllegalAccessException e) {
catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -885,8 +898,7 @@ public class MetaIndex<Y> {
return field.getName(); return field.getName();
} }
} } catch (IllegalAccessException e) {
catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -934,8 +946,9 @@ public class MetaIndex<Y> {
_values = new MetaIndex[0]; _values = new MetaIndex[0];
for (Field field : MetaIndex.class.getFields()) { for (Field field : MetaIndex.class.getFields()) {
if (field.getType() != MetaIndex.class) if (field.getType() != MetaIndex.class) {
continue; continue;
}
MetaIndex index = (MetaIndex) field.get(null); MetaIndex index = (MetaIndex) field.get(null);
@ -944,16 +957,16 @@ public class MetaIndex<Y> {
continue; continue;
} }
if (index == null) if (index == null) {
continue; continue;
}
_values = Arrays.copyOf(_values, _values.length + 1); _values = Arrays.copyOf(_values, _values.length + 1);
_values[_values.length - 1] = index; _values[_values.length - 1] = index;
index.serializer = DisguiseUtilities.getSerializer(index); index.serializer = DisguiseUtilities.getSerializer(index);
} }
} } catch (Exception e) {
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -968,10 +981,8 @@ public class MetaIndex<Y> {
field.set(null, metaIndex); field.set(null, metaIndex);
return true; return true;
} } catch (NoSuchFieldException ignored) {
catch (NoSuchFieldException ignored) { } catch (Exception ex) {
}
catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }

View File

@ -116,6 +116,8 @@ public enum DisguiseSoundEnums {
new Sound[]{Sound.ENTITY_MAGMA_CUBE_DEATH, Sound.ENTITY_MAGMA_CUBE_DEATH_SMALL}, null, new Sound[]{Sound.ENTITY_MAGMA_CUBE_DEATH, Sound.ENTITY_MAGMA_CUBE_DEATH_SMALL}, null,
Sound.ENTITY_MAGMA_CUBE_SQUISH, Sound.ENTITY_MAGMA_CUBE_SQUISH_SMALL), Sound.ENTITY_MAGMA_CUBE_SQUISH, Sound.ENTITY_MAGMA_CUBE_SQUISH_SMALL),
MINECART(null, Sound.ENTITY_MINECART_RIDING, null, null, Sound.ENTITY_MINECART_INSIDE),
MULE(Sound.ENTITY_MULE_HURT, Sound.BLOCK_GRASS_STEP, Sound.ENTITY_MULE_DEATH, Sound.ENTITY_MULE_AMBIENT, MULE(Sound.ENTITY_MULE_HURT, Sound.BLOCK_GRASS_STEP, Sound.ENTITY_MULE_DEATH, Sound.ENTITY_MULE_AMBIENT,
Sound.ENTITY_MULE_CHEST), Sound.ENTITY_MULE_CHEST),