#help-development
1 messages · Page 1463 of 1
typing same thing twice isnt spam tho lmao
there may be typos
@queen dragon go die
Bot makes the rules, not us
YAGPDB.xyz i think
xxxEliteBotCoderxxx42069
yes the bot wrote itself
oh its botlabs.gg
is there any API for finding the spawn egg for a given entity
weird question, is it possible to run a line of command with an argument of a command? like
/testCommand player.sendMessage("hello");
thats who made it
yes but u would have to parse it yourself
i think
wdym parse it
i don't think there is anything to find
all the spawn eggs are the same item with different meta iirc
could be wrong ig but iirc that's the case
there might be a thing to translate a string to java and execute it but i dont think u really should do that
what does this do?
if (plugin.getPlayersWantingLock().remove(event.getPlayer().getUniqueId())) {
event.setCancelled(true);
container.set(key, PersistentDataType.STRING, p.getUniqueId().toString());
blockState.update(); //apply the lock!
p.sendMessage(ChatColor.DARK_GREEN + "Locked!");
} else {
String lock = container.get(key,PersistentDataType.STRING);
if (lock != null && !lock.equals(p.getUniqueId().toString())) {
event.setCancelled(true);
event.getPlayer().sendMessage(ChatColor.RED + "You cannot open this!");
}
yea i made a method for the static field
it checks whether the player set has the player's UUID in it
and if it is there, it removes it, and returns true
who needs that tho also its unsecure if u had it
if it is not there, it doesn't remove anything, and returns false
any one with the permission to that command would be able to execute any java code
im not doing anything related to that, im ust wondering if its possible, like a command that runs a line of code so you can test stuff idk
probs
but if you keep the uuid inside the set the command will be executed again? (in my case it was)
ow
if it is not in the set, it cannot be removed because there is nothing to remove
remove returns true if something was actually removed
false if there was nothing to remove
yea i understand
if there is a case in which locking a container would fail despite clicking on it
f.e if it's locked by someone else already
then we would have to check with contains and then optionally remove if we do indeed lock something
but since this code doesn't do any such checks, we can check-and-remove in a single operation
how do i access a plugins instance again? i putted it as arguments in the constructor but it doesnt work
wait apparently i saw this https://docs.oracle.com/javase/9/docs/api/javax/tools/JavaCompiler.html and apparently u can use it to run java code from a string 👀
show me what you have
Isn't the java compiler only available in the oracle java version
Which is now behind that juicy juicy paywall
i think so
i should look into asm at some point
i found this ? https://datacadamia.com/lang/java/dynamic
do i need to make a method that returns the plugins instance in the main class?
this.plugin refers to a field named plugin on this object
do you have a field named plugin on this object?
u havent created a field named plugin
;-;
ow wew i have it in the main class so do i need to set a getter for it?
forgot it
this is a different class
this is a different object
whatever is happening in the main class, we don't care about it
i had it static
private static MagmaBuildNetwork plugin;
@tardy delta learn java
learn bukkit*
this is java and oop 101
uhu and now?
again we run into the issue that you're not thinking with an object oriented mindset
java is easy
i don't really know what to do about it
its just hard if u never used it before
it is very simple and very natural once you get it
its more easy than python i think tho
python is easy
just getting it seems to be difficult for some people
java not so much
eh for some people
sometimes not even explaining everything 10 times over makes someone get it
you need one of those lightbulb moments to happen in your head
and then it all just clicks together
well i'll do it tomorrow
python:
print("hello worldW)
java:
25 lines of code
:/
its one line
for java
;-;
i hate it that python doesnt use {}
the rest is just to know which class is the main class
and i dont think u need to do a public class Main() {
but idk
classes is basically namespaces
well package; is more like it
kinda
idk
and u have to specify the package so java knows where its at idk why i guess its just how it works
but printing in java is one line its just the file isnt gonna be one line since the programming language is meant to be more compilated and be able to do more things
python cant do half the things java can do ( i think )
nah python can do a shit ton of things, just not this kind of things
you cant code a plugin with python
but you can automate stuff
java is more powerful than python
also isnt slow as crap
java is also crossplatform tho idk if python is probs is
i feel like they’re both situational
the best general language is probably c++ or something like that
ye cpp is much faster than every other language
but i mean it isnt really that crossplatform
true
that depends on what its doing
i think every language is better or worse in each situation it just kinda depends what you’re doing
"much faster" kekw
also depends on how u code it but its mostly faster than other languages
pyhon is one of these languages that are "jack of all trades, master of none". It does everything it possibly can but it isn't necessarily the best
ngl the cpp usecase is probably either OS or intense graphics
cpp is easier to learn 🙂
other than that, kinda useless for what it wants to do
no
how so?
cp+
well it isnt as easy than java cuz java has javadocs and a bunch of tutorials
theres no official thing for cpp
cp-*
c++ also has documentation
since when
i think you missed the joke imaginedev
oh
nope
but it isnt as easy to navigate and read as the java docs smh
i mean most programming languages are made in c/cpp lol
If you know 1 c-like language, you basically know the ins and outs of all other c-like languages. Java, C, C++, C# even JS & TS all share similar syntax, making it easier for developers to use the basics of each of the languages. If you were to do Python however, there's not too many languages out there like Python (except R & Haskell)
what
what programming language is "made in" c/cpp lmao
you write a compiler for the language in it
isnt java made in c
no isnt jvm made with c
hotspot jvm is c/assembly
what was that jvm called that was written in java and compiled by java for java
the python compiler is made with c i think
oh right
Python has 2 main implementations. C implementation and .NET
GRRAAAAL
pretty garbage
wtf why
try set? dunno
because surprisingly the c/cpp code base of hotspot jvm is, like half the cpp codebases, udder spaghetti
or perhaps setProperty
they can't even expand on the C2 JIT anymore because of how legacy it is xD
is hotspot jvm... jvm or no
i just call jvm jvm XD
your mom is a jvm
eh just call them all jvm its easier
jelly vore mountain
😦
no yours
ah, yeah hotspot jvm is your "jvm" then
is all purpose flour for all purposes
hotpot
caching is hard
clear caches and restart
i don't know, ask some eclipse guy
ok
or use google
I use IntelliJ as it’s got a better layout preferably
Project menu -> clean
Anyone know how i can add a fake glow to a itemstack?
else right click pom -> maven -> update project
Explain what you mean
like glow without the lore
intellij best 
Add a enchantment and the. Hide it using item flags
you mean enchantment glint?
yeah
Pretty sure they only way is to add an enchant and then hide enchants
^
ask someone 7 years ago
enchant it with some random enchantment, and hide it from the lore
ok thanks
There is another way but it’s not recommended
You used to be able to just set the enchantment array to an empty array
But I think the client checks for that now
im using 1.7 so idk if the client would check
Oh wow
Did the hide enchants flag even exist in 2014
TF
im sure it did
I may not be able to help you 😂
same tho. probably almost no one here knows how it worked in that old ass versions lol
Is development being done for spigot 1.17 yet?
Yes
Is there a way you can see the progress?
I’ve never made a api myself so I would love to see the back ends of it etc
Ah ok
MySQL is so damn dumb
mongodb is better
i sadly cannot switch, because the database is provided by my server-host
that are general auto db's i think
you can always get a free one online
cancel the damage event, if the damage source is fall damage
Something something don't store relational data non relational
but yeah hosting it yourself would definitely be better
i wouldn't store my client's data on a free db tho
yeah
my problem is just... it produces lag spikes everytime i save/load something into/from the db. maybe i'm just using it wrongly
but i dont think so
mongo db is WEB SCALE
means? lol
Are you doing it sync
any DB will produce lag spikes if you do it wrong
i guess
a db may not be located on your system, and even if it is, it may not be in-memory
public void setCosmeticEnabled(UUID uuid, String cosmetic, boolean enabled) {
try {
PreparedStatement ps = connection.prepareStatement("UPDATE " + cosmetic + " SET ENABLED=? WHERE UUID=?");
ps.setBoolean(1, enabled);
ps.setString(2, uuid + "");
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
any DB requests you make should be asynchronous
because they may take a very long time to complete
thats not spigot btw
Cache things
from several milliseconds to like several seconds if the connection times out
and on the main thread, even half of a millisecond is a very, very long time
so... probably dumb, but i tried to do that on another thread. but 1: everytime doing like new Thread(() -> { //save data })
is probably very dumb.
and loading doesn't work, because i cannot use return statements in those.
and my small-brain doesnt know how to do that i think
use a bounded thread pool and/or completable futures
the thing with using a database is that you need to design your shit in a way that it doesn't explode if the GET ME THIS THING doesn't happen this instant
that literally looks so complicated for my brain
because i cannot use return statements in those.
a return statement that directly returns the data is conceptually the opposite of what you want to do when working with a db
a return statement rougly translates to "hold on while I get you this data"
when the method returns, you must return the data
and the thread calling the method will wait until your method returns
the thing is... i need to get a value from the database like every 10 seconds maximum time, maybe even more
Cache
what you want is a "come back later, i'll get your data in the meanwhile"
Why so often
rendering
which is basically a completable future
you return a completable future of your data rather than your data
that is, a wrapper that will sometime down the road hold your data, but maybe not just yet
basically i want to get from the database if other players have something enabled or not. and i obv wanna update it, if people disable it in their client
a future promise, one could say
yeah you don't want to get that from the db every 0.23 milliseconds or whatever you're doing
you want to get it, cache it, and then use the cached value
point is, cache shit
i am loading it every 10 seconds rn, saving that into a map, and then every tick just getting it from that map
idk if thats good
probably not
is discord dying
dont think so
No
well that is some bastardized and rudimentary way of caching
you'd only want to re-load it from the db if the value in the db is changed by a third party
reloading it from there otherwise is redundant
is there an event or smt for that?
in the server? no
from the sql api
depends on your db of choice
CompletableFuture.runAsync(() -> {
// code here
});
not that hard
for above
and for caching, just use the built in java schedualer
ScheduledExecutorService for every 10 seconds or smthing
(assuming this aint plugin related)
i usually use Java's Timer for that
ScheduledExecutorService probably better
allows you to use Executors
ScheduledExecutorService is able to catch runtime exceptions too
while for Timer, it will just kill the thread... not ideal
Also, caching is very very easy. The most simplest idea is this:
var someValue = ...;
ScheduledExecutorService... (assign time)
When called:
someValue = doSqlShit(...); // update the value
make sure to it on a separate thread too
idk if it works this way with player-related stuff
how do i get the content of an textcomponent to compare it to a string
we don't even know what player is
in this current case, my database contains this row for every player who uses the Client (in this case it's me).
to render my stuff on all players (that are in that db) i need to update it consistantly (i guess?) to make sure it doesnt render anymore if a player disables it in his own client
think of it like probably bac or labymod does it with its cosmetics
use a publisher subscriber model if you need to synchronize data across several writers/readers
a plain database is not ideal for that
i have literally never heard of that
yes, well, the two ways of maintaining synchronization is to either bomb the db with a billion "has this changed" requests constantly
or you can do it the smart way around, and have your parties notify other parties about data being changed
well, i would be good if it updates every 10-20 seconds.
dunno how long that db-accesses take
that still doesn't scale well
for example, the minecraft client doesn't send a get position request about entity every frame
the server sends an update
obv, if i could i would do it like if a entry in the database changes, load it in, but i don't think there's a simple way for that. idk if there is smt like an event for that
why are you pulling data from a database with the client, anyway
that seems more like a server job
or is this supposed to be distributed cloud shit
i want to show something for players, that are using the client. basically it's the same as badlion client-cosmetics.
lmao
lol
hes solo carring this entire chat
so if you and me are using the client.
you got a cape, i got wings.
it should show them to each other
you may want to look into messaging channels and writing a plugin that acts as the database
or is this one of those "must work on all servers" clients that needs to do everything itself
kinda, yeah
glhf basically
lol
your db/server/whatever is going to be dead
the client will obv not be public
someone is going to pull the credentials and address info from the client and leak it and then everything is rip
anyway, write a server for it
obv i don't store important data in it lol
you are trying to replace the function of a server with a database
writing a server would be hell much of work
really much
i could probably kill myself
not really lol
@sullen dome I'm not sure how you would do the database but if I was you I would try to ask the owner of optifine as he has a pretty good solution for the capes, from what I have heard
how do I make a zombie faster without potion effects
also, do float potion amplifiers work?
which method is the speed attribute
?jd
package index
the same as all the other attributes
and which is that?
read the dox
oh that's how they do it. I see
hope i don't go illegal with that, but no risk no fun
Well all you are doing is pulling the cape from the website so maybe lol
no i mean showing the OF-Code here
thats not mine
xd
that's how optifine handles it
oh shit
xd
didn't even realise
yeah
if i would, i would need to remove optifine completely, and even create an installer
and thanks, but no thanks
is it the getAttribute method of the attributable class?
hurt.removePotionEffect(PotionEffectType.BLINDNESS);
hurt.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 100, 2, false, true));
if (hurt.getInventory().getHelmet().getItemMeta().getLore().contains(ChatColor.GREEN + "- True Sight")) {
hurt.removePotionEffect(PotionEffectType.BLINDNESS);
}``` Anyone know how I can stop getting and error for when the player is not wearing a helmet or when they player is wearing a helmet but doesn't have the specified lore **"True Sight"**
the attributeinstance you get from that isn't a copy, right?
i wouldn't expect it to be, but i don't remember the last time I diddled with attributes
surround it with a try catch and ignore the catched error
or just check if it's null :/
what's the unit of the attribute GENERIC_MOVEMENT_SPEED?
1.0D for example
i'm assuming he means "how fast is 1.0"
which, hell if anyone knows
probably some arcane magic value
gimme 1 sec
there's a list with all default, min and max values
yes, but the list there is kind of confusing, as it seems like a zombie is faster than a player
so how can I send a plugin message ONCE,
the same way as you do when you send it MANY times, but you just do it once
since in my code I use Bukkit.getMessenger().sendPluginMessage(<pl>, <data>, idk?);
no like
imagine, every player sends that message....
like to the bungeecord..
I don't know how to explain
select one player and only use that player to send the message with?
since there is no Entity#entitySleeping(blockpos) method
uhhh
nvm im an idiot i just need a livingentity
my pronouns are gas/them
breh
Not sure if this is a good place for this, but does anyone have experience working with Netty?
1.8 async super hyper multithreaded anticheat plugin developers surely do
is there even a way to make the entire minecraft server async?
Like many server implementations say they are multi thread.
so it returns a number between 1 and the max value or from 0 inclusive and the specified value?
but for me it seems like they are not multi threads, I never tested one, but I don't think you could possibly make minecraft multi thread.
change my mind, prove me wrong
asynchronous and synchronous are matters of perspective
performing literally every operation on its own thread would be counterproductive
I know
most of the multithreading forks don't really thread anything or if they do, they do it unsafely
either fake or unsafe, pick your poison
I pick "fake"
the way how bukkit api is designed doesn't really permit for things in the world to happen truly asynchronously
for example, take an entity moving onto a pressure plate and activating it
yes I get you.
first, you would have to fire events for its pathfinding, f.e entity target entity event
these events, if they are fired on a thread that is not the "main thread", aka are colloqually async, would have to synchronize with the rest of the server in order to access their state
yes...
the entity then has to move, check for collisions, bounding boxes and shit which all require their own synchronization
then say it steps on the pressure plate
again, events need to be fired, and the plugins handling those events have to synchronize on whatever they need to access
in the end you have a synchro soup that is slower than you started with
i'm sure it can be done relatively sanely without an api that's supposed to let third party code do all manners of shit
and even with the api in place, some things can be thrown on their own, dedicated threads
for example paper has chunk loading and generation on its own thread
too much time for a advantage... that seems unrelevant as fuck.,
mojang shifted light updates to its own thread
chat has been on its own threads for ages
there is talk about moving entity pathfinding off the main thread but with all of the world state it'd have to access idk how feasible that is
yes.. that's why AsyncChatEvent Exists 🙂
I'm making a bungee queue plugin and i'm having a problem. I have set force_default_server: true in the config, so they are forced to join the queue server. I then have a plugin use PostLoginEvent ProxyServer.getInstance().getServerInfo("Main").getPlayers().size() to compare it to the max player amount, if ther are less players on the main server then the maximum do player.connect(serverInfoMain). Still some times it sends you to the queue server even tho the statement is true and it runs all the other shit in the if statement..
there has also been talk about splitting parts of the physical world off to separate threads, like thread-per-world or thread-per-region
but that is basically impossible with the event system
with the current api, a plugin that catches an event about a block changing at place a has strong guarantees of state about any other block in anywhere in any of the worlds
splitting each world or each region to separate threads would break that guarantee
plugin code that handles stuff happening in between two locations would have to be almost as robust as bungee/bukkit network plugins that synchronize data across servers
and the % of developers who can actually manage to do even that properly is pretty appalling
tbf to properly support this you would need to rewrite major/all parts of the API to follow a way more reactive approach
so that people don't just await the other region/world thread anyway if they wanna work on it xD
yeah and that'd involve plugin developers actually being able to deal with writing code for a threaded environment
which is never going to happen
most people can't handle dealing with code for a single threaded environment to begin with
the value for players(even for sprinting)(0.15) is less than the value for zombies(0.23)
basically, nobody knows
mojang magic values
throw some numbers at it and see what is good
one would expect a bigger number to mean a faster speed
pretty sure a player walks like twice as fast as a zombie without sprinting
about comparable to player speed while sneaking
with each passing day intellij takes longer to open
you would think it wouldn't take that long to index 706 class files
706 is nothing boi
or at least that they would've figured out a faster way to do it than reindexing every time
I know it'snothing
like this project has
47360 lines
i cant use shade in my project cause if i do
this is a solo project
i'd like to introduce you to minimize
surely actual games and businesses have million + line counts
do they take 1h to index every time they open the repo?
they probably don't have the whole shitshow in a single module
if you're making a full on game I'm sure you can go well over 1 million lines per module
i usually start splitting my projects into multiple modules after around 100 class files
because ij is slow as shit and my shit tier machine doesn't make it any faster
you don't need to recompile unchanged modules
Oh, ig in my case I use refactor and that makes a ton of shit
with the way I have things structured that would basically translate into me opening 5 to 7 different intellij projects and waiting for those to index vs doing what I'm currently doing lol
don't refactor shit across 30 modules ig
Well, i am developing a library. And have separate modules for the api and concrete impl
so if i rename an interface in the api
it has to rename also into the concret impl
Doesn’t gradle only compile changed files
Yeah
doesn't do shit for intellij indexing files though
sadly gradle gives me pimples
why
Ah
an allergic reaction
they can be
how do i stop mobs from attempting to float towards the surface if theyre in water
your mom is an allergic reaction
tie a big rock to them
You could remove that AI goal
attached the mob to cobblestone with a leash, didnt work
Try obsidian
ironically it would probably work
i did setAI(false) though :thonk:
can confirm noai creatures still float
i vaguely remember that being an ai goal
and yeah mobs with ai set to false don't have any physics
setting the speed
i need help
Yeah I think there is a PathfinderGoalSwim or PathfinderGoalFloat
?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.
forget that, I was thinking of the fun time I had when I tried to freeze blazes by setting their velocity but it turns out their vertical velocity does not count as velocity
where appeal ban
you should get better at ban evasion
Has he tried Facebook
legbook?
who's going to pay for it?
whos border patrol
i'll shoot anyone on sight
you're already doing that though
I've spent the last 2 days adding and removing green screens and D&D miniatures from my amazon basket
you should make your own miniatures
why is everything I want unreasonably expensive
getting good minis is deceptively hard
use your imagination
Is GetServer sending ALL servers/ is there a way to make it only return online ones??
I mean that's mostly what we've been doing for years
can't you iterate and see if they're online?
throw some streams and filters at it
how
oh boy
I feel like my streams game is lacking
i literally never use streams
I think I have 3? instances of streams on the entire project
more if Arrays.asList counts as one
asList is bae
I use them for startup stuff mostly
so is there a way?
go over the returned servers and ignore them if they're offline
I mean you could keep it simple with a method that just uses a for loop to remove all the offline ones
Or make something fancy with streams
i should look into reimplementing streams myself at some point
streams often feel like a bit of a trap
I should probably stop adding and removing things from my amazon basket
how do i check if its online if the entire reason im trying to do this is to get a list of online servers
i also should look into velocity at some point
are you becoming sonic?
i'll eventually need to look into proxies for my distributed skyblock server network on free aternos servers
and I don't want to do it with bungee because bungee is gay
and also shit
if you're using an api surely there must be a method on there to see if a server is online
I think I managed to get my plugin banned from aternos by giving people an easy way to bypass file upload restrictions
not that I'm complaining, I wasn't the one putting it up there in the first place
it's just mildly entertaining
im using spigot api
I somewhat doubt the spigot api has in it a method to get all servers
since it's an api for a single server
and also code can't run if the server is off
inb4 he's talking about Bukkit.getServer()
yeah I was about to say that lol
I was actually looking the api up to make sure, it's the only thing called getServer
Bukkit.getServer
the fact it's a singleton might be a good hint that there is only one
there is no getservers on the spigot api, or if there is it's not getting picked up by the javadoc
@warm galleon @warm galleon @warm galleon @warm galleon @warm galleon
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("GetServers");
System.out.println("Try to get server list");
p.sendPluginMessage(Main.getPlugin(), "BungeeCord", out.toByteArray());
yeah that's bungeecord not spigot
sendPluginmessage is part of spigot i thought?
yes but your question is about bungeecord
ok
you saying you're using spigot api was pretty confusing
anyways, dunno, i don't really use bungee
look up the docs for it if you haven't already
ive been trying to change the generator in bukkit.yml but the default generation is still used
my method in my main class isnt even being called
i found this in my output
Could not set generator for default world 'world': Plugin is not enabled yet (is it load:STARTUP?)
wtf how am i supposed to wait for plugin to load?
is it load:startup?
the plugin.yml has a setting that controls when your plugin is loaded and enabled
by default it is post-world
oh nice
thanks i will try this
working now
thank you very much!
:)
i'm trying to load in a custom map that will be created but i don't want default terrain generated
so i have to do this :p
Could have just used a super flat void world
Does anyone know why postLoginEvent.getPlayer().connect(serverInfo) not always work in a PostLoginEvent and why it's sometimes just ignored and sends the player to the default server? (BungeeCord)
@stone sinew tryed TimeUnit.SECONDS.sleep(5), same problem...
is it possible to change item meta based on who's viewing it (their permissions)
how would i do it then, some what new to java :/
I create NPC using that EntityPlayer, but how to invisible EntityPlayer's name to players?
Because I want to use hologram as its name instead
can someone point me in the right direction for what events I can hook into in order to prevent AFK players from accumulating playtime on the server?
afk detection is one of the hardest things to accomplish (for a good one)
public void onPlaytime(StatisticIncrementEvent event) {
if (event.getStatistic() != Statistic.PLAYTIME) return;
if (player.isAFK()) event.setCancelled(true);
}```
👍 Will look into it ty
Yes because that’s a method
we talk theory here
lol
I didn't ask for code I asked for a pointer 😎 It's bad mannered to ask for code
You know, 80% of what you asked for is pretty much afk detection and what gecko did was do it in just 1 method
Lmao
Well you are in the dev chat
I keep getting this error when I run my plugin on a server does anyone know why?
[21:11:50] [Server thread/ERROR]: Fatal error trying to convert TerrorGames v1.0:me/TerrorGames/SurvivalGames/Main.class
I can send the whole log if someone wants it
i already know of that, what i meant was how it would know the name
because that is in a completely different class
hey umm i had a question what is the api-version for spigot 1.12.2 ?
how can I find the location of a player?
obfuscated code
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [server.jar:git-Spigot-79a30d7-acbc348]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:305) [server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:205) [server.jar:git-Spigot-79a30d7-acbc348]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) [server.jar:git-Spigot-79a30d7-acbc348]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 6 more
e```
Why do i get this error also heres my plugin.yml
name: AntiCrash
main: com.raffel.antilag.AntiCrash
version: 1.0.0
description: A spigot plugin to stop FitFags from crashing the Server
depend: [ProtocolLib]
api-version: 1.12
author: Raffel```
Oh ok can the 1.13 api-version work on 1.12.2 servers because i think it should. Also would i have to update my spigot api from 1.12 to 1.13? Thank you
how do i type my command like this?
plus the issue resides in your jar not even containing the plugin.yml
It contains the plugin.yml
i extracted the jar and could see the plugin.yml file
according to the bit that says ya know "jar does not contain plugin.yml" it doesn't
The triple ``` at the start and end
how do i fix it then my project already has a plugin.yml in the src folder
idk
src/com/raffel/antilag/plugin.yml
uh are u sure it's in the compiled jar
idk ima check
It has to be three
Does It not need to be in resource folder instead of main folder ?
I mean it depends on the way they're compiling the jar, fuck if I know
it is compiled
I use maven to handle my shading
Won't hurt to relocate plugin.yml into the resource folder tho.
Hello, Can someone help me to setup environment for a (personnal) fork of spigot ? Because I try what it is said on every page I found but couldn't find a way to generate work/decompile-XXXX files. Moreover they are many errors (such as accessing variables on object that didn't have it) everywhere in the code, but I may have done something wrong
@wheat dagger use buildtools it will pull in the repo's for you. which you can then use to fork and do whatever
the whole decompiling part is a different process separate from that of the working repo's
I try that but no, it didn't create the folder, I want to modify the NMS code, and for doing that it is said that i need to create this folder
buildtools creates all those directories for you
once you run buildtools you will have everything you need, even the NMS stuff you want to modify
if you want to know how the decompiling process works, look at buildtools source code
in 1.12 yes but in 1.16 apparently not
the process hasn't changed
you are looking at two different directories
the bottom pic is what build tools creates
the spigot directory is going to contain all the repo stuff and the work directory contains all the decompiled classes etc
I will test it with 1.12 right now, pretty sure I am going to get the exact same layout
So folders at root are just if I want to modify raw bukkit or raw spigot ?
Because in 1.12.2 there isn't the "applyPatches.sh" and it's my current problem in the guideline
well, not entirely sure what kind of fork you are doing. If it isn't going to be a public fork, you don't need to worry about that
I have some difficulties to say in english what I'm thinking sorry if it seem strange --'
the applyPatches is just for if you create your own patches
okay
but if you are not creating patches, then its a non-issue
so when I'm here I just run the apply to create files ?
well all the repo's are maven projects. Just use maven to build those projects, and the patches will be applied through maven
[ERROR] Child module\Spigot\Spigot\Spigot-Server of Z:\Server_Projects\LaboCraft\Spigot\Spigot\pom.xml does not exist @
[ERROR] Child module \Spigot\Spigot\Spigot-API of Z:\Server_Projects\LaboCraft\Spigot\Spigot\pom.xml does not exist @
did you use maven to build the project?
probably would help if you used a paste service to show build errors
?paste
Sorry :p, it found a problem there in brigadier
I will look like a child but I often use gradle instead of maven so I might do wrong
this is why I recommended running buildtools first before creating your workspace. Buildtools will pull everything in, build the project which includes downloading dependencies
"java -jar BuildTools.jar --rev 1.16.5" that ?
yes
ok from there you just need everything from the spigot directory, which should have bukkit, craftbukkit, spigot, spigot-api
can just make a copy and copy it somewhere else, this way when you run buildtools again, doesn't mess with the stuff you are trying to work with 😛
I am saying copy the spigot directory buildtools created
and put it in a safe place
this way, whenever there is a time you run buildtools again it doesn't mess with your workspace
Okay I've done that
ok your spigot directory should look like this
.git
Bukkit
Bukkit-Patches
CraftBukkit
CraftBukkit-Patches
Spigot-API
Spigot-Server
.gitignore
.travis.yml
applyPatches.sh
pom.xml
README.md
rebuildPatches.sh
upstreamMerge.sh
since you are wanting to mess with NMS, you can just open Spigot-Server as a project in your IDE
In 1.12.2 yes but in 1.16.5 no
Because the build failed, with the brigadier exception
then you need to figure out why it is failing, most likely reason is that it isn't downloading brigadier dependency
hmmm the problem is that the object exist just there isn't any currentCommand field
going to run buildtools for 1.16.5 if it works for me, then its something on your end. Either you messed with something and thus recommend deleting all the files except for buildtools.jar and run it again or it is simply not able to download something it needs
Okay sorry for bothering you
you are not bothering me lol
going to take a few minutes for the build to complete for me
It is possible that I mess yesterday with my local maven folder
easiest way to fix if that is the possible reason, is to start fresh
I have to delete .m2 ?
What jdbc wrappers would you recommend?
How can I prevent players from stealing items from item frames? I've tried to cancel the 'PlayerInteractAtEntity' event, but it doesn't seem to prevent theft.
1.8 is fine
I try several time to delete all files and recreate them using Buildtools but same problems
depends on what you are wanting to use
Simply i wanna reduce boilerplate and maybe, data converters..?
some JDBC wrappers have conflicts with other ones. Example being mysql jdbc and maria db
if you try to use Maria DB one, which would need to be shaded into your project, it will conflict with the mysql driver one that is shaded in spigot and thus you will have to resort to some tricks to get it working
I used both once and I don't really have any preferences, depends on what you needs if I remember correctly one has "complex" functions and the other one don't
can't use both at the same time, and you also can't have both drivers loaded either, not without some hacky solutions to get it working
Yes I know but I try both on the same project if you prefer
ah, yeah Maria DB one tends to be better in my opinion
but MySQL one is best for compatibility though
It's the solution we choose at final, because mysql is heavier I think it was because of that
yeah mysql isn't super optimal
where as maria db one is
however, those wrappers are not going to necessarily reduce boilerplate
what that person is actually going to need to search for is a SQL library that does such a thing, not necessarily a JDBC wrapper lol
I don't know what boilerplate is, I haven't gone really deep in database mangement
I just have some trouble with the end of file exception grrrrrrrr
ah okay
I know the expression in french but I didn't translate it x)
ok well my project completed just fine, initially had issues with Java 14. But worked just fine when I used 1.8 java
so, it would seem it is most likely something on your end causing problems. Also it appears they cleaned up the working directory for the repo's
it is essentially still the same, just without a couple extra repo's that are not necessary
hmmm you didn't have any problem at : com.mojang.brigadier.tree ?
nope
wtf
not even when I used java 14
my problem in Java 14 was that I was hitting a file not found exception for some odd reason which I will investigate at some other time, since I have used Java 14 in the past before without issues. otherwise I didn't encounter any issues with brigadier
vault doesn't have any configs
for it does it have config.yml
not sure if vault produces config.yml, but if it does it would be for controlling its auto-update feature
for example I'm selling an item people can still access the chest that has the item in it
not sure what shop plugin you are using, but you are going to possibly need worldguard for it work properly as well as possibly needing a permissions plugin too
Vault is just an api all selling or buying are managing elsewhere
alright, so with updated buildtools and for 1.16.5 the directory should look like this
.git
Bukkit-Patches
CraftBukkit-Patches
Spigot-API
Spigot-Server
.gitignore
applyPatches.sh
pom.xml
README.md
rebuildPatches.sh
that is what is inside the spigot directory
at the root, is where you will find Bukkit and CraftBukkit repo's if you need those
most of the time you don't
Okay how do you build using maven, going back to the very beginning ?
maven build ?
once you get buildtools to successfully run for the version you want, you need to have installed maven
and then its just navigating to the repo using git bash preferably where the pom.xml resides
and then doing maven build in that directory
I actually managed to prevent players from stealing items from item frames, but now I have a different problem. How can I prevent players from rotating items in item frames?
right click instead of left click
cancel the action, and then check the item's rotation in the item frame and just reset it
this way, even if the action wasn't cancelled successfully the item's rotation goes back to what you want it 😉
same problem https://paste.md-5.net/mizavohoho.cs
@wet breach can I do it in call with you step by step to see where I'm failling ?
how do you make people able to sell things using Essentials or do I need a different Plugin for that??
I am just going to compress my working directory and you can just download that
there is a wiki that shows you how to create essentials sign shop
So I guess
yeah we know that but for some reason only I can make shops but not other players
you need a permission plugin
so you can set permissions for default group to give ability for others to create shops
lp ❤️
luckperms = lp
uhhh..... rather than doing that I can just dl a signshop right?
you could yes, assuming it has config options to just allow everyone to create a shop
without needing a permission plugin
can you guys recommend one?
The problem is that every plugin use permission and if you haven't one the only choice is /op which is a reallly bad way to give permission or power to people
Moreover the plugin might not check if the player is an operator, as in my past I've some trouble with that
Yeah that's why as much as possible I want to resort with just people able to access almost everything without the /op system
permissions plugin is best way to go for that
not like you really need to setup any groups
you just need to give default group abilities to do things is all
yeah and also I found a good plugin that is called quickshop but everytime someone tries to buy an item on my shop it says locked
because permissions
basically all plugins rely on permissions, very few plugins are created to work without a permission plugin
@wet breach
So what I have to do :
- download buildtools
- run in the buildtools folder java -jar BuildTools.jar --rev 1.16.5
- then cd Spigot
- them mvn build
Do I miss something ? (I delete all the files, and clear .m2)
Not quite
To get the latest version you can just run java -jar BuildTools.jar
And that will produce a spigot jar in the same directory as the build tools. Bear in mind that it can take a while the first time
How can i get actual block player is standing on
Using location#subtract returns block directly below player
This can be incorrect when player is on very edge of block
It shoudl never be wrong.
If you are shift leaning over the edge, you ARE over the edge and the block below you is empty
Its returning the empty block
But technically we are standing on real block right?
I have 4 maven modules with each an "module-info.java", if I try to depend a module-info towards another module info, Maven can't find the module, but in IntelliJ I can import all classes from that module
module spigot {
requires main; //Custom module from me (another name), not found by Maven, but found in IntelliJ
}
module main {
//exports some classes, only this module compiles
}
module bungee {
requires main; //Same as spigot, could not be found
}
module release {
requires main;
requires spigot;
requires bungee;
//All 3 not found
}
guys how can i register this command to Main class ?
Bukkit.getServer().getPluginCommand(name).setExecutor
if your onCommand is in your main class and the command is in your plugin.yml you don't need to register anything
how can i run code on a block every 2ticks?
With a runnable
ok thx
i did , but this command not working why ?
What for interface is ICommand?
thats not in your main class
And how does that register the command then?
thast your own command. nothing to do with Spigot
implement CommandExecutor not ICommand
oh i will try it thanks
I've made a lobby plugin, now there are a ton of event listeners, is it a bad thing to divide them ? Meaning I've got a few inventory listeners which are kinda practically the same but on different classes just to keep everything organized, or is it better to put everything in 1 listener class ?
You can put Inventory listeners in a class named InventoryListener, player listeners in a class named PlayerListener and server listeners in a class named ServerLister for example
Depends on how much logic you have to double between the two listeners. If you run complex logic multiple times on for example inv click, that might have performance issues
each class should serve a purpose, If you have the same events in multiple classes its no problem
If that is the case tho, maybe evaluate your doubled logic once and then split off into different methods from inside the listener
still i cant use this command
Now you have registered in plugin.yml and with Bukkit.getServer ?
you are registering the executor to this not the command class
Not setExecutor this, setExecutor new Info()
Aight thanks they are very small events anyway
like this ?
Yes, and then Info must implement the CommandExecutor
yes it is
Ok then it is good
but gives error ?
that error says you are not implementing Bukkits CommandExecutor
Bukkits CommandExecutor, not your own
Ok, so i am looking at weather in the docs, how does it work? Like what does the server do to realise "Oh! Now it is time to rain!" and stuff like that
And also, why are there only two weather enums - Clear + Downfall. Is thunder just an added extra?
Basically there is "clear" and "storm" which are the two states of weather. Thunder is added additionally and may exist with or without a storm tho I believe it would reset the next tick if there is no storm present.
Right
If you wanna look at the servers "weather lifecycle" checkout WorldServer#doTick(BooleanSupplier)
can i add a player to a bossbar without them getting the bar at the top of their screen?
if you don't want players to have a boss bar why add them to the boss bar
for the flags
I'm sure it's feasible using nms
i doubt it
bar.setVisible(false);
no, that also hides the flags' effects
https://paste.md-5.net/ukiyovalap.cs how to solve this problem
I keep coming up with these elaborate visual effect concepts
and then I have to spend hours making them
ClassCastException: java.lang.Integer cannot be cast to java.lang.Byte
why do I keep doing this to myself
don't cast Integer to Byte
like what
Thats a pain
well just now I finished planning for a fun power whose warning phase is literally a rave light show
you can't cast the wrapper types
you need to cast to a primitive first
which is omega gay
it's going to summon 12 fireballs around a boss and rotate them around for about three seconds
all the while it's going to raycast particles that will tilt up and down previewing where the fireballs will land
after three seconds they are sent
like these look cool but they just take stupid amounts of time to get to work in a reliable way https://www.twitch.tv/videos/1035433388
tf
if I were to open that link I'd be sitting here at this time tomorrow waiting for it to load
twitch's site is absurdly fucking slow
also I think the twitch player is completely dead, I have no clue of what's wrong with it
whatever
anybody know any crates and or enchants plugins that are not shit
only cast it right ?
boss fight
that is casting an int to a byte, that'll work fine
what you can't do is cast an Integer to a Byte
well you can Integer.valueOf(number).byteValue()
then there's going to be arena mechanics
but that's not a cast
the lightning around the tower is actually an arena mechanic
yep
the end crystal is the one summoning the lightning
you can also do (byte) (int) i
still haven't switched into using packages i see
it is in the enderdragon package
what
kind of renders the enderdragon prefix redundant
The difference between int and Integer
well seemingly you can browse a 5 directory deep package faster than I can type 5 characters so it works for you but not for me
i can yes
yes i know
very impresive
but I didn’t understand him saying it will work but I’m cost an int for byte
I can't even visually find the right package from the list in the time it takes me to type enough characters to access the class
how can I apply color to logger? server.getLogger().log("§cmsg") doesnt work 😦
let me introduce you to the magic of keyboard shortcuts
and navigating directory trees with the keyboard
try using ascii color
the number 1 without anything is an int
it's kind of like a search function
oh so like a search function except slower?
yes ?
except faster
which you can safely cast to a byte
did he mean that converting a float, double or anything without being an int will give an error?
how on earth could it possibly be faster than typing EnderDis
no i mean casting an Integer into a Byte will explode
because you can't cast an Integer into a Byte
but 1 is a int
then i need ?
no
tf
if it would explode, your compiler would notify you of the error
i havent even tested it yet
then why are you asking about it
knowledge
the knowledge is that you can't cast Integer to Byte
int and Integer are not the same thing
but you can cast int to byte
Neither are byte and Byte
this is the extent of the knowledge