#help-development
1 messages · Page 679 of 1
I am redoing a project from scratch
I just realized I ended up in the same alley
So, am I fine prefixing abstract classes with "Abstract" or am I meant to use "Base" prefix?
I've seen people discussing about it yet I got no clue why the issue
You're fine to name them whatever you'd like. You don't have to have either if you don't want. Some consider "Abstract" and "Base" to be redundancies
I mean, I never prefix abstract classes
So long as you're abiding by CamelCase convention for class names, it's down to preference
Sometimes I get this issue that I named the interface with the name that the abstract class could have
So the interface just provides the methods but the abstract class holds the attributes that I know are always going to be recycled at least in my implementations
Then yeah, Abstract prefix on that makes sense. I'd probably do the same
But again, preference. Either works. It's just a name after all
Tell that to X Æ A-XII
how can i see what a method in an interface class does?
Choco
I was about to ask you
How can I pull request?
I just found something that might be useful
But I'm not sure if it might get added. So, as long as it's not a LivingEntity, it's 100% possible to teleport it being a vehicle and both vehicle and passengers will get teleported
Once they are living entity this cannot be done
I got the method that works using reflection, the issue with using reflection is that it points to an obfuscated method so it might stop working in the future
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.
Method is useful because there's a current issue with display entities into which their teleport interpolation doesn't work. It seems the root of the cause is because these entities have transformation and such.
But a quick fix for it is that client reverts it if the display entity is a passenger of a vehicle!
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
I got it the second time around
Methods in an interface don't do anything, they just guarantee that they exist and have an implementation somewhere by some instance.
If you mean Bukkit's interfaces, it's all implemented by CraftBukkit and you can find their implementations on the Stash
the thing i want to is getting player head's itemstack
someone told me this method causes a heavy freeze and lag to your server
Right because it has to lookup the player's skin data
so what should i do
There's not really much you can do. Pretty sure profile lookups have been at least marginally improved in modern versions
String dataFile = plugin.getDataFolder().getAbsolutePath() + "/db/" + databaseName;
try (Connection db = DriverManager.getConnection(dataFile)) {
if (db != null) {
System.out.println("Created/connected to new database: " + db.getMetaData().getDriverName());
return db;
}
} catch (SQLException e) {
System.out.println(e.getMessage());
}
This is giving me No suitable driver found for C:\Users\micha\Documents\Adagra\TestServer\plugins\AdagraPlugin\db\data.db
Shouldn't it create a new file if it doesnt exist?
the location is accurate, does java.sql.DriverManager need extra perms? they should be covered by the server itself no?
oh wait i think I need jdbc:sqlite
aha
Is it possible to mix a 4gb ram and a 8 gb ram?
I mean they have the same frequency
it is
you'll only have dual channel on the first 8gb
and the last 4gb are in single channel
i do recall that the other three values have to be the same tho
like voltage n stuff
well should
voltage barely matters
you can mix but it can cause issues 🤷
timings and frequency will default to a common point
I mean I've been getting DRIVER_NO_LESS_OR_EQUAL BSODs but it got little to do with my ram afaik
what does dual channel actually do tho
bandwidth
isnt the bandwidth dependent on the memory controller
howd sticking two ram sticks into a computer help with that
it's weird but it allows you to basically access the data in parallel
or well
Each slot is tied to a channel
And your motherboard's memory controller manages the memory channels
im assuming it just fragments the data across both sticks then, reducing the amount of data each has to handle?
It moved to each stick in DDR5
Basically the memory channels is what your memory controller uses to communicate with the sticks themselves
Certain slot configurations trigger certain channels
So for example if I only have Slot A & B, on a dual channel configuration, Channel 1 is for slot A and channel 2 is for slot b
And some channels have quicker access, which is why motherboard vendors recommend you use the further slots first or whatever
ive no idea which channel on my motherboard is which
Model?
stupid manufacturers and their idea of preventing repair lol
It's usually AABB
Uhh how many slots u got?
2
Then yeah
Slot 1 runs A and slot 2 runs B
their names are irrelevant
Just know that you want to run 2 sticks of the same size
Swear is abab
i mean i could or i could leave in the exact same manufacturer, model, voltage and speed 8 and 16 sticks
I'm not a motherboard engineer
Why not
At the moment I run 2 mismatched sticks
both overclocked beyond spec
Works fine
Make sure they're the same size though
I gave my homie a 16gb stick, while he had 2x4
And he ran 1x4 + 16 and it was shit
eh like i said, the 8/16 makes mine lag less currently
ill grab another 16 if i get the chance
Until I bought him another 16gb stick
And 2x16 made his cpu faster
because ryzen is sensitive to memory
im on an intel cpu that can self boost from 2 to 4 ghz for some reason
why not run at that speed natively i dont understand
but yea thanks mostly to windows bloat, im faster on size mismatched memory sticks
https://github.com/hibatica/AdagraPlugin/blob/todo/src/main/java/io/adagra/adagraplugin/discord/accountlink/DataStorage.java
Im aware that this code is completely fucked, hence the commit message.
Do I have to rewrite this to connect and disconnect to the database every time I use it?
Im working on a plugin with a custom crafting recipe, this is a plugin for a bedrock and java server, when crafting this item it apears in the crafting window but when clicked it does nothing, here is the code for the item (other custom items for this recipe works fine just this armor set being weird)
// Boots
ItemStack InfernoBoots = new ItemStack(Material.LEATHER_BOOTS, 1);
LeatherArmorMeta InfernoBootsMeta = (LeatherArmorMeta) InfernoBoots.getItemMeta();
InfernoBootsMeta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(UUID.randomUUID(), "generic.armor", 4, AttributeModifier.Operation.ADD_NUMBER));
InfernoBootsMeta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(UUID.randomUUID(), "generic.armorToughness", 2, AttributeModifier.Operation.ADD_NUMBER));
InfernoBootsMeta.setColor(Color.RED);
InfernoBootsMeta.setDisplayName(ChatColor.GOLD + "Inferno Boots");
InfernoBootsMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
InfernoBootsMeta.setUnbreakable(true);
InfernoBoots.setItemMeta(InfernoBootsMeta);
ShapedRecipe recipeInfernoBoots = new ShapedRecipe(new NamespacedKey(SharkSMP.getInstance(), "InfernoBoots"), InfernoBoots);
recipeInfernoBoots.shape("BBB", "BAB", "BUB");
recipeInfernoBoots.setIngredient('B', new RecipeChoice.ExactChoice(EBlazeRod));
recipeInfernoBoots.setIngredient('A', new RecipeChoice.ExactChoice(EmberBoots));
recipeInfernoBoots.setIngredient('U', new RecipeChoice.ExactChoice(InfernoCore));
Bukkit.addRecipe(recipeInfernoBoots);
on testing, when changing the recipe to non custom items it worked, so its something with the custom items
I'd just use PrepareItemCraftEvent
how does one store data for a placeable item and retain the data for the item even if the block is placed and broken?
So, I made a system where you can add a system book with nbt in a slot in an anvil and a item in the other to make it so it "stat traks" the item, the system works fine producing the item, but when I go to retract the item from the inventory it doesn't move. I don't have any code cancelling any event in the entirety of my code, what's happening?
Is there a way to override an item’s max item durability? I see you can get it, but can you set it? For example, if I want to make a pickaxe last longer without enchants?
simplest way is to reduce the damage it takes in teh damage event
java.lang.ClassFormatError: Illegal class name "[YOUR PACKAGE]/inventoryframework/gui/type/ChestGui" in class file me/pulsesapphire/mainscript/GUIs/OnJoinSelection/OnJoinSelectionGUI
Thanks
I'm going to guess you never inserted yoru pagkage name
Is it called “[YOUR PACKAGE]” LOL?
Am I tripping or did you edit your message without it showing up as edited
nvm it's 5:30am I'm tripping
?paste
its not, look at the pom.xml.
you didn;t set yoru dependency for the framework to provided
as you are relocating with shade
probably
i have not really done this shading stuff before, i may need a guide.
I've not used that framework so I'm guessing
am i compiling it wrong perhaps?
intelij?
yep.
right side of screen is a maven tab, in there find lifecycle then package
oh, i was using the compile option under the same tab.
it has been a while.
ok yep, it works now, i may have just been compiling it wrong.
I have this set up but I dont think this is the correct way to do it
@EventHandler
public void onItemCraft(PrepareItemCraftEvent event) {
ItemStack craftingResult = event.getInventory().getResult();
if (craftingResult != null && craftingResult.getType() == Material.LEATHER_LEGGINGS
&& ChatColor.stripColor(craftingResult.getItemMeta().getDisplayName()).equalsIgnoreCase("Inferno Leggings")) {
LeatherArmorMeta armorMeta = (LeatherArmorMeta) craftingResult.getItemMeta();
armorMeta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(UUID.randomUUID(), "generic.armor", 7, AttributeModifier.Operation.ADD_NUMBER));
armorMeta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(UUID.randomUUID(), "generic.armorToughness", 3, AttributeModifier.Operation.ADD_NUMBER));
armorMeta.setColor(Color.RED);
armorMeta.setDisplayName(ChatColor.GOLD + "Inferno Leggings");
armorMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
armorMeta.setUnbreakable(true);
craftingResult.setItemMeta(armorMeta);
}
}
You can just match the recipe yknow
like im so lost, there is like 20+ custom crafting things and this is the only ones that does not work
Anyways I'll check in a bit, having tuna for breakfast right now
whats the difference between spiget and the actual spigot api
spiget is an illegal distribution
?
its illegal to distribute a compiled binary
where do they distribute a compiled binary
I thought spiget distributed a sompiled jar
spiget is a resource api
you are thinking of get bukkit
spiget is a helper layer on top of the API exposed for the spigot resource forums
ah
I wonder how bad the spigot resource api must be for spiget to be a thing
Isn't spiget a distribution site?
How can I make people disable turning off fire and candles or torches?
if (event.getClickedBlock() != null) {
Block block = event.getClickedBlock();
if (block.getType() == Material.FIRE) {
event.setCancelled(true);
}
Material blockMaterial = event.getClickedBlock().getType();
// Add more blocks as needed
if (blockMaterial == Material.CANDLE || blockMaterial == Material.LANTERN) {
event.setCancelled(true);
}
}
}```
Interact event but doesn't work
for the fire you would need some block break event
and turning off candles is with right click, not left click (that would instantly destory candles iirc)
Also, lanters can't even be turned off with right click, only broken
Do you have 1.20.1 in your plugin.yml ?
'cause I think only 1.20 is allowed, the minor versions are not taken into account
Is there a way to spawn a beacon beam?
ah ok
only with a beacon iirc
it is not an entity so you can't "spawn" it
packets?
use fancycraft lmfao
it is tied to the beacon tile entity
so no
i need mode
wait you mean client mod ?
Why are you asking here....
yes
You can use packets to create a fake beacon for the beam if you dont want to make actual beacon blocks
Dude I barely know russian
I was joking since you used wrong language
You are restricted to 50ms
wyum
Tick interval for both client and server is 20tps which if you do the math comes out to 50ms per tick
He's asking for a client modification
?whereami
you are developers with great experience (probably) I think you have dealt with these mods
I am aware, but the point i am making is that a more sensitive mouse input has the restriction of 50ms, unless they are talking about the sensitivity of the hardware to register a movement in which case you need a mouse that has a higher polling rate
The client doesnt control how fine or slow you move or quick only that it can only process a limited amount of inputs in a given time
not all of us are, you should prob go to the fabric cord or neoforge discord
oki
I am assuming they are wanting this mod so they can have a higher sensitivity without changing the hardware and this works by sending more movement inputs and basically want to be able to 360 nope scope everywhere
yes
It could be done
I thought they meant change the sensitivity (the one that is in options) when engaging in pvp
set up in minecraft
Just have to change the mouse sensibility mc comes with while in combat state
a
Yes but the limitation is 50ms still unless you also mod the server to change this
each tick is 50ms but clients are not limited to 50ms of actions
He wants to change it purely client side most likely to join pvp servers with
a client has built in rate limiting, but it could be overridden with a mod
Yes but the server isnt going to register it at the same rate
hi guys i have a problem my method didnt check my hashmap 1m i will send my code
it can be done as the server has no restriction on teh number of packets it can process in a tick.
at least it didn;t
send the code with the question smh
i did thisjava if (args[0].equalsIgnoreCase("red")) { if (args.length > 1) { sender.sendMessage(setMessage.usageMessage("/discord red")); return; } if (discord.sentUsers.containsKey(sender.getName())) { sender.sendMessage(setMessage.correctMessage("Discord eşleştirme reddedildi!")); discord.sentUsers.remove(sender.getName()); return; } sender.sendMessage(setMessage.errorMessage("Herhangi bir Discord eşleşme isteğin yok!")); } but my second if not working
and this is my other code
for put value to hashmap
There is restrictions and while true the netty thread could process packets incoming not everything can be done in an asynchronous fashion like player movement. That has to be synced to main thread
at this my contains if working
like a mod like AI when a more optimal sensitivity and drawing distance is configured based on screen size data, on the skills of my opponents, etc.
like AI
Yeah no, I highly doubt that exists
is expensive to order
?
But i am not in support of mods that promote cheating either
?paste
this not cheat
just get rid of the routine of adjusting the sensitivity
To increase the amount of inputs further then what vanilla allows or would normally allow which would give you the advantage over other opponents? It sure seems like it.
hi i need some help im making factions plugin and i have in my database collection called profiles which stores profiles and collection factions which stores factions and in my database i have key faction which has value of faction name (where player is member of that faction) and for some reason when i try to get value of faction even though it is set it returns null and i cant figure out why does it happen
https://paste.md-5.net/rumucamaha.java
There is no errors in console just to be clear neither in IDE or anywhere else so im clueless and i dont see why wouldnt it work
just make a keybind to adjust the sensitivity without having to go to settings
Wait, why not change the dpi with your mouse?
But regardless i am not aware of any mods existing that do what you are asking for
this is not the problem, I don’t know how to understand what needs to be reduced or added
They probably have sub par hardware that doesnt have this ability only other way to get around this is to send more inputs more frequently to simulate a higher dpi
any help pls ?
idk why you're so fixed on "increasing inputs"
Just increasing the sensitivity (the option) would suffice, no ?
That is what that option does
Yes when done via software side in application its just increasing the rate at which inputs are sent or processed
This is historically the way sensitivity worked because you know old hardware only had one setting for mouse polling lol
But we have since progressed to hardware based settings which is better but not everyone has those so the setting in application remains
Is that possible to force values in a config.yml file to be some values?
For example, if the value is negative I want to return it into the default value
I don't want to allow certain values
If you set your conditional checks appropriately definitely
no in built way of doing it if thats what you're asking
would be pretty easy to implement
Or you can just ignore negatives by using absolutes
Then it doesnt matter if its negative positive it will always treat it positive and when saved back it would be proper again
Without changing the number
Absolutes is part of the math api in java just fyi
what are the default minecraft fonts for components?
How do I edit the config file through the code?
Like set some values to some variables in the config file
I believe we have a command for to link the config tutorial
But i dont rememeber it lol
?config
add an s
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
There we go lol
thanks
hi elgarl can u help me ?
i save datas to hashmap in some class and i can use hashmap methods example like remove in same class
but if i try to use methods for my hashmap in another class not working
i did this
at another class:
DiscordEvents discord = new DiscordEvents();
discord.sentUsers.remove(sender.getName());
discord will be a new instance
at hashmap class
public class DiscordEvents extends ListenerAdapter {
public HashMap<String, Long> sentUsers = new HashMap<>();
wdym
as you are accessing your map via discord.sentUsers, it's not a static Map
therfore every time you use new DiscordEvents() you are creating a new Map
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Static bad learn oop
static bad sometimes
Static has use cases but you must understand the concept
true
is bad use for this ?
yes
its a Listener so shoudl only have one instance
aight
can i ask something ?
i have configmanager
you shoudl pass that instance to where you need it not use new Dicord...
Many people are going crazy whenever they see the static keywoard inside some source code. That’s ridiculous, because it alleges the people who developed Java were totally stupid. It is true that the static keyword gets abused by many people, but there’s a difference between static abuse and proper use of the keywoard. What does...
TL;DR: You can declare everything as static that either describes stuff about the class itself, or that will never be changed in any object instances.
how can i find source of a memory leak in my server?
the heapdump is not that clear to figure out what is it
for example it says Byte[]: 2GB
What's returned when I do Material.getMaterial("not a material"); ?
Does it return null?
You use a proper profiler that lets you calculate paths to GC roots
read the javadocs
The idea behind debugging memory leaks is to look at how many objects of a certain type rather than looking at the big numbers
For example, if I know I'm only running 1 minigame instance at any given time, if I see 2+ instances in the heapdump I know I have a leak there
I use YourKit with a weird personal license I got my boss to pay 100$ for
right, this memory leak does not happen immediately after running the server, it happens ofter ~6h
i don't know if it is one of my plugins or not
well i can't afford 100$ for YourKit too either
✨ free trial ✨
sounds nice, thanks
You can run those inside VMs if things get desperate
YourKit is free for open source projects
you only gotta email them with your github link sales@yourkit.com
visualvm is great
You should also learn about some things that can easily cause memory leaks
Like adding stuff to collections and never removing them
This includes using player objects as map keys, because the object is tied to the player lifecycle and if not removed, causes duplication with new players
(they should just override CraftPlayer's hashcode to redirect to the uuid)
Im pretty sure its not my fault
Yea
private static void blocks() {
File file = CustomItemApi.blocksFile;
Gson gson = new GsonBuilder().setPrettyPrinting().create();
if (CustomItemApi.cBlockList == null) {
return;
}
HashMap<String, String> stringHashMap = new HashMap<>();
CustomItemApi.cBlockList.forEach((key, block) -> stringHashMap.put(key.asString(),
Base64.encode(block)));
try (JsonWriter writer = new JsonWriter(new FileWriter(file))){
gson.toJson(stringHashMap, new TypeToken<HashMap<String , String>>(){}.getType(),
writer);
writer.flush();
System.out.println(stringHashMap.size());
} catch (IOException e) {
Bukkit.getLogger().warning("Failed to save blocks");
throw new RuntimeException(e);
}
}``` Why does this nothing? There is something in the Hashmap, it prints 1. Still, the json file is empty.
if i send my project class can u tell me my static mistakes ?
just don't use statics unless it's a constant, or instance
What should I do?
or util
But honestly I like to try my best to stay away from util classes idk why
what's the cause of net.minecraft.server.CancelledPacketHandleException when executing a command?
send full stacktrace
Util but better name
i mean i'm using a util class to do all my vector math
is it thrown from inside a runnable?
?paste
Only about ~3% of my classes here are util classes
https://paste.md-5.net/qihukexaqo.bash this is the entire exception
And half of those are adapters I could just remove
Because I converted it to an interface already
put the whole EssenceCommand into a try/catch, then catch Throwable and do printStackTrace()
that should give you a proper stacktrace
whats final do in a class declaration? prevent extending it, right?
also this only happens when i login, logout then log back in
if i execute the command once after i relog, nothing happens
if i execute it a second time i get the exception
as said, wrap the whole method into a try/catch and print the stackTrace, then you'll get a proper stacktrace
nms time
bleh i have to do some nms soon and i aint looking forwards to it
What should I do with it?
save it to the file
it returns void
What's the way to remove a wolf's death message?
Unsetting the owner of the world during an EntityDeathEvent doesnt seem to work and event.deathMessage or event.setDeathMessage doesn't exist.
maybe cancel the death event and remove the wolf otherwise
iirc entity has a method that doesnt trigger deathevent
You can cancel death events?
paper
huh
?whereami
hi i need some help im making factions plugin and i have in my database collection called profiles which stores profiles and collection factions which stores factions and in my database i have key faction which has value of faction name (where player is member of that faction) and for some reason when i try to get value of faction even though it is set it returns null and i cant figure out why does it happen
https://paste.md-5.net/rumucamaha.java
There is no errors in console just to be clear neither in IDE or anywhere else so im clueless and i dont see why wouldnt it work
ehh not a fan of that static map
You could use a dedicated registry class
I'm also not a fan of doing all the mongo stuff there
Single-Responsibility principle exists
You can also skip the entire document thing given you're using mongo and just write a codec
and have a PlayerData collection directly
i want to use it this way i just cant figure out why is faction value null when it is properly gathered and written in database
no clue just debug it all ¯_(ツ)_/¯
i wanna check if chunk contain any ProtectedRegion in themself, i need to check all of blocks one by one?
You might be able to create a CuboidRegion of the chunk's bounds and getting all the regions within that cuboid
No clue if worldguard's api allows for that but it might
How? toJson gets the JsonWriter, and returns void.
your file itself might not
how can I serialize an Itemstack to a string?
I would avoid that tbh. Does it need to be a string?
Because if it's for persistent storage, I would opt instead for Bukkit's object input/output streams to read/write as bytes
ItemStack.toByteArray when
It would just be a utility method that you can already do with the API
It can be done with NBT directly though and skip the output stream
Performance!!!
📄
I need some help on how to get started with a boss system. I've never done this before and I have no idea of how it works. How would you guys start?
You start with a design document. Write out exactly what you want your boss system to do.
onEnable is getting when server opening ?
or whenever the server is online
When your plugin enables
:p
actually cant you switch that in plugin.yml from onEnable to onLoad ?
Hi, i make a land claiming plugin. On event like break, place etc... i need to check if the current chunk si claims. When i load theys chunks? All chunks on server start? Just load a chunk using on chunkload évent ?
onLoad gets called before worlds are loaded n such
no give me a moment
Init plugin, onLoad -> load worlds -> onEnable
There is a config parameter for that
if i do on enable
@Override
public void onEnable() {
ConfigManager configManager = new ConfigManager();```
Will configmanager always stay in memory?
It will for the lifecycle of your plugin
Once your plugin gets unregistered, assuming no memo leaks and no static, it dies too
Which is fine
can i make it static then?
it will stay in memory until the scope enable finishes
or even earlier
if it doesn't use the variable at all
N o
not sure how it works
What's the point
you cant make static variables in scopes that aren't a class
i ask for learn
so if on enable ended this will remove from memory
yea
what i tend to do is something like
class main extends JavaPlugin {
static FileConfiguration configuration;
@Override
public void onLoad(){
configuration = getConfig();
}
}
As far as I remember, it wont get garbage collected
no point in static
Like, yesterday I just did it
What I tend to do is just have an "AbstractConfiguration" class that you extend and pass filename and plugin
And it has getters n shit
Instead of making ConfigManager an attribute/field of JavaPlugin, I made it inside onEnable scope
No issues!
I keep everything in something called ManagerDirector
weird name
Then just open ManagerDirector in JavaPlugin
you could name it director
ManagerDirector holds ConfigManager
name it Relay or something
ConfigDirector
Anyways for multi-platformizing this system
I called it ManagerDirector because there’s an object called ObjectDirector
It's really not that hard
It’s for serializable objects
So an ObjectDirector has an ObjectManager and an ObjectBuilder
I think it’s just weird naming
Anyways
Algorithm is the best
pro tip: make a Reloadable interface for reloading your plugin stuff
I did
instead of a method that manually does it
hey
There’s even methods for proxying the ManagerDirector
what happend with bukkit downloading page?
Because BlobPlugin (extends JavaPlugin) needs to expose getManagerDirector
Who's the idiot flashing their 
that's an illegal website lmao
i don't think it illegal
It is
It's literally illegaly distributing copyrighted code
You don't have to think, it is
Want to get spigot? run buildtools
You are meant to build with buildtools
not sure if its legal or not, but not official
can you help me download bukkit craftbukkit1.19.4 plase
Just because they are not getting DMCAed doesn’t means its legal
It's literally illegal
…
schnitzels 
Why craftbukkit??????
Download spigot in the worst scenario
?bt
I should stop drinking red bull my neck is twitching
uhhh i am the craftbukkit lover XD
aren't we all
I wonder how many plugins just won’t run on cb
Since it doesn’t have the bungee chat api
try them all
Are you aware most plugins won’t run on your server?
challenge: make an auto downloader
that automatically renames plugins
or whatevr
and let's try running 65k plugins
hmm i don't think so it old but good enough for my server
It neither has plugin messaging nor anything related to bungeecord
Dude
This is help development
Not help server
API for folia is the same as spigot?
some changes
Mostly for schedulers
There's a wrapper that you can migrate to support both
hey Illusion wish me luck, im about to swap my ram stick
it's literally a ram stick
you dont know my luck
I'm starting to feel like I'm a local celebrity in this server
nah youre just some dude with a pink name :D
I notest something strange
https://paste.md-5.net/secuvukupi.cs
If i equip the item it doesn't get called the first event (EquipAction)
But if i unequipped the item it gets called together
So they can nullify each other, any fix
(i tried making the itemstack into getting the newSlot)
like other 17 peoples
tbh most of this is coz he advised me earlier
You can de-duplicate stuff
what?
yes
yes, but about the problem?
Can't bother actually understanding it
so if i equip they get called each other
something tells me it has something to do with how they're both the same event type
but it doesn't exist an event for unequiping an item so i need to use the same event and get the previous slot
eh
so this is what i did
i made crash my computer with a Ryzen 7 6800H and 16GB ddr5 with a server hosted and intellij at the same time opened with mc obv with while
i've a good pc too i have no idea why this crash happened
32gb of ram and a R5 3600
i just clicked on gradle jar 💀
btw about i run some games with rtx and they work fine the cpu stays at 90 degrees
so illusion about the unequipping problem
hey look we have the same gpu
never tried warzone i don't like the cheating problem etc
nice
Warzone 2 has no cheaters
omg white mode
I'm not a win11 user
even same gpu
rocking win10 pro with a key I bought on ebay for 2$
you paid for the key?
wtf
why its 55c in ~idle? 🤔
upgrade it to 11
I was bothered it didn't let me drag files into the taskbar
when i boot up my pc, the desktop is froozen for first 10 second
across apps
amateur stuff
for like 2 years
win11 i see has more performance about gaming don't know how with my 3070 ti it works fantastic and it boot even more faster than win10
😂
nice
unfortunately my parents are broke
haha, get it yo self
and I don't speak to them
gotta hustle!
That's what I've been doing since I was 12
I'm happy to be where I am :)
I don't need a 7900xtx
I literally make minecraft plugins all day
yea me neither, i've ~140 fps in Warzone 2, but it is nice to have 🥲
yeaa u defo dont need a too powerfull gpu for those
yea 6600 is enough for 1080p gaming
7,5$
my monitor's 1440p
:/
I want to get a 4k for coding
but I'm not gonna drop 2k on a gpu
then you can't play apex
I got better things to waste my money on
lol
Like renting an apartment for a week immediately after an international trip 
i wanted to get one of those sick oled monitors
nice
but then i saw they are like 1k
web summit's like 2 weeks after my planned trip to the states
and I got free dev tickets so might as well go there
It's like 2 hours away but eh
i have one they ARE SPECIALS with rtx
y'all have too much money
yea i hear the colors are soo good
my first game with my computer was dl2 with rtx at max, the first scene was AMAZING light effect after i couldn't play games even mc, i saw the color of life can't explain the feeling (my monitor is HD)
native resolution: 4K
render resolution: 144p
something like that
yeaa its like going back to 60 hz monitors after using 144hz
impossible
haha
1440p or you are going to have a really bad experience
1440p is nice for coding
I bet 4k is even nicer
until then
I work with what I have
I just use whatever lg ultragear was cheap
Gigabyte Q27 if its still available to order
looks like it is
for being the one with friend who couldn't even play simple games to the one who could fire triple A games (even if they sucks rn)
well I'd like to see my text in larger font than 5mm
get a bigger screen
its a nice monitor with a wide range of colors
144Hz overclockable to 165
now waiting for getting 32GB of ddr5 or a NVME for 1TB (but don't know)
meanwhile me codding on a 900p monitor
well
arent all monitors HD nowadays?
You'll get to this point eventually
I used a shitty laptop with a 768p screen, 1tb HDD and 4gb ram
for like..
6 years?
Did like 4 years of java on it
when you compile something, this happenes
oh yea i used to code on a laptop as well
i don't see nothing wrong
intellij takes like 20 seconds to open the project lmao
wait for you 20 seconds for me opening the core of my friend server was 3 minutes
you can't see half your own lines
Took 3 minutes to compile back in the day
I sold everything I had and slowly built my pc over the course of like 3 months
well luckily its much better for me these days
yes i have to close everything
my grandma would give me birthday money and I'd buy a motherboard
intellij opens in does all its shit in legit like 3 seconds
i love this pc
anyways I managed to build the entire pc except I forgot 1 thing
20 minutes and i couldn't even run a server in local or mc
perfection!
nice
lmfao
did a lot of coding like that
i used to sit on a folding chair XD
and because I was still like a 10th grader I'd use my school laptop under the sheets
at night
no i spent the monitor budget on everything else, mouse, keyboard, mic, chair, desk and ...
I used to sit on those garden chairs with the thin backs
even more
my 3$ mouse worked fine
wth
louder keyboard makes you a better programmer right?
but yeah over the years I've been improving my entire setup
yeaa same
went from a shitty tiny 10 year old desk to a 30$ ikea desk
and when it went from a _ to a U
I just bought a wood slab and built my own
Monitor arms are underrated y'all
very convenient
I used to occupy 70% of my desk with just the monitor stands and shoeboxes to lift them
Now they free up space to have chicken nuggets
yea monitor stand frees up so much space
i turned the development help into a computer topic with an image of blue screen lol
time to get to work then eh 
yea me too
rip
work is over rated
make a business and sell it for millions
nah dude still suffering of fixing this fucking Unequip
nice selling crypto scam to kids thats my future
even millionaires have dumb ones, just got to find them is all 🙂
i made something like that once
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onItemHold(final PlayerItemHeldEvent event) {
final Player player = event.getPlayer();
if (!player.hasPermission("annihilationx.staff.editupdate")) return;
PlayerInventory inventory = player.getInventory();
Optional<ActivePlayer> optional = this.profileModule.getCachedProfile(player.getUniqueId());
if (!optional.isPresent()) return;
ActivePlayer activePlayer = optional.get();
ICustomItem current = getCustomItem(inventory.getItem(event.getNewSlot()));
ICustomItem previous = getCustomItem(inventory.getItem(event.getPreviousSlot()));
if (current != null) {
if (previous != null) {
if (previous.equals(current)) return;
previous.onHotbarUnfocus(activePlayer, event);
}
current.onHotbarFocus(activePlayer, event);
} else if (previous != null) previous.onHotbarUnfocus(activePlayer, event);
}
maybe this helps you?
tip: enable this option, you can thank me later
where
appearance settings
you might also wanna set this registry key
6 gives you 50% less indent on the file tree
intelli'j small indent has value of 1
which is for me too small
6 is perfect
the space like new line for files?
these
that means default, which is 11
ah i see
this changes the value to 1
yea thats actually nice on 6
This currently the code https://paste.md-5.net/rosacowiso.cs but i can't determine if it detects it or not
one more thing i was looking for. lemme send a ss
what is this
makes line numbers this long
or this, is this one configurate able too?
well ur checking if the new slot has pickaxe in the name so that aint gonna work is it?
u should be checking if the old item was a pickaxe i guess
you mean the indentation spaces?
but if i did that then it's the same as the equip and they fire the same time
whatever it is, i don't know
the space before the new lines
yeah
generally 4 is standard
it only works if the item next is a pickaxe only for that then it doesn't work (im using old slot)
those buttons cause it to be wider
can i hide them?
theyre useful tho
not for me
whats ur code for that
u should be using the old item there no?
yes
thanks, i'll disable them all, useless for me
and now they call each other so equip and unequip at the same time
use tags instead of contains _PICKAXE https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Tag.html#ITEMS_PICKAXES
declaration: package: org.bukkit, interface: Tag
tags are rly useful i only found out recently
that they exist
in the equip one you should probably be using the new item instead of getiteminhand
even if its just for consistency
probably in fact i was trying that
Hey, I have a custom event that gets called in certain conditions from other events. If I implement cancellable, how would I need to make it cancel the initial event? Or is that automatic or something?
no you'd see if your custom event was cancelled wherever ur calling it
and cancel the initial event if thats the case
Hmm, okay
What Disk space do you guys recommend for around 20 or less plugin and 10-20 player base?
if all the plugins are empty and the players have to survive in a void then you only need a few gigabytes
max
Also is it against some rules maybe to store player info(s) like IPs?
clearly not coz i got banned for that on a server once
Okay
dont think its against any rules to store them but rather frowned upon if you don't have a good reason to do so.
so i want to determine a Player Timezone or soemthing like that
fair enough
cant you just ping their ip with a time request?
okay
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
i'm ready to upgrade my config manager 😄
for custom configs am i need statics ?
with generics
nope
bro idk my brain fcd*
can u help me ?
what with
well i will tell now
i have configmanager class and i need get Plugin class for do this
use di
well i did this https://paste.md-5.net/keholexewi.cpp
now how can i use my configmanager in my database class ?
well this is bungee
keep an instance of the config manager in ur main class and have a getter for it
and i need create config files
wdym for that idk
can u give me any guide for this ?=
helps me understand better
private ConfigManager configManager;
Set it on enable
then write a getter
its basic java
good fookin lawd
quiltflower is good
i found a plugin to replace fernflower decompiler in intellij and now the material class doesnt just die
who needs decompilers when sources exist 🧠
true
yeah the reason intellij tries to decompile and kills itself is because it doesn't have sources attached, so it tries to generate them instead
yeah i disabled the built in decompiler plugin bc of it, quilt works better at it than fern
are Block objects mutable and reused?
if i .getBlock() somewhere and then store that object, and in the meantime the block changes, if i use the previous block object does it have new or old block data?
this is going to sound very specific, but can i send an email without having an email address?
i cant think of a better way to send a status update right now
Uhh that sounds weird
alright let me specify
I have a string representing data and i need some way to guarantee I'll get that data. I would like to do that without having to rely on other, software, and would like to get that data without having to run a 24/7 server somewhere
who would receive the email
depends on the data? I might need this later, so I'm trying to figure this out rn
oh right
well just make like a noreply email
the email has to come from somewhere
You can't just send an email from the nothing
well with how you can host your own email servers, i am fairly sure you can
If that was possible you'd get tons of spam mail
yes but it would still be sent from an email, even if its like a temporary one or no reply one
the sender is required to send an email
I mean if i can spoof the protocol it would look as if there's a proper email address behind it
the annoyance i have with that is the reliance on outside services
like what
If you can host your own email servers why don't you host an actual server? it doesn't have to be http(s) of course, and every cheap vps provider will offer you a port within the four digit range
?paste
Hi im new to writing and sending packets and i wanted to send title and subtitle but it doesnt appear on screen so i wanted to ask some of you am i doing everything right ?
whats your version? there's a spigot method for that in modern ones
i dont think i have access to port forwarding, like i said, data collection
does it need to be a packet for some reason?
legacy bc im making factions plugin so im forced to do so i guess
i guess yes 🤷🏻♂️
why is that
i just prefer legacy and 1.8.8 for such stuff
personal preference
uh the point we were trying to make is that you should download sources for your dependencies but that works too, it'll take its fair share of resources anyway
im forced to do so
personal preference
🤔
how does factions require an old version? do faction plugins not work on modern versions?
my intellij doesnt like to download spigot soures
maven?
Shift Shift > Downloa Documentation
it does but pvp is better on legacy versions everybody who is still playing such gamemodes agrees to that
pvp is bette ron old versions? From what I know pvp in 1.8 is just spam clicking and requires absolutely no skill at all
gradle
W-Tapping:
A-D:
Tactic:
that is your opinion lmao everyone has different opinion
It's hard to explain 1.8 pvp, but it requires lots of skill
and 1.9+ does not require the above mentioned things?
I don't see people W-tapping in 1.9 lol
idk I haven't seen any 1.9 server since 1.10 came out
am i use statics for one variable ?
like for get my config
and database ?
people dont really prefer that delay you have in versions from 1.9+ ofc you can change that in code you can remove it but still 1.8.9 is just better and pvp community is used to it
W-tapping is a 1.8- only thing, as it's needed for combos for better knockback
what?
yes java statics ?
still a open problem any help ?
what are java statistics
i guys said about static abuse
most stuff shouldnt need static
idk your english is hard to understand
am i do this ?i mean am i use static for hikari ?
public class DataSource {
private static HikariConfig config = new HikariConfig();
private static HikariDataSource ds;
static {
config.setJdbcUrl( "jdbc_url" );
config.setUsername( "database_username" );
config.setPassword( "database_password" );
config.addDataSourceProperty( "cachePrepStmts" , "true" );
config.addDataSourceProperty( "prepStmtCacheSize" , "250" );
config.addDataSourceProperty( "prepStmtCacheSqlLimit" , "2048" );
ds = new HikariDataSource( config );
}
private DataSource() {}
public static Connection getConnection() throws SQLException {
return ds.getConnection();
}
}```
Whats a singleton
public class MySingleton {
private static final MySingleton INSTANCE = new MySingleton();
public void doSomething() {
}
public static MySingleton getInstance() {
return INSTANCE;
}
}
Ah, that thing, didn't know that's called a singletone
the canonical definition is a class with one instance which has a global access point
a singleton is an object in which there can only ever be a single instance
but there are many derivations of it
Isn't this static?
if there is ever only 1 instance of something and not expected to go away using static is acceptable
that is static but not how you are using static
it uses static for you to get an instance, not to also run methods
private static Main plugin;
public static Main getPlugin() {
return plugin;
}
@Override
public void onEnable() {
plugin = this;```
am i do this ?
sure
the constructor should be private and/or should throw an exception if INSTANCE is not null
couldnt be bothered to write that stuff too
well i have configmanager
i was ask you
but i don't understand
get my config for use in my hikari.class
i need get file in config manager
i mean if i do this i didnt get my true configfile
1m
keep an instance of it in your main class and get the main class instance then get the hikari class or make the hikari class a singleton too
is that the only place you need your config
yes
thats fine then
but not working
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:149)
at net.md_5.bungee.config.YamlConfiguration.load(YamlConfiguration.java:78)
at net.md_5.bungee.config.YamlConfiguration.load(YamlConfiguration.java:72)
at me.vasir.manacore.configuration.ConfigManager.getConfig(ConfigManager.java:40)
at me.vasir.manacore.storage.HikariCP.<init>(HikariCP.java:18)
at me.vasir.manacore.ManaCore.onEnable(ManaCore.java:29)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:266)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:295)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)```
?paste the full error and ConfigManager
this is wrong, you currently load the file every single time you want 1 value
and this is my
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
hikari
this is also wrong
im using onEnable
i mean my getConfig only works on here
you use the getConfig 3 times
yes this working only in onEnable
ahh
u right
but what u prefer for my mistakes ?
learning java mostly
😦
https://github.com/mfnalex/BungeeCommandAliases/blob/master/src/main/java/com/jeff_media/bungeecommandaliases/Main.java is how i would handle files on bungee
Wait, i never knew that getconfig did this
Oh
i never used it more than once but it would've been a weird choice if it was a thing
indeed lol
היי.
anyone know why a collumn that is auto increment in sqlite returns sql null if its queried?
what is the query
"SELECT * FROM 'islands' WHERE 'uuid' = ?;"
it was select id from but for some reason that column didnt exist
what’s your table statement
String islandsTable = """
CREATE TABLE IF NOT EXISTS 'islands' (
'id' integer PRIMARY KEY AUTOINCREMENT,
'UUID' char(36),
'name' varchar(50),
'x' integer,
'y' integer,
'z' integer
);
""";