#help-development
1 messages · Page 915 of 1
:(
Also catching an NPE is very dirty
I was gonna be fancy and try something that might be null so it is faster but when the error happens its much slower i suppose
its so i can assign an offset to an armorstand
also cloning appears to be what is messing up the yaw, and the issue with this code is that Location newLocation = stand.getLocation() creates the new armorstand where the old armorstand is, not the new central location so i tried to fix this by doing Location newLocation = location.clone().add(offset.x, offset.y, offset.z); and the armorstands yaw is messed up again
Huh? What version are you on?
Then cloning should make no difference.
Because getLocation() from an Entity always returns a clone
for (Offset offset : offsetArmorStandHashMap.keySet()) {
ArmorStand stand = offsetArmorStandHashMap.get(offset);
Bukkit.broadcastMessage("Original: " + stand.getLocation().getDirection());
Location newLocation = stand.getLocation().add(offset.x, offset.y, offset.z);
Bukkit.broadcastMessage("Original with offset: " + newLocation.getDirection());
ArmorStand armorStand = (ArmorStand) location.getWorld().spawnEntity(newLocation, EntityType.ARMOR_STAND);
Bukkit.broadcastMessage("Applied: " + armorStand.getLocation().getDirection());
}
Give me the output of this pls
this doesnt use the central location though it uses the location of the original armorstand
so it isnt really what ill be using in practice if you still want me to test it?
Ok lets take a step back. Explain to me what you are trying to do.
i have a location called location which is the central location that all armorstands should spawn around with their offset being applied
i have an armorstand called stand which is the original armorstand that the new armorstand will have its yaw/data/equipment taken from
i have an armorstand called armorStand which is the new armorstand that is cloned with the offset applied
i basically want to clone a set of armorstands from 1 location to another, like schematics but for armorstands
Alright, first of all: Your Offset class is just a Vector which already exists in Spigot.
You should create new Classes for this:
pseudocode:
class ArmorStandStructure {
offsets: List<Vector>
piece: ArmorStand
}
Here is an example for such a structure class:
public class ArmorStandStructure {
private final List<Vector> offsets;
private final ArmorStand original;
public ArmorStandStructure(ArmorStand original) {
this.offsets = new ArrayList<>();
this.original = original;
}
public void addOffset(Vector offset) {
this.offsets.add(offset);
}
public void pasteAt(Location center) {
for (Vector offset : this.offsets) {
Location copyLocation = center.clone().add(offset);
copyLocation.setDirection(this.original.getLocation().getDirection());
ArmorStand copy = center.getWorld().spawn(copyLocation, ArmorStand.class);
// Optional: Copy the original armor stand's properties to the new armor stand.
copy.setHeadPose(this.original.getHeadPose());
copy.setBodyPose(this.original.getBodyPose());
copy.setLeftArmPose(this.original.getLeftArmPose());
copy.setRightArmPose(this.original.getRightArmPose());
copy.setLeftLegPose(this.original.getLeftLegPose());
copy.setRightLegPose(this.original.getRightLegPose());
copy.setBasePlate(this.original.hasBasePlate());
copy.setArms(this.original.hasArms());
copy.setGravity(this.original.hasGravity());
copy.setVisible(this.original.isVisible());
copy.setSmall(this.original.isSmall());
}
}
}
Usage would be something like
Player player = ...;
ArmorStand original = ...;
ArmorStandStructure structure = new ArmorStandStructure(original);
structure.addOffset(new Vector(1, 0, 0));
structure.addOffset(new Vector(0, 1, 0));
structure.addOffset(new Vector(0, 0, 1));
structure.pasteAt(player.getLocation());
Any nerds here know of a heavy obsfucator (not to use on spigot) that has a gradle plugin or some gradle support. Like it has string obf, and a load of stuff to make code flow irregular mayb even decomp crashing, oh and free
do use the spawn method that takes a consumer
so you modify it and then spawn
instead of spawn then modify
you probably won't get that for free
you could use ProGuard though
and as always it will be bypassed quite easily
well ive modified it a little
public void paste(Location center) {
for (Offset offset : offsetArmorStandHashMap.keySet()) {
ArmorStand stand = offsetArmorStandHashMap.get(offset);
Location copyLocation = center.clone().add(offset.x, offset.y, offset.z);
copyLocation.setDirection(stand.getLocation().getDirection());
ArmorStand armorStand = center.getWorld().spawn(copyLocation, ArmorStand.class);
armorStand.setGravity(stand.hasGravity());
armorStand.setInvisible(stand.isInvisible());
armorStand.setInvulnerable(stand.isInvulnerable());
armorStand.setHeadPose(stand.getHeadPose());
armorStand.setLeftArmPose(stand.getLeftArmPose());
armorStand.setRightArmPose(stand.getRightArmPose());
armorStand.setSmall(stand.isSmall());
armorStand.getEquipment().setHelmet(stand.getEquipment().getHelmet());
armorStand.getEquipment().setItemInMainHand(stand.getEquipment().getItemInMainHand());
armorStand.getEquipment().setItemInOffHand(stand.getEquipment().getItemInOffHand());
armorStand.getEquipment().setChestplate(stand.getEquipment().getChestplate());
armorStand.getEquipment().setLeggings(stand.getEquipment().getLeggings());
armorStand.setArms(stand.hasArms());
armorStand.setBasePlate(stand.hasBasePlate());
armorStand.setBodyPose(stand.getBodyPose());
armorStand.setLeftLegPose(stand.getLeftLegPose());
armorStand.setRightLegPose(stand.getRightLegPose());
Bukkit.broadcastMessage("x: " + armorStand.getLocation().getYaw());
Bukkit.broadcastMessage("y: " + stand.getLocation().getYaw());
}```
but the armorstands still arnt facing the same way as the original armorstands, but the debug messages are returning the same thing
Drop the hashmap, it adds no value. Delete your Offset class, its a bootleg copy of Vector without integrated support from the API, and probably also no equals or hashCode implementation which makes
it not suitable for usage as a key in a HashMap
Yeah im not worried about the bypassing, if they get there fair play, but i looked at proguard and it seems a bit soft for what im looking for
yo guys just a quick q
theres multiple armorstands though im not just cloning 1 so the example you sent wouldnt really work for that
does anyone know how it would be possible to make a void world with end structure
and with biomes
would it be possible
like this guy did it
Yes its possible
well then it's time to get a couple hundred $ and buy an obfuscator
Implement a ChunkGenerator which spawns structures and use this implementation in a WorldCreator
Do you know Java?
i managed to do this with a datapack but a datapack is experimental so
Add more overrides as you need```java
public class VoidGenerator extends ChunkGenerator {
@Override
public void generateSurface(WorldInfo info, Random random, int x, int z, ChunkData data) {
}
@Override
public boolean shouldGenerateNoise() {
return false;
}
@Override
public boolean shouldGenerateBedrock() {
return false;
}
@Override
public boolean shouldGenerateCaves() {
return false;
}
}```
it says it could stop working at anytime
Sad
i also need forge for chunk generator @lost matrix ?
Religion of sus obsfucator when
You are in the wrong channel. This is a development related channel.
i cant find them
there are the plugins of oneblock that respawns
i want one block thats just a grass block
but the problem is i need the end structure to spawn and i need biomes
?paste for me
?gui
what is the repo of multivgerse core?
i look it
but i dont found the repo
not the dipendency
It's literrally the first result
in the pom
repository in the pom
like this:
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
but of multiverse core
???I didn't see it
tnx
It actually redirects dayyum
int amountToSell = event.getItemStack().getAmount();
ItemStack item = new ItemStack(event.getItemStack().getType(), amountToSell);
HashMap<Integer, ItemStack> returned = player.getInventory().removeItem(item);
ItemStack itemCouldNotRemove = returned.get(0);
int amountCouldntRemove = itemCouldNotRemove.getAmount();```
You might want to remove event.getitemstack instead of item, but I'm not sure because you havent told your problem yet
I was wondering if this would correctly give me the amount of removed items from an inventory with the #removeItem method
I will do as you advised:
int amountToSell = event.getItemStack().getAmount();
ItemStack item = event.getItemStack();
HashMap<Integer, ItemStack> returned = player.getInventory().removeItem(item);
ItemStack itemCouldNotRemove = returned.get(0);
int amountCouldntRemove = itemCouldNotRemove.getAmount();```
The hash map contains what is left according to the docd
So to get the amount removed, amountToSell - amountCouldntRemove would work?
sometimes when i run mavens clean task and then try to run the package task maven does not include any resources(except for class files) to the resulting jar, am i too stupid to use it?
which then obv results in runtime errors
TIL that sound distance attenuation only works for mono tracks
If I add a custom sound to my resourcepack and I toss it in stereo it doesn't do the distance volume thing
yeah
random shit you'll never need #1: if you set row height to 50 in microsoft excel you will get perfectly rectangle cells
random shit you'll never need #2: excel ||\s||
until you need to manage your finances monkaW
finances in excel lol
then you use google sheets
How would I go about making something that has several inventories that can be opened and closed, but when the inventory is closed, it returns back to the previous inventory?
google suite sucks
doesnt even have list styles
At least it's free
never tried libre office
its great
its like msoffice
but like lighter
its not big chungus like ms office
it only takes 500mb
while office 3gb at least
and has like 99% features of it
although ui is not the same and you might need to get used to it
but you can fix that by turning on theme that's provided by default in the options that makes libreoffice have ribbon bar
the only reason i use google workspace is because i don't need to download software anywhere tbh
but most importantly, it fits my needs
i mean my uni is oriented around m$ so all the requirements of styling are very strict and around microsoft office suite and gl implementing them with google docs
sucks to be in your uni ig
wanna have a header with a number automatically apended when you create one
google docs nope, you need to click on list icon for each of it and apply it manually
because we havent added list styling for like 10 years of google docs existence
kinda embarrasing tbh
life would've been a better place if we started using markdown instead of ms word
same
with vscodium
i love it how it autoformats for you
and you dont have to bother to make it readable
worst part about college is when you gotta work with other people and they start using ms word
google docs 100% does have an option to number pages automatically lol
then you open a random file and the whole formatting breaks
not even gonna mention that markdown is literally copy pasteable
^^
not pages
It does
section headers
What about it
you can have a title for a section right
but you cannot make it automatically assign a number with it
in my uni rules every header should have a number attached to it like:
1.1 Foo
bla bla bla bla
you can have it in google docs
if you make it a numbered list you can do that
but applying it is pain the ass
yes but you cannot have it as a style
so that if you click on header style it would apply that list automatically like in ms word
yeah so, moral of the story, use the tool that fits your needs
?
list styles exist
in ms word and libreoffice
in which you can attach list style to a normal style
and it would apply that list automatically when you assign that style to a particular text
heeheehee talking about unneeded complexity
yes, but you cannot attach the list style to it (it doesnt apply list to you after you applied it)
blame my uni for this
it strictly rates your docs based on your skills in ms word
to format according to their rules
🙂
lol
its due to the fact we were taught to use advanced ms word things (columns, styles, sections, etc) since we were 12 in schools
and unis expect at least some kind of skills with it
blame my country for that
odd bug
i never paid much attention to it
wrote most of my papers in libreoffice
lets be just nerds and use LaTeX
its like programming language but for text
not writing in latex is a wild choice xD
typst is also decent
hey so when I go to load up my server it says my plugin doesn't work. this is the console error and I don't understand whats going on?
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.belak.test.Testing.getCommand(String)" is null at com.belak.test.Testing.onEnable(Testing.java:12) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:525) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:439) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:584) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:403) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:255) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:968) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at java.lang.Thread.run(Thread.java:1589) [?:?]
did you define your command in plugin.yml?
commmands
so I just fixed it and re did the file. its saying the same thing
wait i dont think i saved it
LOL
yeah its still saying the same thing :/
oh my
i had
3 M's
okay at this point im just spamming the chat. its saying the same thing still
nvm i got it
Is there a way of getting the players exp lvl?
like how it is exactly in minecraft
^ nvm
actually
the methods of getting them return weird stuff
does anyone else know a good method of geting the players xp
that is not (img 1 )
the return value you will never be what you execpt
for whatever god damn reason
I still have no clue what the fuck either of those methods return lol
even with the javadoc
I've got a method for you one second
player.getlevel();
it returns what it says on the xp bar in minecraft
but thanks for trying to help!
appricate it
I thought you wanted total experience points
you gotta make a util method for that one lol
nah the level
So using this I get the packet that I want, which is the Digging one, the problem is that I can't find the status(started mining, stopped)
@EventHandler
public void onPacketReceive(PacketReceiveEvent event) {
if (event.getPacket().getClass().getSimpleName().equalsIgnoreCase("PacketPlayInBlockDig")) {
StringBuilder message = new StringBuilder("Receive packet ")
.append(event.getPacket().getClass().getSimpleName()) //
.append(" from ");
if (event.getRemote().getPlayer() != null)
message.append(event.getRemote().getPlayer().getName());
else
message.append(event.getRemote().getAddress().toString());
this.getLogger().info(message.toString());
}
}
You need to write the class into the config if you want to do that.
Dont check packets by name. Use the packet type instead.
how much in bytes or KB is a block? Or how much, is one chunk in KB? When player joins the server, it has to request the server to load chunks, if they aren't already, and then it starts downloading them, but how much data does the player need to download or how much does its client downloads per chunk?
I think if there are less blocks in a chunk, chunk in total has less data so the faster is loading
I'm doing world (spawn) optimizations
This completely depends on the chunks content. Chests or other tile entities can inflate the size a lot.
Also chunks are sent in batches.
What are batches?
Also is there a formula or any online wiki for this? for blocks sizes in bytes or kilobytes
can you get the block size in bytes or any other.. from Block object?
Sure. But this is tremendously irrelevant information.
What do you need this for?
I'm doing heavy optimizations
And am also curious how much data does a client have to download lol
There is a 99% chance that you will hurt either the servers or the players performance.
The server already does a lot of optimizations in the back when it comes to chunk packets as they get compressed and
and sent in batches
Getting reliable values from this might take a week or two.
I would simply recommend you to listen for outgoing packets, look into their byte buffer and check the size of the packets directly.
Alright thanks!!
This sounds usable
This would directly allow you to limit the bandwith for each client if you really want to.
anyone happen to know if it's at all possible to change the trident model with a custom model in the resource pack without using optifine?
The actual in-world model? No
Its an entity, so you can only replace it with a single texture.
Worst case: Make it invisible and mount an offset item model on it.
ok, i ll keep it in mind
Idk if the trident can be invisible
Isnt it just a projectile entity?
For which protocol version?
Yeah
Only living entities can be invisible afaik
Minecraft 1.18.2 Protocol 758
Myeah no idea then. In newer versions this is handled by the player action packet.
Gosh, then its time for some hacking i guess?
Listening to the ProjectileLauncheEvent, replace the projectile with a snowball, give the snowball your custom model
Not sure how the alignment will look like
Won’t work well if you want to use it with loyalty
Next step is break into mojangs studio and fix their code, then force push on main and release
Hm, might be wonky when the client tries to interpolate the movement for loyalty etc
I tried this:
Field digTypeField = event.getPacket().getClass().getDeclaredField("c");
digTypeField.setAccessible(true);
event.getRemote().getPlayer().sendMessage(String.valueOf(digTypeField));
I got this:
private final net.minecraft.network.protocol.game.PacketPlayInBlockDig$EnumPlayerDigType net.minecraft.network.protocol.game.PacketPlayInBlockDig.c
private final net.minecraft.network.protocol.game.PacketPlayInBlockDig$EnumPlayerDigType net.minecraft.network.protocol.game.PacketPlayInBlockDig.c
What does it mean "Proxy lost connection to the server" using bungeecord newest version coding my own limbo
No keepalive from server
ProtocolLib should have a wrapper for that
After JoinGamePacket i should send KeepAlive to client?
Presumably the proxy has its own keepalive system
I know, actually I ve made a working version of it using ProtocolLib but I prefer to use nms
Then dont use reflections
Yea but what does this error means?
I send normally JoinGame its loading for few seconds
and then this error
Meaning the proxy hasnt received anything back from the server in a while
Then what should i send
After i change codec stated to PLAY?
I figured it out
just to connect player
I wonder if the proxy sends serverbound keepalives to the backend server to check if it’s alive
I just want to connect player
This works fine
Reflections are slow af. I would highly recommend you to not use them.
Everything is fine, i change state to GAME, send JoinGamePacket but then its Loading Terrain.... and "Proxy lost connection..."
The client needs some information on how the world looks like and where he is about to spawn
Do you know what is needed 100% just to connect?
Nothing else just connect
I would have to dig for that
What version
public class NPCManager {
static Map<UUID, EntityPlayer> npcMap = new HashMap<UUID, EntityPlayer>();
public static void Spawn(Player player) {
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), player.getName());
WorldServer worldServer = ((CraftWorld) player.getWorld()).getHandle();
EntityPlayer npc = new EntityPlayer(MinecraftServer.getServer(), worldServer, gameProfile, new PlayerInteractManager(worldServer));
Location loc = player.getLocation();
npc.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
npc.setCustomNameVisible(true);
npc.setCustomName(player.getDisplayName());
npc.setInvulnerable(false);
// Ajouter le NPC au monde
worldServer.addEntity(npc);
npcMap.put(player.getUniqueId(), npc);
}
public static void unSpawn(Player player) {
EntityPlayer npc = npcMap.get(player.getUniqueId());
if(npc != null) {
npc.getWorld().removeEntity(npc);
}
}
}```
Hey, why i got this error ??
[01:31:14 ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: null
at net.minecraft.server.v1_9_R2.EntityTrackerEntry.broadcastIncludingSelf(EntityTrackerEntry.java:327) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.EntityTrackerEntry.d(EntityTrackerEntry.java:292) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.EntityTrackerEntry.track(EntityTrackerEntry.java:218) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.EntityTracker.updatePlayers(EntityTracker.java:178) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.MinecraftServer.D(MinecraftServer.java:874) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.DedicatedServer.D(DedicatedServer.java:403) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.MinecraftServer.C(MinecraftServer.java:723) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:622) [patched_1.9.4.jar:git-Paper-775]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_392]
[01:31:14 ERROR]: This crash report has been saved to: /home/GameServer/lobby_01/./crash-reports/crash-2024-03-02_01.31.14-server.txt
If it’s latest you also need to handle the configuration phase
i'm in 1.9.4
1.17.1
can someone help me please
player is probably null
nop
It’s trying to send a packet to everyone nearby the NPC and the NPC itself
The NPC’s connection is probably null
i just want to create a NPC clone of player
Bdw there was lack of position packet
anyone know if it's possible to make custom armor models using optifine resource packs?
not just modifying the skin but actually changing geometry
to a custom model
With optifine? Probably
Well bungeecord amaze me
I send simple KeepAlivePacket when player is connecting to limbo
overflow in packet detected! VarInt too big (max 5)
I receive this
i copied packet protocol from bungeecord source
Pretty sure it should be a long
I am using TabCompleter for commands but the behavior makes no sense, if i return Collections.emptyList() for no completions it sometimes still lists players names while other times it properly does not display any
I can't figure out the behavior behind it
That’s the weird thing the behavior is not consistent
Sometimes it works sometimes it does not
public List<String> getCompletions(CommandSender sender, String input, String[] args) {
if(!sender.hasPermission(Permissions.adminSettingsAccess)) {
return Collections.emptyList();
}
if(args.length == 1) {
return null;
}
if(args.length == 2) {
return UserSettingManager.getSettingsNames().stream()
.filter(word -> word.toLowerCase().startsWith(args[0].toLowerCase()))
.collect(Collectors.toList());
}
if(args.length == 3) {
return Arrays.asList("true", "false").stream()
.filter(word -> word.toLowerCase().startsWith(args[1].toLowerCase()))
.collect(Collectors.toList());
}
return Collections.emptyList();
}```
That is my code
but tab completing does this
How do I get all yaml configs inside of a folder?
get all files in a folder and filter by .yaml
or you could get all files and put them through a yaml parser to see if its valid YAML
I dont remember exactly but I think there is a setting somewhere to suggest playernames when there are no other suggestions
😦
I don't recognize getCompletions(). Are you using some framework? Is it your own? If so, it's very likely you're passing in a single-lengthed args parameter. It's the only thing I can think of causing this to fail
Also,
if (args.length == 2) {
return StringUtil.copyPartialMatches(args[1], UserSettingManager.getSettingsNames(), new ArrayList<>());
}
if (args.length == 3) {
return StringUtil.copyPartialMatches(args[2], List.of("true", "false"), new ArrayList<>());
}
Simplifies your two streams there a bit
Just made it to simply the parameters a bit lol
public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
return getCompletions(sender, args[0], args);
}```
That works perfectly!
Not too sure how it is different besides simplicity but it works
Guys I need help with plugin development.
I can't figure out how to get the block facing (relative to the world not to another block) and how to get all that information by finding the block through coordinates.
I need to get the block name in a usable format (preferably string) and if that block is a observer I need to get the block facing relative to the world
It would be nice if I could make a function that takes the block as input and returns the name of the block and if that block is an observer, returns the OBSERVER - [ORIENTATION] as a string
I've been trying to do this for 3 days, the spigot javadocs aren't helping. I've read through them several times and I can not figure this out.
Any and all help would be insanely appreciated
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/material/Directional.html
If the block is a directional it's BlockData will extend Directional, so just get block data and cast it to that
declaration: package: org.bukkit.material, interface: Directional
through the Block class you can do getType to get the material and use getDisplayName() to get it's name
I'd really recommend hunting through the forums and using google, saves you heaps of time
why i keep getting this error
for scoreboard
im trying to make scoreboard.yml file for changing lines and stuff
but i keep getting error
everytime i start the server
I dont think you defined your main class in your plugin.yml correctly
nvm that
Map<Integer, String> scores = new TreeMap<>(Collections.reverseOrder());
for(int i = 13; i > -1; i--) {
scores.put(i, manager.getLine(i));
}``` is this smart? i feel smart
lol
quick question
would i need to do something so i can use placeholder api? i use skript and i want to be able to put variables there, there is an addon for it that lets you create placeholders like %data_kills% will be for example {data::kills::%player%}
i found out i couldve just world.getBlockAt(x, y, z).getBlockData().getAsString()
And if its an observer it literally says its orientation in the string as facing=east for example
I have been searching for something like this for a week and a half...
You want to code your plugin relying on strings ???
Actually it is insanely easier
Javas class hyperabstraction bullshit only makes things considerably harder to mentally parse
this way i can literally just
blockString.contains("east");
and i have the logic i need

As opposed to blockData.getFacing() == BlockFace.EAST ?
yeah well unfortunately that doesnt work

getBlockData() doesnt give anything that can give the facing
it only allows for block to block relative facing
java stuff that i am severely underequiped to understand
i am aware i read the javadocs
they are incomprehensible so i gave up after a week
if instanceOf checking is over your paygrade in java you should go back to learning java
i simply do not yet have the java knowledge to deal with all that
oh i am very much aware that i have no clue what im doing
but the only thing i enjoy about java is the occasional C type syntax for basic stuff like logic loops and variables so ill figure it all out
I'm not doing something too complex anyways
I'll definitely post the results here though, once im finished.

i do not understand how to do that in java yet so i will make it harder for myself to learn that
for anyone that reads it, pls don't base your shit off of strings.
if (world.getBlockData(x, y, z) instanceof final Directional directionalBlockData) {
final BlockFace facingDirection = directionalBlockData.getFacing();
}
is the way safer alternative
why whenever i add a command to my code plugin breaks
private DataManager dataManager = ZyptrikBoard.getInstance().getDataManager();
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
File boardFile = dataManager.getBoardFile();
if(!(boardFile.exists())) {
FileConfiguration config = dataManager.getBoardConfig();
try {
config.save(boardFile);
} catch (IOException ex) {
ex.printStackTrace();
}
}
sender.sendMessage(Utils.color("&aReloaded the config file. (scoreboard.yml)"));
return true;``` code
its registered in the main class and plugin.yml
what does "plugins breaks" mean in this regard?

i put wrong name in the main class
btw?
[10:50:34 WARN]: Unexpected exception while parsing console command "reloadscoreboard"
org.bukkit.command.CommandException: Unhandled exception executing command 'reloadscoreboard' in plugin ZyptrikBoard v1.0-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:999) ~[paper-1.20.4.jar:git-Paper-430]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchServerCommand(CraftServer.java:984) ~[paper-1.20.4.jar:git-Paper-430]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:501) ~[paper-1.20.4.jar:git-Paper-430]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:448) ~[paper-1.20.4.jar:git-Paper-430]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1515) ~[paper-1.20.4.jar:git-Paper-430]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1216) ~[paper-1.20.4.jar:git-Paper-430]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-430]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "me.hothifa.zyptrikboard.managers.DataManager.getBoardFile()" because "this.dataManager" is null
at me.hothifa.zyptrikboard.commands.ReloadCmd.onCommand(ReloadCmd.java:22) ~[ZyptrikBoard-1.0-SNAPSHOT.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
... 9 more```
now i get this
when i do the cmd
your data manager is null
ZyptrikBoard.getInstance().getDataManager(); returns null at the point of instance creation
ok wtf
its not
...
private DataManager dataManager;
...
public DataManager getDataManager() {
return dataManager;
}```
?paste the whole class
do you ever create a new instance?
no the main class
you arent ever setting data manager
lol
wrong word, you mean inexperienced
that too
uh wtf
last question
i made a command to reload the plugin and create the scoreboard.yml file, but when i do it and it creates the scoreboard.yml is empty
its not in the code
paper?
dont quit, you will be experienced in no time if you stay with it
yea but idk where to learn
like
there is a new youtube tutorial but it doesn't show the things like plugins
i need to pay for that
and all other tutorials are quite outdated or people stopped them after few parts
I learned by just doing what i want to do and when there where problems i asked here and googled before
i check source codes of plugins
i checked simple score's
i thought i would see like tons of classes
there was just like 4 packages and few classes
I'd recommend jsut start doing something you like and when there are problems ask here or google
is the website working for you guys?
yes
idk what to do lol
Do a ecpnomy plugin
recreate hypixel
wtf
im not really interested in it tbh xD
Then you know what you want, right?
If you know what you dont wnat you should knoe what you want
Easy
i've been thinking on what to do for a week
ok
good idea
i'll make like config.yml with list of words
because i suck making custom configs xD
combine nocheatplus grim vulcan in one anticheat
like wordsyml
No, use regex
uh what
Savinf every Single word will kill Performance
i decided to learn what regex is then forgot to :)
Ok
Yes you can use it to not lose your mind when filtering words
is this right website to learn it
won't i have to like regex every bad word in the planet
i mean
You can
i found this on first search
I'd allow those words
can you fake the biome where the player is just to change the sky appearance?
is there an event to find out that the player has opened his inventory?
i don't think so
You can
Tjere is the achivement of openinh it for the first time
Judt reset it every time
i don't think that is correct solution
Okay but there is no other one
Because its Client side
This is the only server side notice
Either this or nothing
There’s literally InventoryOpenEvent
Okay but player inv is client side
IOE does not fire for the player's own inventory, it is client side
You can call get inventory on the event and check if the inventory is instanceof PlayerInventory
which will always be true unless they have something else open
as far as the server is concerned, unless something else on screen, the player always has its inventory opened
because the client simply does not send any open screen packet for their own inv
this no longer exists
Oh
I would like to know if anyone has any template, information, ideas, etc. on the topic of creating an error handler from configs
preferably via annotations
like lombok
or in runtime
What does an error handler do for you and why does it need to be loaded from configs?
Well, check the resulting value from the config and log their error, displaying the user so that he understands where he made a mistake.
So you want to check for wrongly populated configs and tell the user what he did wrong?
Runtime annotations will require reflections.
What do you want the annotations to do?
Hi, i got a problem, when i use my command everything works fine. But when it gets to the run task timer asynchronously it breaks, here is my code: https://paste.md-5.net/pecaqofaxo.java, here is my error: https://paste.md-5.net/oxuxesulih.sql
Dont run the task async
You cant use anything in the api async
generated the same verification code as in Lombok during compilation
How can i run a task every minute then ?
This would require you to write an entire annotation processor, which is incredibly complicated.
theres a non async version
I understand it. It would be like an addition
Yeah, but i want it to do it infinitly every minute, i don't want to copy paste it over and over
Yes, runTaskTimer does what you want
that's uh
not necessarily the case
No
but a decent rule of thumb
Yes
you are doing runTaskTimerAsynchronously, just do runTaskTimer
Stop nitpicking. Its safer if they take this for bare coin for the moment.
ok
I've got no context I just came here and saw that 😛

