#help-archived
1 messages ยท Page 203 of 1
EventHandler annotation
CMON
you forgot the @EventHandler--
how does this always happen
YOU SON OF A
add
@EventHandler above the method for the event
@dusky sigil
@barren rune poor ev
And pls try early escaping your code...
If ench lvl == 0 -> return
Does anybody know what I am doing wrong with this config and why there is no broadcast? I am using VotingPlugin btw
Cumulative:
'100':
Enabled: true
# Wether or not votes must be made in same day/week
# Useful if you want to require a certain number of voting sites to be voted on
# for a daily/weekly reward instead of all of them
Broadcast: '&a&l%player% &7has voted and received a &3&l[&c&l100th &cKey&3&l]&7!'
VotesInSameDay: false
VotesInSameWeek: false
Rewards:
Messages:
Commands:
- 'cc give p kerosene 1 %player%'
@grim halo wont just doing else with nothing do it?
Its basically the same but this way you prevent
if { if { if etc in your code
cumulative.100.Broadcast is what you're trying to access, right?
Exactly skyy
nvm.
i need help
?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.
also what kind of horrible library is NotNull because im always importing it accidently and it causes like 3000 errors
I have a plugin that just allowed to a default player construct out the spwan, but when i hqave puted the manager group i don't know what i need to do for that the players that join the server can construct out the spawn
I have so many questions about that ^
what plugins you have @frigid ember
AuthMe
AuthMe-5.4.0.jar
6.87 MB
bStats
Citizens
Citizens.jar
2.78 MB
CitizensText
CitizensText.jar
25.39 kB
ClearLag
Clearlag.jar
192.13 kB
Essentials
EssentialsGeoIP
EssentialsX-2.18.0.0.jar
1.58 MB
EssentialsXAntiBuild-2.18.0.0.jar
18.81 kB
EssentialsXChat-2.18.0.0.jar
12.51 kB
EssentialsXGeoIP-2.18.0.0.jar
1.66 MB
EssentialsXProtect-2.18.0.0.jar
25.92 kB
EssentialsXSpawn-2.18.0.0.jar
16.38 kB
FurnitureLib
FurnitureLib.jar
742.26 kB
Graves
Graves.jar
26.52 kB
GroupManager
GroupManager+ [v3.3].jar
124.85 kB
HolographicDisplays
HolographicDisplays.jar
501.01 kB
LockedItems
LockedItems.jar
55.17 kB
Multiverse-Core
Multiverse-Core-2.5.jar
1.65 MB
PluginMetrics
ProtectionLib.jar
51.66 kB
ProtocolLib
ProtocolLib.jar
1.43 MB
README.txt
1.11 kB
Readme.txt
1.04 kB
RedProtect
RedProtect-7.7.2-b357-Universal.jar
1.57 MB
SetSpawn
SetSpawn.jar
17.71 kB
Shopkeepers
Shopkeepers-2.2.4.jar
543.28 kB
SkinsRestorer
SkinsRestorer.jar
7.44 MB
Vault
Vault.jar
265.88 kB
WorldEdit
worldedit-bukkit-6.1.9.jar
1.66 MB
WorldGuard
?paste
wtf
How do I get ?paste
get good
?paste
ok, @frigid ember there is 2 plugins that have permissions for building
Worldguard and EssentialsSpawn
I literally hate 7smile7
whats wrong with 6smile6?
5smile5 is a bully
4smile4 didnt do nothing wrong
3smile3 said get good tho
2smile2 can say that if he wants
ok men im here if you tell me what i can do you help me a lot
men?
1smile1 hasn't responded
smile has no numbers now
laughs in 2 x cromosomes
-1smile-1 is this gag getting old?
yes
frostaff can you help me??
lol
ok
https://essinfo.xeya.me/permissions.html
@frigid ember
Generally Worldguard doeesn't cause issues with default settings
0k,
thank you a lot
l0l
does anyone know what is wrong with this config?
'42':
Enabled: true
# Wether or not votes must be made in same day/week
# Useful if you want to require a certain number of voting sites to be voted on
# for a daily/weekly reward instead of all of them
Broadcast: '&a&l%player% &7has voted and received a &3&l[&c&l100th &cKey&3&l]&7!'
VotesInSameDay: false
VotesInSameWeek: false
Rewards:
Messages:
Commands:
- 'cc give p kerosene 1 %player%'
the broadcast does not work
?paste
It's just this part
no but it floods chat
Ah
is there a way to check if someone owns a copy of a premium resource on spigot? I need this for a discord bot
And how are you gonna link the discord user to the buyer
As not alot of people use same name
they do something like !spigot [username]
can do the same what spigot does @vernal spruce
how can i get the type of a block only? I tried getting the block and doing toString() but i got a rather... Informative output
Too informative
declaration: package: org.bukkit.block, interface: Block
BlockType just returnes the block
or also its
location and all of the other things
Ill try this, thanks
That isn't BlockType. The method I linked returns the Material of the block which indicates its type of block
well as long as it worked lol
@Override
public void run() {
loc.add(loc.getDirection());
if(loc.getBlock().getType() != Material.AIR) {
cancel();
LOG.info("le shoot");
}
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}}.runTaskTimer(Bukkit.getServer().getPluginManager().getPlugin("StaffWeapon"), 0L, 1L);``` halp
it only runs once
how can i add a block's drop to it?
oh yeah thats gonna cause lag btw
lots of lag
BlockPure.getDrops().add(new ItemStack(Material.getMaterial(BlockPure.getDrops())));
im trying this but it doesnt work
Block BlockPure = event.getBlock();
this is blockpure if it matters
i just want to add to a blocks drop what it drops
can use dropNaturually(ItemStack) method
for example, add a diamond to a diamond block
however, the proper way if you want to just generically add to the drops, you would modify the LootTables
if(loc.getBlock().getType() != Material.AIR) {
cancel();
LOG.info("le shoot");
}
@tiny dagger but the block is air
how can i use dropNaturually do do this?
.runTaskTimer(Bukkit.getServer().getPluginManager().getPlugin("StaffWeapon"), 0L, 1L);
didnt know that was even possible
you can get any plugins instance so as long as it is loaded
Do i have to hard code every block into this?
every block that drops something anyway
that isnt itself
getPlugin() is slower than dependency injection
Depends on what you are trying to accomplish. If you really want to just add stuff to their drops and not have to worry about it later
then I recommend modifying the LootTables
I really dont care how the item gets there
I want to add what a block drops to its drops
so.. it drops more
Can i multiply a block's drops?
Then simply spawn the block type you broke on top?
However there are some wich need theyr own
declaration: package: org.bukkit.loot
spawn another block??
there is all the packages in regards to modifying loot tables and loot for various things
I dont want to modify it forever
Its a random thing
kinda like fortune
...but different
man, im speaking nonsense today
up to you how you want to go about it. All I can do is provide you information to possibly use to your advantage to accomplish your goal
like block.getloottable.populateloot?
Yeah, you said
can use dropNaturually(ItemStack) method
and i dont really understand what you meant?
As seem to return a collection of itemstacks
that method
spawns a item at the location
having a Itemstack with a block's drops would solve this
items can be dropped from blocks that are broken/mined by using that method to add the extra item to its drops
however it isn't permanent in adding that drop
is this how i sound?
damn
no, i kinda get what youre saying
but once again
i want to add another drop which is what the block drops
bits
not just the same item
buts
Then you can use a case statement to determine which you want added
so hardcoding everything?
look, between the various methods given to you, and some Java it isn't all that hard to code what you are wanting
Hello ;)
I'm a plugins maker with Skript and a problem appear on 1.16.
With paper, everything work good. But with normal spigot, every NBT are very buggy (no error appear)
Doesn't necessarily need to be hardcoded
but it does depend on your level of understanding of Java as well
1 more of its drops
for example
a diamond block drops a diamond
i want to add another diamond
to its drops
but make it so if it was a coal block
i would add coal, not a diamond
if you're using Skript, I'd ask somewhere that specializes in Skript support
you would use a case switch statement for this
or you could make use of Enums
Enums are pretty handy as you can add quite a lot of things to a single enum
to do things if it matches your enum
I personally use Enums for dynamic permissions ๐
can I make a resource hidden on Spigot?
You can even use Enums for dynamically using classes depending which MC version you are using as well ๐
so Enums are handy if you know how to use them ๐
Block b = event.getBlock();
for(ItemStack i : b.getDrops()){
b.getWorld().dropItemNaturally(b.getLocation(),i);
}
}```
noice
love the name of that method
multiplys the drops
if you're using Skript, I'd ask somewhere that specializes in Skript support
@wise flame It's not a bug with Skript. It's a NBT tag caused. Every thing in the Skript work fine. Just the NBT are not loaded fine on spigot I think
ezy
renaming my now
wait a secend
Stellrow origins
you already asked about this
๐ค coincidence?
there was a bit more advanced
as i had to get the drops as well affected by fortune
fkng magicnumber
?paste
I have a plugin I'm getting ready to upload but the update checker is gonna need my resource ID. Can I somehow upload and hide it or get a resource ID without uploading it?
@Override
public void run() {
loc.add(loc.getDirection());
if(loc.getBlock().getType() != Material.AIR) {
cancel();
LOG.info("le shoot");
}
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}}.runTaskTimer(Bukkit.getServer().getPluginManager().getPlugin("StaffWeapon"), 0L, 1L);``` this only runs once but i have another piece of code which functions aas expected
always nice to learn new things? ๐
why are you running that every tick?
not sure why i even needed that
why are you running that every tick?
@wise flame its agun
m8 that runnable will kill ur server
^
to be more specific this part for(Entity ent : getEntitiesByLocation(loc, 0.545f)) { if(ent instanceof LivingEntity) {
also i dont think u know how fast will that proc
((LivingEntity) ent).damage(10, me); will happen 20 times in 1 second
You're running that 20 times per second forever
That's faster than an IRL machine gun
yeah, watch out
anything who dares to touch that instantly dies
They fire like 500-1000 rounds/min. That's 8-16 rounds/second
as a player has like what? 20 health
that is literally overkill
holy shit dude its been 5 years and i still have to search on google for the color codes
m8 that runnable will kill ur server
@vernal spruce ive used it and it doesnt
and also thats for the bullet
not the fire rate
its actually slower then a bullet
because you cant run something 3000 times per second
and also i originally had it at 20
i tested it
and how lovely were the tps
and spammed it
did you run /tps
tps were okay
although this code that im showing didnt work
because it only ran once
cause once again ur calling cancel
meaning that the "bullet" only moved 1 block
cancel only gets called when the block it is in isnt air
Wait i was gone. Do you guys speak about firearms? Pls i want to see some code ๐ i made a pretty nice engine for a server that implemented actual physics for projectiles with hiutboxes, air resistance, gravitation etc
and the other code worked with the cancel
@Override
public void run() {
loc.add(loc.getDirection());
if(loc.getBlock().getType() != Material.AIR) {
cancel();
LOG.info("le shoot");
}
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}}.runTaskTimer(Bukkit.getServer().getPluginManager().getPlugin("StaffWeapon"), 0L, 1L);```
not a gun though
can you please use a paste service
can be used for a gun
?paste
and i only use paste service for stuff over 2000
the point is that you don't flood chat
lol
if you want to not do anything when you encounter air, use return;
@hollow thorn
wait
no i want it to stop continueing the event when not encountering air
because its a repeating task
But what do you expect to happen with this code?
the location moves forward every tick doing damage to nearby entities
or you could send out a straight line from the gun and everything along that line gets damaged
that removes the ability for entities to doge
and i used to do that
it caused alot of damage
didn't you say you wanted it to be like a bullet?
hmm when i created a bullet
it was a lightning fast snowball
wich eventually losed velocity
I want to keep an entity at the location of another entity*
Yes you need a timer that ticks up and a hard limit.
mate
i also noticed that increasing the velocity of a snowball too extreme
starts to no longer go straight
also when the player moves
@frigid ember PlayerMoveEvent
in one second, a realistic bullet would travel at 23m/tick. That's 23 blocks every single tick.
math: (460 / 20) / 60
So in a single tick, it'd be traveling over a chunk's distance
unless your map is f*cking huge, I don't think there's a point in having visible bullets if you want them to go hella quick
so its not that easy to figure out a bullet trajectory
i mean you dont have them in minecraft
i guess bullet falloff can be added
so it doesnt one shot you at 200blocks away
no thats a stargate staff weapon
if you look in the code the projectile is a blaze particle
Ok but i would really not create a runnable per projectile...
And all this code needs to get encapsulated. If you want to do something like a projectile then you need to be cautious.
With this implementation if a player shoots in a random direction then the world will load every chunk in this direction until the server restarts.
10 shots like this and your tps are gone.
fair point
no we get that
yes
no one said not to use runnables.
We're saying you're going to brick your server if you make a new runnable for every single bullet that runs every single tick
huh?
can you send pastes that show the working one and the broken one?
?paste
"Table 's16892_skyville.vite' doesn't exist"
The error is saying otherwise tho
@hollow thorn Have you checked if your cancel() line is getting called accidentally?
@hollow thorn Have you checked if your cancel() line is getting called accidentally?
@wise flame doesnt seem to be
Is this a reliable way to check if a class implements another class?
currentEvent needs to implement the Event interface for it to set.
public void setCurrentEvent(Class currentEvent) {
for (Class<?> classInterface : currentEvent.getInterfaces()){
if (classInterface == Event.class) {
this.currentEvent = currentEvent;
return;
}
}
return;
}
Oh, so I'd just need to check if currentEvent instanceof Event
Inconvertible types, I'll try the assignable method
I have a custom worldgen that creates a huge desert, but the debug menu and the weather shows that the biomes still exist underneath. One of the plugins I'm using uses them for temperature effects, so I'm looking for a way to globally change the biome to Desert.
I'll try like this this.currentEvent = currentEvent.isAssignableFrom(Event.class) ? currentEvent : this.getCurrentEvent();
preferably as a one-shot thing, the world is already generated.
check to see how world edit does it
btw what does online mode mean help
whether or not you use mojang auth servers
wait wat
if it's set to false, people who didn't buy the game can join your server
I'm more looking for an existing solution, since I'm not up to writing plugins myself just yet. Is there maybe an offline editor that can change the flag across all chunks?
if it's true, only players who have bought the game can join
btw you can't use instanceof on a Class because it can't be an instance of a class
did you buy the game?
yes
are you sure you're logged into the launcher?
yep I am
have you tried logging out then logging back in?
I used localhost
I assumed because they were talking about online mode, the server denied them
I'd say try logging out then back in. If that doesn't work, restart your computer.
could that be a problem....
huh?
entering localhost
if you're just testing your plugin or something and don't have port forwards or anything, I guess you could disable online mode
btw I'm using bukkit + bungeecord
should still be the same
you managed to connect right?
what?
@hollow thorn Ok i wrote a quick simple implementation for very basic projectiles. If you want you can look at it.
I think it will give you a general idea on how to work with clean tasks.
https://www.youtube.com/watch?v=nIR68LhUGWA
Its literally only 3 classes.
Is it possible to find out if player is clicking forwards/backwards/left/right?
So basically impossible
Not impossible. Just depends on your definition of forwards/backwards/left/right
the actual buttons
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
whats this
Ohh ok. So you mean key presses? No you cant get key presses in spigot.
Your best possible bet would be having your players bind like 7, 8, 9, and 0 to another set of keys and checking for hotbar slot changes, but that'd probably be pretty jank for most applications
i already made a working "engine"
its just that one projectile isnt working while the other one is
@frigid ember What are your general TPS? How much ram do you have?
I mean I just want to check if player is moving forwards, backwards, left or right without checking velocities because they may be inaccurate when player is in water or piston pushes player
are you allowed to compare materials with ==?
Yes. All enums are constants. .equals() internally just uses == (in Enums!)
So using == is one method call less. You normally compare enums with it.
new BukkitRunnable() {
@Override
public void run() {
vehicle.teleport(entloc);
}
}.runTaskTimer(this.plugin, 0L, 1L);```
what is it with you people and not using camel case
So Im teleporting the vehicle to the entlocation the time a player is on a horse
@frigid ember What are your general TPS? How much ram do you have?
@grim halo 30 GB Ram, 20 Tps
19,98
do I make a hashset with a long and a for-loop for the time a player is on an entity
or is there an easier way
for the time a player is on an entity
Are you timing them?
I'd go with a HashMap that stores a player and the horse and add/remove their entry whenever they get on/off their horse
hash UUID, Long
wdym long?
wait what are you timing exactly?
the time they're on the entity/mob
oh so you want to see how long they've been going
well, if the HashMap doesn't contain something, you don't need to execute it. You could forego a timer and just remove the player from your hashmap when they get off
unless you need to time it
hmm. a HashMap is faster than a List, so I'd say to make a HashMap with the player and what they're riding (don't forget to handle what happens when the player goes offline). Add them to the hashmap when they get on, remove them when they get off
Just make the timer check the hashmap
or HashSet
and store UUID only
idc what theyre riding xd
and check if the uuid is there
that'll do it I think
thank you
๐
HashMap is faster
and if it's running every tick that might be moderately important @frigid ember
how do I
do I need onlinemode for the bungeecord server and the the minecraft servers or wat
can I turn off onlinemode for the minecraft servers and keep the the onlinemode on for the bungeecord server
BungeeCord should be online
I'm using bukkit servers and bungeecord
...well good luck running that
waddayamean?
...its like driving a ferrari witha volkswagon engine...compared to using spigot
and?
you should probably run Spigot.
idfk
honestly
I'm pretty sure spigot and bukkit aren't that different
but again idfk
...trust me they are
can I turn off onlinemode for the minecraft servers and keep the the onlinemode on for the bungeecord server
is it a yes?
.......
HELLO?
....I went deaf when you yelled did you say you wanted tacos?
Burritos?
can I turn off onlinemode for the minecraft servers and keep the the onlinemode on for the bungeecord server
seriously I already answered read chat
pls just yes or no???
private final HashMap<UUID, Entity> storedNames = new HashMap<>();
storedNames.put(uuid, ent);
new BukkitRunnable() {
@Override
public void run() {
for (storedNames.containsKey(uuid)) {
vehicle.teleport(entloc);
}
}
}.runTaskTimer(this.plugin, 0L, 1L);```
@wise flame
for (storedNames.containsKey(uuid)) expected ;
https://paste.md-5.net/efapivewul.cs please help
for(UUID currentUUID : storedNames.keySet()){
}
oof ty
?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.
also @hollow thorn donโt ask us whatโs wrong tell us whatโs wrong.
read the error๐
also @hollow thorn donโt ask us whatโs wrong tell us whatโs wrong.
@balmy sentinel with that the first piece of code doesnt work while the other one works
whats the error
Why doesnโt it work tho whatโs the error youโre getting?
the first one only runs once while the other one runs normaly
why can I not connect to the bungeecord server when it's in online mode, it just says ReadTimeoutException:null
Why does PersistentDataContainer#getKeys() show up with a red underline saying that the method does not exist?
?help why can I not connect to the bungeecord server when it's in online mode, it just says ReadTimeoutException:null
?help
?ask why can I not connect to the bungeecord server when it's in online mode, it just says ReadTimeoutException:null
?ask
Geekazo
proxy must be in offline mode
if im right
regular servers should be in online mode
@lapis kestrel getKeys isn't a static method. You need to have an instance of the class to use it.
can be in offline mode but thats not smart
will ruin skins, can't access UUIDs, etc
i am using an intsance
when was getKeys() added?
Spigot runs perfectly fine in offline mode behind a properly configured bungeecord server
no
I am telling you if your running a network you dont want the connection between bungeecord and spigot encrypted
This is a copypasta from reddit that explains it ```Essentially, when a server is in online mode, the connection between the server and client is encrypted. Additionally, you get a session key/code when you press the join button on the home screen, which can be essentially "redeemed" for one online mode login.
Now let's say we have a proxy between the client and the server - firstly the connection between the client and the server is encrypted so the proxy can't listen in to, for example, process commands, and secondly the proxy can't switch you between servers because your session key is only valid for that one connection.
Bungeecord therefore requires offline mode to get around this restriction. However, this shouldn't cause issues with plugins if you have IP forwarding enabled. What IP forwarding does is, Bungeecord authenticates the user with mojang then adds a special packet to the login protocol that says "I'm Bungeecord, trust me, I've authenticated this user as UUID xxxx", where xxxx is an online mode, mojang issued UUID.
This means that the spigot server then trusts that this is the player's UUID, and as far as the plugins are concerned the server is in online mode and the players have valid UUIDs. All you need to do to make this work is enable ip-forward in Bungeecord's config and enable bungeecord: true in spigot.yml```
dude...
sorry people need to lear
also donโt have side conversations here if you donโt have a question take it to #general
@hollow thorn post your whole class please
@proud furnace all theyโve given us is the top part doesnโt work and the bottom does. Also that the top only works when the bottom runs successfully
wait does bungeecord not work with bukkit?
the top part only runs once then stops
and its NOT bukkit
according to them
yes
Spigot and all of its forks
spigot/paper/sponge/prob others
and just not bukkit
...you cant run bukkit
Spigot is a bukkit fork, all of your bukkit features are on spigot
thats not exactly true
ok craftbukkit includes craftbukit package
you can run CB from the spigot buildtools
who cares
but its a bad idea
so wait
CraftBukkit is the server side of Bukkit, bukkit is the API
And it's not dead at all
if I switch to spigot do I need to relearn anything?
bukkit's API did not update in 5 years or when did it die
honestly dark its updated
Hey guys, just joined. Haven't ran a server for years. I have a quick question, is it better to rent an entire server, e.g. having access to install/host different things than solely minecraft or rent a server which runs an online panel?
...but it wont be after 1.15
Dark, without bukkit you can't get spigot
i know?
is bukkit faster or is spigot faster or are they the same and I'm an idiot?
md_5 maintains spigot not bukkit
Spigot is faster

