2929import org .bukkit .EntityEffect ;
3030import org .bukkit .Location ;
3131import org .bukkit .Material ;
32+ import org .bukkit .Particle ;
3233import org .bukkit .block .BlockFace ;
3334import org .bukkit .entity .Entity ;
3435import org .bukkit .entity .Player ;
@@ -89,19 +90,19 @@ public Object getData(final @Nullable Object raw, final Location l) {
8990 MAGIC_CRIT (Effect .MAGIC_CRIT ),
9091 POTION_SWIRL (Effect .POTION_SWIRL ) {
9192 @ Override
92- public boolean supportsColors () {
93+ public boolean isColorable () {
9394 return true ;
9495 }
9596 },
9697 POTION_SWIRL_TRANSPARENT (Effect .POTION_SWIRL_TRANSPARENT ) {
9798 @ Override
98- public boolean supportsColors () {
99+ public boolean isColorable () {
99100 return true ;
100101 }
101102 },
102103 SPELL (Effect .SPELL ),
103104 INSTANT_SPELL (Effect .INSTANT_SPELL ),
104- WITCH_MAGIC (Effect .WITCH_MAGIC ),
105+ WITCH_SPELL (Effect .WITCH_MAGIC ),
105106 NOTE (Effect .NOTE ),
106107 PORTAL (Effect .PORTAL ),
107108 FLYING_GLYPH (Effect .FLYING_GLYPH ),
@@ -118,7 +119,7 @@ public boolean supportsColors() {
118119 CLOUD (Effect .CLOUD ),
119120 COLOURED_DUST (Effect .COLOURED_DUST ) {
120121 @ Override
121- public boolean supportsColors () {
122+ public boolean isColorable () {
122123 return true ;
123124 }
124125 },
@@ -131,7 +132,7 @@ public boolean supportsColors() {
131132 ANGRY_VILLAGER (Effect .VILLAGER_THUNDERCLOUD ),
132133 HAPPY_VILLAGER (Effect .HAPPY_VILLAGER ),
133134 LARGE_SMOKE (Effect .LARGE_SMOKE ),
134- ITEM_BREAK (Effect .ITEM_BREAK ) {
135+ ITEM_CRACK (Effect .ITEM_BREAK ) {
135136 @ Override
136137 public Object getData (final @ Nullable Object raw , final Location l ) {
137138 if (raw == null )
@@ -147,7 +148,7 @@ else if (raw instanceof ItemType) {
147148 }
148149 }
149150 },
150- TILE_BREAK (Effect .TILE_BREAK ) {
151+ BLOCK_BREAK (Effect .TILE_BREAK ) {
151152 @ SuppressWarnings ("null" )
152153 @ Override
153154 public Object getData (final @ Nullable Object raw , final Location l ) {
@@ -164,7 +165,7 @@ else if (raw instanceof ItemType) {
164165 }
165166 }
166167 },
167- TILE_DUST (Effect .TILE_DUST ) {
168+ BLOCK_DUST (Effect .TILE_DUST ) {
168169 @ SuppressWarnings ("null" )
169170 @ Override
170171 public Object getData (final @ Nullable Object raw , final Location l ) {
@@ -204,7 +205,7 @@ public Object getData(final @Nullable Object raw, final Location l) {
204205 /**
205206 * Checks if this effect has color support.
206207 */
207- public boolean supportsColors () {
208+ public boolean isColorable () {
208209 return false ;
209210 }
210211 }
@@ -235,7 +236,7 @@ public void onLanguageChange() {
235236 Skript .warning ("Missing pattern at '" + (node + ".pattern" ) + "' in the " + Language .getName () + " language file" );
236237 } else {
237238 types .add (ts [i ]);
238- if (ts [i ].supportsColors ())
239+ if (ts [i ].isColorable ())
239240 patterns .add (pattern );
240241 else {
241242 String dVarExpr = Language .get_ (LANGUAGE_NODE + ".area_expression" );
@@ -272,7 +273,7 @@ public VisualEffect() {}
272273 public boolean init (final Expression <?>[] exprs , final int matchedPattern , final Kleenean isDelayed , final ParseResult parseResult ) {
273274 type = types .get (matchedPattern );
274275
275- if (type .supportsColors ()) {
276+ if (type .isColorable ()) {
276277 for (Expression <?> expr : exprs ) {
277278 if (expr .getReturnType () == Color .class )
278279 color = (Color ) expr .getSingle (null );
@@ -322,19 +323,30 @@ public final static VisualEffect parse(final String s) {
322323 }
323324
324325 public void play (final @ Nullable Player [] ps , final Location l , final @ Nullable Entity e ) {
325- play (ps , l , e , 0 );
326+ play (ps , l , e , 0 , 0 );
326327 }
327328
328- public void play (final @ Nullable Player [] ps , final Location l , final @ Nullable Entity e , final int radius ) {
329+ @ SuppressWarnings ({"deprecation" , "null" })
330+ public void play (final @ Nullable Player [] ps , final Location l , final @ Nullable Entity e , final int count , final int radius ) {
329331 assert e == null || l .equals (e .getLocation ());
330332 if (isEntityEffect ()) {
331333 if (e != null )
332334 e .playEffect ((EntityEffect ) type .effect );
333335 } else {
334336 if (ps == null ) {
335- if (radius == 0 )
337+ int id = 0 ;
338+ int dt = 0 ;
339+
340+ if (data instanceof Material ) {
341+ id = ((Material ) data ).getId ();
342+ } else if (data instanceof MaterialData ) {
343+ id = ((MaterialData ) data ).getItemTypeId ();
344+ dt = ((MaterialData ) data ).getData ();
345+ }
346+
347+ if (radius == 0 ) {
336348 l .getWorld ().playEffect (l , (Effect ) type .effect , type .getData (data , l ));
337- else
349+ } else
338350 l .getWorld ().playEffect (l , (Effect ) type .effect , type .getData (data , l ), radius );
339351 } else {
340352 for (final Player p : ps )
0 commit comments