SPIGOT-6318: Fix smoke effect directions

By: WinX64 <winx64b@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot 2021-01-23 12:17:52 +11:00
parent f7ff794ec7
commit f6f717ebe7

View file

@ -28,35 +28,31 @@ public class CraftEffect {
datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data));
break;
case SMOKE:
switch ((BlockFace) data) { // TODO: Verify (Where did these values come from...?)
switch ((BlockFace) data) {
case DOWN:
// SPIGOT-6318: Fallback value for the old directions
case NORTH_EAST:
case NORTH_WEST:
case SOUTH_EAST:
case SOUTH_WEST:
case SELF:
datavalue = 0;
break;
case SOUTH:
case UP:
datavalue = 1;
break;
case SOUTH_WEST:
case NORTH:
datavalue = 2;
break;
case EAST:
case SOUTH:
datavalue = 3;
break;
case UP:
case SELF:
case WEST:
datavalue = 4;
break;
case WEST:
case EAST:
datavalue = 5;
break;
case NORTH_EAST:
datavalue = 6;
break;
case NORTH:
datavalue = 7;
break;
case NORTH_WEST:
datavalue = 8;
break;
default:
throw new IllegalArgumentException("Bad smoke direction!");
}