#help-development
1 messages · Page 2110 of 1
in general, you do wanna know the design patterns
as they are canonical forms of implementation designs with concrete names
very powerful tool, when two programmers both know the design patterns they can talk about the design of the code in a higher level
sure
So if people are interest they can help
myeah
how to open an enchant inventory for a player?
player.openEnchanting() opens the gui, but there are no enchantment options and the console gives off an error
what error? 😮
iirc you need to connect it to a real enchantment table
let me check one second
as enchantment suggestions etc are calculated server side
null pointer exception something something, but only when i put an item inside
Running into a potential remapping issue if someone has any ideas:
[16:07:24 WARN]: [mcpe] Task #5555 for mcpe v2.1 generated an exception java.lang.NoSuchFieldError: OCEAN_MONUMENT at me.justindevb.mcpe.util.CSVParser.makeAreaSpawnGuardians(CSVParser.java:204) ~[mcpe-2.1-remapped.jar:?] at me.justindevb.mcpe.util.CSVParser$2.run(CSVParser.java:146) ~[mcpe-2.1-remapped.jar:?] at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.18.2.jar:git-Purpur-1612]
Line 206 is :
ResourceKey<ConfiguredStructureFeature<?, ?>> structureKey = BuiltinStructures.OCEAN_MONUMENT;
pom.xml contains:
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.18.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.18.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
?paste for long codes
1.18.1 remapping for 1.18.2?
that would do it...
i know that earlier someone said you can't render the block outline effect for a player via a spigot plugin. but id like to know that works internally, im thinking it must use a packet or something for that. im gonna take a look at the protocol lib site for something along those lines. but if someone knows better please let me know. cheers. :)
Block outline i think it only can be done on Client side
Ah nvm
i was afraid so.
6.1.10 Block Break Animation 6.1.11 Block Entity Data 6.1.12 Block Action 6.1.13 Block Change
these are not what im lookin for lol
whats the bandlion block outline?
You want to have a custom outline with colors on the block?
colors would be cool, but not required
I dont kno what your goal...
You can fake block outlines with glowing shulkers
are you talking about this?
im trying to make an inticator for the player of what blocks will be broken via a special tool
Then this would be a good idea
but wouldn't the shulkers interfere with the action of breaking the block?
i'd just use particles. requires no packets, just a tiny bit of math and it can also look nice
Hm not sure
well i mean ive gotten that far (it works), but the particles are a bit much.. for now they are fine i guess
then just use less particles? 😄
yeah i guess. i recently toyed with the idea of using armor stands with an item on their head. but you can't break blocks behind it
ok, new question
can you make "custom particles" like you can make custom items?
mainly just retextured
damn. ok
@humble aspen what did you try so far?
Caused by: java.lang.IllegalArgumentException: Name cannot be null
at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getWorld(CraftServer.java:1014) ~[server.jar:git-Spigot-21fe707-741a1bd]
at me.cqveman.Primitivesx.commands.spawnCMD.onCommand(spawnCMD.java:33) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[server.jar:git-Spigot-21fe707-741a1bd]
so im new to spigot api, and i was making a /setspawn /spawn commands in 1.8.8, and i got this error
this is the line 33
final World world = plugin.getServer().getWorld(plugin.getConfig().getString("spawn.worldName"));
You’re looking for a world that has a null name
So your plugin’s config doesn’t have anything for spawn.worldName
You have to make sure it isn’t null before you try to get the world
You don’t have to set it by default
You just have to make sure it isn’t null before you try and find the world
then why it says its null
how can i make sure that it isnt null
Because if you don’t set it you can’t fetch the world
if (getString(…) == null)
return;
Or something to that effect
okay i'll try it
Also, your hashmap is inside your onPlayerBreakBlock
that will never work
That means you are constantly initializing a new map
over and over
initialize it on top of your class instead
wait i think i've already done it
final double x = plugin.getConfig().getDouble("spawn.x");
final double y = plugin.getConfig().getDouble("spawn.y");
final double z = plugin.getConfig().getDouble("spawn.z");
final World world = plugin.getServer().getWorld(plugin.getConfig().getString("spawn.worldName"));
final Location location = new Location(world, x, y, z);
if (location != null) {
p.teleport(location);
p.sendMessage(ChatColor.translateAlternateColorCodes('&', backToSpawn));
} else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', noSpawnSet));
}
i did if location is null
and location got the world name and the x, y and z
.
@brave sparrow
sry for the ping
You can’t do getWorld without checking if the name is null
private final HashMap<String, Integer> map = new HashMap<String, Integer>();
@EventHandler
public void onPlayerBreakBlock(BlockBreakEvent event) {
Player p = event.getPlayer();
Block material = event.getBlock();
if(material.getType() == Material.DIAMOND_ORE) {
map.put("DIAMOND", map.get("DIAMOND") ++);
}
}
private void countOres(Block block, Material diamondOre, HashSet<Block> blocks) {
}
}
getConfig().getString returns null if the key isn’t in the config
So you’re effectively doing getWorld(null)
Which isn’t allowed
Apparently not
plugin.getConfig().set("spawn.worldName", location.getWorld().getName());
.
thats in my setspawncmd
I’m guessing that line isn’t being run
What?
if you do a = new Something() a can never be null after that point in Java
Unless it gets set to null later
i did sat it to null
So you don’t need to check if location != null
It will never be null
The name of the world you’re trying to look up is null
so like what should i do now
take the is not null if stat?
like its just dumb in 1.18 u could just do
Player p = (Player) sender;
Location loc = p.getLocation();
plugin.getConfig.set("spawn", location)
since location already have the x,y,z and the wrld's name
but in 1.8
no
u just have to make all this carp
@ivory sleet sorry for ping but i need recommendations for the ORM
What your issue?
Location implements ConfigurationSerializable, so you can directly do:
Player player = bla bla;
getConfig().set("spawn", player.getLocation());
player.teleport((Locaton) getConfig().get("spawn"));
but i sat it
u see thats in 1.18
but in 1.8 it doesn't work
i think
one of the upsides of using updated software
You are wrong, i tested on 1.8 its workings
I mean it did in 1.8 https://helpch.at/docs/1.8/index.html?org/bukkit/Location.html
i did plugin.getConfig().set("spawn.worldName", location.getWorld().getName());
o
wait a sec
then it should work
welp as i see it didnt
how do you retrieve the values from the config
i sat it in the setspawncmd
final double x = plugin.getConfig().getDouble("spawn.x");
final double y = plugin.getConfig().getDouble("spawn.y");
final double z = plugin.getConfig().getDouble("spawn.z");
final World world = plugin.getServer().getWorld(plugin.getConfig().getString("spawn.worldName"));
final Location location = new Location(world, x, y, z);
.
k i'll try it
Its working because i use it on 1.8 and works with no errors
okay
yeah you should be able to just set the location itself, you shouldn't need to split it up like that
into your config
If you are coding an ORM how would you register the model class?
either registries or use sth like the fully qualified name of a class
or go just by traits Ig
is this valid java code?
Bukkit.getServer().getOnlinePlayers().forEach((Player p) -> {
});```
i mean just will that work for looping players. collection functions aren't my strong suit
ill keep that in mind definitely. thanks for that!
yes, the (Player p) -> {...} is called a lambda body expression (and is just an anonymous class (not really but think of it as that) that implements the single function of the interface Consumer)
is there an event for when a block is destroyed
not only by a player, but by natural causes
explosions, fire, or a /fill or /setblock command
declaration: package: org.bukkit.event.entity, class: EntityChangeBlockEvent
There are also dedicated events for example BlockExplodeEvent
is there a list of all possible events that signify a block being removed?
for now I just know EntityChangeBlockEvent, BlockExplodeEvent, BlockBurnEvent
yeah but not all
for example the EntityChangeBlockEvent
also i noticed EntityChangeBlockEvent has "change block" in it, not removed
would this event be fired if the block is "changed" to air
yh
97% sure you don't need the type i.e. you can just do p -> {
(@rugged cargo)
Is there a way to register a custom potion effect?
I am currently creating a new PotionEffectType, then using it to create a potion itemstack and give it to the player. The ones made using my new type don't have the color and don't have an effect listed and when used they don't display anything on the player
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("blastPick"), item);
It's giving me this error
[21:43:26 ERROR]: Error occurred while enabling VanillaPlus v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: blastPicks
There are no special characters?
lowercase only
ah
XD
No problem, had that issue myself too many times XD
why does Location#add() have to modify the location object.
lol
i wish it returned a new location
i can clone i guess
Does anyone know how to properly register a new potion effect type?
I tried to use reflections to change the byId to have a larger list, but it didn't work because the field is final static.
even if you do, you won't be able to get it to display for the client
There’s no conceivable advantage to registering your own potion effect
It will never show up to the client
What's the event that is fired when someone sends a message that lets you "delete" the message?
But if you’re in need of one custom potion effect, I often repurpose bad luck
public void onClick(InventoryClickEvent e) {
e.getWhoClicked().sendMessage("a");
if (e.getClickedInventory() == null) { return; }
if (e.getClickedInventory().getHolder() instanceof mainShopGui) {
e.setCancelled(true);
Player player = (Player) e.getWhoClicked();
if (e.getCurrentItem() == null) { return; }
player.sendMessage("aA");
if(e.getSlot() == 10) {
categoryGui category = new categoryGui("Blocks");
player.openInventory(category.getInventory());
player.sendMessage("aB");
} else if(e.getSlot() == 11) {
categoryGui category = new categoryGui("Foods");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 12) {
categoryGui category = new categoryGui("Valuables");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 13) {
categoryGui category = new categoryGui("Pvp");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 14) {
categoryGui category = new categoryGui("Potion");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 15) {
categoryGui category = new categoryGui("Mob Drops");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 16) {
categoryGui category = new categoryGui("Spawners");
player.openInventory(category.getInventory());
}
}
}
hi im having issues with inventoryclickevent
its not sending aB
but i can confirm its sending aA
ofc slot 10
also i cant send screenshots
you need to show which slot you are clicking on
2nd
yes
so send a message of the slot that's being clicked
really very simple to debug things like this
ok
is it possible to make a passive mob genuinely attack another mob
without faking it
as in not just moving the mob there and making the other mob take damage
Like can I use Mob#setTarget() on a horse
How would you make a TELEPORTING GUI?
Ive done the inventory, but then Im stuck after that
afaik because the horse is a passive mob it will only follow the target and not damage it.
Yes and no
In api, no
With nms, absolutely
ooh really
is there a tutorial for that somewhere
I’ve seen tutorials for pathfinding, not making passive mobs attack
There probably are tutorials but I don’t know for which versions they support
But you’re going to want to replace the entity’s pathfinder goals
Haven’t done it myself since 1.15 and I don’t think I even have that project anymore
hi, kind of related how will i add nms to my plugin?
buildtools, then in maven change spigot-api to spigot
yes
Did you run it for the version of spigot you’re currently using?
And did you refresh Maven?
i tried that, maybe because of some other problems?
im gonna make another one and see if it will work
hmm it works now
no idea why
anyways im not complaining
Is a switch lookup faster than a map?
the hardcoded one is probably better for performance, yes
a switch is always faster / as fast as a map
Ok
both use indexed hash values. but i think since a switch statement is rather a low level call that its faster. problem is that its not flexible
but i doubt its really relevant
but i switch my commands
It became more flexible in recent versions 😋
casting them to lowercase and then switch em
because its certainly faster than ifs
and ppl can say what they want about bad practice they can enjoy their yandere dev styles if else ifs
🤣
if u know then why ask xD
tho being able to switch strings is reserved for recent versions of java and language exclusive cause its casting strings to hash values
u wont get far with it in C xD
Yandere dev is a godly coder how dare you!
if studenID == 1 else if studenID == 2 else if student id == 3 ...
add another 300ish ids
Everyone knows
if x == 1 print("1") else if x == 2 print("2")
Is the most clear way to write code
he said the development process keeps taking longer cause java is a bad language taking ages to compile
cant argue with that
but its most certainly not due to his 10k's of lines of redundant calls each frame
Is it still not done
not even the 2nd rival
I thought he was gonna hand it off to a team to do it
its the star citizen of weaboos
After the 100 year beta I guess
How can I change the name of the player above their head?
playerInstance.setDisplayName(Str)?...
No, it does not change the name above their head
Only in chat
Did you set it to visible too
btw before i waste time on it, i can set custom skins by sending packages to clients right
but can i also specify cape data?
Set what visible?
to say add guild capes
CustomNameVisivble
It says it has no effect on players
Pretty sure capes are tied to accounts
I was asking about speed not flexibility 😂
yea thats what i wonder if its bound to accs but even if shouldnt the server be able to manipulate the info thats sent to players?
So try having an account with the cape for the gameprofile and then set it's skin
That could just be optifine tho
tbh i wanna set the ability to craft banners and then register its pattern as guild cape
by serializing the info of the banners pattern
xX
Ye you can't just set a custom made cape like that
You can't send cape textures to the client
thats oof
You could tp a banner behind them tho
nah im still going to try it
e.setCancelled(true);
Player player = (Player) e.getWhoClicked();
if (e.getCurrentItem() == null) { return; }
player.sendMessage(String.valueOf(e.getSlot()));
if(e.getSlot() == 10) {
categoryGui category = new categoryGui("Blocks");
player.openInventory(category.getInventory());
player.sendMessage("aB");
} else if(e.getSlot() == 11) {
categoryGui category = new categoryGui("Foods");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 12) {
categoryGui category = new categoryGui("Valuables");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 13) {
categoryGui category = new categoryGui("Pvp");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 14) {
categoryGui category = new categoryGui("Potion");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 15) {
categoryGui category = new categoryGui("Mob Drops");
player.openInventory(category.getInventory());
} else if(e.getSlot() == 16) {
categoryGui category = new categoryGui("Spawners");
player.openInventory(category.getInventory());
}
its not sending aB even tho its sending 10
i clicked on 10th slot
the info of capes must go trough the server before being sent to players
dm me the answer i gtg
ill try to manipulate it anyway xD
Use a switch lol
I told you yesterday you can't open am Inventory while IN the InventoryClickEvent
delay it
?scheduling
oh yah
uf
?paste your whole class so we can see what you are really doing
so capes are just numbers which then being requested by the client from the mojang server directly?
I'm saying if it sends cape data at all, it's gonna send something similar like an enum or string with the name
But it doesn't send cape textures
Mojang didn't even want people making custom capes at all, it used to be against EULA, not sure if it still is
And optifine capes use their own special server unrelated to yours
If you used an actual banner item on an armor stand you could get a really good result tho just saying
To any spectators it would look amazing
You're gonna have to edit the packet being sent then, or possibly reflection to change their name?
And you'd have to change their gameprofile I'm pretty sure
thats async for the player himself tho as walking is async
no those sloppy solutions aint for me
same as ppl told me to cancel the op command
ive ended up accessing the command map and overriden the command directly in the nms command map
accessed via reflection
cause i wanted to alterate the op and deop command
Walking ain't really async I think you mean it's gonna appear disjointed on the client
It's handled on the main thread, like all other physics calculations
i mean async to the server
the server only resets ur position if the gap is too big for given time
The only way I can show custom blocks would be via ArmorStands, right?
Unused in terms of a player can't get them in survival mode?
Good idea, thank you 👍
Let's see how much pain I'll suffer 😅
Too much pain
you could refactor the whole code
wat
i said that you could refactor the whole code
why
because you could refactor the whole code
u need to learn java tbf
hey guys, i am making a plugin which gives the player rewards when they do a command. I want to check if they have permission X. How can I?
(The server is using LP for ranks dont know if it is useful but....)
player.hasPermission?
I'm going to make an API for a plugin, it would be good for all the API functionalities to be in a separate package right?
group.id
api
APIInterface
APIImplementation
otherpackages
MainClass
Better to make it in separate project so then you can use it in another plugins
How would I implement it then?
So how would it work? Do I make a seperate project which just has some data classes and an interface and then implement it using my plugin?
Like it depends what would be goal of your API, It will be just set of helping functions and classes?
Or It will be the Core of the logic for your plugin?
you don't really need a seperate project unless you plan on making the API open source but the impl closed source
It's a kit pvp plugin, I want it it to return the kit and stats of the player
Is this correct?
I would do it like this
In API package store all interfaces
and Implement them in classes that are inside ultra_pvp package
?main Don't forget 🙂
java
group.id
api:
IAPI
plugin:
packages:
APIImpl
MainClass
No I mean how do I know what the permission is called
How to get the permission name from LP
bool hasIt = player.hasPermission("player.vip");
replace player.vip with the name of your vip permission
How do i find the name, thats the main thing xD
(Context: I used LP to setup the ranks)
i think that ranks are linked to lp
I have an organization, like GitHub accounts can I use this as a group id?
lp doesnt use perms for it then?
Yes you can
I use smth like
io.github.orgname
you can name anything with the name you wants to
if someone or some comany will complain about it
it is just a bonus :D
for packages and names which should have spaces, do we just use lowercase and ignore or add _?
i never used _
my.fuck.ing.package
good one
but my.fuck_ing.package
So
io.github.the_organization
Group ID
i personally dont like _ in packages
i prefer to rename it with a single name
but now i heard about split the packages
i think i will use that
So you shouldn't use _ in a group ID?
nothing will block you
you can name it anything java allows
so
com.hello_this_is_my.packagE.coolSuBpAcKaGe
How to get the permission name from a LP Rank
how do i do this
see the wiki
Aight tanks
its literally a step by step guide
I want the permission name not rank name, i want the permission from the rank
i hope i helped 👍
i dont think they have one
maybe
idk if vault have something for groups
but if it does
use vault api instead of lp one
why?
because that will work with any plugins that uses vault
oh ok
LP is working with nodes
you need to get the nodes for the group
Aight
everything you need with the first google hit: https://luckperms.net/wiki/Developer-API-Usage#finding-a-players-group
I have used the LP Api in the past
just wanted to know if there was a shorter way to do it which supported way more plugins
just use Vault
? using an alt method now
that is simply a list of all permissions the player has
Yea then i can check in it?
check for what?
they use permissions for groups iirc
for me
I've no idea what you mean by a "rank perm" so I'll assume you are talking about nodes with values, like a prefix
Alright
check the docs lol
does anyone know what the event is for when a grass block dies? like when you put a block ontop of it and then after a short amount of time it will turn into dirt
probably BlockPhysicsEvent
i think block physics does but idk
declaration: package: org.bukkit.event.block, class: BlockPhysicsEvent
its docs says it is not very good
two people responding to the same question
how do i get the plugin for runtasklater?
the instance of your main class is your plugin intace
alr
pass it to the objects that need it using dependency injection
close enough
a letter
haha L
L L L L L L L L L L * 2
whats the optimal L for it?
eh
not really optional
that defines how much delay you have before your task executes
20 would be one second
1 is a tick (50ms)
so L is a tick
LLLLLLLLLLLLLLLLLLLL
unless you like taking L's
Was just typing that lmao
LLLLLLLLLL
so you state that only memes search for help here?
i think im gonna do 20L
It really depends on how much delay you need
1L or even using runTask is enough for some thing (runTask is a 1 tick delay)
ok
Do not set inventory slots a tick later btw
remember
Dupe bugs happen with that
1 tick = 50ms
how long is an L
😢
the L is the long literal
Lynx told you lol
20L = 1 tick
1Liter?
1L means 1L
so its 1/20 of a tick?
an L = 1 L = 1 ms
ok
at this context, 1 tick
looks good
no, 1 ms
I was right idk why I removed my msg so many people saying things made my brain overload lmao
don't overthink it
wait, i get confused
it really doesn't matter if you type 20 or 20L
not awake
if the parameter is a long
1L = 50ms = 1 tick
TimeUnit when
I love how everyone in here got tripped up about a number lmfao
and 32 for int
remember scheduleAsyncTask being deprecated for confusing naming lol
we all are noobs
nothing
hm
More or less the length of 1L
still doesnt work
but as you are using a small number
Everyone confused each other lmao
nithibg
show us your code
lets do not use more bits than we want 
How about this, what are you trying to achieve with that runnable?
the reserved space in heap for the value
And code ^
if(e.getSlot() == 10) {
player.sendMessage("aB");
BukkitScheduler scheduler = Bukkit.getScheduler();
Plugin plugin = new FixmcShopGui();
scheduler.runTask(plugin, () -> {
categoryGui category = new categoryGui("Blocks");
player.openInventory(category.getInventory());
});
}
lets use BigDecimal.doubleVault and cast it
an inventory being opened
this chat is so stupid
Did you try debugging?
indeed
You can;t do Plugin plugin = new FixmcShopGui(); There is only ONE instance of your plugin and Spigot creates it
[12:57:35 ERROR]: Could not pass event InventoryClickEvent to FixmcShopGui v0.1
java.lang.IllegalArgumentException: Plugin already initialized!
theres this error
a "pointer" doesnt exist in java. the adress has the same length as every adress. but the reserved space in heap for the value is different
What elgar said ^
so its instanceof FixmcShopGui() ?
or smth
Im on phone i cant see code to well
bruh
Use dependency injection or a static instance of the plugin in the main class
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Wait
Shit.... I thought this was c++
its your main plugin class. Pass it with Dependency Injection or get it from Spigot Bukkit.getPluginManager().getPlugin(FixmcShopGUI.class)
This is SPIGOT?
this is javascript here
What
scripting java with the bitches
how can it be C++
a script written in java
Idk that code looks like c++ to me, thought this was the c++ minecraft developers discord for noobs
omg
c++ where
Back to dealing with fucking reflections yay
getPlugin isnt a thing
Idk man im new to this programming thing
Just started earlier this morning
im doing this with a javascript mindset this is hard
im wondering what the heck happened here
then how are you Going Back with Reflections
🤔
Okay im done trolling
isnt this visual bukkit?
Sorry
isnt this dotnet here?
Oh god
Isn't this Lua?
That
Bukkit.getPluginManager().getPlugin(string)
Serious Spigot and BungeeCord programming/development help | Ask other questions here
who wrote that
Md5?
Me
that second sentence doesnt make much sense then
please not
MainClass.getPlugin(MainClass.java)
singletons look ugly
DI is great
That method makes me angry it looks so damn goofy
This shit right here, absolutely bullshit
I quit java
Right?
OtherPlugin.getPlugin bla
I provide dependency injection with reflection 
singleton should be avoided IMO
if only bukkit had like, a service provider
giga chad meme here
:kappa:
i dont like the idea of passing each class to the service provider
https://github.com/Burchard36/BurchAPI/wiki/Creating-your-command-class#dependency-injection
Very poggers dependency injection
dont loading

net issues
kek dog
Got that dial up internet
so people like me without nitro could flex too... 👉👈

see wlib
Me sleeping at night with my nitro
stop ending emojis
Im too currently invested in mine to use another :p
dont waste my 4g
this is Serious Chat
i end whatever i want
Plus mine handles auto registration of anything from player data, commands, events etc
😭 😫 😩 😔 😐 👍 💯
I never initialize anything manually anymore, just annotate class and boom
Fast Dev
Thats what I wanted ngl
i dont to waste 5ms of the runtime
I got tired of dealing with bloat code so I spent 30 hours making this
guice
Execution time doesn't differ for this
Hello, How would I access a variable on the main class from another class?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
had irony
Had irony?
enlgish time
NOOOO
disk full
download more disk
is there a Page like downloadmoreram for the Disk?
?downloadram
java.lang.IllegalArgumentException: Plugin already initialized!
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:229) ~[patched_1.17.1.jar:git-Paper-408]
lol
yes, 127.0.0.1
ok
Your still calling new YourClassExtendingJavaPlugin() somewhere
i don't have it in my Machine's web Server
try localhost then
fuck
the website is unavailable 😭😭
FixmcShopGui fixmcShopGui = new FixmcShopGui();
FileConfiguration config = fixmcShopGui.getConfig();
yes its this one
maintenance time
dont make a new plugin instance
dont use new for the plugin
Please just learn dependency injection my friend
lol ip leaked, will ddos you
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
lmao
Imagine DDOSing localhost

lets remove some school shit and games from my disk
Bad
could you send me a screenshot of https://meuip.com.br/ pls
Descubra aqui qual é o seu IP Internet e acesse as melhores ferramentas de diagnostico de sua rede, Medidor e teste Velocidade
o seu IP
I hate when I get in bed then have a million ideas for something I could of done better
same 👉👈
sleep is for the weak
Your right
oh dependacy injection is basicly constructor arguments in javascript
I could stay up and whack out another 4 hours
In a sense yes
some days i sleep 02:30
Its 6:16am for me rn
a time ago i sleep 05:00 to wake up 06:00
i just drank a whole bottle of juice and im still thirsty 😑
Spent 2 hours before bed writing more bullshit javadocs
Guess the Majority of us Share the Bad Sleeping
you cant go to sleep if you dont have a bed
the possibility is existent
you can just fall asleep
or You can Sleep on the Computer Chair
Last time I did that I broke my monitor
so You wake up and Code Again
just dont put your monitor on your chair
I turned my pc off anyways
go sleep!
Poor things been running 3 dev test servers for days now
Would save soooo much time
me too
a Page for Disk
I only made my api compatible with versions compatible with java16
No more catering to 1.8 nerds
bro
i almost wasted my internet
Thanks!
xD
but brazilians use 1.8 :D
and Half of the Servers
they know how to bore people to translate it for them
But you can Run Java 17 with a Modified 1.8.9
yes
Please
Dont give them ideas
just recompile 1.8.9
Just Remake 1.8.9

Nothing before the PDT update
What Worked
If you recompile 1.8.9 make sure to revert the log4shell changes so you can have the trust legacy experience
I wish my code would work
use the argument -DiAmUsingJava17PlsBelieveMe
That's the Full Being Doxxed Experience
yes
spigot has that ? I thought that was a paper thing

that is to disable update checks for spigot
But it's so Unstable to use Java 17 with 1.8 or Another Legacy Version
not the java check
yes
also its sending a message of a command im doing
LOL
yes
reflection changed a lot
Yes, it Literally Breaks almost Everything
like when i do /command it sends /command to me
1.14=<
1.14, i Remember that Update, not for Something Good
Any api for detecting player movement (left, right, top and bottom) ?
i cant ```java
Field field = yourMom.getClass().getField("fat");
field.set(yourMom, true);
it throws `AlreadyFatException`
your gonna make a game huh
Yes
guessed it
PlayerMoveEvent
Just get the direction player is facing on the move event
and check to and from
Field field = yourMom.getClass().getField("fat");
field.set(yourMom, false);
``` `IllegalStateException`
not facing
they can go to left facing north
Oh ok its more easy than how i get told, i get told to do create an invisible wagon and do some shits with that
Then its a feature
so then get their facing and with that get the direction they walked to
Sounds like an event for BurchAPI
Gets walking and facing direction on move
And make it cost
25 cents for each listener attached to it
So wait its possible to get direction?
or just make a method where you can get the relative face f of location l to players facing pf
Wait can you can explain in another way
Because im so dumb that iu dont understand
So i will have to use PlayerMoveEvent get facing block and then?
difference between to and from
Allright and then how i know if right left, etc?
calculate it yourself 😎
if the player is facing north and the block is west of him you know he pressed a
or at least walked to the left
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Oh yes or yes i need to oen a thread?
nah just had fun posting ?services
yes, thats mostly just if you wanna specify in case the method is overloaded for instance
- PlayerMoveEvent
- get facing block
- difference between to and from
- if player facing north and the block is west = pressed a
Like that?
yes
The block i get it from the move event right?
nop
you have 2 getters
from and to
they are Location
you can check their x and z
And why facing nort and block west give pressed a?
open your minecraft
If i dont understand that then i dont know how to calculate pressed b
face north
Allright
With f3 menu looking at coords ^
I will create new world and test
You can figure out an algorithm for direction just by looking at indcrements and decrement when moving
AND CHECK THE RESULTS
blockfaces have x, y and z
in this case, only x and z are important
declaration: package: org.bukkit, class: Location
Thats only for facing direction
Not the actual movement of theyre direction
I just dont know the algorithm i have to use
If x incremented while z decremented, theyre going north west
their
they're = they are
so just write it right
Cba
Cipher so i just need to check when increments and decrements?
I spent all of today using my grammar skills in javadocs
getHowManyTimesIPressedTheLetterAToday()
no need for javadocs
Wym?
:/
So in resoome what do i have to do?
i dont need to doc what the method does
Java docs are useful for the people that use them I am not one of those people thougj
because its name says what it does
Sparsely use them for spigot outside of the enums
It gives better explanations on what specific methods do
I already know that i need the MoveEvent, the facing location, the increments and decrements of (i dont know)
You can only explain so much in a example
/** Gets the player */
public Player getPlayer() { return player; }
I need to protect and private a lot of that stuff in my javadocs though
Eg documenting interfaces and abstract classes
spigot docs be like
I only javadoc things people are meant to use
In my plugin, after generating a world and setting the 'doMobsSpawning' gamerule to false, there are still mobs in the world
I assume that this happens because the mobs spawn in the world generation and I need to set the gamerule in the WorldCreator? if so, how do I do that?
i think that is because the mobs were spawned before you set the gamerule
"@see the other implementations. idrk what they implement"
same thing happens on vanilla
we already told you several times
doMobsSpawning = false != removeAllExistingMobs
But i dont understand and get messed up
Please 1 last time so i can understand completly
How do I remove all existing mobs?
just follow your own plan
with the tips we gave regarding BlockFace
iterate through them
and call #remove
Ah I see, and was I correct about the reason this happens?
maybe, maybe not. never really looked into that
Alright, thank you!
@hybrid spoke just spent the last 5 mins trying to use List.of
bruh
java 8 cringe
^ how do i check if the villager was attacked by a zombie
what happened? misspelled it several times?
L
get the killer
check if its instanceof Zombie
and how do i do that :
getLastDamageCause maybe
We all get there at one point
I spent 5 minutes trying to decide what method name I wanted and I realize dim way overthinking things
Ill literally off myself if I have to refactoring this rn
I prolly will
This data store bs is completely in shambles rn
looks like something is wrong
?jd-s
i just can see one parameter here
i know guy
