#help-development
1 messages · Page 1813 of 1
random question for the devs/contributors. I had an issue a few days ago with the Entity.remove() method. md_5 was online and said the issue was indeed a bug and i should report it. I was finally able to get around to submitting it today and he had already corrected it. I am not very fluent in searching through the changes logs and, to avoid me doing this in the future, would anyone be willing to school me in searching/viewing changes to the patches?
View the Bukkit, CraftBukkit and Spigot changelog.
Ooh, fancy site
How would i make a full bed? If i try just spawning the block, it turns into just one part of the bed so how would i make it into the full 2 block bed
Gotta place both parts
Beds are made of 2 blocks, you have to place both with the appropriate data
ok and how would i place the other part of the bed
like whats the data
theres only one Material for a bed
but theres diff colors of beds
Much easier then trying to go through the stash commits! thanks
@timber whalegive me a moment i jsu had code for that due to the POI issue md_5 just fixed.
Think I’ve come across an issue too, I should probably fix it
nah this actually annoying
how do you post code blocks on here?
?paste
i am on a work computer and would like a native way as I have seen done in the past. I have my computers locked down pretty hard due to my job.
so
if you put three of these ` symbols next to eachother and then type java you can paste it in there (make sure to enter after typing java no spaces)
```java
<code>
```
that
thanks!
the code I used to set a bed
my set bed method
public void setBed(Block start, BlockFace facing, Material material) {
for (Bed.Part part : Bed.Part.values()) {
final Bed bedData = (Bed) Bukkit.createBlockData(material, (data) -> {
((Bed) data).setPart(part);
((Bed) data).setFacing(facing);
});
start.setBlockData(bedData);
start = start.getRelative(facing.getOppositeFace());
}
}
thank you
np
Whats the diffrence between
runTaskLaterAsynchronously
and
runTaskLater
One is async
one isn't
@EventHandler
public void OnBlockBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Block block = event.getBlock();
if (block.equals(Material.STONE_BUTTON)) {
block.getDrops().clear();
player.getLocation().getWorld().dropItem(player.getLocation(), new ItemStack(Material.HONEY_BLOCK));
}
}```
this should drop a honey block and not drop a button when a stone button is broken but nothing different happens
ooooo
Button
ahhhh that makes sense lol
the stone button still drops any idea why that dont work
i would investigate the cancelEvent and BreakBlockNaturally stuff.
only because i have had issues with the .clear() on getDrops.
ive used cancel event what does Break block naturally do
you can replace the "Material" on block break to what you want it to be. IF it doesn't seem to "eject" from the block the right way you can leverage the BreakBlockNaturally to get it to "spawn" right as a block break drop
How can i check if somebody is using kill aurp
if(event.getEntity().getKiller().isUsingKillAura() {
event.getEntity().getKiller().ban("Hacker");
}
^
pretty much every anticheat does that
Anyone know a fix for the search function in jd-gui not working with a 1.18 spigot jar?
try recaf
chance
thanks that seems to work
is using get methods like getString for the config reading from the hard drive or is it already loaded?
it is already loaded
What is the result of ProjectileLunchEvent.getEntity ?
Projectile? or Shooter?
Well, it's not ShooterShootProjectileEvent
Indeed
Docs says it returns a projectile too
If you're looking to get the shooter, first check whether that projectile has one, and then try casting
Projectile#getShooter
^
How can I restart a BukkitRunnable?
My code:
public class RepeatingReminder extends BukkitRunnable {
private static final Main plugin = Main.getPlugin(Main.class); // Get this from main
public void schedule() {
runTaskTimer(plugin, 0L, 20L);
}
@Override
public void run() {
// Get everyone online
for(Player p : Bukkit.getServer().getOnlinePlayers()) {
p.sendMessage("test");
}
}
}
I basically wanna stop the runnable then restart it but with a different time that will be coming from the config
Cancel and schedule again
I get this error:
https://www.toptal.com/developers/hastebin/ecozulafuc.properties
says its already scheduled
Already scheduled as 147
#dropItemNaturally
anyone?
Ya got banned from Stackoverflow?
yes
and I tried the Dcheckstyle.skip
but it didn't work
You aren't looking at the solution
I tried mvn clean install -Dcheckstyle.skip
Have you tried looking after the first answer?
yeah I used an instance of the class and when I wanna cancel it I just call the instance and have .close() is that the way your supposed to
I don't know, I don't have your code
when I check if its canceled using .isCancelled() and it says true, but enabling it throws the error
Try creating a new instance of that runnable
And run that
Make sure to cancel the old one
Depending on what you wish to achieve, of course
would that work if this is in a class of its own
Deleted .m2 aaaaand
Are you telling me it's an unfixable problem?
I don't know
I've never had it
I hate maven so I don't use it when I make my own stuff
Maybe look at this
What do you use
as in IDE or?
Oh
I just compile it straight from IntelliJ
as in build artifacts
just a plain java project
Which isn't maven?
Dependencies are jars?
Yes
oh lol
I just import the spigot/bungee/ext. jar
😬😬
How about no
I mean you can do it that way
Just that it might not be the best standard
It's not included in the actual build file because you can uncheck that
I mean it's for sure the easiest imo
im dumb, it worked @worn tundra
Neither is Maven
Is it faster?
I mean really the only changes I made to the bungee as of now is a few strings
Might be
Ohh waitt
Maven is realy eassy to use, you can make a plugin fast with it. And with intellij theres a minecraft addon to make developing on it easier
I usually compile simple projects with a few lines of code so it's difficult to tell
You're working on bungee?
Yes
^
I plan to make more changes, this is just some basics
I don't like people in general knowing the versions of the software we run
Why? ;D
Opens the door to version specific exploits imo and it just looks unprofessional (I have no idea why I think that but I do)
Yeah but it's still a nice peace of mind
and I plan on adding some stuff to the bungee anyways
Believe me the doesnt even care about server software
either way the command is just blocked
the command /bungee returns the version of their own build number
Security by obscurity 👎
We also take other means of security but if it's an option why not do it
I also want to do something like this when I figure out how java DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // server instead of brand
Probably blocked on lobbies
¯_(ツ)_/¯
But they still don't tell you the Spigot official build number
well, it's a fork of latest build of spigot 1.8.8
but they said it is heavily modded
so it would be like their own jar already instead of it still spigot
Players have two hands now
oh too much fabric for me
Hello, the question maybe not spigot related, but anyway. How do you do multithreading in spigot in proper way? I am not primarily Java developer, so I just do
new Thread(() -> { /* code */ });
Everything in Spigot is single threaded, except for chat
And call it a day
?scheduling
Maybe there are more proper ways?
Does this run things in the same thread as in JS/Boost::Asio/Python or it's a real multithreading?
there are seperate sync and async tasks
What do i use to get the light block?
light block?
Yes
what light block
What are you calling a light block?
are you refering to the light level at a location?
no
Explain better then
I mean, promises in JS are also async, but they run in the same thread. If something is async, it does not imply that it runs in parallel, that's why I wanna be sure.
is that a mod?
Idk
No, its in vanilla since 1.17
ah ok, I've not played 1.17
Can i get it on 1.18
Sure you can. The item id is minecraft:light
Hello!
I made 4 packets, is there a way to put them in a List and send them all at once?
I'm kinda lazy to send every packet each..
List<Packet> packets = new ArrayList<>();
packets.add(addPlayerPacket);
packets.add(spawnPlayerPacket);
packets.add(equipmentPacketMainHand);
packets.add(equipmentPacketOffHand);
//send
Bukkit.getOnlinePlayers().forEach(player -> ps.send(packets));
``` something like this?
and `ps` is `ServerGamePacketListenerImpl ps = craftPlayer.getHandle().connection;`
In Spigot Async runs parallet. In a seperate thread
Use the secheduler if you can but theres nothing wrong with using Futures
Okay, thank you!
Yeah but how do i get it
No, this channel is for Spigot plugin development. Everything in here will be Java code or IDE related
/give YourUsername minecraft:light
nothing
perhaps /minecraft:give?
Which version are you at, this feature is only accessible after 1.17
1.18
I just tested this command in singleplayer creative world on 1.18, it works fine
Thats wierd
Also, you should probably ask this in #help-server and not here
Hi, is it possible to cancel a specific trade of a pnj ? (like if a player want to buy a chain armor it cancel the trade)
ye
just listen to Inventory click event
check if the inventory type == Merchant
then check slot type == result
and then u do ur thing
okay nice thx
Does anyone know how i can say, make a random item like a conduit have the same mining speed as a wooden pickaxe or similar without using a haste effect?
Okay so I have a little hashMap that couples a string to a class
however I want to add aliases. Including those in the hashmap would be no problem
but I sometimes need the unique values. Would it be better to sort them out then, or just to keep a list next to the hashmap?
its an identifying Interface
an Entity may be a Creature but it might not be an NPC
ah ok
Listener is also an identifying interface
uhm.... can anyone tell me why my plugin suddenly shows 4,289 downloads on its current version less than 2 hours after posting an update??
wait an abstract class doesnt have to implement interface methods
yea i thought it had to have those methods as abstract
only when it gets to implementation do all abstracts have to be implemented
poor wording, but you shoudl get the point
hi
Is it possible to set Entity's target without invoke EntityTargetevent?
Nms
Mob::setTarget?
how would you safe sql data in json file?
in yaml you could do like setString("SQL.Host","localhost")
how do you do path in json?
Pretty much, just search on how to use Gson
?
i'm running the latest eclipse 2021-09. it keeps showing Missing property "api". in my plugin.yml, which is annoying.
anyone knows how to deal with it or disable the validation?
main: com.meeku.tutorialPlugin.SpigotBlankPlugin
name: SpigotBlankPlugin
version: 1.0.0
api-version: 1.17
1.17 not 1.17.1
fine. but it still doesn't go right.
Just specify the api version 😳
i did.
Eclipse doesn;t care whats in your plugin.yml. Where are you seeing this Missing property?
left near the main, also in Problems view.
I'll need to see the actual error as Eclipse shoudl not care one bit whats in your plugin.yml
anyone ever see a huge spikein plugin downloads out of nowhere? im talking going from like 10-20 per version to 4,000 in a few hours
i don't think so. it actually shows JSON schema for Bukkit Plugin YAML when i edit other properties.
but whatever, this seems like some wrong validations.
i cannot upload a screenshot. 😦
eclipse doesn't show any detail about this except those words above.
does anyone know how i can make a sphere of floating water
without the water spreading
is this still possible? i havent seen anything since like 1.4 release
Is it possible to set the attacker who just attacked the Entity as the Entity's Target?
Bump, it started working for a little bit, but giving me messages like: "The bytecode does not match the sources". Has anyone else had this happen to them?
But now it's back to square one
yo people,
I've got a problam with PlayerInteractManager, it seems not to be working in 1.18 ?
https://pastebin.com/qqb2Htva
I need to make it so NPC spawns when player joins
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
otherwise, NPC disappears after relogging
where and what should I add? I only found solutions online that aren't for 1.18
bruh
should you use static for stateless helping methods ?
or is it in any way a bad practise?
for util methods
yeah
if that class has no state it wouldnt really make sense to instantiate it
true
i like to have a private constructor for util classes
?
big code
could you provide an answer to what I asked?
what about stateless helping methods that are in the same class as other normal code?
for example
public void sendMessage(Player p, String message) {
p.sendMessage("Some Prefix " + message);
}
Is it bad to make that static?
Cuz i always use static to indicate its stateless, or/and to make it useable from elsewhere without having to make an instance
i would put it in a util class
hmm true, should probably use more classes
i just divide my code using comments haha
anyone has any idea on how the content of the "Documentation" thing will look on the descr page?
it would be stupid not to make it static
the one and only valid reasoning imho is: does it need to access any instance properties? yes -> non static, no -> static
Whoow maybe close some tabs 🤪
😄 yeah true
1.16 supports java 17?
yes
Ok thanks
what’s the min gamma mc lets you go with the slider?
How can you get location 2 blocks in front of player based on their body?
It is fine unless it requires depenencies
Static Utility method are absolutely ok
vectors
yeah i'm blind about that
i use this, but it follows where player is looking at
Location npcLocation = player.getLocation().add(player.getLocation().getDirection().multiply(2));
yeah, isnt that right?
so basically i want to spawn a npc 2 blocks in front of player
with that, if the player is looking straight down
it's a new tab
the npc will spawn inside the block under
oh
or set the Y the same as the player?
i'm using the player location
ok
it fixes the player spawning inside a block
but if i'm looking down, it will spawn on the same block
as the player standing
Even with setting y to 0?
why do locations need to be cloned?
Location original = getLocation();
Location cloned = original.clone().setDirection(target.getLocation().subtract(original.clone()).toVector());
They don’t really
However since many of their mathematical operations only mutate its state rather than returning a copy it becomes a problem when you use Locations in for instance hashmap keys
(Which in itself might cause a memory leak)
locations and vectors should be immutable ☹️
ah alright, thanks 🙂
bump
does spigot or minecraft teleport player to a safe location when they're gonna respawn upon a dangerous place?
just try it
no
I mean - set your gamma to the lowest value with the slider, and then check what your config value for gamma is
then you know what's the minimum gamma
Where is this config file located?
Inside .minecraft/options.txt
however be sure to CLOSE minecraft before you check
I think it only saves the file when you properly close MC
but afaik it will at least teleport u to the top block if the spawn point is underground.
i need that solution to find a safe location.
no it wouldnt
I just checked
it's 0.0 i think the min
ok dope thanks
np
no, spigot does not do that
paper does that, but it's configurable
to the top or to a safe location?
regular spigot teleports you to exactly the location you specify as parameter
when i said "teleport", i meant "respawn". sry about that.
I just set my whole spawn chunks to lava
and I keep respawning in lava
so I basically set everything from -100,0,-100 to 100,256,100 to lava and yeah, I die everytime on respawn again
have u tried place a solid block at the top?
btw which jdk are you guys running for development zulu or adopt?
oracle, and on the build server, amazon
what is the difference between gradle and maven?
that's like
what's the difference between linux and windows
both are build management systems etc
but they are inherently different
ok
both are good, just pick whichever you like better / whichever you find easier i nthe beginning
I'd recommend maven but that's just personal taste
I wrote a tutorial for getting a basic maven setup for spigot if you need one
@mighty pier
i always want a setup for spigot which contains mapped server source codes.
Need Expireincd Builders/dev/admin dm me for more info serv info 32ram 8 core discord server is done allredy
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
How did u add this bar ?
Bukkit.createBossBar
yea
its on the website
this?
probably
when i try to use it ...... yeaaa
no
oh
you need to build the server jar your self
?buildtools
wait
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
is it not for 1.18 yet cuz i didnt have to do this before lol
if you use it as a maven dependency
i dont use maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I'm fairly new to making plugins, I couldnt find anything on the subject I want to find.
How would I run another command from another plugin, for example: If someone dies it will run /broadcast [message]
Does anyone know how to use .getId() and .getDataWatcher in 1.18?
for gradle: https://www.spigotmc.org/wiki/spigot-gradle/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Is there a way to load an external library without shadowing it into the plugin?
Why would you want that?
Whats the benefits
pretty sure its player.performCommand("op Notch");
To be able update the library and the plugin separately
Alright thanks :D
np
?
Also, shadowing kinda defeats the modular nature of Bukkit in my opinion, I feel like there should be a better way
?java17
Install Java 17 at https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot
for myself btw
Hello I have a problem with this line if(Bukkit.getBanList(BanList.Type.IP).isBanned("IP")){ return false but when I check in the banList I have the good IP, who have a exemple for me or anyone can help me ?
thx for advance
doesnt ban list return a String list
Bukkit#createBossBar
Ty
yeah one sec
PacketUtils.sendPacket(player, new ClientboundSetEntityDataPacket(((Entity)entity).getId(), ((Entity)entity).getEntityData(), true));
DataWatcher is getEntityData
I use this method for ban and thats work but when I try the same with IP that doesn't work
Here's some code I have for NPC stuff and other things @upper lark https://github.com/JEFF-Media-GbR/JeffLib/blob/master/spigot_1_18_R1/src/main/java/de/jeff_media/jefflib/internal/nms/v1_18_R1/NMSHandler.java
Legend, thanks man!
please, remove the embbed or put your links inside diamond brackets <>
it spams my laptop screen
It is for an EntityArmorstand in 1.18
thanks
They are not called EntityArmorstand in remapped mojang
correct class name in remapped is net.minecraft.world.entity.decoration.ArmorStand
a problem with the parentheses
i think
Thats work```
if(Bukkit.getBanList(BanList.Type.NAME).isBanned(args[0])){
Bukkit.getBanList(BanList.Type.NAME).pardon(args[0]);
but thats doesn't work
if(Bukkit.getBanList(BanList.Type.IP).isBanned(FILE_UTILS.getIp(args[0]))){
Bukkit.getBanList(BanList.Type.IP).pardon(FILE_UTILS.getIp(args[0]));
public static String getIp(String name){
File file = new File("plugins/H-Moderation/PlayerData/"+ name+".yml");
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
return config.getString("Informations.IP");
}
ok I got try
no
use the
ok here
store uuids
then get the player from uuid
and get the player ip
and check for it
Hey !
Do you know how to remove one Biome using NMS in 1.9+ ?
I want te replace all Oceans by Plains 😄
I use it with 1.8, but don't know how to do with 1.9+ :)
Does "ShapedRecipe#setIngredient" only support Materials and no Itemstacks ?
it does support itemstacks but it wont work well with the Crafting table knowledge book
iirc
Ima try it out
as it seems it only supports materials.
if there is no other way, you would need to go over the PrepareItemCraftEvent
declaration: package: org.bukkit.inventory, class: ShapedRecipe
it supports RecipeChoice
which is an internal predicate and stated as This class is not legal for implementation by plugins!
didnt for me tho
ah wait, i oversee ExactChoice
atleast not with the RecipeChoice
it have to exactly match the itemstack if you use recipechoice
Yes
I have that exact item and it isnt working.
Wait, do you mean same meta or something else ?
show the code
This is from the class that implements the crafting recipe
ur using it wrong then
what is new BlobWand().getItem
thats not how it works
you will have to create a new RecipeChoice.ExactChoice instance with your itemstack in it
Intelj cannot find the classes. Do I need to add any additional depency besides the spigot 1.18 api?
as you can see, it is
definitely wasnt
lol
he was casting the RecipeChoice
exactly what i said xD
you didnt need to know what was the BlobWand.getItem()
Well, anyways it works, yey and thx
Gotta check if it is realiable tho ?
Any words of advice before I use this and might need to change it lateron ?
in what way realiable? i mean, you should be able to craft it huh
well, it depends for what it is.
I just want to add recipes that require special/custom items, thats prettymuch it
so then, if it works, it works
ig so
yes, run buildtools, and compile it with the --remapped option
I have a tutorial for NMS remapped things
https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
one word: troubleshooting
why troubleshoot when you can cast objects to random classes instead to not "get red underlines" in intellij lol
thats like saying
Stringgjwefnonawef lol = string;
then asking what did u write in the lol string
shit example but yes
and what would you've done if the getItem method would've returned an ExactChoice object but unnecessarily casted RecipeChoice anyways?
its like a stacktrace, you start searching the problems from back to front.
not when its extremely obvious
its like scanning an entire event listener cuz it didnt work while it wasnt even registered in the main class
Are you sure? I just ran BuildTools using Java 17 and it said it requires versions between 8-14. Maybe I’m doing something wrong 😑
not really, it could've been anything and you would still stuck at the "why doesn't that work? it should work, its an ExactChoice"
your buildtools is probably 2 years old then 😄
it wasn't. your string example is. but thats also totally offtopic
get the latest version of BT
Latest build
can you show the output pls?
well it was extremely obvious even for an idiot like me
now you start talking about something else
its an example
but your example wouldve worked
you thought it was the cast, but it was the method. seems like it wasn't that obv.
what isn't wrong, just unnecessary
it is wrong
You know what? Screw it I’m not going to use 1.16 😊
you can try it yourself. use a ExactChoice and cast it to RecipeChoice. that will work.
Yes
upcasting is also an appreciated way as you just use what you need
but the method name is pretty self explanatory
not really. ExactChoice "represents" an item
how do i get the first 2 characters of a variable?
My server was going great, did a reboot and I got an error: "Out of Memory: Killed process 1365"
add it to the gitignore
read it
uh
why are we arguing about that either way
lol
gitignore gitignore
hum
to get it right
you should include the pom fyi
well its pretty self explanatory that getItem wouldnt return an ExactChoice
and if it did it wouldve worked
define "wouldve worked". compiled? didnt crash or throw an exception? it already did before with the ItemStack. he said it doesn't work to craft, so you would've need to check his approach and items when crafting
casting this to object says its redundant
btw i gtg now
I am trying to extend the JavaPlugin in my Main Method in Spigot Version 1.18 but it cant find this implementation. It tells me "JavaPlugin cannot be resolved to a type" can someone help me?
what
do you have Spigot imported
you can do new Object[] { ... } around your args
I have imported Spigot 1.18 but its just not working correctly. Eclipse is also not able to find the Bukkit class
are you using maven
I am using the Jar File but i think i know the problem. I am trying to Build the Jar File with the Spigot Buildtools because i just downloaded the Spigot 1.18.jar from the Internet
does anyone know why my NPC keeps disappearing after reloading the server
oh thanks
how do i set a specific player (Player object present) as the cause in a damage event?
as if that player attacked the entity damaged
Can somebody point me to a resource on using mojang mappings for development. I can't find anything
<repository>
<id>minecraft-repo</id>
<url>https://libraries.minecraft.net/</url>
</repository>```
how can I get the server softwares name? Say CB, Spigot, Paper, ...
Like you want to know if they are using spigot etc…
if you want to do ^ f3 screen should say
It will be included somewhere in the version string
Bukkit.getVersion() or getServerVersion I think
thanks that should work
Is it possible to move an item frame of the grid?
doesn’t that return like 1.17
is there any armor equip event? i couldnt find one in the docs
not in spigot yeah
believe paper got, and apart from paper there's some lib which implements one using other existing spigot events
same with full component support
how can I set an npc skin if I have the value and the signature using citizens?
NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, ChatColor.RED + "" + ChatColor.BOLD + "Warden");
SkinTrait skin = CitizensAPI.getTraitFactory().getTrait(SkinTrait.class);
npc.addTrait(skin);
skin.setTexture(GuardValues.WARDEN.TEXTURE, GuardValues.WARDEN.SIGNATURE);
current code
How do i prevent someone from equipping an item?
how would i ban a player? the method Player#setBanned is deprecated, is there an efficient alternative?
what's the best Key -> Object map/set for a relatively low number of keys with relatively big objects?
in terms of overall efficiency
Yes
Hey I have a quick question about attribute modifers. I try to change the attack speed of a sword in the ItemMeta with an attribute modifier. Unfortunately, based on what I found on the Internet, I still don't understand how it actually works or how I have to specify everything there. Anyone who happens to be able to help me with an example?
First parameter is base second is exponent
100 * Math.pow(level, 1.25D)
what??
Idk what you do
100 * level¹'²⁵
Listen inventory click, inventory shift click and air click
What are trying to do by powing to 1.25
bump (ping me)
Interesing idea with powing to 1.25
which is faster? (NamespacedKey key)
if(!key.getNamespace().equalsIgnoreCase("Plugin"))
continue;
if(key.getNamespace().equalsIgnoreCase("Plugin")){
//Code here
}
both the same
ok
implicit else code usually compiles down to nested ifs just to optimize it a bit
I say continue. If your looping, it just moves on to the next object in the iteration. Where as the second option can still run code that's below it.
compiled it makes no diffence, its just a step
any1 knows why the PlayerInteractEvent is called twice for a rod?
just listening for one hand
Is there anything i'm doing wrong while comparing uuids?
Bukkit.broadcastMessage( nbti.getUUID(NBTTags.soulboundPlayerUUID.tag()) + "\n" + p.getUniqueId() );
Bukkit.broadcastMessage( "match:" + nbti.getUUID(NBTTags.soulboundPlayerUUID.tag()) == p.getUniqueId());
Console says:
[21:03:20] [Server thread/INFO]: f36a423a-875a-4ba8-bf9c-ec41c9857c17
[21:03:20] [Server thread/INFO]: f36a423a-875a-4ba8-bf9c-ec41c9857c17
[21:03:20] [Server thread/INFO]: match:false
I think I ran into a similar issue before, just had to delay the triggering
since rod triggers the event twice, i can just cancel the second call when a first one has made. but why does it fire twice huh
do you have torches in your offhand?
nope
and it also happens on 1.8
apparently it fires the event for every air action once.
so I'm getting a nullpointerexception here this.sidebarWidth = fr.getStringWidth(sidebar.getDisplayName()); and I've done some testing and sidebar.getDisplayName isn't null and fr isn't null so im confused on what is
yea
fr or sidebar have to be null
I just said I tested them both and they aren't
I know you said that, but you are likely wrong
there can only be three possible things there that can throw an npe.
fr, sidebar, or you misread the npe and its thrown from the getStringWidth method
so im trying to update my plugin to 1.18 but somehow the api in project structure just dont work
but i have like 200 errors lol
That's not the library you're looking for anymore :)
Hey, im thinking of making a gun plugin but have a pretty important question before i start and id like your opinion about it. Do you think using raycasts or projectiles would be best and why?
what do i need then
Use Maven, or you can find the libraries in the bundler directory
you didn;t read the post about 1.18 you can not longer use the spigot jar as a depoendency
If you need CraftBukkit then you'll need to get that set up as well
Maven is your best bet
i hate maven rip
gradle 😄
and gradle
well, they're far more sophisticated than ant
Also yes!
How to change this icon or "Compatible FML modded server" to a V or Vanilla within the code?
its just too complicated for my smoll brain
Does Player.spigot no longer exist? Using bukkit-1.18-R0.1-SNAPSHOT-shaded as my library, along with bungeecord
Need to send players a ChatComponent formatted message
Player#Spigot is there just fine
Cannot resolve method 'spigot' in 'Player'
I just checked the shaded jar, its in there
isnt it player.spigot()
it also completes fine in my IDE
elgar do u use eclipse
yes
"Better"? I've used both and prefer Eclipse. However if I was choosing an IDE for business I'd go intelij
Oh, I see
For 1.18? I'm looking at the Player class, and it's simply not there
its there for me in 1.18
heyy, so im guessing there is no method for detecting critical hits, in that case what parameters do i check to determine whether the hit is critical
are you using maven
inb4 directly depending on bootstrap jar
No, I'm grabbing the libraries from Buildtools
use a proper build tool
Aight give me a minute
bump
Use spigot, Not bukkit
am I correct that bungee first tries to load bungee.yml and if that doesnt exists, it tries to load plugin.yml?
doh, spigot not bukkit
yeah ofc bukkit doesnt include spigot stuff
I didn't even notice he was using bukkit not spigot for his import
I doubt that that is possible serverside in Bukkit world. If you can Change the Server list Ping it might be possible though, but that requires NMS or other libs that depend on NMS IIRC
I'm talking about Bungee
thought I'd point that out
Oh yeah, then ... idk, might want to roll out a fork or something. But doesnt Bungee Forward SLPs to the Backend Server? (Idk, never used Bungee myself)
Yeah, I'm actually interested in adding this to our custom fork
i dont think so
I know there is a ForgeClientHandler.java file that defines the mod list but idk how to make it say vanilla to forge clients
https://wiki.vg is your friend there
Though doc on FML stuff is sparse Last Time I checked, but it should suffice - in theory
That did it, thanks for putting me on the right track!
Literally a config option for this
^
where?
lol
I have forge_support set to false
but the icon is still there
how do I send action bar messages to a player on craftbukkit?
ping_passthrough also takes the player count and motd with it
I want it to be across the entire proxy
not just the one server
why would you even use craftbukkit
ikr
use spigot and use Player#spigot
spigot or any of its forks
Craftbkkit is not a supported server software
craftbukkit is unusable
It’s for development only
and it's bad at that as well
somehow people still use it for whatever reason
and then complain when they get a NoClassDefFound when using TextComponents etc
Buildtools hasn’t produced it for a couple years now
Though older versions I suppose
is there a way to do it without forwarding all of the ping info?
What are you trying to do
Idiots use CB because their host provider gives them the option to and I kinda just wanna "support" them
To put it simply: Have the MOTD and player count from the proxy but ditch the FML mod loaded stuff and just make the server look as Vanilla.. I don't need or really want to take that status from the default server
Sounds like a bug, open a bug report
You should maybe have some talk with major host providers for using/offering CB servers
There's a plugin that does this https://www.spigotmc.org/resources/bungee-forgeicon.17695/ but I would prefer to either have it directly in the code
Or why not merge CB and Spigot?
Can you name one?
I’m asking here cause their discord isn’t very helpful, how would I get an offline user’s plot count, and max plot count in Plot Squared, their placeholders don’t support offline players and their api docs hurt my brain cells for my plugin.
It was pretty clearly advertised as not supported years ago and buildtools requires special arguments to get it
The part that forge_support: false keeps the icon or something else? Because I first started a server and had this exact issue over 2 years ago (not really a veteran but it's been broken for a while)
Well did you report it as a bug then?
Nope, but I'd expect somebody else also get bothered by that
I mean it's just a small detail and almost every server has that tick with 0 mods present but it just gets on my nerves
Googling Craftbukkit server yields so many sites, videos and tutorials
good afternoon
there's a long-standing bug with Spigot & worldgen datapacks that I'd like to see if you guys could kill once and for all
Did you open a bug report
not sure if it has been reported, but I will
👀 Okay so I have a general question about writing objects and getters/setters.
I find myself writing this same stuff over and over. Is it bad to drop the get/set methods and just make the variables public and manipulate directly? I don't really understand the difference, especially if my getters/setters are so straight forward. if there's other code happening then yes include a getter/setter, otherwise should I just skip them?
public class WorldCustom {
String worldName = "world__rush_";
World w;
public String getWorldName() {
return worldName;
}
public void setWorldName(String s) {
worldName = s;
}
public World getWorld() {
return w;
}
public void setWorld(World theworld) {
w = theworld;
}
}```
No
You ultimately limit yourself and make your code architecture less flexible by exposing state
For instance no polymorphism, you would be enforced to depend on concretions rather than abstractions and if you want to enforce a certain way another module operates on your module that would not be possible as you have donated all that power of control
wrt why this is so important: we have a lot of issues with people being able to install Terralith on Spigot servers; we end up having to instruct people to install it on a singleplayer world first and move it to the server, which is not ideal. So a fix would be really appreciated
This is why for instance even records use methods for other units to access its data.
I tested terralith last week and it was fine
It's not reliable. We get a lot of reports that at the first server start, the dimension doesn't load properly
and you get regular mc overworld
If you delete everything again, everything is fine
What's the difference between net.md_5.bungee.api.ChatColor and the other regular ChatColor? I've noticed that the bungee one has an of method but the other one doesnt. whats that about?
But the. You say the way to fix it is to delete everything
Which would just restore you to the same blank state
Not everything, sorry - only region folder and level.dat
Because you deleted everything
It is a really strange behavior
What other files would you expect are impacting it then
I have no idea. But I just verified on a server, and it started with incorrect dimension file.
I really don’t believe this bug report, as I said I tested terralith last week
Thank you for this explanation, much clearer now!
Yeah well, it's much about keeping the code flexible for possible changes in the future
I hate that you can't just simply delete a commit on github. And then it fucks up your entire project.
git reset --hard; git push --force
Yeah it fucked up my local repo.
ok, I think I know what might be happening with worldgen bug
Watch the world burn
You're not wrong, equally important, why would you even delete it on github in the first place? I mean there are better ways of getting rid of a commit to my knowledge.
Ok so I was able to get my target folder and it contains all the modified code that I need but I can't just put those classes in the src folder. An idea how to make target the new src?
I don't want the commit on github. Hence why I wanted to delete it
I mean revert exists
That’s what I thought of first.
I tried alot of shit but in the end it fuckedup my project
I have a hard time believing it'd be git's, github's or your ide's fault. Sounds like a pebkac issue imho.
IDK I reverted and then my code got fucked up and it didn't match so I pushed the commit that was still available that was suppose to contain the changed code but it didn't, Github is just a fucking joke. I should literally just be able to click delete commit. Thats it.
Any ideas?
How did you even delete a commit through github?
Or well, where do I find it? I am going to test whether what you're saying is true or not as I got curious if you don't mind.
The command above
this?
Yeap
first of all that's not github's fault then
Then with github desktop I pushed the commit that was saved
you probably just used it on whatever upstream you got, in this case github
Which was suppose to be the new one. It wasn't
I am pretty sure using something like bitbucket or even gitlab would provide the same result
but ima try that for now, altho I'm still puzzled why the heck you didn't just use revert
and then pushed it upstream
Any ideas? The commits already deleted I have access to the updated code its just not in the right place anymore.
in that case undo?
Doesn't delete from local repo
wut
Isn't the easiest way to drop a specific commit to just, rebase and drop the commit then force push ?
Its github. There is no such thing as easy
Its not
you cant really
Target is all compiled class files
If you want to revert a commit from a while ago why dont you just pull from a specific commit
and then update your project root with that git project, and then push
Yeah I said fuck it lol. So I reverted the commit back to the last one it was at. Then I imported the project from github and I'll just decompile and re add the classes I need to.
how did you even manage to do that lol
I use the desktop app as well and never has issues with it
Git bash, eclipse etc...
what exactly are you trying to do ?
sorry I wasn't there at the start of this
delete the latest x commits ?
It doesn't matter now. I got it all sorted.
ah nice
Except for that damn .gitignore file still shows
add the .gitignore in .gitignore (?
Look at my other repos
not having the gitignore tracked by git is simple a misuse
if you want to exclude files locally and only on your pc, use .git/info/exclude
The whole point of gitignore is to ignore the files you don't want on the repo
Yes, but that information is supposed to be publically available so that, if anyone else is working on it they also know what files should not be committed
again, if you only want to exclude things locally, use the file i referenced earlier
it is specifically there for that usecase
I don't care what others do lol
Only reason that project is open source is so you can see how to use the api built into my other plugin.
well then use the respective file I mentioned
No. I'll use the same file from my other repos.
okay 👍
then good luck with it
you can delete a file from the git tracking without removing it from the fs btw
When using github.... I need all the luck I can get lmfao
might be what you want here
this is git not github
you are just failing at git, github has nothing to do with this
Requires commiting though
then fix it up into a previous commit ?
I have lol. You can see a commit that's suppose to have fixed the gitignore shit
or just delete the file from your local project files and push...
You can literally just git rm --cached .gitignore
hes using the github client iirc
I can't delete the pom and shit lol
even github client must have a way to do this
why would you delete the pom
you legit just delete the gitignore if you dont want it
clone the repo, when you delete gitignore it shows up in changes
I wouldn't. I just have the gitignore so you can't read my file paths.
ah yes, hardcoded file paths in pom files 🙏
Yes I want it to output the compiled jar to a specific location and not the target folder in the protects file.
you know you can set system specific variables in your ~/.m2/settings.xml
^
already had this discussion with them
hahaha
I'm not trying to remove the file. I need the gitignore to ignore files. But it's still posting the file on the repo even though the file includes itsself.
I literally posted the command you run
just copy and paste it into your shell that is in your project root
I know. I was talking to burchard
but then what is the issue xD
Nothing now. Burchard was continuing the conversation.
good luck on your journey to defy best practices xD
I can contest with lynx that github client isnt very good at this and youll need to use the command to update the gitignore
i just forked the project and tried on the client, just use the git command he sent above ^
don't you fork it, this project is not for contribution or usage!!
wait it says that
oh no xD
ide be happy as hell if someone forked my project LMAO i wouldnt care xD
oh yay
👀
dependabot not knowing its shiz again
Idc if you fork it lol. It's unusable without Minions-Revamped
eh i only did it to test gitignore
wait till someone makes a PR
and you get your first contributors
👀
and having people who dont know the project language ask for help on a day to day basis...
on this already has 55 PR's it feels like no ones really did that much
How can I spawn an entity or LivingEntity with metadata so that, for example, the type or appearance of a horse remains the same. Does anyone have an idea?
You can set the type and appearance on the horse instance that is returned when you spawn it ?
Yes but it should work for all entities. So horse is just an example. It should pack animals in a kind of bag
huh ?
where would you get the apperance from then ?
this seems like an xy, what exactly is your goal
I want to turn animals into an item that works and then spawn them. I get an entity from my item that contains the animal. And I want to spawn it again with the metadata.
you'll have to dive deep into the server source for this or use paper-api, as they offer a full serialisation for entities
there is no API way, at least on spigot, to accomplish this (easily)
Ok, then I'll take a closer look at the Paper API
ok, thank you
just note that you cannot upload plugins that only run on paper to spigot
tho that might not be an issue if this is for a personal server
Ok, this is for my private server
so i gave myself an head
and now my client crashes
nice
oh interesting, in 1.8 if you make an head without proper signature and value it commits dead
oh yeah there was a client that let u make those heads to crash players
a friend of mine kept giving me heads with a skullowner of 0
but it just kicked me for invalid data
while empty signature straight up crashes my client
https://papermc.io/javadocs/paper/1.17/org/bukkit/UnsafeValues.html#serializeEntity(org.bukkit.entity.Entity) tho generally you should ask in the paper discord for help
Thanks I found it
time to make /crash command 😇
just make a for every block in world and add it to a hashmap
slowly but surely your ram go byebye
Hey client, wanna update your client for me 30 times in 5 milliseconds
wat
i got an idea
play tnt packets to only the player until they crash
nah not kick them for invalid packets, crash client funnier
just endless explosions to lag theyre pc out
that is also fun but making the client crash to exeptions or such is funnier
slowly fill up their disc space by causing invisible exceptions
like bad packets with netty or something
the only crash i'm aware of in 1.17 involves campfires
Meanwhile the server owners: Why do our players keep getting disconnected
make it a secret feature in a plugin
getting banned from spigotmc speedrun any%
okay so im pretty sure this only works on lunar 1.17, might’ve gotten patched in the past 3 months
wait actually this might only work for lunar
welp
no secret feature
i mean if you want to not let people play with lunar imagine tinkering with lunar api, just place campfire
If you put small fine print text your good
"If you do this it will disconnect the player"
and put it on some weird ass wiki page like a developer documentation area
as long as it's disconnecting it's fine, but if it crashes players well not so much
naaaah