#help-archived
1 messages Ā· Page 103 of 1
or you can get a specific index in the List
index starts at 0 and ends at 3
making a total of 4 lines
only thing you need to make sure of is that the index you want isn't empty
@keen compass do you know where do i set a picture in my bungeecord server ?
Player me = e.getPlayer(); Location loc = me.getEyeLocation(); World world = me.getWorld(); cooldown.put(me, (System.currentTimeMillis()/1000)); if((cooldown.get(me) + 5) >= (System.currentTimeMillis()/1000)) { ItemStack stuff = e.getItem(); ItemMeta em = stuff.getItemMeta(); em.setCustomModelData(3); em.setUnbreakable(true); em.setLocalizedName("Staff1"); stuff.setItemMeta(im); me.getItemInHand().setItemMeta(em); me.updateInventory(); loc = loc.add(loc.getDirection()); new BukkitRunnable(){ @Override public void run() { Player me = e.getPlayer(); Location loc = me.getEyeLocation(); World world = me.getWorld(); loc = loc.add(loc.getDirection()); while(loc.getBlock().getType() == Material.AIR) { loc = loc.add(loc.getDirection()); world.spawnParticle(Particle.FLAME, loc, 0); world.playEffect(loc, Effect.BLAZE_SHOOT, 4); for(Entity ent : getEntitiesByLocation(loc, 0.545f)) { if(ent instanceof LivingEntity) { ((LivingEntity) ent).damage(10, me); ((LivingEntity) ent).setFireTicks(10); } } } }}.runTask(new StaffWeapon()); }```
@hollow thorn it worked before i made it a runnable
@frigid ember should just be able to put the server icon in the same directory as the bungee jar
and it should pick it up
as long as it is to the specs that is required of a severicon
you add the icon into that directory
@reef sparrow its a list<String>
@keen compass oh okay
oh
64x64 PNG named server-icon
^
ho do i call it ?
read above
oh lol
Server-icon
it has to be PNG right ?
yes
anyway i am making the logo right now lol
public static boolean isChestEmpty(Inventory chest){
for (ItemStack itemStack : chest.getContents()){
if (itemStack.getType() != Material.AIR || itemStack != null){
return false;
}
}
return true;
}
Is this right?
Wouldn't it be getContents.size() > 0?
You can just do getContents().isEmpty()
Can you?
Or that
ye
I'm so dumb xD
its a list lol
Doesn't look like you can š¦
Maybe chest.getStorageContents()?
oh getContents return a normal array lol not a list but
what you can do is
final List<ItemStack> contents = new ArrayList<>(getContents());
return contents.isEmpty();
bruh
A list doesnt have it too
wtf
Oh it does lol
forgot to import it
Array.asList(chest.getContents());
or
Array.asList(chest.getStorageContents());
Ye I mean array.aslist
getContents().length works too
bruh just do
return Arrays.asList(getContents()).isEmpty();```
ah I see, its a master race for the shortest code possible
bruh
Cheers Phelix
I will probably forget about it later and then re-remember it if I have a place for it when I refactor code
XD
@hollow thorn it worked before i made it a runnable
@hollow thorn still doesnt work
Player me = e.getPlayer(); Location loc = me.getEyeLocation(); World world = me.getWorld(); cooldown.put(me, (System.currentTimeMillis()/1000)); if((cooldown.get(me) + 5) >= (System.currentTimeMillis()/1000)) { ItemStack stuff = e.getItem(); ItemMeta em = stuff.getItemMeta(); em.setCustomModelData(3); em.setUnbreakable(true); em.setLocalizedName("Staff1"); stuff.setItemMeta(im); me.getItemInHand().setItemMeta(em); me.updateInventory(); loc = loc.add(loc.getDirection()); new BukkitRunnable(){ @Override public void run() { Player me = e.getPlayer(); Location loc = me.getEyeLocation(); World world = me.getWorld(); loc = loc.add(loc.getDirection()); while(loc.getBlock().getType() == Material.AIR) { loc = loc.add(loc.getDirection()); world.spawnParticle(Particle.FLAME, loc, 0); world.playEffect(loc, Effect.BLAZE_SHOOT, 4); for(Entity ent : getEntitiesByLocation(loc, 0.545f)) { if(ent instanceof LivingEntity) { ((LivingEntity) ent).damage(10, me); ((LivingEntity) ent).setFireTicks(10); } } } }}.runTask(new StaffWeapon()); }``` @hollow thorn
How do I get a List froma Field?
you mean reflection Field?
the motd i need to change is the one in the proxy ?
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
cooldown.put(me, (System.currentTimeMillis()/1000));
if((cooldown.get(me)+5) >= (System.currentTimeMillis()/1000)) {
ItemStack stuff = e.getItem();
ItemMeta em = stuff.getItemMeta();
em.setCustomModelData(3);
em.setUnbreakable(true);
em.setLocalizedName("Staff1");
stuff.setItemMeta(im);
me.getItemInHand().setItemMeta(em);
me.updateInventory();
loc = loc.add(loc.getDirection());
new BukkitRunnable(){
@Override
public void run() {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
loc = loc.add(loc.getDirection());
while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.spawnParticle(Particle.FLAME, loc, 0);
world.playEffect(loc, Effect.BLAZE_SHOOT, 4);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}
}}.runTask(new StaffWeapon());
}
```
try {
final Class<?> yourClass = Class.forName("your.class.ClassName");
final Field yourField = yourClass.getField("fieldName");
List<Something> yourList = (List<Something>) yourField.get(yourClass);
} catch (NoSuchFieldException | ClassNotFoundException e) {
// handle the exception
}
Something like this @reef sparrow
Okay thanks
you might have to change it depending on what you're trying to get.
Player me = e.getPlayer(); Location loc = me.getEyeLocation(); World world = me.getWorld(); cooldown.put(me, (System.currentTimeMillis()/1000)); if((cooldown.get(me)+5) >= (System.currentTimeMillis()/1000)) { ItemStack stuff = e.getItem(); ItemMeta em = stuff.getItemMeta(); em.setCustomModelData(3); em.setUnbreakable(true); em.setLocalizedName("Staff1"); stuff.setItemMeta(im); me.getItemInHand().setItemMeta(em); me.updateInventory(); loc = loc.add(loc.getDirection()); new BukkitRunnable(){ @Override public void run() { Player me = e.getPlayer(); Location loc = me.getEyeLocation(); World world = me.getWorld(); loc = loc.add(loc.getDirection()); while(loc.getBlock().getType() == Material.AIR) { loc = loc.add(loc.getDirection()); world.spawnParticle(Particle.FLAME, loc, 0); world.playEffect(loc, Effect.BLAZE_SHOOT, 4); for(Entity ent : getEntitiesByLocation(loc, 0.545f)) { if(ent instanceof LivingEntity) { ((LivingEntity) ent).damage(10, me); ((LivingEntity) ent).setFireTicks(10); } } } }}.runTask(new StaffWeapon()); } ```
@hollow thorn
Brother
A) stop spamming it. When someone can help theyāll help
B) before anyone can help you need to explain what you mean by āit doesnāt workā
yeah you've literally spammed it 4 times in 2 minutes
@sturdy oar So try { final Field linesField = packet.getStrings().getField(384); @SuppressWarnings("unchecked") List<String> lines = (List<String>) linesField.get(linesField.getClass()); } catch (NoSuchFieldException | ClassNotFoundException e) { // handle the exception }??
Yes I think this is right because of this https://wiki.vg/Protocol#Update_Sign
the hell is 384 tho
Add debugg lines @hollow thorn
they breach the limit
???
No not to the code you are sending
add debug lines to your code you are running
Figure out what is running and what isnāt
There https://wiki.vg/Protocol#Update_Sign is the Field Type of the lines "String"(384)"
Print out things like the items name etc
anything in the runnable isnt running
Okay
There https://wiki.vg/Protocol#Update_Sign is the Field Type of the lines "String"(384)"
@sturdy oar I dont know where I need the "384"
oh wait
you didn't need reflection
i thought you needed java.reflect.Field, but you were talking about another field
that's the type of the field
Yes but I dont know how to use this Field
I don't know either, I've never used packets
i thought before you were talking about reflections but i was wrong
may I ask what are you trying to achieve?
I will create a SignEdit Plugin but with packets because when I right click a sign it will open the SignEditor
Why the runnable isnāt working
@final verge i think its because of the use of e
Bukkit dont contains any function to open the SignEditor
so I must use packets
...And when I will do it without SignEditor Window I also can download 1 of the hundreds of Plugins
oh ok. so you're receiving sign modification packets and applying them to already existing signs?
Right
public static boolean openSign(Player p, int X, int Y, int Z){
try {
Class packetClass = Reflection.getNMSClass("PacketPlayOutOpenSignEditor");
Class blockPositionClass = Reflection.getNMSClass("BlockPosition");
Constructor blockPosCon = blockPositionClass.getConstructor(new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE });
Object blockPosition = blockPosCon.newInstance(new Object[] { Integer.valueOf(X), Integer.valueOf(Y), Integer.valueOf(Z) });
Constructor packetCon = packetClass.getConstructor(new Class[] { blockPositionClass });
Object packet = packetCon.newInstance(new Object[] { blockPosition });
Reflection.sendPacket(p, packet);
return true;
}catch (Exception ex){
ex.printStackTrace();
}
return false;
}```
Okay thanks
Chest Event Class
if (event.getInventory().getHolder().getLocation() == API.chestLocation){}
API Class
chestLocation = chest.getLocation();
I'm confused why this isn't working
or are you using ProtocolLib?
@sturdy oar Yes only the code above is without ProtocolLib all the other thinks I do with ProtocolLib
ok so you want to create a PacketAdapter with the UPDATE_SIGN
(the one from Client)
then you override the packetReceiving
PacketContainer packetContainer = new PacketContainer(PacketType.Play.Client);
You can then get values from the packet
Where can I report a bug in paper/spigot
is it paper or spigot
do runnables need to have everything defined inside of them
wut
Seems like paper
[07:53:01] [Server thread/ERROR]: [global] TIMING_STACK_CORRUPTION - Report this to Paper! This is a potential bug in Paper (TimingIdentifier{id=Minecraft:world - Sync Chunk Load} did not stopTiming)
wut
@sturdy oar i have a bukkit runnable inside an event
Yes but they're realted
do i need to redifine the event
Paper uses spigot as its base and adds optimizations
I'll look through the full stack trace and see where the error is but it's rooted in chunk loading which is not exclusively paper
Well yes but I came here to ask where to report the error and I got my answer right? Seems fine to me.
and the answer is https://github.com/PaperMC/Paper/issues
thx
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
cooldown.put(me, (System.currentTimeMillis()/1000));
if((cooldown.get(me)+5) >= (System.currentTimeMillis()/1000)) {
ItemStack stuff = e.getItem();
ItemMeta em = stuff.getItemMeta();
em.setCustomModelData(3);
em.setUnbreakable(true);
em.setLocalizedName("Staff1");
stuff.setItemMeta(im);
me.getItemInHand().setItemMeta(em);
me.updateInventory();
loc = loc.add(loc.getDirection());
new BukkitRunnable(){
@Override
public void run() {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
loc = loc.add(loc.getDirection());
while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.spawnParticle(Particle.FLAME, loc, 0);
world.playEffect(loc, Effect.BLAZE_SHOOT, 4);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}
}}.runTask(new StaffWeapon());
}``` how do i import e into the runnable
bro stop flooding oh god
Iām confused on why you even need to run a task
Itās not even delayed
It literally is the same as not having it
so its not on the main thread
????
Anything that calls anything bukkit related should be main thread?
Like particles and fire ticks??
Also you run the task not async
but then it will cause the server to stop running while the while thread is active
Then run a task timer
And have the task repeat
And infinite while loop is bad practice
It could be infinite
What happens if there is an air block for as far as the eye can see
On top of that
yes which is why it needs to be on another thread
You are doing so many things that should only be done on the main thread and will break if done async
Damaging entities, getting nearby ones, setting fire ticks, playing effects, getting blocks, spawning particles, getting location of a player
None of those should be done async
but then it wont be able to run alongside other things
if i use the weapon as a sniper
you wont be able to doge in the time its travelling
because the server will have stopped for the event
Then you need to figure out ways to work around it. Because you literally should not be running those thing on an async thread
And you need to add a limit to that loop
Because it can just run forever
On top of that you arenāt running the task async in the first place
Certain things can be done on another thread
Like logic
Anything that modifies the game should not be
how can i make it run seperatly when doing a long task though
ProtocolLibrary
.getProtocolManager()
.addPacketListener(
new PacketAdapter(plugin, PacketType.Play.Client.UPDATE_SIGN) {
@Override
public void onPacketReceiving(final PacketEvent event) {
if (event.getPacketType() == PacketType.Play.Client.UPDATE_SIGN) {
final PacketContainer packet = e.getPacket();
//and here you can get your values
}
}
}
);
@reef sparrow Something similar to this
The task in theory shouldnāt run that long. The logic behind the task is going to be the cause of the lag
Because of many reasons
You damage the same entities potentially
you can then get the sign values from the packet methods
Anyone can help me with a custom craft? I dont really know why it isnt working, here it is the craft. https://pastebin.com/a0Q2AWXM
No my problem is that dont even know how to get the lines from the Field... @sturdy oar
you have to use StructureModifier i think
huh? event.getPacket().getStrings().readSafely(0 - 3); should be right
Okay
that's what i said FatalPacket
getStrings() returns StructureModifier
so he can read from it
String[] lines = packet.getStringArrays().readSafely(384);Is it right so?
i don't know about the 384
yeah xd signs have 4 lines
Yes where i should insert/use the 384
nowhere
i have no idea what the wiki intends by String (384)
^
And for what it exists
Okay
not 100% sure
But thanks anyway i test if this works now
Yeah it seems like that number is the max. length of the string
although i wouldn't know what happens if you set it that high
because it's definetively too long to fit
F*ck that slime split thing 
@frigid ember But getStrings returns a String not a String List
I dont understand it should i use List<String> String[] or String
whatever this is
b={TextComponent{text='a', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}},TextComponent{text='', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}},TextComponent{text='', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}},TextComponent{text='', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}}
oh yeah Json
it returns the String list in json format
yeah probably the whole sign as Json
no idea if you directly get the line
you might have to do some research
Quesiton
How could I make a mob store an Enum?
like, if I check him, I could get a Custom Enum I made.
which plugin can protect ddos on bungeecord
how do i revoke this advancement: end/levitate
just made a plugin that crashes servers...(Not my intenttion)
PersistentDataHolder
Hello someone this is how to execute an order after being logged in with AuthME
y
Help me please š¦
Hello someone this is how to execute an order after being logged in with AuthME
Wait, can I use the same Namespaced key for different mobs?
yeah you can do it JeSuisAD
Yes but how @sturdy oar
commands.yml
Yes but i can't
the hell does that even mean
Can you help me
When players are logged in, the /server lobby is used.
Ask authme
I'am french
This isn't authme support
dont speak english but use google translate
like literally write inside onLogin
and put your commands
it's not anything complex
**Him: **Baguette?
No x)
xD
Do you really speak french?
Neh the only french I speak is "Suce ma bite"
Looking for a plugin or an idea how to write it myself if it doesn't exist. I need to filter chat messages, anvil renames and books with regex so that everything that doesn't match given regex will be removed (charset would be fine but I would like to have a little more control). Pls ping if answering
mdrr suck my dick x)
yeh... you have to be prepared in all languages
Okay, but can't you help me?
there's even a pre-written sample inside the commented lines
?try
sorry
no comments
but help me
What a comment
bruh
im out of here bye
Can someone help me out with this? #help-archived message
register listeners, get messages, and cancel the event if they don't match a RegEx i guess
anyone know of any queue plugins that let players in slowly(to not crash the server) with donator priority support?
register listeners, get messages, and cancel the event if they don't match a RegEx i guess
@sturdy oar I will replace by regex instead of cancellation. I know I have to register Event Listeners of course, but which ones?
@languid pewter I found out what was wrong. The POM was checked among ignored files in Maven settings
Discovered it by coincidence
Is it really that simple? Just find an event and replace the text? Does it work with anvils and async chat?
Can it function like a middleware? I replace some things in the event string and that string will be send to the chat/renamed item
Yes
Cool, thanks
whats the event for dropping an item
https://wiki.vg/Protocol @frigid ember
https://wiki.vg/Protocol @frigid ember
@mellow wave there are no ids
Entity Entity refers to any item, player, mob, minecart or boat etc. See the Minecraft Wiki article for a full list.
EID An EID ā or Entity ID ā is a 4-byte sequence used to identify a specific entity. An entity's EID is unique on the entire server.
it's not actual too, bcs armor stand id != 30
That's what the page says atleast
can i make my plugin its like wait 20 ticks ? for example
whats the event for dropping an item
@hollow thorn
@obtuse rose about yesterday's issue - would you say it's down to poorly made plugins, or no? because that's exactly what the hosting company is saying fml
ya thats skript i wanna make on my plugins.. thats skript just an example
:'(
yea but on java how ?
delayed task in java well
Plugin#getServer#getScheduler#runTaskLater(Plugin plugin, Runnable r, long delay);
usingthat method?
yup
is there any java player.hasFire ?
whats the best way to make a timer in java ? (preferably, one that is serializable)
whats the event for dropping an item
@hollow thorn
use that if you're inside EntityDamageEvent
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Entity.html#getFireTicks--
or this if you only have the Player instance
@hollow thorn PlayerInteractEvent
i thought that was only for right andleft lick
I think it also works 4 dropping
don't work
[21:21]
21:20:51 [INFO] [Rickylacio] <-> ServerConnector [lobby] has connected
21:20:53 [INFO] [Rickylacio] <-> ServerConnector [pryma] has connected
21:20:53 [INFO] [Rickylacio] <-> DownstreamBridge <-> [lobby] has disconnected
i have priorities in lobby
force default server true
and forced host to lobby
Forced hosts bypass this.
So if your default IP is play.example.com that will go to lobby, but factions.example.com will bypass the lobby and go to the factions server. No matter if its offline or not.
We've been trying to help you for like a day or 2 now, its something you're doing wrong...
isnt there a bungee option to set mode to offline
blocking all access except from a server
Online mode for bungee just does what online mode for a bukkit server would.
it just encrypts and authenticates the client with the auth server, meaning cracked clients can't join.
That's it.
Forcing players to connect to a certain server is a different setting, and we've helped this person with this, but they are doing something wrong. So far all they are doing is showing that 2 lines of logs, and nhasn't given us configs or anything
We don't even know if they restarted bungee for the config changes to take effect.
How many packets per second are too high?
depends on a number of factors lol ĀÆ_(ć)_/ĀÆ
For ViaVersion
i went from eclipse to intellij and now my plugin isnt working
was working completely fine with eclipse
i really wish i didnt hate eclipse
@proper cairn please define "isn't working"
I can get the plugin to output to my plugins folder on my server but plugin doesnt work at all
so i can build it and it outputs to my plugins folder but doesnt work at all on my server and cant get it work
to*
Please help, how to create a Firewall on Hosting? I'm have spigot 1.8
I can't currently buy TokenEnchant the buy button is missing
@proper cairn can't get it to work, as it won't load?
Correct @obtuse rose
^ xD
I need enchants for my Prison server and I like the jackhammer enchant
@proper cairn so, have you inspect your output jar file with zip software to make sure that it has plugin.yml came out with it?
I have EpicEnchant for Songoda but Idk if that has a Jackhammer enchant @hoary parcel
@hoary parcel loool They stole over $500 from me
uhm
songoda is one of the worst persons in this community
As a developer/sysadmin, my friendly recommendation is DON'T even touch Songoda's plugin
Her name is Bri, songoda is her "group" name
her plugins are brought, rebranded and then maintained by her child dev sweat shop
Mhm
Its awful
And she has no clue how to code at all
She is the literal worst person in the spigot community far and away
Let's say this, I need to code a replacement plugin because Songoda's plugin performance is so bad it's killing the server
Then recommend another Prison Enchants plugin
She steals everything from everyone, rebrands it to hers, and if you so much as speak shit about her, she threatens to sue you. She stole over $500 from me, months of work, and cost me several friends. Even if her plugins were "decent" I'd still not tell anyone to use her shit
@maiden zephyr we wouldn't know
They said DDOS and one of their staff fucked the discord
I can't live without SSH š
Oh, and she threatened to sue me and rack up thousands of dollars of legal fees for me. She's a shit tier of a person and I have the evidence to back it up.
sue her back?
My does EntityDamageEvent don't work ?
@worn gate please be specific, it won't get invoke or your computer catch on fire after the event got invoked?
Threatened. She didn't go through with it, had her sugar daddy try and scare me too. @obtuse rose No real reason to bother, it would be small claims court anyway, and I'd rather just be rid of her than deal with her at all.
She got banned from spigot anyway lol
she has a sugar daddy too? .-.
Still what plugin should I use for prison enchants then?
Yeah, she did adult livestreams for a bit because she couldn't make enough money from plugins, its a whole shitshow. @obtuse rose
@worn gate I am not trying to be mean, but you need to be specific about the problem ya know š
*gasp*
LOL
how sad
40 year old dude finances the 20ish year old adult baby that is Bri of songoda. I regret ever working with her
@EventHandler
public static final onDamage(EntityDamageEvent event) {
//mycodedud
}```
Oh, and she owns the black spigot like sites. Only to protect her plugins, she doesn't care about yours
return type for this method is missing
Her business model relies purely on screwing over everyone in the community.
wait.... how did you even compiled that before .-.
But I digress, I'm sure you get the idea by now
can anyone help ?
public static void
So you tell me not to use TokenEnchant then tell me not to use EpicEnchants but you fail to say one to use in the place of them. Hmmm they still look like an option atm
tokenenchant if you want to pay an extra $5 for some of the enchants
Yea I'm fine with that but the buy button on TokenEnchant is missing
@EventHandler
public static void onDamage(EntityDamageEvent event) {
Player player = event.getPlayer;
}```
why does that not work ?
you never registered it maybe and you're not doing anything inside
?
did you register it anywhere
Does PlayerDamageEvent work ?
Yeah, but you have to register the event listener on enable
?
Bukkit.getPluginManager().registerEvents(Class<? extends Listener>, JavaPlugin); in your onEnable
Getserver().getpluginmanager().registerevents(new Foo(), this)
its an entity object, there is a player damage event tho
so how ?
Player player = event.getEntityType();
if(player==EntityType.PLAYER) {
//my code
}```
its an entity object, there is a player damage event tho
@worn temple nope
I'm 100% sure it doesn't exist, on Spigot at least
I mean if people used kotlin it would be more intuitive though
Poor guy
the is keyword is much cleaner
@sturdy oar Ah, I'm thinking PlayerItemDamageEvent
event.getEntity() instanceof Player
lol
Gnaboo if you want to understand WHY that can be done
Look at the heir archy of Player
You may notice it is a child of Entity
Scala people be like
if (player.isInstanceOf[Player]) {}
Lol
https://www.google.com/amp/s/www.geeksforgeeks.org/inheritance-in-java/amp/ and I highly recommend you read this
whatever š¤·āāļø i prefer Oracle documentation
I prefer GeeksforGeeks and stack overflow. Iāll use Oracles in a pinch but I donāt like the way it is laid out
I always zone out when I read it lol
Please don't use the amp versions of websites. its bad
its fast tho
what's amp
its the no bullshit version of a website
served thru google
which is good and bad
no ads?
good for the user, bad for the internet as a whole
not no ads, but less for sure
well I use uBlock Origin
That is an FAQ for what amp is and why its bad
amp basically enforces restrictions on what a website can do
and then use google as a cdn
yeah, basically for slightly faster loading times, you destroy the open internet and give google control of most of the internet. Also google trackers, so damn many trackers.
what If i have VPN
Seems subjective, but I understand where youāre coming from. It did it by default
VPN doesn't stop that
Iām on my phone and thatās why
@sturdy oar if you are already using uBlock, add Privacy Badger, shuts down the rest of the trackers that ad blocking stuff doesn't detect.
@thorny ledge Its not really subjective. Its a fact that it gives google the monopoly over the internet. And its a fact that loading times are increased (but not by much, or really in any meaningful way) and google puts in trackers to the amp sites since they are now hosted on google owned and controlled servers.
The only subjective part of it is how much you actually care about it.
Perceived benefit for the user short team, hurts everyone except google in the long term.
how can i set the BlockState of a block
But setData needs a BlockData
Sounds like a situation of: use our service or lose traffic. I suppose that is a monopoly, more or less. Never even heard about this before today. Pretty interesting. Not sure how I feel about it, although Iām a big fan of freedom on the internet for users and publishers alike
@reef sparrow it needs anything that extends blockdata. I believe block state is stored in this. I'm not 100% sure, I'd need to find my old code where I do some block state manipulation to confirm it for you, so give me a few minuets here.
So I'm getting this error:
[14:23:22] [Server thread/WARN]: at java.lang.Class.getDeclaredField(Class.java:2070)
[14:23:22] [Server thread/WARN]: at dtnr.events.WorldSaveEventHandler.onSave(WorldSaveEventHandler.java:20)
[14:23:22] [Server thread/WARN]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[14:23:22] [Server thread/WARN]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[14:23:22] [Server thread/WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[14:23:22] [Server thread/WARN]: at java.lang.reflect.Method.invoke(Method.java:498)
[14:23:22] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315)
[14:23:22] [Server thread/WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[14:23:22] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
[14:23:22] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
[14:23:22] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.WorldServer.save(WorldServer.java:801)
[14:23:22] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.saveChunks(MinecraftServer.java:655)
[14:23:22] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1004)
[14:23:22] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:824)
[14:23:22] [Server thread/WARN]: at java.lang.Thread.run(Thread.java:748)```
And I understand what's going on for the most part, but I'm not entirely sure where I'm supposed to find the correct fields for 1.15. I copied this code from a prev project which was 1.12.
field.setAccessible(true);
field.set(chunk, false);```
Okay, @reef sparrow To get block state its getState()
to set its state, its block#setBlockData(blockState.getBlockData())
@frigid ember please paste/hastebin that code
Gotcha @worn temple
But yeah, NMS changes every release, so its possible you will have to just go about it trial and error until it works. That's usually how I do stuff on later versions when people haven't figured out what everything does yet.
Yeah, you're either gonna have to get ahold of the CB jar and look at that class and find the method that does what you want, or a lot of trial and error.
Okay, @reef sparrow To get block state its getState()
to set its state, its block#setBlockData(blockState.getBlockData())
@worn temple Oh thanks
That's NMS for you. Kinda why I was making a library for my plugins/any one who wants to use it)
That way some of the common NMS stuff I use can be handled in one place, and any plugins using it don't have to bother with NMS versioning or anything.
@reef sparrow Np, can't confirm if it works on latest spigot, since I think it was deprecated at one point, but that's how I've always done it and its worked
Okay yes i think i use this
That's NMS for you. Kinda why I was making a library for my plugins/any one who wants to use it)
That way some of the common NMS stuff I use can be handled in one place, and any plugins using it don't have to bother with NMS versioning or anything.
@worn temple Yeah im trying to use a command that will take a character argument and pass it into the field argument and see if it throws and error. No idea if that even works ... Also, would I possibly be able to achieve the same result if I just took the world the player was in and disabled world saving?
Because essentially what I'm trying to do is reset saved chunks. So it will save the chunks in a world and then reset the chunks on command. And in order to do that effectively, the world saving needs to be off.
I mean, if that's what you are trying to do, you can just wrap it in a try catch.
As for that, I have no idea. Chunks are all saved in region files which store I think 16x16 chunks. So... I have no idea how you would actually do what you are trying...
Gotcha. I was successful with 1.12, but as you stated the NMS changes so it no longer likes to work haha
i can disable forced_hosts
?
I have pterodactyl panel, and the ports are protected with firewalls IP-Tables, what ip i need to use to forced_hosts?
forced hosts just means connecting on a certain IP sends you to a certain server. That's it
I don't know what it would be in your case, but just disable forced hosts and set server priority and default server to the lobby server. That's how I have mine configured.
How i can disable forced hosts?
forced_hosts: false
You must be doing something wrong then
20:47:07 [SEVERE] Exception in thread "main"
20:47:07 [SEVERE] java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.util.Map
20:47:07 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getListeners(YamlConfig.java:253)
20:47:07 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:85)
20:47:07 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
20:47:07 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
20:47:07 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
watch
okay, clearly that's not what I meant
You can't change a map to to boolean
there's a flag somewhere in the file to turn it off
i'm trying to fix
Ok
Why
20:53:50 [INFO] [Rickylacio] <-> ServerConnector [lobby] has connected
20:53:52 [INFO] [Rickylacio] <-> ServerConnector [pryma] has connected
20:53:52 [INFO] [Rickylacio] <-> DownstreamBridge <-> [lobby] has disconnected
Now connect me all time in Lobby
but
? isn't that what you wanted??
Nope, because i join but, don't stay in lobby
i don't use compass to switch
It's an automatic switch
Then a plugin is doing that, not bungee
ok i will check later
Hello, i need some help. I'm trying to develop a plugin using the 1.15.2 spigot but when i have it started and the server running, i can't drag and drop my plugin when it's built. Windows says i need can't perform this action but i'm administrator on the computer and there's only 1 session
i bought a super expensive plugin but didnt get it
@near pasture Stop the server, drag the plugin, start the server
who do i ask for help
yes but the problem is
they got the moeny but i didnt get the plugin
@narrow schooner contact resource staff if it takes longer than a day or two. It can sometimes take a day or two to sync.
@near pasture So, you're using SSH?
a day or two your kidding
i mean
every other one i got was immediate
its annoying since i know they got the money
shouldnt it be immediate if they get it
its 35 dollars
and it's weird because it didn't do that before
like the others spigot versions (eg 1.12) didn't have that problem
okay, so if you are using SSH, the ssh client is logging in on an account without permissions, or your windows share thing is fucked. Likely tho, some program has the file open. You have to stop and then start the server. You can't hotdrop things that are in use.
@narrow schooner Again, it can take time. If it still doesn't show up after a day or 2, contact the dev and/or resource staff for help. I'm just a user that happens to know a lot.
ahhh well, ill try to explain my case better : i'm developing and i have minecraft started on my mac (with intellij opened) and when i build with gradle it sends the file to my other computer (which has the server started and also intellij to be able to receive the file)
i guess that's some weird windows shit
imma call up paypal
If a program is using the jar, it can't be replaced while in use, windows prevents it.
@narrow schooner Chargebacks will get you banned
since they put it on hold
no
not chargebacks nova
they put it on hold
i got in contact with the plugin maker
they put it on hold for him
Okay, so its on hold, so they don't have the money, therefore the transaction hasn't fully completed, meaning you don't get access to the plugin.
tell them its genuine payment so they make it go through
@near pasture You need to stop the server, then change the plugin jar, then start the server again. you can't change the plugin out while the server is running. (jvm class loading stuff will throw lots of lovely errors if you do this, as you can bypass the safeguard for replacing files while opened)
and idk why it does that because windows doesn't say "This file is used in another program" it says "You need administrator permission to continue" then i click continue and then it says "You need an authorization"
@narrow schooner Okay, so this is completely outside of the scope of this server then, as everything is working 100% as intended. Good to know š
@near pasture Yeah... could be the permissions file file sharing got messed up some how. But I really don't know, I'd need more information to be certain about what it could be, and I don't know if I could help solve the issue
well then ill find a program that can close the server, copy the file and reopen the server automatically and it's also annoying to have the 20s delay because the file is not the latest although i'm in 1.15.2
ahhh
i might know why
when i start spigot, the folder goes in "read only"
despite me keeping unchecking it
ah no
apparently it wasn't that
That's the issue then. You can't write to read only folders.
hm I can change plugin jars during runtime with no problem for most plugins
the way paypal works for businesses is they hold money to prevent scamming
after you give that money to the seller it is not yours
but it can be held for up to 21 days
not for you to get it back necessarily
it's to hold money incase the seller scams anyone
You can in Unix OSs, but windows safe guards it. And even so, it can mess with the runtime and bunch of stuff and jhust shouldn't be done @frigid ember
so if the seller take money out of their account there's still money there
meaning the payment has gone through
its not my money
that's why on my account the payment status is completed
theirs isn't
it's compeltely a problem on their side that could last for a month
The money is held by paypal, neither you nor the seller has access to it, meaning the transaction hasn't actually completely. Sure, call paypal, talk to the dev. But this has nothing at all to do with spigot.
I'd say it's pretty safe as I do it in my network constantly so plugin updates come in next restart
the money is still in their account
they just can't use it
the money is not in my account
i have no rights to the money they do however it's not spendable
@narrow schooner They can see it, but can't touch it, its not theirs yet.
due to the chance of them being a scaammer
well i found that i can just copy the file instead of moving it idk why that's some weird sh** happening there
yes but the payment went through
@frigid ember Still should be avoided.
thanks for your help š
i'm not waiting a month to get a plugin that i already paid for
@narrow schooner Technically no. Again, this is not with anything to do with Spigot. The transaction has not fully completed, therefore the plugin cannot be accessed on the forums.
@near pasture Np, glad you figured it out
just hope for it to come sooner than a month xD
^
it seems to be put on hold more often if you're from small country
can the plugin maker give me access early
just because they have their funds on hold doesn't mean i should wait 21 days
they've been suspected of scamming
that's not my fault
and it's no longer my money
that's completely on their account
The system is working 100% as intended, albeit a bit inconvenient for some people.
To spigot the transaction hasn't completed, therefore the plugin cannot be downloaded. Once the money is deposited to the seller, the transaction is fully completed.
To the seller, the money is visible but cannot be touched or used. It is just there so the seller knows that there is money on hold. It is simply there to inform them that paypal is going to hold it for a bit to make sure it is valid.
To you, that money is gone, because it is, its in PayPal's "bank account" not the seller's.
So, everything is working correctly, you can contact the dev and see if they will manually authorize access, but this is all outside of what Spigot is responsible for.
the money went through nova
it'd being held solely on their account
its not my problem
24 hours
Its on hold, meaning PayPal actually has that money. Not you, not the seller, paypal.
its a paypal thing that takes a month
transaction 50% completed.
its held on their account incase of fraud in their business
they have to resolve that
it has nothing to do with me
the money is no longer mine
Can the seller withdraw the money? No, then its not theirs.
they have it on hold incase they scam someone it's still their money but it's used for claims
not my claim
for claims in general
they hold a certain amount of money that comes in
so they cant hightail out
thats why it could take up to a month
Again, this has literally nothing to do with Spigot anymore. This is literally just between you, paypal, and the seller
You are one part of the transaction, so therefore it does involve you
i have nothing to do with it once the money is no longer mine
paypal holds it on the sellers account so they can't just withdraw all their money and delete their account
its held only on their end
to prevent fraud
that's their fault they make hundreds
so paypal is suspicious of them
The money is no longer in your possession, but you authorized the transaction and paypal is holding the money for verification.
This is you, the seller, and paypal.
so they hold money to prevent fraud
Again, nothing to do with spigot, don't know why you are complaining here.
my point is it has nothing to do with me
they're not holding it for me
i'm saying i already gave them the money
the payment is "completed" fully i have no rights to it
if i wanted the money i'd have to make a dispute
it's being held on their account for 21 days
It is on you and the seller to keep the contract you agreed to, spigot is simply the throughway.
it's the same as if they receieved it in full
yeah i'm just saying it didn't go through via spigot it doesn't mean it's paypals fault
paypal does this for all sellers that doesn't mean they don't deliver the product
Again, not sure why you are complaining in the spigot help server, this is something to take up with the seller and paypal alone.
mostly because you're trying to tell me it's not the sellers money but it is
so it's a problem with the system i have to resolve
either with spigot or the seller
Its technically not. I sell on amazon and they hold the money for 30 days, its not my money yet.
because the money was technically received
Spigot has nothing to do with it
on amazon even if they hold it 30 days on your account you still ship the product
the payment is still technically received
Yes, but only because amazon knows when it ships, its a physical product. Spigot here is dealing all digital, the transaction has not fully completed according to the API, the money is not accessible to the seller, the transaction is mostly but not fully completed. So they aren't automatically giving your account access to the plugin.
Spigot = working 100%
PayPal = working 100%
i'm just saying if the payment went through on my end it's silly for it to be held for 21 days
complain on the paypal forums then. ĀÆ_(ć)_/ĀÆ
because 21 days is a long time when you need something like an anticheat
"paypal stop holding money to prevent scammers"
"let the person transfer thousands of dollars that are all fraudulent and hightail on out and delete their paypal acc"
lol im jsing yeah paypals on at fault
but spigot doesn't have a system to read if there's a problem on the sellers end
like amazon does
amazon checks if the payment was sent
ĀÆ_(ć)_/ĀÆ
Paypal has a 1 star review anyways
where?
Does anyone know why this isn't working?
Directional dir = ((Directional) chest.getBlockData()); dir.setFacing(direction); chest.setBlockData(dir);
seems fine to me
Make sure you're importing the right Directional
There are 3 lol
org.bukkit.block.data.Directional
Anyone know the cause for why a chunk fails to unload when you simply unload it?
Is there any way to get the Hopper location from the InventoryMoveItemEvent
I am using org.bukkit.block.data.Directional
btw phase, it can be at 1 star review but what can you do when they have all the power :p
@EventHandler
public void onInventoryTransfer(InventoryMoveItemEvent event) {
if (event.getSource().getType() == InventoryType.HOPPER && event.getDestination().getType() != InventoryType.PLAYER) {
int amount = hopperManager.getAmountToMove(needsALocation)
}
}
wait, may have figured it out.. lol
𤦠I always do that
Well it looks fine to me, Backett. Show us all relevant code
Either it's not being called or something else is updating the state
I update the inventory right after, but I don't think that should change anything. I had a print statement in there, so it is being called
Inventory?
The chest's inventory. I update the contents with an ItemStack[]
chest.getInventory().setStorageContents(c.getValue());
Yea, but BlockData is _Block_Data
What should I change then?
I want to recreate the chest if it was deleted with the proper contents
But the only problem I am having is that the chest always faces North
I did store the proper direction, but it doesn't actually update
blockState.setData(BlockData)
blockstate.update(true/false)
Dunno if that is needed anymore, may have been removed in newer bukkit versions.
Thanks! What is the true/false for?
if you want physics to apply to it or not.
Okay, thanks!
I'm sorry for asking a question this stupid though I can't think right now, what would the class to have effects like posion and regeneration be called? I'm making custom enchantments and never used a Bukkit Effect like Haste or Strength before
All I really need is the class name, thanks!
Nevermind Got it
I was just stupid lol
FAST_DIGGING and INCREASE_DAMAGE respectively, yea
Remnants of old school Minecraft effect names
To build what?
So should this work?
PotionEffect poison = new PotionEffect((Map<String, Object>) PotionEffectType.POISON);
A potion effect
That's for deserialization. Don't use that constructor
Oh ok thanks, what should I use instead?
If you're just doing it based on type, PotionEffectType has a nice utility method that at least looks a bit nicer
PotionEffectType.POISON.createPotionEffect(duration, amplifier);
(might have gotten those arguments backwards but ehm, yea lol)
what is the best plugin for enchantments for spikes, armor etc
Has anyone ever run into an issue where the InventoryClickEvent will not always be called? If we add items to a normal chest by hovering over a slot and clicking it in every so often the InventoryClickEvent is not called at all. We have tested it on multiple different versions including 1.15 but the issue remains.
Seems like a minecraft issue, not a bukkit issue. May be the client not correctly sending it over to the server somehow honestly.
Seems like a minecraft issue, not a bukkit issue. May be the client not correctly sending it over to the server somehow honestly.
We already tested this and it was indeed caused by the client sending different packets to the server. Just wondering if there is a way around that
public void onInventoryTransfer(InventoryMoveItemEvent event) {
if (event.getSource().getType() == InventoryType.HOPPER &&
event.getDestination().getHolder() instanceof BlockState) {
It looks like the Destination is a CraftInventoryDoubleChest
how can I get a location from that? .-.
nevermind, once again got it
you make a selection
math.
Basically, you make a rounded shape with worldedit, then you can make a selection in that shape, then you can use that selection for defining the region. I think.
you can make irregular selections, I'm pretty sure of that
Yeah, just needs math and patience to figure out the exact shape dimensions
No corners in an oval
//sel poly
The picture looked pretty ovular. it s a squished cicle
hey what packettype in protocollib is emitted when a projectlie is launched? spawn_entity or named_entity_spawn doesnt seem to work
Does anbody know how to get spigot java docs to work with eclipse i have tried a good amount of tricks and still cannot get the javadocs to work
you're using build path?
that's what using eclipse is like. Switch to IJ and they just work ĀÆ_(ć)_/ĀÆ
Guys how would I enable and load a plugin from another one?
why tho?
I'm trying to make modules
well simplepluginmanager is the class you need to look into
Bad idea honestly. Just have one plugin contain all the "modules" and only have their code "running" once enabled. so on server start and plugin load, check which modules are enabled, and register their listeners and commands. And when they get disabled, just run the enable backwards basically, just unregistering any commands/listeners (assuming you do this later on, not on load)
You don't really want to be dealing with loading/unloading plugins because it messes with the classloader and you're gonna get a shit ton of errors
You can make a module loader
You donāt want to be loading your own plugins
But
Something like that is basically what you want
@frigid ember
Alright, thanks
Does anybody use the minecraft plugin for intellij
Which one?
Haven't used it in a long time. Imo not super needed if you know maven/gradle.
Tho it does make the boilerplate for starting projects easier.
Yeah once create the project its got everything laid out pretty much for you too and templates too
Makes project starting faster, otherwise not super useful, but its neat. Good for people starting I suppose, give them the proper starting structure.
Still, so many terrible practices in the mc dev community it boggles my mind.
Do you have any configuration in the spigot that unloads the chunks that are not being used? My server gets a lot of loaded chunks
In 1.15 how do I load a world from file? Old code, previously working in 1.14.4, now just returns null when getting the preexisting world.
@old barn There's some anti-lag plugins that do this, but it can cause issues. I can't point to any one plugin to use, but plenty exist that do this, but be aware that it can cause visual issues for players and break redstone and other things if they are spread across multiple chunks and one gets unloaded
I have 4K+ chunks loaded on my server, this causes a lot of lag and lowers the TPS a lot, is there no other way you know to remove this "lag"?
optimization upgrading hardware etc etc
use paper
iirc better optimised
than there are better payed methods for optimised server jars
Optimizing stuff, upgrading hardware, having multiple servers connected with bungee (assuming you have multiple worlds here), etc etc.
But lag plugins just force unloading of chunks and the server will then load the chunks back in over time. That's what it does.
also if your constantly loading 4k+ chunks probably not the best idea to be running regular spigot
xD
unless you have the know how on optimisation
Also, at that size, you probably should be using a bungee network already, unless somehow you have huge amounts of players spread out everywhere on one map...
like I said, lots of people all spread out everywhere
But even large survival servers can help mitigate it by having the overwold, nether, and end on different servers and having some plugins do some funky maths and other nonsense.
Yo why does my code not work i am tryna get item in hand object so like I have this but its not working and i searched up on the web how but couldnt find anyting
Player player = event.getPlayer
player.getObject().getName()``` this isnt working im confused
i shorteneed the first part just focus on .getName
Define "not working"
like it wont get the name of the item in the hand
Does it do anything tho? What is it returning?
yup, read the docs
yo nova do you know anything about shopgui+ api
Not well, messed with it a bit for a client.
do you know of a good way to do something like this
//(I know this part)checks block in hand: gets players balance: buys item from shop if player has enough```
That's just several chains of logic
Get balance & get item in hand.
Get shop with that item
Check if balance is higher than price
Buy
i dont know how to do that iwth the api im stuck on which methods i should use
It should all be documented...
its doccumented I know this -_- im just not completely sure
because everything in the api seemes to piont to a shop rather than a block itself
I mean, I don't really know how shop gui works, but you should be able to get the shop and then check the shop if it contains the block in question
i love intellij but for the love of god i cannot get the plugin to print out a simple println statement idk what im doing wrong
im pretty sure i set it up properly in intellij
Has nothing to do with IJ
https://github.com/brcdev-minecraft/shopgui-api/tree/master/src/main/java/net/brcdev/shopgui @hallow surge if you're using shopgui
Hello,
I'm Making a flying armor stand that stays to the left and behind the player, I define the position of the entity according to the player's yaw, but sometimes the armor stand goes in front on the left but not behind, here's is the code, if you need more details, don't hesitate
float yaw = player.getLocation().getYaw();
double additionX, additionZ;
double sinYaw = Math.sin(yaw * (Math.PI / 180));
double cosYaw = Math.cos(yaw * (Math.PI / 180));
additionX = -1.5 * sinYaw * 0.35;
additionZ = -1.5 * cosYaw * 0.35;
double newX = 1.5 * cosYaw+ additionX;
double newZ = 1.5 * sinYaw + additionZ;
armorStand.teleport(player.getLocation().add(new Vector(newX, 0.0, newZ).normalize()));```
What could it be?
That your statement isn't running
Show the code - you probably haven't registered a listener or something
no plugin.yml?
@white kite You have to handle direction, seems you're missing something about negative values. I don't know the fix from that code without testing a bunch of stuff. But usually a sign of not handling negatives correctly is "reversing" what is supposed to happen (instead of behind, it's front)
Yup, not IJ. And I think you could have found that if you read the logs on server boot, should say that the jar is an invalid plugin because its missing it and it didn't load
i feel so dumb
you're fine. Don't be like me and spend 24 hours trying to find a bug only to find its a typo (saving with capital letter, reading with lowercase letter, meaning no value was found because the key was incorrect)
yall is there a way to send a large amount of particles at different locations in one packet
No
@worn temple I recorded the issue.
The banner doesn't have the same position.
I want the banner to be in same position as the player
there should be š
@white kite I couldn't really tell you what the issue is then... might be updating is position too fast, or its rounding errors, or loss of precision. I'd just keep working on it, fine tuning the calculation and such. This is way way out of my skill set. The code I do doesn't do any sort of positional math that would need to be that accurate in the way you are doing.
Hey... I'm looking to make a custom recipe that uses a stack of each item how do i go about doing that this is the code I have now and I realize that RecipeChoice.ExactChoice is deprecated i would like to remove it but I don't know how...
cactusStick.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
ItemMeta itemMeta = cactusStick.getItemMeta();
itemMeta.setDisplayName("Cactus Stick");
cactusStick.setItemMeta(itemMeta);
NBTItem nbti = new NBTItem(cactusStick);
nbti.setString("KEY:", "Cactus_Stick");
ItemStack newCactusStick = nbti.getItem();
NamespacedKey key3 = new NamespacedKey(this, "cactus_stick");
// Create our custom recipe variable
ShapedRecipe recipe3 = new ShapedRecipe(key3, newCactusStick);
recipe3.shape("CCC", " C ", "CCC");
recipe3.setIngredient('C', new RecipeChoice.ExactChoice(new ItemStack(Material.CACTUS, 64)));
Bukkit.addRecipe(recipe3);```
is the plugin compiled and in the plugins folder? its not loading the plugin.
Infact, that actually looks like its the vanilla server?
Yeah built and in the plugins folder
Oh well that would be the reason why maybe
Stay tuned be right back
lol
@proper cairn could be the fact that plugin.yml is not in the "resources" folder
it doesn't have to be iv made many plugins with it outside the resources folder
@jaunty night its not that, its the vanilla server. Spigot outputs a lot more than that, and even says exactly what spigot build you are using.
Also, resources only tells the compiler to include these non-code files in the compiled version, you could just have it in the artifact directory and it'll work just fine
ah
Its just way better and the proper conventions to put it in the resources folder.
As if you decompiled the jar, you'd see there is no resources folder, just the base package with the stuff that was in the resources folder directly there.
But yeah, that's definitely just the vanilla server not the spigot/bukkit/paper server
If it found a jar in the plugins folder without the plugin.yml file, it would just spit out an error about that and say that it's not loading the plugin.
yeah
normally when I forget to add a plugin.yml to my plugin (I've done that more times then I want to admit) it spits out a massive stack trace.
Yup
yep
Okay so.
I figured out a way to get a class from a string using Class.forName and it seems to work
I hope that first question was a joke
but I have an issue where I need to do cls.INVENTORY.Open(player);
but obviously it doesnt recognize that
You have any idea a way to get it to work?
um
I'll need more context for what you're trying to do before I can tackle this
im basically trying to do [classname].INVENTORY.open(player);
Why are you trying to do it that way
what is inventory, why are you shading, what's the point of any of this
Im using a GUI api
@worn temple how do you know heās shading something?
and thats the method you need to do to open a inventory
I guarantee that is not the method
Just the inventory name needs to be changable
Whatās the name of the class
this looks like static abuse to me
@nimble stump ClassForName is shading
so your trying to get a class that has variable called INVENTORY and you need get that and run open on it?
Yeah, you can't do that directly.
explain
If you're shading
get class for name, get parameter, get method.
All of this can be avoided if you just have the class already, or just cast to the class.
This is all insanely bad practice
Thatās not shading thatās reflection
I need it to be defined in a config
are you doing NMS stuff
Okay, that's even worse letting it be config defind
and thats the method used to open it
Why is the class configurable
None of this is good practice at all
Why would your end user have any idea what class name it is
And you can't just get a class name directly, you have to know the exact package structure too
This sounds like an XY problem my dude
yeah I just found of a way around it too
Sounds like you were looking for a solution to a problem that just shouldn't exist....
PacketPlayOutOpenWindow packet = new PacketPlayOutOpenWindow(
entityPlayer.activeContainer.windowId,
"minecraft:hopper",
new ChatMessage("Amount: " + amount),
event.getPlayer().getOpenInventory().getTopInventory().getSize());
entityPlayer.playerConnection.sendPacket(packet);
entityPlayer.updateInventory(entityPlayer.activeContainer);
anyone got any idea why that isn't updating the inventory title
It's being ran, just not ... doing anything
jesus help lmao
now i cant even get the local spigot server to launch like god is mad at me today omg
loool
are you sure spigot.jar exists
^ yeah, usually its spigot-version.jar or something
its called spigot.jar.jar
you can tell because you don't have extensions on and can see the jar extension
(protip: turn on extensions)
^