We can't really talk about performances like that, performances come with abandons
i'm just saying available options
wat
well you forgot Tuinity
Paper scarifies some Minecraft vanilla features
also what does hypixel run on
fork of spigot
or does hypixel use it's own
@jeff doepends on what you want to do
ยฏ_(ใ)_/ยฏ
it's heavily rewritten so i don't think it's suitable to say that they run craftbukkit
@silver basin As of now just a factions/pvp
Hypixel doesn't communicate its infrastructure. Can be spigot can be something else
You could just go with a cheap / free hoster to start with
I expect to have about 50 people playing at high times
well you might need to upgrade froma free machine
I used to run a server through my own VPS so I'm out of touch
waddafaq
@odd seal start with a vps
what do most servers use? spigot?
Spigot and Paper are mostly used
2b2t runs on paper
@silver basin How much players do you run
it runs on paper yes
this is a mess
anywhere from 5-90
oh
@silver basin Where do you host
OVH
why.
ovh or hetzner seem the best
@odd seal if you are planning to use proxy plus a server, i recommend buying ovh + hetzner
hetzner is pretty cheap
hetzner being proxy?
All depending on your location, and budget
no
hetzner being backend servers
hetzner does not provide anti-ddos, so it's not the best solution for things such as proxies
(honestly i don't think that OVH's antiddos help lmao)
it does
@silver basin Do you use https://www.ovhcloud.com/en/vps/uc-vps-minecraft/
mhm maybe.
but then it does depend on you pay for
yeah and i don't think that you pay 5000$ for each machine
Can't you route traffic through Cloudflare?
so anti-ddos sucks
@odd seal no
it's paid
and iirc it's for big boys such as hypixel
yeah and i don't think that you pay 5000$ for each machine
@spring arch By this you mean a machine to run server on?
we do have a couple of cloud but we have a couple dedis as well
@hazy wadi yes
OVH provides dedicated servers, so each server is on it's own machine
imagine being so good u make ur own anti ddos
nahhhh
@hazy wadi yes
@spring arch You can run it off any computer you donโt use wonโt affect performance. For others anyway..
lmao
lol
did you try?
the key is bandwidth and cpu, do you have both of it to run on your own machine?
...and memory
ofc
Hmm but memory is cheap.
^
unfortunately minecraft likes fast cpus....
everything likes fast cpus
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Yea, there are some clients and profiles that can lower it.
more or less
the problem is that minecraft uses only 1 thread for almost everything
thats how @strong lantern
lol
well
there was one fork that supported parallel world ticking
but it's dead too
lol
If you are running a PC purely for the host of a server then maybe pay ยฃ20 for a client and that can make minecraft unplayable for that PC but runs amazingly for others.
I like playing on 5000 tickspeed.
well core threads an not infinite
Well you see some clients can reduce the strain on the machine by making the game shit meaning itโs better..
pff tell that to threadripper
๐
infinity and beyond
well tbh there is actually one mod that can reduce cpu load on client, yeah
Yea.
Minecraft be like hmm today I will exist on one thread if I go outside that thread I'm breaking the rule so I won't go outside that thread and I'm going to stay on the thread
i mean tehnically you can stop everything from loading
chunks/entitys/items/inventory/particles
^
Yea itโs okay..
wait wat is buildtools
Iโm waiting for my new PC to come canโt wait.
names get comfusing
it's a tool that build stuff
@spring arch You donโt say ๐
well optifine begins to lose against sodium
benchmarks or source?
if sodium will get shaders and all stuff like that
optfiine will be dead
yeah there was benchmarks already
Hmm I have always liked optifine.
@strong lantern read the wiki
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?bt
no Buildtools will build Spigot on your machine
its possibly illegal to distribute it any other way
so how do I run a spigot server
it is illegal
buildtools will compile a server.jar for you
wich is basically the server
read the goddamn page Geek
What was that one program that let you edit minecraft worlds?
not mcedit/worldedit
but a standalone program
ah
Is there any way to create a dragon battle on the fly?
@strong lantern Download java 8 from the oracle site
@wheat mirage see DragonFightManager
@spring arch NMS class?
yes
@spring arch doesn't exist
it's mcp naming
You're better off downloading java 11 now.
or java 14
EnderDragonBattle
@wheat mirage
Call EnderDragonBattle#e, it will start a dragon battle
plus it will respawn crystals if it's needed
the only thing you need to remember is that EnderDragonBattle is ticked only in the end dimension, so you have to do that yourself
@spring arch Do I need to instantiate myself?
yes
Or is world#getDragonBattle always non-null?
it's only nonnull in the end dimension
This will return null if the EnderDragon is not in the End dimension.
so you need to do everything on ur own
@spring arch I only need it in the end dimension tbh
So that's good news for me
Thanks though
then it's non null, yes.
you can
Not with Spigot API
If it's easy enough to do I may PR it
there might be a workaround but only if dragon did not die before
Yeah very true
like changing dragon's position before it dies
whats wrong with this? java @EventHandler public void OnMine(BlockBreakEvent event) { Player p = event.getPlayer(); ItemStack item = p.getInventory().getItemInMainHand(); if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) != 0) { int FLevel = item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS); File file = new File(getDataFolder(), "blocks.yml"); FileConfiguration cfg = YamlConfiguration.loadConfiguration(file); String block = event.getBlock().getType().toString(); Block BlockPure = event.getBlock(); int drop = ThreadLocalRandom.current().nextInt(1,3); if (cfg.getString("blocks").contains(block)) { if (drop == 1) { double add = FLevel / 2; add = Math.floor(add); add = (int)add; while (add > 0) { BlockPure.getDrops().add(new ItemStack(Material.getMaterial(block))); p.sendMessage(drop + ""); add = add -1; } } else if (drop == 2) { int add = 1 + FLevel; while (add > 0) { BlockPure.getDrops().add(new ItemStack(Material.getMaterial(block))); p.sendMessage(drop + ""); add = add -1; } } } } else { return; } the block config works, and the numbers still print, but it doesnt add to the drops
I mean @keen compass considering J11 is the next/current LTS i'd rather not recommend a dev build.
getDrops is broken iirc
it is?
iirc
He s not even using it.
so i need to use dropnatrually?
yep
k, gotcha
does anyone here have experience with the reflections api?
don't use reflection
savage today man
i use it to register commands but it's being a pain lately
use java.lang.invoke
it doesn't work with two different plugins running reflections
one breaks the other stays fine
what do you mean
so i have two plugins
registering commands with reflections
to the commandmap
getting every command class in a package that extends an abstract class
two different plugins, two different abstract classes, etc.
so one plugin
registers their commands fine with reflections
if i disable that plugin and reload the other plugin, then that other plugin registers its commands fine
so both plugins are like "fighting" in a way to register their commands
and only one wins
Is there a way to check each class in a package?
it's not registering commands, it's the reflections api
@ashen stirrup yes
it uses reflection to get command map
How would you do that ๐ค
Reflections reflections = new Reflections("gg.socks.hub.command.impl");```
like that
oh ay
[11:36:16 WARN]: Unable to resolve BlockEntity for ItemStack: minecraft:spawner
[11:36:16 WARN]: Unable to resolve BlockEntity for ItemStack: minecraft:bee_nest```
get outta here reflections ๐
why do these occur?
are you running a spigot server with a higher version than your api
who are you asking?
ClassPath.from(this.getClass().getClassLoader())
.getAllClasses()
.stream()
.filter(info -> info.getPackageName().startsWith("my.package"))
.map(ClassPath.ClassInfo::load)
why is this? dropItemNaturally(new Location(BlockPure.getLocation()), new ItemStack(Material.getMaterial(block))); not working? error The constructor Location(Location) is undefined Main.java /Mining/src/net/FlashPlex/Mining line 71 Java Problem
why would you wrap location into a location
ClassPath doesn't have the from() method ->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0</version>
</dependency>
guava 10
@bold anchor Java 14 isn't a dev build
the fuck
The method dropItemNaturally(Location, ItemStack) is undefined for the type Main Main.java /Mining/src/net/FlashPlex/Mining line 71 Java Problem
It's not a lts build either
is it normal for guava to not find any classes n my package lol
final ClassLoader loader = Thread.currentThread()
.getContextClassLoader();
try {
ClassPath classpath = ClassPath.from(loader); // scans the class path used by classloader
for (ClassPath.ClassInfo classInfo : classpath.getTopLevelClasses("com.taahyt.utilities.command.impl")) {
System.out.println(classInfo.getName() + " : " + classInfo.getSimpleName());
}
} catch (IOException e) {
e.printStackTrace();
}```
you are doing it wrong
it returns a server's class loader
o
not class loader of your plugin
ohh
@bold anchor do you know what it means for something to be LTS?
Oracle says that
LTS doesn't matter unless you are an enterprise really
it depends on how much time they support JDK
wait so- it would be...
Long term support.
@bronze acorn plugin.getClassLoader()
o
i have another error```
The method dropItemNaturally(Location, ItemStack) is undefined for the type Main Main.java /Mining/src/net/FlashPlex/Mining line 71 Java Problem
Considering J11 is the current LTS choosing that over J14 for their MC server would keep them fro mhaving to update to a newer version all the time. (except for patching current version)
Of course J14 has better dev methods like that fancy switch
lmao i was typing final ClassLoader loader = Utilities.get().getServer().getClass().getClassLoader(); xd
yeah just because it is long term support, doesn't mean magically later builds are not also supported. They are just not supported as long as LTS, which means support services in most cases other then updates.
@dusky sigil the compiler says what's the error is
@spring arch what do you mean by that?
ahh there we go โค๏ธ
it means that method you are trying to call does not exist
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#dropItemNaturally(org.bukkit.Location,org.bukkit.inventory.ItemStack)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#breakNaturally(org.bukkit.inventory.ItemStack)
@dusky sigil
declaration: package: org.bukkit, interface: World
declaration: package: org.bukkit.block, interface: Block
so it would look like:
final ClassLoader loader = Utilities.get().getClass().getClassLoader();
try {
ClassPath classpath = ClassPath.from(loader); // scans the class path used by classloader
for (ClassPath.ClassInfo classInfo : classpath.getTopLevelClasses("com.taahyt.utilities.command.impl")) {
if (classInfo.getSimpleName().endsWith("CMD"))
{
UtilityCommand command = (UtilityCommand) classInfo.load().newInstance();
getCommandMap().register(Utilities.get().getDescription().getName().toLowerCase(), new BlankCommand(cmd, Utilities.get()));
utilityCommandList.add(command);
}
}
} catch (IOException | IllegalAccessException | InstantiationException e) {
e.printStackTrace();
}```
And then assuming this would work:
public void loadEvents(){
try{
ClassPath.from(this.getClass().getClassLoader())
.getAllClasses()
.stream()
.filter(classInfo -> classInfo.getPackageName().startsWith("me.straggly.core.eventcore.events"))
.filter(classInfo -> classInfo.getName().contains("Core"))
forEach(classInfo -> events.add(classInfo.getClass()));
} catch (Exception e){
getLogger().log(Level.INFO, "An error has occured:");
e.printStackTrace();
}
}
@bronze acorn yes
@ashen stirrup
ClassPath.from(this.getClass().getClassLoader())
.getAllClasses()
.stream()
.filter(classInfo -> classInfo.getPackageName().startsWith("me.straggly.core.eventcore.events"))
.filter(classInfo -> classInfo.getName().contains("Core"))
.collect(Collectors.toCollection(() -> events))
Would mine not work? or is that just more efficient?
thanks a bunch dark it works great โค๏ธ
how do I even find the JDK 8 install file?
Did the minecraft:spawner change as an item from 1.15.2 to 1.16.1?
spawner is a block iirc
is www.java.com the official site where I can get java
yes
is it no longer minecraft:spawner for the block entity?
What for do you want java? Development ?
spawner is the material @spring arch
it's the official site?
@strong lantern yes
now, was it minecraft:spawner in 1.15.x?
believe so
This is also a great tutil to look for classes and shit https://code.google.com/archive/p/reflections/
No the official really one is the oracle.com one @strong lantern
so, in theory, if I store an itemstack serialized in a database and upgrade from 1.15.2 to 1.16.1, any BlockEntityTag itemstack such as in a ShulkerBox that were based on name from 1.15.2 for minecraft:spawner would throw that warning.
Java dot com safe but you probably better upgrade to java 11 or 14
Reflection is not terrible lol
It is quite useful in the correct usecases
If you want something "faster" but also reflection use this https://github.com/EsotericSoftware/reflectasm
Makes "false" classes to run the methods.
what the hell
Reflection can be useful, but a lot of people use it for the wrong things
thanks @undone narwhal
Reflection isn't terrible if used for the appropriate purposes
most people tend to use reflection when it isn't even needed
Reflection uses that internally
hueheu "appropriate usage" https://github.com/JanTuck/TwerkTree_/blob/master/src/main/scala/me/jantuck/twerktree/suppliers/legacy/LegacySupplier.scala /s
Yeah, that's the problem. Never use reflection if there's another way around it
first N invocations are done through JNI, then it's optimized
even tho it's still slow due to security checks
and tons of runtime checks
which are avoided if you use method handles
plus JVM can inline method handles.
abstraction
to an extent, depends on the methods used in there
abstraction requires effort
seriously? do I rlly need a fricking oracle account?
not cool
no.
yes
wait what it was easy for me? unless i did it wrong lol
to download jdk 8 - yes
JDK 8 is outdated
outdated builds require an oracle account which is free to create
it's still used tho