#help-development
1 messages · Page 689 of 1
¯_(ツ)_/¯
i’d follow Mock pattern then
bc XMaterial is already smt
so people might get confused
What does MaterialX?
legacy 
oh ok
XPlayer is the base player class of my project (LightPermsX)
ohhhh
AbstractPermissible prob has fields
wait, can i use different mappings in spigot?
i guess i don’t have the full context,
you can use mojmaps
if it'd be an interface I'd have to rewrite this whole logic for all things that can have permissions (e.g. groups can ahve permissions too)
Wtf is lightpermsX
pex and luckperms
seems legit
luckpex
Whats a SortedUniqueList?
i wonder if there is a project that makes this stuff testable already
if not ik what i’m gonna do today
a list that is always sorted and cannot contain the same entry twice
MockServer when(?)
mock bukkit
MockBukkit
so a treeset
hot
MockBukkit best shit fucking ever
Oh Verano is back 😄
Im ready for some wisdom this evening
I mean it in the good sense, its prety amazing using it for debugging and testing
How can mirrors be real if our eyes aren’t real
good ol' verano
wtf I've looked for sth like that for ages
No wait that was Jayden smith
LOL
known for being a drunk kid and stealing my 5 year old utilities and ignoring the new code
Looked like some SortedSet impl to me. Maybe TreeSet?
look at the collections sub classes javadoc there are many you’ll find that you like
LinkedHashSet
that's not sorted
I dont suppouse you talking about me?
I am
SorteableLInkedHashList 🤨
hm why does Collections.unmodifiableList not allow me to pass a TreeSet
that's sadge
bc it’s not a list??
Only a fool cries over a torn pocket
gotta love it when sendBlockChange or sending the packet manually for PacketPlayOutBlockChange doesn't appear sometimes randomly... 💀
haha i was kidding i mean i already known you were talking about me haha. Just wanna provee it
Use List.copyOf(Collection) instead.
yeah well but it's also not unmodifiable
gotta love relying on that API for fake blocks
Why do you make laught of me?
It's like the most unreliable part
java 8
fake blocks take some effort to get right
Legacy versions 💀
I'll just return an UnmodifiableTreeSet
does anyone know the inspection name?
just a warning i dont even give attention
yeah i wanna disable it
IDE settings
im so fucking confused
.... i know
oh thanks lmaoo
no results
I didnt even know how it called thats
Are you running it in a scheduler or something?
So you are not using intellij?
Got no clue what you're trying to do
Yep
oh
Also if you flood the client with packets it makes a cool effect
works with spaces
he wants to disable the warning
epic

