#help-development
1 messages · Page 1990 of 1
its not talking about the scratch language
doesn't matter what language tutorials use, just read the concepts and port to java
Oh now it changed
I would love to learn Networking with Netty
But doesnt looks simply
ok it seems too hard for me
its mostly just IPC
dont get it
https://www.youtube.com/watch?v=jmznx0Q1fP0&list=PLRqwX-V7Uu6YPSwT06y_AEYTqIwbeam3y
there are edutainment youtubers that explain stuff in simple terms, should be able to follow along with the stuff for the most part in java.
he uses a library called ml5, so you'd probably need to find a comarable library or look at its source and port it to java, or just follow along with the concepts and write your own stuff
ANN are heavily used these days for general problem solving, universities get contracted and funded to do a lot of number crunching and modeling of data
`private void joinPoliceCommand(Player commandSender) {
UUID playerID = commandSender.getUniqueId();
if(roleManager.isPlayerCriminalMember(playerID)) {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą");
return;
}
if(roleManager.isPlayerPoliceman(playerID)) {
commandSender.sendMessage(ChatColor.GREEN + "jesteś już policjantem.");
return;
}
roleManager.addPlayerToPolice(playerID);
commandSender.sendMessage(ChatColor.GREEN + "Zostałeś policjantem.");
}
private void joinCriminalsCommand(Player commandSender) {
UUID playerID = commandSender.getUniqueId();
if(roleManager.isPlayerCriminalMember(playerID)) {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą");
return;
}
if(roleManager.isPlayerPoliceman(playerID)) {
commandSender.sendMessage(ChatColor.GREEN + "jesteś już policjantem.");
return;
}
roleManager.addPlayerToCriminals(playerID);
commandSender.sendMessage(ChatColor.GREEN + "Zostałeś kryminalistą.");
}`
why when i'm typing /police join it's checking if i'm police but not if i'm criminal but if i type /criminal join it's checking if i'm criminal but not if i'm police. I have no idea what is wrong with this code. btw first time i wasn't using return but i was just checking different options.
first off please format it by enclosing with 3 `
how?
place 3 on each side of your code
``` java
code here
```
yw
why would you assign them to the role after checking for it? you end by assigning them to the role you are running - interesting idea that way
i was checking different optios. First it was all in if statements
UUID playerID = commandSender.getUniqueId();
if(!roleManager.isPlayerPoliceman(playerID)) {
if(!roleManager.isPlayerCriminalMember(playerID)) {
roleManager.addPlayerToPolice(playerID);
commandSender.sendMessage(ChatColor.GREEN + "Zostałeś policjantem.");
} else {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą.");
}
} else {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już policjantem.");
}
}
private void joinCriminalsCommand(Player commandSender) {
UUID playerID = commandSender.getUniqueId();
if(!roleManager.isPlayerPoliceman(playerID)) {
if(!roleManager.isPlayerCriminalMember(playerID)) {
roleManager.addPlayerToCriminals(playerID);
commandSender.sendMessage(ChatColor.GREEN + "Zostałeś kryminalistą.");
} else {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już kryminalistą.");
}
} else {
commandSender.sendMessage(ChatColor.GREEN + "Jesteś już policjantem.");
}
}```
now i changed to sth like this.
how?!?!?!?
this
after the first ``` you can say the language and discord will do syntax hilighting
?paste
What its your issue?
not mine, i was trying to teach Placek how to do code formatting
hy when i'm typing /police join it's checking if i'm police but not if i'm criminal but if i type /criminal join it's checking if i'm criminal but not if i'm police. I have no idea what is wrong with this code. btw first time i wasn't using return but i was just checking different options. (edited)
is their issue
if they want to use a negative it will never get to the second check as it is inside
@daring lark ^^
Is there anyone who can update plugins to work on the latest version of minecraft or could teach me how too?
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
player#spigot()#getLocale() return the player language if im not wrong?
And what about if player has texture?
Im doing a sort of custom api for sending player messages with his lang
I read that texture packs can interfeer with that¿?
.
Let say if you are english the messages from server are sent in English, if you are spanish they get sent on spanish understood?
He?
Wait wait
that is normally how it works if you have locale support
player#spigot()#getLocale() this return the client (minecraft client, the one you set)
No your computer lang
Who uses chineses language=
Btw
take cyrillic, it will only show in cyrillic if the client has that set, it does not matter if their locale says they are polish
what the hex is cyrilic?
if they use UTF, they will get the englishifiedversion of the cyrillic if you have a locale version for it
Translator say that "Cyrillic" its "cirílico"
Oh ok
That why translator wasnt working
"russian" alphabet is cyrillic
I was wondering to make an api which get your mc-client language. And then check if the lang file exists and then ge tthe messages
Allright thanks
Changing the context
TextComponent doesnt support colors?
I tried sending one which contains "&fHi message" from Spigot api and get an exception
Oh ok
But its possible to use &color-code?
https://github.com/XHawk87/LanguageAPI this does exist .... however seems to be abandoned
Decide lamo
you said Basecomponets, ComponentBuilder and now fromLegacyText
I dont understand....
i dont wanna set one color
I want to have multiple colors on a message
I dont want to use ChatColor.Color-Name
I just want to use: "&cMy color, &fother color"
Im using this:
public String style(String input) { return ChatColor.translateAlternateColorCodes('&', input); }
Whats wrong with that
That when sending a text component im getting exceptions
Wait i will send my code (component) im sending
If not it a mess for asking help
TextComponent component = new TextComponent(Chat.style("&6Testing component"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Chat.style("&3Click to run command")).create()));
component.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/say executed a command"));
That what im sending and getting an exception
What diff?
Oh ok
Why baseComponent?
My goal its to be able to show hover messages and execute command/open url
Yes i know that
because the compoents
Make me confuse
TextComponent, LegacyComponent, BaseComponent
Im too confused
Auh now i understand
I didnt know BungeeCord repo was stil lalive
Last time i join it was down
How does one decompile SpigotMC without maven compile issues.
is it possible to give a zombie the "break doors" ability without using nms?
i searched how to do it and all the posts mention nms, but they're from years ago
weirdly, it seems the answer to that question is no
that's such a simple thing for the api to cover yet it doesn't
make a feature request for that
I had made a feature request to add cross-server message system without using player instance . But they rejected
Are there any tutorials to create those fancy UI info bars with resource packs
Instead of this boring display
That animated?
Define animated
You can do animations
Yeah you probably could animate them
Yeah
But I just want a basic dynamic ui bar
So wha tthe problem?
Like the hunger bar
Hmn i dont understand
you can make a scoreboard
I am looking for a tutorial to make a custom stat bar using resource packs
Agree, +1
https://m.youtube.com/watch?v=EL2X6ppZSCQ looks like I found one
We cover how to make custom ui bars similar to the health and hunger bar, in Minecraft.
💡 Amber's Negative Space Font (included in example pack) : https://github.com/AmberWat/NegativeSpaceFont
📦 Download (Contains Resource Pack and Datapack: https://www.dropbox.com/s/1fa3byoz6ugrwx3/cw_mana_bar.zip?dl=1
🔵 Discord Server: https://discord.gg/Hy...
I was searching spigot only, which was my issue
is there a tutorial out there for setting up a decompiled workspace for spigot?
What the hex? Explain
Why do you want to decompile spigot? You can access to the source-code via Build Tools
like old mcp let you see the source code for the server jar file, but after leaving for over 2 years they stopped developing mcp and maven build for spigot is broken for me
Run buildtools and maven will work
I tried
Yeah
it doesnt though for me
It should work
As long as you run buildtools for the right version
And have mavenLocal as a repository
Because BuildTools maven and Intellij maven are different instances let say
I tried the maven dependencies that are erroring out are
`<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.20</version>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.45.1</version>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<createSourcesJar>${shadeSourcesJar}</createSourcesJar>`
Idk where that from
would y'all understand whats happening by the javadocs? https://paste.md-5.net/naximamoba.java
Idk i use BuildTools and it auto build the spigot-api, spigot-jar dependencies
idk what issue
would y'all understand whats happening by the javadocs?
its a yes or no question
I just ran build tools and went to the Spigot\Spigot-Server folder that is made
in intellij
You shouldnt do that
When you run build tools, it will automatically do all stuff
You dont need to compile manually
from me. just asking fully out of context: would you understand what this class is supposed to do only with looking at the javadocs&code
A now its understable what you want
just like from the beginning on
You wondering to do a custom fork of spigot so?
So you cannot get your project compile?
What your idea?
Explain please
Im confuse between vanilla and what you wondering to do
just modifying entity ai and stuff
if the old mcp would work I wouldnt be asking this. old mcp was easier to get things done imo.
Wait
Mcpe and Spigot arent diff things?
I think that Spigot its for Java edition minecraft
Idk i never understand that Mcpe that many talks
yes, old mcp was discontinued I just want to modify the server jar file idc if I have to do it with spigot or vanilla, just that I can do it
it has be a pain to do since the old mcp was discontinued because there is no tutorials or anything
So dont use it if it discontinued?
so I went to spigot
and there is errors in the maven project pom file
so I cant compile or even run the code
Allright, but i dont think spigot is designed to do Mcpe servers
What IDE are you using?
intellij
Do you have maven?
yes
Allright you cant compile it?
yes or run it
How are you doing it?
run build tools then go into the folder that is created called Spigot/Spigot-Server
I tried craftbukkit folder also
and same issue with invalid maven pom file dependencies
So first go to the folder you want to edit, and them right click open as project
And intellij will open it
Is anyone aware if plugin-annotations supports Bungee as well?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/plugin-annotations/browse
Doesnt say on the docs/plugin page/github?
nope, couldn't find any mention of 'bungee' on the Wiki page nor the readme
I guess it's worth a shot. @sullen marlin, I think this should be clarified in the docs :)
@shy coral if you're having issues with maven maybe try invalidate cache or something
Yeah
I dont understand you...
The annotations are within the org.bukkit package.
still no help with
`
<Implementation-Version>${describe}</Implementation-Version>
<Implementation-Vendor>${project.build.outputTimestamp}</Implementation-Vendor>
<createSourcesJar>${shadeSourcesJar}</createSourcesJar>
<artifactId>maven-checkstyle-plugin</artifactId>
<groupId>com.puppycrawl.tools</groupId>
<groupId>org.codehaus.mojo</groupId>
`
it gave me errors on describe and project.build.outputTimestamp (they do not have the "*"s
rest of the pom file is fine just those
I am literally pulling hair out because I never had this issue with working with the old minecraft coder pack modifying the source code for the server jar file
its probably best to submit a post on the forums with all the relevant information
How can I cancel knockback without canceling damage? I tried to set a vector to 0, but it didnt work :(
public class TrainingDummy implements Listener {
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
Entity entity = e.getEntity();
String uuid = entity.getUniqueId().toString();
if (uuid.equals("9152680c-4d5b-2a84-acff-26d704f725fe")){
Vector v = new Vector(0, 0, 0);
entity.setVelocity(v);
}
}
}
which forum should I post it in spigot help?
cancel the event, but apply the damage manually
+1
amazing
You could also probably set the velocity to 0 1 tick later
Its probably better to do what PulseBeat said
Do I use the Chat API ChatColor or standard Bukkit ChatColor...?
I remember hearing that you shouldn't use one in Spigot/Bungee or whatever
Just trying to remember
Bungee one is really nice
bungee for the fancy things
Bungee for when you like having more colors then meets the eye 👀
Just use bungee always
Eh when you're sending a simple you made a booboo message either or at that point 
Hey, im trying to use NMS on 1.18.1 and im trying to make a npc. in this line it says it needs a EntityPlayer and not a world server but how can I define that if im trying to make one? EntityPlayer npc = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager(worldServer entityplayer stuff here));
nani?
Anyone know what the hell this means
It happens when I try to damage an entity, the damage goes through but it throws this big mess of stuff
Do you happen to be calling .damage from a damage event
That triggers the damage event
Which then calls .damage again
And well, you see where this is going
yay recursion 
Just toggle a Boolean before you call .damage
And then ignore the event when the Boolean is set
is there any way to compare two items in with just item meta or name ive tried literally everything and it all just seems to return false
with items with lore and just regular items
getDisplayName equalsIgnoreCase other getDisplayName?
show some code, etc, you arent giving us much details
is there any way to compare the recipe in the crafting table and a custom recipe
Sure
how would i do that
You want to compare the items in the table or the recipe itself?
CraftItemEvent and PrepareItemCraftEvent both have a getRecipe
And that recipe should always be a keyed recipe, so it will have a unique namespaced key
yeah i tried e.getRecipe == shapedrecipe but it didnt work
where shapedrecipe was my recipe
You’ll have to cast it to Keyed
ah ok tysm
Afaik any recipe in the crafting table will always be keyed
yup comparing the keys worked tysm
Hey hey! I'm trying to get a plugin debug server working with pterodactyl (remote debugging)
I've been able to connect to the server in debug mode but I'm confused on how to actually push any new changes
All I have right now
Is there any way to set the plugin directory where it'd get hotswapped remotely?
im having problems with CraftItemEvent. im removing a set amount of items on craft but due to the actual recipe that requires one item when i shift click the slot it doesnt actually remove those items
anyone know how i fix this without just disabling shift clicking to craft
You’d probably have to cancel the shift click, so the math yourself, and then add the items to the players inv
yeah tried canceling it and resetting the items in the crafting table but you can just close it if you time it and get the item for the recipe with one item
Can anyonw hlp me i have a question over the mtwapens how can i add wapens?
iirc its concat
How to add a gun
Oh but which command i have to use
If i do that than is there a error
Can you speak netherlands
Oh ok i find itn thx for you time:)
how do I get the uuid of a player who is offline? I need the uuid for Bukkit.getOfflinePlayer()
but I dont have the object yet
I need the uuid to get the OfflinePlayer object
I cant just use the uuid of the OfflinePlayer object to get the OfflinePlayer object
yeah it is
but the Bukkit.getOfflinePlayer(uuid) is not
which others can I use if any?
is it an external api?
yes
could I have a link to it?
what offline player are you trying to get?
a specific one?
do you already have a uuid or name?
Basically I have a /ban <player> command
the user enters the name of the player
I obviously need offline players to be bannable
so thats why
then use Bukkit#getOfflinePlayer(name)
its deprecated
its fine
you can use it if you just need from an argument
no its because names aren't unique past a single session
it performs a blocking web request to Mojang if the player doesn;t exist
its fine to use for a ban check
The alternative, is to use Bukkit#getOfflinePlayers()
then iterate to see if the player has been on your server
^
use == to compare enums
I have a NMS issue, i am getting NoClassDefFoundError.
pom.xml file: https://pastebin.com/ZRepu15q
java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component
ngl replit is a cool thing to learn
cuz like
u can try out random performance expensive things
really easily
i mean yes to test stuff but it's just gonna cause you massive pain if you want to use it in production
stick to a proper paid host for that
using discord in browser
took 241.023 seconds to run lol
fair
is there a way to put all tools and armour in a list instead of doing it manually
it's quicker
nope
why do u need that
Respekt the drip
why do you care?
ahh
that makes sense
if its ran one time then do
loop thru materials and check if it ends with chestplate, or leggings boots or helmet
or sword, pickaxe, axe, shovel, hoe
Caching
yea
e.g
instead of reading a config everytime
u store key value pairs in a hashmap onenable
and then u just interact wit hthe hashmap
how does that help
Better design
but how would that apply to me
and for stuff like mysql
better performance
instead of looping each time thru the materials
cache the list of tools/armor generated
and just check that list
you generate the list by looping thru materials
and add the materials which are a tool
or an armor piece
check the type?
ok
how do i get type
it's not workiing
i can only get isblock()
what's "not working"
for (Material b : Material.values()) {
if (b.isBlock()) {
blocks.add(b);
}
}```
a type is a Material
but i cant check if its armor
there is no out of the box answer for that
easiest way (not the best) is to check if the material name contains armor
ok fine
if(stack instanceof ArmorMaterial) {
}
?
How would I get a player from their name, even if they are offline
getOfflinePlayer?
isnt that depracted
it's deprecated because names can change iirc
^
Hello... how do I remove lore text from itemstack in 1.18 ?
I tried this, but it's not working:
meta.lore().remove(0)
a ok thank you mane
iirc you need to set the meta again
Which also implies some sort of database query (thru the mojang api) might need to be queued thus it can ultimately result in a dos if used on server thread
hmm okay... I'll try but I think then I have an empty line in the lore ... but tell you in a min
shouldnt have
ItemMeta meta = item.getItemMeta();
meta.lore().remove(0);
item.setItemMeta(meta);
i think
wait
isn't there an updateInventory method?
This isn't working
public static ItemStack remLore(ItemStack item){
ItemMeta meta = item.getItemMeta();
if(!meta.hasLore()) return item;
meta.lore().remove(0);
item.setItemMeta(meta);
return item;
}
how would I do that?
Well every method runs on the thread it’s invoked on obv
since when is ItemMeta#lore something? and you're only removing the first line either
in 1.18 setLore and getLore are deprecated...
The issue is that getOfflinePlayer(String) might make a name to uuid lookup
Which can require a fetch from the mojang api
Is it hard to make a custom attribute modifier?
try lore.clear() if thats a method
Yes dopi
You need to get the lore with lore()
Then set it back with lore(List<Component>)
does that exist
i thought that only existed in forge
Assuming you use paper
Example i have a custom stat like mana and i want to add mana when im holding an item
is he using paper lol
I'm using 1.18.1 and it's there 
Tried it with set again:
public static ItemStack remLore(ItemStack item){
ItemMeta meta = item.getItemMeta();
Component component = Component.text("");
List<Component> itemLore = new ArrayList<Component>();
itemLore.add(0, component);
meta.lore(itemLore);
item.setItemMeta(meta);
return item;
}
But the empty string adds an empty line to the lore...
are you using paper?
yes
oh lol
is there no clear method?
or set a Collections.emptyList as the lore?
idk
or just a new arraylist
yea, it is! let me try
write it yourself
i need to save them in a database too and im looking for a good way
timestamp
ok im gonna make one ig
yee i know that
pog idea
omg, it's actually that simple:
public static ItemStack remLore(ItemStack item){
ItemMeta meta = item.getItemMeta();
List<Component> itemLore = new ArrayList<Component>();
meta.lore(itemLore);
item.setItemMeta(meta);
return item;
}
haha I was kinda stupid I think xD thanks anyways
Lol obviously
java 7 kek
u need to save
a cooldown in a database?
meta.lore(Collections.emptyList()) would be enough tho @shell hedge (and avoid redundant object creation)
ye because the server restarts every day and otherwise its gone
nah i dont work with files
a whole db just for that?
not?
fuck programming in files
nah im saving other stuff too
database programming
Well do it one per line
Lengthy but ye
just store the cooldown in a hashmap, then put it in the database ondisable and stuff
i was looking for integrating it with the user data and a way to figure out what type of cooldown it is
u have mutliple cooldowns?
make a cooldown object
Cooldown<Cooldownable, Integer>.getPlayerCooldown()
make ur command class implement cooldownable interface which has a hashmap
hashmap<player, integer>
no
or maybe not thats just an idea
anyone know how to fix this
what methods does that Cooldownable interface has?
close the terminal window
😎
give some code
i am running mvn clean install inside <BuildTools Folder>\Spigot
of course there is no code from me
getCooldowns() which is a hashmap
ah
player, integer
i was thinking of a cooldownmanager or smth
and i was wondering too if i would change a Set<Home> where Home is a record(name, UUID, Location) to a Map<name, Home> where Home is a record(UUID, Location) so i can do lookups more easily and i can use the Map#remove method which returns the home object?
swap the logic
make a player data class
and put the homes in there
so you can also put the cooldowns in there
the thing i said had nothing to do with cooldowns kekw
ye thats whats i was planning to do
or in the player data
getCooldowns()
will return a Cooldowns class
then u use
getCooldown(CooldownType.KICK_COMMAND)
UserSnapshot represents all the user data that is loaded from the database
mayb
ok ill try something
is that a core
personally i'd change the commands itself
make a wrapper for CommandExecutor
called something like CooldownableCommandExecutor
which keeps a cooldown with it
and on command just do
userSnapshot.setCooldown(this);
many approaches
whatever floats your boat
and then holding a Map<UUID, Cooldown> of these
public class Cooldown {
private final long end;
public Cooldown(long duration, TimeUnit timeUnit) {
end = System.currentTimeMillis() + timeUnit.toMillis(duration);
}
public long timeLeftInMillis() {
return end - System.currentTimeMillis();
}
public long timeleft(TimeUnit timeUnit) {
return TimeUnit.MILLISECONDS.convert(timeLeftInMillis(), timeUnit);
}
public boolean isExpired() {
return end < System.currentTimeMillis();
}
}```
throw this in your UserSnapshot
lol
do you need the cooldown somewhere else than the player?
nah i dont think so
stack is in material?
ItemStack
but i also need an identifier to know for what command the cooldown is
some enum i guess
armor material doesn't exist
im using matrial
What version of MC
I'm using the worldcreator to create a void world but when my plugin is disabled or removed, new chunks start generating again like a normal world, how should I do it to stop that from happening (1.8.8)
@tardy delta it doesn't work for me
Need to have NMS
You can check for armor using EnchantmentTarget.ARMOR
U should generate all world and then disabling plugin and u should ask #help-server
worlds are infinite and the worldcreator is not a plugin
@safe edge so when my builders want to make a map, it loads a void world so they create one, they publish it using a different command and it registers to my database and moves to my maps folder in a different place in my server
so far I'm using this
WorldCreator creator = new WorldCreator("test");
creator.environment(World.Environment.NORMAL);
creator.type(WorldType.FLAT);
creator.generatorSettings("3;minecraft:air;2");
#help-server is for plugin help, this one is coding related
im guessing you move it into some fodler all you servers can access and they clone it into themselves?
what is the event for when player clicks with item on block or in air?
i think its PlayerInteractEvent but it only works on block not in air
yes
I dont think the worldgenerator carries over, at least not in my experience, so it might just be a case of loading a load of chunks in close proximity to the spawn point when its made so they dont load in later when the map is cloned
PlayerInteractEvent but for some reason air clicks are cancelled. Try ignoring the cancellation with @EventHandler(ignoreEvents = true) or try a different priority
oh, ok thanks
my eventhandler is @EventHandler(ignoreCancelled = true) and i even tried out with priority = EventPriority.HIGHEST
if i hide player X for all players on the server and X quits the server and rejoins, is he still invisible for all players?
maybe
ye the last one
not usually
which priority should i try
LOWEST but be careful setting things there
if I remember, all that method does is sends the packet to the player to remove the target player. If the player rejoins, then it a new entity, you can reload it on PlayerJoinEvent
and if i make the player back visible before leaving, other players will be able to see him?
I need to go to a college lecture, if its still not working after an hour, send me a message
alright thank you
What's the fastest way to do a 3d for loop?
wdym?
how big is your 3d array?
that's the thing.... it depends on how big the schematic is the user specifies
It could be fairly big or it could be tiny
actually i dont need it lol
if its smaller than maybe 100ish, use a linear loop, if its anything fairly large, as in more than 100, use a binary search algorithm
It'll be far bigger than 100 for sure
what's y'all personal preference when ordering instance vars?
private final Runnable callback;
private final String name;
private final OtherValue value = new OtherValue();
private final Value val = new Value();
public Constructor(Runnable callback, String name) {}
or
private final OtherValue value = new OtherValue();
private final Value val = new Value();
private final Runnable callback;
private final String name;
public Constructor(Runnable callback, String name) {}
Binary search then lol
second
how hard is a binary search? I've never heard of / used before tbh
I'd look it up, I'm shit at explaining it, but basically it searches an array by repeatedly halfing it
cool
Is it bad I've never heard of it before?
so you use while, correct?
there is an Arrays.binarySearch() method if that helps @next stratus
I've never done these things before and I wanna scream 🥲
like I say, im shit at explaining it
this might help https://www.javatpoint.com/binary-search
Binary Search with Introduction, Asymptotic Analysis, Array, Pointer, Structure, Singly Linked List, Doubly Linked List, Circular Linked List, Binary Search, Linear Search, Sorting, Bucket Sort, Comb Sort, Shell Sort, Heap Sort, Merge Sort, Selection Sort, Counting Sort, Stack, Qene, Circular Quene, Graph, Tree, B Tree, B+ Tree, Avl Tree etc.
i mean theres not a whole lot to go off of
binary search isn't that hard
i recommend this site https://www.baeldung.com/java-binary-search
its usually recursive
I think it's hard because I've not used it before
its not hard, it just looks complicated at the first look
lol
screw greeks, baeldung has a way better article
cant close it
we love sites like that
?
you can lol
i can't really say anything since i don't know the purpose of this. i personally would rename the packages since they seem misleading. also if you try to implement an interface-impl api design i would recommend making a multi-module project
https://i.imgur.com/HXbPM4D.png why it no happy 🤔 https://i.imgur.com/HXbPM4D.png
Interesting cooldown module 2Hex
we've all done that at least 10 times before and been totally flabergasted
bump
i'm not awake yet, k?
You can do both
Set for efficient iteration and map for quick lookup
I never realised you could iterate a schematic before pasting idk if that's bad i didn't know that
what when users have for example purchased a rank and they have a lower cooldown time?
I'd extend HashSet with the Home type and make your own lookup method inside it
i only need the lookup thing in fact
2Hex you need Optional.ofNullable here or it will throw a NoSuchElement ex
Ok then use lookup
But maybe keep the name in the record for if you want to get the name from the home object
ye ty
mye seems stupid to keep the name in two places so thats why i was asking
What if you want to print the name of the home
could drop the optional and use getOrDefault as well, assuming getCooldowns returns a map.
You would need to go through the map and find it
the only time im printing is, is when i print a list of all the homes of that player
so i just loop thro them, no lookup
Ok you do you but its not necessary
I once had a log file of half a gigabyte
lol
I had an error in a client side mod
I didnt notice
at least it wasn't 500gb
It was also quite a long error
just curious, if you had a 500gb error file could you destroy it instead of putting it into trash?
because if you try to delete it then it trashes it
is it bad i've been using windows for years and didn't know that
you also have a limit of the size you can put in the bin i think
at some point it will just permanently delete it
my recycle bin is taking a shit trying to load
ye
lmao
Yeah I don’t think the bin would accept a 500gb file
do you have long file paths on
theres a limit on path length in windows
by default
I've only got about 15tb of storage so ye
actually idk if its by default
260 by default
yeah
you need to edit the registry to ensble long ones
at least i had to
maybe they xhanged it in newer versions
i have pretty bad experience with regedit
I'm gonna miss having all day coding but hey I got a new job so we good
btw, i'm currently outputting
[13:22:36] [Server thread/INFO]: material: com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_18_R1.PaperweightBlockMaterial@10a19d7f
[13:22:36] [Server thread/INFO]: blockVector3: (-14, 30, -111)
using
Bukkit.getLogger().info("material: " + clipboard.getBlock(blockVector3).getMaterial());
is there a way to get the bukkit mat?
oh wait dw
bukkitadapter exists aha
whoever created the BukkitAdapter is fucking amazing
are you in the enginehub discord?
oh? sk or?
sk?
ye
what is sk
Hmm?
sk89q
I'd normally have to load the game and actually create a mine for it to do the iterating but I'm now iterating in the onEnable
unit testing?
I just try to not ask as any questions as I possibly can and then i don't get in trouble lol
wat
i mean
you can always test your model with unit tests
and minecraft should usually only be the frontend
what
I remember not long ago, if I didn't know how to do something I'd just say "screw it, i don't know how to do it no point trying to learn it" and now I push myself 🙂
why is my ide like that
had i too
the project tab
after merging stuff from github
just fucking died
we all were at this point. "i dont want to be a noob again"
how to fix that
i got a message "maven load script found" and it reloaded everything
I just kept going into brick walls and didn't wanna learn how to do the bigger things such as world edit
maven 💀
oh ur using gradle
ofc you use gradle
wtf do i do
yep it's far cleaner
maven
if ur using maven do mvn reload
reload from disk
or pull again from github
you just bashed your files with voodoo magic
does nothing
maven uses up so much room in the file and gradle is far cleaner
lol i have it everytime when i rebase or merge shit on github
what makes gradle cleaner, lol
more detail > clean in build tools
not having a block of garbage per import
you legit use maven plugins?
?
shading plugin lol
that doesnt do anything
its everything you could possibly need
have you tried mvn reload?
go back to a previous commit
fixed it for me
i wrote stuff tho
maven is
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
gradle is
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
I prefer gradle but no point trying to convince you as you've chosen that one
and i still didnt commit it
ig to each their own, I like it all being nice and separate 😄
LOL
a bit offtopic, does PR's from github are able to delete stuffs that came from the branches and merge it to the main that also deletes the file there?
seperate how so
you're fucked hex
multiple lines
it looks cleaner it being on one line imo
and make a new project in intellij
more compact and easier to read
even in the folder
thats why I said to each their own 🙈
ye soz
easier to read no
how so
when its all separate say I just wanted to look at the version
I can j loook for <version>
try closing ide
just look at the end?
and not the 3rd :
version is always at the end so easier
ok its j example
i would only prefer gradle over maven if i have to do special things while building
I think the reason i've been so into gradle is because i was forced to use it
by like your coding partners?
same. at work using gradle.
but maven still >>
wtf
FOR 3 WEEKS
lmfao oops
and i went "fuck sake, i'll use it shut up"
¯_(ツ)_/¯ not gonna judge
invalidate cache, restart, reload from disk
?pdc
I remember before using build tools and I used to import it into eclipse damn those were the days
now i can't get away from gradle
so i'm not alone?
i don't think i'll get over my biggest fuck up in coding
enlighten me
got offered a job coding on a server in 2016 right?
uhuh
LOL
it was called mcprison before now it's mchub
it gets worse dw
the devs get paid TWO THOUSAND A MONTH
yeah... i hate myself
well, big servers aren't always nice
i know the owner lol
it can be very stressful
i found him his wife 🤷♂️
i was like hey <name> you might wanna hire <name 2> she's real nice and good at moderating it went so well they got married and got a kid now
well, thats something special. worked for several. pressure is real
when you do the oof
yup. tests by contents goes through but a playerbase of 5000 at the same time will always find several bugs
and you have to fix them within minutes
lmao nice
yes
everybody hiring devbukkit now:
I swear i see the 9500 one being sold at least 8 - 12 times a day https://i.imgur.com/oVTa5kq.png
who
FUCK i hate myself
what if i get hired by them then reccomend you
big brain time
LOL dw another chance will come
oh btw
just apply ¯_(ツ)_/¯
I did slightly do a middle finger to them
hold on what
I copied their private mines plugin
and well made a ton lol
yeah, but mines the only fair priced one out there iirc
I think the price is fair for the support I give and the features I offer
🤷♂️
Spigot -> 2 notifs
Notifs -> EssentialsX was updated
ructure/.git/HEAD.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.```
wtf
it doesnt exist
Hi. How can I use a project in another one using Maven? What exactly should I setup?
jitpack :o
lol i don't do it for the sales i just want to make a easy way for people to have private mines without having to pay out a crazy amount for such a plugin
inventory management
HexLib
Or Pets would be really useful. Something like hypixel SkyBlock
there is no good and efficient inventory management lib yet
what is HexLib supposed to do? build hexagons or convert hex to binary?
so what is it supposed to do
give me enough time
U mean like to fix null/Air inconsistencies?
lol just write an util method for that
isNullOrAir
everything around inventories. handling, sort, fixes, identifying etc etc
inventories are cringe tho
welp
any other ideas?
Make a lib for custom block breaking
?
Cuz it's a nightmare 🙂
a shape lib with extras like splines
Well
Like mithril on hysb
so like a block builder?
Particle image display
why pain
is there any good 1.18.1 npc api?
Particle video display :0
or something like labymod have, a screen with TV senders ingame
Hm
npc lib
(joke)
NMS LIB
LibLib
protocollib
Use citizens
Yeah but that’s already done
citizens isnt updated for 1.18.1 or 1.18
or make an astronomical ballon plugin. then you can have a sun as a ballon which ends up in a supernova after a few minutes and turns into a black hole fucking with your whole world
Worked for me
i did lol
Latest from Jenkins
@hybrid spoke Gib details about what an inventory lib would do
I am bored and don't want to work on my plugin rn xD
Custom advancements lib
added to my todo list
think of something
imma take this for a starter
+keep track of inventories

