#help-development
1 messages Β· Page 338 of 1
Hello everyone,
This may be a stupid question...
But is it possible to call another class on onEnable()?
What I mean is;
If I split up all my onEnable code and put it into different classes, would it be possible to call said classes?
To execute the code within on onEable?
Learn about OOP - Splitting the code into reusable components(classes) is what java was designed for
hullo all, is it possible to get a head with custom textures? like get a head from a png of a skin or smth?
How do I get all entities in a world using ProtocolLib?
thats not what im asking
my thats not a good answer at all
I usually just use headbase and use Mojang's GameProfile class provided by Minecraft's auth dependency https://minecraft-heads.com/
My internet is to slow to find a thread rn but there are plenty on spigot about how to set custom head textures
On Minecraft-Heads.com you can find more than 30.000 custom heads, which can be used to decorate your world! The collection is seperated into two databases: the first contains custom heads, which never change their texture, using the Give-Codes from Minecraft 1.8+, the second one includes player heads which can be used in all Minecraft versions.
someone was too eager to shove a toxic answer into a programmer's face
this seems like it'd be super laggy? Do you mean all entities loaded? or what
Yes I meant all entities loaded, basically the Bukkit.getWorlds().get(0).getEntities() but in ProtocolLib
alr thx
I'm doing asynchronous threads and the getEntities does not support such a thing
you can't read chunks asynchronously? thats surprising
Not sure about the logic behind it but doing so gives me an error, lotta methods seem to not like asynchronous stuff
thats generally how spigot works unfortunatly.
can't write any data async in pretty much every case.
but as far as I was aware you can actually read most things, mind posting the error you were getting?
?paste
how do i compile this? like whats the maven command for linux
mvn package
do i do mvn install also?
only if you need to install the .jar to your local repo
yeah seems like that can't be run async
also like to point out protocolLib won't help you there
thats how the minecraft server works inherently
lmao
huh I would think that ProtocolLib would have a way to grab entities in a world but maybe not, probably just have to make a static variable that updates whenever entities are destroyed / created
protocollib is really just packets
i dont see why it would have a method to get all entities in the world
what are you doing
/ tyring to do
Well right now I'm doing an asynchronous thread that runs every 10ms to simulate a bullet moving through the minecraft world, (that way I can make so shooting far away will make you need to aim ahead of the player). If I synchronize it up to the main thread then it will result in less "accurate" aim ahead timings since the jump between needing to aim ahead and not will be 5x more abrupt
Anyway I need to get all the entities in the world since I need to know when the bullet hits an entity
That's not how that's supposed to be done. You should rather use ray/AABB intersection, which bukkit already provides an API for, IIRC. Looping all entities of a world would be way too inefficient.
raycasting is instant, I'm simulating a bullet through time
Do you simulate gravity on it?
yes
You could still use raycasting and calculate how much lower the bullet would hit at the distance of an intersection. This way, you're at least dramatically lowering the number of hit candidates.
I mean thats basically simulating the bullet which is what I'm already doing
I also can use the raycast every 10ms, though the API used will still loop through the entities once since it needs to know where they are
Sure, if you're only querying entities of chunks which are actually affected, you're fine.
yep, it'll also only be doing 14 raycasts max so shouldn't be too performance heavy
Hi , anyone know which method in nms that can convert strings to CompoundTag?
CompoundTag.load or sth like that
ah it's parseTag
@Override
public void deserializePdc(String serializedPdc, PersistentDataContainer target) throws Exception {
CompoundTag tag = TagParser.parseTag(serializedPdc);
((CraftPersistentDataContainer)target).putAll(tag);
}
``` for example
thanks
how is the flash particle colored in a firework
π
@tender shard Were you able to successfully add cirrus? I saw the git merge
public static Map<String, Class<?>> classes = new HashMap<>();
public static void registerClass(Class<?> clazz) {
classes.put(clazz.getName(), clazz);
}
public static Variable deserializeVariable(String str) {
if (str.startsWith("playerVariable{")) {
String replace = str.substring(15, str.length() - 1).replace("||", "@@");
String[] split = replace.split("@@");
Class clazz = classes.get(split[2]);
Player plr = Bukkit.getPlayer(split[0]);
if (!plr.isOnline() || clazz == null) return null;
return new Variable<>(split[1], Bukkit.getPlayer(split[0]), clazz.cast(split[3]));
}
return null;
}``` ik very goofy system but how would i make this work? Since i cant cast it to everything everytime
Hey guys, I'm trying to find a spigot plugin to revert sneaking mechanics back to pre-1.14+ mechanics. Specifically to prevent players from being able to fit in a 1.5 block tall area while sneaking
make each class that extends your serializable implementation require a method to create itself from a string
then handle it in each class
good idea
uh could I create a thread just need some help
?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!
?paste
I have this class called "DctrSpaceHelmCMD" which when a player does /spacehelm <player_name> it adds the spacehelm to their helm
well it sets it as the players helm while I want it just to add it to the players inventory how do I do so?
player.getInventory().addItem(itemstack)
the itemstack can be defined anywhere
I tried that but I got item as null
?paste the code
there is quite a bit wrong on that PlayerInteractMethod, and you are adding stuff to th method after you have already given the item
spacehelm isnt even the item you define stuff to
You have an event in that class but you're not even implementing Listener for that class.
oh so what do I do?
implements CommandExecutor, Listener or put them in seperate classes
You should also move player.getInventory().addItem(spacehelm); to after you set all the lore and other information for the item
oh
alrighty
I got this in the main file where the itemstack is defined as helmet
do I keep it as is?
that will still probably work if colors is a list/hashmap of materials
ig
andd uhh am I supposed to define spacehelm in each class?
public static ItemStack spacehelm;```
Use Dependency injection and make a public getter for it. You shouldn't really need static.
create a getter in main class then you can either set it that or just call the getter
with di
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
uhh
That's the best way to do it as it means you'll be sure you're always referencing the correct itemstack
?paste
did I do it right?
The item stack you're making in the main class
hm
?paste
any better or am I doing something wrong
again
your still adding a null item, not the spacehelm item
shit
set the meta after the item flag and add itemStack
like dis?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
spacehelm is nothing
you can remove it
at the item to the inventory AFTER you do anythign to the meta
oh
hi
how do i create a compass item with the needle pointing in a certain direction?
You can use the CompassMeta#setLodestone(location) to set the direction it points in.
Hi, i have a WeakHashMap on my main class and inside of it's saved only playerUUID and a string but when the GangJoinEvent is flagged the HashMap don't reply with the string but with nothing
Thats because your not putting anything inside the hashmap or printing it out
Your telling it to get but not put and also wheres the loop to cycle through the players?
Is there a way to change the default nbt tag of something like enchantments. I have put some nbt data in the enchantments nbt tag like this:
Enchantments:[{lvl:1s,id:"minecraft:sharpness",min:1,max:4,value:5}] just as an example. But spigot keeps removing this nbt data and the tag then look like this:
Enchantments:[{lvl:1s},id:"minecraft:sharpness"] all my custom nbt data is removed. Is there a way to prevent this from happening?
just use PDC instead
hi, do hashmaps in java store keys by value or reference?
Key and value
Yes but the system is already done and very complicated. I coded it in a datapack originally and now want to make it work on spigot. So no, I cant use PDC in this case.
you store the value by the key
i mean
reference
is the key a reference object or value?
map.get(key) returns value
Please, does someone know how to prevent spigot from deleting the nbt data?
String string = "string object";
HashMap<String, Integer> hashmapobject = HashMap<String, Integer>();
hashmapobject.put(string, 1);
do not use NBT but PDC
you can most likely convert the nbt on those items to pdc
is the code i posted above storing the string object's reference or storing "string object"?
okay.
na it works fine on vanilla servers
wait, so can it not match hashmapobject.get("string object");?
if it is a reference?
ofc you can do that
ok nvm, that problem aside for now.
private ItemStack createCompass (Material material, int count, String name, String... lore) {
final ItemStack item = new ItemStack(material, count);
final CompassMeta meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(Arrays.asList(lore));
item.setItemMeta(meta);
return item;
}```
it shows an error when i try to get the compass meta.
cast it
okay.
because getItemMeta() returns ItemMeta, not CompassMeta. You have to cast it
is it possible to make it so squids dont need to spawn on water from squid spawners? via api
nvm.
which out of these would you say is better, im guessing the top one
depends on what you are doing
which looks better from an end user perspective
oh you are asking about the looks not technicalities.
yeah
Most hosting providers actually give you a database to use.
with ItemStack, how to add a grey text just below it like on the screen ?
lore
and to make a space, just add an empty lore?
think so
any idea how to avoid this?
which?
the sentence that doesn't break
that has to be done manually
really ?
yeah
π
Hi, anyone can send an example how i can set a block direction in 1.12.2?
is it possible to make it so squids dont need to spawn on water from squid spawners? via api
Hello can somebody help? I got vehicles [The paid one with no resource pack] i got the chest but when i place it the vehicle despawn like i see armorstand but instantly despawns
guys, i wanna upload my resource, but i have update checker that works with resource id
how can i get it before resource upload to build it?
Upload > get id > update?
its too strange but ok
how do i make it so that the block will break if the user placed it. here is my code so far:
@EventHandler
public void onBlockPlace(PlayerInteractEvent event){
Player p = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
//code to break the block
}
}
check the players name and if its an instance of player then get the block id and break it
how do you get the block id
iirc get the location and use breakNaturally or something along those lines
they all require a storage?
Faster?
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
if (player.isOp()) {
return;
}
event.setCancelled(true);
final Block block = event.getBlock();
Material originalType = block.getType();
if (originalType != Material.STONE && originalType != Material.IRON_ORE && originalType != Material.DIAMOND_ORE && originalType != Material.EMERALD_ORE) {
player.sendMessage("You can't break these blocks!");
return;
}
event.setDropItems(false);
event.getPlayer().getInventory().addItem(new ItemStack(block.getType()));
block.setType(Material.BEDROCK);
Bukkit.getServer().getScheduler().runTaskLater(this.plugin, new Runnable() {
@Override
public void run() {
block.setType(originalType);
}
}, 20 * 5);
}
}```
Does any one know a fix to this? Idk why, but the world is split in 2 and half of the world works and other half dosnt.
Just install mariadb-server
hi
isn't mariadb a nosql database?
mariadb is a fork of mysql
You cant
No
nvm.
anyway, i have to register a lot of event handlers but they are all pretty much the same, is there a way to like do this easier than just creating a class for each and every one of em?
Spawn protection?
i'm not sure if it is the reason but check your server.properties for spawn protection, and set it to 0
k tq
and somebody tell me how the FUCK i can set block face in 1.12.2
yeah it is
Thanks
registerEventHandler((Event) EventType);
something like that?
its pretty much the same event handlers for all of em.
so
any idea on how i could do it?
Will it work like a mysql hosting?
public void Xanax(PlayerInteractEvent event) {
Player p = event.getPlayer();
Material Drug = Material.PUMPKIN_SEEDS;
if(cooldown.contains(p.getUniqueId())) {
return;
}
p.sendMessage(String.valueOf(event.getPlayer().getItemInHand()));
if(event.getPlayer().getItemInHand().getType().equals(Drug)) {
p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 7, 1));
p.playSound(p.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1f, 1f);
cooldown.add(p.getUniqueId());
new RemoveCooldown(p.getUniqueId()).runTaskLater(plugin, 100);
}
}
The event is not fired and event doesn't log nothing, i already did registred everything
if (originalType != Material.STONE && originalType != Material.IRON_ORE && originalType != Material.DIAMOND_ORE && originalType != Material.EMERALD_ORE) {
you have nothing set for dirt?
Because my server hosting doesnβt have a MySQL hosting
for (int i = 0; i <= slots.size(); i += 1) { for (String d : modifyfile.getConfigurationSection(e.getPlayer().getUniqueId() + "." + "Inventory" + ".").getKeys(false)) { if (modifyfile.getItemStack(e.getPlayer().getUniqueId() + "." + "Inventory" + "." + d) != null) { ItemStack item = modifyfile.getItemStack(e.getPlayer().getUniqueId() + "." + "Inventory" + "." + d); e.getInventory().setItem(slots.get(i), item); } } }} im trying to save a players inventory (custom) after a restart through a config file but its not working
you could say its like a portable chest
@EventHandler?
ah i didn't put that thanks
In java do i have a class for basicly every action i need it to make? like if i would want to make a block place event i would need to make a new class for it?
Also what does implementing event listener mean and why do i need it?
Example:
getServer().getPluginManager().registerEvents(new BlockBreak(this), this);
I dont rly know what it does or why i need it, but it just says i do. Can some one explain this
ok and for each event i do a different .java file with a different event
You register each class that implements a Listener. The Listener can contain multiple events.
what's a good structure for a random name + random skin database
for a disguise plugin of course
the Listener interface doesnt actually do anything
is there anyway to change the attribute of an offlineplayer only with username?
ah ok
If you want to know how events are called internally and why you have to register them (if I understood right), you probably want to Google about observer pattern
bummm
still looking for a good mysql host... any suggestions?
Set blockface for what to what on what? Maybe tell us a bit more of what you're doing.
There sure is, I just don't know what you mean by attribute.
player.getAttribute
Just specific players or all players on server?
specific one
is there a less expensive variant of rayTrace if you only want to check if all the blocks are air?
Take a look at this (https://minecraft.fandom.com/wiki/Player.dat_format#NBT_structure) page and expand the section "Tags common to all mobs". As you can see, there's an attributes list in the NBT of all entities. By using a NBT API (https://github.com/tr7zw/Item-NBT-API) you can easily load, modify and save the player-data file of your target-player.
An easier but less elegant route would be to just keep a list of attributes yourself, persist them somewhere, and apply them on join. But I'd much prefer the route of editing the NBT file.
Add custom NBT tags to Items/Tiles/Entities without NMS! - GitHub - tr7zw/Item-NBT-API: Add custom NBT tags to Items/Tiles/Entities without NMS!
<player>.dat files are used by servers to store the state of individual players. The format is also used within level.dat files to store the state of the singleplayer player, which overrides any <player>.dat files with the same name as the singleplayer player. These files are in NBT format.
just use sqlite and ship a database
thanks, i would use the list of attributes method but i just dont know to use a database
hmm i could eventually integrate my parser in a plugin
Then use the method for the NBT file, as it's not that complicated. I could show you an example of editing offline player inventories. If you're invested enough and actually want this to work, you can use it as an inspiration and get up and running with your attribute editor pretty quickly.
yes pls
https://paste.md-5.net/iguqigabey.java
Ignore the slot mappings, just focus on where I get the NBT from and how I modify it.
this will work for stuff like armor toughness etc?
Uhm, I'm not that familiar with attributes. But whatever attributes you can set using the API on Players, you can set there too, yes.
Of course you can, Spigot just seems to lack basic APIs again.
Try what you want to have working with the API first, and if it works, it'll work with the NBT file as well. I cannot guarantee that all attributes work on all entities, as Player#getAttribute is Nullable for a reason.
i can? what's the packet(s)?
i tried with packets and its possible π
i just did a mistake by sending packet on join
and looks like its sent by server a bit later
It's all about telling the underlying minecraft-server what distances of Chunk-Packets to generate and send to the player. If you're not generating some chunks, the client cannot render it. You can only limit their view-distance tho, you cannot get them to render chunks outside of their view-distance.
If you're stuck with editing the NBT file, I can try to quickly create an API for you.
I am interrupting view distance update packet, maybe i need to do something else too?
You are not returning a string. xd
(this is a joke. "nem" means "no" in hungarian)
i think i got it, thanks
How are you interrupting it, what do you change?
i listen for that packet and modify the view distance in it
using packetevents
Well, what did you set it to?
I think the main issue is just that you've thus changed the viewing distance on the server to two, but the client still expects packets there.
i also had to listen to client settings
Outgoing settings tho, right?
the one server receives
and the one server sends (update render distance)
but yea no ghost chunks now
what are you doing?
Ah, PacketPlayOutViewDistance and PacketPlayInSettings I guess?
Know why itemMeta.setDisplayName("Iron fragment"); shows a warning?
paper?
I guess the client redraws the chunk when it receives a new chunk packet, so you'd rather have to force the server to create a new one
hover on it and see what it says
cuz those paper men are a bunch of idiots
what im wondering is client removing chunks not within view distance on PacketPlayOutViewDistance
they have simple plugin manager deprecated for removal, yet its still used in code
π
how are they gonna load plugins then?
main craftbukkit class has like 500+ warnings
π
that is not the problem, the problem is backwards compability
Depricated
backwards compatibility goes brr, i understand them
use spigot api
ignore it
if you dont need any paper api, use spigot api yes
you dont need paper api
thats what you say
Yeah, but i can't cuz i need it to set the name of the item to that, but atm with this warning it dosnt set its name
and if you plan publishing on spigot you cant use paper api
warnings will compile
do you set the meta back to the item
I guess so, yes, because that means that the server decided that it's not going to render anything beyond that. But you'd just have to try that. Render normally and then, after like 2s, send that packet and constrain it to something crazy like 1.
item = new ItemStack(Material.IRON_NUGGET);
itemMeta = item.getItemMeta();
itemMeta.setDisplayName("Iron fragment");
}
item.setItemMeta(itemMeta);```
minimum is two but okay ill do that with different numbers
i set it after
do you use item afterwards
or before you set the meta
Yeah, right, I overlooked that. Just use two.
wait ill send full one
idk but its easy to do by hand
ItemStack item = new ItemStack(Material.AIR);;
ItemMeta itemMeta = item.getItemMeta();;;
if (originalType == Material.STONE) {
item = new ItemStack(Material.STONE_BUTTON);
itemMeta = item.getItemMeta();
itemMeta.setDisplayName("Stone fragment");
}
else if (originalType == Material.IRON_ORE){
item = new ItemStack(Material.IRON_NUGGET);
itemMeta = item.getItemMeta();
itemMeta.setDisplayName("Iron fragment");
}
item.setItemMeta(itemMeta);
event.getPlayer().getInventory().addItem(new ItemStack(item.getType()));```
there
;;; u good man?
you add a completely different item
dont mind that lol
addItem(item) not addItem(new ItemStack())
ah
it work π
pure joy and fun now time for painkiller
What now, do they stay or are they removed?
Lol, then I guess those few packets would be the fastest way to gain full control over render distance.
now i need a way to change tracking distance player has for certain entities
ideally packets/api no nms
Ok thx, works now. BTW is there an easier way to add color and not have to do ChatColor.<color> for each color change?
ChatColor.translateAlternateColors?
Use color sequences directly in your strings
ye youd easily end up with a chatcolor mess
also i wouldnt be shocked if it was deprecated in paper lmao
you WILL use components
no
agree
this is a non component zone
who doesnt use strings for messages
i love the minimessage format
like cmon man
looks terrible too
Hardcoding messages is stupid anyways. There should be a common syntax for defining these things in a config file.
hmm wondering what they mean with that Math.random() is not threadsafe
Math.random() makes use of a static instance, so it's the same for all threads.
i mean it uses an atomiclong so should be threadsafe no?
nah just fast and i was wondering what they dif between Random, SplittableRandom and ThreadLocalRandom was
decided to use splittable one as its faster
Yeah, that looks pretty safe to me
SecureRandom π«‘
dunno what that one does, iirc it doesnt use a seed?
or it changes it so the results arent predictable or smth?
It uses the secure random method of the OS I assume
i.e. /dev/srand
which polls it's data from mouse movements and other things
Hence it is advised to move your mouse when creating encryption keys
ahhh
I'd advise against Splittable random due to the fact that I haven't been aware that is exists until recently
i didnt know it existed either till pulsebeat sent me that
If it is truely safe to use in concurrent environments it comes at a drawback
im more using it cuz its faster
Either you have worse RNG or performance is worse
very unlikely
if its about the same as other random it doesnt really matter
as who is going to use 1000 rand() calls in my parser at once
Also, Random is thread-safe
long oldseed, nextseed;
AtomicLong seed = this.seed;
do {
oldseed = seed.get();
nextseed = (oldseed * multiplier + addend) & mask;
} while (!seed.compareAndSet(oldseed, nextseed));
return (int)(nextseed >>> (48 - bits));
That being said you may experience small to detrimental performance reductions in concurrent envs
ye just sent that code a bit higher ^^
ChatGPT is telling bullshit there
as most of the times
as always, lmao
Using AtomicLong in itself doesn't mean thread safety, but compareAndSet pretty much guarantees it
thats the only thing i remember, that cas tries to update smth till it succeeds
in conjunction with the while loop yes
Hey, I know there's gonna be a little bias here when I ask, but: Which one should I start with to develop plugins in the latests versions of minecraft? Spigot or bukkit?
probably spigot, it contains more stuff and still has all of the bukkit features
anyways
Bukkit is no longer published publicly
You need to use the spigot api
how could i compare getNearbyEntities with an entity type (trying to see if the nearby entities contains an entity of a certain type)
Unless you compile cb yourself that is
Does anyone know how to nullify the annotation processor path under maven?
Use the method that accepts a Predicate
could you explain this further, im quite new to java stuff
Collection<Entity> results = loc.getWorld().getNearbyEntities(loc, 1, 1, 1, e -> e.getType() == EntityType.COW);
if (results.size() > 0) { // A cow was in close proximity}
HOLY
ok
Cow.class::isInstance if you want it fancy
if it possible to use an entity type in .contains() comehow
wha
How would that be better?
Why am i getting this error? https://paste.md-5.net/ixiwebahov.cs
which is ChunksDatabase.java:73
Well, if it has type Cow, it's a Cow, innit?
?paste
alr thanks
database that uses a yml file π€
It's this line getChunksDataBase().set(".Claimed-Chunks." + chunk + "." + "location." + "x.", chunk.getX());;
But sure, do the instanceof, that should internally basically also only compare a hash or whatever.
naming on its best
But i does the same thing with every other line thats sets something
remove the . from the start
From the line 73?
getChunksDataBase().createSection("Claimed-Chunks");
saveChunksDataBase();
}```
On this too?
exactly what i thought
those are not paths
why are you creating sections tho
remove the . from the start of
I dit it but it gives me the same error
you would get a different error
There's not only no need for it, it's a badly malformed path.
Sure you compiled and replaced the jar properly?
yes
Re-send the error as well as the whole file containing the claimed-chunks paths so that I can make use of line-numbers.
org.bukkit.command.CommandException: Unhandled exception executing command 'chunk' in plugin ATHChun
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[patched_1.12.2.jar:git-
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patch
at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492)
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConne
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.1
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.IllegalArgumentException: Cannot set to an empty path
at org.apache.commons.lang.Validate.notEmpty(Validate.java:321) ~[patched_1.12.2.jar:git-Pap
at org.bukkit.configuration.MemorySection.set(MemorySection.java:168) ~[patched_1.12.2.jar:g```
at org.bukkit.configuration.MemorySection.set(MemorySection.java:202) ~[patched_1.12.2.jar:g
at me.gurwi.athchunkclaim.database.ChunksDatabase.claimChunk(ChunksDatabase.java:68) ~[?:?]
at me.gurwi.athchunkclaim.commands.ATHCCommand.onCommand(ATHCCommand.java:28) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-
... 15 more```
which is line 68 of ChunksDatabase
Can't you just send ChunksDatabase.java in it's entirety over a paste?
i doubt chunk is config serialize-able
?paste
That's not the error right now tho.
might cause issues later, as well as the insane amount of static
First of all, your line numbers are off, indicating that you're not running that code, secondly you need to stop putting leading dots in your path, xD.
still wondering why you are creating sections manually
"." + "location" π€
idk why you add a string of . then add the path then add another path if applicable
Oh, my god i just saw it, im so stupid. sorry for making you lose time on this, thaks
if were in this chat we either desperately need help or are wasting time we certainly dont have
so
its our fault honestly
This simple thing could massively improve your manual concatenation orgies, lol
btw why arent you just making a ConfigurationSection and writing that to disk
liek
ConfigurationSection coordSection = config.getConfigurationSection("Claimed-Chunks."+chunk+".location");
and then change that
does anyone know a plugin or script that would always drop a special item from one player?
like notch drop always apples
make one
Does anyone know how to nullify the annotation processor path under maven?
By default the AP path is the classpath, but I don't want to run APs.
I can't write scripts...
do u know java
a little
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
there should be a spigot tutorial for making a plugin
-.-
I can't tell if this makes sense or not for (ItemStack item : p.getInventory().getContents()){}
works
yeah
oh you probably want an if air or null contiue statement
Looks like supplying an empty list of APs to the maven-compiler-plugin should have the same effect as nullifying the path, did you try that? Just a wild guess.
or for (var item : p.getInventory()) {}
Yeah I do I just wanted to make sure that this will actually just loop through the inventory, and honestly why it does that because... what?
for (ItemStack stack : p.getInventory().getContents()) {
if (stack == null || stack.getType().isAir) continue;
// stuff
}```
other way around you noob
oh yeah
Isn't Skript supposed to be so easy that you can pick it up in like 5 minutes? All you need is the death event and then drop an item, that cannot be too hard, tbh.
Yeah but is it part of spigot API or something because a loop like that makes no sense in my head idk
those are java
what you loop over comes from spigot
one second
if i had a List<Object> and that had 5 strings or something in it
anyways, what you need to do after setting up a plugin that builds is to just do this in your one main class:
class mainClass extends JavaPlugin implements EventHandler {
@Override
public void onEnable(){
Bukkit.getEventHandler().registerEvent(this, this);
}
@EventHandler
public void onDeath(OnDeathEvent deathEvent){
Player p = deathEvent.getPlayer();
switch(p.getName()){
case "Notch": /*drop notch apple here*/ break;
case "Moterius": /*spawn primedTNT here*/ break;
}
}
}
or something very similar (im doing this from memory rn), and add each case for each name u want a specific drop for
whatever you call the variable is one of those
What doesn't make sense? The (item : iterable) {} syntax?
Oh right because getContents returns ItemStack[]
yeah
Thank you that's what I was looking for, brain broke for a sec
you can also loop over the inventory for some unknown reason
cuz its an Iterable<ItemStack>
well dont iteration loops work on both [] and <> ?
yeah
anything that is an array or Implement Iterable<?>
Yeah but that includes armor slots too, right? In this case I don't want to include those slots
does collection implement iterable?
yes
iirc it does but im not sure
i havent got a clue
or some super interface but it does
i think the armor is seperate but dont quote me on it
theres probs a method to get the inventory without armor
look at the jd
getStorageContents seems to do this
ah found it
Player::getInventory::getArmorContents gives an ItemStack[] with the armor
just do for(item i : inventory) if(armor.contains(i)) continue;
just check indices
index in plural? isnt that a thing?
uh idk
for (ItemStack item: p.getInventory().getStorageContents()) {
if (item == null || isItemVoid(item, key, p) || !item.getType().equals(m)) continue;```
Goes brrr I believe
You just cannot compare indices, as these don't correspond to the slots...
check for air too
isnt that if item!= null
uh im clearly not following the conversation
last part there
cries in future releases
Good correction, but equals is by default ==, so the compiler will inline that. No need to act like it's the end of the world, xD.
i hate u cant just do if a.equals(null) for a null check cuz if a is null it breaks
The last part of that if statement checks if the item doesn't match a specific material I am looking for, so air is covered there
I guess you're gonna have a pretty short life-expectancy then.
ill join you
Yeah, of course, because null has no member-method called equals, xD. Equals with null values only works when the parameter is null.
i know that but
i find it really irritating how i cant just do chained boolean checks with either == or .equals most of the time
but have to mix both
Enum::equals has an override that does the same as Object::equals π€
i dont think so
decompile bukkit and check lol
Yeah, optional access chaining in java would be really nice.
check stash
Hey, does anyone know why this SQL isn't returning any objects? All my variable names are correct. java List<Object> values = new ArrayList<>(); try { ResultSet rs = STMT.executeQuery("SELECT DISTINCT id FROM guilds"); for (int i = 0; i < rs.getFetchSize(); i++) { values.add(rs.getObject(i)); } } catch (SQLException e) { throw new RuntimeException(e); } return values; When running the sql stand alone in intelliJ, it returns all the values, but when trying to use it here, it gives me nothing.
is there stuff in the db π
also why not Integer
well they are uuid's
byte[] kek
So values.size() is zero?
thats what my uuids end up as
ByteBuffer
urgh dont remind me of bytes
CharBuffer better?
i have to wrangle a bunch of streams lately and they want to use streams instead of loops
Maybe show us your connection setup code
even thought the code would be so much smaller without em
Basically every modern developer which has been removed from underlying concepts, lol
π
I dont think its a connection issue, other sql functions like DELETE and SET work
Yeah, but are you sure you're connecting to the same database as the standalone intellij trial is?
the really stupid thing is that a new boolean[8] doesnt fill one byte of memory
it fills 8
cuz java is dumb and a boolean is 8 times the same bit
yes, other functions in my code that talk to my database work just fine.
That's why you bitpack booleans if you want to decrease size. Java isn't dumb, that's the definition of java's JVM.
e.g. this method works perfectly fine.. java public static float getFloat(@Nonnull final String NAME, @Nonnull final String ID, @Nonnull final String ID_VALUE, @Nonnull final int INDEX) { ResultSet rs = getRs(NAME, ID, ID_VALUE); try { if (rs.next()) { return rs.getFloat(INDEX); } throw new RuntimeException("No Next"); } catch (SQLException e) { throw new RuntimeException(e); } }
eh
i dont think java can allocate one bit
not like im using like 3 million values again this time
Yes, but are you sure you connect to the same endpoint both times?
im positive!
whats the different between @Nonull and @urban grotto
No language can, in fact.
not even c?
well you could do it with some bitmasks i guess
You always malloc in sizes of bytes. Bit-Packing has to be done by the user, not by the operating system.
wait stupid question
ye same in c++ iirc
honestly im surprised that we can malloc parts of memory addresses to different values
*variables i maen
mean
Lombok adds a null check with NonNull. Other than that it's probably just a name difference
Unsafe.putLong kek
How hard is the transition between plugin development and mod development?
It's gonna be really hard to debug your problem then. There's no reason it should behave like that. I just think that you're connecting to different endpoints, where an endpoint is defined by host, port, user, password and database. Maybe you're even on the same server (as I guess you're not having multiple running at this point), but in a different database than your plugin, which doesn't have the entries you're expecting yet. With this little information, it's gonna be impossible to help you, sorry.
Are you going from modding to plugins or plugins to modding?
depends on person
What's the difficulties of each one?
no need to elaborate actually
just say like a sentence
or two
mods and plugins dont play nice with each othe
also
mod dev is harder cuz u need to redownload and refractor a LOT for each minor versino change
dont need to do so for most plugins
Modding is harder and requires a better understanding of Java so switching to the Spigot API shouldn't be very hard
The other way around could be a bit of a challenge
all good, i'll keep debugging
Depends on how well you can read and understand others undocumented code
Modding stuff isn't documented?
You're working directly with Mojangs code
lmao
good luck reading your own code let alone someone elses
its just there to frustrate people
I thought at this point someone would just make a crude documentation at least
Which is decompiled and undocumented
sounds like fun
Basic things can be found online but generally you need to be able to read the decompiled code
can you somehow change per player entity tracking range?
You could try printing java.sql.Connection#getCatalog and check if that's the same in the intellij trial as well as on the server. That should print the database name. If that's the same, you at least know that.
probs by manually overwriting the ai
if its the setting tho
no
I'll stick to plugin then, sounds funnier
one advantage of plugins
whoever joins the server doesnt need to be told the plugin is running
mods dont give you that freedom
most of the time
most of the time
someone is rewriting the server in rust
i know that server side mods exist
Everything you can do with Spigot you can do with a mod
well im not arguing that
Wait, I'll need you to elaborate on this one
Pls, I've been loking for an anwser to this everywhere, HOW DO I MAKE A CHEST DOUBLE!
spigot is limited in scope
or at least send me an article, looks like a lie tbh
mods arent since they can change the game directly
one thing you cant do is subdivide biomesn into smaller than 4Β³ cubes
cuz the code is like 'bitshift to the left twice'
Literally, I've got 2 chests, I just need to make them connect!
place without holding shift
Uhm, are you talking about setting chest blocks next to each other programmatically?
<-- a very literal ass
what, no, I've got 2 locations toggether, i do the Location#getBlock()#setType
to make them chests
then how do I connect the chests
well
do u know how some blocks have directions like stairs
make sure the chests face in the same direction
then check F3 while looking at a double chest
probably needs state
should give you what to set both halves to to connect them
https://bukkit.org/threads/connecting-double-chests-1-13-1.475853/#post-3592948
Literally 2 mins of googling
Compiles on my machine Β―_(γ)_/Β―
how do you change the data of a player with UUID
it is the same π
Bukkit.getOfflinePlayer(UUID)
it doesnt have too many features
they need to be online to get all the player methods
That really weirds me out now, :-:
Is it still about modifying attributes of offline players? xD
yeah same, going to recode with diff approach
giving them an item
I literally sent you an example of how to do so
you cant give an offline player an item without modifiying their playerdata
idk how to add dependencies to maven
i tried by adding it in the pom.xml
you add the repo if applicable
but it just said cant find or smth
how do you do that
There's nothing wrong with your code, that's the thing. At least I didn't see anything obvious.
which
i know nothign about maven
what dependency are you trying to add
some api something
nbtapi?
yeah
That's it
use the api not the plugin
Yeah, whatever, lol, idc
You need to load the plugin anyways if you want to avoid having to shade something.
i remember seeing something like "THIS DEVELOPER HAS HACKED MY SERVER AND KEEPS ADDING THIS PLUGIN"
when one of their plugins used the nbt api plugin shaded
...
wha-
how do you reload maven
yes
open that
then at the top of that pane, on the left there is a reload button
looks like a circle
a really stupid thing to do would to include some nonsense in an api you wrote thats useful for people to use
like
well π
ohh i see
giving you op on doing a certain set of actions
so i dont have to add depend: [NBTApi] in plugin.yml?
if you remove the -plugin from the dep
if its included no you dont add that
but
keep in mind that including means that every plugin using the api needs to separately include it
ohk
as soon as ur using 2 or more plugins with that api its better for disk space to just depend on it and put the api into ur plugins folder
Wouldn't want to explain to a person new to maven how to shade, if adding a dependency is already a struggle.
maven thing is new cuz i just started with java 2 days ago
Well, you're starting out quite hard, huh? Trying to modify offline player data on day three is kinda rough.
thats bcuz i finished like 90% on day 2
90% of what
That does not work.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<target>1.8</target>
<source>1.8</source>
<proc>none</proc>
</configuration>
</plugin>
however does.
Oh wow, I completely missed that one. Great find! :)
Had to google for the error message that came from your approach (Compilation failure: Annotation processor '' not found) to get it
Is this possible to get current playing sounds on client?
How would I go about getting all applicable enchantments on an ItemStack?
like if it was a diamond_sword, it would return sharpness, unbreaking, etc. not power, punch, etc
@dry yacht
getEnchantments or getCustomEnchants on the item meta
@remote swallow
yo
file.save() doesnt work in nbt api?
context or code might help
public void setMaxHealth(OfflinePlayer player, double health) {
NBTFile file = new NBTFile(player, "playerdata");
NBTCompound compound = file.getCompound("");
compound.setDouble("Health", health);
file.save();
}
ive got no idea, i used nbt api like once
Wouldn't that return all enchantments on an item?
yeah
I want to get all the available enchantments that you can put on an item
lol
you know what I mean?
ahh that might work hold up
you could also use Enchantment.getItemTarget
woudl return https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/EnchantmentTarget.html
declaration: package: org.bukkit.enchantments, enum: EnchantmentTarget
Alright thanks
Why are you calling getCompound with an emtpy string?
Not sure what you mean, but anyways: no.
https://pastes.dev/h8xhOXoLtz
[dlhproxyplugin]: \config.yml plugins\dlhproxyplugin
[dlhproxyplugin]: \Created config.yml
[dlhproxyplugin]: \messages.yml plugins\dlhproxyplugin
[dlhproxyplugin]: Created messages.yml
- doesn't create the config files nor a folder
Uh, okay
what do i add there
Well, I mean... you should just clarify your question. I guess the sound triggers come as packets from the server, but you don't know how each sound sounds like, as you don't know if the client has been modified (soundpacks or what it's called)
Get "Health" directly from the file, not from that component you got with an empty string.
is it possible to use the libraries features(from plugin.yml) on multi module project?
public void setMaxHealth(OfflinePlayer player, double health) throws IOException {
File mainWorldFolder = Bukkit.getWorlds().get(0).getWorldFolder();
File dataFile = new File(mainWorldFolder, "playerdata");
NBTFile file = new NBTFile(dataFile);
NBTCompound compound = file.getCompound("Health");
compound.setDouble("Health", health);
file.save();
}
is this correct?
if only one is a plugin sure
otherwise there might be some issues]
I think you need to set "Health" on the file itself, as the variable is at root scope
uh
bump
I added JDA on root pom as provided then add libraries on plugin.yml there are 2 modules and both are spigot plugins
but getting this error
java.lang.LinkageError: loader constraint violation: loader 'plugin-1.0.jar' @42f7cd98 wants to load interface net.dv8tion.jda.api.JDA. A different interface with the same name was previously loaded by java.net.URLClassLoader @2ee5e89a. (net.dv8tion.jda.api.JDA is in unnamed module of loader java.net.URLClassLoader @2ee5e89a, parent loader java.net.URLClassLoader @45fe3ee3)
new File(mainWorldFolder, "Health")
file.setDouble("Health", health)
im guessing one is using it and stopping the other
is that the dataFile line?
You also need to get the UUID data file, currently you're passing a folder to the NBT-API.
copy how this looks loads files https://github.com/mfnalex/BungeeCommandAliases/blob/master/src/main/java/com/jeff_media/bungeecommandaliases/Main.java
That won't work since you need to get a specific players health and not just a health value in the root of the file. I don't recommend trying to modify the player data like that. You're better of changing the hp when they join or quit
why so complex
umm, I think so as the error. but how to fix this?
Make sure you didn't shade JDA
UUID holder = UUID.fromString("...");
File mainWorldFolder = Bukkit.getWorlds().get(0).getWorldFolder();
File playerDataFolder = new File(mainWorldFolder, "playerdata");
File targetData = new File(playerDataFolder, holder + ".dat");
NBTFile file = new NBTFile(targetData);
What's so complex about that? That's just how it works
uuid is the player's uuid?
Yes
makes much more sense
Playerdata files are always stored in conjunction with UUIDs
Bukkit.getOfflinePlayer("...").getUniqueId() You could use that to resolve the UUID if you only have a name available.
NBTFile file = new NBTFile(targetData);
it says Unhandled Exception: java.io.IOException
^^ That does a web lookup so make sure to do it async
hm
why is that not explained anywhere xD
i wonder why
Make it easier for yourself and set the hp on join or quit
how are we supposed to know if things need to be async
idk to use databases
oh wait nvm it is explained
No I didn't ._.
Probably because the file is not existing. Have a look into your actual world's datafolder and check.
I was looking at the from uuid one lmao
Was about to say
I skipped the string one since its deprecated haha
Do you have another plugin that has it shaded?
it doesnt say that while running the code. it just tells that when i hover over it
nope. I have only 2 plugins on my test server
You need to add a try-catch around that call
tysm i think all i needed to do was create the data folder
alr
@EventHandler
public void awdawd(PlayerInteractEvent e)
{
try {
Player p = e.getPlayer();
if(p.getItemInHand().getType() == Material.STICK)
{
if(e.getAction() == Action.RIGHT_CLICK_AIR)
{
ItemStack itemStack = new ItemStack(Material.AIR);
p.setItemInHand(itemStack);
}
}
}
catch (Exception exception){return;}
}
why this not working
;-;
Why are you using a try catch
Don't hide the errors 
Did you register it :>
What's the error lol
Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-
Yea I presume setting the interacted item to air breaks that
Cancel the event
Or run your logic a tick later
i did compile it but now it says
java.lang.NoClassDefFoundError: de/tr7zw/nbtapi/NBTFile
saw a plugin catching nullpointers and out of bounds in their command handler π
how can i cancel event
event.setCancelled ?
Changing the player's item-in-hand breaks the event? Wow, I never came across that issue, that sounds cursed
if i rightclick stick my server keep closing
what error?
Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
this error
Could you post the whole error in a paste again? Don't leave out any lines.
ah had that before but i forgot what the meaning was
Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-
5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
sorry righting
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
I can feel you struggling
i cant send the whole error
Encountered an unexpected exception
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1724) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1150) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:131) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1129) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1122) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1106) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1017) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3580-Spigot-e53686f-5901d58]
at java.lang.Thread.run(Thread.java:833) [?:?]
[02:29:09] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Woori\λ°ν νλ©΄\ν
μ€νΈ μλ²(feat. plugins,mods,commands)\.\crash-reports\crash-2023-01-30_02.29.09-server.txt
what is this
sorry....
Can you do me a quick favour to end your suffering? Just attach latest.log or what it's called as a file to this chat.
try set item in hand to null
I literally cannot get over how much of a struggle they have with posting an exception, haha
i cant send screenshot here
You can use air, I just tested it. It's some other weird niche condition
how can i send screenshot
Not verified? Upload screenshots here: https://prnt.sc/
Send through an online image upload
Hey, Im trying to integrate vault into my plugin. This is what I tried so far: https://paste.md-5.net/uweyizurum.java
but the RegisteredServiceProvider is always null, so then I tried the ServiceRegisterEvent: https://paste.md-5.net/vipubafeda.cs
but the event is never called, even though I made sure to register it in the onEnable() method. Can anybody help me?
That, plus it's always just an excerpt of the exception, slightly offset each time. It feels like having a stroke and loosing control over your mouse when selecting, hahahaha
hey there, i used Player#setSpectatorTarget on a player, but after a few moments, the mounted player just stuck in the air, and doesn't follow the target, and move keys are locked unless i press shift, (i tried to search anywhere else, but i couldn't find whats wrong), code (PlayerInteractEntityEvent):
Player clicked = (Player) target;
player.setGameMode(GameMode.SPECTATOR);
player.teleport(clicked);
PacketUtils.sendTitleAndSub("&eSpectating " + clicked.getName(), "&7Press shift to leave POV mode", 0, 35, 0, Collections.singleton(player));
Scheduler.runTaskLater(() -> player.setSpectatorTarget(clicked), 10);
i tried running it with different delays, 5, 10, 20ticks, doesn't help
any helps? thanks
Is there anything else above that or is that it?
its everything
anyone knows what's wrong? i am doing the exact thing that said in wiki, forums, ..
this is a function that used in several arena methods in order to broadcast same packet instance to large amount of players
chat, title, etc
that's the same thing, nothing happens, player stuck in the air
you removed the spectator target function, that just only does a single teleport
This is the error cause, not yet sure how that got triggered tho.
Actually, can you try setting the item in hand to null instead of AIR real quick?
uhhh, enough. ok... thank you for your help, have a good day/night
that Bird thing is my Util ( made from 3 parts: Common,Bungee,Paper/Spigot)
It has MiniMessage API attached
and Im using that Bird thingy in my other plugin ( Bungee )
but whenever I try to use MiniMessage, I get that error
I want to set block face to north, a block that player breaks
That still doesn't make much sense to me...
do you shade adventure
well on Bird thing, I have scope set to provided, since server runs on Paper
therefore it doesn't shade ig?
if you want to use minimessage anywhere else you need to shade it
"For what to what on what"
For respawning the block to what it was, ofc with correct facing, on BlockBreakEvent
oh well
thx
Minimessage is not found, not the bird thingy.
this is what I meant
this is Bird project - Common Module
.
I guess you're missing that dependency in your classpath
how shall I deal with Bungee and Spigot version of adventure tho?
dont rlly want to update 2 same presets of messages
You just want the exact same block? Why not just cancel the event?
I want to respawn it after a specified time
shade adventure
bungeecord requires VV - this version
Ive coded all of it, i just want the block face part
and spigot/paper without -bungeecord
Has been a long time since I worked with that, but does something simple like this not work for your usecase?
can I make a worldborder 32x16 big?
is there a way i can copy a entire world into a neww world?
Ive tried a lot of thinks, im not home rn can you write another example which its a little more clear? Ill test it when im back
What's not clear about that? It's literally dead simple. Block#getState returns a clone of the block's current state. Calling BlockState#update will update the state's corresponding block in the world back to the state it describes. This should also contain the block face.
Hi, I'm redoing a plugin that is no longer compatible with MariaDB. Except that my JAVA skills are reduced, can I get help to change the normal SQL connection that doesn't work with MariaDB by one that does?
I have a github with the source code if needed to help me better ^^
What's the compatibility issue? Any errors?
do you know how to make the enchantment look good without making the enchantment name visible on the item?
Yes, if you want I have the old logs of the plugin ^^ (I send this to you in PM)
Could you just send it in a paste?
?paste
You mean having the enchanted effect on the item icon without having the enchantment visible?
ok
If so, ItemMeta#addItemFlags, called with ItemFlag.HIDE_ENCHANTS.
only the visual is enough, without the effect or the name
Failed to initialize pool: Access denied for user 'u1_ALulDTBgXb'@'%' to database 's1_m01' What's up with that?
Yeah, then add the line of code I wrote about above. The ItemFlag
I have changed my password, etc. and I have no error message but the tables are not created
Could've said that beforehand, as the whole paste is useless then if you fixed these errors already, xD.
It works fine, is there any other way to just assign the visual without going through .addEnchant()?
Why do you think it's incompatible then? If it was, you'd get error messages.
Ah ok xD, well sorry
Not really, no. The client only renders the visual if the item is actually enchanted. So just use a dummy enchantment
Because normally the tables must be created and it is not the case ^^
oki thank you for the answers β€οΈ
You said the codebase is publicly available, right? Could you provide me with the URL?
Well, is ./proxy-plugin/src/main/java/com/andrei1058/bedwars/proxy/database/MySQL.java's init() method called? Add a sout
I didn't understand very well (I don't speak much English, sorry)
I meant that you could add a System.out.println("is called"); to the init method of MySQL.java to see if that bunch of CREATE TABLE IF NOT EXISTS is actually reached and executed. I think the issue is entirely with the plugin.
If MySQL worked before, MariaDB will work too. It's just a fork which is highly compatible. Something low level like table creation will always work.
That's what I said to the developer but he clearly told me the plugin is opensource and you have to do it yourself ^^
Yeah, what's the issue with doing so yourself? I can try compiling that in for you, if that helps.
I want to because I tested with the github workflow and it doesn't work at all. Java I always had difficulties it's incredible... Especially with the compilation
Nowadays buildsystems are a stupidly overcomplicated clusterfuck engineered by maniacs, so I get that. I'll give it a shot, maybe I can add that line for you.
ow right yea, it was not clear for me because i've tried a lot of thing about Directional and BlockState, for sure none of them worked for me, i just thought its one of them, thanks i'll try
Great, thanks for your help anyway!
if i do Bukkit.createMap how can i teleport someone into that map?
A map is an item?
You probably want to use the WorldCreator
no why
why does it have to be package private
theres no reason
for it to be package private
lets go guys reflection
ahaah