I've put debugs, I've tried sending it through the channel directly, (writeAndFlush)
ugh fuck TreeSets
shits confusing tf out of me
delay by a tick
they are not remotely similar to my SortedUniqueList
Cant you use another collection instead of it?
they don't even allow get(0)
real they are pain in the ass
I simply wrap this into a Preconditions.checkState() for minimal annoyance
I write proper checks
na, just disable the warning and there you go
this > stupid TreeSets
How much proper do you need this to be?
I have disabled like 30% of asshole warnings in IntellIJ
It's already delayed by 40 ticks when it's destroyed 💀
Preconditions.checkState(folder.mkdirs(), "Could not create folder " + folder);
Now i see mfalex code, is there a difference between super.add() or add() directly?
if you override add, then sure
Did someone say recursion
Did someone say recursion
im p sure it also returns false if dirs already exist
Thats why you check before calling this method
gotta throw specific exceptions n such but I can't bother
I wanted to know if you can write different values in the same placeholders if, for example, they are in different itmeStacks in lore
in placeholder api
yup im doing that
So... the same thing i did. Just with extra steps.
yis
😄
Placeholders are always bound to a player object.
You have no notion of where this placeholder is used.
fuck packetplayoutblockchange
all my homies hate PacketPlayOutBlockChange
by the way, that plug-in for checking code style in intelji that you advised sometimes contradicts itself, for example, with brackets
can't blame em
or not
I'd like to see it trip over brackets
what plugin
Nah fr does anyone know sth like a List that is always sorted (not just ordered)
TreeSet doesn’t allow get(0)
if(){
} - wrong
if()
{
} - wrong
if() is wrong
why does this packet seem so fucking unreliable
Do you remeber my file handler i didnt some years ago? I finally re write it, what do you think about the v2?
public class FileHandler extends YamlConfiguration {
private final Plugin plugin;
private final String name;
private File file;
public FileHandler(Plugin plugin, String name) {
this.plugin = plugin;
this.name = name;
this.reload();
}
public void reload() {
try {
this.file = new File(plugin.getDataFolder(), this.name);
if (!file.exists()) this.createFile();
this.load(this.file);
} catch (IOException | InvalidConfigurationException ex) {
plugin.getLogger().severe("[FileHandler] File " + file.getName() + " couldn't be reloaded. Reason " + ex.getMessage());
}
}
public void save() {
try {
this.save(this.file);
} catch (IOException ex) {
plugin.getLogger().severe("[FileHandler] File " + file.getName() + " couldn't be saved. Reason " + ex.getMessage());
}
}
void createFile() throws IOException {
if (file.getParentFile().exists()) file.getParentFile().mkdirs();
if (plugin.getResource(this.name) != null) plugin.saveResource(this.name, false);
file.createNewFile();
}
}
It's reliable you just need to know how to use it
my eyes got nuked
sonar lint
ehh
better way to do it
Why dont you get the field directly by id??
Internally a JsonNode is just a Map<String, Object>
just go all out and make a baller system
Hi Imillision, how are you? I'm Greg, ten time MVP award winner, let's work together to get this fixed.
did you try turning off and on again?
I'm literally wearing a tshirt saying that
Fun fact
Time to queue them and send them one tick after one another
i always thought they are bots
If that shit doesn't work
Yes
Everything is actually a Map<String, Object>
then I will be so FUCKING confused
and not independent advisors
Life is Map<Money, People>
Infinitely better.
People, Money *
tho money is the key
hmm
deep
Doesnt matter if your node is 1MB or 20 GB.
It will always be the same performance.
how to bind these placeholders not to the player but to the itemStack and its model
i don't want to fill everything through a for loop
This also looks like you are abusing the jackson lib for some shenanigans.
Are you using PlaceholderAPI?
.replace("{item_category}", someMethodThatReturnsStringOrSomething) @upper hazel
easiest way
i don't want to fill everything through a for loop
?
if this shit aint work me confuzzled
wdy loop
This will tank your performance if the amount of placeholder grows.
String operations are excruciatingly slow.
i want do this but this plugin connect with player
not with itemStack
any alternatives?
to replace a certain placeholder you need to go through the whole lore
yeah thru every line
so this for loop
or a stream
Regex or Tree skip search
depends how often it runs
you could do either what 7smile7 suggested or cache lore
and players will often open it
this is exactly what i use for my plugin
Of course, when selling an item, you can change Lore for it, but it will be too difficult to update its sale time
a single loop and checks that go deeper if it keeps matching
pringel
and my placeholders are compiled as well
so this only happens once
then i have a tree and a context
because i also made ternary placeholders
Can uploaded plugins to spigot have license?
as long as they work offline yes
Wdym
wdym by license
do you mean drm where you need a key?
if so no
Ive written the general idea for you. This doesnt use regex but a simple char iteration.
You still need to write a ton of logic but this is a very fast implementation.
Basically copy the input, char by char to the builder and replace and placeholders.
public class PlaceholderParser {
private static final char PLACEHOLDER_PREFIX = '{';
private static final char PLACEHOLDER_SUFFIX = '}';
private final Map<String, Placeholder> placeholderMap;
public PlaceholderParser() {
this.placeholderMap = new HashMap<>();
}
public String parse(String input, OfflinePlayer player) {
StringBuilder builder = new StringBuilder();
StringBuilder currentTokenBuilder = new StringBuilder();
boolean inPlaceholder = false;
for (char c : input.toCharArray()) {
if (c == PLACEHOLDER_PREFIX && !inPlaceholder) {
inPlaceholder = true;
} else if (c == PLACEHOLDER_SUFFIX && inPlaceholder) {
inPlaceholder = false;
String token = currentTokenBuilder.toString();
currentTokenBuilder = new StringBuilder();
Placeholder placeholder = placeholderMap.get(token);
if (placeholder != null) {
builder.append(placeholder.getReplacement(player));
}
} else {
builder.append(c);
}
}
return builder.toString();
}
}
One important thing you really want is parameters. Those can be implemented in a similar manner with a
separator character like _ or #
if you mean license as in making it open source or not with a specific license ofc thats allowed
No. Plugins need to be able to always run. Even if the server has no internet connection.
And validating a plugin without internet connections isnt really possible.
Thanks guys
that only applies to paid plugins
it also cant require additional action from the user
plugins need to be plug and play
that also only applies to paid plugins
You usually never tinker with json nodes.
The intended purpose is to create an ObjectMapper instance and then
register Serializer or Deseriaizer on it.
Then your code will be simplyfied to something like;
String json = ...;
ObjectMapper mapper = ...;
SomeComplexPlayerData data = mapper.readValue(json, SomeComplexPlayerData.class);
Yeah, this is a good example of how not to use jackson. 👍
By registering dedicated serializers for every type you want to serialize.
I personally prefer Gson because it uses a ReflectiveTypeAdapter on default.
Which is a bit hacky but lets me serialize literally anything without having to write
serializers for it.
it can be tied to the same subject right?
jackson allows you to do that too?
you can even configure the default behavior on the class with its annotations
Yes, but the equivalent of their TypeAdapterFactories is garbage
Serializing interfaces and abstract classes where you have to retain the runtime class
was an actual issue for me when i used jackson back in the days.
abuse mojang dfu instead
Yes i know. Jackson is an industry standard. I just learned how
to do anything with Gson and now im polarized towards it.
wait it takes 1 text not lore so the for loop will still be
wait wouldnt this in theory ban using the libraries: thing in plugin.yml
No
does it only apply to drm
You’re allowed to download dependencies on the first run
hm
mapstruct when
structmap
that gives me an idea ngl
I mean
Just because you can skirt around the guidelines doesn’t mean MD won’t just say “no”
true
am i doing anything wrong here or why is it not finding en-us.json
no need for first slash
the reason why its confusing is because im using this sorta stuff multiple times, i've got another folder in my resources and it does find the files in that
with the slash on the start
ill try without but it seems inconsistent
yeah it works but im still confused lmao
Does the .jar really include it?
What are you calling #getResoureAsStream() on?
If its the class object it needs the /
/ in front of the path is used for absolute paths
Yes
let me show the other one
this works lol
but /languages/en-us.json doesnt
despite the same structure
i think thats weird
Idk, I looked at the patches from spigot or something, that was the usage it seemed.
I didn't look too deep tho.
I will write a plugin, but I am confused, I will make a server between 1.17.1 and 1.19, I will make a special plugin for it, but which one of the bukkit api will I use, the lowest or the largest one?
If you want to support multiple versions, you have to use the API of the lowest version you support.
Ağh thx 🥺
How would one rotate a display entity based on the yaw of a location? I've tried:
new Quaternionf().rotateYXZ((float) Math.toRadians(p.getEyeLocation().getYaw()), 0, 0)```
But it doesn't rotate correctly. Sometimes it's facing the right yaw direction, most of the time, it's not. When I do:
```java
new Quaternionf().rotateYXZ((float) Math.toRadians(p.getEyeLocation().getYaw()*-1), 0, 0)``` It rotates it in the exact opposite direction of the yaw every time.
And for coding some specific things you will have to use NMS right? Specially related to tablist, scoreboards?
Why
Depends on how far back you plan on supporting and what you are trying to achieve.
since when scoreboards code from 1.8 work on 1.21, without NMS?
isn’t there a newer part of it in a later version( 1.13 ?)
Scoreboard api since 1.13 changed a lot if im not wrong
Idk when it was added
I don’t store memories for versions older than 50% of server owners
Kek
oh haa
I just ask because i wanna improvee when needing to code multi version plugins
Because the demand now adays is whatever version, not just 1.8 or 1.21. They ask for support for most of the versions they are really dumb btw
You know you can say no right?
Would you say no, to more than 120$?
vector has rotate around an axis
check that
Is it difficult to make a plugin with Kotlin and do you need an api, you know, for normal .class, spigot 1.17.1 snapshot api is needed, for example, do you need this in kotlin?
Kotlin 💀
its not difficult tho
oh, you are till alive!! Such a long time
just a bit more complicated
Hey guys! Is it possible to show a different block for each player? What I mean is: for example, there is a coal ore, player 1 breaks it, I cancel block break event, the coal drops and I make that block a stone for player 1. All other players still see the coal ore there, anyone can break it, drop the coal, and for each player that block will become a stone.
Hope I was able to explain the idea)
Kotlin sucks bro
yea :)
idk
I mean kotlin is just... kotlin
Is Kotlin too hard???
depends
Id say it isnt
hard is very subjective
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.0'
id 'idea'
id 'com.github.johnrengelman.shadow' version '7.1.1'
}
group = 'org.outspending'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
name = "spigot-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
}
dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test'
compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
}
sourceCompatibility = 17
targetCompatibility = 17
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "17"
}
shadowJar {
destinationDirectory = file("D:\\MC Server\\plugins")
}``` for kotlin
kotlin mid
i dislike it
agree, kotlin looks like codding on rust. Shity scripting lang syntaxes
uh whaaat
now rust is epic
no it doesnt look like rust sir
I just want to make shop menus in a+++ games like battlefield V or dbd. In short, I will make buttons and panels with kotlin.
wheel, no exactly but its turning into it
Player#sendBlockChange() would probably be the place to start, but that kind of system still requires you to track every single block that could be mined by players.
this is rust:
impl Client {
pub fn new(stream: TcpStream, id: u32) -> Client {
Client { stream, id }
}
pub fn handle_connection(&mut self) {
self.send_message("Hello from the server!".to_string());
self.receive_message();
}
fn send_message(&mut self, message: String) {
self.stream.write(message.as_bytes()).unwrap();
self.stream.flush().unwrap();
}
fn receive_message(&mut self) {
let mut buffer = [0; 1024];
self.stream.read(&mut buffer).unwrap();
println!("Received: {}", String::from_utf8_lossy(&buffer));
}
}```
yes i know how it looks, really ugly code syntax
Aow 😩
i can see the similarities somewhat
yes its not exactly similar, but has sort of it
ye
but i dont care, its the people that just over complicate
Do you know about kotlin decompilation? Is it more difficult rather Java? Josh
Many thanks, I'll look into it
i have no idea
i've used kotlin like twice
According to everyone, I think kotlin is very difficult. 😄
wacky tho
class KotlinTesting : JavaPlugin() {
companion object {
lateinit var instance: JavaPlugin;
fun getPluginInstance(): JavaPlugin {
return instance;
}
}
init {
instance = this;
}
override fun onEnable() {
Something();
}
override fun onDisable() {
logger.info("KotlinTesting disabled!")
}
}```
java is better imo
I mean to decompilate is difficult right? Because some professionals devs told me it looks more difficult to decompile
Do you think I can assign a menu and button that can be opened with a simple private key with kotlin?
Because the lang tools arent realyl improveed
kotlin isn't difficult just i like java better
it does the samething
no real improvement
I mean im talking about code decompiling
except for like data class but you can just use records lol
ye ik
I think it is very difficult to make a plugin, even in the rust game I did not have so much difficulty.
how do we do if a player has permission ese.mc they can do the command but if they don they cant but if they have ese.* they can
I have something related to that an issue
So can I do what I said with java
Its telling that i dont have permission to child command while only having the child permission, but with the base permission allow.What could be happen here?
or would they need both
Ese?
Es? I talk it spanish
example
they're both compiled into JVM you cant add anything special to them
Ha oke 😏
they dont have any performance improvements so why learn a whole new language
i want to make it that ese.* runs across multiple commands but can give perms seperate to certen people
Setup your permissions properly in your plugin.yml.
permissions:
ese.*:
ese.mc: true
ese.whatever: true
Then just check where you need to in your code using Player#hasPermission().
yes, and also just for "shorting / writting few less lines". That can be done with Java and dont require a "new lang"
yes but that comes at a cost
where do i put that
plugin.yml if im not wrong
How so no, I will not add it, I will only use it, for example, I made a gui panel, I will add an image to this panel with a photo link from imgur and add a button there, can't I do that?
and how do you that via code? WHile registering command thru commandMap
i never said you couldn't
thank you
You don't need to register through the command map? What?
your welcome my mate
i'm just saying, my personal prefrence is java since why would you learn a new language
I dont like plugin.yml for commands. I just use CommandMap and i want to know how to achive the permissions structure thru it
I'm sorry I misunderstood
doing commands without the command map is a pain
Why do you mean it? Can i get explained
My lib registers through command map with a label system manually adding into the command map
You are right
Yikes, mines does too. But i want to be able to register all it base and specific permissions, like most do thru permissions into plugin.yml
Sıkıldım lan 1 tane türk bilr mi yok of
O
I'll show
https://github.com/Y2Kwastaken/Suketto/blob/master/bukkit-core/src/main/java/sh/miles/suketto/bukkit/command/SCommandRegistrar.java you can probably execute it better than this, but this is the general idea
Its telling me that i dont have permission to run my child command, but only happens while im using its specific permission
If i try to run it with the base one it allows perfectly
do you have permission for the child?
Can I add a button to the non-inventory main screen in Minecraf, for example a simple button plugin on the top right to teleport to a place
no
mods only for that stuff
plugins can't add things only modify behavior
Yes i already checked, and i have it. I checked thats the same i added, to skip the mistake issue. But couldnt succed.
This my mocde @river oracle
Thank you very much, now it's settled in my head
I have one last question, if I put a mod on my server, people have to install that mod, how can I do it automatically or what can I do?
You can't. If you need mods on your server, you have to run a modded server.
Which requires people to download your modpack so that they can join.
So in short, the man has to download curseforge 1.17.1 for example to enter the server?
More or less.
what, i tried that but didnt fix mi permission issue
Minecraft is such a difficult environment help
i mean minecraft is not a game engine, its what its. It cant offer many things
Uğh okey
honestly it can be a game engine if you surround yourself with teh correct libraries you can do pretty mu ch anything reasonably given you are making a mod
You are so right
plugins is when things get hacky fast asf
Now, you could make your own client and make changes within it, but good luck convincing people to use it.
Exactly tha
Maybe
Thank you very much for filling the gaps in my mind now
I have to use a mod pf
The issue is the next, plugins goes on server side and mods on client side. Plugins allow for doing server side things, like managing scoreboards, tablists, items, etc. But dont allow to interact with the items texture exactly
And mods allow to make modded things, i think thats what you are looking more into it
Not directly. Plugins can mess with things indirectly though.
yes, but you wont be able to fully moded it
Resource packs
a
Woo
A I wish I could put the button only problem button when I solve the texture with imgur
discord dead?
What exacly you need?
Even if there is no visual texture, you can click on an empty key square or any other
So a simple 30x10 clickable button or a plugin that opens a custom gui panel when you press the e key
Sorry, let's make it an x. 😄
That doesn’t really answer the question
I said let's make the E key an X eheh
No you cant bro
You must either do it via plugin and having a texture pack on the client, or doing it directly with a mod
For example, I wanted to create such a panel when I press x with plugins
I can solve the texture package with itemsadder, but I think the button job is difficult, I think it's a special button.
Well you can definitely do something similar to the panel with just a plugin
You're not gonna get that kind of functionality out of a plugin w/ resourcepack.
But you can’t detect the player pressing X
The size I want without such empty square boxes?
Your area is too big.
You can definitely make it appear bigger than a standard inventory
But you can only detect clicks within the bounds of the inventory
You can do full screen inventories
Well technically they're not inventories at all
You could in theory hack something together with a resourcepack, some display entities, and those new interaction entities.
Wouldn't be done in an inventory though.
Yes, yes, I know, but I want to add a special button instead of inventory clicks, you know, like x y location on websites, so that you can add a special button and click where you want.
Finally someone who fully understands me uwu
You can do that
Add a custom button waow are you serious
It requires a resourcepack and a lot of math
Maff
oh and you need to be on a modern version with shader support
Import bukkit.** what should I use or what codes do I know
What exactly are you referring to?
@river oracle are yoo alive bro?
I'm already going to do it like this, I'll get the location of the buttons from mcreator and then I'll throw the code there.
Shader magic for full screen menus
That's a thing? 😳
Hm, ive played with the idea of using core shaders for custom interfaces. But
click detection is a problem. As far as i know the client doesnt send any interactions
outside of inventories and the most granular detection you can do are slots.
I assume you trigger the shader with a title
Basically what you do is you put a shader covering the entire screen
and you listen for when a player punches
then you get the direction of the player head and calculate where the cursor is
In short, can I make a special plugin for button interaction?
Yeah seems reasonable enough
Ooh, right, you could create a virtual cursor and use the clients delta rotation for its movement.
Have you messed with the new Interaction Entities? They have left and right click detection built in.
Hmm
You are so smart😩
That's really cool
So that cursor is controlled by moving your head
The cursor is rendered by a shader
How could you do that?
and your click is the punch and head direction
Bandicam
Yes. Ive build wordl with them. Those where my first attempts.
People haven’t heard of OBS
That's not my video nor my idea. Credits to the people over in the Minestom discord 
@chrome beacon Is this a mod or a plugin?
you can actually do something like this with villager trade gui
and custom model data
for item 2d models
It can be done with a plugin and a resourcepack. What's shown in the video is neither
It's a Minestom implementation
Basically a plugin but more posh
Yeah
Wack
I was very curious if there is a video tutorial for this or if you share open source.
The people in the Minestom discord do some really cool stuff
looks like entity display feature from 1.19
Hmm
I told you how it works
Even if I had the source it wouldn't run on Spigot
Hmm maybe I need to stalk the minestom discord for ideas then
fr
if its minestom then yeah it wouldnt run
That’s why I’m in the fabric discord
A okey
With enough work you can
What about mobs
Yeah they make a lot of cool stuff
okay mobs
i just think world generation is the hardest one
to make
faithful to vanilla
Yeah one guy is working on custom mob systems with Display Entities
Oh hey I’ve done that
I mean minestom is specifically not meant for vanilla
is there any way to lock apps that you run in virtual desktops on win 10?
or prelaunch them with a shortcut
so i dont have to drag and drop to each virtual desktop each time
its annoying
Someone did implement beta world gen in to Minestom
i would like to have a shortcut that preloads the apps to the each virtual desktop and maximizes it so i can have proper dev environment in a matter of clicks
Modern worldgen would be a lot harder though
anyone?
is this using texture pack?
y
Maps would probably work too
He’s trying

