#help-archived
1 messages ยท Page 46 of 1
Why not just make a local server on your computer?
oh,
looking for a plugin that will generate a nether end for every world so if they go through portal in mine world for resources compared to main world nether where it might be more protected and meant more for home building
is this possible, please let me know i would really appreciate it
@junior acorn Could you elaborate more clearly? I don't quite understand what you mean
Possible, but I've never seen a plugin that does that
Is he looking for a different nether world with custom resources than the main nether world?
Per world nether, or per world portal
per world nether
oh so each world would have a different nether that gives different resources?
yes
But you need to either make it, or have someone else do it
@junior acorn do you mean like having custom mobs or like chests and structures?
per world nether
this is the closest thing i could find: https://dev.bukkit.org/projects/multiverse-netherportals/
I would just make a separate server for each "world" at that point
but that is outdated
interesting idea though
for example if you go to a nether portal in world mine you would go to mine_nether but if you go to nether portal in world spawn you would end up in spawn_nether where you can setup where this would be disabled and enabled and other settings
that is the best way i can explain it
i dont know how to find the plugins folder
you could do something though, it may not be the real nether, maybe have someone build a different nether for each world set it up with multiverse and have different things in them., that could be an easier way.
for each world
can someone help me i downloaded a enchant all command plugin but i dont know where to put it for it to work
@atomic niche Do you not see a plugin folder in your server?
i just dont know where to find it
screenshots?
ooooooooooh now i see it sorry ๐
some of the plugins were premium plugins the old versions were free but sometimes when they continue the plugin they start charging, i have to find other ways around by that i mean other plugins still working on my server having trouble finding certain replacement command for essentials still
for (int y = -1; y<= 0; ++y) {
for (int z = -1; z<= 1; ++z) {``` anyone know how I can make this for loop do a 3x3x1?
right now it's doing a 3x3x2
i dont understand that language, is that java code?
@median wing you've got it set up to do -1, 0, 1 then -1, 0 then -1, 0, 1
Remove the y loop if you'd like to do only one there?
@frigid ember Isn't it already -1,0,1 then -1,0 then -1,0,1?
That's what you're doing yeah, but you asked for how to make it into a 3x3x1
So remove the Y loop
You only need 1 value, not the two
@median wing When you say 3x3x1 do you mean x * z * y?
for (int y = -1; y<= 0; ++y) {
for (int z = -1; z<= 1; ++z) {
assert dirblock != null;
block.getLocation();
dirblock.getRelative(x,y,z).breakNaturally(explosive_pickaxe);
player.playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 30, 0);```
this is my code
@median wing When you say 3x3x1 do you mean x * z * y?
@frigid ember
In that case you only need 1 value; right now you're doing y = -1 and y = 0, so instead just pick one
Do you want y = -1 or y = 0?
for(int x=-1; x<=1; ++x) {
for (int z = -1; z<= 1; ++z) {
assert dirblock != null;
block.getLocation();
dirblock.getRelative(x,-1,z).breakNaturally(explosive_pickaxe);
player.playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 30, 0);```
Oh okay
Because your loop as you said was doing -1,0,1 then -1,0 then -1,0,1?, so of course it'd break two blocks - you only want one y value, so you make it
-1,0,1 then -1 then -1,0,1 or -1,0,1 then 0 then -1,0,1
Ah, it makes more sense now
thank you
I'm a try it out now real quick
I'll tell ya if it works
Np gl
Is it possible to get player's time played?
how do you cast an nms entity to a org.bukkit.entity.Entity
doesnt NMS entity have getBukkitEntity?
@frigid ember Just getBukkitEntity()
Bukkit Entitiy's don't extend the NMS entitiy. It's just a wrapper
oh
thanks
net.minecraft.server.v1_8_R1.Entity en = wor.a(id);
org.bukkit.entity.Entity entity = en.getBukkitEntity();```
basically that
Yeah
now i am makign something
trying to support many versions
its so tiring
i must manually import each version
Yup
Most people just use the same folder naming scheme as bukkit
Then load it through some means
what
ok, i heard reflection is slow, what makes reflection slow
i want to have my stuff optimized as possible
i was so used to reflection
The fact it's not straight bytecode
field lookup, ect
Rarely, if ever gets hit by the JIT
Do i need to worry?
Probably
how do i cast a org.bukkit.entity.Player to an net.minecraft.server.....*.*EntityPlayer
net.minecraft.server.v1_8_R1.EntityPlayer ePlayer = ((org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)player).getHandle();```// like this?
player is an org.bukkit.entity.Player
will this work or nah
Is it possible to get player's time played?
@cold wharf Yes with the normal minecraft statistic, placeholderapi has a placeholder for it
(Sorry Retrooper, not ignoring you: personally have no clue)
It didn't work
@median wing Were you able to get it to work? If not send over your code
ok
i think im correct
i am probs
thanks for responding tho
OfflinePlayer#getStatistic(Statistic.PLAY_ONE_MINUTE)
public static final Statistic PLAY_ONE_MINUTE
Name is misleading, actually records ticks played.```
So when you get that, divide by 20 and you have the seconds they played, etc etc.
@frigid ember I got it to work afterwards I just had to use 0 instead of - 1, thank you so much I appreciate it!
Ahh got ir
It*
I read it in docs it is in ticks oki
So I will have to completely code the playtime by using seconds? Like converting it to minutes then hours, days, etc...?
hello How do I access the int variables in PacketPlayOutEntityVelocity?
@lusty vortex ?
they are all private
(without reflection)
@frigid ember You need to use reflection
ok
๐คทโโ๏ธ
:c
Some stuff it's unavoidable
ok
Just cache the field
i didnt ?
So you aren't constantly looking it up
fields are a part of what reflections are tbh
i said ik fields
I mean cacheing as
Maintain that field somewhere
So you don't have to constantly get it
set it outside the method as a static private
i've said more but okay :p
static
i said why static
as in you don't have to init it every time you call a new object
it's initiating the first time you interact with that class and that's that
that's the proper use of the static keyword imo
i got the point
can u perhaps be like less repetitive, like when i say i see or i got it i got it
MethodHandle gang
well i just make sure you get it :p
how do i create a custom dragon (or 4) in game with a plugin/with code? or is it impossible?
i hope you have in mind nms because i doubt you can make a dragon do exactly what you want by using bukkit
choco made a lovely dragonbattle api which lets you do a few things
you don't get full control tho
then make your own bro
no bro
no bro u do it bro
chill bros
ok sis
Step bros
Hello, does anyone has a good tutorial about creating a basic minigame ?
You cant have two in a row dont ask me why
ChatColor.GREEN + "" + ChatColor.BOLD
#general already answered
ask james gosling
lmao
Hi does anyone have any idea why #callEvent would appear null? If so please take a peak here, https://www.spigotmc.org/threads/callevent-appears-to-be-null.434161/ - thank you!
please do not post it in here too
I'd say choose to only post your question here or only on the forum.
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList() {
return handlers;
}
public HandlerList getHandlers() {
return handlers;
}
unoveride them
yea
i just quickly ran over the code and was confused why it nulled
they have nice docs
im not too familiar with their api tho, sorry
Could you link me to their docs? Only found the enginehub thing tbh
https://worldedit.enginehub.org/en/latest/api/concepts/ here are api concepts ,
https://worldedit.enginehub.org/en/latest/api/examples/ here are api examples
what you sent are the ddocs anyway
havbe a look at examples sicne i see you have looked at the concepts
Hmm I think I fully looked through their doc thing and did not find anything about an AbstractDelegateExtent example or sth
But I don't think registering is the problem here because 1 is printed to the console in the @Subscribe block
its not, thats my q about haha
but you dont register an Extent
you register ur listener which listens for EditSessionEvent, and I just set the Extent of that event to my extent
ok
ill try their discord xd
any better plugin than advancedban for bungeecord?
User purplexdev has disconnected, reason: Internal Exception: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/World
I get this console eror when I attempt to join, I didn't import World class anywhere tho, but my server is spigot 1.8.8
fnaly
v1_8_R3 is 1.8.8
U need to find the full exception
Maybe turn on debug
v1_8_R3 is 1.8.8
okl
Hey does anyone know how I can make Maven get the current version based on the current version in plugin.yml
I'm using the Plugin-annotations library too
Of the plugin, my update checker uses the latest version on spigotmc and last time I forgot to change the value so I had to wait another 24 hours for bukkit to approve the update.
@Plugin(name = "ChestsPlusPlus", version = "1.15 v1.3")
So I'd like Maven to append 1.15 v1.3 to the current jar
I'm not sure if Maven can read any variables directly from classes though?
Define the version in maven and let maven replace a var in your source
That would make more sense
any better plugin than advancedban for bungeecord?
@frigid ember LiteBans is pretty good
thanks
anyone knows scoreboard-r alternative? now on 1.15.2 it's just spamming your console :/
Hi do anyone of you use UltimateHome?
Hi do anyone of you use UltimateHome? if yes how did you use it without op everyone thx
@frigid ember https://wiki.vg/Mojang_API
Are there any plugins that add various clothes?
Clothes?
Please tell me if anyone knows.
yes
dress
various dress
plugins
outfit plugins
isnt it..?
Uh what ?
how to make a void world
there are many different ways
you don't need plugins tbh
Through plugins or through server settings
I think I already have multi verse core, isn't there another plugin extention to that?
Cause you can just create an empty superflat world and boom
you can use server.properties' generator settings with a custom world
or a plugin if you're not comfortable with that stuff
does anyone know anything about multi worse core?
thanks for ignor me
no problem
yup
As much as I love 1.8, don't expect people to support outdated versions.
I'm on 1.15
I wasn't talking to you k9
i see
it gives me noclassexception, for importing 1.8, but i didnt
it led to an empoty constructor
the whole project
i didnt import
1.8
Atom do you know anything about the multiverse core plugin?
Not really
I've used MultiVerse plugin
pretty sure this worked:
https://www.spigotmc.org/resources/voidgenerator.25391/
then your friend doesn't know how to use it I guess
I invited him to the server now @sturdy oar
well you should just contact that resource's author, I'm not the one who made it.
wait he can't write until 8 minutes
otherwise just learn how to use level-type and generator-settings in the server.properties
pretty sure you can cleate void world from there
How can I transform from string Location{world=CraftWorld{name=Survival},x=936.3635795673218,y=70.0,z=63.546793984847405,pitch=12.006668,yaw=-1.1398733} to Location?
you are reading from json?
Anyone ever have issues with SMTP emails?
Mine will send to 90% of email services. But when it comes to foreign emails, even just a foreign yahoo domain, it doesn't reach
How can I delete my spigotmc account?
I've already sended mails to deletion@spigotmc.org or at support@spigotmc.org but didn't get an answer for weeks. I also reported my account with the reason "delete me".
What can I do?
when ddi u send a mail
to deletion
About 4 weeks ago
wow
Or maybe even a bit longer
report your account
for deletion
Already done
But nothing happend
maybe.. wait?
Yes about 4-6 weeks ago...
then you didn't explained clear enough why you want it deleted
But I told them why it's important for me to delete the account
How do you guys save config to also contain comments?๐ค
are you using a writer rather than the api?
probabily they copy it directly from inside the jar?
hmm
Do you guys have any idea what I can do to delete my account? :/
why?
Is it terribly urgent? I can't imagine it is
Yes for me it's terribly urgent, because of personal reasons
Your life depends on the deletion of your spigotmc account?
monkaS
inb4 yes
@subtle blade no... what does such an answer brings...
But for me the deletion of my account is important...
You see.. problem is with what you posted,your account can be anonymised,so the posts will remain but the account can't be used anymore..
From all the account deletion requests I can see, none of them are urgent as the majority of them have no forum posts and no public contributions
It's not urgent
That being said, md is the only one who has the ability to delete accounts. He will get to it whenever because you have to realize that you are on a public service
Context: I'm running SpigotMC on a Raspberry Pi 4. It's connected via ethernet directly to the router. The public IP has a domain name assigned to it configured specifically for a Minecraft server.
Problem: Late last night the wifi shutdown. I assume ethernet continued to work as this morning I found that the wifi would restore upon disconnecting the Pi from ethernet. Reconnecting the Pi via ethernet does not cause direct problems, however any attempt to ssh or even connect to the pi shuts the wifi down. Also worth noting that the Pi connected via ethernet worked fine for several hours, but started having problems just over an hour after the public was assigned to a domain name. That being said, the server worked for well over an hour before seeing network issues.
SpigotMC does not collect any personal information nor does it distribute it, if that was your concern
why are you running a minecraft server on a microp?
Anything available to SpigotMC is public on your profile which is all changeable
beside the point
(except birthdate which isn't, for some reason lol)
We serious don't recommend running a server on a pi. It was not designed for that and they often fail as a result
How could I make a plugin which increases the enchantment level of the item in your hand, depending on what you wnat
So basically you can enchant a pickaxe by 1 extra level in effiency
you loop through all enchantments,remove the one and add it again with 1 level higher?
well
It's an experiment, for very low user counts
Yes... but it is possible that they delete my account?
Only md_5 and he does it whenever he gets the time
More often than not, it's not a pressing matter
anyone knows something like scoreboard-r but with 1.15.2 support and not spamming into your console every few minutes?
Yes I understand this :)
But do you think he will delete my account when he reads my email?
spamming your console? have you reported that issue?
That can take awhile so don't expect it anytime soon though if you sent a email.
If the account has no significant contributions, generally it's fine for deletion
It's just a matter of whenever md has the time
Ok thanks a lot!!
Now I'm a bit calmed down ๐
I suppose because the Pi is not reccomended there is no support to be had on this issue
well its a microprocessor
its not supposed to be used for this
also Arduino king
Well it's not that it's not supported. It's just that there are significant cons to running it on a pi
Storage and performance being the biggest issues
So just looking for a general opinion... If I re-developed a semi-original game I have to have a similar gameplay of a mix between Mineplex's and Hypixel's Cakewars/Bedwars, would that be of interest to anyone? I feel like it would be redundant, but at the same thing I believe it would make my game a bit more interesting and give it more dynamic.
The latest that can run on a Pi is 1.12.2.
@frigid ember people copy minigames from others always
they are always interested for others
Anything above isn't possible without issues.
Despite that, I donโt believe this problem has anything to do with the Pi specifically.
And is unstainable for the Pi to handle.
โน๏ธ
This is a network related problem, perhaps something to do with port forwarding
mh
I wasn't saying that wasn't the issue I was talking about running 1.14 on a Pi isn't suggested as it won't be sustainable.
Still beside the point
Id like to understand the problem so I may avoid it regardless of how I decide to run my Pi
Which, full disclosure, Iโll seriously reconsider using it to run the server based on your advice
Does net.md_5.bungee.api.chat classes, the BaseComponent, TextComponents and all that work without having BungeeCord on the server?
(but minimessages is better)
how's the time complexity?
@scarlet nova it looks like a plugin named ultimatefriends is the problem
16:18:22 [SEVERE] Exception in thread "main"
16:18:22 [SEVERE] java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
16:18:22 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getListeners(YamlConfig.java:253)
16:18:22 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:85)
16:18:22 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
16:18:22 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
16:18:22 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ```
Can someone help me
@verbal silo I don't have that problem anymore, I think
ok
how can I fix that?
Looks like a stupid plugin being stupid
In your larger paste, https://pastebin.com/DreNfrN2, "UltimateFriends"
Send the stacktrace their way
what?
The plugin UltimateFriends is causing that issue. Send the error to the author of that plugin
16:18:22 [SEVERE] Exception in thread "main" 16:18:22 [SEVERE] java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map 16:18:22 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getListeners(YamlConfig.java:253) 16:18:22 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:85) 16:18:22 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273) 16:18:22 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62) 16:18:22 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ```
@scarlet nova This error?
is caused by ultimate friends?
@subtle blade
Yes, but send the paste you'd sent in #general
More context = better
That small snippet there doesn't tell us anything, but the pastebin does
ok
https://pastebin.com/Uq8ZgDGb , This is what shows on the console, if you need any more information, I can give you @subtle blade .
Yea, I know. Send it to the author of UltimateFriends lol
It's a bug from that plugin
uh, ok
Hi, i have problem i'm not getting notification when new plugin or resource getting update
https://www.spigotmc.org/resources/ultimate-friends.3964/ 7JzKgEp- Owner's discord, the 1st error got fixed by restarting!
@subtle blade
@subtle blade I removed Ultimate Friends And It's still showing the error!
hello. I purchase a resource but am not able to download the plugin, it still prompts me to make purchase
Contact the author
imagine having wings and not being able to fly @verbal silo
I'm using a bukkit runnable to spawn entites from a queue. Sometimes I have to spawn n entities of the same type.
To avoid adding duplicates to the queue my queue consisted of a ConcurrentLinkedQueue with a pair of Enemy (the class which holds the entity type) and Integer (the amount of Enemies to spawn of that same type).
However this defeats the purpose of the queue to spawn entities in a more controlled way.
Using Collections#nCopies works but this seems like a waste of memory. Does Collections#nCopies just create a collection with n references to the same instance or does it make a new copy of that instance n times?
The javadoc says Returns an immutable list consisting of n copies of the specified object. The newly allocated data object is tiny (it contains a single reference to the data object).
What's wrong about duplicates in your queue?
^
nothing wrong I was just wondering if Collections#nCopies would be wasting memory
I would just keep the queue with duplicates entires
As it will also have your order and stuff
cool ๐ . The javadoc says The newly allocated data object is tiny (it contains a single reference to the data object).
Does this mean it doesnt create an entirely new instance?
just tested it ๐ it does use the same instance
Please help:
Console sending:
.................................................................................
In FTP files:
bin
boot
dev
etc
home
initrd.img
initrid.img.old
lib
lib32
lib64
libx32
lost+found
media
mnt
plugins
proc
root
run
sbin
srv
sys
tmp
urs
var
vmlinuz
vmlinuz.old
at.cpu.txt
deploy.sh
installimage.conf
installimage.debug
log.cron
logb.txt
logb2.txt
t_cpu_ms36.txt
tmpc.txt
tsql.txt
Could someone help me , im probably doing something wrong, Im saving chests to chestloot.yml and get them later.
but somehow when i save them first with: chestloot.set("loot." + args[0].toString(), chestinv);
where args[0] is the name given by user and chestinv is the chest inventory
Now when i try to get it with:
@SuppressWarnings("unchecked")
List<ItemStack> theinv = (List<ItemStack>) chestloot.get("loot." + args[0].toString());
ItemStack[] invarray = (ItemStack[]) theinv.toArray(new ItemStack[theinv.size()]);
``` it doenst work and gives the error:
```console
java.lang.ClassCastException: [Lorg.bukkit.inventory.ItemStack; cannot be cast to java.util.List
but it does work on chests i saved before a restart/reload
You'll probably want to getList() instead
Is it even possible to get an ItemStack list from the config? I thought it was only individual entries
Sure. A Yaml list is just a list of objects
If they're serializable, absolutely you can
Please help:
Console sending:
.................................................................................
In FTP files:
bin
boot
dev
etc
home
initrd.img
initrid.img.old
lib
lib32
lib64
libx32
lost+found
media
mnt
plugins
proc
root
run
sbin
srv
sys
tmp
urs
var
vmlinuz
vmlinuz.old
at.cpu.txt
deploy.sh
installimage.conf
installimage.debug
log.cron
logb.txt
logb2.txt
t_cpu_ms36.txt
tmpc.txt
tsql.txt
Hi, it's me again with noobish question... Is there some simpler way to prevent player from getting rid of item? Prevent dropping is simple, it is much worse with inventories as I would like them to still be able to move the item around in their inventory, but do not allow moving it into chest etc... I know there is InventoryClickEvent but it covers sooo many things and I guess it will be hell writing the conditions for that. So the thing I am looking for is something will the result of this event be user is moving item out of their inventory?
@vivid imp Ahoj ๐ Can you provide more info rather than list of files from unix?
InventoryClickEvent's getClickedInventory() will be null if they click outside of their inventory
@subtle blade Even when they click into a chest inventory?
You could check if the clicked inventory isn't an instanceof PlayerInventory. Should cover what you need
Will also ensure nullability. If it's null, won't be an instance of PlayerInventory
if ((event.getClickedInventory() instanceof PlayerInventory)) {
event.setCancelled(true);
return; // If clicked outside of inventory or of any non-player inventory
}```
I reset the server, but the console still writes: ............................................................ and hosting writes to me that my server is very overloaded: /
that's all i know ...
@vivid imp Well I would contact support of the hosting... I guess they will be able to help you more
@subtle blade yup, it seems pretty straightforward, so I don't need to check getAction that much, except for shiftclicking etc... Thank you!
Yep, sounds about right
@subtle blade and what is the difference between getClickedItem and getCursor? Javadoc is not very helpful. When I click Item and I have it in hand it is cursor and if i click/shiftClick item it is currentItem?
getClickedItem() is the item being clicked in the slot. getCursor() is the item on your cursor (i.e. you have it picked up already and are trying to move it to another slot)
ok, thank you!
How do I stock the villager shops? It says 'Item unavailable' when I try to use it.
How do I fix that?
Anyone?? Hello?
@frigid ember can you provide more info? Some code or something... There is not much to catch on here...
hi
Like, when I use the villager shops, and try to buy items, it says 'Item unavailable'. How do I fix this?
@sacred wave
Can someone help me... I need help deleting a plugin on my server, because its preventing me from deleting it cause its a jar file
someone please help... ๐
@frigid ember ok, again, you just repeated your original question. Are you trying to write plugin and using the plugin restock Items? Or are you just playing vanilla minecraft? Really, it is hard to help you with this little info...
Sorry.
I'll figure it out eventually. Thanks anyway!
hi people help me please
@snow willow isn't the server running while are you deleting the plugin?
@snow willow also OS of the server?
@frigid ember I would try to help you but with this little info, I really can't, sorry...
@snow willow Operating system
@snow willow so it is windows ๐
๐
lol
Im just starting out my server rn, so i would let u join but the problem is i dont wanna give my ip4
players die and immediately respawn when they drink a potion to increase health. how to solve the problem?
@snow willow I don't have a time, but thanks ๐
@sacred wave wut
so i want to save and load inventories from and to a yaml.
what is the way to go
something like this?
save inv as itemstack[]: ItemStack[] chestinv = chestblock.getInventory().getContents();
Im just starting out my server rn, so i would let u join but the problem is i dont wanna give my ip4
@snow willow
@snow willow np ๐
Slight smile ๐
lol
what do u think is the safest way to change the ip of a minecraft server
so its not the ip4
like a website that is safe
to change my ip
@snow willow well that is not easy thing to do... If you want to hide your IP I would suggest using proxy (BungeeCord)
@snow willowYou would download it, but you will need a hosting for it...
@sacred wave can I use my spigot server?
@snow willow you can but then, it will have the IP you want to hide...
ohhh
so what type of hosting would i need tho?
or could I just buy a domain.... Which is risky
@snow willow well I guess any hosting that would run minecraft as long as they suppor BungeeCord... But I am fairly new with Bungee, so I will not give you much info here...
@snow willow domain will not hide you IP...
Youโd need to hosting and to buy a domain.
@snow willow I can get IP from domain in 20 seconds...
Plus IPs are always out there itโs just how the internet works
wut
The only way you can hide an IP is if no one connects to the server.
but
@snow willow: @gleaming totem is right...
if you want someone to connect to the server, they need to know the IP...
why cant you buy a domain for the server... and then it'll change the ip
for the server
IP address != domain
@snow willow buying domain doesn't change an IP... It is just a name for it so you don't need to remeber it...
Domain --> Ip address
thwarted
how did u find that?
@snow willow so behind every domain is an IP address
Literally ping mineplex.com in your terminal lol
some show an ipv6 though
A domain just points to an IP so itโs easier in the eyes. Itโs easier to remember โgoogle dot comโ instead of a string of random numbers
i'm not a networking guy so i'm unsure why that is but it's effectively the same ๐คทโโ๏ธ
what hosting thingy do I need?
Any hosting that will host a bungee cord proxy, since it sounds like thatโs what you want
@snow willow well in that case I would get full MC hosting ๐
Before you buy hosting just ask if they support bungee
That is if you really want to set up a network with a hub and multiple servers!
Depends on the host, usually around $1-$2 per GB of ram
@snow willow bungee is free... hosting - it depends...
Basically all of them do if you have one in mind I could check for you if youโd like.
https://shockbyte.com/ from the google ๐
but it is just example I don't know any hosting personally
so I can't judge quality/price etc...
is that the one you use?
Iโd say find one with the cheapest price possible!
@snow willow nope I use VPS hosting which hosts full server and then I run mc on it...
and as it is not powerful enough, I run Bungee there and usually host MC from my personal PC ๐
cool! well ill think about it
so basically I have the same usecase as you ๐
I'll think about it... but when I want people on my server ill just switch to Vps hosting or something
or shockbyte
idk
ill find some
and ill switch to it
sometime
well thank you guys for your help im gonna go now! bye ๐
@snow willow for "production" it is the safest bet... I run my server for just family and friends ๐
np see ya ๐
Why is IntelliJ warning me about this
I'm probably being stupid but I can't find a scenario in which meta is null?
@dusty topaz because ItemMeta is marked as Nullable?
why though
@dusty topaz well I was wondering that too, but then, I am not an expert here, so I just decided to ignore it and pray ๐
Because it's nullable. smart
Going to check the source of craftitemfactory, but I'm pretty sure it can't return null
@dusty topaz @Nullable public ItemMeta getItemMeta() { return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone(); }
perhaps it does it the material is air
Otherwise most of my plugins wouldn't have thrown an NPE upon usage without a ItemStack#hasItemMeta() check.
getItemMeta() returns a new meta if hasItemMeta is false
Weird, it's nullable though.
Try it on an item that does not have anything at all, you'll see what I mean.
my reasoning being that CraftItemFactory#getItemMeta (or perhaps the clone implementation) can return null
there will be a reason it's marked as nullable
Most definitely.
If pulled from a vanilla item, it can be null
If just freshly created it wonโt be
vanilla item?
and that's our answer.
As in if I craft an item and try and get the meta of it it will be null?
Crafted, chests in shafts etc I guess.
that doesn't make sense to me, since it checks this:
return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone();
so if the meta is null it creates a new meta
๐คท
@dusty topaz but this can return null: Bukkit.getItemFactory().getItemMeta(this.type) , I guess
Is it possible to get a Block or Location from a chunk and x y z
`public interface ItemFactory {
/**
* This creates a new item meta for the material.
*
* @param material The material to consider as base for the meta
* @return a new ItemMeta that could be applied to an item stack of the
* specified material
*/
@Nullable
ItemMeta getItemMeta(@NotNull final Material material);
`
how to solve it ? https://bugs.mojang.com/browse/MC-19690
it can only return null if the material is air though
@dusty topaz I don't know that but even if that is the case, there is your answer to when ItemMeta can be null...
unless some of the sub calls it makes are null
then air is the only case in which it can be
which is reason enough i suppose
All we need to know is that it is possible that it's null. :smart:
๐๐ป ty
should get the block relative to the chunk
Yeah, there's a World#getChunkAt(x, z) (block and location as well FYI).
yeah, i meant getChunkAt
sometimes forget the names, but its self explanatory usually
Definitely is. Auto-completion in an IDE will most likely lead the user to it.
these nullable warnings are killing me :((
I think I'm going to elect to leave them and just have it spit NPEs lol
Not final. mad
@dusty topaz Why is this so relatable? ๐
why would i make it final
I mean.. you're not reassigning it, aye?
I don't finalize local vars either unless absolutely necessary. I hate it
๐คท
yeah, i'd only do that if i need it in a lambda function or something
Same goes with method params
I am signing under that ๐
I agree when it comes to method parameters, that I hate.
But they require it in my job ๐ฆ
my 'job' is mainly working with decompiled code
thanks to autocleanup
so i have to put up with it ๐
yikez
how to solve fake death?*
can i get help on how to start a server?
get a server jar in a folder.
create a run.bat following the format to run it (if you want to be able to close it easier)
run it (accept EULA) and restart.
boom a server on ur own pc
okay so im confused, can someone tell me what i am doing wrong
So i save chests to chestloot.yml and load it with java ItemStack[] contents = chestloot.getList("loot." + chestnames.get(listnumber)).toArray(new ItemStack[0]); but the problem is if i save a chest in the main class to chestloot.yml it can't load it, it does know it exists since the keys in the chestloot.yml increase (i printed that out in console before and after save) but it gives me a java.lang.NullPointerException: null
the one way it does work is if i put FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml")); above the chestloading
but i dont want to declare the data file so often
public class Main extends JavaPlugin{
public static Main plugin;
public FileConfiguration data;
public FileConfiguration chestloot;
@Override
public void onEnable() {
plugin = this;
plugin.saveDefaultConfig();
data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
``` I declared it like this
and the class where it loads:
public class Lightning implements Listener {
private final Main plugin;
FileConfiguration config = Main.plugin.getConfig();
FileConfiguration data;
FileConfiguration chestloot;
public Lightning(Main main) {
plugin = main;
config = main.getConfig();
data = plugin.data;
chestloot = plugin.chestloot;
i'd be happy if anyone could help me :D
the error
and line 153:
ItemStack[] contents = chestloot.getList("loot." + chestnames.get(listnumber)).toArray(new ItemStack[0]);
is there a way to directly get nutritional values from a food or enum it is?
have a method that requires the enum to store a value?
with a getNutritionalValue() method
imma check the chestnames
i gotta tell, it only gives the error if i save it and load it within the same uptime
if i restart or reload the issue is gone and the previous saved chest works fine
So sounds like some error with saving and updating the config file?
yes i think so
Are you reloading the config before pulling the chest info from it?
Are you saving it as soon as you put it in, or only onDisable?
ill show my saving
btw, if i put FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "chestloot.yml"));; works
chestloot.set("loot." + args[0].toString(), chestinv);
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&2&l[Airdrop] &r&aSaved &c" + args[0].toString() + " &ato the storage!"));
try {
chestloot.save(new File(plugin.getDataFolder(), "chestloot.yml"));
}
catch (IOException e) {
e.printStackTrace();
}
i also have a command that will get all the keys from the chestloot.yml and if i run that right after the saving, it does include the newly made chest
data.yml and chestloot.yml? Are they the same thing?
no they are not
oh
i meant Fileconfiguartion chestloot = blablbal "chestloot.yml"
Just check that chestloot and chestnames aren't null
Probably chestloot is if you're able to fix it by declaring right before
I got a weird bug. I'm trying to disable join messages but when I do event.setJoinMessage("") in a PlayerJoinEvent then it sends an empty line instead of disabling it
try putting null instead
@subtle blade if (ItemDropFlag.getItemFlag(e.getCursor()) == ItemDropFlag.BOUND) { if (!(e.getClickedInventory() instanceof PlayerInventory)) { e.setCancelled(true); return; } }
So, this almost works, but if I pick the item and keep clicking into foreign inventory sometimes I am able to. :/
but Dessie
if i save "chest1" and restart the server
then save "chest2"
then i trigger my command which summons a random chest, if chest1 gets loaded it works
but if chest2 get loaded it gives error
Could be chestnames.get(listnumber) when you save a new chest are you adding it to chestnames?
if i trigger the spawncommand it first makes a list of all the keys in the config named "chestnames"
so that list is updated before it choses a chest
ill try printing all contents of the chestloot.yml before loading the chest
loot, loot.h, loot.hhh it does see the new chest
i saved a chest named hhh and then did the summonchest and i made it so it prints all keys before summoning
@upper hearth Any ideas?
What's the issue here?
Well its quite complicated
im saving chests to a yaml file using:
chestloot.set("loot." + args[0].toString(), chestinv);
and with another command summoning a random chest in that yaml file using:
ItemStack[] contents = chestloot.getList("loot." + chestnames.get(listnumber)).toArray(new ItemStack[0]);
the chest loading works semi
Next possibility is getList() is returning null.
if i save a chest, reload server, load chest it works
but if i save chest, load chest it doesnt
hmm its so weird cause why would it find the list if the plugin restarts
Saving issue I suppose. If you save a chest before reloading what does the YML look like?
ill show
And what does it look like after you reload
Let's begin at the way you're saving. Data stuff should be loaded on enable and saved on disable. This way it's easier to access the data needed and modify whatever you feel like, there's even more to it.
You should serialize the Inventory to save it
You should be loading the data on enable and save it on disable.
Access it through a map of player's data.
So its not possible to acces the new chest if you save it without restarting?
i mean it is possible
but
Serialization allows you to read and write the entire inventory to/from a base64 string
ah
So simple sayed, i'd have to convert inventory to a string?
and save that in the file
then read it and convert it back to inventory?
Can anyone here transcribe music?
but the weird thing is that if i put FileConfiguration chestloot = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "chestloot.yml")); the line above the loading it works absolutely fine
yeah if you use that it is base64
but just deserializing an itemstack it will just be like
item:
==: org.bukkit.itemstack
type: blah
amount: blah
etc
@narrow crypt why don't you iterate over the files contents before you need to use them
to debug what is in the FileConfiguration you have
ill try that
i already printed every key and it did included the new one
but you mean also the content of the new one i guess @dusty topaz ?
can i print a itemstack?
public String toString() {
StringBuilder toString = (new StringBuilder("ItemStack{")).append(this.getType().name()).append(" x ").append(this.getAmount());
if (this.hasItemMeta()) {
toString.append(", ").append(this.getItemMeta());
}
return toString.append('}').toString();
}
yup
-----------------
[20:45:38 INFO]: -----------------
[20:45:38 INFO]: null
[20:45:38 INFO]: -----------------
[20:45:38 INFO]: -----------------
alright thats clear
its null
the value is null, it did save the name tho
show me the code where you set it
but is says all of them are null, even the ones i saved earlier
that do work when i summon them
how are you loading your config
chestloot.set("loot." + args[0].toString(), chestinv);
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&2&l[Airdrop] &r&aSaved &c" + args[0].toString() + " &ato the storage!"));
try {
chestloot.save(new File(plugin.getDataFolder(), "chestloot.yml"));
}
catch (IOException e) {
e.printStackTrace();
}
that is the saving part
that is not how you want to be saving
oof
https://www.spigotmc.org/wiki/config-files/ - pretty sure I linked this last time but give it another read
just follow the convention in this and you'll be fine
So a quick question to see if I understand this correctly. PaperMC/PaperSpigot/SpigotMC has a separate 'world' for each dimension (overworld, nether and end). Am I correct in my assumption that settings don't 'carry over'? Like off i set keepInventory in the overworld it's doesn't apply to the others? Is that for all commands? Difficulty etc?
thanks avrovulcan
pretty sure I answered you in general Nils...
Yes. I just moved the topic.
thank you so much for your patience :D
... but you got the answer
Yup. But I was wondering if that ment everything?
every gamerule? yup
btw, i favorited the website when you sent it to me earlier haha
@dusty topaz thanks. Then I got my answer.
Would have been a good thing to know. We learned this the hard way...๐
@dusty topaz Just one more question, sorry for being such a noob ๐ Does this include teams and such? I have all the players sorted in groups according to what community they come from. Will this to have to be set per dimension?
Okay. Thanks anyway ๐ I'll ask my players if it shows up in the nether and end. I really hope it does cuz that's a lot of typing...
Ok, can someone try this: @EventHandler public void onInventoryClick(final InventoryClickEvent e) { Bukkit.getLogger().info("BOO"); if (e.getCursor() != null && e.getCursor().getType() == Material.BEACON) { if (!(e.getClickedInventory() instanceof PlayerInventory)) { e.setCancelled(true); } } }
When you register this event and pick a Beacon from your inventory and try to put it into a chest, it should be canceled. However if I hold the Beacon and keep clicking into chest inventory there is about 10% chance the event is not called at all and is not cancelled.. Or I am just stupid and don't see something...
well, first of all I would replace the instanceof with
if (e.getClickedInventory().getType() != InventoryType.PLAYER)
but then you can also just
event.setCancelled(e.getClickedInventory().getType() != InventoryType.PLAYER)
well getType could return null...
then check if the inventory is null
*getClickedInventory...
but the thing is that the BOO message is not outputted sometimes...
so I guess the event is not called at all...
but it should be as I keep doing the same thing...
i'll test it
Thank you!
Yeah, I can get it in the inventory
So it is a bug... :/
I agree with the approach that Avro mentioned. Implicit else is the way to go.
Hey guys just a quick question i can't find a way to add a potion effect to a user for a certain amount of time. Can somebody give me an example?
Player#addPotionEffect?
I tried that. But it doesn't seem like i can add a certain amount of time and such
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 11));
PotionEffectโ(@NotNull PotionEffectType type, int duration, int amplifier)
Ahhh yes thank you!
I've always preferred PotionEffectType.WHATEVER.createPotionEffect() ๐
Just a convenience method but it looks a little nicer
does it cache potion effects
@rigid nacelle @dusty topaz Ok I will use the getType... ๐ But I am afraid it won't help me...
No, creates a new one every time. You should create constants for your own potion effects
viaversion or protocolsupport?
or both
Well I know the packet is not lost as the item stays in the chest, and I don't see that much under the hood so I can't tell...
@frigid ember i dont know why you bother asking if you dont read the answer
both plugins do the same thing (protocl support)
as for which is better its probably your own choice to make
@dusty topazDo you have latest spigot?
yep
i think perhaps its an inventorydragevent being called
when its not calling the click event
and you'd need to cancel the drag event anyway
Will try that....
@dusty topaz ha! that seems to do the job, so not a bug at the end... Thank you!
๐ make sure you can't shift click them in too
since the click will be in the players inventory
yup I had it already implemented, just wanted to post as simple sample as possible
@dusty topaz @EventHandler public void onInventoryClick(final InventoryClickEvent e) { if (e.isCancelled()) { return; } if (ItemDropFlag.getItemFlag(e.getCursor()) == ItemDropFlag.BOUND) { if (e.getClickedInventory() == null || e.getClickedInventory().getType() != InventoryType.PLAYER) { e.setCancelled(true); return; } } if (ItemDropFlag.getItemFlag(e.getCurrentItem()) == ItemDropFlag.BOUND) { switch (e.getAction()) { case MOVE_TO_OTHER_INVENTORY: case CLONE_STACK: e.setCancelled(true); return; } } }
๐
public static void serialize(Coinflip coinflip, String path, FileConfiguration config) {
config.set(path + ".uuid", owner.toString());
config.set(path + ".amount", amount);
}
Any better way to do serialization than this?
I would ideally want to return a configuration section that they can use config#set(path, flip.serialize(path, config));
I don't know structure of the class but maybe if values are stored in map, then you can just iterate? @dusty topaz
Should I separate each inventory page into a class? Is this single responsibility?
it's just got two fields
Then I guess this is fine...
just wondering if its possible to create ConfigurationSection
I feel like it is an over exaggeration of it
@dusty topaz I guess you can create a section
I meant without passing in a fileconfiguration object ^^
Anyone knows why my ${project.version} placeholder is not taking the version and just leaving the placeholder there in the plugin.yml file?
I'm using Eclipse
I feel like it is an over exaggeration of it
@fleet burrow this is in a class named MachineInventoryImpl so is that enough?
@fleet burrow I don't think that would be single responsibility
depends what you class as functionality
ah, there is the catch....
is the functionality just one inventory or handling all inventories
regardless i'd put them in different classes
@dusty topaz then from my little knowledge, you can't without the FC instance :/
Anyone knows why my ${project.version} placeholder is not taking the version and just leaving the placeholder there in the plugin.yml file? The placeholder is functional in the pom.xml just not in the plugin.yml and I'm using Eclipse if that helps*
@fleet burrow you probably shouldn't create a new object for each inventory
in some cases that's unavoidable (if its player specific) but if it's a static inventory you can just have a shared instance without issues
Yeah, I know :P
It's player specific
in which case you should definitely have a separate class per inventory
since you'll want to track who is in what inventory
other people probably know more about the single responsibility principle than I but it sounds like you should be splitting them up :p
I guess I could have a static field in the a machine object that points to an inventory of the machine
would be much better
thanks for giving me the idea though ๐
Now I dont know what causes this but when someone is kicked by my plugin, you can no longer join (sometimes, like a 20% chance). You just get kicked with Disconnected in the client and nothing prints out in console like you never even joined
usually when it happens handleDisconnection() called twice is printed after the person is kicked
Could it be my plugin maybe or protocollib or something else
yeah in a task
is the task async?
No idea
show some code
pd.setViolations(0);
violations.remove(pd);
pd.isbeingpunished = false;
p.kickPlayer(Main.getInstance().removalMessage);
}, 1l);```
try increasing the tick to 2L, but I'm unsure why that is happening
also ensure p.isOnline before kicking I guess
ยฏ_(ใ)_/ยฏ
hi, have a really big problem, i have a VPS with 8GB of ram but the server only use about 1-3GB, we dont know what it is, anyone have a clue?
(we have 8gb in the config.yml)
there is no config option to specify the ram usage
and it doesn't need to use all allocated
and you also shouldn't allocate all the ram to the server
we also tried it with 7 and 6 bit still the same
it doesn't need to use all of it
the problem is the TPS start to fall down
leak
cause we have about 16 people
depends tho
Hey, if I'm saving to a YamlConfiguration quite often should I be doing that in a background task?
why...
you shouldn't be writing to a file often
would you do that?
what do you mean by timing (new in this sorry)
/timings report
@dusty topaz actually /timings paste creates link...
๐คทโโ๏ธ i don't use it often
dawon is likely correct
/timings paste, not report :p
I used it today for the first time ๐
and if you go through report it sends you to a webpage informing that you should use paste ๐
https://timings.spigotmc.org/?url=ihuwivihod
@uneven kraken these are the timings
I'm storing a bunch of ItemStack Lists from a custom inventory and serialising them. And so each time the inventory gets closed or some other setting I've just been saving directly to the file then, obviously everything is still in memory. I'm just thinking that save() is running on the main thread
if you expect slow data do it async
Yeah I already save in onDisable and then also whenever a setting is changed.
actually when speeking of speeds, how is it with PersistentDataContainers?
are they cached? or written/read to disk directly
I guess I don't I was just wary of server crashes, since there could become some discrepancies between the world and the config file
Hence you save on a timer
They are cached yeah
How i does my skyblock island regen auto every 5m
@crimson sandal awesome thank you
Oh wait
How i does my skyblock island regen auto every 5m????
I thought you were asking me if my data was cached
I'm assuming they are stored in memory though...
Caching data in memory is no where near as intensive as IO
I would too, just wanted to be sure
Yeah, I use one currently to store a players UUID to a sign.
I am saving game info into a chest at 1,1,1 ๐
why not just save it in memory
Well that sounds peculiar
@dusty topaz https://timings.spigotmc.org/?url=ihuwivihod here you have the timings, @ me so i dont get confused
can't really expand those timings - i suppose it's timings v1 and not v2
@dusty topaz well I have it in memory, I save it there onDisable and load it onEnable ๐