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
*/
public static MetaIndex<Integer> AREA_EFFECT_CLOUD_COLOR = new MetaIndex<>(AreaEffectCloudWatcher.class, 1,
Color.BLACK.asRGB());
public static MetaIndex<Integer> AREA_EFFECT_CLOUD_COLOR =
new MetaIndex<>(AreaEffectCloudWatcher.class, 1, Color.BLACK.asRGB());
/**
* Ignore radius and show effect as single point, not area
*/
public static MetaIndex<Boolean> AREA_EFFECT_IGNORE_RADIUS = new MetaIndex<>(AreaEffectCloudWatcher.class, 2,
false);
public static MetaIndex<Boolean> AREA_EFFECT_IGNORE_RADIUS =
new MetaIndex<>(AreaEffectCloudWatcher.class, 2, false);
/**
* 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);
@NmsRemovedIn(NmsVersion.v1_13)
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_1_OLD = new MetaIndex<>(AreaEffectCloudWatcher.class, 4,
0);
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_1_OLD =
new MetaIndex<>(AreaEffectCloudWatcher.class, 4, 0);
@NmsRemovedIn(NmsVersion.v1_13)
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_2_OLD = new MetaIndex<>(AreaEffectCloudWatcher.class, 5,
0);
public static MetaIndex<Integer> AREA_EFFECT_PARTICLE_PARAM_2_OLD =
new MetaIndex<>(AreaEffectCloudWatcher.class, 5, 0);
/**
* The size of the area
@ -68,26 +68,26 @@ public class MetaIndex<Y> {
/**
* Armorstand body eular vector
*/
public static MetaIndex<Vector3F> ARMORSTAND_BODY = new MetaIndex<>(ArmorStandWatcher.class, 2,
new Vector3F(0, 0, 0));
public static MetaIndex<Vector3F> ARMORSTAND_BODY =
new MetaIndex<>(ArmorStandWatcher.class, 2, new Vector3F(0, 0, 0));
/**
* Armorstand head eular vector
*/
public static MetaIndex<Vector3F> ARMORSTAND_HEAD = new MetaIndex<>(ArmorStandWatcher.class, 1,
new Vector3F(0, 0, 0));
public static MetaIndex<Vector3F> ARMORSTAND_HEAD =
new MetaIndex<>(ArmorStandWatcher.class, 1, new Vector3F(0, 0, 0));
/**
* Armorstand left arm eular vector
*/
public static MetaIndex<Vector3F> ARMORSTAND_LEFT_ARM = new MetaIndex<>(ArmorStandWatcher.class, 3,
new Vector3F(-10, 0, -10));
public static MetaIndex<Vector3F> ARMORSTAND_LEFT_ARM =
new MetaIndex<>(ArmorStandWatcher.class, 3, new Vector3F(-10, 0, -10));
/**
* Armorstand left leg eular vector
*/
public static MetaIndex<Vector3F> ARMORSTAND_LEFT_LEG = new MetaIndex<>(ArmorStandWatcher.class, 5,
new Vector3F(-1, 0, -1));
public static MetaIndex<Vector3F> ARMORSTAND_LEFT_LEG =
new MetaIndex<>(ArmorStandWatcher.class, 5, new Vector3F(-1, 0, -1));
/**
* Armorstand metadata
@ -97,14 +97,14 @@ public class MetaIndex<Y> {
/**
* Armorstand right arm eular vector
*/
public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_ARM = new MetaIndex<>(ArmorStandWatcher.class, 4,
new Vector3F(-15, 0, 10));
public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_ARM =
new MetaIndex<>(ArmorStandWatcher.class, 4, new Vector3F(-15, 0, 10));
/**
* Armorstand right leg eular vector
*/
public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_LEG = new MetaIndex<>(ArmorStandWatcher.class, 6,
new Vector3F(1, 0, 1));
public static MetaIndex<Vector3F> ARMORSTAND_RIGHT_LEG =
new MetaIndex<>(ArmorStandWatcher.class, 6, new Vector3F(1, 0, 1));
/**
* If the arrow is a critical strike
@ -188,8 +188,8 @@ public class MetaIndex<Y> {
/**
* No visible effect
*/
public static MetaIndex<BlockPosition> DOLPHIN_TREASURE_POS = new MetaIndex<>(DolphinWatcher.class, 0,
BlockPosition.ORIGIN);
public static MetaIndex<BlockPosition> DOLPHIN_TREASURE_POS =
new MetaIndex<>(DolphinWatcher.class, 0, BlockPosition.ORIGIN);
/**
* No visible effect
*/
@ -203,11 +203,11 @@ public class MetaIndex<Y> {
/**
* The itemstack of the dropped item, must be set
*/
public static MetaIndex<ItemStack> DROPPED_ITEM = new MetaIndex<>(DroppedItemWatcher.class, 0,
new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> DROPPED_ITEM =
new MetaIndex<>(DroppedItemWatcher.class, 0, new ItemStack(Material.AIR));
public static MetaIndex<Optional<BlockPosition>> ENDER_CRYSTAL_BEAM = new MetaIndex<>(EnderCrystalWatcher.class, 0,
Optional.empty());
public static MetaIndex<Optional<BlockPosition>> ENDER_CRYSTAL_BEAM =
new MetaIndex<>(EnderCrystalWatcher.class, 0, Optional.empty());
/**
* 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);
@NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<ItemStack> ENDER_SIGNAL_ITEM = new MetaIndex<>(EnderSignalWatcher.class, 0,
new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> ENDER_SIGNAL_ITEM =
new MetaIndex<>(EnderSignalWatcher.class, 0, new ItemStack(Material.AIR));
/**
* If the enderman is screaming
@ -231,8 +231,8 @@ public class MetaIndex<Y> {
/**
* What block the enderman is holding
*/
public static MetaIndex<Optional<WrappedBlockData>> ENDERMAN_ITEM = new MetaIndex<>(EndermanWatcher.class, 0,
Optional.empty());
public static MetaIndex<Optional<WrappedBlockData>> ENDERMAN_ITEM =
new MetaIndex<>(EndermanWatcher.class, 0, Optional.empty());
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
*/
@NmsAddedIn(NmsVersion.v1_13)
public static MetaIndex<Optional<WrappedChatComponent>> ENTITY_CUSTOM_NAME = new MetaIndex<>(FlagWatcher.class, 2,
Optional.empty());
public static MetaIndex<Optional<WrappedChatComponent>> ENTITY_CUSTOM_NAME =
new MetaIndex<>(FlagWatcher.class, 2, Optional.empty());
/**
* The custom name of the entity, empty if not set
*/
@ -275,12 +275,12 @@ public class MetaIndex<Y> {
@NmsAddedIn(NmsVersion.v1_14)
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,
BlockPosition.ORIGIN);
public static MetaIndex<BlockPosition> FALLING_BLOCK_POSITION =
new MetaIndex<>(FallingBlockWatcher.class, 0, BlockPosition.ORIGIN);
@NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<ItemStack> FIREBALL_ITEM = new MetaIndex<>(FireballWatcher.class, 0,
new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> FIREBALL_ITEM =
new MetaIndex<>(FireballWatcher.class, 0, new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> FIREWORK_ITEM = new MetaIndex<>(FireworkWatcher.class, 0,
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);
@NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<OptionalInt> FIREWORK_ATTACHED_ENTITY = new MetaIndex<>(FireworkWatcher.class, 1,
OptionalInt.empty());
public static MetaIndex<OptionalInt> FIREWORK_ATTACHED_ENTITY =
new MetaIndex<>(FireworkWatcher.class, 1, OptionalInt.empty());
@NmsAddedIn(NmsVersion.v1_14)
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
*/
public static MetaIndex<Boolean> HORSE_CHESTED_CARRYING_CHEST = new MetaIndex<>(ChestedHorseWatcher.class, 0,
false);
public static MetaIndex<Boolean> HORSE_CHESTED_CARRYING_CHEST =
new MetaIndex<>(ChestedHorseWatcher.class, 0, false);
@NmsRemovedIn(NmsVersion.v1_14)
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
*/
public static MetaIndex<Optional<UUID>> HORSE_OWNER = new MetaIndex<>(AbstractHorseWatcher.class, 1,
Optional.empty());
public static MetaIndex<Optional<UUID>> HORSE_OWNER =
new MetaIndex<>(AbstractHorseWatcher.class, 1, Optional.empty());
@NmsAddedIn(NmsVersion.v1_14)
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
*/
public static MetaIndex<ItemStack> ITEMFRAME_ITEM = new MetaIndex<>(ItemFrameWatcher.class, 0,
new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> ITEMFRAME_ITEM =
new MetaIndex<>(ItemFrameWatcher.class, 0, new ItemStack(Material.AIR));
/**
* 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);
@NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<Optional<BlockPosition>> LIVING_BED_POSITION = new MetaIndex<>(LivingWatcher.class, 6,
Optional.empty());
public static MetaIndex<Optional<BlockPosition>> LIVING_BED_POSITION =
new MetaIndex<>(LivingWatcher.class, 6, Optional.empty());
/**
* 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<WrappedChatComponent> MINECART_COMMAND_LAST_OUTPUT = new MetaIndex<>(
MinecartCommandWatcher.class, 1, WrappedChatComponent.fromText(""));
public static MetaIndex<WrappedChatComponent> MINECART_COMMAND_LAST_OUTPUT =
new MetaIndex<>(MinecartCommandWatcher.class, 1, WrappedChatComponent.fromText(""));
/**
* 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<NbtBase> PLAYER_LEFT_SHOULDER_ENTITY = new MetaIndex<>(PlayerWatcher.class, 4,
NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None"));
public static MetaIndex<NbtBase> PLAYER_LEFT_SHOULDER_ENTITY =
new MetaIndex<>(PlayerWatcher.class, 4, NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None"));
public static MetaIndex<NbtBase> PLAYER_RIGHT_SHOULDER_ENTITY = new MetaIndex<>(PlayerWatcher.class, 5,
NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None"));
public static MetaIndex<NbtBase> PLAYER_RIGHT_SHOULDER_ENTITY =
new MetaIndex<>(PlayerWatcher.class, 5, NbtFactory.ofWrapper(NbtType.TAG_COMPOUND, "None"));
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<Optional<BlockPosition>> SHULKER_ATTACHED = new MetaIndex<>(ShulkerWatcher.class, 1,
Optional.empty());
public static MetaIndex<Optional<BlockPosition>> SHULKER_ATTACHED =
new MetaIndex<>(ShulkerWatcher.class, 1, Optional.empty());
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<ItemStack> SPLASH_POTION_ITEM = new MetaIndex<>(SplashPotionWatcher.class, 0,
new ItemStack(Material.SPLASH_POTION));
public static MetaIndex<ItemStack> SPLASH_POTION_ITEM =
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<Optional<UUID>> TAMEABLE_OWNER = new MetaIndex<>(TameableWatcher.class, 1,
Optional.empty());
public static MetaIndex<Optional<UUID>> TAMEABLE_OWNER =
new MetaIndex<>(TameableWatcher.class, 1, Optional.empty());
@NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<ItemStack> THROWABLE_ITEM = new MetaIndex<>(ThrowableWatcher.class, 0,
new ItemStack(Material.AIR));
public static MetaIndex<ItemStack> THROWABLE_ITEM =
new MetaIndex<>(ThrowableWatcher.class, 0, new ItemStack(Material.AIR));
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<BlockPosition> TURTLE_HOME_POSITION = new MetaIndex<>(TurtleWatcher.class, 0,
BlockPosition.ORIGIN);
public static MetaIndex<BlockPosition> TURTLE_HOME_POSITION =
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_UNKNOWN_3 = new MetaIndex<>(TurtleWatcher.class, 2, false);
public static MetaIndex<BlockPosition> TURTLE_TRAVEL_POSITION = new MetaIndex<>(TurtleWatcher.class, 3,
BlockPosition.ORIGIN);
public static MetaIndex<BlockPosition> TURTLE_TRAVEL_POSITION =
new MetaIndex<>(TurtleWatcher.class, 3, BlockPosition.ORIGIN);
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);
@NmsRemovedIn(NmsVersion.v1_14)
public static MetaIndex<Integer> ZOMBIE_VILLAGER_PROFESSION_OLD = new MetaIndex<>(ZombieVillagerWatcher.class, 1,
0);
public static MetaIndex<Integer> ZOMBIE_VILLAGER_PROFESSION_OLD =
new MetaIndex<>(ZombieVillagerWatcher.class, 1, 0);
@NmsAddedIn(NmsVersion.v1_14)
public static MetaIndex<VillagerData> ZOMBIE_VILLAGER_PROFESSION = new MetaIndex<>(ZombieVillagerWatcher.class, 1,
@ -694,8 +694,9 @@ public class MetaIndex<Y> {
private static void orderMetaIndexes() {
for (MetaIndex flagType : values()) {
if (flagType.getFlagWatcher() == FlagWatcher.class)
if (flagType.getFlagWatcher() == FlagWatcher.class) {
continue;
}
flagType._index += getNoIndexes(ReflectionManager.getSuperClass(flagType.getFlagWatcher()));
}
@ -710,8 +711,10 @@ public class MetaIndex<Y> {
HashMap<Class, Integer> maxValues = new HashMap<>();
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;
}
maxValues.put(type.getFlagWatcher(), type.getIndex());
}
@ -723,11 +726,13 @@ public class MetaIndex<Y> {
MetaIndex found = null;
for (MetaIndex type : values()) {
if (type.getIndex() != i)
if (type.getIndex() != i) {
continue;
}
if (!ReflectionManager.isAssignableFrom(entry.getKey(), type.getFlagWatcher()))
if (!ReflectionManager.isAssignableFrom(entry.getKey(), type.getFlagWatcher())) {
continue;
}
if (found != null) {
DisguiseUtilities.getLogger().severe(entry.getKey().getSimpleName() +
@ -740,8 +745,9 @@ public class MetaIndex<Y> {
found = type;
}
if (found != null)
if (found != null) {
continue;
}
DisguiseUtilities.getLogger()
.severe(entry.getKey().getSimpleName() + " has no FlagType registered for the index " + i);
@ -762,15 +768,19 @@ public class MetaIndex<Y> {
try {
for (Field field : MetaIndex.class.getFields()) {
if (field.getType() != MetaIndex.class)
if (field.getType() != MetaIndex.class) {
continue;
}
MetaIndex index = (MetaIndex) field.get(null);
try {
toPrint.add(index.toString());
} catch (Exception ex) {
ex.printStackTrace();
}
}
catch (Exception ex) {
} catch (Exception ex) {
ex.printStackTrace();
}
@ -797,11 +807,13 @@ public class MetaIndex<Y> {
*/
public static MetaIndex getMetaIndex(Class<? extends FlagWatcher> watcherClass, int flagNo) {
for (MetaIndex type : values()) {
if (type.getIndex() != flagNo)
if (type.getIndex() != flagNo) {
continue;
}
if (!ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher()))
if (!ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher())) {
continue;
}
return type;
}
@ -817,8 +829,9 @@ public class MetaIndex<Y> {
ArrayList<MetaIndex> list = new ArrayList<>();
for (MetaIndex type : values()) {
if (type == null || !ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher()))
if (type == null || !ReflectionManager.isAssignableFrom(watcherClass, type.getFlagWatcher())) {
continue;
}
list.add(type);
}
@ -832,8 +845,9 @@ public class MetaIndex<Y> {
int found = 0;
for (MetaIndex type : values()) {
if (type.getFlagWatcher() != c)
if (type.getFlagWatcher() != c) {
continue;
}
found++;
}
@ -865,8 +879,7 @@ public class MetaIndex<Y> {
return (MetaIndex) field.get(null);
}
}
catch (IllegalAccessException e) {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
@ -885,8 +898,7 @@ public class MetaIndex<Y> {
return field.getName();
}
}
catch (IllegalAccessException e) {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
@ -934,8 +946,9 @@ public class MetaIndex<Y> {
_values = new MetaIndex[0];
for (Field field : MetaIndex.class.getFields()) {
if (field.getType() != MetaIndex.class)
if (field.getType() != MetaIndex.class) {
continue;
}
MetaIndex index = (MetaIndex) field.get(null);
@ -944,16 +957,16 @@ public class MetaIndex<Y> {
continue;
}
if (index == null)
if (index == null) {
continue;
}
_values = Arrays.copyOf(_values, _values.length + 1);
_values[_values.length - 1] = index;
index.serializer = DisguiseUtilities.getSerializer(index);
}
}
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}
@ -968,10 +981,8 @@ public class MetaIndex<Y> {
field.set(null, metaIndex);
return true;
}
catch (NoSuchFieldException ignored) {
}
catch (Exception ex) {
} catch (NoSuchFieldException ignored) {
} catch (Exception ex) {
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,
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,
Sound.ENTITY_MULE_CHEST),