#help-development
1 messages ยท Page 1422 of 1
You didnt add a reference to to protocollib
what about this any ideas?
Use brackets in your if statement and the error is obvious
I dont see the error still
packetplayoutplayer info is a public class why do i need reflection
same for the action enum
I think the spigot jar doesn't include it or something like that. Can't remember exactly. I have a method if you want it
Cause mojang broke the class
thats what we've been saying lmao
is there a way to change java's current directory?
like working dir?
yeah
in C# you can just do Environment.CurrentDirectory = "new path";
i've tried System.setProperty("user.dir", Path.of(newpath).toAbsolutePath().toString()); but that doesnt seem to work
now I changed it to this https://paste.md-5.net/toqeqidopo.cs but it now gives this error whenever protocollib isnt there https://paste.md-5.net/refegakuma.sql
check if protocollib is installed, if not disable your plugin with a warning
any idea?
looking it up rn
I dont want to do that. if I wantedf that I could have just added it as a dependancy
make it &&
actualy nvm
just means top if statement isn't being satisfied
thats weird
@solemn shoal https://stackoverflow.com/questions/840190/changing-the-current-working-directory-in-java
oh you tried that
is this for ap lugin?
this is weird
yes, but my plugin can be executed on its own, which is where i'm using it
setting user.dir doesn't affect subsequent file accesses
as you can see by my output it does infact get the argument correctly and throws no errors, yet file accesses arent changed
how are you verifying the current working dir
how do you mean?
how do you know it's not switching dirs
the original working dir only has 3 jars, whilst the one im setting to has 30+
when i specify scan directory instead of switching current directory, i get this:
whilst when changing current directory, i get this:
hmm i think File always does working dir as the dir of the jar
not actual working dir
i could test that
https://paste.md-5.net/fidafolivo.nginx
https://paste.md-5.net/riqogaxija.cs
Looks like the first if statement just continues
could always just have a home dir variable instead of using java's system
jar is in the libs folder
interesting
it takes the working dir of your executing process
(aka if you use bash to launch it, itll use whatever dir you were in with bash as working dir)
thats some strange behaviour
seems normal to me
im assuming exactly the same code to scan for jars with both methods
yep
Java is weird
the problem is that when your plugin is loaded, that is an import. you need to put the protocollib code in another class and load it via that if protocollib is loaded
of course it doesnt
like the packetstuff
it isn't imported/used anymore
its your import
lol
*part of PluginManager btw
o
put it in a ProtocolLibLoader class or something and then in your main class check if protocollib is loaded and instantiate that class if so
gotcha
so I still need to use staticc
public class MyClass1{
MyClass2 mc2 = new MyClass2();
mc2.myMethod();
}
public class MyClass2{
public void myMethod(){
}
}```
no you shouldn't need to use static
how would I find out why I'm getting Timed out?
o
it has to be something in my plugin since it just started happening
I see
and there is no console output about it
timed out is a network thing usually
do you have any while loops?
any loops at all
infinite loops would also cause timed out
would dump an error in console
infinite loops?
yeah the thread dies and it will report in console
doesnt do that for me usually
do you have protocollib on ur server?
No thats what im trying to do
did you end up putting it in another class
I need to check
no thats what im trying to check
i think sam was right
oh
Bukkit.getServer().getPluginManager().isPluginEnabled("ProtocolLib")
Im not I placed it on another class
i believe
ProtocolLibCheck protocolCheck = new ProtocolLibCheck();
send that class
are you creating it before checking if its enabled
send the class
pls
it's prolly an error in ur constructor if that's whats happening
have your check if it exists in the onEnable
for this
then create after
yeah
u can do that
or
i believe
it's because ur registering the variable
first
check if it's enabled then try creating the variable
ProtocolLibCheck protocolCheck;
if (pl != null && pl.isEnabled())
protocolCheck = new ProtocolLibCheck();
it's dumb for it to show the error on that line though
when it should be in
particle manager line
35
well its on instantiation of the class
because the protocollibcheck has nothing in the constructor
not a line within the class
but it shouldn't be trying to do anything protocollib related
actually
i get what u mean
public void protocolLibCheck() { your protocollib registering stuff won't even get called
^ and yeah not calling the method lol
you should also put the entire thing in the plugin enable check if you're not using the protocollibcheck class elsewhere
u do or else it just says it cant save cuz it already exists in console
why not just use the bukkit method for config.yml?
you don't, but the console does send an annoying warning if it already exists
ah thats dumb
this too
getConfig().options().copyDefaults(true);
saveConfig();
saveDefaultConfig()* during initialization 
ez
ok at this point im just confused
Yes
don't initialize
ProtocolLibCheck
you're going to first check if protocollib is on the server
then initialize it
Ok
also just bc it looks cleaner for ur logger.info i'd recommend String.format
๐คท๐พโโ๏ธ
so
if(getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
protocolCheck.protocolLibCheck();
}```
no
?
@Override
public void onEnable() {
ProtocolLibCheck protocolCheck;
if (getServer().getPluginManager().isPluginEnabled("ProtocolLib"))
{
protocolCheck = new ProtocolLibCheck();
}
long start = System.currentTimeMillis();
instance = this;
updateCheck();
if (protocolCheck != null) protocolCheck.protocolLibCheck();
createCustomConfig();
Objects.requireNonNull(getCommand("particlemanager")).setExecutor(new Commands());
long fin = System.currentTimeMillis() - start;
logger.info("ParticleManager v" + getDescription().getVersion() + " has been successfully enabled in " + df.format(fin / 1000.0) + " seconds (" + fin + "ms)");
}```
Im trying to make a groundspoof check but every time i jump normally and hit the ground it flags
Player player = e.getPlayer();
boolean client = player.isOnGround(), server = player.getLocation().getY() % groundY < 0.0001;
if (client && !server) {
boolean boat = false;
boolean shulker = false;
List<Entity> nearby = player.getNearbyEntities(1.5, 10, 1.5);
for (Entity entity : nearby) {
if (entity.getType() == EntityType.BOAT && player.getLocation().getY() > entity.getLocation().getY()) {
boat = true;
break;
}
if (entity.getType() == EntityType.SHULKER && player.getLocation().getY() > entity.getBoundingBox().getMinY()) {
shulker = true;
break;
}
}
if (!boat && !shulker) {
fail("mod=" + player.getLocation().getY() % groundY);
}
}
whats groundspoof
any reason why it is doing this? it works if i manually type it but there are no quick snippets
is this an api?
the client says if on the ground when it isnt, its what nofall hack uses usually
if MPlayer has any static methods then it'll show u options
didnt u basically do the same thing?
no just a Player variable which has been set
oh pascalcase weird ๐
i can type MPlayer.sendMessage(""); and it works but no quick options
no u were running the method but we have to do initialize the class instead
this is because MPlayer looks like a class name
so it's searching for a class by the name of MPlayer
use proper naming conventions
camelcase pls
variable/field names are supposed to start with a lowercase alphabetic character
lowerCamelCase for fields/variables/methods
UpperCamelCase for class names
then u go to C# and u have variable names starting with _
your ide assumes MPlayer is a class
๐
not a variable
ALL_CAPS for constants
Variable 'protocolCheck' might not have been initialized
yeh if u dont use correct casing you'll get yelled at by every java dev
Do you have an example pls ?
set protocolCheck to null at the top
@Override
public void onEnable() {
ProtocolLibCheck protocolCheck = null;
if (getServer().getPluginManager().isPluginEnabled("ProtocolLib"))
{
protocolCheck = new ProtocolLibCheck();
}
long start = System.currentTimeMillis();
instance = this;
updateCheck();
if (protocolCheck != null) protocolCheck.protocolLibCheck();
createCustomConfig();
Objects.requireNonNull(getCommand("particlemanager")).setExecutor(new Commands());
long fin = System.currentTimeMillis() - start;
logger.info("ParticleManager v" + getDescription().getVersion() + " has been successfully enabled in " + df.format(fin / 1000.0) + " seconds (" + fin + "ms)");
}```
now it says Operator '!=' cannot be applied to 'void', 'null'
I've just found the issue, if I send the player info packet (Add_Player) , the spawn packet and another player info packet (Remove_player, for removing the npc from the tablist) sequentially, the npc spawns without skin. This not always happen. I think that I'm not giving the client the time to properly load the skin that he receives a player info that tells him to remove that player... Any tips?
oh nvm
public static final List<TaahPlayer> TAAHS = new ArrayList<>();
TaahPlayer taahPlayer = new TaahPlayer();```
TaahPlayer being a class name
wat
nvm
show ur onenable atm
ignroe that
o ok
Thank you !
I though constants was like variables ... (For the conventions I mean)
ok, changed it to mPlayer. m meaning message (player receiving message). mPlayer is a variable with the specified player who will be receiving the message. I want to do mPlayer.sendMessage(""); .But this isn't working, and I've tried other variables and it doesn't have the option to auto Fill. is this a library issue?
Hopefully that makes sense
sounds like an ide issue
have you restarted your ide
yeah
try File > Invalidate Caches > Restart
if ur using intellij
I should have asked that
im using Eclipse
Can you show us your code please ?
?paste
Why not ?
Maybe this mPlayer isn't a Player ๐คทโโ๏ธ
I doubt anyones that dumb
they are
or just uppercase in general
That's not nice. When you learn, it's not complicated to mix the brushes, I know what I'm talking about ...
https://paste.md-5.net/lotaqemiva.rb
this is my cehcker
https://paste.md-5.net/weyekeyude.java
this is my main
https://paste.md-5.net/biyecazaju.java
it now gives error whenever protocollib is on the server
I was never being rude lol
I'm saying no one is dumb enough to do that
not meant in a rude way
no? if he says he didn't mean it that way, it means he didn't
Can you guys please go to general
no
ok...
you're casting this as plugin
when this is refering to ProtocolLibCheck
You need to null check that
should pass a reference to plugin
but other than that, it should auto complete ๐คท
Im trying to make a groundspoof check but every time i jump normally and hit the ground on a full block it flags
This code should check if the client says its on the ground but it isnt on the server
Player player = e.getPlayer();
boolean client = player.isOnGround(), server = player.getLocation().getY() % groundY < 0.0001;
if (client && !server) {
boolean boat = false;
boolean shulker = false;
List<Entity> nearby = player.getNearbyEntities(1.5, 10, 1.5);
for (Entity entity : nearby) {
if (entity.getType() == EntityType.BOAT && player.getLocation().getY() > entity.getLocation().getY()) {
boat = true;
break;
}
if (entity.getType() == EntityType.SHULKER && player.getLocation().getY() > entity.getBoundingBox().getMinY()) {
shulker = true;
break;
}
}
if (!boat && !shulker) {
fail("mod=" + player.getLocation().getY() % groundY);
}
}
I don't know why it is not working, but I think you should use getPlayerExact() instead of getPlayer()
h9ow can I do that so it gets the plugin
Yeah thats what is puzzling me, its not just this variable its everything. I opened eclipse and there is no auto complete
Meant for the other message soz
you want to pass Plugin in the constructor and keep it as a variable
I haven't used eclipse in many year
Well... idk how to do that
What do you use ? Intellij ?
netbeans /s
public class ProtocolLibCheck {
private final Plugin plugin;
public ProtocolLibCheck(Plugin plugin){
this.plugin = pluign;
}
}```
On enable:
```java
ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
then instead of using this use plugin
my uni is trying to get me to use netbeans for their course
lmao
no
Expected 0 arguments but found 1 for the 2nd
You have to modify your code, you can't just copy and paste it
???
have you changed the second class yet
it's gonna throw that if you haven't changed the constructor
I did
show the class
public class ProtocolLibCheck {
private final Plugin plugin;
public void protocolLibCheck() {
this.plugin = plugin;
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter((Plugin) ParticleManager, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
if (ParticleManager.getInstance().getCustomConfig().getBoolean("status") && ParticleManager.getInstance().getCustomConfig().getBoolean("disable-damage-indicator"))
event.setCancelled(true);
}
});
ParticleManager.getInstance().logger.info("ProtocolLib was found and its features are enabled!");
}
}```
you didn't change the constructor
oh yeah you didn't even make one 
public class ProtocolLibCheck {
private final Plugin plugin;
public ProtocolLibCheck(Plugin plugin){
this.plugin = pluign;
}
public void protocolLibCheck() {
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter((Plugin) ParticleManager, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
if (ParticleManager.getInstance().getCustomConfig().getBoolean("status") && ParticleManager.getInstance().getCustomConfig().getBoolean("disable-damage-indicator"))
event.setCancelled(true);
}
});
ParticleManager.getInstance().logger.info("ProtocolLib was found and its features are enabled!");
}
}```
your constructor is basically saying "When i create this class, I NEED these parameters"
pluign; r u sure it should be that
deleting the .metadata has resolved the issue. bit odd
yeah
is this rigth
public class ProtocolLibCheck {
private final Plugin plugin;
public ProtocolLibCheck(Plugin plugin){
this.plugin = plugin;
}
public void ProtocolLibCheck() {
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter((Plugin) ParticleManager, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
if (ParticleManager.getInstance().getCustomConfig().getBoolean("status") && ParticleManager.getInstance().getCustomConfig().getBoolean("disable-damage-indicator"))
event.setCancelled(true);
}
});
ParticleManager.getInstance().logger.info("ProtocolLib was found and its features are enabled!");
}
}```
this too
like i just fucking said
variables, methods, and field names should be in lowerCamelCase
change it to twhat thgo
https://www.spigotmc.org/threads/packetplayoutplayerinfo-playerinfodata-inaccessible.445980/ any updates on that?
sure
you can bypass most access modifiers via reflection
both the enum and the class are public
dunno then
splรถgget's cloudflare shit bricks my browser for 5 minutes so i'm not going to open ze thread
how can i fix this ? https://paste.md-5.net/yudequjeha.cs
im copying an world and then loading it for player
thanks i'll check it out
what do I do for there
if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) { protocolCheck = new ProtocolLibCheck(); }
9in the main clas
you should probably include the isPluginEnabled check in your ProtocolLibCheck class
if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) { protocolCheck = new ProtocolLibCheck(this); }
after all, that is the purpose of that class
it wigs out if you instantiate the class without the dependency
doesn't like the imports
so he has to check before instantiating
that
I spent way too much time on this instead of making the plugin
could always just do a good ol' try catch
or an inner class in the checker class
yyes
But was I smart enough to realise that I could use that
if ur answer was yes
you are so wrong
your mom
how can i fix this ? https://paste.md-5.net/yudequjeha.cs im copying an world and then loading it for player
lmao wot
just means the if statement is saying it's enabled
thats when the plugin isnt there
even tho it's not
Yes.
that is strange
I hate this
honestly I would just wrap it in a try catch and call it a day
creating the class
so
like tyhis
try {
if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
protocolCheck = new ProtocolLibCheck(this);
} else logger.warning("ProtocolLib was not found! Some features may not work as expected!");
if (protocolCheck != null) protocolCheck.protocolLibEnable();
else {
logger.warning("ProtocolLib was not found! Some features may not work as expected!");
}
}```
try {
protocolCheck = new ProtocolLibCheck(this);
protocolCheck.protocolLibEnable();
}catch(NoClassDefFoundError ex){
logger.warning("ProtocolLib was not found! Some features may not work as expected!");
}```
how so
IDK
what does it say
ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
I really want to give up but I spent too much on this to just give up
you are still creating it outside of the check
Hello, anyone experienced with publishing Maven projects to Sonatype central repository?
so the try and catch would be
ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
ProtocolLibCheck protocolCheck = null;
protocolCheck = new ProtocolLibCheck(this);
protocolCheck.protocolLibEnable();
}catch(NoClassDefFoundError ex){
logger.warning("ProtocolLib was not found! Some features may not work as expected!");
}```
public void onEnable() {
long start = System.currentTimeMillis();
instance = this;
updateCheck();
try {
ProtocolLibCheck protocolCheck = new ProtocolLibCheck(this);
protocolCheck.protocolLibEnable();
}catch(NoClassDefFoundError ex){
logger.warning("ProtocolLib was not found! Some features may not work as expected!");
}
createCustomConfig();
Objects.requireNonNull(getCommand("particlemanager")).setExecutor(new Commands());
long fin = System.currentTimeMillis() - start;
logger.info("ParticleManager v" + getDescription().getVersion() + " has been successfully enabled in " + df.format(fin / 1000.0) + " seconds (" + fin + "ms)");
}```
i dont know why you're creating two protocollib checks
am I?
ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
ProtocolLibCheck protocolCheck = null;```
๐
epic
ey atleast you learnt something maybe?\
Yes I finally learned how to see the which error is what
.d
and the fact that I hate protocolib
:d
didn't work : D
keywrod sometimes
not using it properly then, show code
I use it in my own plugin it works fine
wait..
idk it was just so much of a pain for me
yes it works fine...
Yeah thing with protocolLib is theres not many tutorials or documentation for it
surprising for how big and widely used it is
yep
but onc eyou get the hang of packets it becomes second nature
and the things that are there like
yeah you do this
and this
and now we made minecraft
can you patsebin pls
no on e is oging to download that
ok
Tbh protocolLib is perfect befoer I was planning to make a plugin that disables particles but oh boi mojang did not use particle pacekts for like 99% of the particvlesz
sounds counter intuitive lmao
can somebody help me ? https://paste.md-5.net/yudequjeha.cs
?
instance.getServer().createWorld(new WorldCreator(worldName));
the worldName is P4vlyi so the name isnt null
and the world copies itself too
yeah idk
[ParticleManager] ProtocolLib was found and its features are enabled! this message makes me smile
anyways imma spend the next hour or so reloading from my console to watch that message
lmao
i messed up with pastebin but ok https://pastebin.com/t3ziVEbM
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.
what is this for exactly btw
you can scrape the api or i think spiget has an api for it
i dont work with auto updating stuff so im not familiar
update checker
@drowsy helm it's for listening to PakcetPlayOutPlayerInfo and then overriding the skin data sent to change a player's skin
sending a notificaiton if there is a update
just iterate over all players, remove their tab profile
and add a fake one for them
with your desired skin
i also want the client to see their skin not only the others
@EventHandler
public void EntityInteract(final PlayerInteractAtEntityEvent event) {
if (!(event.getRightClicked() instanceof ArmorStand)) return;
final Player player = event.getPlayer();
final ArmorStand click = (ArmorStand) event.getRightClicked();
final String armorname = click.getCustomName();
if(!armorname.startsWith("loot")) return;
final String[] name = click.getCustomName().split(":");
LootManager.loot.stream().filter(e -> e.getName().equals(name[1])).findFirst()
.ifPresent(e -> LootManager.pickup(player, click, e.getItem()));;
}```
it has been reported that if you click the support armor several times very quickly, it gives the player a glitch to receive the item several times
what doesnt work about it
It never occurred to me that you can declare two things in a try with resources
please use camelCase for method names
try and avoid streams they are super slow
ok
what ?
streams are slow, try not to use them for events and such
their best use is on startup and shutdown, etc.
aaah then i ned user for ?
?
yeah
use a for loop instead, yes
what doesnt work about it
it just doesnt work
nvm tho I think I just messed up the sendinmg apart
in the main class
oh ye
I jujst emssed upo sebnding
Question: How can I check if the name of the plugin has -beta at the end
and how can I send centered message
oh
and pad each side of the message with spacing, have to make a method for it
jo guys I'm a newcomer to java I need help with the Config.yml
im not on the update rn im just checking if there is -beta so I can say that it might be unstable and stuff
What you need help with?
https://www.spigotmc.org/wiki/config-files/ this can help
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I have a small plugin program what it is about with Antibuild and I have added a / build command, but I want to change & 7LobbySystem to & 6LobbySystem in the Config.yml file for example
wdym
i need a Config.yml to change the Prefix for LobbySystem i didnt want to change it in my program i want to change it in the Config.yml
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
could use this
so uh
how can I detect if at the end of the plugins version there is a -beta text
??
two ways:
if(version.endsWith("-beta"))
if(version.substring(10).equals("-beta"))```
first one is obv easier
and second one is hardcoded shit
!
You could use ::isFile iirc
^
how can I loop thru a config section
FileConfiguration#getConfigurationSection().getKeys(false) in a for
Hey, is there any difference between HumanEntity and Player ?
Generally no
I always unsafe cast to player, Iโve never had an issue so far
I'm wondering if I have to do
if(e.getWhoClicked() instanceof Player) {
}
before :/
not really
Itโs not a bad idea
its not like entities can click in their inventory lol
I mean player is an entity too
Iโm not sure why this event returns HumanEntity
Probably to keep it inline with vanilla
is it possible to get a completely random material from an itemStack
an ItemStack has ONE material
if you want a random Material create an array/List of the ones you want an pick a random one
ok thx
or a random int and use Material.getId() ?
Not good as you can get Materials that should never be used
Oh, i guess that's why Material#getId is deprecated
No itโs because numeric IDs are dead
wdym ?
Minecraft switched entirely to namespaced keys
Hi everyone i am looking for a plugin that allows me to teleport using an item. best would be to save a location by clicking the item ( like when you use an empty map) and by klicking the item a second time you are beeing teleported and the item is consumed. does anything like that exist ?
aaah okay ty
well
everything does still have an id
it's used in the protocol
but now it's like dynamically generated from the registry or some shit
Can i intercept the chunk generation?
like as in, only gen blocks that are x = 100
for example
there is a populator event you can intercet
Whats the best way to load a plugin after vault and also all types of economy plugin that run on vault?
Add load before to plugin.yml
i was thinking of doing load before but it would mean i need to list all types of economy plugins out there
loadbefore: [Vault]
will depend: work?
no
i see thx man
if you want to load your plugin after vault, you need to add vault as a depend
if you want your plugin to load before vault, you need to add vault as a loadbefore
listing plugins as depend or softdepend ensures that those plugins are loaded before yours
if I refer to an item in a list, can I change it?
ItemStack[] list_of_equipment = {someentity.getEquipment().getItem(EquipmentSlot.HEAD)};
itemstack[0].setType(material.LEATHER_HELMENT)
so, does the code above change the armor the someentity is wearing or not.
it changes the armor that is in the list
but it does not change the armor that is on the player
ok
unless explicitly documented, everything that gets you an itemstack is always a clone
meaning that changes to it won't be reflected on the thing you got it from
does this Gets the ItemStack at the given equipment slot in the inventory. mean it gets the actual itemstack?
is there a way to change the armor using a list?
there should be #setHelmet() and stuff
true, thats existing too
he asked this question yesterday and choco or someone gave him the same answer
i'm pretty sure he's illiterate though so not like that helps
no, I asked for help using the list in an if methood
so 80% of that discord? lol
i don't remember if it was you, but it was probably you
it was me
interesting
but the questions weren't exactly the same
yes, you improved your machine translation a bit
i mean, i am allowed to say that, my english is trash as well lol
they were both relating to the list, but one was about using it in an if condition, while this one is about actually changing it(i asked that yesterday, but this time it's using a different method to change it)
would a lot of player skulls cause a relatively small map to lag?
does
list_of_equipment[x] = new Itemstack(armor)
just change the list pointer, or the actuall armor
define lag
client lag
player skulls should be handled like entities
having to fetch the skull skins from mojang freezes the client momentarily
yeah but like consistent lag?
every time your client loads a chunk with skulls in it, there's some jitter
when you are in those chunks
true
a little worse
it's mostly that I cannot notice it so I took so long to figure out what would be causing it
for other players
i remember having about 1k entities on the enderdragon-island
affects low end machines with poor gpu's like shit
wasn't that funny for my pc
thats probably the reason why cyberpunk has such a bad performance
cyberpunk has such bad performance because modern developers don't know how to optimize anything
thats true as well
cyberpunk probably runs on fucking electron in javascript because that made it multi platform
something like this many skulls just clicked for me
thats not how it should be
been having this problem for the testers like since we had the map made months ago
i'm not seeing that many skulls
each floor has pretty much skulls so yeah now it all makes sense
yeah, if you make a big public server, you have to make sure, that players with bad pc's can play as well
or with low-to-middle-class systems
it's a mcc like event not really public
but still better reducing lag causing things for the client side too
i run a slimefun server, and slimefun is a shitty plugin impl of a stripped down ftb modpack
almost all of the machines are skulls
isn't there a client yet that really improves performance?
so people have enermous fucking arrays of thousands of skulls
not like badlion, that just SAYS it does
if you really have to use so fucking many skulls, use a server resourcepacks, and use ingame-skulls like creeperhead, etc
there aren't enough vanilla skulls
there are like 200 different machines and each of them has a different texture
can't spigot optimize that, so it's loaded only one time? or is that a fully clientside problem?
clientside
saaad
the client has to fetch the skins for the skulls
and the client's rendering engine can't handle them very well
MOJANG, FIX THAT
imagine using skulls instead of custom textures
I mean yeah the client can still prefer to not use them but the performance is on a different scale
yeah one of the core principles of the server is that you can build shit as big as you want
which is pretty rare among slimefun servers
since the plugin author is a fucking tard and couldn't make shit run properly if his life depended on it
i basically rewrote half of the internals because otherwise the server would die
how can i optimize that? if i can
what are you even doing
i am putting the player's permissions into a map, because people are hating, because i read them from config every time
and i thought reading them from a map is better
are you trying to write a permission plugin
a small api for my own server, yeah
why though
because i dont like the existing permissions plugins
getStringLIst returns a List<String> not sure why you are looping it and putting each in a new list
dont ask why
i guarantee you it will be several orders of magnitude more shit than the existing plugins
no matter how much effort you put into it
are you writing it as an excercise
i am writing it to use it.
you should use good stuff
why tho
because using bad stuff is worse than using good stuff
sounds like not invented here syndrome
well if that ain't the truth
so maybe you could answer my question, instead of just saying use other stuff
no
if you don't have to say something about my question, dont say anything
no he's right though in this case. you have no reason whatsoever to reinvent the wheel ;p
don't waste your time
so i should use a plugin instead that laggs my server to hell with functions i dont need?
here comes elgar telling you to use groupmanager
GroupManager, Luckperms, or if you want really basic, BukkitPerms.
are you experiencing lag at all?
lmao
because thats what the permissions plugins are doing at my server
lol what a call out 
He knows me too well ๐
pex is not availabe
that's still around?
i don't know, the jar is from like
for like years now
2015
Spigot has permissions.yml
was gonna say, i haven't used it since i ran a server back in 1.8
it's just been lying around for over half a decade and I haven't bothered to change it
yeah, but without a proper permissions plugin you cannot add permissions iirc
cause it works fine
you can give a player OP, that's all
it only occasionally loses data about random players and corrputs the entire permissions.yml file
minor inconveniences
So, i wanna make a terraria style world gen plugin (ie 1 block wide). I have found some info on making a custom Terrain generator, however i wondered if the generator could inherit all the normal data like caves and villages and stuff but then just select, lets say x = 0
bukkit's world generator api is kinda trash
the underlying system has been changed by mojang several times and little to nothing remains of the system the API was originally written to reflect
Right....
which results in something bulky and cancerous and aneurysm inducing to work with
you're almost better off just skipping the api and hooking directly into whatever's happening underneath, if you can find a guide or someone to help you with it
or god forbid write a datapack
yeah I had over 1200 skulls in those chunks
ok, i mean i have been looking around and i haven't really found much
if I ever have to work with world generation i'll probably just throw the notion of procedural generation into the trash bin and pregenerate an entire world with just the regular bukkit api, without touching generation itself
it's going to be super slow and inefficient but at least I won't die from fucking anal cancer while writing it
plus procedural generation has its share of conceptual issues
you often don't have enough information at hand to make things like large structures look good, because nearby areas aren't generated yet
I mean, all i want to do is take the default chunk and wipe out 93% of the blocks
there is a way to delegate chunk generation to the vanilla generator, but I don't think you can actually do stuff with the result
maybe if it's as simple as just deleting most of the blocks it could be done
then again you could just write a chunk load listener that does the same if the chunk is fresh
you could look into what worldedit does, but there are a couple of resources for faster setting of blocks out there
i saw 7smile7's guide a while back
though most of the time you don't really get much benefit unless you skip light updates, which make stuff not look very good
i mean, you could just skip them and then send it at the end?
sending it involves calculating it
which means you'd have to basically reimplement the lighting engine
which is what worldedit and co. do i think
light is server side because of plant growth and mob spawns and shit
Guys, quick question. What is adventure API?
those are all applications of chat components, yes
all text elements the client shows are chat components
adventure is an api for building them
ok, thanks.
Adventure takes a mess and makes it manageable
a mess is a very apt description for what chat components have degenerated into in bukkit
When I often read or write on a file should I have a special class that uses the singleton pattern that make the job or should I use some sort of lock on the file?
depends on what you're doing
the file is created at run-time, read several times and it can be deleted at runtime
what is this file for
save some serialization of objects
what sort of objects
An object that contains some serialized packets
for what purpose
I need to re-send the same packets even after a reload
to whom
to a player
only a single player
not really ;D
dunno
A collection of players
๐ . Thanks anyway, it was funny
no
it must not be absolute coords
it must be in-chunk coordinates
that is, from 0,0,0 to 15,255,15
ok
thanks
What is the best way to set a block to air
Cause if i do this
chunk.getBlock(x,y,z).setType(MATERIAL.AIR)
I get some physics problems
I assume there is some block data to reset or something?
And to clarify, when i say physics problems, i mean server crashing physics problems
[18:31:09] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=391, y=35, z=352} but found not block entity block Block{minecraft:air} at location
[18:31:09] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:air} but failed at location BlockPosition{x=391, y=35, z=352}
[18:31:34] [Worker-Main-8/WARN]: Worker-Main-8 died
java.util.concurrent.CompletionException: java.lang.StackOverflowError
Then about 223,000 lines of errors
you can set to air without physics
just add the false flag
ok
How do i get block break particle for a block?
stack overflow ๐
yeah
are you doing it recuringly?
uuuh i think the uh
setblock on a chunk border loads the neighboring chunks
which fires your event
which sets blocks
ohhhhhhh
which loads a chunk
lol
huhuhuhuhh
remember what I said about procedural generation before
๐ซ
it has its own share of conceptual issues
does disabling physics prevent the loading of adjacent chunks?
i dont need physics anyways
its just air
mmmmaybe but i think it's more for checking tile entities like doublechests crossing chunk borders
it won't care about those anymore
hmm.
thanks, i gtg b4 i can test, will test later
thanks
Is there some nms way that is better?
I canโt test, but sure
@Override
public void setBlockFast(Block block, Material type) {
CraftBlock cb = (CraftBlock) block;
Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();
IBlockData data = CraftMagicNumbers.getBlock(type).getBlockData();
chunk.getWorld().notify(cb.getPosition(), cb.getNMS(), data, 0);
chunk.setType(cb.getPosition(), data, false);
}
it can load a staggering number of blocks
you can optimize it too for better utilizations
๐
Calling a Collections.singleton method inside a loop is a bad practice?
mh, thanks
!varname gets the opposite of a true false variable right? cuz when i do this if (getSpawned(loc) && (getUnlocked(loc) == false) {
it tries to change it to if (getSpawned(loc) && (!getUnlocked(loc))) { but i want to run this when getunlocked == false, not the opposite of it
or returns true only when that var is false
That is correct
! is an unary operator that inverts a boolean
!boolean is preferable over boolean == false
yea but it returns false when its true
and i dont want to run it when its true
only when getunlocked == false
what
if (!getUnlocked) will only succeed if it returns false
should i just ignore the suggestion?
but we're calling it negative
no? why would you do that
everything can be an unary
but the other guy is saying that it inverts the boolean
Correct
if the function getunlocked returns false, cuz it inverts it to true and runs
if it were static, yes
oh
if it's an instance method, it'd be a binary operator
if (!false) {
// this will run
}
if (!true) {
// this will not run
}
since the object it's called on is technically an operand if you look at it that way
a zero-parameter instance method would probably be the closest to an unary operator
why no one uses if(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!true)
real men use (true ^ var) to invert
but is there a real advantage to it??
in java i don't think you can do that
it is
no
but still
for not-booleans, it's a bitwise xor, for booleans it's a logical xor
it works for that
booleans get special treatment in a lot of places
wut
boolean bool = false;
boolean boolAfter = bool ^ true;
assert (bool != boolAfter);
you mean for when they both the same
yea
got it
that's why i was confused
cause of type safety
booleans get special treatment
it's the only primitive that isn't upcasted to int/long automatically
How can i get the user total playtime?
String executorPlayTime = String.valueOf(executor.getStatistic(Statistic.PLAY_ONE_MINUTE));
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Statistic.html#PLAY_ONE_MINUTE
But read the comment regarding the name
Yes, but that's not working
07.05 21:50:32 [Server] ERROR Could not pass event PlayerJoinEvent to HttpPoster v4.3
07.05 21:50:32 [Server] INFO java.lang.NoSuchFieldError: PLAY_ONE_MINUTE
What version are you on?
java is 1.8
spigot version
uh
Works for me...
owo
no, my server is 1.12.2
Big brain moves ๐
You can assume forward compatability in most cases. Backwards not so much.
there is zero reason to build for and run in a different environment, anyway
So... is there another way without storing manually user time?
dunno, yes, probably
build against 1.12 and see what the IDE autocompletes for you
the statistic was stored by the player for sure in 1.12
but idk if there was api to retrieve it
He is looking for time that is already tracked
Yup