File tree Expand file tree Collapse file tree
Plugin/src/main/java/dev/lrxh/neptune Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,13 +68,19 @@ private Optional<Profile> getProfile(Player player) {
6868 }
6969
7070 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = true )
71- public void onCrystalSpawn (EntitySpawnEvent event ) {
71+ public void onEntitySpawn (EntitySpawnEvent event ) {
7272 if (event .getEntity () instanceof EnderCrystal crystal ) {
7373 Player player = getNearbyPlayer (crystal .getLocation ());
7474 if (player == null )
7575 return ;
7676
7777 getMatchForPlayer (player ).ifPresent (match -> match .getEntities ().add (crystal ));
78+ } else if (event .getEntity () instanceof ArmorStand armorStand ) {
79+ Player player = getNearbyPlayer (armorStand .getLocation ());
80+ if (player == null )
81+ return ;
82+
83+ getMatchForPlayer (player ).ifPresent (match -> match .getEntities ().add (armorStand ));
7884 }
7985 }
8086
Original file line number Diff line number Diff line change 1515import org .bukkit .Location ;
1616import org .bukkit .Material ;
1717import org .bukkit .entity .Player ;
18+ import org .bukkit .entity .ArmorStand ;
1819import org .bukkit .event .EventHandler ;
1920import org .bukkit .event .EventPriority ;
2021import org .bukkit .event .Listener ;
@@ -44,6 +45,9 @@ public void onCreatureSpawnEvent(CreatureSpawnEvent event) {
4445 if (event .getSpawnReason ().equals (CreatureSpawnEvent .SpawnReason .SPAWNER_EGG ) || event .getSpawnReason ().equals (CreatureSpawnEvent .SpawnReason .EGG ) || event .getSpawnReason ().equals (CreatureSpawnEvent .SpawnReason .BUCKET )) {
4546 return ;
4647 }
48+ if (event .getEntity () instanceof ArmorStand ) {
49+ return ;
50+ }
4751 event .setCancelled (true );
4852 }
4953
You can’t perform that action at this time.
0 commit comments