File tree Expand file tree Collapse file tree
Bukkit/src/main/java/com/plotsquared/bukkit/listener Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1310,16 +1310,18 @@ public void onInteract(PlayerInteractEvent event) {
13101310 }
13111311 }
13121312 }
1313+ // 1.21.5 (Spring to Life) introduced brown_egg and blue_egg.
1314+ // This new variable detects all current and future eggs.
1315+ // It could be replaced with an Item Tag or the exact Material in the future.
1316+ final boolean isEgg = type .toString ().toLowerCase ().endsWith ("egg" );
13131317 if (PaperLib .isPaper ()) {
1314- if (MaterialTags .SPAWN_EGGS .isTagged (type ) || Material .EGG .equals (type )) {
1315- eventType = PlayerBlockEventType .SPAWN_MOB ;
1316- break ;
1317- }
1318- } else {
1319- if (type .toString ().toLowerCase ().endsWith ("egg" )) {
1318+ if (MaterialTags .SPAWN_EGGS .isTagged (type ) || isEgg ) {
13201319 eventType = PlayerBlockEventType .SPAWN_MOB ;
13211320 break ;
13221321 }
1322+ } else if (isEgg ) {
1323+ eventType = PlayerBlockEventType .SPAWN_MOB ;
1324+ break ;
13231325 }
13241326 if (type .isEdible ()) {
13251327 //Allow all players to eat while also allowing the block place event to be fired
You can’t perform that action at this time.
0 commit comments