Falling dust particle kick from server

Discussion in 'Spigot Plugin Development' started by Stef, Jun 12, 2016.

  1. Hey,

    When spawning a falling dust particle, like so:
    Code (Text):
    location.getWorld().spawnParticle(org.bukkit.Particle.FALLING_DUST, location, 100, .5, .5, .5);
    I get kicked from the server with this error:
    Code (Text):
    Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(38) + length(1) exceeds writerIndex(38): UnpooledHeapByteBuf(ridx: 38, widx: 38, cap: 38)
    Does anyone know what this error means and why this is happening?
     
  2. Are you running the correct version of minecraft? Your using a 1.10 particle on a lower version server it sounds like
     
  3. I am on 1.10 both my server and my client.
     
  4. Lower the amount of particles to 10
     
  5. Changed it to this:
    Code (Text):
    location.getWorld().spawnParticle(org.bukkit.Particle.FALLING_DUST, location, 10, .5, .5, .5);
    but I still get kicked with the same error.
     
  6. YOu have the full error|?
     
  7. This is what it says when I get kicked from the server:
    Code (Text):
    Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(38) + length(1) exceeds writerIndex(38): UnpooledHeapByteBuf(ridx: 38, widx: 38, cap: 38)
     
  8. You sure on 1.10? And can how show the event or method when using this?


    (Also tagging md_5) @md_5
     
  9. Yes minecraft title says "Minecraft 1.10" and my server is running spigot 1.10 as well.
    Here is the code where the particles are run from:

    Timer (repeating every 20 ticks)
    Code (Text):
    for (Arena arena : ArenaManager.getInstance().getArenas()) {
                for (Plot plot : arena.getPlots()) {
                    for (Particle particle : plot.getParticles()) {
                        particle.render();
                    }
                }
            }
    Here is my particle class:

    Code (Text):
    private Location location;
        private ParticleType type;
       
        public Particle(Location location, ParticleType type) {
            this.location = location;
            this.type = type;
        }
       
        public Location getLocation() {
            return location;
        }
       
        public ParticleType getType() {
            return type;
        }
       
        public void render() {
            if (getType() == ParticleType.ANGRY_VILLAGER)
                location.getWorld().spawnParticle(org.bukkit.Particle.VILLAGER_ANGRY, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.DAMAGE_INDICATOR)
                location.getWorld().spawnParticle(org.bukkit.Particle.DAMAGE_INDICATOR, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.DRAGON_BREATH)
                location.getWorld().spawnParticle(org.bukkit.Particle.DRAGON_BREATH, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.ENCHANTMENT)
                location.getWorld().spawnParticle(org.bukkit.Particle.ENCHANTMENT_TABLE, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.END_ROD)
                location.getWorld().spawnParticle(org.bukkit.Particle.END_ROD, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.FALLING_DUST)
                location.getWorld().spawnParticle(org.bukkit.Particle.FALLING_DUST, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.FLAMES)
                location.getWorld().spawnParticle(org.bukkit.Particle.FLAME, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.HAPPY_VILLAGER)
                location.getWorld().spawnParticle(org.bukkit.Particle.VILLAGER_HAPPY, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.HEARTS)
                location.getWorld().spawnParticle(org.bukkit.Particle.HEART, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.LAVA_DRIP)
                location.getWorld().spawnParticle(org.bukkit.Particle.DRIP_LAVA, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.MAGIC_CRIT)
                location.getWorld().spawnParticle(org.bukkit.Particle.CRIT_MAGIC, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.REDSTONE_MAGIC)
                location.getWorld().spawnParticle(org.bukkit.Particle.REDSTONE, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.SMOKE)
                location.getWorld().spawnParticle(org.bukkit.Particle.SMOKE_NORMAL, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.SNOWBALL_POOF)
                location.getWorld().spawnParticle(org.bukkit.Particle.SNOWBALL, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.SPELL)
                location.getWorld().spawnParticle(org.bukkit.Particle.SPELL, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.SWEEP_ATTACK)
                location.getWorld().spawnParticle(org.bukkit.Particle.SWEEP_ATTACK, location, 100, .5, .5, .5);
            else if (getType() == ParticleType.WATER_DRIP)
                location.getWorld().spawnParticle(org.bukkit.Particle.DRIP_WATER, location, 100, .5, .5, .5);
        }
       
        public void setLocation(Location location) {
            this.location = location;
        }
       
        public void setType(ParticleType type) {
            this.type = type;
        }
     
  10. Have you tried doing the particle;
    location.getWorld().spawnParticle(org.bukkit.Particle.DRIP_WATER, location, 100, .5, .5, .5);
    Example on a event like togglesneakeevent?
     
  11. Tried all others and they all worked.
     
  12. I mean, use the spawnParticle in a togglesneakeffect, if that error still appears it is a bug.
     
  13. Created a new plugin for spigot 1.10 with only a togglesneak event which spawns the particle and I get kicked with the same error. This is my code:

    Code (Text):
    @Override
        public void onEnable() {
            Bukkit.getPluginManager().registerEvents(this, this);
        }
       
        @EventHandler
        public void onSneakEvent(PlayerToggleSneakEvent e) {
            Location location = e.getPlayer().getLocation();
    location.getWorld().spawnParticle(Particle.FALLING_DUST, location, 100, .5, .5, .5);
        }
     
  14. Tried with particle 10? The amount 10.
     
  15. I tried, same error.
    Code:
    Code (Text):
    @Override
        public void onEnable() {
            Bukkit.getPluginManager().registerEvents(this, this);
        }
       
        @EventHandler
        public void onSneakEvent(PlayerToggleSneakEvent e) {
            getLogger().info("Sneak");
            Location location = e.getPlayer().getLocation();
            location.getWorld().spawnParticle(Particle.FALLING_DUST, location, 10, .5, .5, .5);
            getLogger().info("Sneak done");
        }
     
  16. Than its a bug which staff need to fix. Already emailed md_5 so please be patient.
     
  17. Ok, thanks for your help.
     
    • Friendly Friendly x 1
  18. [​IMG]
     
  19. Woops
     
  20. Reported to JIRA.
     
    • Informative Informative x 1