Coder Social home page Coder Social logo

pyrbu / znpcsplus Goto Github PK

View Code? Open in Web Editor NEW
79.0 1.0 25.0 1.33 MB

A Spigot plugin for creating interactable fake entities

Home Page: https://www.spigotmc.org/resources/znpcsplus.109380/

License: GNU General Public License v3.0

Java 100.00%
minecraft npc plugin bukkit java spigot

znpcsplus's Introduction

ZNPCsPlus

ZNPCsPlus is a Spigot plugin that is used to create fake entities that players can interact with to perform actions like switching servers on a network or executing commands.

This plugin is a remake of a plugin called ZNPCs, we originally started because the maintainer of ZNPCs decided to announce that he was dropping support for the plugin.

Looking for up-to-date builds of the plugin? Check out our Jenkins

Why is it so good?

  • 100% Packet Based - Nothing is ran on the main thread
  • Performance & stability oriented code
  • Support for all versions from 1.8 to 1.20.4
  • Support for multiple different storage options
  • Intuitive command system

Requirements, Extensions & Supported Software

Requirements:

  • Java 8+
  • Minecraft 1.8 - 1.20.4

Supported Softwares:

Optional Dependencies/Extensions:

  • PlaceholderAPI

Found a bug?

Open an issue in the GitHub issue tracker or join our support discord

BStats

Like what you see? Want the project to continue improving? Consider starring the repository & leaving a positive review on Spigot!

Credits

znpcsplus's People

Contributors

alexdev03 avatar d3v1s0m avatar josthedude avatar minefact avatar noltoxgit avatar pikamug avatar pyrbu avatar r00tb33rman avatar sj-hub9796 avatar sparky983 avatar vluckyyy avatar whothefuckiam avatar xcodiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

znpcsplus's Issues

Hologram Memory Leak

Internal holograms appear to have a severe memory leak, as indicated in this report:
image

Make poses that don't work not show based on NPC type

Okay, for example I have a Player NPC. I want to change his pose to SITTING pose with command npc property set 1 pose SITTING, but... nothing heppend! Some poses is work, such us SWIMMING, SLEEPING, STANDING, CROUCHING, and may be some others.
If player NPC does not support other poses, I think plugin have to dont show this poses. Or, if it shuld work... rapair if :)

Thank you

Error in console

https://gist.github.com/Regomy/46677e4b228732420b81bfd8b995a365

[07:58:53 INFO]: This server is running Paper version git-Paper-196 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 773dd72)

[07:59:01 INFO]: Server Plugins (33):
[07:59:01 INFO]: Bukkit Plugins:
[07:59:01 INFO]: - ajLeaderboards, AntiRelog, Chatty, Clans, *CmdBlocker, DecentHolograms, DeluxeMenus, Essentials, EssentialsSpawn, FastAsyncWorldEdit
[07:59:01 INFO]: GrimAC, *HideAchievements, *IRandomTeleport, ItemJoin, LuckPerms, Multiverse-Core, PlaceholderAPI, ProtectionStones, ProtocolLib, *Punix
[07:59:01 INFO]: *RedstoneLimiter, *rMine, TAB, TimeIsMoney, Vault, ViaBackwards, ViaRewind, ViaRewind-Legacy-Support, ViaVersion, *VoidSpawn
[07:59:01 INFO]: *WoodCutter, WorldGuard, ZNPCsPlus

Java 8 Support

While I support encouraging end users to use the latest version of Java, I'm curious if there is an actual need for ZNPCsPlus to compile with it, given it supports older Minecraft versions?

Requiring Java 17 prevents Java 8 resources which depend on ZNPCsPlus from doing so properly (example). There are "valid" reasons for server owners to run it, such as running HyperConomy on older servers, which Java 9 broke due to major reflection changes. It's also not a matter of security - Java 8 continues to receive updates as recently as this month.

So if there's no technical reason for compiling against Java 17, would you consider Java 8? I could fork & pull request.

2.0.0 Tracking Issue

This is the tracking issue for the 2.0.0 release of the plugin, if you think you are able to and are willing to complete/help with any of the uncompleted tasks below please contact me in our plugin discord and I will point you in the right direction

  • Rewrite entity system transitioning from reflection to packets
  • Rewrite holograms
  • Rewrite interactions system
  • Rewrite NPC registry
  • Rewrite skin system (make it more reliable)
  • Add Folia support
  • Rewrite commands
  • Add new storage system that supports different storage types (MongoDB, MariaDB, YAML)
  • Add converter for legacy data (old ZNPCs)
  • Add API for plugin developers

Random error after storage reload

