#help-development
1 messages · Page 276 of 1
as I said
go here
click here
It's under BuildTools
I'm using Maven rn so I can't show you
go into InteilJ Preferences
Select Gradle
you should be able to change it there
@frail gale
here I can only change the gradle JVM Version and not the gradle version
Strange
in the site there's something for a gradle-properties file but I don't where I'll need to put this file
that's why I hate Gradle
Ask there
Thanks I'll ask right now
Tried my best ¯_(ツ)_/¯
bruh I'll need to wait 10 minutes
I still have nightmares when I was setting the Gradle in my Forge mod
Rip
not only that I was setting it in Eclipse with Notepad++ xD
😂
also I saw you're using Mac
Yup
I have Notepad-- on my Mac xD
sucks sometimes
-- Lmfao
yes haha
Use VScode or Atom
fair
My macOS is Hackintosh
I have IntelliJ Idea on my Windows and on my Mac
imagine not using linux
I don't use
But I have been thinking on triple booting my computer
triple booting lol
What version of registerNewObjective is not depreciated? I am using the one that seems to not be depreciated in the docs, but I am still being told its depreciated
last time I checked, ubuntu was linux
Does anyone know how I can get all chunks inside the red border ?
Pretty sure that's just the chunks around your own
bruh moment
You can't use fn because the || would never cast it
ye ik
me going from a recursive design to a loop
im already regretting
scope is also sad
where does the red thing even come from?
you cannot use pattern matching if you do "||"
nahhhhh impossible
because "instanceof" could be false, but the second term could be true
F3 + G
so you cannot be sure that "crawl" is instanceof FunctionNode
okay and what does it show? the border of the "next" chunks?
yes
You could easily calculate that with some tiny math
Just loop a 1 chunk radius around the player
get all blocks in a 32x32 area, no?
exactly
getChunk().getX()-1
then +1
and same for Z
then turn it into a boundingbox
Ok thanks, I will try to do it
ty
@mighty pier
Can anyone help me with POM?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
math isn't mathing
update intellij
this drives me crazy, not sure how the other guy sees himself as invisible
is this packet sent to multiple players via sendPacket?
cause i'm out of things
Fixed it by making it to TeamColor instead
Moment of truth
That try catch is useless
nesting if statements
im ashamed
i'm working on it lol @mighty pier
nothing to work on
if you wanna have multiple methods for doing this go ahead
?
how the heck is this possible?
is there any way to serialize itemstack into byte array?
For some reason it's not catching the exception though
is there a TeamColor.RED?
Yes
did you enter RE or RED
It's meant to say invalid team specified
RE on purpose
Instead of it spitting an error, It's meant to say Invalid team specified
well you can't, it will only work if you write red
why are you doing unnessecary stuff?
valueOf() takes the exact id not abbreviations
looks like tabcompletion
yep that try catch is useless
anyone?
the assignTeam() was originally embedded inside the command
but instead I want to make it as a public method
so when the gamemode starts
it will check if any players do not currently have a team
and if they don't, assign them a random one
which I have written here
fixed it lol
Soz, I'm a little stupid sometimes
and my Main class is clustered
I'm trying to split everything into different classes
public PacketPlayOutEntityDestroy(int var0) {
this.a = var0;
}
hm
i am going mad
it says that the constructor is wrong while its actually as true as it could be
whats wrong here?
I think i did an oopsie when setting up NMS
I get shit like java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component
what mightve went wrong?
youre not reobfuscating your plugin at build time
if you use maven use specialsource
im on gradle
if you use gradle move to paperweight userdev
at runtime that class will be like net/minecraft/a$b or some shit like that
@chrome beacon i have now the host announced with the virus, i hope. this server will removed from system 🙂
read the error
ah nvm, I can only run teleport on the main thread
got it
Bukkit.getScheduler().runTask(plugin, new Runnable() {
public void run() {
player.teleport(location);
}
});
why new runnable and not a lambda
hm
thats not an answer
I meant "hm" in a "ooo good point" tone
thanks :P
Right
Small issue
I get teleported to the correct world, wrong coordinates
Output:
Lol
yes.
You're probably reading the config wrong
those arent doubles, it looks like you''re storing them as strings
Remove the ""
ig TeamManager#hasTeam and #getTeam are both checking a map?
Correct
Any known better plugin /sethome, warps. i hate Essentials xD
I'll simplify the plugin before releasing
for the time being I'm doing deadass basic things
check if player has team
if yes
get players' team
just call getTeam null check it and decide
aight
its calling get twice internally now
Why dont use a config section?
In future I'll be adding more maps
and I want to just simply add it in the config
Also
Each map has a different spawn
Smth like:
Words: # Section name
world-1: # Key 1
x: -100
y: 20
z: 100
world-2: # Key 2
x: 100
y: 20
z: -100
Ohhh you mean like that
I mean yeah I could
I have nothing else in my config so I don't need to, but in future I definitely will
So then you can just get the section "Worlds", loop over each key
You can also, make a custom object for them, using ConfigurationSerializable
# Maps:
Canyon:
RedSpawn: # 242 75 -100
X: 242
Y: 75
Z: -100
YellowSpawn:
X: 0
Y: 64
Z: 0
GreenSpawn:
X: 0
Y: 64
Z: 0
BlueSpawn:
X: 0
Y: 64
Z: 0
I've joined Red Team
Attempts to teleport me
Print SelectedWorld
You're making an anni plugin?
It teleports me to the correct world
yepity
Haha
Just 0, 0, 0 coords
All the current ones are either dogshit or outdated
It's not that hard in theory though, is it?
Nope
Load world
Minigames aren't hard
What's hard is creating a configurable minigame
Yup
Not hard but tedious
Hey, how can i create a Book, that isn't signed but has text prewritten in it?
Since you need to make sure the user doesn't do anything stupid
Make sure it's reading frm the config properly
I'll print out the coordinates
Also ever played guildcraft anni?
Nope, Only CosmicCraft anni
It was such a fun gamemode
thought I'd recreate it and put it on my own server
How profitable is a mc server
An old server I developed on earned 1000$ in 1 month
It's not really profitable ig, but it's a decent side-hustle if you have the skills already
You currently have a server?
In the midst of making one
The old one I worked in shutdown due to staff inactivity and the owner having a busy life
Recently I've revisited the idea
got a VPS from Oracle for free, 24GB RAM and 4 Cores
thought why not do it again
¯_(ツ)_/¯
HOW
As of now, Im making a Towny && Anni server
guys how can i sort string like this
max,john,jack,emily
to array String like this
max
john
jack
emily
Only thing though it requires a credit/debit card for user verification so that people don't abuse their service
🥧 i love pie
split
I'd imagine you'd do something like array.split(",")
yeah thanks
Arrays.stream(input.split("/s*,/s*")).collect(Collectors.joinin("\n")) or smth
is anyone aware why IJ doesnt respect org.gradle.jvmargs of gradle?
it just fills my entire ram
Code delet
Ah
i wouldnt respect gradle either
Did you print selectedworld?
As I said, it was Canyon
It was correct since it teleports me to the right world
I'll try it anyway
Aaaaannnnnnd?
How can i get all item icons as png as they appear in the gui?
Including blocks.
Actually No, I did already
i believe its client sided and you cant
bruh
Issue is it's getting values 0,0,0 from config
?paste your code
Lemme see it all
bruh
@gilded knot Don’t get the config values before onEnable
ah
Aight
and use a logger instead of the consolesender
alright
noted
mismatched api/ server version?
Update the x,y,z each time you choos ea new world @gilded knot
aight
I’ve seen wrose
@gilded knot that's gonna get very messy very fast
As I said, I'm in the middle of splitting it into classes and making the code better
That'll work
works 👌
Problem was loading the x, y, z outside any methods
yep
before the plugin was enabled
Meaning it loaded it as the plugin instance was constructed
mhm
What would be the easiest way to detect if the server version my plugin is running on is > 1.18.3 ?
So 1.19 and above
some string splitting and parsing
public static final int MC_VERSION = Integer.parseInt(Bukkit.getServer().getClass().getPackage().getName().split("\.")[3].split("_")[1]);
Check if MC_VERSION is >= 19
thanks!
That's just for the major version not the minor
Yeah that's fine, I only need to know if it's at least 1.19
smh now i get java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_19_R2/entity/CraftPlayer
oh shit
nvm im on 1.19.2 😂
how do I fix the Cannot get plugin for class from a static initializer error?
yes
Just use the keyword this
you shouldn't be doing stuff outside onLoad or onEnable in your main class
attack, right-click, right-click at block I assume
interact could also be left click
How do I get the dropped items after a Blockbreak event
Like if a user breaks an iron ore
How would I get the iron ore entity
afaik you can't, if you want to edit the drop you need to do BlockBreakEvent#getBlock#getDrops(ItemStack item)
the itemstack pass through keeps fortune and other modifiers
this is what I have(in theory)
I'll try that out
than you'd need to cancel the actual drop and drop your modified version
you can do this with
World#dropItemNaturally
so the itemstack would be the tool the player used?
yes
I think he wants dropped items from block break? I'm assuming
can you get a cause with BlockDropItem Event?
Its always pretty accurate for me
it does a good job taking into account fortune etc
then NMS is the other option :P for editing block drops
Im reading data from a zipfile in to ways, while one works and the other doesn't but I dont know why:
1(doesnt work): ```java
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream("./file.zip")));
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ZipEntry zipEntry = null;
while ((zipEntry=zis.getNextEntry()) != null){
byte[] buffer = new byte[1024];
for (int read = 0; (read = zis.read(buffer, 0, buffer.length)) > 0;){
bOut.write(buffer, 0, buffer.length);
}
zis.closeEntry();
System.out.println(bOut.toString(StandardCharsets.UTF_8));
}
zis.close();
2(works): ```java
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream("./file.zip")));
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ZipEntry zipEntry = null;
while ((zipEntry=zis.getNextEntry()) != null){
byte[] buffer = new byte[1024];
for (int read = 0; (read = zis.read(buffer, 0, buffer.length)) > 0;){
bOut.write(buffer, 0, read);
}
zis.closeEntry();
System.out.println(bOut.toString(StandardCharsets.UTF_8));
}
zis.close();
I use the actual read length in the 2. one, but that shouldnt affect it. I also tried just using Strings, but completely messes up everything. I think that there is a problem with the length, but I dont know why
or you could reimplment fortune yourself
with silk touch etc than do the calculations yourself
I think the bukkit method does a good job and save a lot of time
^
Aight
got it
Wait how do I get the ItemStack
I assume I just make another ItemStack
getDrops returns a collection
Why not ise the blockdropevent?
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
@gilded knot
NamespacedKey dataKey = new NamespacedKey(plugin, "backpackData");
Player player = (Player) event.getPlayer();
ItemStack hand = player.getInventory().getItemInMainHand();
if(hand.getType() == Material.AIR) {
return;
}
String id = hand.getItemMeta().getPersistentDataContainer().get(dataKey, PersistentDataType.STRING);
if(id == null) {
return;
}
plugin.getBackpackManager().saveBackpackData(id, event.getInventory().getContents());
log(event.getInventory().getContents());
log("Zapisano");
}```
i'm getting this error(this object is content of my inv)
at me.placek.backpacks.Backpacks.log(Backpacks.java:37) ~[backpacks.jar:?]
at me.placek.backpacks.listener.InventoryCloseListener.onEvent(InventoryCloseListener.java:36) ~[backpacks.jar:?]```
What is line 36
log(event.getInventory().getContents());
i'm checking stuff
why contnet of my closed inventory is null?
getsContents is null ig
does any1 here know how i can hide a players nametag only to specific players in a way that does not stop me from using the "ghost" functionality from scoreboard teams
probably gonna have to be with packets somehow
Don't know how your log method is implemented, but probably some item of array is null
if(backpackData.getConfig().get(id) == null) {
return new ItemStack[0];
}
return ((ArrayList<ItemStack>) backpackData.getConfig().get(id)).toArray(new ItemStack[0]);
}```
So now here's the next one
at me.placek.backpacks.backpack.BackpackManager.getBackpackData(BackpackManager.java:35) ~[backpacks.jar:?]
at me.placek.backpacks.listener.PlayerInteractListener.onEvent(PlayerInteractListener.java:45) ~[backpacks.jar:?]
at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:37) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-260]```
How can i get list of itemStacks?
?whereami
- null
- ==: org.bukkit.inventory.ItemStack
v: 3120
type: SPRUCE_LEAVES
- null
- null
- null
- null
- null
- null
- null```
is this an itemStack or list?
so...
and that's good
Google about spigot serialization
And see how to get custom serialization from config
i literally just did that
Your code doesn't look like that tbh
so how could i do that thing?
Collections.emptyList() if you dont intend to mutate it
guys...
Thank you all for helping me
Thank you very much. You all changed my life prespecitve
?
Trough you are serb nvm
or save it async and lock it
Map<UUID, ItemStack[]> tho
this whole code smells like the whole codedred tutorial i once did
What about crashes 😬 /s
wondering if the os actually synchronizes write access to a file
It’s sarcastic
tone indicators
I’ve used /s and jk
are there any tools that can be used to inspect packets that clients receive?
I mean the clientbound packets?
Protocollib comes to mind
kinda want something that displays packets as the client is processing them
cuz im not sure its receiving packets im sending
Get a mod
ya. which 😄
Are you sure you're sending it in thebright format?
i mean im using protocol lib plus a wrapper class for that packet
What packet are you sending?
PacketType.Play.Server.SCOREBOARD_TEAM
I've seen a video long time ago where guy make some kind of proxy in netty so he seen all incoming and outcoming packets for certain connection
I googled and found this thing https://github.com/wvffle/minecraft-packet-debugger
maybe im just not doing the right thing tbh. im tryna hide the player nametag to specific players
but had no luck in the last 6 hours of trying -.-
tf
Then intercept the packet
And see what's normal
And how the packet is supposed to look
Understand @tall dragon ?
yea kinda let me go try that.
https://youtu.be/zDj3IBaIY7w this is the video i talk about but propably minecrsft-packet-debbuger would be better
● Visit my website: http://www.CosmosMC.net
● Join my server: playmc.cc
● Checkout Netty here: http://netty.io/
● Netty Examples and Documentation: https://github.com/netty/netty
● Download the code here: https://github.com/sgtcaze/Tutorial/blob/master/Resources/PacketAccessor.java
Connect with my social media:
● Twitter: http://www.twitter.co...
Basically to figure what the the packet is supposed to look like. Eg. Lets say you wanna see how to remove an entity for a single player only but don't know what the packet is supposed to look like, what you can do is call entity.remove() using spigot and listen for the packet to remove entities being sent to players and look at how they're written
right.
well, does anything happen that would throw an exception?
player does not exist
?
Like the server gets the map full of players
1 of them decides to leave
would it throw an error or no?
not unless u try to access a field or method from Player id imagine
just the player object itself shouldnt cause an issue
but if somewhere in removePlayer u did like player.doSomething() then yes
wait
no
hm?
im thinking if u literally passed null or if Player was null lolnvm
ah aight
nothing should happen
mhm
ive now done that. but i dont rlly know what to look for tbh.
one weird thing is that the packet specifies that its for mc version 1.18
which i am not running
Do u use ij debugger?
yes
Whoever made the command made it tryandsee for whatever reason!
And they put the <> around it so it doesn't embed
java.util.ConcurrentModificationException: null
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?]
at java.util.HashMap$KeyIterator.next(HashMap.java:1620) ~[?:?]
at net.minecraft.nbt.NBTTagCompound.a(SourceFile:163) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.nbt.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:280) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.nbt.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:248) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.world.level.chunk.storage.RegionFileCache.a(RegionFileCache.java:141) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.world.level.chunk.storage.IOWorker.a(SourceFile:174) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.world.level.chunk.storage.IOWorker.a(SourceFile:164) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.util.thread.PairedQueue$b.run(SourceFile:59) [spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.util.thread.ThreadedMailbox.h(SourceFile:91) [spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.util.thread.ThreadedMailbox.a(SourceFile:146) [spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.util.thread.ThreadedMailbox.run(SourceFile:102) [spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
[00:21:08] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 6219ms or 124 ticks behind
[00:22:13] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 5544ms or 110 tick
?paste
ig you are trying to remove item from map while iterating over it
Yeah well have a look at the packet
you can't do that with for loop
my English is not good
can you explain in detail?
@tall dragon 1.8?
i literally can't explain better then i already did
I'll help u ina bit
use some translator
yeaaa
you cant remove item from map when doing for over it
already 😄
either use iterator or Map#removeIf
yea @humble tulip its defo receiving my packet now. but its still not acting how i want it to
right now the other client just turns the name white
instead of not displaying it
ConcurrentHashMap anyone?
But in this case, I don't think any of the solutions apply
how do I fix the Cannot get plugin for class ____ from a static initializer error?
@tall dragon lemme see ur code
Bro
I told you already
it didn't work
I'm not downloading your file
Collection<ItemStack> drops = this.populateLoot(new Random(), lootContext); you said change PaperLuck to this
also this button exists
bit hard to show code like that here
this time i uploaded it as a file so it didnt take up the whole screen
but i have noticed something is wrong @humble tulip
in the packet sent by the server the nametagvisibility was stored in field "e" while in mine its stored in field "b"
thats probably the issue
the wrapper class i got probably not for the right version or something
yea im going to try that
@heady iris send the entire class
@heady iris https://paste.md-5.net/emofuvicoq.java
pain
@humble tulip omg it works
👍 great 🙂
now i only need to figure out a way to cleanly revert it.
if i were to use the spigot api to re-set the player's team woulnt i just sent the correct packet to change it back?
Just change the visibility to always
Not necessarily
It might try to be efficient by checking if the visibility is the same as what you're trying to to set it to and then do nothing
na i mean just re-adding the player to the scoreboard team
Inb4 md_5 shows up to complain about people not using the scoreboard API
yea unfortunately the scoreboard api is equal to hot garbage
Well he isn't wrong. You don't need packets with scoreboards. Anything the packets can do, the api can do
ur capping
tell me how to show ghost of invisable players and at the same time hide name tags of opposing players only when they are invisable.
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
Implement it in the API then
You would do it the exact same way as with packets
As md5 has said, if the API is missing something try to suggest it instead of using nms and packets.
You set the teams
wont be able to hide the nametag of a specific player then
if i change the nametag visibility it would change it for everyone in the team
I believe teams are bound to the scoreboard
So you create a new scoreboard for that player and change the teams
?jd-s Let me check that real quick
then that player wont be able to see the ghost of invisable teammates
as the player can only be part of one team
You can have per player scoreboards that contain per player teams
same issue
That's effectivly doing the same as packets
nah cuz the players will all have their own team then
You can do that with the api
which will cause this issue
No
If that would cause the issue then packets won't work either
Since the api would use the exact same packets in the same way
Yeah with different scoreboards per player you can target a specific players visible teams
Just like raw packets do
Different players can see diferent teams by being on different scoreboards
By see I mean the information sent to the client
i mean i tried having a scoreboard per player and was never able to see invisable people
Which is the same as the raw packets would do
You're going to need to set everyones team in every scoreboard
and then players can just suddenly see invisable people that are not in their team?
You can make them look like they're in the same team while dead just like you would with packets
All you would have to do is grab the dead players scoreboard and set the teams of every dead player to the same one
I'll get some sleep now. Hopefully you can figure it out. If not I can help tomorrow
it shoulnt happen when players are dead tho. i have 4 teams and those 4 teams should be able to see their allies in invisibility at all times
alright
does pdc have a way to store string arrays?
not by default
Natively? I'm not sure, but you can add your own types
but this guy made a bunch of extra types. string arrays among them https://github.com/JEFF-Media-GbR/MorePersistentDataTypes
Alex!!!!
oh cool thanks
dont open an inventory on inventory close event
either cancel the event or open the inv 1 tick later
inventroycloseevent is called before the inventroy is closed
ah it's not cancellable
ok so i should just open it 1 tick later
ok so i haven't gotten into timing and stuff so how would i do that
?scheduling
using wait()
nope
https://paste.md-5.net/siqayawiyu.cs - Please i need a hand i couldnt be able to cancel the second hand usage
@sterile token did you do what i told in dms?
yes
The message is print tho
Are you already on pc bro?
ok
I debug everything
I want to only be able to use the off hand:
- build: false, member: true, permission: false
- build: true, member: true, permission: true
- build: false, member: true, permission: true
those are the three casees?
Other posibilities must be cancelled
Yeah
permission, why? because if you have the region bypass, you can do whatever you want
Pleae let me know
I have to leave in less than 5m
it matter
not in the 3 cases above
so if build : true, member: true, permission: false
what happens
I mean wait:
If you have the build: true OR permission: true AND member: true
cancel
this conflicts with
this
oh ok
Yeah because you cant use OFF HAND unless you are not in the mode or have bypass permission
if (member && (build || permission)) return;
setCancelled(member && (build || permission)); ?
Hi guys, I have given a chunk and now I want to get the coordinates of this chunk (Or the coordinates of a block in this chunk).
How to do this?
?jd-s docs have that info. Or at least they should
@EventHandler
public void onClose(InventoryCloseEvent e) {
if (!e.getInventory().equals(BedwarsStorage.pmenustorage.get(e.getPlayer()))) return;
e.getPlayer().openInventory(BedwarsStorage.pmenustorage.get(e.getPlayer()));
}
Using this listener to cancel closing an inventory, it works once and then both of the listeners I'm using don't work after reopening the inventory. The inventory initially opened is the same one opened here (BedwarsStorage.pmenustorage.get(e.getPlayer())). It's from a <Player, Inventory> Hashmap
?paste
how do you open the inventory
this will always open a new inventory
is it about the player's inventory?
or some custom GUI?
It’s a GUI, a command creates an inventory and stores it in a hashmap with the player as the key, and this gets that inventory with using the player from the InventoryClosEvent
well then obviously your hashmap does not contain this gui inv
Anyone knows how can i have multiline output in github workflow ?
I tried
- name: Generate SHA checksum
id: checksum
run: | # EOF not working as delimiter
cd target/
CHECKSUM=`sha256sum File.jar`
echo $CHECKSUM > ../checksum.txt
echo "checksum<<EOF" >> $GITHUB_OUTPUT
echo "### SHA256 checksum" >> $GITHUB_OUTPUT
echo "`\`\`\" >> $GITHUB_OUTPUT
echo "$CHECKSUM" >> $GITHUB_OUTPUT
echo "`\`\`\" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
But it just throws Invalid value. Matching delimiter not found 'EOF'
?paste your full yaml pls
oh and please use $(...) instead of ```
...
https://paste.md-5.net/koxopekimi.sql testing this rn
that actually looks okay to me
can you print out the contents of the script you generated?
What script ?
the thing that the "run: " thing generates
I don't know how github actions work, but I'm pretty sure that it saves the whole thing as a script inside /tmp of sth
Im actually not sure how to do that 😄
escaping \ ig
do you just wanna print the checksum?
\ is for escaping "`"
yeah but what are you going to do with $CHECKSUM?
aren't you trying to print it?
no, im trying to put it in release notes
if so you should do
echo $CHECKSUM
that is why im trying to do markdown format
aren't you missing an "echo" or "print" statement then?
for example:
echo "asd"
this would print "asd".
This however:
"asd"
would try to execute "asd"
you obviously don't wanna "execute" the checksum, but simply print it out, right?
do you got a link to your repo, so I could fork it and try myself?
MESSAGE=$(cat << EOF
### SHA256 checksum
`\`\`\
$CHECKSUM
`\`\`\
EOF
)
i want this, to simply put something like this inside of MESSAGE var
this is my other repo, but every release i manually add new lines
so i want to "fix" it
😄
https://github.com/Goksi/PteroBot This is one with nearly same workflow which doesn't work
what do I have to do to make github run that script?
I never used github actions before
okay so I just fork it, and then push a change with commit message "v1.2.3" (or similar) right?
aaaaah so it's just a new branch
probably 😄
okay idk sorry I have no clue how to help you with this lmao
just for fun, try to do sth like this
MESSAGE=$(echo testing stuff)
does it work now?
let me try that
this way we can check what exactly the problem is
Do you guys know what the latest solution to serializing a bukkit ItemStack is? Years ago we just wrote the bytes a BukkitObjectOutputStream yielded as base64, but that cannot possibly be the best solution. Any other ideas?
huh
weird
anyway, so you got the full thing working now?
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings according to this #help-development message approach should work
serializing to what?
a string?
yeah, just dont have new lines
weird. anyway, glad I could help for once lmao
usually I just ask for ?pastes here haha
yeah, thanks alex 😛
Well, to be concrete, let's just say serializing into a database. A relational type would be preferred, as I could of course just dump some JSON into a document oriented DB.
Looks like the only truly version independent way will be to store the NBT value. I think the BukkitObjectOutputStream may break when changing the server version.
if your storing it in json you could technically follow the serialisation format
I really think that's the most sane solution, yes. Just store binary JSON as a blob in SQL. All I have to do then is to just write a small lib to version-independently r/w the root NBT tag. Shouldn't be hard.
has anyone made a guide to updating resource packs to the 1.19.3 format?
isnt it just the usual change the version to 1.19.3s pack format version and maybe redo Vex since it has a new model
then what's wrong with the builtin serialize() method?
it turns any ItemStack into a byte[]
did they actually change anything other than the version num in pack.mcmeta
for everything else I use this class https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ItemSerializer.java
e.g. when I want it to be base64 or sth
but in 99 % of cases, you don't need/don't want base64
I feel like it could break when you got items of an older version and try to feed the byte[] to the API of a newer version. I think I should actually try that. I'd just like to have a failsafe way of reading and storing items, no need to crash if the ItemStack ever gets new properties or some properties aren't available at the current version.
Yep, I do not want it, you're right, xD. I want a blob, so byte[] would be perfect.
How about jsonfy it
json is pretty solid to storing datas
Or if you want to optimize at memory encoded it with rawdata
Yeah, right, but that only delegates the issue. I still need a reader (which converts all NBT to JSON) and a writer, that converts JSON to the NBT tree. I do not want to rely on sketchy NMS invocations for that, like the #toString(). It jsonifys now, but who knows for how long, and if it'll be that way forever.
Just write the reader and encoder on your own ?
So I guess I'll navigate the NBT tree both ways and use BSON for a blob-like result.
I guess the NBT-API is pretty stable. And they're forced to keep keys compatible, as you could otherwise throw your world saves away every time there's a change.
Depends on whether we're actually talking about the same thing, xD.
But I do have a pretty nice reflection library sitting around here, I think it's time to make use of it.
Using nms make it version independence isnt it ?
using nms create version dependence
just use reflection and interfaces with multiple maven modules
and its easy to get stuff done
NMS doesn't have docs
maven modules aren't new
reflection is basic java
here is an example
best I can do
Hmmm i mean using it for version dependent
what is your native language?
ye ye I somewhat speak spanish though
which is why I'm wanting to know
anyways I'm not quite sure what you mean. If you want version independence with NMS use maven submodules and reflection as in my above example. If you just want one version you don't need to abstract
but keep in mind it will only ever work on that version
Well, actually yes! I bypass all of the ItemMeta-business and access the raw data as mojang stores it in the world too. I got a pretty powerful way of accessing fields, methods and classes through reflections by running predicates and scanning the environment to find something I describe in a builder-type fashion. I guess I'll have that running in no time. I can share my little lib once it's ready, if you want.
I have my 1.12.2 working on 1.16.5 server :d
with NMS not abstracted?
that is very very very very very very very very unlikely
Yeh i think so
But it work^
There is no way since the imports are version specific
you should be getting ClassDefNotFound errors
especially if you use the CraftBukkit classes that interact with NMS
As I've said, I think we're kinda talking about different things here, lol.
For some reason it still working
he is talking about NMS?
Only way to really not encounter errors between versions is only if nothing changed with the class except the version specific import which you can handle easily with reflection. Otherwise you need version specific classes to not encounter problems
^ this is just a fact so what you claim to have is impossible
I'm not at all sure tbh, as they make it all seem "so easy and quick", while a proper implementation on top of NMS actually takes quite some elbow grease. I think it's not NMS then.
could just be some API maybe that abstracts the NMS for them?
in that case version independence is achievable as the API does the hard work
Or handles the hard work of the implementation specific classes without it being noticable
Or both
🤷🏽♂️ who knows
Anyways, have tires to change out lol
Be back in like an hour. Have 8 of them to change on a trailer
I think I'ma read lol I don't feel like coding lowkey. I took 3 days off and really procrastinating getting back into this project
Lol
I mean I do want this $65 its just. I got this brand new book
Ouch, reminds me of my weeks-long phase of almost not writing a single line of code.
I usually code atleast 4 or 5 hours a day
so I need this little break tbh
reminds me of sth too
I code even more, xD. But I also constantly burn myself out.
after I finish this commission I'ma take a small break and go work on a personal project
I'm going to teach an AI to play minecraft 🥳 so fun
https://hastebin.com/betuweqeni.swift
Really love this way of handling reflect, lol
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
AI, another topic I never got into, xD. It just seems way too abstract for my liking, :(. But I'm happy you find some joy in doing so! :)
My friend does a ton of Machine Learning so we will be co-oping on the project. Mainly I'll be implementing client protocol for the AI to keep in touch with
My plan is to make a semi-lightweight client for training sessions and give it protocol to easily interact with
I'd love to create my own neural net from scratch and really learn backwards propagation and such from the ground up, just using a lib without knowing it's inner workings would really depress me. But that's like one more projects to my thousands of projects, so I'll have to pass for now :(.
That sounds amazing tho, ngl, reminds me of the time I tried to write a simple bot to automate getting stuff on a server for me, xD
Unless you want to learn and do Linear Algebra, just stick to ignorance is bliss
I do, I love math, :).
I understand most of how it works already, I just haven't gotten around to implementing it
🧠 I would never even bother learning math by myself lol thats why I just stick to the libs :P
It's basically a huge ass function with weighted nodes which you train on huge amounts of data to brute-force the thousands of unknowns.
I love math, but I also have so many other interests, :-:
Like, I just got this stupid idea of version-independently persist item-stacks, got out my old reflection-lib and got an adrenaline rush from the idea of actually making this work like I imagined it, lol. This has to seem so weird to people who don't write code or love to get lost in the world of logic and abstraction, xD.
the first bot I'm going to train to survive the first minecraft night lol I wonder how long before it realizes it can just dig a whole it was makes me curious
I understand that, really do.
gotta set priorities
oh boi, :,D.
however, CS is so broad and profitable there is no point
I love statistics too, but I really don't miss it, looking back at school. Maybe that's just due to the fact that my teacher really did a poor ass job. They really lost me at the gaussian distribution, until I learned all of that stuff on my own for the exam and actually managed to understand everything we had to know.
Yeah, well... the point is interest! :)
My Stats teacher, is really passionate about stats
my stats teacher the best way to explain that guy is the Least NPC human on earth. He is so cool and is super passionate about everything he teaches
lucky you, haha
I'm still in basic math stuff rn though. I've only reached Pre-Calc
such is being in highschool though
Is there a tool to play the minecraft sounds on specific pitch instead stay changing the pitch and recompiling?
pitch is between 0 and 1 afaik
yeah, that's not my question
make it a command and add an arg for pitch?
use a config file
or use a command
is not a bad idea
config is better though since it'd be saved to disk
command you'd have to execute every time the server starts
Could be better if there exists a tool, but if not, is a good way
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
depends if its needed perm or just temporarily
thought this meant counter strike for a second
nah fuck CSGO
Wtf i never said csgo just cs
I suck at video games
i couldve meant CS source for all u knnow
do people even play other counter strike games
yeah
ok I got sidetracked I have a book to read
Is there actually a BSON lib available for Java which is not already old enough to die soon? lol
Seems like they're all inside of this huge mongodb dependency...
Maybe I'll use json after all.
Hey, I'm making a custom pathfindergoal for a custom entity, it's basically a modified PathfinderGoalRandomLookaround
I'm getting this problem where one of the methods I need is called "do" which is a keyword, hence I cannot compile the code.
¿What could I do in this case?
what is the error on compile
Kits Pvp Server minehut
this is decompiled code from craftbukkit
?services dont mind this
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
CraftBukkit actually compiled with a function named do?
Do.... Sucks : 👏
Wow, that sucks! In Kotlin you could use backticks to escape keywords, Java doesn't offer this ability I think...
Overriding methods via reflection is going to be hard tho, I've never done that. Is probably some weird black magic.
There are proxies, but idk if that could solve the issue.
It is on net.minecraft.world.entity.Entity from Craftbukkit-remapped.
Yeah, for the JVM "do" is a valid method name so no issues when calling it but no way to call if from code.
and aw is private 😢
I'll try some reflection black magic
Yeah, no, there shouldn't be a problem calling a keyword-named method. Your problem is getting past the parser, cause the tokenizer/lexer attached the token-type "keyword" to your "do", xDD.
pain
There has to be a way around this tho...
I already googled, didn't find anything useful. Just know how kotlin can easily support escaped identifiers, with keywords and even spaces in em.
maybe with class.forName
Well, you want to override this method, so you have to override it at compiletime, or you're in for a ride
No just access it
The e() method on pathfinderGoalRandomLookAround needs its value
is that a craftbukkit class?
yes
wtf
?nms
use mojang mappings
oh, that should be orders of magnitudes easier than reverse-engineering method names.
haven't seen it before lmao.
ty
Yep, that helps. But you still need to get around that override, if that's actually what the JVM loads this method as, lol
it will probably change it back to "do" at compile time when re-obfuscating. Should be able to get past the parser at that point I guess, let's see if the compiler complains.
But the JAR had to compile after being patched with bukkit, so they had to make it work too. Are you sure it's called do at runtime? List all fields of this class with reflect and print them out on stdout, just to make sure.
all methods*
alex's link is the right answer
@tender shard you finally made it
now put a rick roll in it
Awesome, got my nbt tree to json tree up and running, xD.
{"display":{"Lore":["hello","world"],"Name":"{\"text\":\"hi\"}"},"Enchantments":[{"lvl":3,"id":"minecraft:sharpness"},{"lvl":1,"id":"minecraft:flame"}]}
he bugged imajin to add it lol
we all did, it was needed
wdym
that link is on this discord since months
also
?switchmappings
Is there a way to disable command logging in the console? Every command is logged, and I'd like to turn it off.
you could probably use console spam fix to block it
Would anyone be able to help me figure out why player.damage(hp) doesn't work? The item and code omitted in ... does work. It just doesn't apply the damage. Hardcoding the statement player.damage(1) works however.
if (event.getItem().getItemMeta().equals(itemManager.mirror.getItemMeta())) {
Player player = event.getPlayer();
double hp = (int) (Math.random() * (0 - 20 + 1));
if (hp == 0.0) {
player.sendMessage("Lucky, Mirror took no health away");
} else {
player.sendMessage("The mirror took " + hp + " of health away.");
}
player.damage(hp);
...
}
Negative values won't take anything away. You need to use positive numbers.
omg that makes so much sense! thank you
Is it possible to make a client open a writable book ( Without them having ot have a book in thier inventory ) Via the server?
Looked into Protocollib but it doesn't open anything, I've heard it's not possible to as book writing and such is all client side now? (par the send off)
Wondering if this is true :)
the writable book is sadly fully client sided
:( so no way to get the client to open one so they can edit in it?
I've heard a way is to put one in their hand and get them to right click using protocollib but not sure
How would I be able to make players instantly respawn?
You know when players die they have the Return back to Menu or Respawn Buttons
I want it so that they instantly respawn at their spawn point
Could try caneclling the playerDeathEvent. So they technically don't die. Then you can handle the "death" differently.
You can't cancel the death event, The event runs after the player has died
Yeah just realised lol.
declaration: package: org.bukkit.entity, interface: Player
You have to catch the damage event and see if their health will be zero.
dont know if it works with writable books though
I think just call this in death event is fin ehttps://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.Spigot.html#respawn()
declaration: package: org.bukkit.entity, interface: Player, class: Spigot