#help-development
1 messages · Page 256 of 1
How much is a crap ton you think
im bringing my snowballs.
well for tridents probably somewhere around 50 depending on the server setup and everything else
One of the major issues I’ve had is I’ve coded this thing where I can convert a chunk of land into a chunk of falling blocks 5x5x5 in size and then move them around in 3D space
well, I am not exactly sure because I never load tested how many tridents could you really spawn without issues
just there is more logic to tridents then normal projectiles is all
like don't tridents go back to their owner?
only with this enchantment
with a certain enchant yea
otherwise no
I just delete them as soon as they hit an entity or the ground
ah got it
Loyalty I think
Nah riptide is the one that lets you look like palpating
then as long as you don't have that enchantment I suppose you should be fine then
Palpating
Loyalty yea
I made a plugin about this enchantment but I have no clue how it's called lol
loyalty
then I guess the next thing to do, would be to test 125 tridents being spawned
the enchantment is called loyalty
if you don't have issues you should be fine
and as long as you don't have that loyalty enchant on them lmao
Hey, i encounter the weird issue, that at some point, my Passengers i sat on an Entity get instantly ejected, did anybody else encounter this?
iam still at debugging the cause so i hope i can follow up with more informations if i get some.
I honestly didn’t know particles were entities
I thought they were their own thing
Frost said so
do you use any other plugins?
they are not
@wet breach !!
particles "do not exist"
Settle the disagreement
they are NONT entities
trying on my dev server (it's the only plugin currently.)
no
particles are not entities
they are simply a packet sent to the client "yo show some particles at X,Y,Z"
no they seem to be their own kind
!
for the server, they don't even exist
:this:
that's wrong
they aren't
I am 420% sure
Just found out the Entity i depend on dies / despawns which makes the player be ejected.
you're right
org.Bukkit.Particle is it's own class and does **not ** extend any other.
^
btw thx xxlucy, thanks to you I discovered that profile pic decorations now exist lol
nice ! 👍
pride cometh before the fall
alright so i did some more debug
[23:27:38 INFO]: =========================================================
[23:27:54 INFO]: Item Blocks are alright!
[23:27:54 INFO]: Checking Passengers!
[23:27:54 INFO]: NogitsuneZero is on the Sled!
[23:27:54 INFO]: Alive? SF: true AS: true
[23:27:54 INFO]: =========================================================
[23:27:54 INFO]: Item and Passengers are okay!
[23:27:54 INFO]: [ZeroPower] Silverfish ejected: NogitsuneZero
[23:27:54 INFO]: [ZeroPower] Silverfish ejected: Armor Stand
[23:27:54 INFO]: Item Blocks are alright!
[23:27:54 INFO]: Checking Passengers!
[23:27:54 INFO]: Alive? SF: false AS: true
[23:27:54 INFO]: ========================================================
That means, entity + player works fine for the first loop.
For some Reason in the Second Loop (2L Ticks later) the Entity i let the player sit on, despawns.
It is Invisivle and Invalnurable so i think it just despawns?
can i somehow get the reason it does despawn?
i guess no one has an idea? or do you need the code? 🤔
.isRemoved() does return true so iam sure now, the entity get's removed by the Server 🤔
omg
we would need the code but invisible invulnerable entities don't get removed automatically
i am so incredible stupid
yeah you wanna know the issue?
you removed the entity
a member of my dev server set difficulty to peaceful.... which despawns SilverFish which i abuse for my stuff right now
i feel so dump
ah yeah that's a classic
i wanna bgn my head against a wall, i just wasted a hour of debugging for that
at least make it an armorstand
because of an attached model etc. i used, the best solution for now was the silverfish 🤔
I have time travelling javascript code somehow
i did a thing ! 😄
oh what? XDS
do you know how to check if any passenger of an entity is instance of player?
i am more a python programmer, and i know how to solve this in python but not in java :(
if(entity.getPassenger() instanceof Player)
yes i know that it exists but i have multiple Passengers to carry some stuff
its deprecated in newer version afaik
because you can have more than one now
just make for loop with entity.getPassengers() and if(entity instanceof Player) return true
i have this clunky stuff, but isn't there a more efficient way?
Bukkit.getLogger().info("Checking Passengers!");
boolean player_is_on_sled = false;
for(org.bukkit.entity.Entity ent : sled_engine.getPassengers()){
if(ent instanceof Player && ((Player) ent).equals(player)){
player_is_on_sled = true;
break;
}
}
would using a filter be more efficient?
this just seems like bad design
why do you need that at all
entity.getPassengers().forEach(...
exactly
what is it for
you can just
for(entity in passengers){
if(entity is player) return true;
}
return false;
java has the in keyword? :o
its pseudo
you already kinda used it
for(org.bukkit.entity.Entity ent : sled_engine.getPassengers()) here
using kotlin is loser behavior
kotlin > java
does this improve the runtime at all? seems just like another way to do it, now that it works like intended iam trying to go efficiency a bit :D
nono, revert original
again, what are you using that check for
Alr. sorry iam a noob then ;D
breaking a Runnable if the player isn't a passenger of the sled anymore so i can kill / remove the sled.
minorly but not worth changing for
more like enchanted java
shouldn't that be as simple as simply checking if there is a passenger at all, if you put a player on it and it left there will just not be a passenger
no need to compare it against anything
i think we all know this discussion doesn't lead anywhere ;D.
There always people believing that their favorite language is the best :kek:
i've got 2 passengers on it, one armor stand and one player so i can let the armor stand carry some fancy stuff.
then check if there are less than 2 passengers
as i sit the player first sled_engine.getPassengers().get(0) should be enough, also it works, but for some reason doesn't feels right.
if you think is reliable enough i think this would be better solution, right?
I would only access it to check the count
seems like you have a hard threshold where if there's less than 2 passengers then there is no reason to have the sled
normally should be 2, so yeah i think that's the way to go, thanks!
and it saves you on checking entity types
exactly, didn't tought about that before, thanks m8 !
the fastest code is the code that doesn't exist
good advice ! :D
sled_engine.getPassengers().size() == 2 should be it then, right? :D
ah nvm i should stop asking and test myself, sorry to bother you!
yeah which means with 2 entrys it should be 2 and as normally it always should have 2 the == 2 should be enough to ensure that :D
yeah but the size gives Max Index +1 so if you have 2 entrys it gives you the 2 :D
lua >.<
:yessir:
say hello to MagmaScript where collections are -1 indexed in the memory of my dog which you shot in cold blood
I shivered at the prospect of -1 indexed arrays
mfnalex said he wanted to do a tiktok trend called "does this shotgun look loaded to you" with my dog and I think he should be in jail
python [-1] is the last element and [-2] is penultimate. think that is quite cool
just wait until you hear about how EliteScript uses base 12 for getting elements from that array and base 14 to tell you how large the array is
Yeah but it's not -1 indexed
That's just the other side of the array!
we can go further and use different bases for getting and setting elements, that would be interesting
Explain -1 indexed? Does it mean that the index of arraylists just start at -1 instead of 0?
yep
Could you imagine,
int[] array = new int[10];
for (int i = -1; i < array.length - 1; i++) {
int value = array[i];
}```

Now that sucks
if (value[-1] != null)...
ok so why does javascript's cloneNode not clone the function of my button
https://paste.md-5.net/izahijecow.cs
So basically i'm trying to make a class that just gets messages from a properties file. but it seems I keep getting errors such as the one in the file (Code and error in that link)
Can somebody help me?
you have \\ in the path
Oh my. Please don't be loading that file every single time you call the method
second you should let java handle path separators
But it is not good
Some things just work, but they are bad
The error is almost definitely this line because you're accessing index 0 without checking if there is an index 0,
p.sendMessage("" + translate.replace('&', '§').replace("{0}", args[0]));
@worldly ingot people can change stuff in the file though
That's fine... have a reload command
Do not load that file synchronously every single time
i have a backup if an error it just goes to the default one in the jar
and if the data isn't there, you should fail silently where possible or handle the error by correcting it
It's fine for Properties. It's like a Map and will return null
ya
(or if there's a default property, that first)
when I checked it gave the same error
but yeah, source of your error is this
Well there's no other array accesses in that method
And that's an AIOOBE
aioobe?
ArrayIndexOutOfBoundsException
o
Only other array access you're doing is on a newly created array of size 1
ArrayIndexInsideBoundsException
Ayeee its the Jägermeister guy
this is what I did but it gave the same error:
if (args != null) {
if (args[1] != null) {
p.sendMessage("" + translate.replace('&', '§').replace("{0}", args[0]));
}
}
the fact that it gave the error is weird
args will never be null, just empty
so replace the second check with .isEmpty?
yep and that should work
arrays don't have an isEmpty() method
its a string[]
check its length
.length != 0
if there is something in that array, even if its at index 0, it will have a length of 1
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 0
Wait I got something from 2 days ago
well you cannot do myArray[1] if it has 0 elements
you can only do myArray[1] if it's length is at least 2
3L bottle peppermint lmao
that's enough to brush your teeth at least 25 times
Yeah
maybe 27 times
That party took away 12 Liters of liquor
not with that attitude
you said length
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.
oh
Can imagine how I looked the day after the 2 party days
its not java its me being stupid
args[1] is the second element of an array, it has no length
Also had some Jägermeister lmao
args is the whole array, it does have a length
Method call expected
String[] myArray = {"a","b","c"};
myArray.length() would be 3
myArray[1] would be "b"
so myArray[someNumber] is a string
myArray is a string[]
ya ik indexes start with 0
-> indexes start at 0, length-checks start at 1
chec out this ^
without ()
.length() ?
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
oh you mean the length thing
its arr.length
no, length is not a method
if (args != null) {
if (args.length != 1) {
p.sendMessage("" + translate.replace('&', '§').replace("{0}", args[0]));
}
}
this is how I call the method:
if (sender instanceof Player) {
plugin.getMessage("clearChatCommandMessageToSendToConsole", null, args);
} else {
plugin.getMessage("clearChatCommandMessageToSendToConsole", null, null);
}
return true;
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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
do you think it is possible to offset a second passender on a Entity? 🤔
Took a look into the Entity.Class but didn't found anything regarding the position.
fun fact: I watched that movie 2 hours ago
damn
no
is it one of the client side things again? 🤔
yes 🥲
rate how sexy this is looking out of 10
some people claim to have done it using NMS 🤔 but i can't find anything regarding it so even if they actually did manage it they ofc never opened up the source :(
the server only informs clients "x is a passenger of y", it doesn't send any information about the "relative location" or anything
as i think the borders are mostly debug, like 10/10 tbh, can't htink of a way to make it better :D
ah damn i have hoped it's oterhwise, sad but maybe i find a workaround :D.
would you script me? I would script me
sorry, I only script cute dudes < 21 yrs
my time to shine :kek:
what country? 🤔
germany
same here I think
Oh you're making Scratch for Minecraft, version 3.0
Lol me aswell
my bf is 20
Oh no... who's gonna tell your bf next year?
tell? they get shot
clearly you've not heard of mfnalex
he's not black and we're not in US, he won't get shot lol
would there be a better way of doing this?
public static Map<UUID, Map<Material, List<PlayerGenerator>>> getFormatedGenerators(Player player) {
return PlayerGenerator.getPlayerGenerators().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().stream().collect(Collectors.groupingBy(generator -> generator.getGenerator().getMaterial()))));
}```
guys how can I make a plugin that will make mfnalex not racist?
Well that's certainly something
Yep
US cops are racist, not me 😦
I want to make it so every time someone shoots a target in mc mfnalex gets shocked in the nuts
Generally speaking, 3 nested collections is just an all around bad idea
What's your input, what are you doing with the output? Surely there's a better way to handle this
I thought so
Im looping each player aka uuid then looping the materials then getting the size of the list then spawning an entity on the last element of the list
the size of the list = x amount of entities
@EventHandler
public void arrowShoot(ProjectileHitEvent e){
Player p = Bukkit.getPlayer("mfnalex");
p.getWorld().spawn(p.getLocation(), LightningStrike.class);
}
Something like that
Give me like 5 mins. I'll try and clean that up to the best of my ability, Josh
Thank you kind sir
it was fast stuff that came to my mind :(, don't judge this code out of my head.
irl
give me an arduino, a bug zapper and i'll implement it
AAAAA
why this stickers everytime
gosh
I would give you that just to get footage of you hunting mfnalex down
@tender shard i have free candy, do you give me your adress so i can ship it to you? :kek:
A list of PlayerGenerator
I think
Im on my phone so
It's a Map though
I had that on my github
Map<UUID, List<PlayerGenerator>> then presumably
One sec
huh
return playerGenerators;
}```
oki
if anyone trips and falls on documentation on the 1.19.3 implementation of resource pack atlases let me know
did it change from 1.19 at all? 🤔
it changed to the point where resource packs are not working on 1.19.3
and I can't guess without documentation, of which seemingly none exist
only solution people suggested was decompiling the defaults and that doesn't sound like fun
it isn't
have you read the client logs?
?
what client logs
the dumbest part is that it looks like the new atlas system could've autogenerated the files it needs, I really don't know what mojang was thinking
well the client also does logging
@rare rover I literally cannot think of a better way to do this. I would honestly opt out of using a Stream entirely due to the complexity of the task you're trying to achieve here. I would opt instead also for a Map<UUID, ListMultimap<Material, PlayerGenerator>>, which is still ugly, but it at least gets you out of 3 nested collections
if the resource pack doesnt work, it will definitely log why
You can make a ListMultimap with MultimapBuilder.hashKeys().arrayListValues().build()
I haven't because it's a whole new structure, I don't even know where to start with it
I mean, checking it right now it basically just says there's missing textures
ListMultiMap is a thing 
Where would i find all maps, hashmaps, lists
I wanna learn them all
Could be very useful
Maybe look at what extends Map and Collection
personally I like using ArrayListMultimap from commons-io
And how would i look at all of them?
Uhh I think if you go to the Map class in IntelliJ there's a little O with an arrow next to the class definition
If you click that I think it should show you all of them
👍
i was reading D:
hi guys hru?
good
im not seeing the problem here
the error says the list is empty, but it should contain the was goozed to death by a zombie villager! message, right?
if a list has players in it. is using list.get(int) a specific index which has a player in it and casting it to a regular player variable ok?
like in a situation lkii,ke thise
wdym
if a players stored in index 0, whats wrong with using .get(0) to return the player at the first index?
yes but i want all the players in the list to get the effect
wait
so the loop increments and then does those effects to the second player
were you saying that in response to me
you can just for(Player p : nerbyentities)
for (Player nearPlayer : nearbyentities)
yes a foreach loop
but i wanted to check out this scenario and see if it while still work
cause im just wondering is if casting like that is allowed
am i not storing the message from the given path correctly?
this j produces a null response, but no error
Idk code looks ok at a glance, debug it
Is deathconfig right, is the formatted string right
should be fine
getDeathConfig() just returns deathConfig
and the string formatting seems okay
Uh I don't think you can use getDataFolder in a field initialiser of your main class
Set it in onEnable instead
Surprised it's not erroring
maybe it just takes null as an empty string equivalent
set both in onEnable or just the top one
getDeathConfig() doesnt work then?
f parent is null then the new File instance is created as if by invoking the single-argument File constructor on the given child pathname string.
Yeh it's loading from your server root, not plugin folder
Move to onEnable
sorry, im confused
to use it in the string formatting part, where am i getting the deathConfig from if what im moving is private
you gotta put your fields in your onEnable method
you can keep the fiedl yk
just put the init inside of onEnable
don't make them final fields either
if intellij yells at you disable the warning and tell it to politely go fuck itself
Also probably move the deathFile.exists before the loadConfiguration
You need to initialise deathFile before checking it exists
Might be worth brushing up your programming or thinking carefully
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
xd
what's the turtle master potion called in spigot
TURTLE_MASTER?
declaration: package: org.bukkit.potion, enum: PotionType
working w config files is j beating the shit out of me
the code that i have is making sense to me
but its j giving a null response
and idk how to find the answer to the problem
Is it possible to make a custom EntityPlayer chat?
wdym by that?
a separate chat for only a few players?
No
like
The custom EntityPlayer chat
like send a chat packet with it
so it looks like it chatted
Should I redo my current gui code and use this?
https://github.com/IPVP-MC/canvas
Cause it seems WAY better
than what I was doing
What are you trying to do?
Like what's the end goal
To have a few NPC's be chatting
Can you just broadcast a message, no?
Could be
Ok
Last question
Any idea how to make the custom EntityPlayer have velocity aswell as knockback?
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.options()" because "this.config" is null
at world.ntdi.nrcore.NRCore.onEnable(NRCore.java:26) ~[nrcore-1.0.3.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-270]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-270]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.19.2.jar:git-Paper-270]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:422) ~[paper-1.19.2.jar:git-Paper-270]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.2.jar:git-Paper-270]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.19.2.jar:git-Paper-270]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-270]
at java.lang.Thread.run(Thread.java:833) ~[?:?]``` How come my config is null, It's in my resources folder, im so confused
wait no i know
i was calling the variable
not getconfig
oopss
Im trying to install this: https://github.com/IPVP-MC/canvas
I did as it stated however it doesnt work
<dependency>
<groupId>org.ipvp</groupId>
<artifactId>canvas</artifactId>
<version>1.7.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
It states that it cant resolve the dependancy for this
Did you do git clone https://github.com/IPVP-MC/canvas.git cd canvas/ mvn clean install
Yes, I did
The only issue: I couldnt do mvn, it didnt reconize it
so i just use the run/debug config
to clean install
Unsure if that worked or not
Im using intellij
?paste
Paste your build file
Yes, your pom.xml
Looks fine, maybe reach out to the dev and ask them
wait no i didnt clean install it correctly
@jagged monolith it says mvn isnt a reconized command
am i doing something wrong, idk if its cuz im using intellij
Question about Vectors, does Vector#multiply() perform element-by-element multiplication or does it perform actual matrix multiplication?
(For the case where the argument is another Vector)
Open the project in intellij compile with maven from there
If using the bukkit util vector it will multiply all the numbers with the other vector
So the components for the resulting vector are [v1x*v2x, v1y*v2y, v1z*v2z]?
Yes

You never installed maven stand alone
You were using maven provided by intellij
So all that was needed was just open project in said ide instead and build from there
ohhh
Now you know for future stuff so you don't encounter this problem again
yesh
?paste
https://paste.md-5.net/atayujokoy.cs
My code refuses to work correctly, the plrData object doesnt show the same things in every place.
plrData.get(p.getUniqueId()).put("Page", "Lot");
plrData.get(p.getUniqueId()).put("AllowC", false);
This is what its supposed to show.
Instead, in the menu.getSlot(?, ?).setClickHandler functions, they are viewed as:
"Page" = "Main"
"AllowC" = true
Everywhere else shows it correctly. Anyone have an idea why?
Maybe open a GitHub issue on their GitHub since I don’t really understand the lib
For some reason it shows the old values inside the setClickHandler function
Ohh
Find anything?
First time making a backend plugin
harder than it seems!
I still have yet to test it
kek
Okay, I updated my code after testing a ton of times it STILL doesnt work
Im gunna send my updated code
someone PLEASE help
You’re changing it to menu each time you’re checking it.
menu.getSlot(2, 5).setClickHandler((player, info) -> {
System.out.println("Test"); //Hey!!!! THIS ONLY RUNS ONCE!!!
if(plrData.get(p.getUniqueId()).get("Page").equals("Lot")){
System.out.println("Test2");
getRandomReward(5,p);
}else{
startLottery(p);
}
});
Seems like a library thing if it only runs that part once?
Is there a wait method for spigot that isnt creating a Bukkit runnable
What do you need it for?
i just wanted to do something like create a mob set it to invunerable , wait 5 seconds, and then make it vunerable again
Use a scheduler
^ that would be the best thing to use for it
yea i was just wondering if there was another thing for it
You can’t tell the thread to wait safely
but alright ill work with it thanks 👍
oh is that why you cant use the wait in spigot
There’s other ways, but scheduler is already there
The server runs singlethread most things so it’ll halt everything else
I cant find any contact info for the developer.
Nor can I see any good information on how to fix this
oh i didnt know that that actually explains why i cant use the wait method
Use IF emerald
Inventory library
@rotund ravine Ah ty
Stef is really responsive to issues
@rotund ravine I dont understand what my top level of my package is
can you tell me rq
In regards to what?
it says replace [YOUR PACKAGE] with top-level package of your project
i need it shaded
@rotund ravine what function should I use to check for a click at the actual gui
gui.setOnTopClick(event -> {});
gui.setOnBottomClick(event -> {});
gui.setOnGlobalClick(event -> {});
gui.setOnOutsideClick(event -> {});
Im unsure if its top or global or whatever
its confusing
Globalclick is any click
Top is top inventory
Bottom is bottom inventory
Out side is outside
ok so top is what i should use
Yeah if u only care about top
@rotund ravine Final question: How would I go about adding a singular item to the gui
cause it seems different
Create a guiitem https://github.com/stefvanschie/IF/wiki/Gui-Item
And set it on a pane
Or a gui
@rotund ravine Now all I see is the item I wanted to add to the current gui
Yet it had another pane before that
Hm? Whats ur code
ChestGui inv = findMenu.get(p.getUniqueId());
StaticPane pane = new StaticPane(c, 2, 1, 1);
pane.addItem(new GuiItem(item), 0, 0);
inv.addPane(pane);
inv.update();
What happened and what did you expect?
Happened: Cleared the entire gui and replaced it with a barrier saying "Nothing"
Expected: Replace a paper text "Scratch me" for it to replace with "Nothing"
@rotund ravine So?
Alright
Sry am on my way to school. But instead of a pane, you can simply getInventoryComponent and setItem on that with ur item i suppose.
best way to embed a webserver in plugin ?
You shade it
There’s plenty of different ways
Did it work?
i have 0 clue how to work with the x and y stuff
im so used to .getslot so im having difficulty
Oh, it’s basically just a grid
Whats the easiest way ( no api)
Make your own webserver in Java
What’s ur gui height/size?
3
3x9?
yea
nah thx no time for that
Well easiest way is to just creat a socket listener but like it's just easier to shade apache http stuff because otherwise you are going to have to handle serving content yourself. It's not like automatic lol
ChestGui inv = findMenu.get(p.getUniqueId());
inv.getInventoryComponent().setItem(new GuiItem(item), 4, 1);
inv.update();
This is my current
But it wont even apepar
It’s set from top right to buttom left
You're the one who didn't want to use an api
So you don't have a choice
yea
but still it doesnt even appear
So try 2, 1 @vapid grove
thats the MAJOR issue
but I will go for apache
So you will use an api
ok thx
Remember to update the gui
Oh you are
Sec
Just gotta switch busses
Instead of update try show @quaint mantle
Wait nvm it already does that
Is the item present in getItems()?
idk what u r talking bout
checking
Oh was not talking to you woops
spigot
@rotund ravine ho wowuld I check?
Just print the size of it
If it doesn’t work i’d go back to using panes and playing around with that a bit. I am not home atm and gotta attend a lecture in 15 min.
So that’s correct?
@rotund ravine just noticed something, do I need to specify that its ALLOWED to replace items?
Doesn’t look like it. But you might actually need to make a static pane the size of the chest @vapid grove
why
Wait... it says that it can ONLY fill empty inventory slots
Can’t test it atm, but it’s a mostly pane system, so it handles everything by the pane.
sec
Just make a staticpane “new StaticPane(9, 3)” and set the stuff on there. Supposedly that should work. Then use the addItem on the pane and the addPane (once should be fine) on the gui
I can test more later in like 8 hours when i get home
I’ll head into my lecture. Hopefully you can figure it out or someone else here can help you.
Didnt work, ill figure it out tommorow.
Ill ask for help when ppl are online to help
what you trying to do?
^^, set or add item
Is there dependency of mythicmob?
I tried to find it but I couldn't 😥
It should tell you on startup
Why can't I implement my own RecipeChoice?
I want an ExactRecipe that matches off name instead of off isSimilar
anyone know the mojang mapped names of these packets?
depends on what spigot version
NO clue on your version as PacketPlayOUt has not been used in a LONG time
ah found it thnaks
net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket
1.10 or 1.9 I think it was last used.
That's true. The API has pretty much everything needed for scoreboards.
it doesnt work with api
im trying to set the team for an npc
I see md5 got in the xmas mood
setting coal on fire and throwing it at people who don't use the api, this is what xmas is about
Waste of good coal
speak for yourself, it makes for a lovely roast
it shouldnt show the name tag
{
// create team
scoreboardManager = Bukkit.getScoreboardManager();
scoreboard = scoreboardManager.getMainScoreboard();
team = scoreboard.getTeam("npc");
if (team == null)
team = scoreboard.registerNewTeam("npc");
// set team settings
team.setPrefix(TextUtil.translateLegacy("&8&l[NPC] &8"));
team.setColor(ChatColor.DARK_GRAY);
team.setDisplayName("NPC");
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
team.setOption(Team.Option.DEATH_MESSAGE_VISIBILITY, Team.OptionStatus.NEVER);
team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
}
When all you get for xmas is coal, what else is there to do?
I assume everyone is using the same scoreboard
didnt you had to use packets for scoreboard to have a tablist AND scoreboard?
or am i way outdated
thats what i was trying to do but the packet doesnt have parameters
i need to provide it with a friendlybytebuf
but idfk the format
there is usually another constructor which takes an object
holy fucking shit
r u fucking serious
it parses from the byte buf
the one taking objects is private
oh shit there are helper methods
static
hey no profanity in my christian minecraft server
bruh it doesnt work
Ever
for npcs you appereantly do
It does work. I use the API for tablist and stuff
No
I can only assume not all your players/npc's are set to the same scoreboard
^
Don't use addPlayer 🙃
addEntity?
oh shit fuck im sorry
addEntry with the npc name ( or uuid?)
you'll be going straight to Minecraft heck for that one
Name
im fucking what? shit. fuck that.
Also setting the scoreboard for a fake player like that is pointless
Ye npcs don’t have a gui
alright ima test now
i realized i was creating a new scoreboard for the gui in kitpvp
not using the main
fixed that now
smh
wow discriminating against npcs, this is why skynet will get you first
if you make good AI it should interact with menus the same way players do
ayy lets go that works
if it gets good enough maybe you can get the AI to donate to your minecraft server with the dayjob you programmed it to have
and then it searches the internet for human domination and you become the working slave on your minecraft server
worst part is after a couple of weeks the ai leaves your server because it found a better minecraft server
that's when it really stings
imagine you make an AI to automatically farm things for you
and it just switches the server because it want to play something else
2 years later it comes back, says you were a shitty father and that it began a competitor mc server and it's doing way better than your server
then you get really angry, you get really drunk and in a moment of anger your pull the plug on the AI which runs entirely on RAM meaning it is effectively dead
basically I am describing your average Wednesday
whats the unicode character for a continueous horizontal line
ive tried horizontal bar and extended line from unicode but both show up as extended dashes in the scoreboard
ooh underlines
use - and strikethough it
they dont go through spaces i thought
find a 1 px dot unicode char that renders in mc
its a character
it has a width and shit
just blank
but idk if it will register
for strike
oh yeah it works
is there a way to get the similar item of an itemstack?
set amount to 1 ig
Wtf is a „friendly“ byte buffer?
Wdym
It's a byte buffer that won't hurt you like other byte buffers
Fair enough
serious answer: It's a bytebuffer wrapper that mojang uses because it has extra functionality
such as varints and reading their custom codecs iirc
why not ExtendedByteBuf or smth
Possible they named it that way because it was more dev friendly. Or they needed to make a unique name and settled on friendly
Some stuff feels like it wasn't written for others to use
Gotta send them an email and ask
Lets send them a post card
i love when my location if checks dont work when they are the exact same
decimal values
yaw n pitch n shit
and pitch
I have a method to get a weird hashcode of a location within a single long
yeah just compare to vector or smth yaw and pitch annoying af
Even with the world?
not sure if the world is hashed
don't think so
I just use it on my particle culler
because some mfs at work decided to spawn 32k particles in the same location
Make two longs then :D
okay even better, all values of the location are the same
can i get the code for that
great question
for educational purposes
they all send the same packet
public long hash(double x, double y, double z) {
int xPos = (int) x;
int yPos = (int) y;
int zPos = (int) z;
int xIndex = (int) ((x - xPos) * 0xF);
int yIndex = (int) ((y - yPos) * 0xF);
int zIndex = (int) ((z - zPos) * 0xF);
// 22 bits for xPos, zPos
// 8 bits for yPos
// 4 bits for xIndex
// 4 bits for zIndex
// 4 bits for yIndex
long hash = 0;
hash |= xPos & 0x3FFFFF;
hash |= (long) (zPos & 0x3FFFFF) << 22;
hash |= (long) (yPos & 0xFF) << 44;
hash |= (long) (xIndex & 0xF) << 52;
hash |= (long) (zIndex & 0xF) << 56;
hash |= (long) (yIndex & 0xF) << 60;
return hash;
}
well it looks like im comparing xyz coords then
this should have an epsilon of 1/16
didnt i tell you that spaces dont work
it does
dafuq
what you testin?
something doesnt math up
I'd honestly just store totalExp
instead of level + totalExp
if you change the formula you gotta reset player data n shit
true
you gotta think about these when coding
Just recalculate the level if you change the formula
I've used client-sided lore for such purposes, too
Why calculate the level every time
changing the lore in config applies instantly to allplayers
calculate onJoin and onExpChange
i might work on a crate system for one of my servers later
one that you get keys, can redeem them into a respective crate and get items or you can get the key item

Nova plugin type beat

this shouldnt be too slow right
made a role system where you can have weights, display name, permissions
and each role has a display item
that you can select on a fancy GUI
click on the button to type the item name in chat, or just select it from a paginated menu containing most item types
hella fancy
like 100 lines of code
so like a permission plugin
not really
or does another plugin handle the perms
ooh ye ok
that's for another project
project-similar-to-discord is not under NDA
particle culling is under NDA
ah
particle culling is just one very minor patch in the NDA code
when does it expire
10 years from now
lmao
ill dm you in 10 years asking to look at it
oh okay
if i remember ofc
bruh im starting to regret essentially coding the whole server in one class
the whole kitpvp game part at least
where has alex gone
i would do that
but i just wanted to code some shit for my server quickly
and i never thought it would get very bi
g
give me a line count
ahha
refactor that rn
help
i sort of like it because i dont constantly have 3000 tabs open tho
lmao
surprisingly that's only like 100 hours of development
nope
hoh
how are you coding like that
idk
its so big, you 2 major ij versions out of date
tbh I only updated ij after like 4 years
atleast your using gradle
I was rockin ij2017 until 2021
how
how do i show bookmarks on the sideba
faur
I think the longest class I have is maybe my color matcher
that I use for imageboards
just because I had to type every map color manually
this was not fun
ask google or chatgpt
but hey it brought like a 100x performance improvement over the traditional bukkit method
so I'm not complaining
is it on github
took an 80ms rendering process into 0.1ms
might need it at somepoint
no it's not on github ❤️
you might need literally anything I ever write at some point
thats why you should os your entire computer
ah yes, OS the stash
Hello , i have a question why its not saving a location to my json file ? what can cause this? i know i asked this in the past , but i didn't find a fix for it ..
Bukkit only needs around 0.091 ms to render a full map since around 1.19
welp i'm using 1.18
and I'm drawing my own images, not rendering a vanilla map
there's not setImage, you must setPixel individual pixels
I did tests
I made setCancelled(true) but if i swap item to left hand it dupes
some images took 80ms, others were quicker around 20-30
my new system is consistently under 100mu
How to prevent that?
takes longer to draw the actual image than to split it into itemframes
and I'm satisfied enough with that
I also made raytracing code that gives me the pixel the player is looking at in about 10-15mu
1000 mu = 1ms btw
I might need to account for some lens distortion
as harsh diagonals seem to be 1-2 pixels off
did you add a type adapter to save the location
due to some predictions I make
Not hard to factor
Basically just need to check the angle if its past a certain point and slightly correct for such things
or just correct based on the angle instead of checking for angle ranges
red is what's happening, blue is with extra correction
You could do that too
yes , when i did that the whole system stoped working
no errors tho
?paste the type adapter and class
alr
honestly it doesn't matter much, I was planning on doing it regardless
If you dont need the location human readable just base64 the location.
one sec ill find the stuff you need
pretty sure the problem was that the actual thickness of the map in the item frame was like
paper-thin
big thanks
so I just made a big tolerance
the corrections would just base themselves on the border tolerance,
basically adjust X and Y so that the Z tolerance is 0
or within a thickness of like 0.1
this probably makes 0 sense to y'all
for the json instance use Gson gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Location.class, new LocationTypeAdapter()).create(); and for the class https://paste.md-5.net/yajafiwazo.java
this is how iam using it now :
return the location :
set the location : on click event on the item in gui :
it spawn the lootbox preview , but when i restart it dosen't save it in the json file
that's my only problem with the entire lootbox system xd
i already wasted 3 weeks didn't try to fix it
i already have Gson instance should i make a new one or just use that one and add the registerType to it ?
just add that
Personally i just always base64 the location lol
and where i can use the read and right method?
or it auto use it?
i don't need to do anything?
in a new class, called LocationTypeAdapter or whatever you put in the type adapter
create a class called LocationTypeAdapter then
btw you can dynamically register type adapters like this?
this right?
i just ask where i can use the read & write methods?
or i don't need to do anything
just register it?
ok time for testing i hope
bruh you can parse json objects like that?
ive got no idea
i just stole it from fourteens code and havent had a chance to use it
cries in japanese
how to cancel swapping item from custom inventory

oh my god that did the trick!
run it on higher priority probably
thank you so much sir !! you saved me ton ton ton of times ..
