#help-development
1 messages · Page 206 of 1
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
using intelkij and doing maven install
i get this error
Could not transfer artifact com.jolbox:bonecp-test-commons:pom:0.8.0.RELEASE from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [spring-milestone (http://s3.amazonaws.com/maven.springframework.org/milestone, default, releases+snapshots), jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public, default, releases+snapshots)]
breh
You have to force new versions of maven to accept http repos
Since they’re insecure
brah
bruh im not even sure of this option is the right way to turn all my files into a jar
how do i turn
these files
into a jar
that can be used
as a plugin
on my minecraft server?
whats the plugin and what version will it not work on
Your name
You'll need an IDE that can compile it. Something like Intellij or Eclipse
anyone wanna co-op with me on a project, the workload is getting to big for me to handle it (especially when I am busy in real life)
no
https://www.jetbrains.com/help/idea/compiling-applications.html You import the project into the which ever IDE you want to use, then compile/build it
yeah sure. why not blindly contribute to something you dont even know what it is
oh ok... sorry for not giving you info on that...
Its a project that allows players to edit minecraft server files (with perms ofc) in minecraft chat
https://github.com/Hasunemiku2015/MinecraftNano
still working on features and here is the checklist of what needs to be done
🗿
bruh
can someone compile this into a jar for me 😭
please
i cannot
for the life of me
😭
Youtube how to compile a project with intellij
How did you make it, if you don't even know how to compile something
he didnt
That much is clear... Compiling a project is a 5min thing. import > build
Does anybody know if it's possible with WorldEdit's API to get the bounds of a paste after you've already pasted it? I intend to paste the schematic and then scan the blocks it contains and modify them as I need to but I can't find a way to get the area of the paste.
you can get region of that and loop through all blocks
Because you added a space?
How do I get the region of the paste?
Whatever plugin you use for it is obviously adding a space.
Hey! I'm getting an error when I try and open an existing repo from a friend, he doesn't know how to resolve the issue, can anyone help?
The error:
Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.19-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
I installed the NMS folder in C:\Program Files\NMS
if that is relevant information
there is no such thing as an NMS folder. Run BuildTools with the --remapped switch
I just made the folder for convenience, was I not supposed to?
I moved BuildTools to the folder and ran it there
will try with --remapped
it still extracted a maven, should I be worried
error no longer happens with --remapped, so my friend is dumb for not including --remapped
thanks!
Yo guys, Can I show the minecraft's item on tab completer? like below pic
You need them to start with "minecraft:" or may them be Bukkit's Material?
Hmm actually I don't need "minecraft:"
Materials.values();
I think this is the answer
Yes
for (Material material : Materials.values()){
list.add(material.name());
}
return list;```
Use that in your tab completer 🙂
no
dont
you dont want to iterate everytime over 400+ or something materials and basically throw away the result
true
public List<String> materials = Arrays.stream(Materials.values()).map(Material::name).toList();```
im so bored
anyone has a cool project i can contribute to?
something actually useful tho
Oraxen
It's code base is a mess
I did a slight cleanup once but it still needs work
Oraxen is a good plugin
if (block.getBlockData() instanceof Sapling) {
Sapling sapling = (Sapling) block.getBlockData();
sapling.setStage(sapling.getMaximumStage());
block.setBlockData(sapling);
block.getState().update();
}
Hello everyone, I'm trying to grow a tree, unfortunately without success yet. Have I overlooked something?
Thanks for the help 😄
a sapling being max stage does not mean it grows instanly
where can i download protocol lib 1.19?
basically the next time the tree would advance a stage, it would grow
their CI dev builds are linked
yea
ah okay, can I force this myself somehow?
the API has generateTree methods on the World interface
anyone know a good GUI api? implementing it myself is getting sorta a clusterfuck
ah I see, Thank you for your help 😄
So nobody answer me, I will ask again (ping at answer)
how to do lay at 1.12.2? (I found only sit, but hypixel developers do lay at 1.8.9 and I want to know how)
you "lay" by forcing the player into a sleeping position
how exactly that works in a legacy version like 1.12.2
kinda good luck to you
how can i make an npc with ai?
when i extend server players there is no register goals
Players don't have AI
How could I avoid triggering the EntityDamageByEntityEvent, if there wasn't any damage done, like when you are in a WorldGuard PvP disabled zone?
You don;t trigger it so you can;t prevent it being triggered
all you can do is cancel it
I mean in my plugin
I check for EntityDamageByEntityEvent in my plugin, but dont want it to trigger if there is, for an example worlguard no pvp zone
again, YOU can't prevent it being triggered because YOU don;t raise it
its always going to trigger. You need to ignore/cancel it if it's in a WG zone
ok yeah thats what i meant, i want it to cancel if ther is a wg zone, or if there is no damage done
if WG has a flag for no PVP then it should already be canceling the event. you shoudl listen to the event later than WG
i gave wg flags just for an example, is there a way to cancel the event if there was no damage done?
in any scenario
If you wanna do it you'll need to mixin to nms
Easiest way would be to do server patches but you could also use other mixin methods best of luck with this
Wich could be an event that is called when a TNT gets primed by redston, such as by a redstone block?
on spigot i believe you only get the spawn event of the tnt
I tried one time and debugging the event doesn't get fired
acf weird, i do /vanish e and it says that player is already vanished :/ and its talking bout me
that event is very deeply nested in the spawning logic, the primted tnt would trigger it
Hello everyone, I have a small question regarding sugar cane, I can grow wheat and other crops without any problems, but with sugar cane and melons the whole thing does not work. Do I have to pay attention to anything special there?
is there a way to print all pdc entries of a player without knowing the datatype of eeach?
yes
you can get them by plugin
actually nto sure about printing them
you can get the keys
adding this (priority = EventPriority.MONITOR, ignoreCancelled=true) to the @EventHandler solved it
for (NamespacedKey keys : container.getKeys()) {
if (!triggers.contains(keys.getKey()) && keys.getNamespace().equalsIgnoreCase(plugin.getName())) {
plugin.getLogger().warning(String.format("Unknown trigger removed! %s.", keys.getKey()));
container.remove(keys);
}
}```Somethign I did to remove old data
reading the actual data may be difficult
I did see code on here a while back about cloning a PDC.
i probably have to keep track of my namespacedkeys (as i only want to see entries my plugin added) thro a map<NameSpacedKey, PersistentDataType<?,?>> ig
What exactly is the goal ?
is it possible to open a book and quill gui ?
declaration: package: org.bukkit.entity, interface: Player
its more for debugging purposes to see the whole pdc actually
this is for written book
i know /data get entity <player> exists but sometimes that prints like 50 lines and it difficult to read
writing books is client side, the server only knows once its signed
so no, i don't think it is
so how about open it with packet ?
the server never sends the player a packet to open a book and quill because its handled client side
i assume we put it in main hand and open it
so there wouldn't be a packet for it
did a quick search of wiki.vg and open book packet is only for written books, and the open screen packet is only for inventories
is server bound, so the server can't tell the client to do it
You can always open player data file with some nbt editor
That is what I used
[WorldEdit API] I'm making: After checking the blocks in the schematic, if there is no block in that location (In real minecraft), the block in the same Location stored in the schematic is pasted.
This is code However, only the type of the block was changed, but the data could not be changed (direction of the attic door, etc.):
public static void func(Location location, File file) {
ClipboardFormat format = ClipboardFormats.findByFile(file);
try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
Clipboard clipboard = reader.read();
for (int x = (int) location.getX() - 10; x <= (int) location.getX() + 10; x++) {
for (int y = (int) location.getX() - 10; y <= (int) location.getY() + 10; y++) {
for (int z = (int) location.getZ() - 10; z <= (int) location.getZ() + 10; z++) {
BlockState block = clipboard.getBlock(BlockVector3.at(x, y, z));
if (block.getBlockType().getId().equals("minecraft:air")) continue;
Block toPlace = location.getWorld().getBlockAt(new Location(location.getWorld(), x, y, z));
toPlace.setType(Material.valueOf(block.getBlockType().getId().substring(10).toUpperCase()));
}
}
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
``` How do I paste everything in a block, including the block's data?
(Also: I don't want to paste all the blocks at once, but I want them to appear one by one when the player goes within 10 blocks.)
EntityAddToWorldEvent is called
I'll give another check on EntitySpawnEvent
EntityAddToWorldEvent is a paper specific event tho
That is not a problem
I'm using a Paper
declaration: package: com.destroystokyo.paper.event.block, class: TNTPrimeEvent
Check on 1.12.2 javadocs
1.12.2 
L
💀
ok it's not in 1.12.2
so let's get back to EntitySpawnEvent
Well yea its a legacy version years old now
xd
wtf
there is like 200 different levels of wrong in that screenshot
Lol
Hey, I created a BungeeCord server today. There are no error messages in the console and the server starts but there is always this error message (read timeout exception null). I set the online mode to false for all subservers and to true for bungee cord. In the config of the bungee cord portforwarding is also activated and also runs. Does anyone know anything about this?
anyway to get player input as book and quill ?
hmm think i finished refactoring https://paste.md-5.net/ukimerowep.java
am I tripping
or does NO_NIGHT_VISION have a 0 on it
ok
uh thats normal, theres a dif between not being vanished and being vanished where the plugin applied nightvision (configurable)
uh values dont really matter, what would you suggest?
(1.19 with remapped NMS) how do I change the direction an arrow is facing?
I know I have to use yaw and pitch but idk the method I should use
hmm ye would work too ig
should be careful with adding another constant in between others
brr
as in yaw/pitch or just a vector?
end - start
I'm gonna try it now
hmmmmm
for some reason
arrow.teleport(arrow.getLocation().setDirection(arrow.getLocation().subtract(livingEntity.getLocation()).toVector()));
doesn't work
but I know it runs
because the other thing in the same place as it does
to set the arrow to not be affected by gravity
the arrow just keeps going straight forwards
i would say the static final field was better
No
For that type of things you must use enums
im only using the byte value anyways
like always doing pdc.set(key, PersistentDataType.BYTE, State.NOT_VANISHED.flag);
is it possible to force a player using an item ?
is it ok to use InventoryHolder interface
for custom gui
to check it instead of name
or that would be bad approach
it's an ok approach
thanks I am asking because Choco was talking on forum that is should not be used
much better than checking name
?paste
But is it better than checking full object?
does anyone know why this doesn't work? I'm trying to make arrows point at the nearest player or mob when they shoot
I have this in an EntityShootBowEvent
https://paste.md-5.net/abiwupafuk.cs
and this is the shootArrows method
https://paste.md-5.net/goletafeze.cs
can anyone help?
you can assign your inventory functionality on the object itself and just route it
The thing with checking name is that it's unreliable. Inventories don't have a UUID
Yrah
Why inv doesnt have uuid
They should be uniq
For scalability
That are those things I dont like from spigot api
😂
cant you just compare with ==?
Is not a good practice to use it for Objects
it has specific scenarios
== works because each player is strictly tied to one object
Same for each world
UUID is for persistence. Since inventories generally do not persist you don't need a UUID
is it possible to force a player using an item ?
Menú are not persist?
I dont think so
I have used api for more than 1y and i never had a null player inventory
🤔
Idk what u refer to
can anyone help with this? If not that's fine but I've been trying to fix it for a while and I have no idea what's wrong
Paciente
You are not paying for instant support
So you cannot expext fast help
they do not persistent over restarts etc
use the ordinal
Just dont use byte
🤦♂️
Change it to int
Lmao why ppl over complicate so much the self
Anyone have an idea why cancelling BlockBreakEvent and setting setDropItems to false still drops a seed with this code?
Ageable blockData = ((Ageable) block.getBlockData()); blockData.setAge(0); block.setBlockData(blockData);
I wanna replant harvested wheat, that works, but sometimes it just drops an additional seed
I figured out that it doesn't drop that seed when I don't cancel BlockBreakEvent
What?
You have make night mare
I dont even know what you want to cancel harcesting or break ing blocks?
I need to cancel BlockBreakEvent, because otherwise the new block I plant just gets broken
But somehow when I cancel it a seed is dropped
then don;t cancel it and plant a new wheat 1 tick later
Yeah that's what I'm doing now
Just wanted to figure out why that's happening
I guess it somehow drops the existing block when replacing it
Well still sometimes dropping an additional seed
wheat when harvested can drop 1-2 seeds
My guess (as you've shown very little code) is you are not delaying the replacement and you are breaking the block while you are still in the break event
No I am delaying it
the code you showed above would not work delayed
when that code runs it's not going to be a block of wheat
it's already broken
ah
It does set it, otherwise it would throw an error
is there a way to create a whole new gui menu
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Please!!
But I don't know where this additional seed is coming from
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
You don't have to DI everything
I dont like static getters for instance
so is there a way to get a player head using textures from a url
I mean that why the concept of di came
not really
getInstance is fine there as the plugin is a singelton
I mean only for plugins
and he did it for main class of his plugin
But for java general its not okay
it is for singleton classes lol
The mix does it
What?
You don't need to DI singletons, because there is only 1 instance of them
^
My programming teacher told me that we must use di for everything except libraries
Yes, your teacher told you
And i agree with him because he has study for that
my programming teacher tells stuff and i dont care lol
I mean that why they are teacher they would told smth wrong if not they would have their título
https://en.wikipedia.org/wiki/Singleton_pattern look at this
In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to a singular instance. One of the well-known "Gang of Four" design patterns, which describe how to solve recurring problems in object-oriented software, the pattern is useful when exactly one object is needed to coordinate act...
That's pretty naive to think
Those who can do, those who can't teach.
so i've used this code to get a player head using textures from a url butit kept giving a player head with the default skins
public ItemStack getSkull(String url) {
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
if(url.isEmpty()) return head;
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
byte[] encodedData = Base64.getEncoder().encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes());
profile.getProperties().put("textures", new Property("textures", new String(encodedData)));
Field profileField = null;
try {
profileField = headMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(headMeta, profile);
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e1) {
e1.printStackTrace();
}
head.setItemMeta(headMeta);
return head;
}```
Another thing, it's not happening when I'm debugging
So when the debugger pauses execution and I resume it
Really weird
but you should
the singleton pattern is awful and you should always choose DI over singelton where you can
why ?
Singletons are not awful by design, even the Minecraft Client class is a singleton
there are plenty of reasons and a major one is testing
can you elaborate
they are
you cant really test singletons and you are not as much as flexible as if you would simply DI
you still didn't explain anything
a singleton which is accessible by static can easily be tested. not sure what you mean.
im also not sure how they are not flexible
singletons are static constants. how would you mock them?
Why would you mock the plugin instance?
who is talking about the plugin instance
so youre not talking about the singletons themselves, youre talking about their dependencies?
We
no we do not. not everything is about minecraft
i am talking about singletons in general
i mean if you singleton a string, sure you can test its content
but why would you singleton a string
There are also pendants to plugin instances in general programming
you can singleton a logger too
For example the Minecraft class in the client, check its implementation
you can singleton something that does other things. those things are testable too...
singletons are only useful for stuff that doesnt change, like loggers as you are right on
So that was wrong then
nope
Nobody said you should singleton everything
the whole idea of singletons is that there is only one instance of it, right? changing things about that singleton would carry over to all other uses too
so using singletons for stuff that changes makes sense, right
not really
di is basically singleton city without making everything a forced singleton
you just described encapsulation pretty much
changing the internals without the interface
a change without notice
that has not much todo with the singleton pattern
That's not what encapsulation is
except that its a static encapsulation which is totally garbage
static singleton is pretty bad, agreed. but im talking about the idea of the singleton not the singleton pattern
and technically encapsulates that one instance, correct.
While static encapsulation is just a static getter/setter with no one instance restrictions
Now, a non-static singleton seems a bit... off
Because it's impossible to tell whether the object is already set or not if we can just create another instance of the underlying class
What you want is a weird final object
never said that
talking about shreb here
ah
im new to spigot thing, and i think this is a stupid question
but lets say i have 1.19 installed in buildtools
can i install a different version on the same folder?
yea, just re-run build tools with the proper rev
I mean, don't run the server in the folder you run build tools in
if that is what you are asking 
so like i just run this java -jar BuildTools.jar --rev 1.19.2 --remapped in the same folder that i ran java -jar BuildTools.jar --rev 1.19 --remapped and i should be good?
Doesn't even reset. Just creates a new folder in the work dir and updates the Bukkit, CraftBukkit, and Spigot dirs to the correct revision
First build will take a while, subsequent builds of the same version should be much quicker
Yeah don't open inventories async
can you create a whole new gui container using the api
player.sendBlockChange(location, blockData);
Does anyone know when using that above, how to have the blockData be a skull with a specific skin?
Atm I am using material.createBlockData()
And can only get a default player head
Create the block data then get skull from the blockdata (by casting it) and then set the skull owner
I've tried that it does not work
I've deleted it now I'll re-write what I had
Yeah I didn't think so
Remember that it exists only on the client. The server has no concept of the skull so it can't get and cast its state
Ah right it's the BlockState not the BlockData...
Forgot about that
Which part? Sending the packet or what arguments to give the packet?
packets give me a headache
They're not that bad to work with
Is it possible to color player's name in scoreboard, but not in tablist? I'm using bukkit api for scoreboards (teams, objectives)
I've tried team.color(NamedTextColor.AQUA);, but it is coloring nick in tablist too.
That's Paper API not bukkit api
I tried doing some simple removing and adding back an entity on distance for a player but I could never figure it out, didn't really try that hard bc I eventually updated to use spigot's draft api for hiding and showing entities to a player
Entity tracking is a pain
Oh, right, but only color.
Can i do what i want in bukkit api?
You're going to have to mess with packets to prevent it from showing in the tablist
It's not worth it and will cause flickering
Okay, thanks.
you might be able to override it with Player#setPlayerListName()
I'm not sure which one takes priority
hm, okay, i'll try it
It depends on how that is implemented
but yeah give it a try
Oh, hmm, do you think that TAB will override it?
TAB could override it
Im gonna change the plugin structure so the heads are manually placed and then finding them will use sendBlockChange() to hide them with packets rather than show the heads with packets
because i don't use it now, because i'm testing my plugin
Okay, thanks
yea, setplayerlistname works
So long as the players aren't colliding with the skull that should be fine. Otherwise you'll get some weird ghost movement
thanks :)
+1
Replace the skull with a barrier block or smth
Yeah that would maybe partially remedy it
It shouldnt give too weird a collission will it as you can walk over skulls?
Oh I guess yeah
Ye if you're standing on it you're going to be raised up, but the clients that can't see them won't be raised up
yup
can you create a whole new gui container using the api
it has to look like a chest / furnace / anvil etc
u need mods to actually make inventories
Which is a mod
You can use a resourcepack
ik but can I make it hidden
it seems like you are looking for a specific answer
yes
I just want the slot to be hidden
so nothing can happen to it
like you can't attempt to put an item in it
Use event listeners to not allow interactions on that slot
That's impossible. The best you can do is hide the slot
and yea ^
ik
Hi, im trying to spawn an invisible, named armorstand for a player. This spawnes the armor stand but he is not invisible and named
The data watcher of your entity
cuz i need an integer, and a boolean, the data watcher you can easily get by entityArmorStand.getDataWatcher()
The int is probably the entity id
hmm ye
as for the boolean look it up on wiki vg
Hello is there a way to add a new library to the libraries folder that will be loaded?
How is InventoryInteractEvent? Im not getting anything if I do something in Inventory. why? ```@EventHandler
public void onInventoryInteract (InventoryInteractEvent event) {
Player player = (Player) event.getWhoClicked();
Main.console.sendMessage("inventory interact");
player.sendMessage("Interact event");
player.sendMessage("Results: " + event.getResult());
}```
did you register the event?
yep, other events from that file works
Don't blindly cast for this event on who clicked also decompile the jar and make sure thr code is in there
I tired and that code is there. So idk if I did something from or mby I dont understand when the event is called? 😄 idk
i think its the InventoryClickEvent
Thats looks like a different event than InventoryInteract or am I wrong?
InventoryInteractEvent is an abstract class. It can;t be listened to.
yep
the event u serch is the inventoryClickEvent
Than my bad. Thanks! Im pretty new in java.
np
Omg notro I'm a big fan
Can I get autograph?
Pls pls pls
🤨
oh, it's you xd
Confusing 2k subs no videos
hah
i was recording 2-3 years ago
it was very cringe content xd
so kids were watching
Feels bad
it is possible to change displayname to just name on scoreboard?
Like... When i added vault, it has prefix now
if i did this to a fileconfiguration object FileConfiguration#getDefaults shouldnt return null right?
well actually ig reloading it removes the defaults
Hello I am working on plugin that creates fake player and I need listen for packets that are coming to that player, is this even possible? I am getting error NoSuchElementException: packet_handler when try add listener to it
you can't really listen to packets that are coming from a fake player
because it has no connection
Its behavior is emulated
I tried before make connection via mcprotocollib but turned out it will not connect to forge server
I am a little pissed rn
Did anyone try this? I mean connect to forge server
Thing is I am working on plugin for hybrid server
something tells me you're trying to make a plugin that acts as a client for another server
either that or you're trying to send packets to fake emulated players which makes no sense
plugin that allows use minecraft chat from discord
I succeded actually, but only if there are no client-side mods on server
so discordsrv?
idk what that is
Ah yeah
I have this site as readed so probably didnt worked for some purpose
Well, something like that is simple
I am trying to achieve something like chatcraft
is there a way to read a file using plain javascript?
custom config
and?
Hi, so basically I need to check when a TNT gets powered, I'm using paper, there is TNTPrimedEvent, but I'm in legacy (1.12.2) so I can't use it
How to check it then?
EntityPrimeEvent?
And casting the entity to tntprimed, and getting the source of the explosion would return the redstone block (for example)?
yeah i guess
it's debug time
@tardy delta
and?
the problem is that I need to check if the original TNT block is in a list
so I need to get the source block before the TNT becomes an actual TNTPrimed
public FileConfiguration getConfig() {
if (newConfig == null) reloadConfig();
return newConfig;
}
public void reloadConfig() {
newConfig = YamlConfiguration.loadConfiguration(configFile);
final InputStream defConfigStream = getResource("config.yml");
if (defConfigStream == null) return;
newConfig.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(defConfigStream, Charsets.UTF_8)));
}
public void saveConfig() {
try {
getConfig().save(configFile);
} catch (IOException ex) {
logger.log(Level.SEVERE, "Could not save config to " + configFile, ex);
}
}
public void saveDefaultConfig() {
if (!configFile.exists()) saveResource("config.yml", false);
}
well just reproduce it for anything else than "config.yml"
thats what im currently doing
declaration: package: org.bukkit.event.entity, class: ExplosionPrimeEvent
That is called once the TNTPrimed explodes
do i need to close an inputstreamreader lol?
I need to get an event called when the TNTPrimed spawns
me every time I decide to work on my old plugins
i guess it's placed in the stack memory
EntitySpawnEvent doesn't get fired with TNTPrimed
so gets auto-closed with method end
EntityAddToWorldEvent does but you can't cancel it
no clue
Removing the entity creates a visual bug
as long as it doesnt break its fine
remove it 1 tick later
I mean yeah, but it's a bit weird since even scheduling 1 tick later would cause a visual bug
scheduled tasks get run at the end of every tick, right?
maybe thats enough so you can schedule the task for the same tick
does anybody have a clue on how to obfuscate gradle projects
iirc all tasks run in the beginning of the tick
and like half of the tick is on "waiting state"
after everything is done
this should work
lol
@tender shard
smoking is very healthy
I smell cap
Smoke and drink for extra hospital visits later in life
I'm always 5 years younger when I shave
nms is fun
after all I got a sponsored trip to the states in like 8 months
Going to the land of milk and honey 
I got an ID
where
And that's all
is it some european thing?
Yeah
one sec
I can travel within europe with just my ID
Well
In theory I have an expired passport I last used 10 years ago
America gonna irradiate you with scanners
which i sent
yeah
except I'm not from slovenia
it's gonna be great
I've tripped the metal detector in ukraine once
I was like... 7?
security guard patted me down extra hard
They put me a big box once cause they didn't trust me or something
I can imagine the mfs being like
Hahahah machine go brrr
"no"

like
it's weird
I'll work on a project and once I'm done with the project
I'm being flown to the states to just meet the team and hang out
Victory beer
I don't think I can legally drink in the states
Gotta be 21
here in europe you can be 14 and just go to a supermarket and no one gives a shit
I've seen cashiers ask for ID to buy a red bull but not a beer
I did not unblock you
this is proof
😭
Rekt
freejavalessons
if you know so much about java, help yourself
can you remove this message plz
it's literally in the middle of my topic
between some parts of code
also
you should feel owwww after this
bold of you to assume I feel anything
i'm brave
I literally dream about cold blooded murder every night
xd
so do i
so do I*
died
💀
i literally changed from so do i to so i do
and then started recalling all my english classes
🤦
@echo basalt lmao ur friends with rehold
hey guys, which name would you guys give to a class that adds players to a game?
game display is a bit mismatched in my opinion
GameDisplayManager
but it doesn't manage game displays
GameManager?
GameQueuer
that's something else
GameManager / GameManagement, ye
Would also add the starting and more things about the game to that class
ehh that structure is a bit eh..
GameHosting / GameHost
hosting is a good one
That's the whole point. Programmers are lazy
usually a manager is mangled with a lot of stuff
other than the scope it is intended for
And everyone knows what a "xyzmanager" is used for
i also like PlayFacade
But that's not the names fault. Obviously you should keep it clean
bruh
or GameServer
basically a GameManager, if you are doing OOP, you would need Game + Player + GameManager
I mean I won't complain if someone doesn't use "manager". But at the end it seems very clear to me what UserManager/PlayerManager/SessionManager etc. are supposed to do
with GameManger you would add Player to Game
I wouldnt name it game manager eitherway
Don't think Game.add(Player) would do better
whats the best way to spawn anvils so that the player won't lag
i'm assumning as entities and not blocks since that would update the lighting iirc
FallingBlock is an entity
you're not wrong
that wasnt the question
so if you just set blockdata to Material.ANVIL.createBlockData()
i have a playlist inside game manager
it's gonna work fast
is it not better to spawn an entity instead of a block since the client will have to render the changes when it's not a fallingblock entity
?paste
Hey I am creating a scoreboard and for some reason I cant see some of the lines/scores
I can see time1,time2, and time3
Can anybody see the scoreboard? Player#setScoreboard()
yes I can see the scoreboard perfectly fine
Oh just specific lines
yup
blank and blank1 are identical for one. They need to be different lengths
" " & " "
alright I didnt notice that I can see it but the times one arent identical so
its weird that only those are the ones not showing
Yeah. I'm not sure what about those scores in particular would result in them not showing up
changed the text to a, b, c and it worked so something is messed up with the values
Could be that scoreboards treat 0-9 as the same char for some inexplicable reason
any screenshots? i worked with scoreboards for a bit
funny how during the past 5-6 years I never messed with scoreboards
it's just a bunch of trig
is this finaly the recoding of the counterstrike:D?, been waiting for years:3
How do I convert an nms-world back to an bukkit-world?
haha sick:D I hope it will have improved api:)
kinda @pallid oxide
getCraftWorld() will return the NMS wolrd obj
good suggestion, ability to add skins to weapons without copying whole weapon:3 hehe
I had this system where i had to dig really deep so i could add my own skinsModels: stringlist to guns.yml
so it would automaticly create Gun object to the skin:D
Wow i suppouse u are coding a big plugin
I leave it there, if someone want to use it or improvee it
File could be created when the object is created and u could get the name from the file
Can u explain more about the "File could be created when the object is created"
oki 2s
In the case of using that utility class i created once its initialized the file is loaded
it's not that big of a plugin honestly
How u know?
because I write big plugins for a living
agreed i actually planned to code my own
but
oh ok u have xp?
Would you be interested on working for a +$250 budget plugin?
But plugin like that is big for some people
He has more than u xD
I think that like 70% of plugins I wrote this year were made for sharding
https://i.imgur.com/aVaPN4H.png
Does someone know why addPassenger() doesn't work on snowballs?
Version 1,.8.8
setPassenger for legacy shit
?1.8
Too old! (Click the link to get the exact time)
you should just... try all methods suggested by your IDE
You shouldnt be using deprecated versions
If u still want to get support please move to latest version
😂
private final File file;
private final String name;
private final boolean parent;
private final JavaPlugin plugin;
public FileHandler(JavaPlugin plugin, String name, boolean parent) {
this.name = name;
this.parent = parent;
this.plugin = plugin;
this.file = new File(plugin.getDataFolder(), name);
}
Just a preference actually, and u got reason for boolean to be Boolean?
and depends how u want ur stuff to work (the file part)
I'd move to latest if Micromojang didn't ruin PvP
but unfortunately my players like 1.8.8
In my case yes
I tried removing the boolean out
But then its get fuck
Because its try to get the parent which is null, so then you have issues
i mean why is your boolean capital case, what happens if u type new FileHandler(plugin,name,null)?
do you have use case for it or a reason?
Boolean can be null, boolean cant
oh ok
Good aproach i would change that
👍
I seen you bunch of experience
:) thanks
Zoltus
yes?
I can dm some personal questions?
yes
How do I open a book for a player so it shows up on their screen but it doesn't give them the book in their inventory?
Every time I try to set the display name of an item via item meta, I end up with this error: Incompatible types. Found: 'void', required: 'org.bukkit.inventory.meta.ItemMeta'
Code:
public ItemMeta Beermeta = BeerDrink.getItemMeta().setDisplayName(ChatColor.GOLD+"Beer"); (all the other code is as it should be and alright, but when I put in the text after the chatcolour, the error always pops up)
Think long and hard, what do you think #setDisplayName() returns
setDisplayName does not return anything
ItemMeta beerMeta = BeerDrink.getItemMeta();
beerMeta.setDisplayName(ChatColor.GOLD+"Beer");
this would work and sry adelemphii for ruining it:D im bored
Ah, that also gives me a similar error, let me copy paste it
I mean have you learnt java before coding?
Because tems like void, etc are java bases
You can also try this:
ItemStack BeerItem = new ItemStack(Material.LAVA_BUCKET);
ItemMeta Beermeta = BeerItem.getItemMeta();
Objects.requireNonNull(Beermeta).setDisplayName(ChatColor.GOLD + "Beer");
sorry for the double ping
A decent while ago, tbh I should probably do a refresher
weird
I ave learnt java 1y ago and i never forgot what was void
can anyone help me in #help-server
Stop asking for fast support
You are not paying anyone to get instant support
Atleast take the time for reading the rules
im not asking for fast responses, im just seeing if anyone knows
this not the channel tho
well
im not impatient
there will be impatient people in life tho
i dont care i love catting them up
😂
So go to your channel and tag there
Dont came to disturb into other channels
Tho
PROGRAMMING tho
ok
No luck
LMAO what amazing society we have created
?paste
Please send the error you are getting
K one second
um, what?
quite a few
And sorry for being in that actitude i know that i sound rude but im like girls every 28 of each month. I have lot of problems and dont like more problems
Cannot resolve symbol 'requireNonNull'
Unknown class: 'Beermeta'
Identifier expected
Unexpected token
Invalid method declaration; return type required
Missing method body, or declare abstract
Unknown class: 'ChatColor.GOLD'
',' expected
Identifier expected
'class' or 'interface' expected
whoops
Oh dont worry, i got told to f off yesterday lol i cba to be mad
I'm probably missing something simple af here though
these are all syntax errors
are you coding with notepad++ or sum lol
intellij
please learn basics of java or atleast how to utilize an IDE
they are great tools you shouldn't bee getting these syntax errors
Yeah i realize that
I think he havent learnt java and dont want to admit it
Its really obvious when you dont learnt java and try to code
you need lombok it might seem as a dependency
or some other dependency that provides those checks
why lombok?
Its the only one I can think of right now because my brain isn't letting me think of the appropriate dependencies
so hopefully saying that others here can fill in the blanks 😛
and you don't read
I mean lombok is a library for speeding up coding
annotations library or unit dependency for those checks is what is needed
finally my brain lets me think of the word 😛
and you don't read as I said
so please stop telling me what I already know
Does anyone know how to make armor tank more hits (only like 1 dura every 4 hits from good swords)
I dont understand your OOP language
1 dura? Do u talk spanish?
duration
Lose 1 durability every other hit
oh ok
Do you know how I could do that
you would need to listen for the interact events for combat and basically have to keep track of these armor values yourself
to then appropriately apply your custom math for it
not saying it is easy, but it is doable with the API though 🙂
:/
Hello, I was about to use StringUtils from org.apache.commons.lang.WordUtils, but now I noticed that they are no longer included in the spigot jar.
How can I still use the StringUtils now?
Are there no easier ways? Just make Unbreaking enchantment better or smth
add apache commons as a dependency to your project. Spigot provides those libs
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
And how can I do that with maven?
You can theck their own have docs to see when they remove a method or not
I mean spigot api contains it tho
Thank you!
Thx
Na dont worry, i mean my answer wasnt what you were expecting but if you didnt know that then can now have it in care
How would I take first (best) key out of linkedhashmap<uuid, integer) after sorting from most to least?t
Have you sorted?
LinkedHashMap<UUID, Integer> sorted = originalLinkedHashMap.stream().sorted();
sorted.whatYouNeed()

I coded something that in theory change the players max health to 5 hearts whenever they join, but for some reason this doesn't seem to work. i put in 10 as the value becaise i thhink it's referring to healthpoints
no static and you forget the annotation
why not static?
its how its should be done
ok
10/10 verano as always
?events
maybe
idfk
pretty sure that static listeners aren't supported
wait my bad i forgot to add @eventhandler
They work but takes more time to compile
you sure
I mean someone told that some months ago that they works but its not recommended
Yeah I just need to pull out the first key (uuid) lol idk how to
You can read LinkedHashMap docs
kk ty
you do realise ASM here is a pretty good deal for you ?
i have a question for yall. would you guys use a library that contains everything. think about "command managers, menu system, config system, etc"
which could lead to bloat that you don't actually use in your plugin. or would you go with seperate libraries for each use? meaning you would for example have just a "menu system, config system" and leave anything you do not need out. this would eliminate tying the systems together though
I just have a folder with them all in their own package
and just copypaste whatever I need
usually those libraries end up with the same issue as any other jack of all trades
I would use a multi module library
Unless I have duplicates
so the systems don't need eachother then
Then I'd just... make a core plugin
one or two need each other
but in that case I just bundle them both
and just use the modules you need then?
Example: my menu util needs items, placeholders and colors
Depend if i need most of them, include the parent module if not just each of them
could you show me that library? or is it private
I never finished it but you can take a look more or less
would love that
i will invite you to the repo
looking for inspiration to get it right
ok
i would use this structure
library-parent (Default POM)
library-plugin
library-core
library-menu
library-chat
library-etc
I mean i have never seen a single forum which isnt toxic lol
right. that sounds good. cuz right now i have the problem of having alot of stuff shaded in that i do not actually need
Yeah that why multi module cames
Also there is something but from java 17 for modules
I dont know how its called