From 7d16df11ff91c959400a291f54679ecf4fdb8314 Mon Sep 17 00:00:00 2001 From: BadBones69 Date: Thu, 16 Jun 2016 10:32:07 -0400 Subject: [PATCH 1/2] Adding 1.9 particles Particles Added: - DRAGON_BREATH - END_ROD - DAMAGE_INDICATOR - SWEEP_ATTACK Made it so it can allow 1.10 because it used to only get one number but since 10 has two numbers the method of getting the version needed to be changed. --- .../particleeffect/ParticleEffect.java | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java b/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java index 6db6726..2011306 100644 --- a/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java +++ b/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java @@ -381,7 +381,43 @@ public enum ParticleEffect { *
  • The offset values have no influence on this particle effect * */ - MOB_APPEARANCE("mobappearance", 41, 8); + MOB_APPEARANCE("mobappearance", 41, 8), + /** + * A particle effect which is displayed by ender dragon: + * + */ + DRAGON_BREATH("dragonbreath", 42, 9), + /** + * A particle effect which is displayed by skulker bullets and end rods: + * + */ + END_ROD("endRod", 43, 9), + /** + * A particle effect which is displayed by mobs when damaged: + * + */ + DAMAGE_INDICATOR("damageIndicator", 44, 9), + /** + * A particle effect which is displayed by swinging a sword: + * + */ + SWEEP_ATTACK("sweepAttack", 45, 9); private static final Map NAME_MAP = new HashMap(); private static final Map ID_MAP = new HashMap(); @@ -1403,7 +1439,7 @@ public static void initialize() throws VersionIncompatibleException { return; } try { - version = Integer.parseInt(Character.toString(PackageType.getServerVersion().charAt(3))); + version = Integer.parseInt(PackageType.getServerVersion().split("_")[1]); if (version > 7) { enumParticle = PackageType.MINECRAFT_SERVER.getClass("EnumParticle"); } From 81563042f4f336a9e47736e5bfae02b767bb2e71 Mon Sep 17 00:00:00 2001 From: XXLuigiMario Date: Tue, 28 Jun 2016 18:35:15 +0200 Subject: [PATCH 2/2] Added effect FALLING_DUST --- .../darkblade12/particleeffect/ParticleEffect.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java b/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java index 2011306..6246cb0 100644 --- a/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java +++ b/src/main/java/com/darkblade12/particleeffect/ParticleEffect.java @@ -417,7 +417,15 @@ public enum ParticleEffect { *
  • The offset values have no influence on this particle effect * */ - SWEEP_ATTACK("sweepAttack", 45, 9); + SWEEP_ATTACK("sweepAttack", 45, 9), + /** + * A particle effect which is displayed by unstable sand and gravel: + * + */ + FALLING_DUST("fallingdust", 46, 10, ParticleProperty.REQUIRES_DATA); private static final Map NAME_MAP = new HashMap(); private static final Map ID_MAP = new HashMap(); @@ -566,7 +574,7 @@ private static boolean isLongDistance(Location location, List players) { * @return Whether the data type is correct or not */ private static boolean isDataCorrect(ParticleEffect effect, ParticleData data) { - return ((effect == BLOCK_CRACK || effect == BLOCK_DUST) && data instanceof BlockData) || (effect == ITEM_CRACK && data instanceof ItemData); + return ((effect == BLOCK_CRACK || effect == BLOCK_DUST || effect == FALLING_DUST) && data instanceof BlockData) || (effect == ITEM_CRACK && data instanceof ItemData); } /** @@ -1638,4 +1646,4 @@ public PacketSendingException(String message, Throwable cause) { } } } -} \ No newline at end of file +}