Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
WenXin20 committed Jan 4, 2025
1 parent 091064d commit da0b54f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public void spawnFromQuestionBlock(Level world, BlockPos pos, ItemStack stack, E
stack.copyWithCount(1);
} else spawnItem(world, pos, stack, dropItemsAtPos);
} else if (stack.getItem() instanceof BucketItem bucket && bucket.content != Fluids.EMPTY) {
if (!ConfigRegistry.QUESTION_BUCKET_TWEAKS.get()) {
if (ConfigRegistry.QUESTION_BUCKET_TWEAKS.get()) {
if (world.getBlockState(pos.above()).isAir() || !world.getFluidState(pos.above()).isEmpty()
|| (!world.getBlockState(pos.below()).isAir() && world.getFluidState(pos.below()).isEmpty())) {
if (bucket.emptyContents(null, world, pos.above(), null, stack))
Expand All @@ -388,7 +388,7 @@ public void spawnFromQuestionBlock(Level world, BlockPos pos, ItemStack stack, E
spawnItem(world, pos, new ItemStack(Items.BUCKET), dropItemsAtPos);
} else spawnItem(world, pos, stack, dropItemsAtPos);
} else if (stack.getItem() instanceof SolidBucketItem bucket) {
if (!ConfigRegistry.QUESTION_BUCKET_TWEAKS.get()) {
if (ConfigRegistry.QUESTION_BUCKET_TWEAKS.get()) {
if (world.getBlockState(pos.above()).isAir() || !world.getFluidState(pos.above()).isEmpty()
|| (!world.getBlockState(pos.below()).isAir() && world.getFluidState(pos.below()).isEmpty())) {
if (bucket.emptyContents(null, world, pos.above(), null, stack))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static void dropContents(Level world, double x, double y, double z, Cont

@Unique
private static void marioverse$spawnFromContainer(Level world, BlockPos pos, ItemStack stack, Entity entityHitBlock, boolean spawnMobs, boolean spawnPowerUps,
boolean cannotEmptyBuckets, TagKey<EntityType<?>> cannotSpawn) {
boolean canEmptyBuckets, TagKey<EntityType<?>> cannotSpawn) {
if (world instanceof ServerLevel serverWorld) {
if (stack.getItem() instanceof BasePowerUpItem powerUpItem && spawnPowerUps) {
EntityType<?> entityType = powerUpItem.getType(stack);
Expand Down Expand Up @@ -227,13 +227,13 @@ private static void dropContents(Level world, double x, double y, double z, Cont
stack.copyWithCount(1);
} else marioverse$spawnItem(world, pos, stack);
} else if (stack.getItem() instanceof BucketItem bucket && bucket.content != Fluids.EMPTY) {
if (!cannotEmptyBuckets) {
if (canEmptyBuckets) {
if (bucket.emptyContents(null, world, pos, null, stack))
bucket.checkExtraContent(null, world, stack, pos);
marioverse$spawnItem(world, pos, new ItemStack(Items.BUCKET));
} else marioverse$spawnItem(world, pos, stack);
} else if (stack.getItem() instanceof SolidBucketItem bucket) {
if (!cannotEmptyBuckets) {
if (canEmptyBuckets) {
if (bucket.emptyContents(null, world, pos, null, stack))
bucket.checkExtraContent(null, world, stack, pos);
marioverse$spawnItem(world, pos, new ItemStack(Items.BUCKET));
Expand Down

0 comments on commit da0b54f

Please sign in to comment.