Solved Plugin only works on a local server?

Discussion in 'Plugin Development' started by TheSporech, Apr 9, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    TheSporech

    Hi. I am testing my new plugin, and it works perfectly fine on a local server hosted by my laptop, but then when I tried uploading it to my Ubuntu server, I kept on getting this error, when I walk through a portal:

    Code:
    [10:16:21 WARN]: [PortalPlugin] Task #3 for PortalPlugin v2.0 generated an exception
    java.lang.NoSuchMethodError: java.util.Map.replace(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
        at me.Sporech.Portal$1.run(Portal.java:59) ~[?:?]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:53) ~[craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:349) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:686) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:361) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:635) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:539) [craftbukkit.jar:git-Bukkit-9554894]
        at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
    
    And this error on entity damage:
    Code:
    [10:14:33 ERROR]: Could not pass event EntityDamageEvent to PortalPlugin v2.0
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:89) [craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:570) [craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:556) [craftbukkit.jar:git-Bukkit-9554894]
        at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:602) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.damageEntity0(EntityLiving.java:1193) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.damageEntity(EntityLiving.java:807) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityRabbit.damageEntity(EntityRabbit.java:240) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.e(EntityLiving.java:1059) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.Block.fallOn(Block.java:484) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.Entity.a(Entity.java:874) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.a(EntityLiving.java:161) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.Entity.move(Entity.java:679) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.g(EntityLiving.java:1625) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.n(EntityLiving.java:1920) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityInsentient.n(EntityInsentient.java:480) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityAgeable.n(EntityAgeable.java:121) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityAnimal.n(EntityAnimal.java:23) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityRabbit.n(EntityRabbit.java:181) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityLiving.m(EntityLiving.java:1754) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.EntityInsentient.m(EntityInsentient.java:243) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.World.entityJoinedWorld(World.java:1491) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.World.g(World.java:1469) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.World.tickEntities(World.java:1331) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.WorldServer.tickEntities(WorldServer.java:610) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:733) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:361) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:635) [craftbukkit.jar:git-Bukkit-9554894]
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:539) [craftbukkit.jar:git-Bukkit-9554894]
        at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_9_R1.entity.CraftRabbit cannot be cast to org.bukkit.entity.HumanEntity
        at me.Sporech.PlayerListener.onEntityDamageEvent(PlayerListener.java:44) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[craftbukkit.jar:git-Bukkit-9554894]
        ... 32 more
    
    As far as I can tell, it's running the right version of Bukkit, and I don't know what's wrong. Can anyone see any problems?
     
  2. Offline

    0verFull

    @TheSporech you should not have the same version of java on your Ubuntu server and on your pc. That of your Ubuntu server should probably be lower. Which version of your java have you on your pc?
     
  3. Offline

    CraftCreeper6

    @0verFull
    I'm 99% sure that would return a Major.Minor mismatch.

    But check anyway.
     
  4. Offline

    0verFull

  5. Offline

    WolfMage1

    @TheSporech by the looks of it, your plugin starts up so it's not the java-version, can we see your PlayerListener class?

    And your task.
     
  6. Offline

    mcdorli

    java.lang.ClassCastException: org.bukkit.craftbukkit.v1_9_R1.entity.CraftRabbit cannot be cast to org.bukkit.entity.HumanEntity
    What could be the problem...
     
    maved145 likes this.
  7. Offline

    TheSporech

    I have no idea where that comes from... I never cast CraftRabbit to a HumanEntity...

    Here's PlayerListener:
    Code:
    package me.Sporech;
    
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import java.util.Random;
    import java.util.Set;
    
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.Particle;
    import org.bukkit.Sound;
    import org.bukkit.block.Block;
    import org.bukkit.block.BlockFace;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.HumanEntity;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.entity.EntityDamageEvent;
    import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.event.player.PlayerLoginEvent;
    import org.bukkit.event.player.PlayerQuitEvent;
    
    public class PlayerListener implements Listener {
        public PlayerListener(MainClass plugin) {
            plugin.getServer().getPluginManager().registerEvents(this,plugin);
        }
      
        public static Map<Player,PortalGun> mapper = new HashMap<>();
          
        @EventHandler
        public void onLoginEvent(PlayerLoginEvent event) {
            mapper.put(event.getPlayer(), new PortalGun());
        }
      
        @EventHandler
        public void onEntityDamageEvent(EntityDamageEvent event) {
            Entity e = event.getEntity();
            if (e instanceof Player || event.getCause() == DamageCause.FALL) {
                if (((HumanEntity) e).getInventory().getBoots().getType() == Material.IRON_BOOTS) {
                    event.setCancelled(true);
                }
            }
        }
      
        @EventHandler
        public void onLogoutEvent(PlayerQuitEvent event) {
            Player player = event.getPlayer();
            mapper.get(player).destroyPortals();
            mapper.remove(player);
            PortalGun.cooldown.remove(player);
        }
      
        @SuppressWarnings("deprecation")
        @EventHandler
        public void shoot(PlayerInteractEvent event) {
            Player player = event.getPlayer();
            if (player.getItemInHand().getType() == Material.WOOD_PICKAXE) {
                Location loc = player.getTargetBlock((Set<Material>) null, 100).getLocation().clone().add(0.5,0.5,0.5);
                //Colour of portal
                ArrayList<Double> c = new ArrayList<Double>();
                //Blue
                if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) {
                    c.add(0.1);
                    c.add(0.6);
                    c.add(0.9);
                }
                //Yellow
                else if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                    c.add(0.9);
                    c.add((double) 1);
                    c.add((double) 0);
                }
                List<Location> locs = line(player,100);
                int angle = 0;
                for (Location loc2 : locs) {
                    double x = new Random().nextDouble() + 0.15;
                    double y = new Random().nextDouble() + 0.15;
                    double z = new Random().nextDouble() + 0.15;
                    for (int i = 0; i< 5; i++) {
                    player.getWorld().spawnParticle(Particle.REDSTONE, loc2.clone().add(0,Math.sin(angle)*x,0),0,c.get(0),c.get(1),c.get(2));
                    player.getWorld().spawnParticle(Particle.REDSTONE, loc2.clone().add(Math.sin(angle)*y,0,0),0,c.get(0),c.get(1),c.get(2));
                    player.getWorld().spawnParticle(Particle.REDSTONE, loc2.clone().add(0,0,Math.sin(angle)*z),0,c.get(0),c.get(1),c.get(2));
                    }
                    angle ++;
                    if (angle >= 360) {
                        angle = 0;
                    }
                }
                player.getWorld().playSound(player.getLocation(), Sound.ENTITY_ELDER_GUARDIAN_HURT, 1, 1.5f);
                if (loc.getBlock().getType() == Material.QUARTZ_BLOCK || loc.getBlock().getType() == Material.IRON_BLOCK || loc.getBlock().getType() == Material.END_BRICKS) {
                    player.getWorld().playSound(loc, Sound.ENTITY_SHULKER_HURT_CLOSED, 10, 0.5f);
                    if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) {
                        if (mapper.get(player).getBluePortal() == null) {
                            mapper.get(player).setBluePortal(new BluePortal(loc,mapper.get(player),player));
                            mapper.get(player).getBluePortal().setSurface(facing(player));
                        }
                        else {
                            mapper.get(player).bp.setLocation(loc);
                            mapper.get(player).getBluePortal().setSurface(facing(player));
                        }
                    }
                    if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                        if (mapper.get(player).getYellowPortal() == null) {
                            mapper.get(player).setYellowPortal(new YellowPortal(loc,mapper.get(player),player));
                            mapper.get(player).getYellowPortal().setSurface(facing(player));
                        }
                        else {
                            mapper.get(player).yp.setLocation(loc);
                            mapper.get(player).getYellowPortal().setSurface(facing(player));
                        }
                    }
                }
            }
        }
      
        @SuppressWarnings({ "unchecked", "rawtypes" })
        public List<Location> line(Player player,int distance) {
            List<Block> targets = player.getLineOfSight((Set)null, distance);
            final Location loc1 = player.getLocation().add(0,1.5,0);
            Location loc2 = (targets.get(targets.size()-1)).getLocation().add(0.5,0.5,0.5);
            Location AtoB = new Location(player.getWorld(),loc2.getX()-loc1.getX(),loc2.getY()-loc1.getY(),loc2.getZ()-loc1.getZ());
            double length = Math.sqrt(AtoB.getX()*AtoB.getX()+AtoB.getY()*AtoB.getY()+AtoB.getZ()*AtoB.getZ());
            double length2 = length*2;
            Location increment = new Location(AtoB.getWorld(),AtoB.getX()/length2,AtoB.getY()/length2,AtoB.getZ()/length2);
            if (length > distance) {
                length = distance;
            }
            else {
                length = Math.floor(length);
            }
            length2 = length*2;
            List<Location> lotcs = new ArrayList<Location>();
            for (double x = 0; x <= length2; x ++) {
                loc1.add(increment);
                lotcs.add(new Location(loc1.getWorld(),loc1.getX(),loc1.getY(),loc1.getZ()));
              
            }
          
            return lotcs;
        }
        @SuppressWarnings({ "unchecked", "rawtypes" })
        public BlockFace facing(Player player) {
            List<Block> targets = player.getLineOfSight((Set)null, 50);
            if (targets.size() > 1) {
                Block tg = targets.get(targets.size()-1);
                Block bf = targets.get(targets.size()-2);
                if (tg.getY()-bf.getY() < 0) {
                    return BlockFace.UP;
                }
                else if (tg.getY()-bf.getY() > 0) {
                    return BlockFace.DOWN;
                }
                else if (tg.getZ()-bf.getZ() < 0) {
                    return BlockFace.SOUTH;
                }
                else if (tg.getZ()-bf.getZ() > 0) {
                    return BlockFace.NORTH;
                }
                else if (tg.getX()-bf.getX() < 0) {
                    return BlockFace.EAST;
                }
                else if (tg.getX()-bf.getX() > 0) {
                    return BlockFace.WEST;
                }
                else {
                    return null;
                }
            }
            else {
                return null;
            }
        }
    }
    
    and the portal class:
    Code:
    package me.Sporech;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import org.bukkit.Location;
    import org.bukkit.Particle;
    import org.bukkit.block.Block;
    import org.bukkit.block.BlockFace;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.Player;
    import org.bukkit.util.Vector;
    
    public class Portal {
        public Player player;
        public Location location;
        public Portal portal = this;
        public PortalGun gun;
        public BlockFace surface;
        public int id;
        public Vector offset = new Vector(0,0,0);
      
        Colour colour;
      
        public Portal(Location loc, PortalGun pg, final Player p) {
            setLocation(loc);
            gun = pg;
            player = p;
            id = MainClass.that.getServer().getScheduler().scheduleSyncRepeatingTask(MainClass.that, new Runnable() {
                @Override
                public void run() {
                    List<Location> elipsep = null;
                    if (surface == BlockFace.DOWN){
                        elipsep = elipse3(p,location.clone().add(0,-1,0).getBlock(),surface,BlockFace.UP);
                    }
                    else {
                        elipsep = elipse3(p, location.getBlock(), surface, BlockFace.UP);
                    }
                    ArrayList<Double> c = new ArrayList<Double>();
                    switch (colour) {
                    case blue:
                        c.add(0.1);
                        c.add(0.6);
                        c.add(0.9);
                    case yellow:
                        c.add(0.9);
                        c.add((double) 1);
                        c.add((double) 0);
                    }
                    for (Location l : elipsep) {
                        player.getWorld().spawnParticle(Particle.REDSTONE, l,0,c.get(0),c.get(1),c.get(2));
                    }
                    for (final Entity e : location.getWorld().getNearbyEntities(location.clone().add(offset), 1.5, 1.5, 1.5)) {
                        if (!PortalGun.cooldown.containsKey(e)) {
                            PortalGun.cooldown.put(e, false);
                        }
                        if (!(PortalGun.cooldown.get(e))) {
                            PortalGun.cooldown.replace(e, true);
                            MainClass.that.getServer().getScheduler().scheduleSyncDelayedTask(MainClass.that, new Runnable() {
                                @Override
                                public void run() {
                                    PortalGun.cooldown.replace(e, false);
                                }
                            },20);
                            Vector v = null;
                            float pitch = e.getLocation().getPitch();
                            float yaw = e.getLocation().getYaw();
                            switch(colour) {
                            case blue:
                                v = switchvelocity(e.getVelocity(), gun.yp,gun.bp);
                                switch (gun.yp.surface) {
                                case UP:
                                    yaw = -90;
                                    break;
                                case DOWN:
                                    yaw = 90;
                                    break;
                                case NORTH:
                                    pitch = -180;
                                    yaw = 0;
                                    break;
                                case SOUTH:
                                    yaw = 0;
                                    pitch = 0;
                                    break;
                                case EAST:
                                    pitch = -90;
                                    yaw = 0;
                                    break;
                                case WEST:
                                    pitch = 90;
                                    yaw = 0;
                                    break;
                                default:
                                    break;
                                }
                                Location l = new Location(gun.yp.getLocation().getWorld(),gun.yp.getLocation().getX(),gun.yp.getLocation().getY(),gun.yp.getLocation().getZ(),pitch,yaw);
                                e.teleport(l.clone().add(gun.yp.offset));
                                break;
                            case yellow:
                                v = switchvelocity(e.getVelocity(), gun.bp,gun.yp);
                                switch (gun.bp.surface) {
                                case UP:
                                    yaw = -90;
                                    break;
                                case DOWN:
                                    yaw = 90;
                                    break;
                                case NORTH:
                                    pitch = -180;
                                    yaw = 0;
                                    break;
                                case SOUTH:
                                    pitch = 0;
                                    yaw = 0;
                                    break;
                                case EAST:
                                    pitch = -90;
                                    yaw = 0;
                                    break;
                                case WEST:
                                    pitch = 90;
                                    yaw = 0;
                                    break;
                                default:
                                    break;
                                }
                                Location l1 = new Location(gun.bp.getLocation().getWorld(),gun.bp.getLocation().getX(),gun.bp.getLocation().getY(),gun.bp.getLocation().getZ(),pitch,yaw);
                                e.teleport(l1.clone().add(gun.bp.offset));
                                break;
                            default:
                                break;
                            }
                            e.setVelocity(v);
                        }
                    }
                }
            },0, 1L);
        }
      
        public Location getLocation() {
            return location;
        }
      
        public void setLocation(Location loc) {
            location = loc;
        }
      
        public void setSurface(BlockFace bf) {
            surface = bf;
            switch(surface) {
            case UP:
                offset = new Vector(0,1,0);
                break;
            case DOWN:
                offset = new Vector(0,-1,0);
                break;
            case NORTH:
                offset = new Vector(0,0,-1);
                break;
            case EAST:
                offset = new Vector(1,0,0);
                break;
            case SOUTH:
                offset = new Vector(0,0,1);
                break;
            case WEST:
                offset = new Vector(-1,0,0);
                break;
            default:
                break;
            }
        }
        public BlockFace getSurface() {
            return surface;
        }
      
        enum Colour {
            blue,yellow
        }
        public Vector switchvelocity(Vector vel, Portal p, Portal ap) {
            double carriedforce = 0;
            switch (ap.surface) {
            case UP:
                carriedforce = -vel.getY();
                break;
            case DOWN:
                carriedforce = vel.getY();
                break;
            case NORTH:
                carriedforce = vel.getZ();
                break;
            case SOUTH:
                carriedforce = -vel.getZ();
                break;
            case WEST:
                carriedforce = vel.getX();
                break;
            case EAST:
                carriedforce = -vel.getX();
                break;
            default:
                break;
            }
            switch(p.surface) {
            case UP:
                vel = new Vector(0,carriedforce,0);
                break;
            case DOWN:
                vel = new Vector(0,-carriedforce,0);
                break;
            case NORTH:
                vel = new Vector(0,0,-carriedforce);
                break;
            case SOUTH:
                vel = new Vector(0,0,carriedforce);
                break;
            case EAST:
                vel = new Vector(carriedforce,0,0);
                break;
            case WEST:
                vel = new Vector(-carriedforce,0,0);
                break;
            default:
                break;
            }
    
            return vel;
        }
    
        public List<Location> elipse3(Player player,Block block,BlockFace face,BlockFace flatDirection) {
                List<Location> locs = new ArrayList<Location>();
                double bX = block.getLocation().getX();
                double bY = block.getLocation().getY();
                double bZ = block.getLocation().getZ();
              
                if (face == BlockFace.UP || face == BlockFace.DOWN) {
                    bX += 0.5;
                    bY += 1;
                    bZ += 1;
                  
                    for (double x=0; x<=0.25;x+=0.05) {
                        double z = Math.sqrt(1-(4*x*x));
                        locs.add(new Location(block.getWorld(),x+bX,0+bY,z+bZ));
                        locs.add(new Location(block.getWorld(),x+bX,0+bY,-z+bZ));
                        locs.add(new Location(block.getWorld(),-x+bX,0+bY,z+bZ));
                        locs.add(new Location(block.getWorld(),-x+bX,0+bY,-z+bZ));
                    }
                    for (double z=0; z<=25;z+=0.05) {
                        double x = Math.sqrt((1-(z*z))/4);
                        locs.add(new Location(block.getWorld(),x+bX,0+bY,z+bZ));
                        locs.add(new Location(block.getWorld(),x+bX,0+bY,-z+bZ));
                        locs.add(new Location(block.getWorld(),-x+bX,0+bY,z+bZ));
                        locs.add(new Location(block.getWorld(),-x+bX,0+bY,-z+bZ));
                    }
                }
              
                //Sides
                if ((face == BlockFace.NORTH) || (face == BlockFace.SOUTH) || (face == BlockFace.EAST) || (face == BlockFace.WEST)) {
                    bY += 1;
              
                    //North/South
                    if ((face == BlockFace.NORTH) || (face == BlockFace.SOUTH)) {
      
                        //North
                        if (face == BlockFace.SOUTH) {
                            bX += 0.5;
                            bZ += 1;
                        }
                        //South
                        else if (face == BlockFace.NORTH) {
                            bX += 0.5;
                        }
                      
                        for (double x=0; x<=0.5;x+=0.05) {
                            double y = Math.sqrt(1-(4*x*x));
                            locs.add(new Location(block.getWorld(),x+bX,y+bY,bZ));
                            locs.add(new Location(block.getWorld(),x+bX,-y+bY,bZ));
                            locs.add(new Location(block.getWorld(),-x+bX,y+bY,bZ));
                            locs.add(new Location(block.getWorld(),-x+bX,-y+bY,bZ));
                        }
                        for (double y=0; y<=0.5;y+=0.05) {
                            double x = Math.sqrt((1-(y*y))/4);
                            locs.add(new Location(block.getWorld(),x+bX,y+bY,bZ));
                            locs.add(new Location(block.getWorld(),x+bX,-y+bY,bZ));
                            locs.add(new Location(block.getWorld(),-x+bX,y+bY,bZ));
                            locs.add(new Location(block.getWorld(),-x+bX,-y+bY,bZ));
                        }
                    }
                  
                    //East/West
                    else if ((face == BlockFace.EAST) || (face == BlockFace.WEST)) {
                      
                        //East
                        if (face == BlockFace.WEST) {
                            bZ += 0.5;
                        }
                        //West
                        else if (face == BlockFace.EAST) {
                            bZ += 0.5;
                            bX += 1;
                        }
                      
                        for (double z=0; z<=0.5;z+=0.05) {
                            double y = Math.sqrt(1-(4*z*z));
                            locs.add(new Location(block.getWorld(),bX,y+bY,z+bZ));
                            locs.add(new Location(block.getWorld(),bX,y+bY,-z+bZ));
                            locs.add(new Location(block.getWorld(),bX,-y+bY,z+bZ));
                            locs.add(new Location(block.getWorld(),bX,-y+bY,-z+bZ));
                        }
                        for (double y=0; y<=0.5;y+=0.05) {
                            double z = Math.sqrt((1-(y*y))/4);
                            locs.add(new Location(block.getWorld(),bX,y+bY,z+bZ));
                            locs.add(new Location(block.getWorld(),bX,y+bY,-z+bZ));
                            locs.add(new Location(block.getWorld(),bX,-y+bY,z+bZ));
                            locs.add(new Location(block.getWorld(),bX,-y+bY,-z+bZ));
                        }
                    }
                }
                return locs;
            }
      
        public int getId() {
            return id;
        }
    }
    
    Hope this helps :)
    Sorry for posting the classes in their entirity. I have no idea what's causing it, so I don't know how much of them is relevant.
     
    Last edited: Apr 9, 2016
  8. Offline

    mythbusterma

    I mean geez.
     
  9. Offline

    TheSporech

    Ik it doesn't work, but that's a different issue :p
     
  10. Offline

    mythbusterma

    @TheSporech

    I showed you exactly what was generating the stack trace you saw. It will generate that same stack trace for any falling entity.
     
  11. Offline

    TheSporech

    Okay, I'll improve this part, but why does it work on my local server but not my ubuntu one? More importantly the second error.
     
  12. Offline

    I Al Istannen

    @TheSporech
    Well according to the javadoc for Map (Java 7) and Map (Java 8) the method you mean is a default method introduced in Java 8. On your local server you have 8 installed, on the remote not. Stop using that method.
     
  13. Offline

    TheSporech

    Ok thanks! I'll see what I can do.
     
  14. ..i had this same error hes not using java jdk hes using environmental version... Use jdk

    Sent from my LGMS345 using Tapatalk
     
Thread Status:
Not open for further replies.

Share This Page