#help-archived
1 messages · Page 25 of 1
That still doesn't make sense.
Anvil loads and in it's onenable it registers the commands of another plugin that depends on it.
Shouldn't Anvil be dependent of OnTime?
@upper hearth so u think i will can connect to my server with viarewind
@frigid ember Just install ViaVersion and ViaRewind on your Spigot servers and you should be able to join
no, anvil is a cross platform plugin framework. OnTime "registers" itself with anvil and then anvil runs the enabling methods for ontime
For everyone that is posting code you can use
//Code here
//Example:
@Override
public void onEnable(){
Bukkit.getConsoleSender().sendMessage("Hi");
}
You can do it by using ```java
at the beginign of the code and ``` at the end
and this plugin already works on sponge, im just implementing it on spigot now
I'm pretty sure you can't work with commands until a plugin is enabled.
You can't work with commands until the server is started
i call setEnabled(true) in the ontime main constructor
@upper hearth i have it, but its saying kicked from the server out of dated version.Please use 1.9 version
Tehy don't get process
@frigid ember you didn't do it right, then.
@radiant pollen I am now determined the problem is with the server not downloading resource packs. I just uploaded a test pack I downloaded from online and its still not downloading
@radiant pollen i have via version and via rewind + via backward
It cant be a plugin conflict as I tried removing every plugin and I had the same issue
this method in anvil basically loads the ontime stuff
so i see the issue now
because anvil loads before ontime
reeee
We said that didn't we? lmAO
well this hasnt been an issue on other platforms so i kinda just assumed it work would here too xD
ah i know why
in sponge i can make the anvil enabled listener run later
@cosmic lily Show me the line in your server.properties that sets the server resource pack, please.
resource-pack=http://victorynet.works/downloads/testpack.zip?dl=1
is there an onEnable that runs after ALL plugins have finished their onEnable?
Is there anyway that I could monitor all the console output with my plugin?
I've tried adding a new Handler via Bukkit.getLogger.addHandler but it doesn't work
I want to be able to monitor everything that gets printed on the console
Maybe you can schedule a task?
it has a backspace
@lofty otter Bukkit.getScheduler().runTaskLater()
@lofty otter Runs on the first tick of the server, after everything has loaded. IIRC
hm. not ideal though
Why not?
because this is the phase where everything for any anvil plugin gets loaded
it has to be delayed like this because i create a guice injector for each plugin
i need to wait until every plugin has registered before i can complete the initialization
Or just do Bukkit.getScheduler().runTask(). It won't run until everything has loaded and the first server tick happens.
is there some kind of event i can listen to
Is there anyway that I could monitor all the console output with my plugin?
I've tried adding a new Handler via Bukkit.getLogger.addHandler but it doesn't work
I want to be able to monitor everything that gets printed on the console
@mental falcon Maybe https://data-flair.training/blogs/read-java-console-input/
https://stackoverflow.com/questions/4334808/how-could-i-read-java-console-output-into-a-string-buffer
that happens right before done
No. You can just start a synchronous task. Because it's synchronous it won't start until all plugins and worlds are loaded.
@cosmic lily Maybe try https? I don't know anymore.
tried it before
im just putting all of that loading into the first real tick
it gets stuck on the end
My pack uses https.
would u guys say that the crash course to java on the wiki page is accurate?
@mental falcon Maybe https://data-flair.training/blogs/read-java-console-input/
https://stackoverflow.com/questions/4334808/how-could-i-read-java-console-output-into-a-string-buffer
@high root that's not what I meant
I'm trying to connect the server console to a telegram bot. so I basically need to monitor everything that appears on console
Can someone who know how to use Via version and ViaRewind help me?
@frigid ember No. We've told you what to do already.
You're not providing anything to help us help you further. You need to give us server logs and error messages. You can't just say it doesn't work and expect us to fix it.
Do the plugins load correctly?
this 20 second timer on each server start is killing me man
@radiant pollen
Found this in my client log
[19:46:54] [Downloader 0/WARN]: File C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\9ff27345c35152b711ad5f90d6ef2cccad39d925 had wrong hash (expected 3cf9a4334467e89fff45586b0a25c856c5887aad, found e2583dd9e13cba6b2d5036e5f98376e8d36b67ca).
[19:46:54] [Downloader 0/WARN]: Pack application failed: java.lang.RuntimeException: Hash check failure for file C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\9ff27345c35152b711ad5f90d6ef2cccad39d925, see log, deleting file C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\9ff27345c35152b711ad5f90d6ef2cccad39d925
@high root that's not what I meant
I'm trying to connect the server console to a telegram bot. so I basically need to monitor everything that appears on console
@mental falcon
https://stackoverflow.com/questions/8708342/redirect-console-output-to-string-in-java
https://openwritings.net/pg/java/how-capture-and-store-console-output-systemoutprintln
This?
@cosmic lily Ahhh yup. That's the issue. You need to upload the .zip of the resource pack into a sha1 hash and use that as the resource-pack-sha1 field in the server.properties. I've completely forgotten about that, I'm sorry.
@cosmic lily http://onlinemd5.com/ Use this. Select "SHA1" and upload your .zip. The string of characters it gives you goes in that field.
@cosmic lily It basically uses the hash to make sure the server gets the pack correctly. If the hash from the pack it gets does not match the hash in the server.properties it gives you that error.
but I thought the hash wasnt even required?
No it is.
If you look in the server.properties, the hash is 3cf9a4334467e89fff45586b0a25c856c5887aad.
sooo zax i did that thing with the task and still
[00:52:54] [Server thread/INFO]: [Anvil] Enabling Anvil v1.0.0-SNAPSHOT
[00:52:54] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[00:52:54] [Server thread/INFO]: Done (6.762s)! For help, type "help"
[00:52:54] [Server thread/INFO]: [Anvil] 1.0.0-SNAPSHOT by Cableguy20 - Loaded!
[00:52:54] [Server thread/INFO]: Plugin: OnTime v1.0.0-SNAPSHOT
[00:52:54] [Server thread/WARN]: [Anvil] Task #7 for Anvil v1.0.0-SNAPSHOT generated an exception
java.lang.NullPointerException: OnTime command not registered
at java.util.Objects.requireNonNull(Unknown Source) ~[?:1.8.0_241]
Hmmm. Does OnTime get enabled at all?
@radiant pollen u got any good tutorials on yt about plugin development? or is it just the spigot wiki
[19:53:35] [Downloader 1/WARN]: File C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\5f13098ce090fd83ac680f2913052abde63626d0 had wrong hash (expected 852E2B9918BEDE1F24D54A013E54630344013F87, found 14ce2132d3eefa09d1d0ab8a88647080e9ddf23b).
[19:53:35] [Downloader 1/WARN]: Pack application failed: java.lang.RuntimeException: Hash check failure for file C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\5f13098ce090fd83ac680f2913052abde63626d0, see log, deleting file C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\5f13098ce090fd83ac680f2913052abde63626d0
same issue
i put the new hash in server.properties
does the hash have to be in the pack in some way?
Did you use a different resource pack this time?
I uploaded my VN Resource Pack and I used the hash for the VN Resource pack
Where I get that 1.15.2 mcmmo
Anyone know why this is im using FAWE and trying to paste a schematic it says it pasted but its been like 15 minutes and nothing is here?
@rapid yacht There's millions of tutorials on Youtube. There isn't a secret one that'll teach it to you in 20 minutes. You just gotta pick one and stick with it.
[00:55:32] [Server thread/INFO]: Default game type: SURVIVAL
[00:55:32] [Server thread/INFO]: Generating keypair
[00:55:32] [Server thread/INFO]: Starting Minecraft server on *:25565
[00:55:32] [Server thread/INFO]: Using default channel type
[00:55:34] [Server thread/INFO]: [OnTime] OnTime says hello!
[00:55:34] [Server thread/INFO]: [LuckPerms] Loading LuckPerms v5.0.136
[00:55:34] [Server thread/INFO]: [Anvil] Loading Anvil v1.0.0-SNAPSHOT
[00:55:34] [Server thread/INFO]: [OnTime] Loading OnTime v1.0.0-SNAPSHOT
[00:55:34] [Server thread/INFO]: [LuckPerms] Enabling LuckPerms v5.0.136
so yeah it gets loaded
but command is no bueno
can I somehow print out the valid commands?
from the plugin yml
Guys.
how can something so simple make me want to end my existence
That's usually how it goes.
@cosmic lily Are you sure the pack you linked is the same pack you generated the hash with? Because the link you gave me for the new pack isn't the link you said was in the resource-pack field.
Well then don't use the test pack in the hash generator.
resource-pack-sha1=852E2B9918BEDE1F24D54A013E54630344013F87
resource-pack=http://victorynet.works/downloads/vnresource.zip
i didnt
i used the vnresource
is there any way to set the executor for a command for a plugin from another plugin
So who can help now
im gonna try putting the expected hash in the sha1 hash
😭
@cosmic lily Yeah try that.
@frigid ember What is the server version and what version are you trying to connect with?
anyone else had problems with griefprevention plugin?
@lofty otter Yeah, you should be able to set the executor literally anywhere. You should also be able to getCommand from any plugin as long as the reference to the other plugin is valid. Maybe Anvil should depend on OnTime instead?
no anvil should definitely not depend on ontime
but heres what I dont get
why is the command still null in the task
Well then the runTask() thing should work.
btw is vanilla less heavy to run then spigot?
That's weird.
im gonna try using getCommand from inside ontime to see what happens
zaxarner are you familiar with datapacks? if so would you say datapacks are less heavy then plugins?
@radiant pollen [20:04:58] [Downloader 1/INFO]: Found file C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\1b78af34d1afcdaf588978ab65ccd77ae5aa66e7 matching requested hash 5d0e79d2973437a326ff628e0a968e1cdd888ce3
[20:04:58] [Downloader 1/WARN]: Pack application failed: java.lang.RuntimeException: Invalid resourcepack at C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\1b78af34d1afcdaf588978ab65ccd77ae5aa66e7: error in opening zip file, deleting file C:\Users\raych\AppData\Roaming.minecraft\server-resource-packs\1b78af34d1afcdaf588978ab65ccd77ae5aa66e7
the thing is
my server-resource-packs is empty
@lean knot I've never used a datapack before. I would guess it depends on what it's doing.
i have one for grief prevention
Hey, I have a question... does anyone here know how to power a dragon's head programmatically?
not sure but maybe the head has a powered nbt tag?
that you could just trigger of somehow?
[01:07:33] [Server thread/INFO]: [OnTime] OnTime says hello!
[01:07:33] [Server thread/INFO]: [OnTime] Root: null
so
its null even in onEnable
i didn't find anything about it, so i'm not sure
probally bcs there is an error in it's formation
@pulsar cairn It depends on the version you're using.
only thing i personally see is the location of the sounds file
no errors when loading it in my client logs
@pulsar cairn It depends on the version you're using.
@radiant pollen i'm using 1.15.2
I want to know how to create my own configuration with json
@pulsar cairn You would get a block instance and get the meta, check if it's a dragon skull, cast the meta to Powerable I think and then set power.
Or something along those lines.
how does extract jar?
Does anyone have a test server to test the pack on?
[01:16:47] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[01:16:47] [Server thread/INFO]: Done (6.307s)! For help, type "help"
[01:16:47] [Server thread/INFO]: [Anvil] 1.0.0-SNAPSHOT by Cableguy20 - Loaded!
[01:16:47] [Server thread/INFO]: [OnTime] A1.0-1.0.0-SNAPSHOT by Cableguy20, STG_Allen - Loaded!
>ontime
[01:16:57] [Server thread/INFO]: [OnTime] Running version A1.0-1.0.0-SNAPSHOT by Cableguy20, STG_Allen
Use /ontime help for help
>
zax
it was because i was calling setEnabled(true) in the constructor
one attempted solution actually broke it more
@radiant pollen does the server resource pack have to be a zip? or can it be a folder
Pretty sure it needs to be a zip
must be zip yes
a proper zip though
you got that mostly right, however i am not sure all files are in the right locations
like i sad i think sounds.json should be either in models or sounds
yeah its all working now
although this really just makes me wish bukkit didnt have such a JANK ass method to registering commands
Does anyone know how can I know if iptables is working correctly?
legit all i need in my resource pack is sounds
True dat @lofty otter
@lean knot all the packs I downloaded the sounds.json was outside
how?
i used nmap
so many tools
nmap finds my ports.
are they open or filtered
Does that mean it is installed incorrectly?
i followed this https://www.spigotmc.org/wiki/firewall-guide/
what sounds does it contain records?
does nmap say open it filtered
@cosmic lily if the sounds are records you don't need sounds.json
root@user:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- !2.171.(IP) anywhere tcp dpt:(port)
DROP tcp -- !2.171.(IP) anywhere tcp dpt:(port)
DROP tcp -- !2.171.(IP) anywhere tcp dpt:(port)
DROP tcp -- !2.171.(IP) anywhere tcp dpt:(port)
@silk gate
done
and you're not nmapping from that 2.171 IP right?
EntityAirChangeEvent can anyone specify this?
do i need to restart something for it to work?
what if you allow certain ports and drop the rest
that's generally the preferred setup
how?
want me to write the rules for you
what ports do you want accessible
I assume 25565 and 22 at least
Dude I will literally pay someone at this point to fix it
Apache handles PHP
phpmyadmin with apache
first iptables -F to flush your current rules
@lean knot or @radiant pollen can I pay you to fix this for me?
I am aware just wondering if he had some weird setup
Also, phpmyadmin isn't really that great of a setup to use; if you really want to use tools to develop a MySQL Database, you should use an application to modify your database if you're able to.
Like MySQL Workbench, or other choices
you dont need to use 3306 at all if you're using it on the same server
yes
why so
or rather, the same PC
Could I enter the phpmyadmin?
yes
phpmyadmin is not external
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 22,25565,80,443
iptables -A INPUT -j DROP```
then obviously save those rules
But like I said, this is just a personal opinion; I would open the 3306 port to allow use of external database editors such as MySQL Workbench
PHPMyAdmin is trash.
and if you use the 3306 port and use an external application then you dont need to open port 80 nor run Apache
i used "dpkg-reconfigure iptables-persistent" to save as it says in spigot tutorial
Thanks for all the help today in here. Really appreciate the community. Managed to get a good amount done today, but I am still unsure about a lot of things too. If someone could take some time and give me some feedback on this: https://pastecode.xyz/view/a130b6e4
The PersistentData method is a part I need to refactor. It's a bit messy. The basic idea of the plugin is that when you pick up a red mushrooms, it saves a record in the database, with the amount that was picked up, who picked it up, and when it was picked up. When it's dropped, the record is updated, dropped_by, dropped_at is added, and lore is created like "NAME dropped item on DATE". That's what I got so far. I've attempted to use runTaskAsynchronously, but I am not 100% sure that the implementation is correct. Any tips on this would be great.
I have a decent server running, but if I have a 64 stack I press Q to drop them individually, creating 64 records in the database, I feel it's really hard on the server and I get a warning like [Server] Server thread/WARN Can't keep up! Is the server overloaded? Running 10700ms or 214 ticks behind - So something is up 😛 The Database does seem super slow though. SHOW FULL PROCESSLIST took 11+ secs to run, so that might also be a bottleneck.
root@user:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
tcp -- anywhere anywhere multiport dports ssh,25565,http,https
DROP all -- anywhere anywhere
now it says this
its good?
root@user:~# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m multiport --dports 22,25565,80,443
-A INPUT -j DROP
Just want to have something cleared up, if a plugin I coded get enabled without any errors. Could anything occur later that would disable the plugin itself?
plugin wouldn't disable itself
Starting Nmap 7.80 ( https://nmap.org ) at 2020-04-18 20:48 Hora estándar de Argentina
NSE: Loaded 151 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 20:48
Completed NSE at 20:48, 0.00s elapsed
Initiating NSE at 20:48
Completed NSE at 20:48, 0.00s elapsed
Initiating NSE at 20:48
Completed NSE at 20:48, 0.00s elapsed
Initiating Ping Scan at 20:48
Scanning (IP) [4 ports]
Completed Ping Scan at 20:48, 2.23s elapsed (1 total hosts)
Nmap scan report for (IP) [host down]
NSE: Script Post-scanning.
Initiating NSE at 20:48
Completed NSE at 20:48, 0.00s elapsed
Initiating NSE at 20:48
Completed NSE at 20:48, 0.00s elapsed
Initiating NSE at 20:48
Completed NSE at 20:48, 0.00s elapsed
Read data files from: C:\Program Files (x86)\Nmap
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 4.43 seconds
Raw packets sent: 8 (304B) | Rcvd: 0 (0B)
it says this
unless another plugin disables it
(nmap)
"nmap -p 1-65535 -T4 -A -v 62.171.(ip)"
Ah cool but it can't get disabled by like the server instance? Just need to make sure :))
yeah
nice, thanks for help!
Hey. I want to pregenerate my server worlds. How would I do that?
wdym?
@tender ibex Not sure if it's the way to go, but I just removed the world folders.
@tender ibex What do you mean by "pregenerate"?
Oh.. Pre. Nvm.
@radiant pollen So i can reduce CPU spikes
@radiant pollen I fixed it by using Minepack. I guess my hash was broken
thanks for all your help
24 hours of my life wasted on an issue
@cosmic lily No problem! Glad you finally got it working!
hoorsy
@tender ibex Use worldborder plugin
@velvet halo thx. I thought there was another way..
@storm willow port 80 and 443 are open
so why can't i get in?
im using cloudflare for the site, it need other port?
the minecraft server neither works
that's also open
i cant connect
@fluid basin Are you closing your connections after you make queries?
did you try to use ufw or another firewall before @storm willow
@fluid basin Send your code and I'll help you out.
@storm willow are you using an SRV record for minecraft
I use HikariCP
what?
I take that as a no
How can I know that?
well did you make one
you can't have the orange cloud on and use just an A record
as you'll be trying to connect to cloudflare
before activating iptables everything worked with cloudflare
ah, yes i have the SRV
I had forgotten, sorry
did you run that command
@fluid basin Make sure you're closing the Connection after you use it. Also, do not close the HikariDataSource, that will kill all the connections in your connection pool. So, use for example:
/// perform queries
connection.close();
But do not do this for example:
dataSource.close(); for example. I dont see any code, but it's an important note if you're not aware of it.
how?
never used contabo
poke around on their panel
I assumed you'd know how to if you knew it exists?
Connect to VPS? Depends on the operating system.
it says VNC: and a ip
do they not offer a web client
If you have Windows, you already have a built-in remote desktop application that you can use.
But, I would imagine that it only uses Windows (not sure about that)
yes
no it's probably like
VNC: xxx
username: xxx
So to connect, you would follow the instructions, and connect to the IP : Port provided
then the password, like they described in the guide.
Is there a way to sell Spawn Eggs or spawners w/ eggs inside them already via EssentialsX sign shop? I am running Spigot v1.8.8.
Is there a way to have a unique identifier for an ItemStack, that isn't visible to players? I know you can put a UUID in the lore of an ItemStack, but that's visible to players.
Custom Tags?
??!?!??!
Is there a way to sell Spawn Eggs or spawners w/ eggs inside them already via EssentialsX sign shop? I am running Spigot v1.8.8.
@rotund fulcrum my original question ^
nah thats deprecated
Bruh.
You should be able to use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataHolder.html to store custom data within ItemStacks
I'll forward it to my Co-Founder, he hosts the server and puts in plugins and fixes perms.
Thanks @dusky herald I'll take a look
@rotund fulcrum They weren't talking about your question
Is there a way to sell Spawn Eggs or spawners w/ eggs inside them already via EssentialsX sign shop? I am running Paper Spigot 1.8.8 off of Google Cloud self-hosting with 8GBs of storage.
@storm willow they recommend a client in their blog
I am going to ask somewhere else now.
they installed many clients
alternatively you can boot to rescue
@dusky herald That seems to be for 1.14.4 onwards, is there a solution for 1.8.8?
restart?
For 1.8.8? The only way I remember ever doing it in the past was using ItemMeta setLore
i have this options http://prntscr.com/s2219f
no
in my panel
rescue system
Hmm okay
You could always remove the lore after the player picks the item up.
this dont delete my data?
no
No, I need to be able to identify the item up until the player right clicks it
I guess I'll just use lore
@fluid basin Ah, that seems weird. From my understanding was that HikariCP is supposed to keep connections alive the entire time it runs.
@storm willow recommended
Ah so maybe it's a setting on the actual MySQL server software then?
and now?
Maybe you could try adding a periodic runnable that runs every few hours to refresh the connections perhaps
or if it's just a plugin where you cannot make the change directly within the code; find a way allow MySQL connections to last longer?
Yeah, I'm just not sure if he's having issues with a plugin he's developing or just another plugin he's using.
@storm willow show me your
fdisk -l
@silk gate @storm willow
is the 800g drive yours
yes my disk has 800gb
mkdir -p /mnt/data
mount /dev/sda2 /mnt/data
cd /mnt/data/etc/iptables
ls```
does anyone know where i can find all the valid json parameters for a generatorSettings string?
done
also just a reminder to move away from contabo when you can
now?
show me the output
y
now?
reboot
@silk gate
yes, it disconnected
now working, but so i can't use iptables?
this works?
iptables -I INPUT ! -s $BUNGEE_IP -p tcp --dport $START_PORT:$END_PORT -j DROP
Could I use that to close group ports but not all?
no don't
So close the minecraft but not all
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 22,25565,80,443 -j ACCEPT
iptables -A INPUT -j DROP
I forgot a -j ACCEPT last time lol
but
do not disconnect
until you verify it works
a
done
works?
the webpage is working now
ok good
wait, i dont saved rules
sudo dpkg-reconfigure iptables-persistent
now i try to start minecraft server
I need help please I wanna know how can I disable to place chest on the ground in a spefic world
I mean that the users can’t place chest on the ground
what have you tried?
Hey guys. I am experiencing a kind of a problem and I start believing its a spigot problem.
It has to do with the PlayerMoveEvent. In the event handler, i set the event.seTo() to my custom location. The location works as expected, but instead of applying it the players it should, it applies it to all the players that move. It doesnt make sense at all logically... I have tried debugging but it still doesnt make sense.. If you need me to send code for reproduction please tell me!
I need help please I wanna know how can I disable to place chest on the ground in a spefic world
Please 🥺
Hey guys. I am experiencing a kind of a problem and I start believing its a spigot problem.
It has to do with the PlayerMoveEvent. In the event handler, i set the event.seTo() to my custom location. The location works as expected, but instead of applying it the players it should, it applies it to all the players that move. It doesnt make sense at all logically... I have tried debugging but it still doesnt make sense.. If you need me to send code for reproduction please tell me!
code snippet plase
?paste
@velvet marten PlayerMoveEvent is triggered when any player moves
yea that too
so are you aware of the ability to cancel events?
event.setCancelled(true) will not let the player move
you also have event.setTo(Location)
Yes I do. But if I cancel the event they cant jump or move the camera... I want to block only X,Z
Also the setTo location is for very specific players.
if(event.getTo().getX() == event.getFrom().getX() && event.getTo().getZ() == event.getFrom().getZ())` return;
also
i'm not sure how to explain
😎
But the event activates for every single player
and every single time the event activates
you are checking if the player is a WarPlayer
so that list might have more than one player
My onCommand listener throws a command exception whenever I add this line to it:
List<String> papersList = config.getStringList("config.enabled_papers");
this is my config:
enabled_papers:
- owner
- moderator
- default
owner:
rank: owner
moderator:
rank: moderator
default:
rank: default
Any idea why it could be doing this?
are you sure that the playersJoinedList doesnt have every single player?
Yes. I can set plugin.canJoin to true, and I dont join the list, but I am still frozen.
you could simplify this too
I have tried several stuff. The debugging logs you see are intresting too...
I run a test with the debugging logs on, and the message I received was : You are not in wartime
As I would expect. Because I wasnt in the list. But I was still frozen (all but pitch yaw y)
well its because youre accessing event.getTo()
when you modify the variable newLocation you access the event.getTo() variable
playersJoinedList should really be a Set<UUID> of all the players against which you can #contains() check the player moving. Iterating over every player in that list every time the event is called is a very, very bad idea
yep
so while it may not look like it
you're setting the to location in PlayerMoveEvent
But the whole idea of having a getTo() method is to protect the to location from writting.. Yes ?
nope
That is why you have a setTo()
@subtle blade My list is a WarPlayer which contais a player object/reference. I cannot simplify it to a UUID as it holds many more stuff.
what you could do is getTo().clone()
Then it should be a Map<UUID, WarPlayer>
however as stated previously
if(event.getTo().getX() == event.getFrom().getX() && event.getTo().getZ() == event.getFrom().getZ())` return;
will avoid all Y movement and head movement
Adding this line to my onCommand listener is making my plugin throw CommandException when the command is used:
String papersList = config.getString("test");
this is my config:
test: "test"
I'm very lost as to why this is. Could anyone help me?
Then it should be a Map<UUID, WarPlayer>
Intresting idea. Will look into that. Thanks
Is there a way to search an inventory for a particular block type?
config is probably null, @frigid ember
if(event.getTo().getX() == event.getFrom().getX() && event.getTo().getZ() == event.getFrom().getZ())` return;
@wanton delta And you reccomend that just to avoid creating a new Location object every time I guess.
Question: Does that even fire for every single UNIQUE movement ? For example change in X, change in Y, change in Z etc, or can it have a combination of movements ?
im not exactly sure
if im not mistaken it represents the movement change in one tick
Is there a way to search an inventory for a particular block type?
@inland heron Get the player inventory in a ItemStack array, filter for the nulls and search for the block time in the array
Cool, thank you
Movements in all axes and in pitch/yaw, without any specific checks.
@keen moth he was asking if you moved in X and Y simutaneously if it would fire two seperate events
i dont think it does
just 1 event per tick
(if they move)
@keen moth I've got this line above my onCommand listener:
public FileConfiguration config = PaperRank.plugin.getCustomConfig();
and these lines in my PaperRank class:
public FileConfiguration getCustomConfig() {
return this.customConfig;
}
private FileConfiguration customConfig;
and in my onEnable I've got plugin = this
Set the variable in the constructor
Fields initialize first, then constructor is called
@velvet marten Location newLocation = event.getTo(); see how this is not calling a new instance of a location but rather is accessing a current instance? the way you would make a NEW instance is by calling Location#new. just want to celar that up
plugin is null by the time it reaches your field because the constructor has not yet been called
Yes, even if it's declared after the constructor
Yes indeed. I just assument that getTo returns a copy of the locaiton and not the adress.
oh hm okay
nope! Location#clone would
Not a copy, a reference
(clone only works when the class implements Cloneable just fyi, doesnt work for everything)
(which Location does)
I did write it down, and it says it can throw a null exception because the getTo can be null... How can getTo be null inside the event? Doesnt the even triggering assume that getTo has a value ?
if the player only moves its head
the event is triggered
so the getTo location is null
iirc
Okay now I've got this line in my onEnable in my PaperRank class, which extends JavaPlugin:
this.getCommand("givepaperrank").setExecutor(new Command_GivePaper(this));
and these lines in my Command_GivePaper class:
public FileConfiguration config;
public Command_GivePaper(PaperRank instance) {
config = instance.getCustomConfig();
}
but it's still returning a null pointer exception for this line:
String exampleString = config.getString("test");
when I try and run my command?
but getTo includes the Yaw and Pitch ... :/
Cool. Thanks 😛
when setTo requires NonNull 🤔
dont just ignore the npe
location the player is moved to
if the player only moves the head
its not moving anywhere
hence its null
PlayerMoveEvent fires when a player moves their head
yeah
Location includes pitch/yaw values
mhm
I guess what they mean by location is just x y z
thats my interpretation from the docs
anyways just check if getTo is null before doing anything
dont let it spam out npes
but it does return null :/
It doesn't. It's impossible
Okay now I've got this line in my onEnable in my PaperRank class, which extends JavaPlugin:
this.getCommand("givepaperrank").setExecutor(new Command_GivePaper(this));
and these lines in my Command_GivePaper class:
public FileConfiguration config;
public Command_GivePaper(PaperRank instance) {
config = instance.getCustomConfig();
}
but it's still returning a null pointer exception for this line:
String exampleString = config.getString("test");
when I try and run my command?
I currently have a big problem with disconnecting from Minecraft Networks.
My Problem:
When I disconnect from a Network (it appears on every network)
the network tells me that i am still online until the fake me loses
connection to the server.
maybe you guys know a solution for me
+ Location oldTo = to.clone();
+ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);```
so when you try to rejoin it tells you that you no longer have connection?
@frigid ember config is null
is it an offline mode server?
When I already disconnected a server I didnt really disconnected the Server
Yes but I don't know why @radiant pollen
If it could ever be null, the server would throw an exception
The nullable annotation is a bug
ah right my bad choco
@frigid ember show us the getcustomConfig method
Let me make a quick PR to address it right now, actually
public FileConfiguration getCustomConfig() {
return this.customConfig;
}
darn i was gonna do taht LOL!
It'll take me 2 seconds
you probably can do it better than i can tbh
@frigid ember when is the customConfig initialized?
At the top of my main class
Show it
I am happy I found a bug 😄
That wrongly annotated method has been known for a bit now. Just no one's bothered to fix it
Hello. Is there a way to prevent a player from setting there spawn in a certain world?
Hello?
@frigid ember Something must be wrong in the createCustomConfig method.
@boreal tiger I do, look at the createCustomConfig method
yeah just saw it my bad
@vagrant walrus Some permissions plugins allow for per-world permissions.
instead of calling File#getParentFile#mkDirs
thanks
Is there someone that might have a solution for me?
just call File#createNewFile
I already reinstalled mc but I can try to update Java
restart pc
I have this bug since weeks
Looks like there's a reason for it being annotated nullable https://hub.spigotmc.org/jira/browse/SPIGOT-5668
It's a silly reason but it makes sense
when I check hasPermission it doesn't check which permission is highest right?
So whats the best way of doing that IE - I have 5 tiers of permissions, if im given tier 2 and tier 5 how do i make it choose which permission is by highest
@radiant pollen Any idea what's wrong in my createCustomConfig() method, I've got no idea anymore.
just call
File#createNewFile
@wanton delta @frigid ember
hi
Is there a way to sell spawn eggs on a sign shop via EssentialsX? It won't let me. I am using Paper Spigot 1.8.8 on a self-hosted Google Cloud server.
Paper Spigot 1.8.8
- Wrong server
- Unsupported version
Paper* 1.8.8 as well
It still wont work 😦
When I do if (!customConfigFile.exists()) customConfigFile.createNewFile(); I get an IO exception?
whats wrong with gcp lmao
createNewFile() throws an exception, you should try/catch it
Oh
Though the call to exists() is redundant because createNewFile() does this for you
- expensive
- low clock speed
he's probably using the free credits
yeah fair
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}```
Will not override existing files
Last one before bed :P
In my PlayerRespawnEvent, I set the inventory of the player to a custom inventory, I change the respawn location correctly and I add the some effects (glow). But even though all of the above work, the glow doesnt get applied. Is that because when the player respawns he loses all effects ? I set it in the event, shouldnt that apply ?
Oh cool thanks @subtle blade
Sorry, I was using Paper Spigot 1.8.8 to suffice my community with better combat.
RIP 🙏
go ask in paper
no need for the sass
theyre two different servers
spigot is not paper
paper is not spigot
plugins can work on spigot and not paper
plugins can work on paper and not spigot
¯_(ツ)_/¯
I still get a null pointer exception
(and i personally would rather choose a combat plugin over hundreds of lost features)
what line is your NPE
What's you code look like. I missed out on a lot of the conversation
i did too tbh
I currently have a big problem with disconnecting from Minecraft Networks.
My Problem:
When I disconnect from a Network (it appears on every network)
the network tells me that i am still online until the fake me loses
connection to the server.
maybe you guys know a solution for me
@gaunt ermine i dont think we can help you
its not a spigot issue and i would suggest you put a thread on the forums
@subtle blade Here's the repository https://github.com/aimorris/minecraft-paper-rank
I'm getting a null pointer exception on Command_GivePaper:28
¯_(ツ)_/¯
wait
there it is
those class naming conventions 😭
please dont name your classes that
I dont want to spam my question, could you please check a bit higher ? 😛 Its not a difficult one I assume :/
it helps no one else
String exampleString = config.getString("test");
is this in your config? the "test" path
Calling createCustomConfig() AFTER instantiating your command class
Do this before
onEnable(), line 27, move it up
Calling constructor -> getting the field (null at this point) -> creating and instantiating the field in the main class
(is what you're doing now)

pepecry for underscores in class names

thank you
Uh, I have a problem. So EntityPortalEvent isn't called in custom worlds (although PlayerPortalEvent is, and allows you to set a new world as destination), so I am using EntityPortalEnterEvent to detect portal entry instead. This all works fine, and I've managed to replicate the portal finding code from vanilla.
But, as I can't set the destination here I need to teleport the entities. Whenever I teleport the entities to another world, they're just gone. Boom, poof, out of existence :/ Is this... normal?
Uh oh, I'm getting this in the console https://hastebin.com/iquqebaqez.md
but it's not creating the config file...
I'm going to say yes because those chunks aren't loaded. Likely a bug on the vanilla end that was enabled by Spigot
The chunks are loaded

is the difficulty not peaceful
i mean that would only really help you if youre trying to teleport monsters
@frigid ember to load your config you should be using https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/file/YamlConfiguration.html#loadConfiguration-java.io.Reader-
i dont have experience just offering ideas lol
Uh, it seems to randomly work now. I'm still not happy about EntityPortalEvent just being called when it feels like it though, but I'm gonna complain instead of making a PR.
ticket
@subtle blade So my createCustomConfig() method becomes:
private void createCustomConfig() {
customConfigFile = new File(getDataFolder(), "papers.yml");
try {
customConfigFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
customConfig = new YamlConfiguration();
YamlConfiguration.loadConfiguration(customConfigFile);
}
?
private void createCustomConfig() {
InputStreamReader reader = new InputStreamReader(this.getResource("papers.yml"), Charset.forName("UTF-8"));
YamlConfiguration config = YamlConfiguration.loadConfiguration(reader);
}```
Simple as that ;P
May need to try/catch some of that, don't remember
(and assign your field, obviously)
That's his field
huh
customConfig = YamlConfiguration.loadConfiguration(customConfigFile);
that should be it right?
Yes
(and assign your field, obviously)
oh i was just point out his original code
customConfig was just a blank yamlconfiguration
Yea, you should assign the variable using YamlConfiguration::loadConfiguration, it will return a new configuration from the specified file/reader.
Okay, can we confirm that I've got this correct now?
https://github.com/aimorris/minecraft-paper-rank/blob/master/src/com/github/aimorris/minecraft_paper_rank/PaperRank.java
I'm also not sure if loadConfiguration() closes the reader. Have to check that
test it out :D
today i learned how to use dropboxapi
i wish u could just download files with link :/
it used to work like that now it throws 400 ::(
can someone help me
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
It does close it
try {
String line;
while ((line = input.readLine()) != null) {
builder.append(line);
builder.append('\n');
}
} finally {
input.close();
}```

It works, thanks.
o/
Is it possible to get a list of the top level keys from my config yml?
What I mean is, if my config is
owner:
rank: owner
moderator:
rank: moderator
default:
rank: default
is it possible to get a list containing owner, moderator, defualt
use #getKeys
Yep. ConfigurationSection has a getKeys() method
oh thanks
false to not get all keys recursively (just top level)
@subtle blade my createCustomConfig() method isn't actually creating the file now, it's just reading from the default config.
@distant steeple only way to do this is with a constant open sql connection (not recommended)
Not sure why you deleted that, you're right. saveResource()
you cant detect server crashes otherwise
ah my bad I thought it wasnt the right thing xD
Nope, you're 100% right 🙂
I have the tendency to type stuff before thinking it through xD
you cant detect server crashes otherwise
@wanton delta tell me how
That's actually a better way to load it as well. Save resource, get the file, loadConfiguration() on that file
since i save my data to a flat file
Otherwise you're getting the config from the jar every time
could make an auto saver
Which... y'know... isn't ideal... lol
@frigid ember Your config field should also be private, considering you've given it a proper getter 🙂
@distant steeple yes you could do that
autosaving is the only way to safely save data before a crash
what would be a good period like saving every 5 mins?
whatever you think
or maybe at low tps or packet income
plugin im working on leaves open 3 sql connections at a time 😳
player data
Yea that narrows it down to everything
im using flat file
Are you using a connection pool?
¯_(ツ)_/¯
too lazy
I know. HikariCP is a connection pool for sql
nope
and i dont want to setup a mysql server for a plugin
You can use Hibernate to make your life a lot easier, however when you shade it, it will be a large file.
you can just spin a docker container for sql to test stuff
Ray, you can get a free one for limited storage, online.
hikari is the most common pool
c3p0 is what I use 😮
It is possible to give someone permission to access a certain file on my vps (a server on my network)?. is to give access to my developer so he can configure, but i dont want to do him access to all vps.
Literally just download MariaDB package for windows
ik but i want my plugin not to use external databases
comes with heidisql and everything
hikari > c3p0 😤
@storm willow chroot
mhm I want to spawn some entities close to where most players are.
I've been doing it by finding the mean location and then generating random coordinates in a radius of X blocks. is there a better way of doing this?
depends @keen moth
?
majority of servers have sql so it doesnt hurt 🤷
windows subsystem
idek what that is
but its hard to rewrite a server system with over 500 of classes
I like MariaDB because its what you get on unix
you can get mysql on linux as well xD
@wanton delta should i run a scheduler for each player or one for all
because i normally use unix for test stuff but dont have a linux server rn :/
However @keen moth you are right, c3p0 is very buggy and when not configured properly it can have a huge impact on your application.
you should run a task timer with a delay of 0 and a period of 20 * 60 * minutes
im good with what i got lol
i like heidisql
instead of downloading mariadb for Windows going through the installer all of that, you can apt install mariadb
why doesnt try(InputStream in = plugin.getResource(resource); OutputStream out = new FileOutputStream(resourceFile)) { ByteStreams.copy(in, out); } work on java 8? it wants me to change to java 7? pretty confusing but ok
im not gonna install a linux vm
its not a linux vm
I recommend using a bufferedstream, much more efficient @frigid ember
its slightly different
its integrated into windows
idk why yall so against running an msi file lmao
wdym?
:crazy:
i will look into it but i like what i got
you install it directly from Microsoft store
if you're comfortable with linux you'll prefer it by a mile
i probably would :/
why is it a bad idea lmao
i tried to setup microsoft sql
and once i got it running after like 4 hours
i realized it doesnt accept the same syntax
.<
lmao
that's why you use wsl
i was mislead
it doesn't take 4 hours to install anything in wsl
bro you can chill about this wsl thing
i will look into it but i like what i got
@wanton delta
it's superior ok
gaming
linux is as good as windows for gaming.
it's all personal preference 😛
no way
you cant run origin games in linux iirc
so many triple A games just don't work on linux
when u say something is superior that is an opinion
proton and wine do a lot but it's just not the same
leave ppl to do what they like to do
and if theyre lookin for better options offer it
but for now i am using my maria db on my windows machine with heidisql lol
he wasnt making you use it lol
if you wanna spend 4 hours installing MS SQL, be my guest
im not using ms sql
well yah spent 4 hours installing it
MSSQL takes like 10 minutes to setup?
4 hours? lmfao
it does NOT
It takes like fucking 2 seconds to install MySQL
he said it took him 4 hours
IT took me ages
must've been a pebkac situation
I mean, I work at a firm that specializes in MSSQL solutions, it's especially easy on Windows
I had to download the thing and get all these seperate files from this windows developer site
Like you just click through everything and it's ready
bro it wasnt i swear
this is why wsl is superior, you have package managers to do this for you
-_-
You might want to change the SA password and setup some service accounts, but that's it
isn't there a sql community server you can just download and it does all the installation automagically?
Hello. Is the player bed enter event called when a player clicks on the bed and sets its spawn in 1.15?
are you talking about the Microsoft SQL Management Studio thing?
cus tahts what i setup with everything else
I mean, that's the Windows approach for it, you just click through everything
@silk gate You know what's even more superior. Linux on it's own.
Nah, SSMS is for interacting with the server
Either way, regardless of the duration that it takes to install MySQL; MySQL does have useful purposes, but if it does not fit what you need then don't use it.
@frigid ember GAMING
inb4 someone starts recommending nosql databases 😂
thats all im sayin
Mongo 😮
ahahah lmao
mongeddb
they have their uses
yeah
@silk gate Okay I'll admit that it might be easier to setup gaming for windows. but for everything else: linux.
I honestly don't know how you'd fuck up an MSSQL installation
not hating on them
If you're running a single-server project, then you have no reason at all to even bother to use MySQL. If you're trying to setup a multi-server project, then you have a lot of reasons to bother to use MySQL.
Imagine using SQL lol
redis :)
@frigid ember some games just straight up don't work under wine and proton
mhm I want to spawn some entities close to where most players are.
I've been doing it by finding the mean location and then generating random coordinates in a radius of X blocks. is there a better way of doing this?
Not necessarily. SQL is not just for cross server data.
sql is the language
sql is not a database
Structured Query Language
anyway i have work to do, which i'll be completing efficiently using linux.
Yeah, not even just cross-SQL, but it's especially useful if you want to integrate MySQL Databases + Web Development, and more. It's pretty versatile, naturally you would choose your data storage solutions based on what fits your needs best.
I mean, I'd say that SQL is superior in most cases it's tried and tested, while NoSQL is widely used in smaller to larger projects, it's still new compared to SQL
postgresql is cool too. you can store json objects as well
It's very useful because of the json integration it can offer. Especially when reading/writing to web services in json
Yeah, I really wouldn't store JSON though
MySQL does have JSON support included, although I don't really know much about it nor its limitations, I'm sure there are probably better solutions out there.
Yeah, just run basic and it should work
mongo has really good support to work with geolocalization stuff too
jsonb postgres style
isnt Mongo just using files?
Documents*
for my discord bots cache I just chuck data into jsonb columns and it's really FASTE
You can look up a "cheat sheet" for the terminology that you can somewhat associate with mysql
Oof
I cant figure out how to start a forums post so i will just ask here
Is there a plugin that does nothing but connect bungeecord servers tablists
i think global tab is deprecated
Storing things in JSON columns is just going to make it harder to query the data you want
At least with MySQL, if you use it properly to it's capabilities you can actually divert a lot of the calculations to the MySQL server to figure out queries versus running them all just in your plugin itself.
yep
that was years ago
it was bad
I cant figure out how to start a forums post so i will just ask here
Is there a plugin that does nothing but connect bungeecord servers tablists
two seconds to google :s https://www.spigotmc.org/resources/bungeetablistplus.313/
But, like I said before, if you're using a MySQL Database for purposes that it's not really intended for, like only on a single-server you're just including delays that dont even really need to be necessary.
Yeah, in 9/10 situations you'd want to let your SQL server do the calculations
you can query stuff even if its in a jsonb column in postgres
@hot lodge
So it's just best to use files, unless you're really needing the versatility.
and you need that data accessed in more than one place.
Well the scalability is already there if you choose to implement mysql
yes @wanton delta
i sent link
i tried that it interfered with my essentials tab ranks
:ssss