java.util.ConcurrentModificationException: null
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1631) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
        at lol.pyr.znpcsplus.npc.NpcRegistryImpl.getProcessable(NpcRegistryImpl.java:94) ~[ZNPCsPlus #94.jar:?]
        at lol.pyr.znpcsplus.tasks.NpcProcessorTask.run(NpcProcessorTask.java:32) ~[ZNPCsPlus #94.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[pufferfish-1.20.1.jar:git-Pufferfish-14]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[pufferfish-1.20.1.jar:git-Pufferfish-14]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[pufferfish-1.20.1.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Build #94

Error when cloning repo

When I call NPC.all().size(); it returns 0 even though there are NPCs on my server.
I'm running the latest version (1.0.5) for my plugin and the server.

I was also getting an error when cloning this repository.

image

Line 88 in gradle.build -> if (DIST_USERNAME != null && DIST_PASSWORD != null) {

Error occurred while enabling ZNPCsPlus

I'm launching the plugin for the first time. there are no presets or any changes.

[19:11:10 ERROR]: Error occurred while enabling ZNPCsPlus v1.0.1 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
at io.github.znetworkw.znpcservers.configuration.ConfigurationConstants.(ConfigurationConstants.java:9) ~[ZNPCsPlus-1.0.1.jar:?]
at lol.pyr.znpcsplus.ZNPCsPlus.onEnable(ZNPCsPlus.java:93) ~[ZNPCsPlus-1.0.1.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:569) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:480) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:645) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:444) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:350) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1122) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[plazma-1.19.4.jar:git-Plazma-"84f3148"]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "com.google.common.collect.ImmutableSet.stream()" because the return value of "java.util.Map.get(Object)" is null
at io.github.znetworkw.znpcservers.configuration.Configuration.(Configuration.java:40) ~[ZNPCsPlus-1.0.1.jar:?]
at io.github.znetworkw.znpcservers.configuration.Configuration.(Configuration.java:33) ~[ZNPCsPlus-1.0.1.jar:?]
at io.github.znetworkw.znpcservers.configuration.Configuration.(Configuration.java:28) ~[ZNPCsPlus-1.0.1.jar:?]
... 14 more

