1.8.8 NMS biome

Discussion in 'Spigot Plugin Development' started by chochoco4777, Jun 26, 2021.

Thread Status:
Not open for further replies.
  1. Changing the biome with nms does not work NPCs. What's the problem?

    Code (Text):
            plot.getBlocksInPlot().forEach(l -> {
                l.getBlock().setBiome(currentBiome.getBiome().getBiome());
            });
            plot.getChunksInPlot().forEach(c -> {
                plot.getArena().getPlayers().forEach(p -> {
                    if (MinecraftVersion.atLeast(MinecraftVersion.V.v1_17)) {
                        try {
                            ReflectionUtils.sendPacket(p, ReflectionUtils.getChunkNMSClass("PacketPlayOutMapChunk").getConstructor(ReflectionUtils.getBukkitChunkNMSClass("Chunk")).newInstance(c.getClass().getMethod("getHandle").invoke(c)));
                        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e1) {
                            e1.printStackTrace();
                        }
                    } else {
                        try {
                            ReflectionUtils.sendPacket(p, ReflectionUtils.getNMSClass("PacketPlayOutMapChunk").getConstructor(ReflectionUtils.getNMSClass("Chunk"), boolean.class, int.class).newInstance(c.getClass().getMethod("getHandle").invoke(c), true, 65535));
                        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
                            try {
                                ReflectionUtils.sendPacket(p, ReflectionUtils.getNMSClass("PacketPlayOutMapChunk").getConstructor(ReflectionUtils.getNMSClass("Chunk"), int.class).newInstance(c.getClass().getMethod("getHandle").invoke(c), 65535));
                            } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e1) {
                                e1.printStackTrace();
                            }
                        }
                    }
                });
            });
        }
     
  2. NPCs remain as they are, but when you right-click on them, they do not work.
     
  3. I've confirmed that this is a Citizens issue. Thread closed.
     
Thread Status:
Not open for further replies.