@Override
public void execute(SignActionEvent info) {
boolean move = info.isType("meffect");
if (!info.isPowered()) return;
Effect eff = parse(info);
if (info.isAction(SignActionType.MEMBER_MOVE)) {
if (move) {
if (info.isTrainSign()) {
for (MinecartMember<?> member : info.getGroup()) {
eff.play(member.getEntity().getLocation());
}
} else if (info.isCartSign()) {
eff.play(info.getMember().getEntity().getLocation());
}
}
return;
}
if (info.isTrainSign() && info.isAction(SignActionType.REDSTONE_ON, SignActionType.GROUP_ENTER) && info.hasGroup()) {
for (MinecartMember<?> member : info.getGroup()) {
eff.play(member.getEntity().getLocation());
}
} else if (info.isCartSign() && info.isAction(SignActionType.REDSTONE_ON, SignActionType.MEMBER_ENTER) && info.hasMember()) {
eff.play(info.getMember().getEntity().getLocation());
} else if (info.isRCSign() && info.isAction(SignActionType.REDSTONE_ON)) {
for (MinecartGroup group : info.getRCTrainGroups()) {
for (MinecartMember<?> member : group) {
eff.play(member.getEntity().getLocation());
}
}
} else if (info.isAction(SignActionType.REDSTONE_ON)) {
if (info.hasRails()) {
eff.play(info.getCenterLocation());
} else {
eff.play(info.getLocation().add(0.0, 2.0, 0.0));
}
}
}