Add command to change NPS`s ID

When I realised, that ID's can be not only number, I wanna to change it to more relevant ID's, but I can't. Okay, ofcourse, I can edit storage files, but... It seems not good.

Plugin issue

Hello I am using Purpur 1.19.4 and I migrated from ZNpc to this ZNPCsPlus but the problem is all of my NPC names changed to armor stand also some of them get invisible often and get visible again also there was a error when the plugin tries to start up
image
image
image

Error:

survival  | java.lang.NullPointerException: Cannot invoke "lol.pyr.znpcsplus.lib.spigotresources.api.Resource.getVersion()" because "resource" is null
survival  |     at lol.pyr.znpcsplus.updater.UpdateChecker.run(UpdateChecker.java:26) ~[ZNPCsPlus-1.0.5.jar:?]
survival  |     at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.4.jar:git-Purpur-1962]
survival  |     at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.19.4.jar:git-Purpur-1962]
survival  |     at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.19.4.jar:?]
survival  |     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
survival  |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
survival  |     at java.lang.Thread.run(Unknown Source) ~[?:?]

right clicking the npc doesnt work

When I Right Click The Npc It Doesnt Run Any Commands At All I Tried Different Action such as SERVER CMD CHAT and more none of them work

memory leak (build #102)

Self-explanatory.

image
Image taken after 11h uptime. (Have at least 3 more heap dumps with the same high memory usage between different restarts.)

(dont mind ajleaderboards, working on that one)

Discord: txslx (in case you need full image etc)

Allow non-registered commands to be executed

Whenever I give the npc a command such as /warp created by plugins such as DeluxeMenus, which aren't registered commands the plugin does not work with them

image

Whenever I click the NPC it says unknown command even though the command exists, it's just not registered... this does not happen with the Citizens plugin. and you might say: "why not just register the command?" in some use cases registering the command isn't possible for example if I register the command /plot for my deluxemenu gui it'll completely make my plotsquared plugin disfunctional when executing other commands such as /plot teleport

Error dispatching bukkit commands

[23:11:26 ERROR]: Thread Netty Server IO #1 failed main thread check: command dispatch
java.lang.Throwable: null
	at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[paper-1.19.4.jar:git-Paper-466]
	at org.bukkit.craftbukkit.v1_19_R3.CraftServer.dispatchCommand(CraftServer.java:882) ~[paper-1.19.4.jar:git-Paper-466]
	at org.bukkit.Bukkit.dispatchCommand(Bukkit.java:980) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
	at lol.pyr.znpcsplus.interaction.types.ConsoleCommandAction.run(ConsoleCommandAction.java:18) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.interaction.InteractionPacketListener.onPacketReceive(InteractionPacketListener.java:29) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.event.PacketListener$1.onPacketReceive(PacketListener.java:41) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.event.PacketReceiveEvent.call(PacketReceiveEvent.java:45) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.event.EventManager.callEvent(EventManager.java:52) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.util.PacketEventsImplHelper.handleServerBoundPacket(PacketEventsImplHelper.java:82) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.impl.injector.handlers.PacketEventsDecoder.read(PacketEventsDecoder.java:51) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.impl.injector.handlers.PacketEventsDecoder.decode(PacketEventsDecoder.java:58) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.impl.injector.handlers.PacketEventsDecoder.decode(PacketEventsDecoder.java:35) ~[ZNPCsPlus-2.0.0.jar:?] <40 internal lines>
[23:11:26 WARN]: [lol.pyr.znpcsplus.lib.packetevents.api.PacketEventsAPI] PacketEvents caught an unhandled exception while calling your listener.
java.lang.IllegalStateException: Asynchronous command dispatch!
	at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:16) ~[paper-1.19.4.jar:git-Paper-466]
	at org.bukkit.craftbukkit.v1_19_R3.CraftServer.dispatchCommand(CraftServer.java:882) ~[paper-1.19.4.jar:git-Paper-466]
	at org.bukkit.Bukkit.dispatchCommand(Bukkit.java:980) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
	at lol.pyr.znpcsplus.interaction.types.ConsoleCommandAction.run(ConsoleCommandAction.java:18) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.interaction.InteractionPacketListener.onPacketReceive(InteractionPacketListener.java:29) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.event.PacketListener$1.onPacketReceive(PacketListener.java:41) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.event.PacketReceiveEvent.call(PacketReceiveEvent.java:45) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.event.EventManager.callEvent(EventManager.java:52) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.api.util.PacketEventsImplHelper.handleServerBoundPacket(PacketEventsImplHelper.java:82) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.impl.injector.handlers.PacketEventsDecoder.read(PacketEventsDecoder.java:51) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.impl.injector.handlers.PacketEventsDecoder.decode(PacketEventsDecoder.java:58) ~[ZNPCsPlus-2.0.0.jar:?]
	at lol.pyr.znpcsplus.lib.packetevents.impl.injector.handlers.PacketEventsDecoder.decode(PacketEventsDecoder.java:35) ~[ZNPCsPlus-2.0.0.jar:?] <40 internal lines>

Npc center and teleport command not working

Whenever I use npc center on an npc or Teleport it facing the other direction. It ends up looking at the same wrong direction everytime the servers lightning updates or if i run the command //fixlighting from FastAsyncWorldEdit

Server Version 1.12.2 Paper
Plugin version 2.0.0-SNAPSHOT

All of them looking at the wrong direction: (the center command does make them face the right location but once the lightning updates they go back to looking in the wrong place)
image

Entity Teleport in Folia

Server version:
This server is running Folia version git-Folia-"d34fb87" (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) (Git: d34fb87)
You are 14 version(s) behind
Download the new version at: https://papermc.io/downloads
Previous version: git-Folia-"32417a2" (MC: 1.19.4)

Issue:
Teleport issue(You need to use "Entity#teleportAsync()": https://paste.md-5.net/edubiyibep.bash
Commands feed back not working(only in the final command. Example /znpcs) The commando not show nothing in Folia

Originally posted by @Aitooor in #38 (comment)

NPE sometimes when spawning NPC

(copied from report on discord)

I have a problem with the plugin, when the players are not near the NPC, they sometimes disappear. This happens in most cases and is solved by restarting the server.

image

Caused by Reflections sometimes picking up UUID getOriginWorld() instead of UUID getUUID

Occasionally some NPCs disappear

It happens that occasionally some NPCs disappear. I don't think it shows any error.

ZNPCsPlus version: 1.0.5
Server: Pufferfish-59 (MC: 1.19.3)

Dependency Hook

I was wondering if there was a new dependency that I can hook into for one of my plugins.
Thought it would be in the form of

        <dependency>
            <groupId>lol.pyr.ZNPCsPlus</groupId>
            <artifactId>ZNPCsPlus</artifactId>
            <version>1.0.5</version>
            <scope>provided</scope>
        </dependency>

But this doesn't work. The previous one I had for the old plugin was

        <dependency>
            <groupId>io.github.znetworkw.znpcservers</groupId>
            <artifactId>znpcservers</artifactId>
            <version>3.6</version>
        </dependency>

Maintained with ?

Figure it's supposed to be a heart in Unicode? Maybe just use <3 instead.

splash

NullPointerException

I'm getting this error on my first server:
[19:02:40 WARN]: [ZNPCsPlus] Plugin ZNPCsPlus v1.0.5 generated an exception while executing task 8960
java.lang.NullPointerException: null

All NPCs have disappeared and are not visible.


Second server: Only some NPCs are visible.
Error: https://pastebin.com/raw/NG7tdtU9


ZNPCsPlus version: 1.0.5
Server: Pufferfish-61 (1.19.3)

Action order inconsistent

The order of the actions being executed is incorrect. Although the second action is a player command action, it should still execute before the third one, or the third action should somehow wait for the second action to be completed.

Also, adding a delay that can be set such that the next action runs after that many ticks would be better option to fix this issue.

image

NPCs teleport

Can you implement an NPC teleport by coordinates x y z (like: /znpcs move)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.