#help-development
1 messages · Page 99 of 1
Iirc cast the BlockData to Levelled
d'oh
so APPARANTLY a cauldron is NOT a filled cauldron
wth
why isnt that part of blockdata
WATER_CAULDRON
srsly
isnt sh a power shell only thingy
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
ye true
should i import minecraft_server.1.12.2.jar or mapped.cf6b1333.jar
uh are you on maven
yes
what you do is that 1 you download buildtools and run it using the --remapped arg, then you paste this as your repo/dependency/build in your pom.xml
take note that this is for 1.19.2
its also for 1.12.2
no not exactly
but shoudld i use minecraft_server.1.12.2 or mapped.cf6b1333.jar
you need to change the 1.19 in my pom to 1.12 in yours
i have
im asking which jar should i use
then i have only
Is there even a remapped 1.12
there should be
oh ffs
I TOLD YOU
you need to change your frigging pom xml so that it includes the 1.12 version of what i posted
ofc you cant use remapped if you dont import it
im so done
what i need to change
How do I disable item movement using the number keys?
cancel appropriate inventory event
yea now reload your config
Sorry, I meant I am trying to disable the movement of an item in a specific slot to another slot, however it isn't working and I'm not sure what to do,
Code:
public void onRemoveElytra(InventoryClickEvent event){
if (event.getWhoClicked() instanceof Player){
if (event.getSlot() == 0){
System.out.println("clicked");
event.setCancelled(true);
}
}
}```
InventoryDragEvent or smth like that iirc
Ah
getWhoClicked will always be a player
actually im unsure why that happens. you saidd you did reload the maven thingy?
No need to check
and that happened
im using intellij
and i import it like this
well yea but did you click this
its possible that your import is messing with the auto import
nah
hm. did you add both dependencies
Looks like tou havent run buildtools correctly
importing mapping did this
so i have this
but still not what i need
and someone said about powershell
Hello, I need help with adding another line of text above the player's name it would be really helpful if u helped me. I've researched for a few days to try and find a solution, one of the more popular methods I came across is having a mob riding on you with a custom name tho it hides the main name, another popular method I came across and I tried to do this one aswell is to have an armorstand with the custom text teleported to that exact position I want it every tick but if I F5 I can see it lagging behind me tho for other players it looks just fine. please help
Does it need to be visible in f5 anyway
I mean the armor stand is not but the name for that certain player looks lagging behind while in reality for other players it looks fine
The regular usename tag isnt
Unless you’re using a riding mob, you cant stop that lag
Minecraft movement is predictive
is there any other way of getting it done
Either use a riding mob or just make it invisble to the player who owns the tag
error:
https://pastes.dev/lAoGwFfKMh
any ideas?
try {
gson.toJson(registeredPlayersManager, new FileWriter(data));
} catch (IOException e) {
throw new RuntimeException(e);
}
}```
whys the spigot doc website so laggy now
oh
What are you trying to do
it doesnt know how to serialize a file? idk what that java.lang.String is doing there
if you dont want fields to be serialized, declare them as transient
It’s trying to serialize the FileWriter class itself
it shouldnt
I think they’re trying to serialize the data then write to file
it only provides a way to let gson write to a file?
had so many related issues with gson
trying to save my hashmap of players to a json file
custom player object
HashMap<UUID, Player> registeredPlayers = new HashMap<>();
i wanna be able to save it to json and then retrieve it from the json file
this
you can always retrieve the Player connected to a UUID, if they are online.
the player object doesnt hold that kind of info, its weird dont ask
. . .
my naming skills aren't up to scratch
is that a custom player class?
its more of a quest data class
nothing to really to with the player
ill not write a serializer for u
its more of a bind
rename that class pls
yeah but my point still stands i need to save a hashmap to json and vice versa
doesnt the default serialisation work?
Im pretty sure for that you could just serialize each entry
Entry as in Key-value pair
yea
do you have a file object in your player class?
no
best way would be writing a proper db impl
uhhh sometimes you can
can you paste that player class
for other players you can mess around with packets instead of events so both packets are sent at the same time
?paste
not sure if Im reading it correctly, but are you trying to access private fields via reflection?
so u mean the class with the hashmap
Gson might be doing that
gson is reflection bases ye
and it doesnt know how to access smth in this case
solution would be to try setting the field not private, but maybe protected?
thats iterally it
or non-final, never had that error
uhh player class i mean
gson might now know how to serialize it
works fine with private fields
https://pastes.dev/5UFTDELsmf
the player class just binds the list of quests to a player
maybe its the private final
now sent PlayerQuest lmao
shouldnt tho
the playerquest object is also just more of that, theres a few nested objects
ok sec
and please declare every field that shouldnt be serialized as transient
and uh you could optimize this by just calling 'return map.get' in first method and 'map.putIfAbsent' in second
https://pastes.dev/1ldXd3GXyb dont ask about the bad code below
Im saying for the player that is moving
o
not sure, if you would leave that field away and try again you'd be sure its that
or the Quest class
it's serialized component before tho
i've seen it work, but something happened and idfk
yeah erm
ill make one rq
its a mess atm
was trying to make it quickly
just adding some comments and cleanup
gimme like 3 mins
You can add a codec for it anyway right
whats a codec
If the data cant be serialized natively. Just lets you use your own serialization
Not sure is gson even had that though
just add typeadapters/ serializers/ deserializers
Component can be turned into json anyway right
probs
wondering hashmap <location,int>
or
<string,int>
i store an location to execute an event at the location
i use the int as timer
so mainly what would be better
world.spawnParticle(Particle.SPELL, new Location(world, loc.getX()+x, loc.getY(), loc.getZ()+z), 10, new DustOptions(Color.fromRGB(50, 205, 50), 1.0F));
Doesn't work: java.lang.IllegalArgumentException: data should be class java.lang.Void got class org.bukkit.Particle$DustOptions
In another class:
Bukkit.getWorld("TowerDefense").spawnParticle(Particle.REDSTONE,((Location)towers.get(towerID).get(4)).clone().add(new Vector(0.5,1,0.5)), 10, new DustOptions(Color.fromRGB(0, 255, 0), 1.0F));
Works perfectly fine
check ur impots...
imports
1.13
😢
I mean that's what I wrote in the plugin.yml
i have another problem, whenever i save/retrieve data from my json file it creates a duplicate key in the file and doubles the file size
don't ask me how I made that conclusion I'm a total noob in development
"Yes, I use eclipse and code 1.8 plugins"
the linked jar is 1.17.1
without a code it doesnt help
run it on 1.17.1
or just paste the two json files
How does it work in one class and not the other then tho
add a typetoken
thx
the testing server is on 1.19
no clue what to do lmfao
Emeraldtip
stick to the API of 1.19 then its an issue coding on 1.13
and running on 1.19
some methods cloud be changed and etc
its the same from 1.9-1.19
no really alot of diffrences
instead of
Map<UUID, Player> playerHashMap = gson.fromJson(reader, HashMap.class);```
do
```java
Map<UUID, Player> playerHashMap = gson.fromJson(reader, new TypeToken<Map<UUID, Player>>() {}.getType());```
and i tell u as a person who uses 1.2.5-1.8
which 1.7-1.8 are simillar but below tottaly different
so link the new API and update the plugin... or do reflection
Can someone help me setup a domain
unstable methods? should i just ignore that
wrong server man
#help-server might be able to help you
Its for a mc server bro
tyt
java.lang.RuntimeException: Unable to invoke no-args constructor for class net.vlands.survival.quests.internal.Quest. Registering an InstanceCreator with Gson for this type may fix this problem.
pain
oh its bc its an abstract class
Abstract class can't be instantiated! Class name: net.vlands.survival.quests.internal.Quest
do I have to do the maven solution
sorry that my questions are just extremely stupid but is there a way I can just download a jar for 1.19, add that to build path and just be on my way?
?bt
aight another 30 min trip here we go
@tardy delta java.lang.RuntimeException: Unable to invoke no-args constructor for class org.bukkit.potion.PotionEffectType. Registering an InstanceCreator with Gson for this type may fix this problem.
full error
ur trying to do something ur not allowed to
im guessing youre trying to make a copy of potioneffecttype
gson sees it as an abstract class?
might rewrite the reward class, i think its something to do with this:
i'll just create my own potioneffect reward class and make it serializable
because currently i think its gonna do the whole of the potioneffect stuff
maybe serialize the ordinal instead?
Idk I mean it might be a type adapter factory you know
Which would address abstract class hierarchies
PotionEffectType a class now?
yep
i guess register a deserializer which calls PotionEffectType.getByName
i cant type smh
ooh ok having a look
Look at their first example <:
mkay
sqlite kekw

i feel like this is cleaner than having one reward class that has a bunch of null variables
uhh anyways does anyone know how i can see my newly created branch on gh
did git checkout -b experimental
Did you create a branch downstream?
Mye more or less
ill probably have to do a commit first
Yeah probably
But else
You just push the branch iirc
And it should appear at origin
ah yep there was an option
Ya might have to check it out first tho unsure
oh im used to fucking things up with git
Same lol
How do I check wether an argument of my command is a String
uhh i mean the arguments is a string array so ofc they're all strings 🤔
In older versions of spigot I was able to use
p.spigot().sendMessage(TextComponent)
how can I send a text component to the player in Spigot 1.16
BaseComponent... iirc
oh yeah might be a vararg
or normal array whatever
Metu what dependency are ya using
uh well thats odd
si bump to my question
<string,int> , <location,int>
what would be better
an object or an string of location?
I'm importing
org.bukkit.entity.Player btw
Id say the latter
Use a custom class to encapsulate the location
tho depends on what you're doing evan
That co tains x y x and yaw if needed
and make it immutable 🤤
have you tried restarting and invalidating caches with intellij
Parsing a string for location on every call sould just be annoying
I've never had to invalidate caches on vsc so clearly vsc on top
vsc doesnt even have that
except having to download like 20 extensions 
invalidating cahces?
ye
how can I do this? I've restarted intellij
You can do it for java shit
File > invalidate caches
like does it store caches in a folder?
idk if u can see but there
flipping screen dang
hehe
Tf your second screen is long
vertical
metu sort of
it indexes a lot of shit which gets cached
sometimes intellij is drunk
basically i store an block location to make an event
and integar to represent timer
first screen is big too
pretty simple
so what would be best way to store an block
so far hashmap is great for those kind of things in general
i would either make a different type of storage but i dont see a reason why not use an hashmap
Map<Location,Integer> is extremely dangerous
and can if used wrongly result in memory leaks (due to Location being mutable)
Which is why you probably want to write an immutable version of Location for yourself
and then use that
Again I'd store some location data you want in a custom class
Immutable as well 🔥
Why tf is location mutable
record 🤤
still same
uh
why does bukkit still has the Consumer class
probably in case someone uses it
dunno if its still in the latest versions
spigot should use 1.20 as the fuck it up and add all the breaking changes to the code lol
hmm, if you type inside the method,
Player.Spigot sth = null;
does it become red?
the assignment expression
🙏
how can I make progress bar?
Coloring |||||||||||||| and resulting it in progress bar?
Player.Spigot bolded part is red
thats weird
What kind of progress bar?
calculate how many bars should be green and how many red using the percentage or a floating point number
memory leaks ;-;
i got 256 gb ram in my dedicated server
easy as numberOfBars * progress (where progress is a float between 0.0 and 1.0)
bruh who cares lmao memory leaks are objetively bad
oh my 😄
Didn't show up for me when I was searching for it
thx
myes, but memory leaks will in long term eat up your ram
also don't run a spigot server on that much you'll lag your server
saw it before
they're usually quite subtle at first
often restarts
every 4 hours
and the ram comes back when the jvm shuts down? 🥺
i abuse cache anyway loading ton of data into it
don't use your server specs to produce sh it code lmao
I mean if you want a malfunctioning design + memory leaks Ig go ahead and use Map<Location,V>
nah nah ty
nothing's technically stopping you
alr sounds good
not sure what he meant by custom class
all i have in my head is storing those not in hashmaps
but in files
X,Y,Z are the only requriments
but is does not allow reassignment once created of said properties
oh then you can in theory create an immutable vector
123;100;100
record Position(double x, double y, double z) {}
but hashmap will still be needed indeed no
record Vec3d(int x, int y, int z){}
i use hashmaps as timers oftenly
yeah
for different shit
so whats the point of making custom class?
if i will either clean the map
since it will be -1 for all the containing
if it achives 0
it will be removed
I mean to avoid the error proneness of Location as K type for your Map?
But I mean there are other benefits also design wise
ok lol
i just came back to get some underwear
gl
have you tried reloading your maven project?
i think its CommandSender.Spigot
I have to send a TextComponent
though there should be a Player.Spigot too
yeah
thats in commandsender spigot
declaration: package: org.bukkit.command, interface: CommandSender, class: Spigot
Player.Spigot derives it
yeah
Why are you attempting to static access Spigot?
you can player.spigot() fine, but Player.Spigot ?
I can't use player.spigot() finely
yes just creating a nullary variable to see if the ide recognizes the type at all
Well I just discoeverd that wasn't the issue
apparently redstone particles are the only ones that support custom colors
now my question is:
Is there a way to spawn potion particles on the ground (like the lingering potion effects)
that have different colors based on the potion
What IDE?
intellij
maybe delete maven or gradle cache for the spigot api and invalidate caches in ide too
Yes, that's an entity you can spawn
type p. and screen shot the options
declaration: package: org.bukkit.entity, interface: LingeringPotion
BRUH
how can I delete on maven?
well deprectaed works for me
Wrong entity
declaration: package: org.bukkit.entity, interface: AreaEffectCloud
This is the right one
aight tysm
i dont know but ive seen people reload with a --update flag
maybe try like mvn command --update
mvn clean install -U
this
I dont have mvn installed
um, thats not spigot
can you show your dependencies
where should I paste my pom?
?paste
?paste
might need to install mvn or use something in intellij to update maven cache
Is NMS not available on 1.17.1 spigot api?
pretty sure nms isnt available with the api anywhere
^
Isn't buildtools just for the servers though?
I believe they can use paper nms thing
yes but nms is shipped with the server jar
Ah I see
and buildtools when ran installs a server jar dependency for u to depend on
and if you use maven you can use https://github.com/Alvinn8/paper-nms-maven-plugin
I'm porting my plugin from 1.7.10 all the way up to 1.19, and i'm now on the 1.17.1 version. Suddenly, the entire NMS reflection broke. Did NMS change here? Is it not stored on net.minecraft.server.* anymore?
Yeah
"Yeah"?
Classes aren't relocated and methods are unmapped
Unsure about that first part was going to check
I'm going to guess you manually imported a CraftBukkit dependency jar
You have a player object, just not a Spigot one. You have something providing it and its not the Spigot API
I'm not importing it. How is it possible?
all my imports
Yes, those are class imports. I'm talkign about dependencies in IJ
from
Project Structure/Libraries right?
yes
so for developing spigot plugins, java is the base?
yes
I see maven imports only
Its possible that is Spigot 1.8. That has an awardAchievement method
So I need to learn it, currently I am learning it with Code academy, so when do I know I am ready for spigot
Finish the courses, do other ones
3rd from teh bottom is a jar
When you can write decent programs in normal Java move into Spigot
looks like
how much time will it take if I invest 2 hours a day, approximate figures are totally alright
Java is a massive language
I just saw this
so more than years?
I'd spend a few weeks if not a month just going into Java prior to Spigot
Learning isn't a mathematical constant. It varies for everyone.
^
that would be it
there must be an average right
Everyone's different
like how massive etc, I know the caliber differs
That's why I'm trying to stay away from exact numbers when telling you time, cause really we don't know exactly
hmm so I will have to figure that out by actually doing it
It's not like anyone went around and asked people "how long did it take you to learn java and feel comfortable to program in Spigot" to calculate the average, but there must be one uncalculated one, yes.
that is totally alright, thanks for the help tho
not all of my dependencies are on mvn local or sth. I've installed them and imported on pom.xml
I'd bet a good percent of us started with spigot but that makes it a lot harder lol
So I will complete the Code Academy lessons for now
move to the paid ones afterwards if needed
even tho I am sure I will need them haha
delete that 1.8 import
Yes, and when you feel comfortable enough, move to spigot. That'll depend on you, really. Learn OOP and java basics/intermediates.
Perharps! I definitely learned alot with spigot, but personally I didn't start there
OOP?
Question: my goal is to automatically make a player ride a boat when they place it. Is there a good way to get the player who placed the boat? In my use case, multiple players will likely be nearby to the boat when the boat is placed, but because I only want the "creator" of the boat to automatically hop in it, I don't think that getting the nearest player is the best approach. Any suggestions?
when I delete it and refresh maven project it re-creates it
Object Oriented Programming, essentially what 90% of java programs are built upon
Because for some reason there's functional programming in java now
then one of your other dependencies is adding it
you are using somethign out of date
how do I access that, what platform is that on?
It's a programming style, if you learn java, you'll learn it xD
This is not my project :/ the owner of the project no longer develops it and shared plugin's source.
Ooh so like a format humans can understand?
Java is built to be programmed in OOP
More like a common way for programs to be written
ah so kind of like a platform or universal format?
update to stop using a jar for https://www.spigotmc.org/resources/mvdwplaceholderapi.11182/
You can write in OOP across most languages, if they allow you to do so
Think of it like...
is it necessary for mc plugins
I am not sure what that exactly is since I started coding recently haha
Actually fix ALL yoru imports that use local jars
Imagine the language being a "house" and the style being the "model", there's the modern models, the 16th century ones, gothic ones, etc. You can build a house with any of those models
I'm deleting the dependency for mwdw? Did I understand right?
Java really wants you to write your programs in OOP, so when you learn java, you'll learn that forcibly.
I just got it lol, so basically a type of representation or code being written right?
UltraMinions.jar, MMOLib-1.7.4.jar, MythicMobs.jar, MMOItems-6.3.1-Cracked.jar
kinda yeah
no, update it
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.
I linked you the project, it tells you on that page what to use in your pom
Yes i am using code academy at the moment
hmm not sure what he meant a custom class
It seems quite nice ngl
finish the course....
When I started programming a few years back, I think I used Udemy to learn programming theory
and do some homework as well those are bad tutorials
But i've also checked out codecademy
That's what I'm doing lol
it's p neat
good luck pal!
I have to take notes too right? In copies to remember probably
Hmm not really
Thanks man you too :)
I mean
nah do practice to get used to some shit
its would be way better
then writing down notes
The important ones
or re read till u got into memory..
There are people that understand it better by taking notes and learn that way
re-read what you forget
Yes I have to be resource efficient since I'm in last year of school as well
it will be the same writing down notes is not really a soluation
But I personally just try to understand the concepts and why they work, and why they work like that, so if I ever forget something I can remember it easily
updated
keep going even if u dont understand something as well it what i did
i later used to learn what are things after having alot of practice
Programming's very much about problem solving and logic, so knowing the exact things isn't much of an issue, you can always look them up
Do that for all the dependencies I listed
logic?
Your ability to solve problems is more what's needed
spigot API is dog shit what you talk about
The academy i used to learn on earlier was whitehatjr, and they never explained the 'whys' that's why I left lol
UltraMinions.jar, MMOLib-1.7.4.jar, MythicMobs.jar, MMOItems-6.3.1-Cracked.jar
Yes? Logic.
Logic is a subject of math
It needs logic too
the logic sometimes doesnt make any sense
when u stick to spigot api
anyway yeah logic exists there
Yes doesn't have to everytime, there are a lot of possible cases
nah there ton of unnessacry shit in spigot api
and things that atleast my logic tells me should not work like they do..
👀
not gonna help this fool
lmao
That doesn't mean that logic is to be taken out of the equation. Programming's all about logic, problem solving, and maths pretty much.
Unnecessary for you, but might be very usefull for others
That would just mean spigot has faults
who says so
I do.
from some reason we still use NBT
and packets
really often
from a good reason
shit API
NBT very rarely
i used it very often
Like EXTREMELY rarely
efficency..
Unless you are talking about outdated versions of spigot api
i use 1.8
I have not used NBT in a very long time
not 1.19.2
lol
Of course you are missing a ton of features, 1.8 is like 7 years old
Talking about NBT.:
Did NMS in 1.17.1 change? I've been porting my stuff with reflection across versions, and i've reached 1.17.1, and it doesn't seem like any NMS classes exist.
1.17 removed all the spigot mappings
They aren't relocated anymore and everything is unmapped. I told you this earlier
So you are complaining about inefficenies when USING OUTDATED AND UNSUPPORTED VERSIONS OF AN API and then you have the AUDACITY to complain about the API not having some features THAT WERE IMPLEMENTED LATER. That is it, someone ban this guy
Must've missed it, apologies.
unsupported?
YES
yes
This isn't bukkit
That really sucks though. How should I do this then?
SPIGOT 1.8 IS ALSO FUCKING UNSUPPORTED
we aren't backwards in history we are in the now lol
you guys just cant admit that newer versions are like a shitty modpack
The last update to spigot 1.8 happened months ago, and before that update the last update was years ago
yeah i agree new versions have cool features like multi texturing
and many other options
that i dont have
Caused by: java.lang.UnsupportedOperationException: Interface can't be instantiated! Interface name: net.kyori.adventure.text.Component
cry
well you are right
but think about how great things were done in the past as well
im not really fan fan of 1.8
Why are you instantiating the interface??
im not
and starting of 1.8 is the right way.
gson serializer
But you should also come to the realisation that you cannot blame spigot for 1.8 not having adequate API
I don't understand the whole "omg modern minecraft is like a shitty modpack thing"
So the gson serializer is
Please just say that any time Mojang adds literally anything new
Add a custom adapter or whatever it's called
nah i dont blame just shared my opinion with the learning guy
they think 1.8 is minecraft and anything extra is stupi
Adventure has an adapter already I believe
pfft
To be fair it do be kinda like that
The real Minecraft is 1.0
ah then tell gson to use it
polar bear? turtle? wierd nether biome?
Oh no
common man if you already added polar bear and panda where is my animal pack
Not a turtle
It's not really a boss
lol you have to be fake
Hey, at least I have my path block. The best addition that happened in the last 10 years
how do i add that
Yeah good thing they've never added a weird boss before
Like a giant dragon in another dimension
No clue
hm forgten wither
it was added in the past
not really was best update
concept was cool
how do i change player's glowing color?
TL;DR It's new, I don't like it and change is scary
anyone of u watched spongebob?
probably trolling if not just a dumbass
or simpsons?
team colors
Ok so I wil get the lessons completed, thanks for the help everyone, never thought I would recieve such help, thanks again, have a fun time and take care ❤️
now compare old and new seasons and realize the difference between 1.8 and 1.19.2
damn, anyone know about paper type adapters for the textcomponents
the new seasons are for 2 digit IQ homur
same as new versions are shit honestly
and no i dont blame combat update was good actually
the rest is shit and make game just way heavier.
if you don't even like the new villagers you just got brain damage not sure what to say
new villagers are fine
It's clearly trolling at this point
How would I do it then?
nah not really
1.6 is my favorite version before the dumb 1.7 and 1.8 updates
u see anyone stays in 1.7.10
for so long?
oh
forgot about his existance
yeah it was dogshit update as well tbh
anything after MC 1.0 is just fake tbh
i also noticed that glowing color is depending on displayname's color. can i change it without changing displayname's color?
I only play real versions
tbh actually everything pre-hunger bar is just objectively better
it work like util?
You'll need to reflect using the new package and class names. As for the method name you can hardcode it. I don't see nbt classes changing anytime soon
Actually after reading the NMS a bit more, it's just changing the names yeah
Yep, sorry to bother with that. I spoke before I looked.
just make a data class with x, y, z int/double values
Is there a quick and easy way to build complex armor stand models?
yea a data class
I dont have anything depends on old versions of spigot I believe
ill write something quickly and rate it ok?
this is working now
looks like p.spigt() is working tx
public class MilesIdea{
private int x;
private int y;
private int z;
private String world;
public MilesIdea(int x, int y, int z, String world) {
this.x = x;
this.y = y;
this.z = z;
this.world = world;
}
//methods to get vaules later.
public int getx() {
return x;
}
public int gety() {
return y;
}
public int getz() {
return z;
}
public String getworld() {
return world;
}
}
@river oracle its what you meant + -?
🤷♂️ more or less should work
Spigot NMS Remapped 1.19
How to name entity?
I can't find TextComponent in nms
isn't it just called Component?
ye but can't get that to work as well
isnt it the same?
wdym
Location is bulky as fuck compared to that class plus it stores the world which can cause memory leaks
and it has vector information
it also stores the block at the location etc etc
better store world uuid
and its mutable which is cringe
not name
world name spaced key instead 😈
unless ur talking about 1.8
well in general the "the world"?
what you mean by the world?
The world object
if you keep an instance of World. that world cannot be unloaded even though no players would be in it
WeakReference it
i run 2000x2000 map
and i load the whole map on start
okaaay so?
anyway ill create an class to store exactly what i need
e
The funny thing is storing the world by name probably makes that object bigger than a normal Location object
Do note that a Location object stores a hard-ref to the World
Not in modern spigot :p
Yes, but they using 1.8
im wondering i will anyway have to use block.get x,block.get y,block.get z
in it right?
they
If you are storing entire chunks, you are better off getting rid of x, y and z and instead make a linear array storing 256 * 16 * 16 objects
How can I check if the player has a cracked minecraft account in PlayerJoinEvent
Are you using offline mode
Generally you cannot
nah storing a single block...
Im 100% there is a way
Yea
if its offline mode you cant..
time to trial and error
hey what would be the best way to make a superclass called reward, and have children classes with different types of reward (e.g. expreward, itemreward)
I want it to serialize to json something like this:
"rewards": [
{
"rewardType": "EXP",
{
"type": "LEVEL",
"amount": 1
}
}
]```
probably dumb but i cant think right now
I mean you can if you run in online mode
^^^^^^ he going L7 mojang servers
Then how do login plugins create autologin for premium users?
Proxies
diff proxies tho
Cracked players login through one proxy, premium players through the true proxy
So how would I check through which proxy someone goes through?
The proxy could send the information alongside the player connection via the plugin messaging channel
not necessarily
It's more of an relay than a tunnel
that connects the player to different IPs
true, that guy cant think out of box biggest problem
That being said it would be a bit after the player login event most likely given that the plugin messaging channel requires online players
Yea ik that, but then how do I use it to check if a player has a cracked account?
request an UUID
And you can't stop bashing other people
in general ill explain how they did it
Will do nada
if it is about uuid's why the duck where we talking about proxies?????!!!
just make it offline mode shitty feature
i think man honestly if you dont get it just leave it go offline mode
ur mind doesnt work properly
im brain dead not sure what are you
anyway proxy is nessacry or make custom alternative to login plugin
if u want premium to go to different hub
where there no register
Will a cracked account still return a uuid from Mojang?
Assume following precedence:
- Proxy A runs in online mode
- Proxy B runs in offline mode
- No other proxies exists and direct connections are forbidden
- Both proxies will send metadata when a player connects sucessfully through them
If Proxy A says that player X connected through it, player X is not using a cracked account. If Proxy B says that player X connected through it, player X might be using a cracked account
that probably won't work, because player can join trough cracked client with premium username
Alright. thanks
also not exactly
You have no clue what you are talking about
If I read this correctly you are running two servers
Which is probably not what you want
i dont need it its the other guy thing which dissapeared
Even then I am not sure how the proxy would work given that offline mode protocol is antagonistic to online mode protocol
Do you know french?
can i create a superclass without a constructor just to keep some of my classes extending it?
It can't work like that. It's either an offline mode or an online mode setup.
here
this guy did exactly
what you look for
Exactly.
go do homework
please stop with this attitude.
wake up
thug life
alright i think i get it thanks guys
🤣
Does anyone know how to declare dependencies in maven in a way that
a) it happens through a Mojo
b) it can be picked up be IDEs
c) the mojo can update dependency whenever it wants (in this specific instance when an access widener file is changed)
My current knowledge would say that I would have to declare the dependency manually in the pom.xml and when the mojo is executed it puts it in a specific directory defined by the system scope. However that would still mean that refreshing/reloading the maven project/pom in the IDE would not pick it up and the IDE wouldn't pick up the dependency either if it has not yet been built yet.
If the answer is "use gradle lol", then my second question would be whether anyone knows how to publish artifacts to maven repository in a way that:
a) Includes javadoc
b) Checksums are computed
c) Knows how to deal with snapshot repositories
d) Works through FTP (not SFTP, FTP)
e) Includes source
f) Has the ability to overwrite existing artifacts
g) Requires no manual user intervention (no manual copying)
h) Does not (indirectly) use the CLI or other godforsaken tools (has to work across systems)
https://github.com/games647/FastLogin/blob/812cf21ad0ac565c3211fa63e2a9dd89fe2f0f62/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/task/ForceLoginTask.java#L95-L102
This is how they check if player is premium/cracked, not sure how this is reliable ?
how do I get the PAST location in an on move evnet or do i have to use pdc or smth
are there any instanceof switch modules
switchinstance (object) {
case String.class: //blah
}
i dont literally mean this syntax but is there a quick way to do this other than multiple if statements
that is whether the player is online, not whether the player in in online mode
PlayerMoveEvent#getFrom()
ty!
That will not work
If the player is connecting through an offline mode connection the UUID of the player will be random for our means
I thought it was based on name
It is predicable yes
But random for our intents and purposes
Again, if the player is connecting through an offline mode connection (which they will if you are running an offline mode server), they will always have an offline mode UUID that is "randomly" chosen based on their name
In theory this would work unless the cracked account is using the username of a premium account
That too lol, spoofing is not a thing
if you do this across servers then you already know that those being on online mode servers are on premium accounts and those being on offline mode server are possibly (but not definitely) on cracked accounts
basically you use a proxy that is running in offline mode and a proxy running in online mode
This is why we don't make cracked servers
And yes that, cracked servers are kinda difficult to manage
You know the player name and that is it
If ip-forwarding is disabled you will also know with which proxy the player is connected to
they will join trough online proxy every time
yap that might be problem
yeah, but large number of household internets are not static ips
VPNs
UUID passthrough
or worse their IP gets changed
Paper for sure has this, I believe spigot has it too
I still don't understaind how this works
i mean i know there are alot of those kinds
of plugins
but i just cant think of any way ¯_(ツ)_/¯
It just checks if the player is already on the server
Exactly
what does
this mean
then
isOnlineMode is at the bottom
yeye
i saw now
its not about server but player
but im just blind
didnt differate two methods
its in fact meant to work just in offline servers
it would
It makes use of proxies for that part
it is basically just a ternary
var var10001 = this.isOnlineMode() ? PREMIUM : CRACKED;
it is
Yes, I was just underlying that the order didn't matter
It's basically a one line if else
if (condition) then A else B
No
true ? "A" : "B" will result in A
This will return premium
if true
correct
Is creating my own tuple class a good option if i need somewhere on a grid
coordinates
java doesnt seem to have one or i havent found it yet
You mean something like a record Point(int x,int y)?
yeah thats what ive done pretty much
i was just wondering if java has any stuff for that
without me creating my own
its like a line but yeah
There is Map.Entry<K, V>
HOWEVER I strongly prefer using long if the two parameters are ints
depends on their design. they could be using Deque
Creating objects is costly, but converting between primitives and objects is extra costly
hashmaps do not keep order unless you use linked hashmaps
If you just want to have something like Map<MiniGameType, Deque<QueuedPlayer>>, then go for it
if ur looking for a queue the simplest is using a Deque
Just remove five players that are at the tail of the queue
And insert any incoming players in the head of the queue
you could
But it is kinda difficult to do that with spigot API
found this the other day. might be fun looking into https://github.com/GamerCoder215/MobChip
You probably can make zombies and other melee mobs attack a bat or something at a certain place, but otherwise it gets complicated
how can I tell when its safe to unload/load a world
pretty sure you can tell by checking if there are no players in that world
what I mean is
for locks to disappear
or sth
when I try to unload/load a world twice my server crashes
i don't know which one(s)
what's the most efficient way to change a mob's target distance?
session.lock?
when I unload?
manually?
i dont know
java.nio.channels.OverlappingFileLockException: null i got this exception
so delete after unload?
then load again?
this is not a permanent thing
its for a plugin, without server restarts
the world isnt perma locked or anything
i can unload the world