@Override public void playEffect(Location location, Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed, int particleCount, int radius) { if (effect.getType() == Type.PARTICLE) { MaterialData material = new MaterialData(id, (byte) data); showParticle(location, effect, material, offsetX, offsetY, offsetZ, speed, particleCount); } else { GlowPlayer.this.playEffect(location, effect, data); } }
/** * Displays the given particle to all players. * * @param loc the location * @param particle the particle type * @param offsetX TODO: document this parameter * @param offsetY TODO: document this parameter * @param offsetZ TODO: document this parameter * @param speed TODO: document this parameter * @param amount the number of particles */ //@Override public void showParticle(Location loc, Effect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount) { checkNotNull(loc); checkNotNull(particle); int radius; if (GlowParticle.isLongDistance(particle)) { radius = 48; } else { radius = 16; } showParticle(loc, particle, particle .getId(), 0, offsetX, offsetY, offsetZ, speed, amount, radius); }
@Override public Optional<Effect> set(String value) { PowerParticle.this.data = null; try { Effect eff = Effect.valueOf(value.toUpperCase()); if (eff.getType() == Effect.Type.VISUAL) { PowerParticle.this.effect = eff; PowerParticle.this.particle = null; return Optional.empty(); } throw new Handler.CommandException("message.error.visualeffect", value); } catch (IllegalArgumentException e) { DeprecatedEffect particleEffect = DeprecatedEffect.valueOf(value); PowerParticle.this.effect = null; PowerParticle.this.particle = particleEffect.getParticle(); return Optional.empty(); } } }
@Override public void playEffect(MCLocation l, MCEffect mCEffect, int data, int radius) { w.playEffect(((BukkitMCLocation) l).l, Effect.valueOf(mCEffect.name()), data, radius); }
@Override public String get(Effect effect) { return effect.name(); }
String effectName = configuration.getString("effect"); try { effect = Effect.valueOf(effectName.toUpperCase()); } catch (Exception ignored) {
/** * Sends a {@link PlayParticleMessage} to display the given particle. * * @param loc the location * @param particle the particle type * @param material the item or block data * @param offsetX TODO: document this parameter * @param offsetY TODO: document this parameter * @param offsetZ TODO: document this parameter * @param speed TODO: document this parameter * @param amount the number of particles */ //@Override public void showParticle(Location loc, Effect particle, MaterialData material, float offsetX, float offsetY, float offsetZ, float speed, int amount) { if (location == null || particle == null || particle.getType() != Type.PARTICLE) { return; } int id = GlowParticle.getId(particle); boolean longDistance = GlowParticle.isLongDistance(particle); float x = (float) loc.getX(); float y = (float) loc.getY(); float z = (float) loc.getZ(); int[] extData = GlowParticle.getExtData(particle, material); session.send(new PlayParticleMessage(id, longDistance, x, y, z, offsetX, offsetY, offsetZ, speed, amount, extData)); }
@Override public void playEffect(Location loc, Effect effect, int data) { int id = effect.getId(); session.send(new PlayEffectMessage(id, loc.getBlockX(), loc.getBlockY(), loc .getBlockZ(), data, false)); }