#help-development
1 messages Β· Page 1570 of 1
If I listen to PlayerLoginEvent
private Channel getChannel(Player player)
{
Channel channel = channelLookup.get(player.getName());
if(channel == null)
{
NetworkManager networkManager = ((CraftPlayer) player).getHandle().b.a;
channel = channelLookup.put(player.getName(), networkManager.k);
}
return channel;
}
Caused by: java.lang.NullPointerException: Cannot read field "a" because "org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer.getHandle().b" is null
If I listen for PlayerJoinEvent
channel.pipeline().addBefore("packet_handler", handlerName, interceptor);
Caused by: java.util.NoSuchElementException: packet_handler at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1119)~[Paper.jar:3162-Spigot-f773da8-b121d3b]
those are the worst methods names i have ever seen
To the point pls
i saw that cuz i have no idea what "getHandle().b.a" is, "networkManager.k"
blame mojang
it's their obfuscation
i thought it was a custom class sorry
Ok
i want to make a command who change a player name but i can juste put 1 argument... how can i do like all argument after the command is the name of the player?
player1.setPlayerListName(args[2].replace("&", "Β§"));
can you put it in my code because im starting in java x)
copying and pasting is not learning java x)
i can send you a link where you can read and understand what i mean
but i wont do the exact code for you
ok send it
https://bukkit.org/threads/adding-arguments-to-arraylist.70554/
here you will find an example of a guy making a string of the arguments
Hello,
I have no clue why this is not working, but I have this line of code:
commands.add(args.toString());
which is supposed to...
you can use that string to set the name of the player
How would I go about spawning custom mobs in certain worldguard regions?
isnt work... my name is changed by [Ljava.lang.String;@20f09b8e
u're printing the array by invoking toString() on it
what r u trying to do?
Use print Arrays.toString(arr) if u want to print the elements
no i want to change player name with all argument
I think I answered this already; but you keep asking...
Get the region bounds, and spawn the mob within them.
what does this mean? i sent stop via rcon, the server stops, everything works as it should, apparently, but i get this on the server console, before the server is stopped
[12:45:22 WARN]: Unexpected exception while parsing console command "stop"
java.lang.IllegalStateException: Asynchronous command dispatch!
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.17.1.jar:git-Paper-96]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:797) ~[patched_1.17.1.jar:git-Paper-96]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchServerCommand(CraftServer.java:784) ~[patched_1.17.1.jar:git-Paper-96]
at net.minecraft.server.dedicated.DedicatedServer.lambda$runCommand$3(DedicatedServer.java:776) ~[patched_1.17.1.jar:git-Paper-96]
at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764) ~[?:?]
at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:100) ~[?:?]
at java.util.concurrent.CompletableFuture.asyncSupplyStage(CompletableFuture.java:1778) ~[?:?]
at java.util.concurrent.CompletableFuture.supplyAsync(CompletableFuture.java:2001) ~[?:?]
at net.minecraft.util.thread.BlockableEventLoop.submitAsync(BlockableEventLoop.java:58) ~[?:?]
at net.minecraft.util.thread.BlockableEventLoop.executeBlocking(BlockableEventLoop.java:75) ~[?:?]
at net.minecraft.server.dedicated.DedicatedServer.runCommand(DedicatedServer.java:755) ~[patched_1.17.1.jar:git-Paper-96]
at net.minecraft.server.rcon.thread.RconClient.run(RconClient.java:81) ~[?:?]
at java.lang.Thread.run(Thread.java:831) [?:?]
mm should i ask in the paper server?
How and why can getWorld be null for DoubleChest? (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/DoubleChest.html#getWorld()).
It's not nullable for BlockInventoryHolders.
declaration: package: org.bukkit.block, class: DoubleChest
also getLeftSide and getRightSide can both be null. How?
Hello what wrong here?
if ((event.getEntity() instanceof Player)) {
Player player = event.getEntity();
Player killer = player.getKiller();
Bukkit.broadcastMessage(PVP.translate("&c" + player.getName() + " &7has been killed by &c" + killer.getName()));
}
Error line 26:
Bukkit.broadcastMessage(PVP.translate("&c" + player.getName() + " &7has been killed by &c" + killer.getName()));
Bukkit.getServer.getWorld and all other world functionality in Server?
declaration: package: org.bukkit, class: WorldCreator
thank
Hello? Someone can helpme?
?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.
He did, some posts up
It's not enough information to determine what is wrong anyway
oh right my bad lol
Post the whole error, not just the line it's on
presumably he got a null pointer exception since getKiller may return null
is there any way to create a fake player? that can send chat messages, and make it appear in the list by pressing tab
Yes thats error
so how i can get the killer? :(
PlayerDeath
make sure they die to another player then
and if not? How i do it will not throw error?
check it aint null
if killer == null
yes yes
anyone here a free server provider where i can test my custom plugins on?
yeh its called localhost
oh yeah forgot about it, good tutorial on how to set it up?
Run the server jar
im trying to spawn a fake player
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player)sender;
World world = player.getWorld();
Entity fakePlayer = world.spawnEntity(player.getLocation(), EntityType.PLAYER);
((Player)fakePlayer).setDisplayName("fake_player");
return true;
}
i get this error
Caused by: java.lang.IllegalArgumentException: Cannot spawn an entity for org.bukkit.entity.Player
at org.bukkit.craftbukkit.v1_17_R1.CraftWorld.createEntity(CraftWorld.java:2008) ~[patched_1.17.1.jar:git-Paper-96]
at org.bukkit.craftbukkit.v1_17_R1.CraftWorld.spawn(CraftWorld.java:2033) ~[patched_1.17.1.jar:git-Paper-96]
at org.bukkit.craftbukkit.v1_17_R1.CraftWorld.spawn(CraftWorld.java:1594) ~[patched_1.17.1.jar:git-Paper-96]
at org.bukkit.craftbukkit.v1_17_R1.CraftWorld.spawnEntity(CraftWorld.java:826) ~[patched_1.17.1.jar:git-Paper-96]
at io.github.misdocumeno.sharedservers.commands.SharedServersCommands.onCommand(SharedServersCommands.java:17) ~[?:?]
You can't spawn a Player
You have to use NMS for FakePlayers I'm pretty sure
And send them with Packets
Idk but maybe citizens might be helpful here
i saw code from 2016 doing something like that, now is different i guess
need to implement ur own player
Yeah your best bet is using Citizens API for it
tbf idk if it ever was possible
Doubt it tbh
i wouldnt like to have to update it with each mc update
that may be useful
well, maybe i dont need a fake player, i thought it would be easier, as in other games
what i want is a player in the tablist that isnt actually on the server
also send messages with this "fake player"
the idea is sharing tablist and chat between two servers, nothing more
Just send the chat? You don't need a fake player for that
Same with tablist, you can modify it directly I'm pretty sure
but i read somewhere that i need nms for tablist stuff
Just add a player to the tab list then. And send a just copy the text of the chat event.
can i add a player to the tablist with just the spigot api? if so, how?
sharing the chat is the easy part, but idk how to do the tablist thing
how can i make it so onCommand a new gui opens, but when another player runs the same command the first gui doesnt stop working ?
is it possible that its braking because both users are on my pc
no
?
Guys, anybody knows if getProxy().getPlayer(name) is case sensitive?
Send your command class
You're overriding kitsInv for the old player
Just create a new separate inventory for the new player, and have an Inventory instance for both players
anyways
yeah stop telling people to use sites that host illegal jars
fine ig
wdym
am i not doing that? when i do the new KitCommandListener.open
thats creating a new instance of the class
Make build() return an Inventory and open that
Right now you're setting a static Inventory variable
And then when you do this in the onInvClick if (event.getInventory() != kitsInv) return; it returns because the Old player's inventory isn't kitsInv anymore
Are you able to put custom unicodes you made in your textures in the lore?
event.getClickedInventory()
Get rid of kitsInv
this is waht i mean
Yeah it's because of kitsInv, get rid of it
How could I make it so it doesn't show 0 https://imgur.com/RSVrT9f
public Inventory mainMenu(Player player) {
ArrayList<Player> playerList = new ArrayList<>(player.getPlayer().getServer().getOnlinePlayers());
Inventory mainMenu = Bukkit.createInventory(null, 45, ChatUtil.color("&cPlayer List"));
for (int i = 0; i < playerList.size(); i++) {
ItemStack playerHead = new ItemStack(Material.SKULL_ITEM, i, (short) 3);
SkullMeta meta = (SkullMeta) playerHead.getItemMeta();
meta.setOwner(player.getName());
meta.setDisplayName(playerList.get(i).getDisplayName());
playerHead.setItemMeta(meta);
mainMenu.addItem(playerHead);
}
return mainMenu;
}
wut?
new ItemStack(Material.SKULL_ITEM, i, (short) 3);
i is the amount, and it starts at 0
how can i get rid of the inv thats showing
right
Store it in a Map<UUID, Inventory>, or check the Inventory title.
But if you have a static variable like that, only the last player that opened the inventory can use it because of if (event.getClickedInventory() != kitsInv) return;
You could also build the Inventory once, set it as kitsInv, and then just open kitsInv.
Don't rebuild it everytime the command is ran
but the kit list might change
Is it player dependent or does it only change on server load
its the kit list in the config file
so if an admin changes the lsit
i want players to see the new list
wich works, if only 1 player opens the inv
lol
Well, just rebuild the Inventory when the config changes then
But don't rebuild it everytime someone opens it
k i fixed it thx
does anyone knows which one of these is the tablist showing connected players? it seems that Player_List_Item doesnt exist anymore, i see that everywhere on google searching for "add players to tablist"
https://wiki.vg/Protocol
thanks
mm thats a lot of stuff
anyone knows whats the protocollib's PacketType.Play.Client.?? thing for that?
nvm its Server.PLAYERINFO, not client
@chrome beacon ?
whats the gui InventoryType name of a double chest?
if https://wiki.vg/Protocol#Player_Info has 2 int field types and 1 array, why i cant do packet.getIntegers?
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
packet.getIntegers().read(0);
// ...
}
});
[15:33:38 ERROR]: [SharedServers] Unhandled exception occured in onPacketSending(PacketEvent) for SharedServers
com.comphenix.protocol.reflect.FieldAccessException: No field with type int exists in class PacketPlayOutPlayerInfo.
at com.comphenix.protocol.reflect.StructureModifier.readInternal(StructureModifier.java:218) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.read(StructureModifier.java:197) ~[?:?]
at io.github.misdocumeno.sharedservers.SharedServers$1.onPacketSending(SharedServers.java:25) ~[?:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:195) ~[?:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[?:?]
at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:535) ~[?:?]
at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:516) ~[?:?]
at com.comphenix.protocol.injector.netty.ProtocolInjector.packetQueued(ProtocolInjector.java:346) ~[?:?]
at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketSending(ProtocolInjector.java:308) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector.processSending(ChannelInjector.java:433) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector.access$800(ChannelInjector.java:70) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector$3.handleScheduled(ChannelInjector.java:373) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector$3.onMessageScheduled(ChannelInjector.java:343) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable(ChannelProxy.java:127) ~[?:?]
at com.comphenix.protocol.injector.netty.EventLoopProxy.execute(EventLoopProxy.java:95) ~[?:?]
at net.minecraft.network.Connection.sendPacket(Connection.java:294) ~[?:?]
at net.minecraft.network.Connection.send(Connection.java:258) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.send(ServerGamePacketListenerImpl.java:1905) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.send(ServerGamePacketListenerImpl.java:1891) ~[?:?]
at net.minecraft.server.players.PlayerList.tick(PlayerList.java:1017) ~[patched_1.17.1.jar:git-Paper-96]
...
[15:33:38 ERROR]: Parameters:
net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo@28eb45fe[
a=UPDATE_LATENCY
b=[PlayerInfoData{latency=0, gameMode=SURVIVAL, profile=com.mojang.authlib.GameProfile@65a586e2[id=f62a41ae-4198-391b-ad68-6dbbc530da23,name=misdocumeno,properties={},legacy=false], displayName=null}]
]
I recommend you take a look at PacketWrapper because what you need to do is grab the PlayerInfoData
From what I can tell by that error message somethings wrong with your SQL command
I'm not expert with how they work so I'm not sure I can help more than that
Send where you're executing the PreparedStatement please
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
does anyone know what it does. What does that even mean?
Sets the localized name.
ItemMeta#getLocalizedName() gets the localized name depending on the server's language settings.
So I would assume setLocalizedName sets it for the client?
this is changing my name, instead of adding a new profile to the list, any idea why? also im now really sure what should i send to the 4th parameter of the PlayerInfoData constructor
public void onPacketSending(PacketEvent event) {
List<PlayerInfoData> playerInfoDataList = event.getPacket().getPlayerInfoDataLists().read(0);
WrappedGameProfile profile = playerInfoDataList.get(0).getProfile();
profile.withName("duplicated");
playerInfoDataList.add(new PlayerInfoData(profile, 10, EnumWrappers.NativeGameMode.SURVIVAL, WrappedChatComponent.fromText("duplicated")));
event.getPacket().getPlayerInfoDataLists().write(0, playerInfoDataList);
}
is playerInfoDataList.get(0).getProfile() returning a reference maybe? idk how that works in java really, idk java
Well you are modifying your name not adding a new entry
no, its passed as value, you need to return a new one and replace the old one, also you cant have a void and ItemStack return type at the same time
i am adding to the list, right?
why myself? isnt playerinfo...getProfile() duplicating my profile?
You should create a new Profile with a new UUID
depends what you do with it
not necessarily, it could update directly depending on the situation
but for safety purposes i would return it and use it to set
well yea, it depends on the data type, i guess
itemstack is mutable
if you change the amount in the modify method, then the amount will be different for is
right, its an object, its passed as reference
any help with this? im so close to achieving what i want
I've told you what to do
that is returning your profile
not a copy
You need a new Profile
yes, thats why i add new PlayerInfoData(...) to the list, isnt it a new profile?
?paste
https://paste.md-5.net/moqohematu.cs Why do I get this error?
qwll you're still using the same profile
No you're using your existing profile and putting in a new PlayerInfoData object
how do i clone that profile, and change the uuid and displayname?
NoSuchFieldError: LIGHT_GRAY_STAINED_GLASS_PANE
I am creating new item stack with that material
My guy I told you don't clone it. Create a new one
I don't understand why
if its cloneable then you can .clone, if not then you have to create a new one and figure it out
well, not clone it, in fact i need a new one
u use 1.8, those material values are only new to 1.13
It's literally new WrappedGameProfile(`<insert args>)
oh, but I am trying to make this work 1.8-1.17
What's the max inventory size you can have?
well u cant with hardcoded material values
54
Then you need to compile against 1.8 and skip setting api version
and those args are...?
HOW AM I GETTING AN NPE ON THIS LINE!!! WTF if (args[1] == null) {
.isEmpty doesnt work either
because the array is of length 1 lol
another profile?
is args null
its from a command, dont think it can be
wait
yes it is
sop i checking if its null
primitive arrays will error if you try to access an element that's not in it
would throw an out of bounds exception if it was length 1
check that args.length > 2 before you try to access it, there will be no problems.
check out https://gitlab.com/RandomHashTags/umaterial
its pretty similar to the original Material class (Don't think its been updated to 1.17 but you could do that yourself)
you are
thank you gecko
π
thanks
XMaterial is better
Both look pretty meaningless
I recommend the entire XSeries of plugins for best version compatability
never heard of it until now
i get 2 duplicated
public void onPacketSending(PacketEvent event) {
List<PlayerInfoData> playerInfoDataList = event.getPacket().getPlayerInfoDataLists().read(0);
WrappedGameProfile profile = new WrappedGameProfile(UUID.randomUUID(), "duplicated");
playerInfoDataList.add(new PlayerInfoData(profile, 10, EnumWrappers.NativeGameMode.SURVIVAL, WrappedChatComponent.fromText("duplicated")));
event.getPacket().getPlayerInfoDataLists().write(0, playerInfoDataList);
}
I never realised how many items minecraft has until now lol
also im not sure what WrappedChatComponent.fromText("duplicated") is doing and if its correct
Well everytime that packet sending is called it will add a new one
That's fine
then i should check the list first
but, should it add a new one every 5 seconds or something? every ping update
im waiting and i still have 2
new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO)
you mean this?
That might only be called when a new player is added to the tab
or so
I'm not entirely sure actually
mm, i will join with another account
yea, i new one was added
so that list is persistent
You will have to track what you add
ok
so, that event isnt called when a player press tab
then, do i need to call the event myself if i want to add or remove someone from the list?
I wouldn't listen to that even if you want to add things
yea, so i need to call those events
You can do it anywhere you want. Just create a new packet
not listen
No need for that event
Hence why the first thing I recommended was looking at PacketWrapper
Which has a premade utillity class you can use
the github wiki is pretty incomplete, what wiki are you using?
C# then?
no
Any programming language?
python mostly, javascript with typescript
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.
Anyway here's the utility class I was talking about: https://github.com/dmulloy2/PacketWrapper/blob/master/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerPlayerInfo.java
ew
Ew to what
copy and pasta
That's effectively what you're doing when you shade dependencies into your project π€
Well you're using an API too aren't you. This is what it was designed for
no?
recycling old code is the most usefull tool you have as a developer
Yeah I couldn't be bothered with teaching shading
I'm not talking about copy and pasting
the setData method is what i need, right?
LMAO I don't blame you
I didn't say ew to that
ok too bad but thanks for your help so far :D
U wanna See my Plugin. Jam packed with Code fein Others that Allow it
on the edit resource page, how do I align text to the left but have it in a centred spoiler. I am going mental
This is the complete class
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.UUID;
public class addPlayer {
public static boolean addPlayer(String username, UUID uuid, int coins) {
try (PreparedStatement stmt = MySQL.getConnection().prepareStatement(
"INSERT INTO playerdata(username, uuid, coins) VALUES(?, ?, ?)")) {
stmt.setString(1, username);
stmt.setString(2, uuid.toString());
stmt.setInt(3, coins);
stmt.execute();
return true;
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
}
what happen if that wrapper stops being updated? i dont like relying on protocol lib, tho it seems to be pretty active, but adding something more to depend doesnt sound very good to me, but idk
It's already slightly out of date
also cant i add that with maven?
Wrapper that is
You can
how
[CENTER][SPOILER="title"][LEFT]content[/LEFT][/SPOILER][/CENTER]
It's maven project run mvn install
mmm
i only know to edit the pom.xml file
where should i put the PacketWraper folder and where should i run that command?
You should run the command in the same directory as the pom.xml of PacketWrapper
Life saver <3
wait
there is a pom.xml inside PacketWraper
and a src folder
where do i have to put those 2 things?
ignore them
u can just install it to ur local repository if u want to use it
I have no idea where the issue lies, but from what you said, it sounds wrong
Seems fine to me. Things to check next:
1.) Table structure - make sure your types match
2.) Print out the query after setting params - some JDBC drivers let you get the query it'll run by calling .toString() on the PreparedStatement
Second point isn't guaranteed to work but it's worth a shot.
i dont get it, really, should i combine my src folder with that src folder? should i put PacketWrapper at the same level as my src folder?? or what, i dont get it
why couldnt the author just do the thing to add a dependency and a repository in my pom.xml and thats it
How can you loop through a specific inventory slot like slot 45 to 52? I know you have to do a for loop but I mean like the equation I guess you could say
clone the project, navigate to it and run mvn install
it will effectively do what you want it do it, except the repository is your own local one
i get it, but to where do i have to clone it...
anywhere
how does it know what to do then?
well anywhere outside your project then
nvm ill just do it
you have a folder on your system called .m2 which is a maven repository
wait, maven is a global thing?
i thought it installed everything in my project folder somewhere
well now it makes sense
no
so, everything i install with maven will be available to all projects?
yes
why do i have to add spigot to pom.xml in every plugin project i make then?
it is like having your own repository
because you're fetching spigot from a remote repository
you haven't actually installed it to your own
ok
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:00 min
[INFO] Finished at: 2021-07-12T16:52:50-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project PacketWrapper: Could not resolve dependencies for project com.comphenix.packetwrapper:PacketWrapper:jar:1.15.2-R0.1-SNAPSHOT: Could not find artifact com.comphenix.protocol:ProtocolLib:jar:4.5.1-SNAPSHOT in spigot-repo (http
s://hub.spigotmc.org/nexus/content/groups/public/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
it is different from stuff like npm where it is mainly per project and all dumpted to node_modules
yea
did you actually install it
bump
i did mvn install inside the PacketWrapper folder, where the pom.xml is
everything in it will be executed for each int i within the obunds
it looks like it on protocollib
well, i didnt use mvn, i did "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib\maven3\bin\mvn.cmd" install
i think that pom.xml is outdated
no
maven dependencies are transitive
meaning it will try to resolve the dependencies of your dependencies
it appears to have failed to find ProtocolLib
in the PacketWrapper pom.xml i replaced version 4.5.1-snapshot with 4.7.0 and now i get a different error
so to get back to the first point, I created the table in the Main method as follows:
PreparedStatement ps = MySQL.getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS playerdata(id INT(100) PRIMARY KEY AUTO_INCREMENT, username VARCHAR(16) NOT NULL, uuid CHAR(36) not null, coins INT(100) not null, language VARCHAR(3) not null);");
looks like the tests failed, youβll have to skip them
itβs a command line flag, forgot what it is though
Oh maybe the error is output because the column "Language" is not null, but I do not write anything into this column.
You're inserting a record without specifying a language, which is marked as non-null, that could be a problem.
using -Dmaven.test.skip=true
[ERROR] Failed to execute goal on project PacketWrapper: Could not resolve dependencies for project com.comphenix.packetwrapper:PacketWrapper:jar:1.15.2-R0.1-SNAPSHOT: Could not find artifact com.comphenix.protocol:ProtocolLib:jar:4.5.1-SNAPSHOT in spigot-repo (http
s://hub.spigotmc.org/nexus/content/groups/public/) -> [Help 1]
still need protocollib
fuck it ill copypaste
lol
wasnt protocollib installed when i added it to my pom.xml?
what is your full pom
im already using protocollib, so, it has to be installed
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.misdocumeno</groupId>
<artifactId>SharedServers</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<outputDirectory>../Server/plugins</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.36.0.1</version>
</dependency>
<!-- ProtocolLib -->
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.7.0</version>
</dependency>
</dependencies>
</project>```
How can I get all the new methods/changes of 1.16 ?
packetwrapper is available on that repo
https://repo.dmulloy2.net/repository/public/
you can freely browse it
wait i just realized the maven is in Js thats why theres the / closing LOL
what
im quinda sad it took me this long to realize
maven is not in js?
xml...
its the same structore
then why WrapperPlayServerPlayerInfo doesnt exists or at least intellij doesnt know about it? does it have another name?
pom.>>>>>>>>>>>>xml<<<<<<<<<<
html has those comments
is that part of packetwrapper? you need to declare that dependency
yes
how do i declare that dependency
you said thats included in the protocollib repo im using
what is that?
the repository browser
whats the location of the local maven repo again?
it depends on your OS
windows
Guys is buildtools broken????
1.13.R0.1-SNAPSHOT is the latest version?
Have compiled smth with IT today
So no
I guess
thats the latest one on that repository
I tried so many things, clearing all the files, downloading all files manually, nothing works
Try an older version
I tried
you mean from buildtools?
Yes
then I cannot build 1.17
yes
Send the errors then
I'll try
Could not find artifact com.cophenix.packetwrapper:PacketWrapper:pom:1.13.R0.1-SNAPSHOT in spigot-repo
why is it trying to download it from the spigot repo, instead of the dmulloy2 repo
Wrong directory my guy
what do you mean wrong directory?
You're in the system32 dir
U in sys32
oh god -_-
Go back to the BuildTools directory
running system adminstrator won't work then that way okay hold on
it just doesn't work ....
<dependency>
<groupId>com.comphenix.packetwrapper</groupId>
<artifactId>PacketWrapper</artifactId>
<version>1.13-R0.1-20180825.172109-2</version>
</dependency>```
thats the dependency for packetwrapper from that repo
Same error, even when running as administrator?
Weird
May u restart ur pc and clean all the files and redownload
Google ur friend
Could not find artifact com.cophenix.packetwrapper:PacketWrapper:pom:1.13-R0.1-20180825.172109-2 in spigot-repo
the same thing, its trying to download it from the spigot repo, why?
maven will try all repositories
it does not know which dependency belongs to where
yes
it just doesn't work
it's broken
never had this
ever
i shearch and i didnt found enything
Weird. Maybe for some reason it can't modify anything in your Documents folder? Try running in a folder on your Desktop
The first link dude
Come on
it didnt work xDDDD
yea, but why doesnt it say "in dmulloy2 repo"
Protocollib
well, nvm, what now?
Use it
idk tbh, it seems rather abandoned but if you really want it via maven then you're gonna have to install it locally
do i really need to use this wrapper just to fire a protocollib event?
i have no idea
Y would u need a wrapper for an protocollib event?
That's not making sense in my smooth brain
probably not but if we're talking about packet wrappers then you may want to use that
AbstractPacket doesnt even exists
AbstractPacketInjector does
also its not importing AbstractPacket, i dont get it
https://github.com/dmulloy2/PacketWrapper/blob/master/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerPlayerInfo.java
You need to include AbstractPacket from PacketWrappers
how do i change the name tag of a player
i did this but it doesnt change the name tag
can i just literally combine that src folder with my src folder?
and change some package names and stuff
Yes
whats with the ewen abuse
well, ill do that
the readme says that is the best approach to including it
You can use PacketWrapper as a dependency if you wish, although it is highly recommended that plugin authors simply copy and paste the classes they need into their project. This helps guard against future changes in PacketWrapper and makes it easier on the end user.
its my friend lol
I think it is not possible with regular bukkit api.
packets π
wtf
... or just enslave another plugin to do the heavy lifting
NametagAPI is working on being updated to 1.17, which is my go-to for that.
Or sorry, NametagEdit
It's 1.16.x right now
i guess this wrapper will work as long as protocollib keeps being updated?
I bet a lot of projects like this will struggle to update a little bit thanks to the mapping changes.
right
I don't like protocollib tbh, it has been wonky with updates in the past
Β―_(γ)_/Β―
wym
stuff like breaking with java releases or fully releasing a working release only after a few months after it went into testing
if by myself i recode a plugin that is already existing and its paid and i make it free is against TOS?
like if i like code a plugin like litebans and make it free
As long as you're not using any of Liteban's code
^^
nono ofc not
Then it's fine
all plugins should be open source anyway
dont pull the "buy premium plugin and publish for free" one
wdym
ye but im trying to make it so when you use the command, it can only change the nametag to "Ewen_Is_Fat_XD"
._.
?
I know how to do it I just can't be botherd to explain it for the third time today
All I can say is scroll up a bit and you will find what you're looking for
basically, use libraries or plugins that are not official bukkit apis
how do i decompile a jar file :)
There are many ways
do i see the full code?
No
bruh
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
.
Just use a decompiler like quiltflower, CFR or procyon
k
You're not making the plugin if we write the code
:(
Of course you can be lazy and use a proper tool such as bytecode viewer or recaf
Recaf is great
It is, as long as you don't join their discord server
why
Never been there
What's wrong with their Discord
ye
Bunch of kids trolling and meming
no im stealing them and then changing them so i can troll my friend
not selling them tho
no, but you will see frequently things like "haha, I skidded a minecraft client. I must be cool"
lmao wat
sounds annoying indeed
yes
sounds like me 2018
Give a man a fish and feed him one day, teach a man how to fish and feed him for his whole life
eclipse govno??))
No eclipse here
ok
The eclipse government is at the other door
yes
hi, recently i started trying to create my own world generator. I'd like to get an effect very similar to a standard minecraft vanilla world generator, but I'm currently not doing it. Anyone know how I can adjust the shapes to get this similar? My code:
int currentHeight = 50;
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
ChunkData chunk = createChunkData(world);
SimplexOctaveGenerator generator = new SimplexOctaveGenerator(new Random(world.getSeed()), 8);
generator.setScale(0.005D);
int r = random.nextInt(21) + 3;
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
currentHeight = (int) ((generator.noise(chunkX * 16 + x, chunkZ * 16 + z, 0.5D, 0.5D, true) +1 ) *15D + 50D);
chunk.setBlock(x, currentHeight, z, Material.GRASS_BLOCK);
chunk.setBlock(x, currentHeight - 1, z, Material.DIRT);
for (int i = currentHeight - 2; i > 0; i--) {
chunk.setBlock(x, i, z, Material.STONE);
}
chunk.setBlock(x, 0, z, Material.BEDROCK);
biome.setBiome(x, currentHeight, z, Biome.PLAINS);
}
}
return chunk;
}```
result:
so cool
i read about this in this article : https://bukkit.fandom.com/wiki/Developing_a_World_Generator_Plugin
will player.getUniqueId remain the same forever for each account?
yes, so long as its online mode
wdym online mode
not offline mode server
what even is that
have you played MC before?
lmao perhaps so yes
oh you mean like
if the server can't reach mojang's servers or something? idk
yes, kinda. You can configure it to never authenticate
Is it possible to get a column from mysql depending on row
which is bad, but some do
how can i restore the vanilla socreboard back?
claims sidebar is already showing it
it seems to get reset by my plugin
Just steal the nms code π
it could be a client side thing. Looks like your using a hack client so that could be it
What is in Forge 1.16.5 the name for the onRightClick event?
Forge?
Just 1.16.5
I would try the Forge Discord if there is one. This discord is for Spigot.
kk
its not related to my client
PlayerInteractEVent
afaik
Forge
he edited it said what was the equivalent for forge lol
or something like that
well
usually onUse
or onInteract
like if you're deriving a custom registerable
Its onInteract ty
Displaying it correctly could be an issue but probably not likely
nvm then
here's my code
yes gitlab
now with this copilot thing
github overrated ngl
regardless, can anyone figure out why you cant set scoreboards in vanilla if scoreboards are disabled in my config?
Because they are disabled?
no i mean, you cant use the vanilla scoreboards at all if you disable my custom scoreboard
Nah I β€οΈ GitHub
thing is, i dont see what i did wrong in my code
Are you setting the players scoreboard to something other than the main scoreboard
ok, where can i find it? (path)
when enabled, yeah
Oh idk you would have to look thru it
Hmm, BuildTools is giving me this error when trying to compile 1.17 now: [INFO] --- specialsource-maven-plugin:1.2.2:remap (remap-fields) @ craftbukkit --- org.apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact org.spigotmc:minecraft-server:csrg:maps-spigot-fields:1.17-R0.1-SNAPSHOT
And this is what I'm running with java -jar BuildTools.jar --rev 1.17 --compile craftbukkit --remapped
Seems like a 1.17 issue hmm, seems to work with 1.17.1
my project (maven) doesnt get build bc "nothing to compile, all classes are up to date" despite being modified, a lot of times, why? it was working fine and suddenly this happens, and its not the first time it happens
InteliJ? Using Artifacts to build and not lifecycles?
I use Intellij artifactss
how can i config this thing to compile artifacts when using maven? the spigot guide uses lifecycle > package
You don;t use artifacts. Thats InteliJ compile, not maven
use teh Maven menu right hand side
correct. Then it shoudl be building.
but its not
Do you get an error? or is there a jar built in the target folder?
no errors, just "nothing to compile", im compiling directly to the server/plugins folder, not to target, while the server is still running, but ive been doing this since 2 days ago, and it works fine
also, it literally says "nothing to compile, everything up to date" so... idk
using some plugin to redirect the jar?
yes, i think
Run a clean then package
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<outputDirectory>../Server/plugins</outputDirectory>
</configuration>
<version>3.2.0</version>
</plugin>
im trying to create a shop plugin where a player can place down a block and when someone clicks on it, it opens an inventory. How do I uniquely identify each block (shop)?
still the same
ok
use files for saving locations and other data, ig
and ofc interact events
so I should keep track of the shops by location?
that's what I'd do
thats not sql, its just a random link name
Yep, clearly thinks everything is upto date
im editing the onCommand method inside a class that implenets CommandExecutor
im doing this inside onEnable on the "main" class this.getCommand("addplayer").setExecutor(new SharedServersCommands());
so i dont see the problem, also i didnt change anything besides code inside the command callback
actually, it claims your compile was fine, it was your test compile that had no changes
the entry point class for the plugin, the one that extends JavaPlugin, is unused according to intellij, is that normal?
yes
its kind of annoying
ok so when a player right clicks on the block (shop) i get that location and get the contents of the shop?
I don;t use a hand holding IDE like Intelij
yeah
Ok, so how do I tell if the block that the player places down is the shop block? Like where do I store that data?
the compiled jar isnt changing, its mtime stills the same
is it a sign they place or a chest or what?
manually copy it over. The log says it built fine
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ SharedServers ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 5 source files to D:\Documentos\Java programming\Minecraft Plugins\SharedServers\target\classes```
yeah i think im gonna use a chest
Your server needs to be stopped when you build txt [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ SharedServers --- [INFO] Building jar: D:\Documentos\Java programming\Minecraft Plugins\Server\plugins\SharedServers-1.0-SNAPSHOT.jar
special name? lore? persistent data container?
well, no, i only see .class files, no .jar
smth to make it identifiable?
Its building to Building jar: D:\Documentos\Java programming\Minecraft Plugins\Server\plugins\SharedServers-1.0-SNAPSHOT.jar
Ok yeah Ill probably use lore, thanks for the help.
hey, how should i check if an OfflinePlayer DOES exist..?
PS: i HAVE the offlineplayer set, however i get an error when i try to set the OfflinePlayer
&&&i know how to get offline players, and this way /does/ normally work
cool
yea, the server is not receiving the stop command for some reason
get the offline player by UUID. If the returned OfflinePlayer object has a null name then they don't exist
idk what u need exactly but I recommend using nbt
π
It's safer then names / lores
i just restarted the script and now it works, idk
well
anyways
this isnt working
how do i actually update the list?
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
WrapperPlayServerPlayerInfo wrapper = new WrapperPlayServerPlayerInfo();
// get the current tab list
List<PlayerInfoData> playerInfoData = wrapper.getData();
// create a new player profile
WrappedGameProfile profile = new WrappedGameProfile(UUID.randomUUID(), args[0]);
// add it to the tab list
playerInfoData.add(new PlayerInfoData(profile, 10, EnumWrappers.NativeGameMode.SURVIVAL, WrappedChatComponent.fromText(args[0])));
// set the new tab list
wrapper.setData(playerInfoData);
return true;
}
do i need to "set an action" or something like that?
does player.getUniqueID() not work?
Yes, but if you already have a player object why are needing to check if they really exist?
to see if they're online or not
if they are not online you will not have a player object to get the UUID from
is player.isOnline() a thing..?
You can NOT use player
thats what i thought
Player will not exist unless they are online
where are you getting player from?
args[0]
so not a player but a String of their name
ok ill look into nbt tags
if there is no player online then your player will be null
ahhh
π ty
Hey I am working on an EventDebugger, we have a project with 14 different Modules, and it happens a few times where 2 plugins have the same listener, and one plugin cancels the event but the other sets cancelled to false, which breaks our code. So I wanted to make a Plugin which detects specific Events and when certain methods are changed. There is this Plugin: https://www.spigotmc.org/resources/eventdebugger.82055/ it does exactly what I wanted but its missing functionality which we need. so I wanted to recreate it, its written in Kotlin so the Code is 0 help because I have never used Kotlin before.
My Quesion: How can I make a Listener which listens to specific Events and when something changes
Why would you want to reset a cancelled state?
Thats ignoring the Event contract with other plugins
we are multiple developers so sometimes mistakes happen, and using that solution we don't need 20000 hours to find the wrong Event.
true, but we only reset cancelled state if alot of if checks pass which can ONLY happen on our plugins, its mostly internal checks.
ok, write a plugin with two listeners for the same event. One registered on LOWEST priority and the second on Monitor. Compare the two.
thats not what I want to achive, I want a Universal solution like the plugin linked above, its only a config
I want the same thing, but there are some information missing which makes the plugin above a little useless
they use reflections to get the Handlerlist and go from there, but how can I constantly check if there is any change
hmm let me take a look
They simply refect and re-register all executors to pass though executeAndCheckChanges
it compares the map of Fields
could you explain that a bit different?
everything is fucking minimum requirements
how is this related to Spigot development?
bUT they SaY it DOesnT FUcKing SuppPOrt IT
it isnt
then delete it ...
nah
yeah idkidk, not the best channel
:(
hey gamers, is it possible to inject code into the base mc server?
like a mixin but for spigot?
i think yeah
pretty sure you can even inject cpp dll
you want bytecode manipulation/injection?
uh thats hard to do then
or any tweaker classes
this is why you should have the (stupid) in your name
wrong person
can you help me out please?
If only we had mixins
Conclure you have somthing for my Problem above? I want to make the cleanest solution possible
idk if javassist needs an agent, if not maybe that?
Ik not the best thing
yeah well
let me jump to the event impl
Take your time, I am glad you want to help π
Conclure, sorry to bother you, but do you have an idea on this subject ?
Conclure, or anybody
there's no best way to do that
afaik you can just delete it in onLoad? aren't the plugins loading first
I often run into some errors (due to world saving) doing whatever way. Even deleting the world by hand while the server is off is causing errors
^ provided it isn't the main one
It is the main one
Oh I read nether and end
Create a new world set that as the main, then unload the old world π
Was just about to say that lmao
But yeah, have a placeholder world so you can load/unload world
so like the debugger thing goes like this:
I will avoid design pattern names just in case you dont know them
it gets the HandlerList instance of a specific derived Event class,
it invokes HandlerList#getRegisteredListeners and loops it,
then for each RegisteredListener it reflects the EventExecutor field named executor,
it then sets a custom EventExecutor for the executor field,
the custom executor delegates the original executor instance but it maps the old values before invocation, then it maps the new values after invocation and compare
So Reflection, Reflection and more Reflection?
yup
so everything sounds pretty straight forward until the last point with the custom executor
you could use MethodHandles or Unsafe if you want to increase speed I guess
right
public class RegisteredListener {
private final Listener listener;
private final EventPriority priority;
private final Plugin plugin;
private final EventExecutor executor;
// more
discord changed the boosted on a server badge?
pretty sure never looked like this
I still have the diamond. But that's not the place to discuss about that, is it ?
2 time you sayd something completely misplaced.
i would put it in general but i dont feel like moving
we don't care this is a channel for development not random nonsense
ik but do i care
it gets the already existing executor,
...getDeclaredField("executor")
setAccessible and so on,
then it creates a new executor:
class AdapterEventExecutor implements EventExecutor {
private final EventExecutor delegate;
AdapterEventExecutor(EventExecutor delegate) {
this.delegate = delegate;
}
public void execute(Listener listener, Event event) {
//get current values of event
delegate.execute(listener,event);
//get the new values of event (after invoking execute)
//then check differences between current values and new values
}
}```
then it sets the field `executor` to one of those adapter event executor instances where it essentially wraps the old/existing executor
iterator maybe
would getting the values done using Reflection too, or is there a different way?
sorry 4 ping
still throws it
reflection Johni
o
Are you still here in like 40 - 50 min Conclure?
maybe i should make it a while loop instead?
interesting why that throws one
yeah
also what is rse
red stone event i assume
yeah
still dont know what that is
RedstoneEvents is a HashMap<Long, ArrayList<Integer[]>>
rse += item.size()
im trying to get the size of the Integer[]s
the code where im counting things is async
you're getting the size if that list tho
How does Bukkit.getScheduler().runTaskAsynchronously work, does it create a new thread for each task given or is it a separate thread that just has all the asynchronous tasks running on it?
separate thread for each task iirc
it uses a scheduled single thread event executor to dispatch a scheduled task which is then delegated to a cached thread pool iirc
synchronized or ReentrantLock
maybe it was a fixed thread pool, was quite some time since I red the implementation
so is there a limited amount of threads to use (eg. only x threads in the pool) or does the pool just grow larger when more tasks are given to it?
its been so long since the minecraft migration was said and its still hasnt started yet
even if i lock it, still throws that error
the point of cached thread pool is to have reusable threads
what do you want to use threads for?
but it may grow to achieve concurrency
send entire method
or entire class
imma test something real quick
int rse = RuntimeStore.RedstoneEvents.values().stream().mapToInt(ArrayList::size).sum();
I'm trying to play noteblock music (without the use of NoteBlockAPI since it seems to be broken in 1.17), each thread = one player's music so multiple people can listen to different music at the same time
if this method is inefficient I'm open to other ideas!
you should be able to do that on a single thread
sounds horrible
async is better for stuff like databases and large calculations
a per player thread design is more performance taking than gaining
Quick side question: Whats the best way to make certain tasks MultiThread? for example we are planning on making a custom miniture version of towny, and the current plan we had required some methods which might take longer to execute, like calculating surrounding plots. or when claiming town chunks take the surrounding x chunks and add them to the town. And doing that on the Main Thread sound very unhealthy.
you'd be surprised how powerful a cpu is. Those calculations could be done on the main thread
tbf you could just use a ForkJoinPool with maybe the parallelism set to 4 or smtng
but even a single thread executor would do the job
unless you're like hypixel or something
its hard to tell unless you'd come out an disclose the exact project
i mean, hypixel doesnt have 1000 people one one server so even they wouldnt need it
You sure? 40 - 60 active Players, Car Plugin that use Armor Stands, amusement park stuff that takes like 100 armorstands for 1 ride, and then make such thing
I believe a minecraft server is capable of using more than one core right?
I'll look into this, but currently to get the rhythms and everything right I'm using Thread.sleep (ik, it's bad), I can't think of a way to get concurrent players without ruining rhythm, do you have any ideas?
Any minecraft related stuff (i.e moving armour stands etc) HAS TO BE on the main thread
so either way you would have to wait for main thread to catchup
well for example when we first claim the town we go into the center type lets say /town claimnearby 150, and it will take the nearest 150 chunks around the player, process them (which means, save data to file, save data to sql database, get the center of all plots and add the Townblock, modify a bunch of caches and push the changes to files)
ffs sorry for the ping
I hate the reply system
I mean server thread would obviously fix the major rythm problem but I guess you could try having all that logic executed on a scheduled single thread executor
using the runTaskTimerAsync would definitely lead to some unsynced issues
or "rythm ruining issues"
here's the code conclure
not sure if you saw it
I recently made a factions plugin which needed a chunk claiming system. I used a separate thread to calculate chunk neighbours etc but even then it was fully necessary
spacedash and RedstoneEvents is a Map<K,List<V[]>> essentially?
from my own experience from using rollercoaster plugins and working on them using another thread is better
and you wanted the summed length of each list?
i want the summed length of each array within each list
yea but also database intense stuff, that loads lots of information from database would be great in a extra thread. for example Invoices, once we oben the Invoice menu for lets say the Police it needs to load 1000+ Invoices from the Database, (even tho they are not displayed at the same time, it loads the first 100, once the player reaches the end of the 100 invoices aka gets to the last page, it starts to load the next 100) but we are experiencing serverwide tps drops if multiple players open the invoice system at the same time, that is caused by a design flaw but also because 14 plugins work on the main thread and do like 100 different tasks per like 10 secs
hmm yeah that should be done async altho you should probably implement a cache mechanism here
Is there any documentation about how the ip-foward packet works with BungeeCord? Trying to get TyphoonLimbo to work with BungeeCord but I can't seem to figure out the packet.
Hello good night, could someone recommend me a good blinder? That it is compatible with bungeecord, I couldn't use ProGuard
@solemn shoal first of all switch to a ConcurrentHashMap<Long, CopyOnWriteArrayList<Integer[]>> for thread safety.
or well you could use a lock I guess
might be easier that way yeah
i tried using a lock as you can see in the commented out code below what i linked, still threw that error
and you only use RedstoneEvents there?
yep
(like nowhere else)
and in another thing but there it runs sync
help please ;-;
i check if args aren't set, by having an if statement with args.length() == 0?
im just confused
class RuntimeStore {
static final Lock lock = new ReentrantLock();
public static final HashMap<Long, ArrayList<Integer[]>> RedstoneEvents = new HashMap<>();
public static int computeTotalArrayLength() {
int result;
lock.lock();
try {
result = RedstoneEvents.values().stream().mapToInt(ArrayList::size).sum();
} finally {
lock.unlock();
}
return result;
}
}
``` @solemn shoal maybe try this
then call the method instead
well i just implemented the thing with the concurrent hashmap
uh undo that
well it seems to work
the snippet I sent you should be more perfomant
CopyOnWriteArrayList and ConcurrentHashMap are slower compared to the non thread safe collections
wouldnt that lock the server until its finished?
yes but ConcurrentHashMap also do that
right.
it locks to ensure thread safety when mutating
copy on write arraylist provides copies of itself when u want to mutate, then the changes of the copies gets reflected to the list
right
so yeah I mean choose which one you want but yeah I have spoken I guess
i mean the version with copy on write arraylists doesnt seem to throw errors
i guess ill see which one is faster
yeah thats the gist of copyonwritearraylist
every change is just done on a copy of the original list
but then that change is safely reflected to the original list
alrighty
since that call is being made on every tick
the former allows the runtasktimerasync to do compute concurrently
is player#openInventory always super slow?
Is spigot for bedrock?
No
Depends on your definition of slow
I'm back again ! One little thing, I changed the default world to A. It generated nether and end for A. However, for the world that I want to delete and recreate (let say B), the nether and the end are those of the default world A. Is there a way I can have nether and end for B and only for B ?
10-20+ ms
doesn't take that long for me
Hmm I mean could be ping also and the client
can someone tell me what is causing this error?
Could anybody direct me to a bedrock plug-in that allows for custom generation and structures?
idk I don't have bedrock
Altho yes itβs slightly slow, well in fact you could argue for that the entire spigot api is slow because of the delegation it goes through thus more bytecode instructions
You have to give it a List<Integer> and a String
But itβs negligibly
is it not allowed to have arguements?
You have a constructor but you're not supplying arguments
so i know its possible to WRITE to a file, but is it possible to edit specifically one line? all of the java resources i see only write to the file (i think)
You can, you're just not giving them.
Working on a gui lib and just did the timings because it constantly was 20+ ms and noticed it all came down to player#openInv
uh lol
where should I be supplying them, exactly?
MOB(list, string)
On that line... when you define MOB...
An Enum is all static, you have to supply everything when you make it
It's like doing YourEnum MOB = new YourEnum(list, string)
only enums take out the boilerplate of that
did u use the former or latter?
What's the 1.17 code to make this work?
import net.minecraft.server.v1_16_R3.PacketPlayOutOpenBook;
What are you trying to do spacedash?
thats the latter one
π
im trying to monitor redstone events as a bossbar
use the former one then π€£ spacedash
Which line generated the error though?
fun
the nms versions are gone in 1.17 spigot
uses mojang mappings now
Doesn't it only use Mojang Mappings if you explicitly tell it to
uh yeah
Otherwise it's obfuscated, right?
yup
do u use RedstoneEvents somewhere else?
Easier to use, a pain to setup π

Well, itβs a concurrent error.