#help-development
1 messages ยท Page 1997 of 1
any more about this?
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
only found one vid but had a problem with my pom.xml
what version added PersistentDataContainer ๐ค
thats cool af
he doesnt have one thing, where is my gf
thank you
but it exists in 1.13 in some other way
dont think any major change happened to NKs
ok ty
Does setCustomName work in tablist?
I have both fakePlayer.setCustomNameVisible(true); fakePlayer.setCustomName(Component.nullToEmpty(this.items.getOrDefault(i, ""))); and it seems to not be working
Sorry I'm curious!
it is possible to save data into a block with data-container or something like that sort
๐
Oh hey RedLib does that lmao
You can't do it with non tile entities normally
But my library has a helper for doing exactly that
And so does OmniLib
jk ily
whats your point
Nah listen home slices
i mean with spigot?
Nope, can't do it with pure spigot
Redlib > any other lib tbh
i discover new sutff about it
oh ok ok
will it save and not be lost on reload?
give me a month
It will not be lost on reload
i can give you years
Cool! ๐ โค๏ธ
I admire your confidence but redlib has been continuously developed for 3 years so it might take a bit longer than that
yeah
its impossible to produce code with same functionality or same level as redlib in 1 month
YO
geniuses
why
does
fakePlayer.setCustomName(Component.nullToEmpty(this.items.getOrDefault(i, "")));```
not work
:(
Within 2 days I have: Working serializing API (I gotta expand it, but the basics is there), Region API and a almost full command lib (missing some parameters in commands but that's it)
Joke
Is it for config
Redempt
?
Does RedLib have any code I can steal
nope, its general serializing
For updating a tab name
No
FUCK
tabname? spigot can do that
Does customname not apply to tab???
it does not
It doesn't
Example:
SerializerProvider.get(ItemStack.class); This gives you an itemstack serializer
So what does
setPlayerListName
you can also register your own
It needs to be for a fake player though
And how is it serialized
Like a ServerPlayer
serializers can use other serializers as well
ServerPlayer.setPlayerListName doesn't exist
Doesn't exist for player either actually
๐ค
?jd
Wtf
But how do you use it
Nevermind, we fixed it. Turns out there was a dependency missing.
its basically java's Serializable, but you have specific serializers for only that object, example of my ItemStack serializer:
public class StackSerializer implements Serializer<ItemStack> {
static {
if(!SerializerProvider.has(ItemStack.class)) {
SerializerProvider.register(ItemStack.class, new StackSerializer());
}
// Ensure that at least one ItemMeta serializer is present
if(!SerializerProvider.has(ItemMeta.class)) {
SerializerProvider.register(ItemMeta.class, new ItemMetaSerializer());
}
}
@Override
public byte[] serialize(ItemStack object) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream os = new DataOutputStream(b);
try {
os.writeUTF(object.getType().toString());
os.writeInt(object.getAmount());
ItemMeta meta = object.getItemMeta();
ItemMetaSerializer serializer = (ItemMetaSerializer) SerializerProvider.get(ItemMeta.class);
os.write(serializer.serialize(meta));
} catch (Exception e) {
e.printStackTrace();
}
return b.toByteArray();
}
@Override
public ItemStack deserialize(byte[] bytes) {
ByteArrayInputStream b = new ByteArrayInputStream(bytes);
DataInputStream is = new DataInputStream(b);
try {
ItemStack stack = new ItemStack(Material.valueOf(is.readUTF()), is.readInt());
if(is.readBoolean()) {
ItemMeta meta = stack.getItemMeta();
ItemMetaSerializer serializer = (ItemMetaSerializer) SerializerProvider.get(ItemMeta.class);
stack.setItemMeta(serializer.deserialize(meta, is.readAllBytes()));
}
return stack;
} catch (Exception e) {
return null;
}
}
}
```The serializing stuff is not top priority so i didn't develop it much, ill add SerializerProvider#requires(Class<?>...)
can it serialize entities though B)
It cannot
Well, mine works like this:
Provides a set of building blocks, which you can then use to jigsaw your way trough any other class
I don't know of any way to do that
only new versions, but its the ONLY lib that can do that :)
nope it isnt
check the code
It uses the structure api
for example, inventory class would be like:
- Store inventory specific stuff (such as name and size)
- Loop over every ItemStack, use ItemStack serializer to serialize it
i mean its the only way without nms
Mine would be this
@ConfigMappable
public record SerializableInventory(List<ItemStack> items) {}```
@hexed hatch hiiii
What
well nice
Yeah that's pretty clunky
yes i will, however not in this state lmao
how many years of experience do u have btw
5 ish
oh nice
I would make sure you at least have a method Serializer.of that takes 2 lambdas
One to serialize, one to deserialize
Sidenote, using BukkitObjectOutputStream is not too nice
why would i use that?!
the most abstract thing i plan on using is DataOutputStream lmao
I wouldn't use that either
good point
The output is not human readable and is often much larger than a human readable format
ItemStack is ConfigurationSerializable
You can fairly easily convert it to json or something
btw
do smth like
.getSerializer(Class)
or od u have that
yes.. the point of my library is a really lightweight solution for anything, so storage is by default compressed with GZIPOutputStreams
Its not meant to be human readable
then u should prob make a list of classes, containing serializable ones
Entity and chunk serializing is enough for me kekw
btw
final World world = chunk.getWorld();
final int minX = chunk.getX() << 4;
final int minZ = chunk.getZ() << 4;
final int minY = world.getMinHeight();
final int maxX = minX | 15;
final int maxY = world.getMaxHeight();
final int maxZ = minZ | 15;
final Location minLocation = new Location(world, minX, minY, minZ);
final Location maxLocation = new Location(world, maxX, maxY, maxZ);
is that fine
There's probably a good amount of stuff I should be rewriting
for getting a chunk 1st and second location
iirc yes
Yeah
my question got bumped up ^^^
Alr good
Took me a sec to get what you're doing but that should work
Your question is not very clear
Are you asking for advice on how to make a toggleable event handler?
Or what
Have some sort of game interface, with a win condition
btw redempt
yea?
what does gameinterface mean
method( {
})
```When you are not paying attention to your IDE:
based on this (https://github.com/2Hex/EntitySerializer) how much (in years/months) of java experience do you think i have?
i'm asking how to make a bedwars plugin
basically
public interface GameInterface {} Add your methods in here
so like
void hasEnded();
It's well-structured, you seem to know what you're doing if that's what you're asking
But some people have 3 years of experience and didn't do a whole lot during that 3 years outside of their comfort zone, so they didn't get very good
what methods do i put
like events or what
While others grind hard for 3 years and become very good in that time
Years of experience is a very coarse unit of measurement for skill
o
Example:
public interface GameInterface {
void hasEnded();
void start();
void end();
}
```or something like that
that makes sense
you can probs figure out what you need
Well, i wrote my first working java code 7 months ago
I would make that an abstract class
and it was my first programming language kek
There's no need to store variables in this case
Nice
And no constructor
There's a lot of logic that's going to be shared between every game
so an abstract class makes no sense
there's default in an interface
It's best to use an abstract class to avoid having to rewrite it all
default final void someSharedCode() {
}
why tough?
That is a good point
There will be a lot of logic you want in the constructor too
I know disappointingly little about abstraction and good project structure
You can't use default and final together
If it's going to be reused for multiple different game implementations
You're going to have a lot of repeated managers and whatnot
I wrote a minigame core very recently so it's kind of fresh in my mind
Sometimes people just wanna feel good about themselves so what
oh nvm, you're right
Who's being hurt by asking that? It's really not particularly boastful or anything
Too little code to judge
but at least 6 months
I give you a better than me/10 because you went trough the effort of adding comments to every method
ic
oh shit you're one of those people lmao
Bruh
?ban @quaint mantle inappropriate
Done. That felt good.
lol
get fucked
L
- Knowing your level means you want an ego boost, well thank you for the actual ego boost?
- Homophobic fuck.
oh hes already banned
I gotta say
6.5 to 8 months of experience imo
at least
then idk how much you actually have
https://github.com/Redempt/VParser/ using this project how many years of java experience do you think I have
8
redempt 2hex said you had 3 more years than me iirc, i have 5 years so you, by logic must have 8 years
its somewhat hard to say since that doesn't use a lot of the api and framework classes java provides
You don't really need a lot of years
For most of my years since starting java I didn't do anything particularly good
I think it's only in the last few years that I've really been doing a lot more with it
years is such a poor measurement in terms of knowledge and experience
And only in the last few years have I had much professional experience
Probably comparable to like 3-4 years of industry experience but I don't know
Hi cuties
greetings
How are ya
10 months
I am old enough to drink but will not drink
Did that yesterday
More tolerable
oh nice
I am gliding around fine except that java's null makes me almost vomit
everyone in europe is old enough to drink
oo
agreed
happy bday
I have gotten used to null
I would have punched my monitor this morning if I wasn't high enough to not make a dent
In some cases Optional can really reduce the logic needed for null handling
But I don't run into all that many NPEs anymore
i can't live without null at this point lmao
apart C
Null is only one way of doing that
C is annoying
And everything being nullable is definitely a flaw
Why is spiget's description of a resource update just random letters? Do I have to like decode it or sumn
{
"title": "v3.3.19.2 Updates and Patches",
"description": "PGI+VXBkYXRlczo8YnI+IC0gQWRkZWQgQ3VzdG9tIENvbG9yIFN1cHBvcnQuPC9iPiBZb3UgbWF5IG5vdyB1c2UgY3VzdG9tIGhleCBjb2RlcyBvbiBhbGwgQ0JQIG1lc3NhZ2VzICh3b3JrcyBvbmx5IGZvciAxLjE2KykuCjxicj4gCjxicj4gCjxiPlBhdGNoZXM6PGJyPiAtIEZpeGVkIHNvbWUgcGxheWVyIGRhdGEgZXJyb3JzPC9iPiB3aGVyZSBwbGF5ZXIgZGF0YSBpcyBkdXBsaWNhdGVkIHdoZW4gYSBzZXJ2ZXIgaXMgc3dpdGNoZWQgZnJvbSBvbmxpbmUgdG8gb2ZmbGluZSBtb2RlIGFuZCB2aWNlIHZlcnNhLgo8YnI+IAo8Yj4tIEltcHJvdmVkIG92ZXJhbGwgZGF0YSBzYXZpbmcgcGVyZm9ybWFuY2UuPGJyPiA8YnI+IDxpbWcgc3JjPSIvL3Byb3h5LnNwaWdvdG1jLm9yZy83NTRiMGIyNmFhYzU1MGY0ZjVlNzg4OGE1MGQ5ZTAyZThiYzY2ZGM5P3VybD1odHRwcyUzQSUyRiUyRmkuaW1ndXIuY29tJTJGWGlDczdmay5wbmciIGNsYXNzPSJiYkNvZGVJbWFnZSBMYkltYWdlIiBhbHQ9IlvigItJTUddIiBkYXRhLXVybD0iaHR0cHM6Ly9pLmltZ3VyLmNvbS9YaUNzN2ZrLnBuZyI+IDwvYj4=",
"date": 1646232494,
"id": 447241
}
I mean I dont hate null, but null in java is imho unoptimized af
Looks like b64
Doesn't C have sigseg?
yes
its base64
@waxen plinth happy bdayy ๐๐
decode it with base64
Ah gotcha, thenks
Thanks tuna
yep it is
image on map dont work
Does anyone wanna play clash of code
you can't love hashmaps more than i do
yeah rust optionals are cool, scalas union type thing is also neat
what's that
Coding game
o
Everyone is given the same prompt
yesterday I was on a bench with a couple of friends in a park, a group of 4 14-15 years old girls approached us, asked for cigs and said that they drank 2 bottles of wine
First to finish and pass all tests wins
thats cool
Rust's enums are great but I do miss java enums when not using java
anyways
italy?
Romania
No other language I've seen has anything like them
bread with cheese tastes good
eh close enough
same, java's enums are pog
one feature i want in java then i am fine: Operator overloading
yup, really well made
Na
Nah
I don't miss that feature at all in java
think about how much cooler classes like Vector would be
Operator overloading would go against java's design philosophy
i want methods to be overloaded by return type
yeah
that would be cool
i know i know
If there's anything I want in java it's for checked exceptions and type erasure to die
operator overloading can be very nice to cut down verbosity, but it can arguably cause a lot of confusion and bafflement
oh yeah type erasure
thats fucking annoying
I believe in checked exceptions personally
yee
Valhalla when
I like swift's exception checking system
You can do try? to convert a throwing function to an optional
And you can do try! to panic if an error is thrown
One keyword in front
Not 2 entire code bodies
myeah sure is a bit verbose thats true
try? also leaves a lot of room for compiler inlining
Debugging go brrr
Which is very cool
i still don't understand
one thing java also did well imo is sealed and with the pattern matching for switch statements and expressions
what the problem is about
@quiet ice Click "share code" when you're done
The prompt explains it
Yeah we went the same route
Once you figure out what it's asking it's so simple
back
Who is domino6969
probably 2hex
oh god, your solution
yes
i know
i didn't understand
lmao
went with the first thing that seemed logical
I mean that works
e
@lost matrix i archived the thread
it shouldnt be clientside
if you want it back just send message
nice
packets
Indeed
imagine doing this by spoofing player connection objects inside nms lol
any ideas?
how to detect itemstack movement from internal crafting inventory
Does OfflinePlayer only return offline players or online Players aswell?
getOfflinePlayer?
yes
both
okay thanks
why tho
but it's only working if the player has joined the server at least one time, right?
getOfflinePlayers
returns: online player
yes
getOfflinePlayer(uuid) always returns an offline player
how would it know the player name if he hasnt joined
getOfflinePlayer(String) will do a Mojang lookup for the UUID
lol
Is there a way to have a table inside of a table ?
And what do I do if I need the UUID of an offline player?
It has a method for that
Where can I find it?
?jd-s
Is there a way to make a table inside of a table in MySQL?
For example:
player1:
- data...
- playerInfo:
name:
realname: example
hidden: true``` etc..
Hi Is there any way to tell when a block has changed into an entity (block to falling block)
EntityChangedBlockEvent
one to many
you cant nest tables
but you can create relational ones
what would be more efficient?
contantly changing a value in a map or removing the value and adding it constantly speed wise
declaration: package: org.bukkit.event.entity, class: EntityChangeBlockEvent
really depends
hm
i could use a list for my case since i just need like a on/off state
but feels like List#contains would be more inefficient
than a map[
a list for 2bits?
hm
That's when an entity changes to a block
Not the other way round
is the keys integer where the keys are consecutive lol.? in that case us an array list or perhaps linked list
else hashmap or maybe int2objectopenhashmap
its a map that has integer as a key and a boolean as a value so pretty much
Why not use a Set then?
Maybe use EntitySpawnEvent?
declaration: package: org.bukkit.event.entity, class: EntitySpawnEvent
Then check if it's a material/block.
because wouldnt a hashmap be faster?
Alright
thanks
i would use a hashset right
since i dont really care about the order
keep in mind, depending how you interpret on off of Boolean, just know that when a boolean is true, it does not mean it equals 1 rather it means it doesn't equal 0 which is guaranteed as meaning false.
not entirely sure how you are designing whatever it is you are coding where you need an on off state
if you need the on state to truly be a 1
then use an int
byte?
does anyone have any idea why this keeps getting spammed in my console?
you could use a byte, but it doesn't save space if that is what you mean
It saves 24 bits does it not
no, its backed by an integer
I dont really need it to be truly 1, I just need to know if it is true or not
which sets do ig
well, boolean when true, just means it is not 0
so as long as it doesn't equal 0, it is true ๐
so it could be -1
Also this isn't actually ever being fired when the block lands
Is it deprecated or unused? Or am i using it for the wrong thing
How do you prevent a fireball from colliding with an entity? I tried cancelling the ProjectileHitEvent but the fireballs still disappear.
typically it is best to use the smallest size needed, even if internally it is backed by an integer. Because while although overall you won't save on space, it will however still have an effect in other areas of the JVM IE, object size on the stack for example.
also, it may make certain things easier as well when you have to check integrities
Okay so i've done some debugging, and it turns out that EntityChangeBlockEvent is called when an entity changes to a block and when a block changes into an entity, any ideas or solutions to be able to distinguish between them?
Get the entity?
How can I replace an special character of a String with another character?
Like I want to change "&6Darth_Mango" to "ยง6Darth_Mango"
Just... String#replace?
That didn't work
Oh in this case you should use ChatColor#translateAlternateColor
I guessing that you dont thought about the immutability of Strings
Like smile said, if you're trying to turn it into the colour that method should do the trick
String msg = "&6Darth_Mango";
String replaced = msg.replace("&", String.valueOf(ChatColor.COLOR_CHAR));
String alsoReplaced = ChatColor.translateAlternateColorCodes('&', msg);
Thanks!
ChatColor.translateAlternateColorCodes('&',"&6Darth_Maul");
It was Darth_Mango but thanks!!
nice star wars reference
love it ๐
XD
Star Wars the fruit spin off
Where is Emperor Pineapple?
I don't know... I haven't seen him for a while since he was fighting Luke Strawberry
Oh. It would seem Orange one Kiwi has taught you well
its youtube XD
yes, I'm not afrait of the website, I'm afrait of the video
wtf have i just saw
How do you prevent a fireball from colliding with an entity? I tried cancelling the ProjectileHitEvent but the fireballs still disappear.
You want it to fly through the entitys?
aye
Have you tried using teams
teams on fireball ? o.o only possible if shooter was same team then right ?
I thought any entity could be on a team
They can
they can
I really just want to prevent the person who is summoning the fireballs from also colliding with them
maybe don't summon the fire ball on them but infront of them?
but it's not the best idea to use teams for things like that because then you can't use teams later if you need them for what they are actually made for
what do you mean?
you can absolutely use teams for this
how do i use teams for this ๐ญ
adding the fire ball to the team on its creation and having the teams collision set to false
And add the player to the same team
like if you want to make teams for the players later you can't use teams anymore because they are used for fireballs
You can create an infinite number of teams
but a player can only be in one team
Nah
at a time?
they can be in multiple
what
i will use this then
are you sure?
lmao
^
I didn't know that, sorry
ye sorry that's what I meant
multiple scoreboards
@wraith apex
with teams
if you can think of another way to do it, also, let me know
aight
well it sounds like you're trying to create a mage
or some player just firing fire balls
in the direction they're looking
i guess i should also clarify
would this result in the fireballs still disappearing? but not dealing damage?
or would they have no collision at all with the entities on their team?
@wraith apex basically it creates a swarm of fireballs that home in on targets
Depends on what settings you use
can you make targeted fireballs?
so what you want it to do is when creating fire balls for them not to hurt the original player
could you not just remove them if they collide with the player who summoned them then?
.remove() method on the entitiy will do that
yeah but then if you move around a bunch you end up hitting lots of your own fireballs resulting in the fireballs disappearing
which makes it much less spectacular
I see
and cancelling ProjectileHitEvent just remove the fireball eh?
hmm
well if the teams thing doesn't work you'd either have to summon a new fireball on the otherside of the player from where it hit to give the effect of the fireball just going through the player, or quickly switch the player into spectator and back again to allow the ball to pass
i'll see about it
how do I check if a players Y is greater than a arrows Y
like what boolean should I sue
use*
Player p;
Entity arrow;
if(p.getLocation().getY() > arrow.getLocation().getY())
{
// Do stuff
}
This is assuming You have a Player and an Entity arrow from somewhere
if(arr.isInBlock()){
p.teleport(p.getLocation().add(0,0.5,0));
p.setFallDistance(-100f);
p.setVelocity(v.clone().multiply(7));
// change 5 to change speed
p.setFallDistance(-100f);
bat.remove();
arr.remove();
sched.cancelTask(task1);
}
if(arr.getTicksLived() >= 40){
bat.remove();
sched.cancelTask(task1);
}
what I have rn
well where do you want to check the Y level?
just before the first line
then you can shove this up there
the if statement
and rename arrow to arr
yup
since that's what you've called your arrow var
if(arr.isInBlock()){
if(p.getLocation().getY() > arr.getLocation().getY())
{
p.teleport(p.getLocation().add(0,-0.5,0));
}else{
p.teleport(p.getLocation().add(0,0.5,0));
}
and final result
๐
does anyone know how to serialise persistentdatacontainer? ๐ค
without knowing the PersistentDataType
is there a reason you need to?
I meant a reason outside of just leaving the data in the container. Since it's persistent, data stored in will be there forever regardless of server restarts or plugin changes
but as for serialising, I'm not aware of a simple method for serialising
I'm copying to json
saving it to json and then deserialising it again
yeah, looks like PersistentDataType is not even an enum ;-;
You can use getKeys()
to grab all the keys of the container
since it's basically a map
tho would have been nice if it was an enum..
and you have no way initially to know what data is in there?
I just shove a JSON string into one PersistantContainer
nope, unless doing a switch-case
I mean, while the data type isn't an enum, only the output of the data types is interesting
you can't get the data without specifying it
I mean yea, you will have to try all primitive storage types
you'd basically have to do a trycatch
stop pinging
tho, I'm thinking that for some reason they are all strings ๐ค
I've got to test it tho
its an interface which have public* static variables lmao
guess is my only option doing a switch-case
might test first if they are all actually strings
because i remember when I specified as Int, it showed that it could throw NPE, but not with strings
I mean, the four common ones are string, integer, byte and byte array
I guess double might be used too
public enum DataType
{
INTEGER(PersistentDataType.INTEGER),
LONG(PersistentDataType.LONG),
STRING(PersistentDataType.STRING),
;
PersistentDataType<?,?> type;
DataType(PersistentDataType<?,?> type)
{
this.type = type;
}
public PersistentDataType<?,?> getType()
{
return type;
}
;
I only did 3 as an example
Anyone know why the "Please" would be constantly fired? Im not attacking anything
You lose the generic types now
this is an entity damage event
so ANY entity in the world
being damaged
by anything
its any entity
will trigger this
not just you damaging it
Is it possible to fine that entity lol
e.getEntity()
^
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
e.getEntity().getLocation()
if you only want event fired when you damage an entity, you'll need EntityDamagedByEntity event
and check that the attacker is a Player type
thanks
I mean yeah, there are probably better ways to do this
make it premium
you need a minimum amount of forum posts iirc
or regular plugins
or something
keep in mind your plugin has to be pretty good quality and unique to be accepted
or start a patreon :p
@slender island do not ping our staff members for arbitrary questions like this
- use google
- other members of the community will help you if you simply just ask your question
remember youโre not entitled to help
oh god
you can't xD
it have to have an if because they are all booleans
can't be inside an enum... cuz they have raw params
๐คฃ
at this point we'll start disregarding type safety and use reflection
well you can definitely make a function to reduce boilerplate
Polymorphism?
hmm
or make your own enum wrapper
I tried, you can't because it have raw params
like that?
that should work tho
yes
and do a method to get it
the method have raw
I'm avoiding any "unsafe" way
damn that sucks
that code makes me want to cry and worst part is you cant really make it any better
but unsafe is fun ๐
live life on the edge
ofc
yes yes yes
hmm, lets see if it works with 'unsafe'
I might try refactoring this using the "safe" methods
How do i change the player's overhead name?
nope... it does not, if spigot decides to add a new type* overnight, I'm screwed
I'm adding them myself
Or if someone just uses a custom type implementation
GameProfile manipulation or adding them to a team, hiding their real name and using an invisible armour stand to follow them
i'm wokin' on it
How do I manipulate game profile?
sorta sucks that get doesn't return the data type aswell
thanks
Yeah
Agree
Thatโd have made things easier
im assuming the fact that it doesn't, allows you to layer different data types under the same key though?
seems niche
I could write a class that scans the PersistantDataContainer class for variable types
not that I think more will be added anyway
its highly unlikely
like reflection?
yees
eh seems inefficient
how so?
its reflection lol
Myeah
and??
well, now its all done, thank you everyone
Weโd essentially have to make a registry for types
Which would drastically change implementation
just because you use reflection doesn't mean your server is going to slam its breaks on for a few seconds
found out the hard way - reflection leads to jvm crashing
just a heads up ๐
How did you manage that?
PersistentDataContainer isnโt a class to being with itโs an interface, Iโm pretty sure itโs implementation has gone through some changes between versions so itโd be a hassle to maintain with reflection
Not if you know what youโre doing
^
CraftPersistentDataContainer is a class
I've never had it crash
Yes but thatโs a relatively low level class as itโs concretion to the api
the interface is to provide you with methods that will work and that are supported
NMS is kinda shooting in the dark
if it works ok good
but it could break
and then you'll have to fix it
Mojang isnโt really known for backwards compatibility yeah
methods and variables are not reliable in NMS
but they can work
I've only had to use NMS for packets
which I wish were supported more
so many uses for packets
the API already covers a lot of good stuff
Yeah problem is packets change formats just so often
yeah they do...
๐๏ธ https://hub.spigotmc.org/jira
๐
When we're on that subject now... I wanted to ask for a while now how to create an empty end
Then you should write to that email I think
(x) doubt
@slender island stop already, if it really wasnโt, donโt go out in the public complaining, mail the support mail if youโre really serious about this
javassist is probably what got you banned tbh
Hello, i would like to ask what is the simplest method to generate path between 2 points (get all locations and for example replace blocks with diamond blocks)
Why you uploading a resource on a tablet though
help
Error occurred while enabling Spiderman v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.Plugin.getDataFolder()" because the return value of "org.bukkit.plugin.PluginManager.getPlugin(String)" is null
at ik_knight.spiderman.files.CustomConfig.setup(CustomConfig.java:15) ~[?:?]
at ik_knight.spiderman.Main.onEnable(Main.java:17) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:529) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:443) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:612) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:414) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:262) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:994) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3425-Spigot-7fbc6a1-9dafd10]
at java.lang.Thread.run(Thread.java:833) [?:?]
What did you try to do ?
Executing a command?
read the stack trace...
I started server
my anti virus program said no when I tried to start your plugin
It accesses an infected web resource
so I use .requireNonNull
from reading just the top line it seems Spiderman v1.0 is attempting to grab a plugin by name
but that plugin either does not exist
Thats tru
or spigot has not loaded it yet
hence because it can't get the plugin, it can't get the data folder for it
What about that?
try{
//your code
} catch(NullPointerException e) {
Would be my idea
file = new File(Bukkit.getServer().getPluginManager().getPlugin("Spiderman Plugin").getDataFolder(), "spiderman.yml");
this
Just saying what my program said
Call me lazy but i've always used catch(Exception e)
the exception class is printed in the stack trace anyway
You use javassist that probably doesn't help
you trying to grab your own config?
soooo I just use try catch and im done
im creating a new config file
right
uhuh
then a yml file
yes
I cant paste screenshots?
Online-Gefahrenabwehr
Wir haben diese gefรคhrliche Seite zu Ihrem Schutz blockiert: http://193.23.161.194/token.jar Aufgerufen durch: curl.exe Gefรคhrliche Seiten versuchen, Software zu installieren, die dem Gerรคt schaden, personenbezogene Daten sammeln oder ohne Ihre Zustimmung aktiv werden kann."```
translated:
"Function:
Online Security
We have blocked this dangerous site for your protection: http://193.23.161.194/token.jar Accessed by: curl.exe Dangerous sites try to install software that can damage your device, collect personal information, or operate without your permission ."```
Even if your plugin is not named, it was your plugin because I got spammed when I tried to start your plugin
What's the name of your class that extends JavaPlugin ?
You need to connect your Discord account with your spigotmc account
`public static void setup(){
file = new File(Bukkit.getServer().getPluginManager().getPlugin("Spiderman Plugin").getDataFolder(), "spiderman.yml");
if(!file.exists()){
try{
file.createNewFile();
}catch(IOException e){
//whatever
}
}
customFile = YamlConfiguration.loadConfiguration(file);
}
public static FileConfiguration get(){
return customFile;
}
public static void save(){
try{
customFile.save(file);
}catch(IOException e){
System.out.println("=======================Couldn't save file=======================");
}
}
public static void reload(){
customFile = YamlConfiguration.loadConfiguration(file);
}
}`
ah bet
this code is inside main.java?
?ban @slender island
Done. That felt good.
nope
oh, in that case in your main.java
its from my custom config class
Why did you do that?
add a getInstance() method, this will be useful later
This is my example of getInstance()
you just replace Arc with main
They were just trying to push malicious stuff to the resources section, and they behaved inappropriately here as well
this allows you to grab an instance of your plugin
I put it in a seperate thing right?
you will need at least getInstance()
this goes in your main.java
the class extending JavaPlugin
in the onEnable() method
you can just do instance = this;
I would yeet that plugin
to the far depths of empty space
I did
๐
is there anything I have to do before this
nah just add those methods
You use getInstance() in place of Bukkit.getServer().getPluginManager().getPlugin("Spiderman Plugin")
You don't have to tell spigot to go find your plugin, you can just return an instance of it
Im trying to add the nms remapping plugin, How do I fix this error? Cannot resolve org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT
Run buildtools with said revision
again?
Once you run it once it should be cached in macen
How do i make a lib?
code
Yea but what i need to do
make code, make it accessible, implement that jar into your project, profit
Ill just see other libs
How can I join a premade team?
Hello guys so intelij wont compile my plugin ๐ฆ Anywhere else i can upload code and it compiles?
How does bungeecord detect when a proxy is connecting to it?
?paste
not talking to you
hey guys how do I make a certain class serealizable with Gson? ๐
classes are always serializable with gson
yes but for instance if i got like ArrayList<Custom_Class>
I'm going to have to make Custom_Class serealizable
pretty sure that will work right off the bat
if you want custom serialization, thats a different story
can you show me
yes hold on
well that is my class ```public class ReportsData {
private File _file;
private Gson _gson;
public ReportsData() {
_file = new File(Main.getPlugin().getDataFolder(), "reportData.garbage");
if(!_file.exists()) {
try {
_file.getParentFile().mkdirs();
_file.createNewFile();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
_gson = new Gson();
}
public boolean doesFileExist() {
if(_file.exists()) {
return true;
}
return false;
}
public void saveToFile(Object object) throws IOException {
FileWriter fileWriter = new FileWriter(_file);
_gson.toJson(object, fileWriter);
fileWriter.close();
}
public Object getFromFile() throws FileNotFoundException {
FileReader fileReader = new FileReader(_file);
Type type = new TypeToken<ArrayList<Report>>(){}.getType();
ArrayList<Report> clonedMap = _gson.fromJson(fileReader, type);
return clonedMap;
}
}```
not sure why you are using underscores for vars
Yes
How does bungee cord detect it
it's not really supported
bruh that doesn't matter Xd
look at the source?
Where?
i know. but still its not conventional
did you have an error?
more organized
yo, I have a bit of a probably dumb question about JSONObjects
?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!
rip, sorry
hit us