yeah ofc ill do that
what do you thikn
think
anyways one thing
across restarts or when restart it forgets about them
yeah
nah
this is a lib not a plugin
ill just forget on plugin shutdown
// Creating an inventory
InventoryWrapper wrapper = InventoryProvider.register("plugin:inv-name");
// Getting an inventory
InventoryWrapper wrapepr = InventoryProvider.get("plugin:inv-name");
// Removing an inventory
InventoryProvider.unregister("plugin:inv-name");
oh and also think of serializing and deserializing
whats the name of the lib?
OmniLib, not on gh yet
👀
https://github.com/IkeVoodoo/SpigotCommandLib
Here are my plans for my command lib (One of the 5 libs planned so far)
on the topic of that
anyone got any idea how to detect when PlaceholderAPI reloads itself
how do you interface with libraries?
make sure you can link 2 inventories
so mirroring one's contents on the other?
wdym
do inventories have PDCs?
but bindings would also be cool
cipher just give me the ideas you have
no
damn
i already do
I have this issue where my placeholder seems to poof after /papi reload
so parenting and binding?
and only works when I reload my plugin
those are exclusive
the following stuff has PDC:
- Entities
- Tile-Entities
- ItemMetas
- Chunks
(in the future: 5. Worlds)
yup as well as pagination maybe
Hey, i want to change the leaf decay distance. With custom trees, the leaves that are outside the distance decay immediately, but we want the leaves to decay when the tree is chopped down.
It's not just configurable in a config so I guess I'll just have to make a plugin for it, what's a good way to approach this?
the event is still being run would be the guess
is that because the leaves are not touching a treeblock?
I mean I have a decent (de)serialization framework.
It's a little unstable though.
I can't contribute to it atm cuz freelance but I'm just saying, the baseline is there if you feel like PR-ing. Otherwise, go ahead and make your own thing.
Self-reminder: PR some shit to RedLib to fix a few issues with Messages
this man is the definition of a pain in the arse with coding
wdym