so any ideas or anything similar
How much experience do you have with bytecode generation?
I tryed but i doesn't do it infinitly
wdym
In short, async context when interacting with the bukkit api has like 3 safety levels:
- Should be fine (when it's just sending a packet. Think particle effects or sendBlockChange or something)
- Eh not a good idea (varies by case. You can change inventory contents async but you can't open or close an inventory async)
- no. (Bukkit will often stop you. This is your typical world / entity manipulation)
:)
serilization
Why are you doing this? , 15*20L, Integer.MAX_VALUE);
wdym?
where Integer.MAX_VALUE is, is how long it takes to repeat
Integer.MAX_VALUE is a really large number so its going to repeat like never
for example
.runTaskTimer(0, 15*20L) would repeat every 15 seconds
Writing an annotation processor requires you to hook into the compiler and generate jvm bytecode during compilation.
If you have no experience with compiler architecture and bytecode generation, then there is an exactly 0% chance of you
writing that.
I would highly recommend simply writing a bunch of code that checks for malformed values in configs.
This could be done with reflections and annotations, or with some classic code.
Yeah my bad i'm just stupid
the first value (where i've put 0) is how long it would take to start
so if you want to add a delay for it to start, you can change where i've put 0 to however long you want
what method would i have to use to check if a task has finished, with a Scheduler#runTask() task that is
would isCancelled() simply return true when its done
public static void setBlockInNativeChunk(World world, int x, int y, int z, int blockId, byte data) {
net.minecraft.server.v1_12_R1.World nmsWorld = ((CraftWorld) world).getHandle();
net.minecraft.server.v1_12_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
BlockPosition bp = new BlockPosition(x, y, z);
IBlockData ibd = net.minecraft.server.v1_12_R1.Block.getByCombinedId(blockId + (data << 12));
nmsChunk.a(bp, ibd);
}``` why doesn't this method change the blocks type and data 1.12.2
I'm making a colormatch mini game and the original settype is too slow
hi , uhh anyone good with math and if checks?
i sure hope any programmer is good with if checks
iam making a menu for levels , so user have that level or higher , it should be unlocked , if user don't have that level yet in the db , it will be locked . and the material will be changed to dpend on that
anyidea , what is the best way to make a check to see if user claimed the reward or no?
UUID , int level , opned boolean?
map of <UUID, Boolean> should work
and check if that level is opned? if so , set lore to opned ,if not set it to ready to be claimed
they are diffrent levels
The player should have some general data object. Simply give him a Set<Integer> to check which levels he has claimed already.
can i do a new table , with the levels user unlocked , claimed?
uuid , int , boolean?
or is it bad?
Sure you can do that. But as soon as the player joins the server you should load pretty much all his data
yeahh
You can, or just use an array in your existing users database table
Hello, I am trying to add custom NBT data to my item so that I can identifiy it in the PlayerInteractEvent but it's not working for some reason.
Here's the code for applying the tag: https://paste.md-5.net/vuzosedoso.java
Here's the code for PlayerInteractEvent: https://paste.md-5.net/petajakeva.java
?pdc
I am on 1.8.8
?1.8
Too old! (Click the link to get the exact time)
it creates a copy
Oohh
Anyone know if there is an easier way to convert from spigot EntityType to an nms EntityType than just doing a switch?
id
they should both have one
Thanks so much Shadow :D
np. There probably are some libs already for older minecraft versions
ye
it doesn't look like theres an easy way to do from string, like a valueOf
I didn't mean Enum#ordinal
Use this key in the nms registry
NamespacedKey key = Registry.ENTITY_TYPE.getKey(EntityType.ALLAY);
tis
It's pretty easy doing it without a library so I didn't bother using one, thanks so much for the tip tho :D
yeah i tried that, but because it's an optional its real weird
i'll try what 7smile7 said
it's really simple
it returns the optional of an exisiting value if it exists
and an empty optional is it didn't find it
What about CraftEntityType#bukkitToMinecraft()?
yeah i ran .get() on it and there wasn't a value
so basically an alternative of returning a null
Optional#isPresent
When I will right click on a Block that doesnt works?
Code: https://pastes.dev/j40Q9Yz3PD
We have a fun method for this: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#openBook(org.bukkit.inventory.ItemStack)
Create yourself a WRITTEN_BOOK ItemStack with all the necessary BookMeta
Pass it to that method
No idea what thats supposed to mean
I am trying to create a dummy entity class that has no pathfinding goals, but I'm getting an error when trying to create one:
dev.yada.spawners.entities.DummyEntity cannot be cast to class net.minecraft.world.entity.monster.EntitySkeleton
public class DummyEntity extends Monster {
public DummyEntity(Level world, EntityType entityType){
super(EntityType.SKELETON, world);
this.setBaby(false);
this.setCanPickUpLoot(false);
}
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0f));
}
}
If the EntityType is Skeleton, then you need to extend EntitySkeleton
This didn't happen when I had a class extending a specific monster, like extends Zombie, but I wanted to get around creating a dummy class for every kind of monster I want
is there not any way around it?
Okay... so... ehm... we made changes to CraftBukkit that enforce types in the hierarchy
You can get around this hackily if you really want to, but I would just opt to make classes for the types you need
is there a way I could get the class type i want through an EntityType enum?
like for example i have a method that inputs ZOMBIE and then i get DummyZombie as a generic or something
Not really, no. What's your goal here?
Dummy entity, obviously, but what's the end goal?
If I click in the air that will work but if I click a block than it will switch 2 times the Item
Creating a spawner plugin that spawns mobs which have no ai, but can still move around (get pushed, hit, etc)
which is why im using nms as opposed to using #setAI
There is an EntityTargetEvent if you wanted to cancel that instead if they're spawner entities
public static void setBlockInNativeChunk(World world, int x, int y, int z, int blockId, byte data) {
net.minecraft.server.v1_12_R1.World nmsWorld = ((CraftWorld) world).getHandle();
net.minecraft.server.v1_12_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
BlockPosition bp = new BlockPosition(x, y, z);
IBlockData ibd = net.minecraft.server.v1_12_R1.Block.getByCombinedId(blockId + (data << 12));
nmsChunk.a(bp, ibd);
modified.put(new BlockPosition(x, y, z), CraftMagicNumbers.getBlock(Material.WOOL).getBlockData());
}
public static void update(Player player) {
HashSet<net.minecraft.server.v1_12_R1.Chunk> chunks = new HashSet<>();
for (Map.Entry<BlockPosition, IBlockData> entry : modified.entrySet()) {
net.minecraft.server.v1_12_R1.Chunk chunk = ((CraftWorld) player.getWorld()).getHandle().getChunkProvider().getChunkAt(entry.getKey().getX() >> 4, entry.getKey().getZ() >> 4);
chunks.add(chunk);
chunk.a(entry.getKey(), entry.getValue());
}
for (Chunk chunk : chunks) {
PacketPlayOutUnloadChunk unload = new PacketPlayOutUnloadChunk(chunk.locX, chunk.locZ);
PacketPlayOutMapChunk load = new PacketPlayOutMapChunk(chunk, 65535);
EntityPlayer ep = ((CraftPlayer) player).getHandle();
int dist = Bukkit.getViewDistance() + 1;
int chunkX = ep.getChunkCoordinates().getX();
int chunkZ = ep.getChunkCoordinates().getZ();
if (chunk.locX < chunkX - dist ||
chunk.locX > chunkX + dist ||
chunk.locZ < chunkZ - dist ||
chunk.locZ > chunkZ + dist) continue;
ep.playerConnection.sendPacket(unload);
ep.playerConnection.sendPacket(load);
}
//clear modified blocks
modified.clear();
}``` why doesn't it update the blocks? 1.12.2
The interact event is always fired twice. Once for each hand.
they still wander
Ah you don't want wandering either
yeah
0 pathfinding
so if my spawner spawned type is zombie, I want to spawn a DummyZombie
setAware?
same for skeleton, etc
for (int platformRow = 0; platformRow < 4; platformRow++) {
for (int platformCol = 0; platformCol < 4; platformCol++) {
for (int rowIndex = 0; rowIndex < 16; rowIndex++) {
for (int colIndex = 0; colIndex < 16; colIndex++) {
DyeColor randomColor = colors.get(random.nextInt(colors.size()));
PartyUtils.setBlockInNativeChunk(Map.party, (int) (Data.firstPlatformBlock.getX() + (platformRow * 16) + rowIndex), (int) Data.firstPlatformBlock.getY() - 1, (int) (Data.firstPlatformBlock.getZ() + (platformCol * 16) + colIndex), 35, new Wool(randomColor).getData());
}
}
}
}
for (String pl : SumeruParty.players) {
Player p = Bukkit.getPlayerExact(pl);
PartyUtils.update(p);
}``` I'm doing a colormatch minigame and I'm looking for a more productive method than settype
Yeah, that's the better alternative
blockparty
is there a way to optimize this because settype slows down the server very much?
can't find setAware?
I've got a LivingEntity and theres no setAware method
only see setAi
How can I fix that?
nevermind, had to cast to Mob
Check which arm the event was fired for
How can I that?
With an if statement
does some1 know how i can make something like bukkit with their @EventHandler so methods are called if annotated?
if (event.getAction().equals(Action.RIGHT_CLICK_AIR) && event.getHand(EquipmentSlot.HAND)) {/*CODE*/}
So?
use reflection, get the class, loop methods, check if field has annotation and there you fgo
Yes. But split both statements
tnx Choco!
@lost matrix u have used redisson right?
so if I query a topic (reliable topic), and I dont specify a codec, what is the default codec
Come vc i need a walkthrough for something
That not woks
@EventHandler
public void onPlayerInteractOn(PlayerInteractEvent event) {
String prefix;
prefix = ChatColor.GREEN + "" + ChatColor.BOLD + "[DolfiMC] " + ChatColor.GRAY + "";
Player player = event.getPlayer();
if (event.getHand().equals(EquipmentSlot.HAND)) {
// That will be Execute 2 Times
if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if (event.getItem() != null) {
if (event.getItem().isSimilar(playerhideritemon())) {
for (Player allPlayer : player.getWorld().getPlayers()) {
allPlayer.showPlayer(player);
}
player.sendMessage(prefix + "Du hast alle Spieler Versteckt");
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), playerhideritemoff());
event.setCancelled(true);
}
}
}
if (event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
if (event.getItem() != null) {
if (event.getItem().isSimilar(playerhideritemon())) {
for (Player allPlayer : player.getWorld().getPlayers()) {
allPlayer.showPlayer(player);
}
player.sendMessage(prefix + "Du hast alle Spieler Versteckt");
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), playerhideritemoff());
event.setCancelled(true);
}
}
}
}
}
how do you people who actually post plugins embed images on your plugins
I tried using imagur and it won't embed on the resource page😭
spigot only handles 5MBs in its image cache iirc so Idk what to do
need smol gif
I'm making epic handle it I'm losing my mind
this is why I work with epic lol
back to slaving away at the docs
ebic
ebicepic reference
Markdown >> BBCode
this is all im good for
any idea how i can fix the sqllite file is java.sql.SQLException: [SQLITE_BUSY] The database file is locked (database is locked)?
hey you're good at coding
and yelling at me
that's why I keep you around
read what you just said again
especially the later part
kek
It's called a hostile takeover
uhm actually
we have equal access
doubt that
you own the group on github
I thought we had equal rights?
init how I setup the perms?
oh
any idea :p?
I thought you could lmao
ill check
iam using HikariDataSource
clearly we need to establish an HR department though
see you could run a hostile take over
@young knoll fire y2k for me, so he can start on CabernetMC
github is reckless
literal hostile take over incoming 
is that fuckin cheese mc
No
Cabernet is a type of grape
Basically wine mc
why are you starting a grape mc while being in cheese land
im telling john wisconsin
oh fucking fair
Because cheese pairs very well with Cabernet wines
I should name it Four-YearCheddarAndCabernetMC
Still lots of time to debate the name
@inner mulch
cammombear
<T extends A | B>
Though you were quite strongly opinionated when it came to CabernetMC the other day
Like I said you still have lots of time so don’t rush the name, make sure it’s good
is there a snippet for coloizing components, like the translate thing in ChatColor
like color("#123456Hello &aWorld")
How do I properly unsign a message?
Since I intercept and prevent some message packets from being delivered to the client. But I also save them and send them when the time comes. However that kicks the player out in some cases
For some unvalid signing
Or the feedback messages are sent "Couldn't deliver the message: <message>"
Raw netty intercepting
As packet classes
call again?
ye join general
bump
Hey, what player#hasPlayedBefore checks for? the data in the world or usercache
world probably
thanks
You can always try it and see
Yes, it checks for the existence of the player's dat file
@Override
public boolean hasPlayedBefore() {
return getData() != null;
}
(getData() being the NBTTagCompound from the world's playerdata folder)
?paste
@inner mulch apologize for ping i get this error, can you help me making the chat filter? i'll really appreaciate it and won't forget it for rest of my life
https://paste.md-5.net/wepakemuha.pl
so i used this code in some listener class , but it sends errors
the errors is above
why is this a download?
if i click on the link discord tells me to not open it
because it downloads something
.java works
okay, where is the code?
Looks like a nullpointer
wait 1 sec
i think
i'll try smth
btw is the code good? xD
i tried a for loop to get the word from the split message
so it doesn't do like class will be deleted because it has ass
i fixed it but now nothing happens
:)
ohhh
i got it
it doesn't ignore the case of word
i think im smart
i did something
how do i use the ignore case for contains
because there is nothing for it
why not use regex?
🤷
i couldn't find a made regex list for all bad words
i found one and its for gay and some idk what
Here's how I would do it:
- Split the message by space, in an array.
- Run a for loop through the words and for each word check if it's in a bad words list.
But that's not very optimized. For a much more optimized version you should use functions from List. convert the String array to List. etc..
thats what i do
String msg = Arrays.toString(String.valueOf(event.message()).split(" "));
for(Object word: Objects.requireNonNull(main.getConfig().getList("words"))) {
if(msg.contains(word.toString())) {
event.setCancelled(true);
player.sendMessage(Utils.color("&cYou can't say that word. " + "(" + word + ")"));
}
``` :)
ez by pass f u c k
You need to cache your words list
exactly
this is where regex comes in
How can I create a GUI?
each bad word would have its own regex, I'd probably think this through and spend an entire day on it
where is best way to learn how to use them in java, i couldn't find something useful on yt and google
If you have a bit of programming experience:
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
Otherwise:
Create an Inventory and listen for the InventoryClickEvent
you made that?
I doens't hab any experience of GUI's and that xD
Yes, this is one of my dev resources. 👍
oo nice
should i like create something with list of all the regexes, and then check if matches it?
Then its a good idea to start with the basics.
Create an inventory
Listen for the InventoryClickEvent
Cancel clicks in your GUI
Check which slot was clicked and execute methods accordingly
you can find some mc developments tutorials on yt too
oh god those are awful
Is that good?
https://pastes.dev/fc0VqZUBDC
now learn about early returns
you german?
so many germans on this discord xd
you too?
nein
ok
lmao
FourteenBrush new pfp 🗣️ 🗣️
?paste for code walls pleasee
1.12 packets using 1.16 API?
- Why are you sending a destroy packet to all other players. You never sent the spawn packet to anyone but the player.
- You can;t use 1.12 packets and 1.16 API. pick one version.
are you running it on a 1.12 server?
now you are spawning a new stand for every player except for the one joining
hmyes this better be a font issue
this is how my file reading turns out
it messes up polish characters
and probably other too
using utf8?
you are not using utf8 encoding
pretty sure I am
it has to be created and saved as UTF8 also
wdym?
this is how I save it
the data you are reading, comes from a file
why no try with resources?
What ru reading from
You’re reading from a file
You can;t use FileWriter as that defaults to teh system default encoding
use OutputStreamWriter
Conclube help. VC and help me decypher my old code so i can color my stuff.
Im just saying shadow, it can be dangerous to not close() the closable
In the finally block
Lmao
I will finally block you if no help

OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8");
besides
can't I use the constructor above?
this
You can use whatever you want, just don;t use FileWriter
I saw it everywhere online
my hero
FileWriter is a convenience class for adding text to a file. Typically you’d want to use an OutputStream or something else.
Well Files.newBufferedWriter/Reader does just wrap around the Files.newInput/OutputStream
:)
but yea
then is this
and this fine?
yes
nice, it works
How can I detect when I click in the Menu on a Item?
Guys does anyone know how i can properly work with RLiveObjects from redisson?
InventoryClickEvent?
Yes
InventoryClickEvent
Yes but how can I make that?
Code:https://pastes.dev/fc0VqZUBDC
it works in minecraft, so is this a console issue?
Does anyone know how I get the location of the interacted entity? I'm using protocollib and targetEntity is null in the print code
That’s your PlayerInteractEvent. Where’s the code for the InventoryClickEvent?
after a server restart it's fucked up again
You got notepad++?
ye
Open the file you are messing with in it and look at the bottom right.
It’ll tell you what the file is encoded in.
utf8
this thing
is what I'm doing to ensure the files are updated
could it be an issue?
are you saving a resounce from teh jar to file?
well kinda
just use Plugin#saveResource
but yes
this one is used to ensure none of the files have missing configurable fields
I can probably help more with that when I get home.
Did you try looking whether it is UTF-8 in your jar?
correct:
It wouldn't be impossible that maven or gradle copied the resource in a way that you didn't anticipate
after this:
I am one and above
using the intelliJ artifacts
uh yeah, then idk how it copies the resources
but intelliJ still thinks I'm using gradle and pops up
it does it normally
Normally would mean converting the resource to whatever bullshit encoding is your system default (not always UTF-8)
Unzipping the jar and explicitly opening the resource file as UTF-8
Also, input streams are reading the raw bytes. It doesn't matter for input streams which encoding the files are
why does this happen then?
So input/output streams cannot be the cause unless you wrap then in a Writer of Reader
I do
why would you
no I mean
uh
I don't
OH WAIT
ok I know the exact code that causes this
but I still don't know why it does
What is said exact code?
Please just use java.nio.file.Files#write
Try to use ISO_8859_1 instead of UTF_8 just as a hail mary
not a good idea
V::toString, that java?
ye
looked like reified generics, ig its the same as Object::toString then lol
nope
Object::toString returns the Object implementation
I'm decently sure of that
Yes, but if that suddenly works we know that they aren't reading the file as UTF-8
do you wanna vc?
Uhm that would involve me switching the discord client
there are some other options
no need then
No, just replace the charset you use for writing the file back
And make triple sure that your text editor is set to consume UTF-8
now it just somehow
broke the file
like when it encountered the first invalid symbol it stopped writing
the other lines as well
no error in the log?
anyone know how to get the console command sender in bungee?
no it doesn't lol
it will just dispatch a virtual call as usual
What can cause an event not to fire in some cases?
private static class Child<X> extends Parent<Void>{}
private static Class<? extends Parent<Void>> field = Child.class; // error```



