#help-development
1 messages · Page 428 of 1
Yes
О
why is entity ai not in the api 🤔
i have no idea 😭
this is basically the last thing i need to get working before the plugin is complete
i was thinking of manually checking the entities' positions every tick
and making them run away
but that feels heavy
no?
i guess spawn one like you normally would spawn an entity
and then do what you please
ok thanks
looks good to me 🙂
thanks you i love u 💝
alex, maybe you know?
oh thanks!
i'm currently looking through tweakin' source code trying to figure out what sachin did lol
I#d extend the existing goal, then print out stuff in canUse(), tick() etc and see whether / when it actually runs
https://github.com/JEFF-Media-GbR/JeffLib/blob/master/spigot_1_19_4_R1/src/main/java/com/jeff_media/jefflib/internal/nms/v1_19_4_R1/ai/HatchedAvoidEntityGoal.java I also just extend it but not doing anything with it. always worked fine for me
public class FleePathfinder<T extends EntityLiving> extends PathfinderGoalAvoidTarget<T> {
public FleePathfinder(EntityCreature var0, Class<T> var1, float var2, double var3, double var5) {
super(var0, var1, var2, var3, var5);
}
@Override
public boolean a() {
System.out.println("Can Use called");
return super.a();
}
@Override
public void e() {
System.out.println("Tick called");
super.e();
}
}
gonna try this
also check what super.a() returns
true
sure
on second thought i think that it's indeed the correct behavior
just ambigious naming
it does avoid the player entity for some time
idk
i'll test anyway
if another goal is still running and returns "canContinueToUse" or what's it called, then it continues to use the already running goal, even when that has a lower priority
idk
i'll test too ig
because i'm currently using 0
for this
and yeah it never outputs Tick called
do you know a way to combat it?
e.g. the pig at the end, it's a MoveToBLockGoal, and it also takes 1-2 seconds before it starts to use that goal, that's normal. only thing to prevent this is probably to get rid of all other goals, and only add them back once your goal has started to run
hmm
only thing to prevent this is probably to get rid of all other goals, and only add them back once your goal has started to run
I could do that indeed
remove all the goals but store them, give it an avoid goal, then readd the goals
how to check is block generated?
public static void addRunAwayPathfinder(final EntityCreature entity) {
final List<PathfinderGoalWrapped> goals = entity.goalSelector.d().collect(Collectors.toList());
goals.forEach(goal -> entity.goalSelector.a(goal));
entity.goalSelector.a(0, new FleePathfinder<>(entity, EntityPlayer.class, 3, 1.2D, 1.5D));
entity.goalSelector.a(1, new PathfinderGoalPanic(entity, 1.55D));
goals.forEach(goal -> entity.goalSelector.a(goal.h(), goal));
}
this might work
any tips to improve this before i go and test?
Just try it and debug lol
still outputs false 😦
Ill help when i get home im in gym rn
insane chance but are your palms sweaty
believe it or not, but I'd use JeffLib to write my own pathfinder goal lol
?paste
and then just add it to some entity:
public void addGoal(Creature creature) {
AvoidPlayerGoal avoidGoal = new AvoidPlayerGoal(creature, 20);
EntityUtils.getGoalSelector(creature).addGoal(avoidGoal, 0);
}
How to check is block generated?
Its not got a kitchen sink!
this may or may not have crashed my server
i'll investigate now
have you considered telling it not to crash
my bad
Man now I want to add goal api to spigot
i'll do that now
do it
😭
@Override
public void tick() {
getNavigation().moveTo((BlockVector) RandomPos.getPosAway(
(Creature) getBukkitEntity(),
10,
10,
nearbyPlayer.getLocation().toVector()),
1);
}
so apparently this was null
now u have to
Why don’t you :p
oh yeah that's sometimes null. I'd save the value of that in a field, then in canUse() check if the value is set, if not get a new one that's not null
that's how the vanilla goals do it too iirc
you think theres enough unsmooth left of my brain for that
save in a field where
in your custom goal
Maybe there would be if you didn’t walk into doors
no it was smooth before that
?paste
https://paste.md-5.net/zemuzajolu.java do you mean this?
or should i also generate it in tick()
i'll go test it
canUse() -> check if a player is nearby, then return true
start() -> nothing
tick() -> check if we got a destination location, if yes move towards there, if no get a new target location (RandomPos)
canContinueToUse() -> check if player is still nearby
oh alr
jefflib is like a fresh grasp of air for this project
damn
note to self - always use remapped from the beginning and never use nms for under 1.18
xD
don't forget to add the <filters> to maven-shade-plugin if you use minimizeJar
lol yeah
i don't minimize, it's fine
1.17 also has remapped
1.17+ it is
ok it crashed but this time it was my mistake i think
yeah it's on my behalf
oh i just realized
i want it to always be active, so that the pig always goes away from players that appear nearby
so should i set canContinueToUse to true
instead of a player proximity check
and then just do checks to make sure to do nothing if there's no player nearby
yeah i'll do that i think
Nice 🙂
wait no that won't work will it
it'll just keep running away
what else could i do
sleep
i have a lesson of english in 4 minutes
sleep anyway
nah i skipped two this month already
and i only have 4 per month
i think i have an idea
Tbf a custom pathfinding ai doesn’t seem too difficult actually
i have yet to create a single ai, period
but a pathfinding ai sounds fun
though i'll probably eat my words
You just need an interface with the methods and then a class that can hold said interface and delegate the methods
skript has an in-built pathfinding method, you could check the source code
skr*pt
?
skript 💀
alr i'll head off for my english lesson and test my code 1.5 hours later
ik but it's still coded in Java
when I switched to Java I checked it's source code to see how to do some stuff
Granted that’s just for adding new goals
You’d have to do something so the existing goals are abstracted somehow
I guess you’d want an implementation similar to BlockPopulators in world
Explain why you'd need to do that? There might be a better method
You could store the code to run as a runnable alongside a completable future and cancel the future and immediately run the runnable code
I'm talking about the future you get back when you schedule something
Cancel it and run the code you had queued inside of it
you can derive a scheduled executor service thread pool impl and create some sort of cancellable class that it returns
is there a method to change the colour of water in a cauldron
think u need nms for that
could you help me with it
I’m using NMS in my project
"Give me code"
The color of the water depends on the biome that the cauldron is in
So what you need to do is set the biome where the cauldron is
What about the dye
thats bedrock
^^
Is it not Java too
sadly not
No it's bedrock only
@tender shard sorry for pinging you, but could you take a look? i can't get it to work no matter what i do: i want the goal to always be active and it is, it always says "ticked", but for some reason the pig does not care and stands in place
https://paste.md-5.net/layuqusuva.java
Damn that’s crazy
i think i sorta got it working
fixing minor stuff
the code is quite scuffed though lol
i'll need to measure the perf
nah I needed vanilla
hi, in my plugin, how would I be able to get the amount of players within a certain distance of a block?
ah ty
hlo
How to fix raid is not working properly in my server evokers and witch are not spawning
That's a #help-server question, but to answer it. Change your difficulty level.
ohk thanks
mobs with custom PathfinderGoalMeleeAttack don't cause EntityDamageByEntityEvent???
what the fuck
Does bukkit#getScheduler#runTask run every 1T
runTaskTimer does i think
You specify how often it runs
with 1L
Yes it's in ticks
Not in runTask
Are you sure?
try it and see?
yeah
why don't you just use runTaskTimer
I did which is why I'm confused
Oh wait, yea. runTaskTimer is what you want.
runTask runs the consumer the next tick
I will, was just wondering what the default was
I don't think there is a default considering it asks you for a period parameter.
has anybody experienced this problem?
i have a custom pig that attacks me but apparently edbee is not called
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
@EventHandler
public void onAnimalDamagePlayer(final EntityDamageByEntityEvent event) {
System.out.println(1);
...
}
This doesn't even run multiple times just once like it was said above
1 is never outputted
So now figuring out why it's getting run non-stop
I don't think non-hostile mobs can attack. You might have to send an event yourself.
do you have any idea how i can do that? my pig indeed attacks, and she lands quite a punch
I meant it might not send an event since normally they don't attack at all.
i guess, but in that case how'd i detect when it hits so that i can send an event?
it's an nms pig, do you want to see the code?
though this is sufficient i think
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
this.goalSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityPlayer.class, true, false));
You might be able to call the event with PluginManager#callEvent()
yeah but when
Maybe on the EntityTargetEvent
hmm
perhaps
but wouldn't that only be called when the pig finds a target?
aka once\
What do the boolean values represent in those goals?
pretty sure it's like "can detect through walls" and something else
one sec
false - mustReach
true - mustSee
What about the normal EntityDamageEvent?
hm
one sec
i do need to have the damager present though
but maybe i'll find a workaround
hi, is it possible to move display entity smoothly?
for (int i = 0; i < 9; i++)
Bukkit.getScheduler().runTaskLater(plugin, () -> entity.teleport(entity.getLocation().clone().add(0, 0.2, 0)), 1);
^ worked well on armorstands, but not on block display entity
to move an entity smoothly i think you need to use NMS, but I really hope there's a better way
unless you just move it very slowly per tick
Whoa, why are you duplicating the task? Just use scheduler to run a timer and cancel it after a certain number of ticks has passed.
How can I set a mob to not be collidable. As in, I don't want the player to be able to push it around but yes to hit it
BukkitScheduler#runTaskTimer() is what you'll want to use.
If I extend EntitySmile for example
nop
not called
i'll go have dinner and think about what i can do here
if you have any ideas please suggest them
Pretty sure it can be done using team scoreboards but it's not working correctly
public static Team getCollisionDisabler() {
Scoreboard defaultBoard = Bukkit.getScoreboardManager().getMainScoreboard();
if (defaultBoard.getTeam("collide-disabler") != null) return defaultBoard.getTeam("collide-disabler");
Team team = defaultBoard.registerNewTeam("collide-disabler");
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
return team;
}
it works, but it's a little bit laggy
What about LivingEntity#setCollidable()?
Hi, is there any easy way to get a list of all the in survival obtainable items?
My first idea is getting all the Material values and filtering with isItem and then removing all the creative items 🤔
Can you send a video of it? Cause as long as you aren't moving it over long distances and the TPS is stable, it should be smooth.
How do I get a living entity from extending EntitySlime?
i can't, but i mean, it's not as smooth as it was
public Ball(Game game) {
super(EntityTypes.aD, ((CraftWorld) game.getCourt().getWorld()).getHandle());
Location spawn = game.getCourt().getBallSpawnLocation(game.getTurn());
setLocation(spawn.getX(), spawn.getY(), spawn.getZ(), spawn.getYaw(), spawn.getPitch());
setInvulnerable(true);
Can I just get the instance of LivingEntity from (LivingEntity) getBukkitEntity();
Is that NMS?
Yeah
Any reason you can't just use the Slime class?
Ummmm
how?
i mean, how can i move it smoothly with nms
Probably, but it depends on what you're trying to do. Unless you stated that earlier in which case I missed it.
How can I set a mob to not be collidable. As in, I don't want the player to be able to push it around but yes to hit it
Specifically, a slime which is a "ball"
LivingEntity bukkitEntity = (LivingEntity) getBukkitEntity();
bukkitEntity.setCollidable(false);
I got that part. I'm asking what your plugin does that requires you to use NMS.
Heavily doubt that works
It doesn't require nms
I rather not use it if possible
Then why are you using it now?
Yeah I shouldn't be, changing craftworld
Material#isItem will only return items not blocks. AFAIK, there is no standard way to do this, so it's up to you how you want to define your filtered list.
Are you sure I checked the isItem() method and it only filters out unobtainable stuff like Portals or Stems
A lot of blocks are also items
I mean all blocks are also materials right
Yes all blocks have a Material associated with them
My list is made up of materials
If they didn’t spigot would implode
hi guys
Does craftbukkit make any changes to the server beyond those absolutely necessary to implement the Bukkit api, or are those changes deferred to spigot-server
Then why does #isItem only return a handful of items?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/Material.java#8384
Unless I'm missing something here.
it returns a boolean and the items there are the ones that resolve in false
all good 😅
If I want to make a mob be pushed in a specific direction
Can't I just use Slime#setVelocity(velocity);
using velocity can work on a mob, but you risk the next tick it's AI cancelling whatever you did
It's a mix of both, so it seems.
No AI = no Gravity
you'd have to apply your own AI
What set of mappings does CraftBukkit use?
By default, it uses it's own obfuscated ones. If you use the mojang mappings, you get the ones made by... well... mojang.
pretty sure Spigot mostly uses Mojang mappings now
so like
thats no mappings
.a .b .c is obfuscated (no mappings)
https://linkie.shedaniel.me I'm trying to use this website to help transcribe a fabric mixin into a bukkit mod but I'm not sure which one is Bukkit
setAware(false)
This is what most here us for mappings https://nms.screamingsandals.org/
Oh shit awesome
Thanks
So like
The craftbukkit patches which mappping set do they use on that website
by default it would be spigot mappings
depends on version but Spigot
Ok this is a huge help thanks
does this website have a way to compare the Yarn mappings and the Spigot mappinsg
You can do that with screamingsandals.
https://nms.screamingsandals.org
what that has a blue name :l?
its got changes that arent committed to its repo
oh
How to fix raid is not working properly in my server evokers and witch are not spawning also i set difficulty to hard
btw what are yarn mappings
where do you even get them from and why
They are mappings from the fabric team
ty
How to convert PlayerInventory to json for MySQL?
why json?
you can turn ItemStacks into byte[]s using BukkitObjectInput/OutputStreams
better in bytes, right?
Anyone familiar with ZeroMQ?
I'm loosing my mind over it
im trying to send data from Bungee to Spigot 🔄
Current setup is DEALER - DEALER
can't send from nor side
https://paste.md-5.net/aliqutuboj.java - Bungee
https://paste.md-5.net/beqavaxuba.java - Spigot
JeroMQ
I wrote thru their docs and used parts of their code
maybe trying to use one socket?
cuz I don't want to deal with multiple sockets
uhh
I didnt touch jero
entities' (like pigs) uuids are unique, right?
But let me see
i'm dumbfounded
UUID does stand for (universal sometimes) unique identifier
yeah i know
but i had no other options
like
i don't know why else things are happening\
yep
imma send u where I took that
The normal approach afaik is for u to have one socket per backend
And then let everything go through bungee
https://zguide.zeromq.org/docs/chapter3/
Figure 37
Chapter 3 - Advanced Request-Reply Patterns # In Chapter 2 - Sockets and Patterns we worked through the basics of using ZeroMQ by developing a series of small applications, each time exploring new aspects of ZeroMQ. We’ll continue this approach in this chapter as we explore advanced patterns built on top of ZeroMQ’s core request-reply pattern.
...
Hey guys, I'm trying to use FAWE(FastAsyncWorldEdit), and I've encountered an issue. I know this is the spigot server, but since it's a spigot server might as well.
I'm trying to rotate a schematic and then get the blocks. but the clipboard itself isn't rotated. how can I get the rotated blocks?
if i don't modify a list, it shouldn't magically get cleared, right?
yeah i'm just asking stupid questions because i'm questioning my sanity atm
aiight
Im very dumb with networking and stuff. like very very dumb
soo I would need some checkpoints to follow, to achieve that
if I can ask for those
i feel like i started coding 2 days ago
riddle me this: where in this code does plugin.drops get cleared? https://paste.md-5.net/acofemarum.java
for some reason after an animal dies, the list is cleared
and it never happened before
plugin.drops
actually the issue seems to be deeper, i'd have to explain my entire plugin to get someone's help so i'll just try to investigate on my own
i'm just slowly going insane because of too many hours put into this
probably some blunder
i cant find plugin.drops
because it's not there, it's in AnimalDropsPlugin
.
using intellij?
Sounds like a public field
well if thats right then you have no issue 😄
indeed because i couldn't care enough
half of what i use in my plugin class is getters
the other half is public field
why? fuck knows
but i found the suspect
this is why you shouldve cared
final List<AnimalDataHolder.Drop> currentValue = plugin.currentlyDropping.get(entity.getUniqueId());
currentValue.remove(drop);
apparently this deleted a value from plugin.drops as well???
This is why we encapsulate
i guess yeah
i've probably gone insane after fucking with nms for so long
won't touch development with a 5-foot pole for like a week after i finish this
ok so
final List<AnimalDataHolder.Drop> currentValue = new ArrayList<>(plugin.currentlyDropping.get(entity.getUniqueId()));
this works
😭
sorta maybe kinda makes sense
but i don't want it to
That creates a new list with a copy of the contents
yeah
Where as the first one assigns them both to point to the same contents
are plugin.currentlyDropping and plugin.drops referring to the same list? that's probably why plugin.drops is updated as well
true
that was an oversight
I don't know. I can't think of why a separate list would update otherwise
me neither but somehow it now works after creating a copy like this
let's forget that this discussion existed because i'm going to bed with hopes to not wake up again
cya
but money
i usually have good coding ideas while sleeping
i'll get paid ~tomorrow for this order
just a few touches to finish the plugin
but i'm not gonna do it today
Smh delivering code with bad encapsulation
i usually dream about the craziest shit while sleeping
"a few touches" includes refactoring lol
at first it has to work
then it will become clean
start taking commissions then you get bragging rights
make scarlet talk then
clean code
its from smth i forked
not guilty then
that dude probably doesnt know encapsulation is a thing
xd
oh no
naming is hard
must be documented by someone else
surely the person who wrote the classes called Fi didnt write an entire paragraph explaining what it does
its a file wrapper
Im trying to create a quest plugin for my server but when i kill an Enderman it doesnt send me the message. What do i do?
https://paste.md-5.net/ikozukimas.cs
Does spigot lazy-load worlds? in a plugin, if I have a world named "foo" and I don't call Bukkit.getWorld("foo") can I perform file operations then call Bukkit.getWorld("foo")?
It "prepare" the world.
not load it.
this void only sends the player numbers 1 and 2 not the others. What is wrong?
https://paste.md-5.net/zimefacaye.cs
why isnt your name pink anymore
my nitro ran out
they arent in the list/set you have of active
but how is it possible
you dont add them to it?
sout the list before the if
yes
do you get the messages from the commnad
yes
sysout the map after you send the "you have to kil X"
list not map
also where is the list and are you using the same instance of it
you mean after the command?
after you send t he "quest started" message sys out the list
before that, where are these 2 methods
and where is thee list
it does send my uuid
the list is in my second class
are you modifying that list in the class or a new one
How much more efficient is it to just create a huge list with all wanted materials vs to filter through all values of the Material class (Getting rid of maybe 50 items) 🤔 (The list is static)
mk, in the command class and other class how do you create the active list
There are 2 classes Main and EndermanQuest. The list is created in EndermanQuest class, the commands in Main
i would have Set with all materials i want
do you modify the list created in EndermanQuest on the command
i might have fixed it ill let you know in a bit
take a note that contains on set have nearly constant time complexity in average, so it basically doesn't matter how much elements you have
ahh cmon
how do i put text colors with hex codes instead of using § in the text?
ChatColor#translatealternatecolorcodes
^^
but then what do I input as the values?
'&' and you text
ChatColor.translateAlternateColorCodes(&, "your text")
quote the ampersand
6000 lines of horror
it doesn't work when I put the hex code
what format does it need to be in?
ah ok so I put & before each one
&
yeah and begin with &x
#123456 = &x &1 &2 &3 &4 &5 &6 (without the spaces, ofc)
ChatColor.translateAlternateColorCodes('&', "stuff")
?learnjava
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.
i already know java, its just the spigot API
i put exactly what you guys told me to
if you knew you would check the ChatColor class/interface for the args
oh my god
why do people always come for the advice yet think that they know better in that regard
if you know java you should know most things like that should go in a string
^
i put it in a string, didn't work
so you check the method args?
hovering over the method in intellij shows the args it wants
shh don't say anything he knows java
i've done all that
then gl, you know what to put into method !
i got it
I mean that is basically what ever mods code looks like
ugh everything is public
in AnvilMenu or ContainerAnvil what is that int value represents ?
the only int I can think of is cost
use interface :d
well maybe if you didnt crop it we could atually read what it said
i didn't cropped it
wdym you didnt crop it
do you have any listeners for playerDeathevent?
yes
public void onPlayerDeath(PlayerDeathEvent event) {
String item = "Dast";
String killer;
String victim = event.getEntity().getName();
String deathMessage;
if (event.getEntity().getKiller() != null) {
killer = event.getEntity().getKiller().getName();
} else {
killer = null;
}
if (killer != null) {
if (event.getEntity().getKiller().getInventory().getItemInMainHand() != null) {
item = event.getEntity().getKiller().getInventory().getItemInMainHand().getItemMeta().getDisplayName();
}
deathMessage = Utils.getColorizedConfig("Death-Message-Normal")
.replace("%VICTOM%", victim)
.replace("%KILLER%", killer)
.replace("%ITEM%", item);
} else {
deathMessage = Utils.getColorizedConfig("Death-Message-NoKiller")
.replace("%VICTIM%", victim);
}
event.setDeathMessage(Utils.colorize(deathMessage));
}
also Paper, does it happen when running Spigot?
String item = "Dast"; means Hand
what is PacketPlayOutOpenWindow in mojang mapping ?
item in hand can be AIR which has no meta
with items
whats line 26 of player death listener
item = event.getEntity().getKiller().getInventory().getItemInMainHand().getItemMeta().getDisplayName();
because its air right
it doesnt have a display name
but why gives error while i'm killing someone with items?
that item can be null or AIR. meta can be null as can display name
unless an item is renamed it has no display name
you need better tests
and checking items basde on their names isnt optimial
consider using pdc for this kinda thing
?pdc
if ((event.getEntity().getKiller().getInventory().getItemInMainHand() != null) &&
(event.getEntity().getKiller().getInventory().getItemInMainHand().getType() != Material.AIR)) {
item = event.getEntity().getKiller().getInventory().getItemInMainHand().getItemMeta().getDisplayName();
}
lemme test this
you want to check if it has a display name
and you can cache the item after the null check
before it actually
ItemStack weapon = event.getEntity().getKiller().getInventory().getItemInMainHand();
if (weapon != null...```
^^
is there an equivalent to Block::isFunctional()
ie
crafting station & anything with inventory
instancof InventoryHolder
does that also hold true for crafting tables?
my goal is to fire my event if and only if that right click wouldnt do anything else normally
item in hand is set
so i want to exclude everything you can interact with like chests, stations, buttons...
ill just try this
if(event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getBlockData() instanceof InventoryHolder)
eh good enough lol
the most important part is inventory blocks
you know
so the event doesnt fire while im tryin to put an item into an inventory
thanks now i wanna kermit Minecraft Steve OOF Damage Sound Effect on minecraft
why it looking kinda cursed idk thb
wtf is node
query
I checked, its block or blockstate
Looking at mindustry code?
The coding style they use is a bit strange tbh
wdym or
you can check either
yes
they seem to have never heard of encapsulation
whats that
well almost every field is public
Ah that
If I recall correctly their engine (Arc) doesn't do that sometimes and it can be a pain in the but to find a workaround
Especially since Mindustry is "moddable" I guess they just made all fields public so modders have an easier time
that answers that question
is modding forking the github or actually writing a proper mod?
Writing a proper mod
I'm not too sure how the modding api works, but it seems to be there
There was a guy over at the fabric discords that used fabric to mod mindustry but I believe by now there is a proper API built-in
i have nothing better to do so ill probably make a fork of it 🤓
huh
i recall whoever made space engineers saying their api had roughly ten times more endpoints than the game called
its basically a massive blank slate
if i have an interface and one of my classes implement that interface, do i need to use override all the methods from the interface in the class which im implementing the interface in
Yes, all the non-default methods need to be implemented.
*Unless your class is abstract
abstract interfaces can but dont need to implement methods
every class using that abstract interface has to implement all abstract methods of that interface
so
*Abstract classes you mean
interfaces are always abstract
ah fair
And all methods in interfaces are abstract
abstract class example(){
abstract void a()
void b(){return;}
}
if you extend this u only need to implement method a
now i cant create an instance of the class if its abstract
since b has a method body
Yes because every method needs an implementation in the end
what is going on here
This wont work
what would be the best way of doing this
wha-
what about cauldrons, redstone repeaters, levers, buttons, composters etc? they all have a function but no inventory
Implement all methods
can i use the methods from the interfaces in other classes
would that work
that naming schemes gives me cancer
public interface SomeInterface {
// Needs to be implemented
String createName();
// Does not need to be implemented
default void printName() {
String name = createName();
System.out.println(name);
}
}
Yep, but the code is a bit older than that
If you have a class which implements this interface then you can create an instance
of that class and use those methods.
But the methods of an interface do exactly nothing
There is no point in calling interface methods because they have no implementation
is the bukkit api (org.bukkit:bukkit) no longer published for the newest minecraft versions?
got it thanks for the help
last version was 1.14.3
it looks like the latest version is 1.15.2
yes
i dont think anyone uses bukkit anymore
wait
he asked for anything with an inventory. However this won;t cover a crafting station as it has no inventory
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
I believe it was stopped before that
looks like it
Bootstrap jars are a thing since 1.18
Hm i thought this was a 1.16 measure
The bukkit artifact only is gone because craftbukkit is on it's way out
But things take an enormous while over at spigot so of course the transition is not completed even today
there is no TextComponent in 1.19?
What do you mean on its way out
so how should I depend on this then
in gradle
spigot 1.19.4
no no no absolutely no NMS
compileOnly("org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT")
I am using a non-traditional (not craftbukkit) implementation of bukkit
Well with only the api you can just depend on it as always
Spigot is basically bukkit
I'm aware
There are next to no differences
But since it's a non-standard implementation I just wanted to use bukkit
Oh what? Custom bukkit impl?
I think you have to run buildtools and see which jar you need to depend on as File
Chances are your non-tradiitonal implementation is using the paper api though
I'm the one writing the non-traditional implementation 🙃
Ah.
Then I'd recommend implementing the paper api regardless.
Well then why do you need to depend on bukkit?
I didn't want to go through the trouble of adding the additional spigot methods at this time
I don't want my project growing into Cardboard 2.0
There are no non-spigot bukkit implementations that don't use paper as a base
Another fabric hybrid
Even just bukkit will take an enormous time to reimplement
Yea it's a forge hybrid
Well aware
Situation now: There are 14 competing standards
I think I have a good idea
https://xkcd.com/927/ for the uneducated
I love xkcd so much
What if we just left spigot and fabric forge separated
If only there is sponge for that
But then how will people run their pixelmon server with essentials on it
amen
Oh wait there is
It's like nobody knows FTB essentials exists
How good is it though?
An economy???
Back in my day we just used vault
out of curiosity what does the craftbukkit bootstrap jar include that the api doesn't
like the JDBC driver classes
I'm looking at it
there is just like
a sea of dependencies and the comments in the POM don't help much
i think this stuff
although that doesn't include the jdbc classes... strange
Oh wait
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/pom.xml#60-251 are all teh dependencies
i didn't know bitbucket had line highlighting until just now 😳
Probably jline too
I think I see it
I'm not going to depend on the mojang stuff
Yeah I get it
I found the JDBC driver classes
AbstractFactoryFactory
exactly
I had to write a "normal" factory few days ago for the ServerListPingEvent D: https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/internal/ServerListPingEventFactory.java
I don't think I've used factory pattern once
can you be for once not the center of the discussion alex
Only if you comment about the label I used in the static init block
whats with all the alex hate :(
where?
Nobody hates me, i am fabulous 
I do 😈
ur irrelevant in Alex’s eyes
fabMuuLous
have you guys heard of this funny little haxe language
it is very neat for the one thing I use it for
And not much more?
idk I'm sure its useful for some stuff I just only use it for Computer Craft lol
I hate lua
yeah lua is such a pain
haxe has nice syntax features and it can compile into lua
what more could I ask for
lua the boblox lang?
lua is used in many games, yeah
I also use it for my adventure games and it's total shit
best part about haxe is its strongly typed
you can also expose native code from a language you are targeting
its really neat
mmh
luaStart("ExitMenu")
function openEsc()
--escMenu_HideInterfaces = game.HideInterfaces
escMenu_HideCursor = game.HideCursor
game.HideCursor = false
--game.HideInterfaces = true
end
function closeEsc()
game.HideCursor = escMenu_HideCursor
--game.HideInterfaces = escMenu_HideInterfaces
end
-- [[
function openExitMenu()
if((not Scenes["pippen_wohnzimmer"].Objects["pos_start"].Conditions["intro_played"].Value) and (not Debug)) then
print("Cannot go to exit menu before intro is finished")
return
end
print("Opening exit menu")
isInExitMenu = true
hideInterfaces = game.HideInterfaces
game.HideInterfaces = true
--char = game.CharacterLinks["Watzmann_Couch_Pippen"]
scene = game.CurrentScene
--charScene = char.Scene
--pos = char.Position
print("isInExitMenu = true ")
changeScene("_Escape_Menu", 3, 500)
end
function closeExitMenu()
print("Closing exit menu")
print("isInExitMenu = false")
isInExitMenu = false
game.CurrentScene = scene
--char.Scene = charScene
--char.Position = pos
--char.Direction = 90
game.HideInterfaces = hideInterfaces
end
--]]--
luaEnd("ExitMenu")
you can see my lua skill is bad from all the commented out stuff
the engine I use only supports lua so I am stuck with that
oh I'm not sure how engines work but you can expose native code in Haxe
and than compile into lua
i don't think visionaire studio would support that
oh my gosh what language is that?
I forked this project cuz I'm going to improve it, but I really like how it looks and works compared to lua (shit lang)
what?
the code
because most people count like that and lua is the normie language
i think it's weird to start with 0
after all it's called index, not offset
sure, but every other lang I know starts at 0 so suddenly when it changes it breaks a lot of your logic in a stupid way
are we talking about array index?
what about int?
array index
also starts at 1?
int starts at the value you set it
It's a dynamically typed language so I don't think there is a type default
nah in java it default is 0
but java is statically typed
i mean lua can be typed faster than java cuz lua doesnt have all those { } && || everywhere
faster isn't all that matters though
what is dynamic types?
if typing speed was all that matters everyone would use python becaues its fast as fuck to type
variable a, variable b
there are no type such as int, long, double, String, Object, ThreadedAnvilChunkStorage
no builtin ThreadAnvilChunkStorage? what a shitty language
but doesn't it take a long time to run?
no
or compile
Remember that python is AOT compiled if you use cpython
Generally you'll be using the "JIT"-compiled python variant which is slower yes
Though the JIT compilation of python can't be compared to java's hotspot
no its slow af
Like unless you are writing time-critical code it is discardable
i'm litterally ADD in a nutshell who can blame me
i waste time on different things
but i might cancel discord subscription
at next payment
what for
ANYWAY...
quick question
how can you get the possible safe enchantments on a item
heres the stupid solution
call for every enchantment the method to enchant an item
it fails if you cannot
making an enchant plugin
so i dont want people to enchant flame on their sword
because that would be dumb
remember that extending Enchantment isn't something you're supposed to do, you should rather just apply a PDC tag to identify your custom enchantments
i hate the limt of Minecraft vanilla
fx not being able to enchant my armor with all the prots
let's be real: Noone does this
I do that, I only extend Enchantment to get the glow effect
And then there are stupid plugins (looking at you, slimefun) that don't provide the necessary API to provide support for the new enchantments
oh slimefun....
for me i dont think that is needed here
And no, open source does not work.
do ender crystals throw a death event?
anyone knows what cleanup code in intellij does?
My plugin is giving me an error when i try to add a UUID to an ArrayList using a command. What do i do?
error: https://paste.md-5.net/ikejoseseq.bash
Main: https://paste.md-5.net/jezuwinone.java
oh god this gonna take a few minutes
you never gave a value to that enderman thing
read your errors
💀 hows that standard json
how is this question related to #help-development
If i knew how to fix it I wouldnt ask you would I?
So is there any way you can help?
spamming across multiple channels is not a way to go
MerchantRecipe recipe1 = new MerchantRecipe(new ItemStack(Material.EMERALD, 1), new ItemStack(Material.CARROT, 8));
why does this throw an error?
what error
depends on the parser
There are many very lenient parsers out there
it says required type int provided type itemstack
exactly, on one of arguments you put itemstack instead of int
uhh wtf is tagalog
no, you gave 2 item stacks
LOL
oh
how does this work
wait ill read the doc
it should be ```java
new MerchantRecipe(new ItemStack(Material.Emerald, 9), 16)
so the result is 9 emeralds right?
Why configuration serializable is tring to serialize a int to a long?
When im telling to save it as long value?
💀
💀
is there an enum of every block
there is the material enum, but you'd need to filter out all non-blocks
like isBlock or something
And even then you have issues with things technically being blocks but not really
nah i need just every wooden block
im in the material enum but theres isnt a name for all blocks
youll have to filter on Material.values()
isnt there a Tag for it
oh ok
World#setBlock(Material.ALL_BLOCKS)?
Yeah, use a tag
no no i just want to see every single blocks name
tags
hold on
github rendering my push go brr
Material has the name of every material
there isnt one for wooden blocks
how about this
if(material.isBlock()) {
String blockName = material.name();
// print them or smth
}
}```
theres ones for groups of them
every single block
Logs or planks