Wait a minute
Those arent multiple lines in the action bar. Dont believe what anyone else tells you.
Boss bars?
so wtf is this
they dont look like actionbars since those dont have text shadow afaik
I want to say invisible item, but I doubt that one myself.
bossbars seems like plausible thing
or invisible scoreboard with some font exploits (im sure its not scoreboards dont have text shadow)
Unless it's more shader magic?
could be also
Text shadows can be deceiving because you can add/remove them using core shaders 🙂
Those are actual lines within the actionbar
so you've used shader tricks?
But you said it’s not an action bar
i feel like he's keeping this a secret as kfc's recipe
How can I make a clickable keyboard like this as a plugin
My other guess is just using font ascent and negative space
shaders with resourcepack
and serverside plugin
you cant do this with plugin alone
forget it
And this system was developed in order to have custom huds while still allowing messages above them
You need a mod to
you need serverside resource pack
these days things like this dont require a mod
thirst..?
only some shader resource pack logic and plugin to handle the displaying the right things
but you've broken your arm
Hmm, as in that video, mesrlq clicks on a letter, in fact, I don't understand if that button or the place on the keyboard is a place in the inventory or what exactly it is.
this seems like a shader that renders an inventory differently, plugin handles inventory click events to define what gets rendered after the clicking
and hey it even says fuck to you
Imagine having to deal with each broken bone individually.
This project was too complicated... Never launched sadly.
I understand real crazyyy waoww
Thx
Reminds me of that mod that gives you body parts and health
Then you get headshot by a skeleton and die instantly
reminds me of this
SIGN UP FOR DROPOUT.TV, available WORLDWIDE: https://bit.ly/2DFBBea
App available in Canada, Australia, New Zealand and the U.S.
An exclusive look at the year's most anticipated housework simulator.
See more http://www.collegehumor.com
LIKE us on: http://www.facebook.com/collegehumor
FOLLOW us on: http://www.twitter.com/collegehumor
FOLLOW us...
How to execute code during some time every second and so that I can cancel the execution of this code under certain conditions?
Start a runnable when your server starts that always runs and add a boolean to en/disable its run method.
I meant a little different.
Can I write something like this?
new BukkitRunnable() {
int timer = 15;
@Override
public void run() {
if (status.get(victim).equals("agree")) {
player.openInventory(VictimInventory.GUI(victim, "Кража"));
player.sendMessage(plugin.getConfig().getString("success_of_steal_message"));
this.cancel();
}
else if (status.get(victim).equals("disagree")) {
player.sendMessage(plugin.getConfig().getString("lose_of_steal_message"));
this.cancel();
}
else if (timer <= 0) {
player.sendMessage(plugin.getConfig().getString("waiting_time_expired_message"));
this.cancel();
}
timer--;
}
}.runTaskTimer(plugin, 0, 20L * 5L /*<-- the interval */);```
public class teleportToBlock implements Listener {
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK){
Player player = event.getPlayer();
Location loc = new Location(player.getWorld(), event.getClickedBlock().getX(), event.getClickedBlock().getY(), event.getClickedBlock().getZ(), player.getLocation().getYaw(), player.getLocation().getPitch());
player.teleport(loc.add(0.5,1,0.5));
}
}
}
I have this but when the player teleports the pitch goes to 0 for some reason?
I've just installed spigot (Im on a MacOS platform), I have dragged my plugin into plugins folder and and stopped and restarted the server multi times and it wont work is there a reason?
the yaw works when its literally the smae but the pitch does not
Get the eye location of the player instead
when typing 'plugins' in my console it shows (0)
You probably have an exception when starting the server
I did stop and restart
then ./run.sh
the .jar folder is in plugins
Look into your log. There is an exception.
cheers
it works sorry I had to install another plugin, thank you for responding anyway
I would solve it differently but this should work.
There are just some problems that might emerge. But youll get there.
Okay, thanks!
Hi, how can i add a new remote repo to maven?
To publish to?
to use depends
you wanna host a repo?
But add it globally
or add a repo to your pom
I mean add a remote repo but configured already
So i dont need to do it on every project the repositry tag
im p sure you have to
<repositories>
...
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
Im here but i cant add configure it here
Yeah i know, but i want to add it globally to Intellij
I think you can simply add a remote repo to your maven profile.
But i would highly advise against doing that.
I want to add it because its a work repo
And i will code many projects with dependencies from their repo so i will just stablished shit
@lost matrix have u done any1 bytecode manipulation, with/without mixins?
i am considering to inject some enum constants but unsure if thats the right approach
You mean runtime or compiletime?
well prob compile time
if I can
just wanted a second opinion
in short, minecraft recipe book
Yes im currently digging into code generation and modifying existing sources based on annotations.
Pretty much like lombok does it.
ooo how appropriate
But do you know how do i do that?
tbh it's far easier to post-process the already compiled classfiles
than making a compiler plugin lmao
but well, continuing, im considering to just inject some custom enum constants into the minecraft recipe book category enums
since they are enums and not registries for w/e reasons
But you wont be able to work with the generated classes while coding.
Unless you are using an annotation processor and AST rewrites.
how to make plugins with c++?
i mean, it just depends on what you're doing
Hm, im not sure how well you can do that with enums. Would have to look at how
they look in bytecode format. You might get problems with incomplete .values() returns etc.
*on runtime that is
And as soon as the classloader touches the enum, all constructors get called.
This will be tricky.
I kind of developed the opinion that enums are overused...
well I might as well just pull a classic copy paste and write my own recipe book :|
XD
yeah for the open closed principle enums are a troll
That wont be possible. There might be a server impl in c++ but writing plugins for c++ applications is hell.
where is the c++ server implementation
You will be much better off writing plugins for a Rust implementation.
If its based on Bevy then you might have a decent time.
where is the c++ server implementation
DuckDuckGo. Privacy, Simplified.
there's no official c++ implementation of the mojang server, unless you want bedrock
if you want to write plugins for the java server, you can use JNI, but you won't have a good time at all
Oh yeah. Almost forgot cuberite exists.
Not sure if its still maintained.
https://cuberite.org/
A custom Minecraft compatible game server written in C++. It's a fast, lightweight, and awesome replacement for Vanilla.
*Up to 1.12.2
lol
Why do you want to write plugins in C++?
2 reasons
- idk java i know c++
Dont say performance pls
- i forgot
ate
(maybe learn java) :>
no java is a dumb language
Well. This sounds like a good reason to tackle a new language 😄
Cant have enough of those
java is object object object
Yes object orientation sucks but java is multi paradigm you goof
c++ is functionality functionality object functionality
what else would i use java for other than plugins for the craft
Expand your horizon. Knowing multiple languages is always a plus.
And you will learn to love java and hate C++ in not time.
lol bro
Let me introduce you to the worlds entire backend. lol.
i have nightmares about managing memory manually
i was on a date with a girl one time and i was just thinking about C++
One word… rust
the whole ducking time
and memory leaks
horrible!
Rust is, to put it simply, the superior low-level language.
too high level
you are just a privileged developer.
garbage collector 🤓
Also any batch processing tasks, since those get pretty fast on java (thanks, JIT)
rust 🤣🤣😂😂🤣🤣😭😭😭😭🤣😂😂😂💀💀💀😂🤣😭😭😭
Nobody has ever said that...
Try it out. Superior to C++ in any way.
you wish
Yes, me big sad now
Well, those are your options.
- Use a C++ impl from years ago that goes up to 1.12.2 max
- Learn and use Rust for this very promising Bevy-based impl
- Leand and use Java for writing Spigot or Paper plugins
define high and low level
buddy i will never give up on C++ just like that
Someone did not get the joke
inb4 that DEFCON talk about assembly being too high level
You must be a pretty young developer if you are so one dimensional in your
language choice. Use the appropriate language for the task. You will have to
learn other languages eventually.
are snoop dog binaries open source?
The appropriate language is always node
young my ass, i am 57 years old and an extremely racist C developer. i don’t mean to come at you like this but you won’t change my mind. C is my world
take that with a pinch of salt
"Everything that can, will eventually be written in javascript"
so don’t come here talking about one dimensional
i know that C is superior in any task
depends on the task
Hot take, whatever language you're most comfortable with is the superior language 
That’s why I make websites in skript
skript?
you wish, it’s people like you in this world stealing our jobs and wives
If you like Skript, it's great
I'd be hesitant to call it a programming language, but yeah
ill make an OS with it then
In theory you could bridge between java and compiled binaries using JNI or the new native memory api from java.
This way you could still write Spigot plugins in C++.
But if you want to properly stay with C++ then your only way is to find
someone that implemented the mc server in C++ and hope he has an API layer for you.
Well, i would use my veto at this point.
C is a god complex, C was brought to the world as a celestial object from a different intergalac

C is superior
i will now proceed to implement the server and make it closed source.
someone is starting to get it
C is a really easy and powerful language. The only problem is that you need to invent clay before you can
even think about building a brick house.
coreutils tho
Do I need to invent water before I invent clay
Yes. Start by defining molecules.
i wrote a sound driver because i didn’t want to install the sound driver for my speakers one time
people in this day and age are too afraid of technology
Alright I’m gonna need some hydrogen, some oxygen, and some tape
they are making everything for the simple minded these days
like having file extensions off by default on windows
which simple minded smooth brained thought that was a good idea
That is my very first action when setting up a windows system.
I always have to show my file extension
Tinkering with all the braindead folder and file options
It's so annoying
I heard windows 11 has an option to switch back to command prompt that isn’t buried in the registry
That’s nice
This is a mammoth task. But if you want to go through: This is the best site for understanding the client-server protocol:
https://wiki.vg/Main_Page
anyone know why dis aint firing?
You can probably get a limbo server running with a simple TCP library within a few hours
i rather continue work on my botnet
That sounded like some kind of flex
You are pretty much not 57. You speak and meme like a genZ spawn. 
Did you register the listener?
yes
you already know it was
i enjoy slamming queer minecraft servers
and regular ones of course****
Emily coming with the hard words right away...
i am the reason you don’t run a server
damn, you got me there
that's how the open source mirai botnet (one of the largest botnets) started - they wanted to take down other mc servers so they get more players
obviously it wasn't open source back when it started - they open sourced it to prevent getting caught (they still got multiple years of jailtime though)
Recompile, make sure you updated plugin is on the server, and try again.
will do
I'm not joking, there's videos on youtube telling the whole story, quite entertaining
yeah until the server firewall bans the bots
And if you are a server as big as mineplex and you are able to take down hypixel, obviously you'll get a bunch of players
yeah mineplex is SUCH A BIG server rn
back then it was
still no :(
A firewall will still go down under hundreds of terabytes/s
And you connected to a server throught this proxy?
mitigation :big-brain-emoji:
yes
mitigating ddos attacks can be expensive
not always
Latest version on everything?
remember the internet is always advancing
Banning bots can prevent network overload?
No exceptions when starting the server?
wdym
wdym? Of course it is. Huge ddos attacks are expensive to mitigate
How can you prevent traffic overload with firewall banning bots
unless you just wanna shutdown your server which would cause the ddos to succeed
by banning the bots so the traffic overload stops
???
Literally what the fuck
i don’t understand what the fuck ur asking
make it clear
traffic overload from what
How do you think a firewall works?
that just depends on the size of a ddos attack
i just updated it and still doesnt work, no exceptions on startup.
I'm asking if you think you can prevent large scale ddos attacks by banning zombies
You can't stop network port overloading
We were talking about mirai, one of the largest botnets in history
what is large scale to you
You must be doing something wrong.
Try listening to other events and see if they fire.
At least 5
I thought about 1.5
no 5 bots wouldn’t do shit
even on a good net 1000 bots can still get banned by firewalls these days
Really? Explain it to me. I have no idea how networking works.
yeah the largest net i know of only has 125k bots
i might test something
someone give me a random minecraft server
But did it work
go ask in paper
Mirai was estimated on 145.000 devices with about 1Tbps
@echo basalt watch out buddy
ok if you mitigate it once then you can most likely stop the attack a second time
Myeah. Depends.
I suppose so?
It was even used in order to take down a server that deactivated an encryption virus.
Then google and cloudflare jumped in in order to stop that ddos attack successfully.
Was a really cool story
Unless they said they were using Velocity
either way they were using a paper fork
But... they're writing a Bungee plugin...
*Waterfall
Oh okay
Well if I ever want more players I know what to do
Which means when i asked if they used the latest version, they lied.
Isnt waterfall discontinued?
no ur a harmless don
And they can’t throw me in jail because I’ll ddos the jail
No idea lol friend just setup the server for me so i can test the plugin
ddos the entire police. All crimes are legal then.
Ddos the police comin straight from the underground
Go learn java and write some spigot plugins pls.
Probably
probably
Look at these nerds in #help-development
no i remember running a minecraft server like 6 years ago then spigot just came up somewhere so i joined the discord server
i’m gonna go chill on irc
ngl i laughed
Now that I called you guys nerds, back to figuring out how to re-create an android app's UI kek
u are a real life npc
?
no u
Oh... isnt that bannable?
You mean recreate in terms of style? What else would you use besides css?
also not using CSS, doing it via http://figma.com/ LMAO
The temptation to say figma balls is strong
what forum framework does spigot use
xenforo
ok
Aaah. Ok. So CSS with clicky and draggy 
I dont... follow. I would assume that this is backed by css.
Mayhaps, but I don't do any CSS
Understandable
It's just to create, share, and test designs for websites, mobile apps, and other digital products and experiences
(totally didn't just steal that off google search)
If it works on websites, mobile apps etc then its probably electron
This code should make a team prefix appear next to the player’s username, but it doesn’t seem to affect anything. Yes I did instantiate the listener, and it does work, I checked.
public void onJoin(PlayerJoinEvent event) {
event.getPlayer().setScoreboard(scoreboard);
}
public void setPrefix(Player player, String prefixText) {
Team team = scoreboard.registerNewTeam(player.getName());
team.setEntry(player.getName());
team.setPrefix(prefixText);
}
What might be the problem?
Figma is just a design tool. Its CSS that it displays is kinda superficial as it makes assumptions.
and a pain to use sometimes kekw
Currently trying to figure out how to re-create
return Card(
margin: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: Padding(
padding: const EdgeInsets.all(12.0),
Using it 🤔
wtf is that? lol
okay so, I was gonna show what it should look like but android studio is being a cuck
but that's dart code
I did change the player’s username color through NMS. Could that be causing an issue?
good to know I'm not the only one that thinks that
doesn't want to show the emulator for some reason (╯°□°)╯︵ ┻━┻
That could very well be a problem.
use scoreboard teams !
I agree. I haven’t used scoreboards before, and added the NMS code before doing anything with teams
Then found out you can change a team’s color
it’s dead simple and also allows for tab sorting if that’s a goal for you
Yeah, much simpler than adding a duplex handler to intercept packets and change the name LOL
Went through a Dart & Flutter tutorial, which had me make the following. I can actually use this, but I want to re-create the UI so I don't have to fuck w/ dart code LMAO
but
why
Looks easy enough to replicate.
Yea, you'd think so. Tell that to figma LMAO
The issue I'm running into is the cards (the white rectangles)
What about it specifically?
Did you see my message later? I didn’t know you could set a team’s color until days after I added an NMS system to change username color
?paste
Anyways, that was my stupidity
The full dart code: https://paste.md-5.net/imuvuruwiq.js
It's mainly the size, padding, and margin
The text & buttons are fine, the rest is being an uncessary pain lmaoo
can the MoveEvent toggle multiple times per tick? If yes, I'd use a 1 tick repeating runnable instead
The app bar was the easiest part to replicate kekw
This is what I got. If you can replicate that layout, you should be fine.
1 Container
2 Boxes
Content
bruh
.
Obviously not. The server does not handle anything more than once per tick
Besides Async events ofc
I'm just gonna bug you anytime I need help w/ this stuff LMAO
Tbf. Things can happen multiple times a tick, nothing new can happen though.
Idk if i worded that correctly
It can most likely happen atleast twice if two different players. Not sure if it can happen twice for 1 player.
hm
its probably better to do a runnable and do some math considering it's only relevant for like 1 / 20 players
Not sure what ur making
Yeah what are you doing
Location currentLocation = player.getLocation().setDirection(new Vector());
boolean moved = lastLocation.equals(currentLocation);
lastLocation = currentLocation;
if(moved != movedRecently)
stateChange();
movedRecently = moved;
I'm applying different effects depending if a player is currently standing still or not, ignoring camera rotation
Well the server can't handle it twice within 1 tick I suppose. If I manage to click 40 times within 1 second it might just ignore/cancel 20 of those clicks. I could be wrong since I never tested that
I am not entirely sure about how it transfers packets over to the main thread. 🤷🏽♂️
Can’t u do .toVector?
Yeah just use a Map<UUID, Long> and put the players UUID + the unix timestamp in there on the move event.
This way you can always check how long ago the player moved.
PDC might also work. Slightly worse performance probably.
A task then
Still not able to get it exactly right though 🤔
You can probably get away with making that higher
Just to be clear, you're remaking it in figma? Not code?
Correct, figma
trust me
Sounds like a bad joke
you see 50 ms
This company name sounds stupid in german...
I have the code (and therefore the actual app to test), I'm porting that to be able to re-use it for a different project
You up? 😘
uh thats not what it translates to
Yea trust me, I find the name amusing too lmao
About to hit the hay
I 100% cannot take it seriously kek
Wait what does it translate to
What's it looking like now?
nice part is I can re-use this mess once I do figure it out kekw
Just trying to get it to auto layout properly 😆
Nothinggg
Straight vibin'
It's likely I'm missing a specific setting or settings kekw
If you're trying to resize an auto layout box manually, make sure to use the resize settings.
is there a way to check if a position is north south etc of another position?
what is it called?
So I'm clearly missing something KEK
It looks like you're just missing the padding on the outer frame.
Frame 4?
Ye
You can do some math with the x and z values, or get a vector between them and check the angle
You might have to send your example so I can check it side by side, I've definitely screwed up somewhere lmao
Anyone can just report the message and discord doesn’t want to take chances with the government
........
Location currentLocation = player.getLocation();
currentLocation.setDirection(new Vector());
boolean moved = !lastLocation.equals(currentLocation);
lastLocation = currentLocation;
if(moved != movedRecently)
stateChange();
movedRecently = moved;
``` This triggers when i move the camera, the EXACT thing i wanted to prevent by setting the direction to 0. Anyone an idea why? Do i have to compare the raw x,y,z values?
well yea, they need proof you're 13 or above
Just convert both locations to vectors and compare those




