#help-development
1 messages · Page 2174 of 1
Eh, I do, but it's a pain to make custom enchantments. It's a little easier nowadays thanks to the pdc, but still. You'd have to create a listener for each custom enchantment, update the lore on the item, update the pdc with the custom enchant name, etc
It's worth it if you need it. I'm just saying it's a process.
Line 4. Enum is more efficient to compare, as well as ordinary numbers. 16 and 24 - requesting a variable from the config each time is slow. save its result to a static variable, and that's better. I think sending an interactive message will solve your problem, clicking on which will execute a command that will already execute the desired piece of code.
Normally yes. but in this case the config is already cached due to spigot's implementation of #getConfig().
Can you ppl just tell me wen I place a beacon I want to place a block on it How can I dO that
But accessing HashMap, or whatever is in the config... it's still much slower to access the variable isn't it?
I want to place a block over it
I want to create a kick gui but I can't get the target through events.
It's still a reference lookup. So it should be the same performance.
Listen for the BlockPlaceEvent, check if it's a beacon, then get the location above it and set the block to what you want.
how
how can I get the location up it
In that case, both the config and your separate value would sit in different parts of memory. The config would take up more memory, but when you get the value of each one, it's the same process.
Create a new location object using the one provided by the event and then just add 1 to the y value.
How
plugin.getConfig().addDefault("...", true);
plugin.getConfig().setComments(stuff);
plugin.getConfig().options().copyDefaults(true);
plugin.getConfig().options().parseComments(true);
plugin.saveDefaultConfig();
like this:
Location loc = block.getLocation().add(0,1,0);
?
When I manually delete everything from the config and save and reload it's still empty
Exactly that
ok
I mean, if you want to get real technical, depending on where the values are in memory, it may take a milisecond longer to get to one that is "farther" than the other, but it's so negligible at that point.
but its not placing over it
Show your code
You need to set the block at that location to something else.
ok
That location is just a location. You need to do something with it.
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
public class Listeners implements Listener {
private Magic_Armor plugin;
BukkitTask task1;
int task2;
int task3;
BukkitTask task4;
BukkitTask task5;
public Listeners(Magic_Armor plugin) {
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent e) {
if (e.getBlock().getType() == Material.BEACON) {
Player p = e.getPlayer();
Block block = e.getBlock();
if (e.getBlock().hasMetadata(ChatColor.GREEN + "Re" + ChatColor.WHITE + "ge" + ChatColor.GREEN + "nb" + ChatColor.WHITE + "og" + ChatColor.GREEN + "en-" + ChatColor.WHITE + "Le" + ChatColor.GREEN + "uc" + ChatColor.WHITE + "ht" + ChatColor.GREEN + "fe" + ChatColor.WHITE + "ue" + ChatColor.GREEN + "r")) {
Location loc = block.getLocation().add(0,1,0);
loc.getBlock().setType(Material.GOLD_BLOCK);
task1 = new BukkitRunnable() {
int c_color = 0;
public void run() {
if (c_color==6){
c_color=0;
}
switch(c_color) {
case 0:
loc.getBlock().setType(Material.RED_STAINED_GLASS);
c_color++;
break;
case 1:
loc.getBlock().setType(Material.ORANGE_STAINED_GLASS);
c_color++;
break;
case 2:
loc.getBlock().setType(Material.YELLOW_STAINED_GLASS);
c_color++;
break;
case 3:
loc.getBlock().setType(Material.GREEN_STAINED_GLASS);
c_color++;
break;
case 4:
loc.getBlock().setType(Material.BLUE_STAINED_GLASS);
c_color++;
break;
case 5:
loc.getBlock().setType(Material.PURPLE_STAINED_GLASS);
break;
}
}
}.runTaskTimer(plugin, 20, 20);
}
}
@EventHandler
public void onBlockBreak(BlockBreakEvent e){
if (e.getBlock().hasMetadata(ChatColor.GREEN + "Re" + ChatColor.WHITE + "ge" + ChatColor.GREEN + "nb" + ChatColor.WHITE + "og" + ChatColor.GREEN + "en-" + ChatColor.WHITE + "Le" + ChatColor.GREEN + "uc" + ChatColor.WHITE + "ht" + ChatColor.GREEN + "fe" + ChatColor.WHITE + "ue" + ChatColor.GREEN + "r")) {
task1.cancel();
}
}
}
?paste it next time please
ok
so can you tell me whats wrong
be careful of people placing blocks at the height limit
no
lmao
why do child classes called Spigot exist??
Well ok then
@kind hatch WHY IS IT NOT WORKING
@EventHandler
public void onPlace(BlockPlaceEvent e){
if(e.getBlock().getLocation().getBlockY().getRelative(BlockFace.UP) < e.getBlock().getWorld().getMaxHeight()){
e.getBlock().getRelative(BlockFace.UP).setType(Material.WHATEVER);
}
}
just an idea
debug it
First off, lower your voice. Secondly, I think you need to do something more than just setting the block type. You may need to update the state.
to simply place a block, setType is enough
I see you got nitro hahahaha
It may also be due to something with the block metadata. Not sure how long that lasts for.
i don't use the nitro features, so it'd be kinda useless to pay 5€ more
exactly
ooof
You get any perks for boosting here?
idk
i dont think i get one for boosting myself
but everyone gets some things for the server having enough boosters
like higher upload limits etc
alltho i can't upload shit either lol
@kind hatch I tried to place blocks but its not placing and I tried this:
public void onPlace(BlockPlaceEvent e){
if (e.getBlock().getType().equals(Material.BEACON)) {
e.getBlock().getRelative(BlockFace.UP).setType(Material.GOLD_BLOCK);
}
}```
show code
debug it
I did
you registered it?
is it called?
clearly not enough
and dont compare enums with equals
oh wait
Verify your account and you can upload stuff
yea, that's most likely the reason
AH MAN ,I DIDNT
nope
lmfao
ALL THIS FOR NOTHING
i'm gonna kill myself today if that keeps happening
it will use the default Object#equals then which is ==
why do so many people forget registering stuff
main reason why i stuck every event in one class tho
oh god
They probs think the annotation handles it.
i'd probably forget registering that many events as well
or they forget it like i do 💀
its working now
nice
how can people rebuild their project stop their server reinstall the plugin and load it back in that small time?
Vitally
i mean 1 minute
SSD
server starting up is slow tho
You can also use hot swapping 🙂
Just use paper userdev. It comes with all of that setup iirc
paper what?
idek how that happens, first thing I do after I'm done with the class is registering it lol
ye i ended up at that site but it isnt sayin me anything
my servers are not running on java , but on Graal .. the time to launch is calculated in seconds, milliseconds.
whats Graal
a vm?
What significance does public void onLoad() have? Is it any different from onEnable() ?
minecraft works fine on it and not only, but many java flags are outdated and not supported
onload gets called when your plugin is loading
do I have to restart the server every time when building the plugin? or can i just reload it
onenable when it enables, as simple as that
it's called before the onEnable method.
plugin gets loaded early on though, even before the worlds load and whatnot
So if you need to do anything before the plugins get enabled, use the onLoad() method.
You can reload, but I do recommend restarting
like veryy early on
yes
vm = virtual machine
i think economy plugins hook into vault in the onload?? im not 100% sure though
thanks, how can i add an interactive message ?
ik lol
yes but is it building the remapped jar or isnt it because the jar to replace is in use?
use json messages. or TextComponent[]
ah ok thank you
How can you mix
player.sendMessage() and player.spigot().sendMessage()
One is meant for hex color and one is for hovering messages, but idk how to mix
when you check your console on startup, you'll early see plugin xy loaded and later plugin xy enabled. first is the onLoad(), second is the onEnable
So can it replace the onEnable() method though? Or do I still need onEnable()
well depends
Don't build directly to your plugins folder
at which point you load your plugin
it's the same thing. it's just that it's very convenient to work with text components, despite the fact that they are outdated
if it's loaded after the worlds (default), use the onenable
Ok thanks, was checking out the worldguard api and noticed they had the onLoad() method so I was interested
but why? its way easier
i dont think the onload has any real use-case anyway
well true, that takes a bit of time
They also need to be loaded before other plugins
You might run in to issues, such as the file not being replaced, but you do you.
player.spigot().sendMessage() takes textcomponents
Yes, but there is another flag that lets you choose if you want STARTUP or POSTWORLD. I forget the name
Either way, those features only sometimes fit the usecase
Sometimes, you need to use the onLoad because the loadbefore isn't enough.
PAPI is a good example of loadbefore not being able to work.
but if you load it on startup, i'm pretty sure that the onenable is called right after the onload, so idk if it's that much of a difference
yes but do u know how to make it support hex?
All onLoad methods from every plugin are called first, then every onEnable method is called shortly after all of the world loads. Unless specified otherwise with the load flag
you can achieve that with the Player#sendMessage method and the ChatColor.of or something, look at the forum
i mean yea, it may be useful if you really need to load stuff before some other plugin... but i think there's a flag to load your plugin before all others
Anyone knows a way to save comments in a config file after editing it and saving it?
If you are using 1.18.2, spigot does this automatically.
setComments i guess?
Anything below 1.18.2 won't save comments due to the functionality not being added.
imagine not using 1.18.2
Just bump the version on spigots side of things for 1.8 obviously /s
im using 1.17.1 smh
?scheduling
only saveDefaultConfig() keeps them
Bukkit.getScheduler().runTaskLater(plugin, () -> yourtask(), 20L); // 20 ticks delay```
Run /version
and it's f'ing annoying me
How many versions behind are you?
Latest Spigot should save comments
It does and it has for a while
i remember saveconfig wiping all of my config's contents lol
dunno what drugs spigot was on back there
contents or comments?
That's odd.
everything
I'm 31 versions behind and I'm able to save comments with #saveConfig()
even when onEnable doing nothing but calling saveConfig(), it always wiped the whole file
SAME RN
but only comments are getting wiped
i dont mean comments
ik
i mean EVERYTHING
ye ik
Can you share how you are saving and loading your config?
change my mind: i still wish for a method to completely remove complete sections
Uhh, #set("section", null)?
it just sets the value to null
public void editDefaultConfig() {
plugin.getConfig().options().copyDefaults(true);
plugin.getConfig().options().parseComments(true);
plugin.saveDefaultConfig();
}``` this in onEnable()
when I try to save stuff the comments are gone
with saveConfig().
idk it has a good api and im not going to switch to something new everything it comes out
hasnt alot of the api changed in 1.18 or were that only some aspects?
i dont remember having anything beeing worse
or even changed at all
maybe just me, idk
I normally avoid config options as the defaults just work for me. Try removing them and just using the basic #saveDefaultConfig()
ah then probably it had to do with world generation
That's really weird. I'm pretty sure the advice on the wiki even says to set a section to null to remove it.
world generation was always changing between versions
nothing new
also, there's no good "documentation" about worldgen
except old ass outdated 1.8/1.12 ones
hmm i thought something had changed
Youi are correct to remove a section you set it to null
is this fine for creating a delay:
public void run() {
block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS);
task1.cancel();
}
}.runTaskTimer(plugin, 20, 0);
task2 = new BukkitRunnable() {
public void run() {
block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS);
task2.cancel();
}
}.runTaskTimer(plugin, 20, 0);```
It works fine
why are you not using the scheduler and using 2 tasks?
Are you sure you aren't parsing null as a string or something else?
i want to see the whole code
this makes my head blow
?paste
i'm sure, yes
i always use set("path", null)
not "null"
that will remove the path no?
Use runTask instead of runTaskTimer, if you want it to run once and stop. No need to cancel
Well the only other thing I could think of is encoding issues or YAML parsing options that are set to something else.
soo much wrong in that code
ok
i mean wtf
first param is the initial delay and the 2nd the time in between repeats
If you setting values in something like a List you can include null. ConfigurationSections are removed by setting them null
but how can I add delay in it bcz it only needs one arg
thats the plugin
runTaskLater
They're not getting added for me without the options, also I just tried putting this in onEnable
getConfig().set("Test-String", true);
saveConfig(); ``` and it removed all comments -.-
ok
yes writing into a configfile will remove all comments except the header.
i mean that code isnt going to do much
Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS), 20L);
Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS), 20L);
basically exactly the same
and do I need to cancel it or not
use the one i sent above i guess
ok
runTaskLater runs it once
ok
with the delay you pass, in ticks
i dont like people manually instantiating BukkitRunnables unless theres a good reason to do so
So how do I keep those fuckers after adding stuff to the file?
No need to cancel. runTaskLater also only runs once, then ends
it doesnt add 20 lines per runnable, that's my reason ig
i guess
ah bruh why do i keep forgetting that
instagram is shit
You may want to try using the manual approach then.
Just run saveDefaultConfig() in your on enable so that it gets written to disk.
Then override the #getConfig() method with your own.
File configFile = new File("config.yml");
FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);
config.set("whatever", true);
try {
config.save(configFile);
} catch (IOException ex) {
ex.printStackTrace();
}
😳
i dont use it for like 2 years or smt
it can be shit but i still use it
I deleted it recently
i only use it to simp specific people
so ur using it
lil simp 
If you use any version below 1.18.2. This issue has been fixed.
i dont do anything except scrolling through profiles
i'm saving base64 heads in memory, but after my server restarts, it stops stacking with those heads and create a new stack, is there a fix to this?
but I'm on 1.18.2 wth does it still remove those fricking comments
did they change it recently? I didn't know
Check my last reply. Try that approach.
ur recreating them?
but it only places one block after 1 sec and it doesnt place the red glass it onyl places the orange one
I don't quite understand what you mean with that
Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS), 20L);
Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS), 40L);```
fixed
ok
i thought they'd stop the flow until the task ran through
ye change the time
apparently not? idk
I just tested Comment saving in 1.18.2. It works perfectly.
The "easy" built in methods for accessing the usual config may not be cutting it.
What I gave you in code is essentially what those methods do internally.
I wish it would do so for me too
well i'm storing it so it stacks with other heads, but after i restart, it has different nbt because what was saved into memory with hashmap is gone and resets
are you using the 1.18.2 api as well?
for the plugin
i guess recreate them
It'd be the same regardless of version when running on the server.
it worked
pog
I did saveDefaultConfig() Saved as expected. I then called saveConfig() comments were still there. I thien addedjava getConfig().set("test-value", "this is a test."); saveConfig();Config saved with the extra entry and all comments preserved
<version>1.18.1-R0.1-SNAPSHOT</version>
you remember
buildtools
the "issues"
i'm sure it has something to do with your nms not working for 1.18.2
-.-
do u know if it's possible to save it to flatfiles
Changed it to 1.18.2, exported the plugin, and still comments gone
I don't think using the 1.18.1 API to make a plugin that runs on 1.18.2 would be an issue in this specific case.
The #saveConfig() method is present in both, so when you use the API, it will be there. But when it actually runs on 1.18.2, it should save comments.
ikr
apparently not
it's just so weird
I want it to place 5 block after every 10ticks
but it goes to the last block
too fast
Well, the only other things you can try are as follows.
- Update your spigot to the latest using buildtools.
- Refresh your maven project and maybe restart IntelliJ
- Restart your computer
- throw myself outta the window
LOL
I have an issue with hashmap, I create a location based on a vector and a world, but it wont match the one that I retrieve with the PlayerInteractListener.
I checked (Logged) and both of them share the same hashcode (because they have the same value). I cant wrap my head around this.
When I try to retrieve it obviously it fail.
There aren't any hidden spigot.yml settings for comments are there?
10 ticks is half a second
🤔
BukkitTask task = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
//place block 1
//place block 2
//place block 3
// place block 4
task.cancel();
}, 0L, 10L);
not tested obv
you either use one runTaskLater for each, or you use a runTaskTimer and code delay logic in it
i'm dumb
@quaint mantle you are placing blocks top and 4 sides. not below?
wait
I have a weird bug, I canceled items despawning at a specific world for a minigame Im doing and for some reason this causes a duplicated-unpickable item to spawn when I use the /give command
Any idea why?
This is my code
@EventHandler
public void onItemDespawn(ItemDespawnEvent e){
if(MiniGames.bedWarsGame.isOngoing() && isBedWarsWorld(e.getEntity().getWorld().getName()))
e.setCancelled(true);
If you cancel that event, you may need to manually call #remove on the items.
so how can I place after each 10ticks
I want the items to not despawn
uhm private is a thing
Well, there are options for despawn time in the spigot config. However, you may have to do something like respawn the item as it despawns to make it look like it never despawned.
?
I will try that, thanks!
just another idea
private BukkitTask task;
private int blocksPlaced;
private void yourMethod() {
this.blocksPlaced = 0;
this.task = Bukkit.getScheduler().runTaskTimer(Main.getPlugin(), () -> {
switch (blocksPlaced) {
case 0 -> placeBlock1();
case 1 -> placeBlock2();
case 2 -> placeBlock3();
case 3 -> placeBlock4();
}
blocksPlaced++;
if (blocksPlaced == 3) this.task.cancel();
}, 0L, 10L);```
i'm tired, keep that in mind lol
aaaaaa indeed
A little old school, but would still work.
new BukkitRunnable() {
List<Block> blocks = new ArrayList<>();
int counter = 0;
@Override
public void run() {
location.setType(blocks.get(counter));
counter++;
}
}.runTaskTimer(plugin, 0, 10);
if i could, i would do that
but i just woke up like 5 hours ago
OPTIC?
how late is it?
for me it's 8pm lol
oh
dont ask
and u woke up 5 hours ago?
dont even wanna know
good
@EventHandler
public void surroundBeacon(BlockPlaceEvent event){
if (event.getBlock().getType() != Material.BEACON) return;
BukkitTask task = new BukkitRunnable() {
Block block = event.getBlock();
List<BlockFace> faces = Arrays.asList(BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST);
public void run() {
if (faces.isEmpty()) {task.cancel(); return;}
BlockFace blockFace = faces.remove(0);
block.getRelative(blockFace).setType(Material.RED_STAINED_GLASS);
task.cancel();
}
}.runTaskTimer(plugin, 10, 10);
}```
Yooo, that's clean.
you forgot down ._.
instantiating bukkitrunnables aaaa
Yes, he did say 5 blocks
okay, then my bad lol
no I also want to place it down
then add down too 😉
ok
I ran buildtools and replaced the old jar with the new one and still comments gone
oh sorry a mistake
Did you run it in a new directory?
Should be if (faces.isEmpty()) {task.cancel(); return;}
Maybe something in your code is setting other flags that are preventing comments from saving.
I don't have anything else config or even file related beside that
ah won;t work. see Arrays.asList is immutable
How can I make a player open a random inventory , like crafting grid enchanting table , enderchest, wardrobe etc…?
I don't think this would be the issue, but what do your comments look like?
will it place those blocks which I put under red
somewhat like that
Oh, that's why. The comments need to be above the section name, not below it.
really?
Yes
no way
lol
such an easy fix lol
If it's not directly above a section, it will be removed.
It’s a fixed size array list
what is that dude saying then
You can have block comments as well, but if there is a space like this:
# Test Comment <--- This comment isn't tied to any section due to the space below it.
section: "Value"
# Test Comment <--- This comment is registered to `section1` and will stay.
section1: "value1"
i put them above and still they are gone
whats the difference then? what else is considered as being a mutable operation than add and remove?
set
is there still something wrong?
i shouldve said 'other things than operations that modify the size'
List<BlockFace> faces = Stream.of(new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST}).collect(Collectors.toList());```
muteable 🙂
That looks fine to me.
myeah altho Collectors::toList doesn't specify mutability, so it could change in the future although unlikely
no
set doesn't
it sets an elements to the given index
ah so set doesnt work in List.of
nope
ah i understand what you mean now
I'm trying to make a 1.8 plugin, but keep getting Missing artifact net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT in my pom. Any idea how to fix it?
The comments stay if I remove getConfig().set("Test-String", true); saveConfig();
as soon as I add it they're gone
Do config.save(WhateverFile); instead
I tested exactly that, it works fine
maybe this thing is trolling me or smth
It knows who you are 😄
Using a recent version of spigot?
public void editDefaultConfig() {
plugin.getConfig().options().copyDefaults(true);
plugin.getConfig().options().parseComments(true);
plugin.saveDefaultConfig();
}
@Override
public void onEnable() {
editDefaultConfig();
getConfig().set("Test-String", true);saveConfig();
}
--> comments gone```
the latest
I didn;t do any of the options
Yeah, generally they are not required
in onLoad() saveDefaultConfig()
in onEnable add the section and saveConfig()
Why do they even exist 🤨
i'm saving base64 heads in memory with a variable, but after my server restarts, it stops stacking with those heads and create a new stack, is there a fix to this?
jesus christ
it's working now
plugin.getConfig().options().copyDefaults(true);
plugin.getConfig().options().parseComments(true);``` those 2 piece of ****
then there is some kind of nbt difference
That's why I avoid them. Their functionality seems to be either unknown, or unnecessary.
I'm guessing you are generating the heads with a random UUID when yoru plugin starts
anyway, thanks for helping me with that struggle
have you annotated the Listener?
yep yep and I registered events
add debug then. sysout
COBWEB is not in yoru enum
its not placing blocks
sooooooo (?)
sorry mistake again, remove the last task.cancel() line
ok
ok
whats wrong with new ArrayList<>(Arrays.asList()) heh
teh code uses .remove on teh list
well
yours would work
new ArrayList of a List 🙂
(?)
yesj
You wrote this code on a different server version that you are testing on
Arrays.asList is just an array wrapper 🤤
k I try changing api or version idk... let you know
or you don;t have an api version so its defaulting to legacy
is there any way to make custom structures or caves?
it was the server version! You was right! Thank you it works and pretty good!
how do i add a string to an array in a config?
config.set("clans." + clanx + ".members", config.getList("clans." + clanx + ".members").add((String)player.getUniqueId().toString());
this is what i have rn
problem = 'add(capture<?>)' in 'java.util.List' cannot be applied to '(java.lang.String)'
config.getList returns a List. you need to store that to a local variable, modify it, then put it back
You need to do the steps individually.
ty
what event would i use to get when a player right clicks another player
PlayerInteractEntityEvent
Just check if the clicked entity is an instance of Player and there you go.
rightclicked instanceof Player
config.getConfigurationSection("items").getKeys(false) returns ["pirates_compass", "cod"]
What happened to sysout-debugging?
this is correct.
but it's supposed to look into those branches for the values
And what value is "cod.rarity"?
“COMMON”
Look at your config again
do i need quotes?
Whatever: it is not set
where'd i be without my slatts?
"COMMON" would be "items.cod.rarity"
@onyx fjord
ohh
?
https://paste.md-5.net/usudakuqic.pl now im getting this error
looks similar, but it didnt error on load this time
what is the code?
You never set the rarity to the PDC
Well the PDC that is used in the line that errors
if (rarity != null) setString(item, new NamespacedKey(PlexPvP.get(), "rarity"), rarity.toString());
rarity isn't null for either of the available items
line 62 of this code
that entire class is just for loading all the items specified in the config file into the correlating lists
Fishable.trashItems.get(ThreadLocalRandom.current().nextInt(0, Fishable.trashItems.size()+1)); also, this is asking for an IOOBE
whats that
IndexOutOfBoundsException (or in C speak, segfault)
but i make sure the list's size isn't zero beforehand
if it's not zero, it'll work
Lists are 0-indexed, that is that list.get(list.size()) is guaranteed to throw an IOOBE
Yes
Considering that this did not happen, the else statement was invoked, creating a fresh itemstack with no PDC (or you just had enormous luck)
but the max value isn't inclusive
You have a +1 there
ohhh
I am not very experienced with the new switch tables, but chances are you may need to add a break in there
nah the new ones dont need em
i found the problem
i didn't add at least 1 item for every possible rarity in my config, so i just got lucky and pulled a legendary
i am currently trying to make an npc and when i try to import import net.minecraft.server.level.ServerPlayer; it says it doesnt exist. The net.minecraft.server.level part exists but ONLY THE SERVERPLAYER PART DOESNT EXIST
you use mapping?
try EntityPlayer
ok 1 sec
and when i do new ServerPlayer i should do new EntityPlayer?
switch(thing) {
case thong -> stuff;
}
you mean those?
or do you mean
switch(thing) {
case thong && thong instanceof Integer myInt -> stuff;
}
```these
Both
*This is an upcoming JEP
uh sorta
any idea how to give an mob increased knock back
Lol, when doing event.setCancelled(false) you can breaks plugins lmao
depends on the definition of breakage but sure
I just realized
And that its not specified on the docs...
I thik its somth rlly importanrt....
depends on their events priority
is there any way i can change the drop from fishing event
manually throwing an item at a player is finnicky
Changing drop event
drop event?
there's .getCaught()
There you have all events
because it does not count as a break
it is entirely up to plugin developers themselves to resolve event handler execution order
its how protection plugins work lol
Im not talking about block break event
its from the api
thong!
I am talking about Cancellable::setCancelled
good golly
Where does cancell come from?
wym?
Is it from spigot?
referring to this
yes
lol
events that implement cancellable have the setCancelled method
I thought it was defined like closeable
I know that why you implement cancellable
what am i doing here lol
why should it be documented?
its an accountability plugin devs have to take into consideration verano
nothing that needs or should be documented
I mean you can break the bukkit api in 200 different ways
Bukkit::setServer being the most obvious one
They mut be documented in teory
Not document libraries != not correct documented library
Are calling me idiot?
nope
That why i love u <3
but people who intentionally break stuff and expect documentation or fixing
You have a completly different personality
ig lol
Also this is more poiting to discussion
yes tho I believe its not something that should be documented
if the implementation by itself can cause stuff to explode
Okay
then that must be documented
else, the api should only document the functionality of what its intent is
myeah sort of
I was having a nithmare
consumer-side to be nitpicky but ye
thought u fixed that ages ago
most people 
Its really annoying, me is a specially case because i have the language barricade
So something i dont follow the indifications because i dont understand it, not because im trolling
yeah altho your english has become significantly better since you joined tbf
Oh nice to hear that
I have something strange
!((contion1 && contidion2)) return;
They 2 are true, why not returning
Im annoyed
Why it's not work?
if(e.getPlayer().getInventory().getItemInMainHand() == new ItemStack(Material.AIR))
Lol
because of the ! (verano)
compare with equals
Also not recomend doing new iteam stack
That can be really laggy sometime
It has brackets
To negate the 2 inputs
🤔
Oh f** its not inside the first bracket
I just realized
lol ye
That why lmao
I was shiting the table
Because i get mad and just realized was that
this isnt an actual metod right
💀
But that doesn't work either:
if(e.getPlayer().getInventory().getItemInMainHand().equals(Material.AIR))
because getItemInHand is an itemstack
and ur comparing it to a material
yeah it is ☠️
you have to do getMaterial() on the getItemInMainHand
Who is doing me ghost pings
Really i ill need to install better discord to see who is strolling
Exactly... Thank you. It was a dumb question
That why javadocs exists!
What is an java
They are documentions about every classes, methods, arguments, etc
Maybe you need to take your schizophrenia pills
I just seen how a red number appear here but not tag message
The Bukkit Api is more suitable here, because in the usual docks there is nothing about the ItemStack
There exists javadocs for the spigot api as well tho :3
?jd-s
what is spigot
Java is the foundation for virtually every type of networked application and is the global standard for developing and delivering mobile applications, games, Web-based content, and enterprise software.
I said about this
That not the documentaions for spigot neither bukkit
Oh is just realized he is one of the trollers group
He is strolling
who
Him
whatever daddy wants, daddy gets...
Hey
Why ae yu tagging?
Do you think its funny
that was the latmi guy
Who?
Verano you really gotta stop these troll accusations
Really conclure check the logs
this is just some tik tok sound i cant get out of my head
Ignore them then
why dick you?
And you still call me a troll?
why dick he call you a troll?
whatever daddy wants, daddy gets
He was ghost pinging ass
I accidentally
You sure?
The logs can say it
Doesn’t look like a ghost ping
it def was not an accident lol
Checked the logs
you were purposfully doing that
logs don't show deleted messages if it's from the owner of the message
because you don't need a permission to delete your own messages
what are the kids doing lol
I admit that I pinged and deleted the post
What
We log all messages lol
I mean in audit log
But I just found it useless
yeah I forgot about that
And it was 1 time
yo how do i reset something AFTER a runnable
wdym?
one moment
I want to set count back to zero after the runnable is finshed
but rn im failing to do so
egad
well yea.. the runnable doesn't ever end
Why not use the sneak event
Nice java still hatting me
what even is NaN in java?
you die
Its pretty amazing, for some reason its applying to me the owner of the claim the flags
idk
i know about Double.NaN but i forgot its value
¯_(ツ)_/¯
ye
Allright
I mean there are many libs
which has volume framework classes
Conclure im an ifull idiot
I realized again, the flags is applied when breaking, hich i never updated that event
I dont kno why i get annoyed easly instead of thinking quiet
Celina talking to?
🥲
just random msg
They are all virgins that way
i remember like when i was active in here i got like 10 random fr's per day
then when i wasn't booster anymore it stopped, and now it starts again
I get them all the time
its normal when they see a girl they all want to dm her
a pic to see all the amount? if possible
i get them sometimes i when i accept i get stuff like free nitro 💀
most of em i delete instantly
Ah yeah
also it was on my other acc previously
Atleast i dont do it
@waxen plinth
im just curious
how can they tell if ur a girl or not if you dont have a female pfp 🧐
female php?
php
php yes
🖖
i'd never accept random dm's
most of them even come from people who never sent a message in here
Are you young?
LOL
what has my age to do with it? lmfao
Just curious
And sorry
lmfao that was funny
Is there any other way to check for custom inventories except checking the name???
What funny, never have say something wrong and them said sorry
By comparing the object
Are you young?
depends
Are you little? 🙂
on how you see it
Your own inventory holder
whatever daddy wants... daddy gets
i'd say 20 is still pretty young
Arent they deprecated no?
olivo real bro talking about inv holders
Whatever daddy wants, daddy gets.
daddy daddy
ur weird
i know
intellij is wrong
lemme see
As usual
you are right I don't. But I am popular regardless 🙂
but you're not female
I was doing, a * a and he was telling me to do: a * 2
you can be as popular as you want to be
tf
if youre not female, you'll never get the same amount of simp dm's
thats not true
because females don't like guys right?
coding simp dms 💪
we all simp for this man
boys with a female pfp 😎
just because the amount of virgin guys who send random dm's to girls is usually higher than the other side
and you base this on what exactly?
logic
probably her own experince lol
knowledge mainly
#general
on my personal dm's i got in my life
did you compare to a male?
ok this is getting weird
i've never got any simp dms 
i didn't, but i'm pretty sure you don't get about 10 simp dm's/fr's per day
wait nvm @quaint mantle
if you do, i apologize
Do you want me to spam your dms? I can do it if you can
but I do
do it and ill block you
aight, then i'm very sorry
Of course i will not do it if you dont want it
and i hope it gets better lol
I used to be Bukkit Dev staff. When I was one, it was even worse 😛
How you can be a staff member?
I applied and was accepted years ago
Are they till being done?
why aren't you staff anymore?
I left before the mass exodus of staff members during the great DMCA time
Evilseph isn't exactly the best to talk to even wolvereness
good ol times
sounds like that could've been me
they also would routinely make fun of people who made PR's and would reject PR's that were good but simply they didn't want to make the effort to implement or because they didn't think of it
very toxic people
Yes but it is what led to the downfall of Bukkit
Wolvereness did the DMCA because Evilseph forgot he couldn't make executive decisions anymore such as shutting the project down since he sold his rights to Mojang
Everyone that was employed by Mojang sold their rights to the project to them before being employed including evilseph
the only person who never had their rights bought was Wolvereness
o
Those dev's had rights over code they contributed
However, Dinnerbone and Evilseph had rights to the entire project
which both were bought by Mojang
Evilseph didn't last at Mojang and is the one that was supposed to help develop the Minecraft API
and it is probably because of him that it never happened and was let go
technically he resigned but they didn't give him a choice lol
But, he came back to Bukkit Dev as the project leader/Manager. He attempted to shut bukkit down using the excuse of the whole EULA thing forgetting he doesn't have those powers no more, since you know he sold the project
and yeah, that is when the DMCA happened and then the mass exodus of the staff members
i see... i think...
that honestly reminds me a bit of the rockstar modding situation with t2
lol
too dumb to make stuff themselves while earning millions per day, and then sending pi's to modders homes
gonna love it
they literally sent pi's to the homes of modders because of modding tools for singleplayer... thats so fucking dumb
if they mess with the multiplayer stuff okay, fine... but lmfao
the main reason Wolvereness DMCA'ed though is because he was left out in terms of being paid for their code. He even attempted to sell his rights and was rejected. He didn't know I guess that his peers who were hired were bought out before being employed to include evilseph. And I guess was left out of the loop on that.
and just retaliated XD
Fros tthat the story about plugins?
i mean, that makes a bit of sense at least
what do you mean?
who ping
the ghost
imajin
yo nah
@quaint mantle did you where the owner of purple server?
what?
Did you have mc server called purple network
no lol
Oh ok
are you referring to purpur ?
Hmn there is a server called purple or purpur
Im not sure
Or my time where i play it existed
ignPurple isn't even remotely close to the one that owns purpur
owo
-<

frost so evilpeh caused all the DMCA problems, with rights he have selled
in a way you probably could say that, but Wolvereness is the one that did the DMCA and basically acted like a child
In teory if you sell the rights, you cannot do anything because you are not anymore the owner
Wolvereness I think was the only dev who was part of the original group or one of the main devs that had been there a while that was never employed by Mojang.
nor even knew that his peers who were employed had their rights bought out
I was there for the conversation when he did learn that was the case
what means peers?
others that were like him. in this case the other main devs of Bukkit
the ones that left for Mojang
Also the story can be distributed? because most of time its confidentials information
AKA Dinnerbone, Grum, etc
I am not under any contract of any sort 🙂
uhh
Markus "Notch" Persson
yeah
he swedish
minecraft's main inspiration is probably ikea
i wonder what would've happened to mc by now if he would still be the "leader"
Also, minecraft when where planned
there was an older game similar to the original concept of Minecraft in where the idea came from
Minecraft just grew into its own thing after that
cave game
the old herobrine jumpy things scare me
I wonder what cave game is about
fuck I guessed wrong
you just dig and place
Why still using C++ for games when there is a thing called C#?
because c# is microsoft's bootleg java
C++ is more low level
C# is used. Typically most clients you see use C#
C++ is used typically for backend
Yeah
and JavaScript but who uses JavaScript
Me
assembly
ew