Skip to content

Commit

Permalink
Fix spawnPowerUps config not working
Browse files Browse the repository at this point in the history
  • Loading branch information
WenXin20 committed Jan 1, 2025
1 parent ba5acd0 commit 4be2f24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ public void spawnFromQuestionBlock(Level world, BlockPos pos, ItemStack stack, E
else entityType.spawn(serverWorld, stack, null, pos.below((int) Math.max(1, entityType.getHeight())), MobSpawnType.SPAWN_EGG, true, true);
stack.copyWithCount(1);
} else spawnItem(world, pos, stack, dropItemsAtPos);
} else if (stack.getItem() instanceof SpawnEggItem spawnEgg && ConfigRegistry.QUESTION_SPAWNS_MOBS.get()) {
} else if (stack.getItem() instanceof SpawnEggItem spawnEgg && ConfigRegistry.QUESTION_SPAWNS_MOBS.get()
&& !(stack.getItem() instanceof BasePowerUpItem)) {
EntityType<?> entityType = spawnEgg.getType(stack);

if (world instanceof ServerLevel serverWorld && !entityType.is(TagRegistry.QUESTION_BLOCK_CANNOT_SPAWN)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ else if (container.getItem(i).getItem() instanceof MinecartItem)
entityType.spawn(serverWorld, stack, null, pos, MobSpawnType.SPAWN_EGG, true, false);
stack.copyWithCount(1);
} else marioverse$spawnItem(world, pos, stack);
} else if (stack.getItem() instanceof SpawnEggItem spawnEgg && spawnMobs) {
} else if (stack.getItem() instanceof SpawnEggItem spawnEgg && spawnMobs
&& !(stack.getItem() instanceof BasePowerUpItem)) {
EntityType<?> entityType = spawnEgg.getType(stack);

if (world instanceof ServerLevel serverWorld && !entityType.is(cannotSpawn)) {
Expand Down

0 comments on commit 4be2f24

Please sign in to comment.