diff --git a/game/core/src/main/java/net/minecraft/core/block/BlockLogicFenceGate.java b/game/core/src/main/java/net/minecraft/core/block/BlockLogicFenceGate.java index d25f78220..7d0403a6e 100644 --- a/game/core/src/main/java/net/minecraft/core/block/BlockLogicFenceGate.java +++ b/game/core/src/main/java/net/minecraft/core/block/BlockLogicFenceGate.java @@ -113,7 +113,7 @@ public class BlockLogicFenceGate int data = world.getBlockData(tilePos); if (isOpen(data)) { world.setBlockDataNotify(tilePos, data & ~MASK_OPEN); - world.playBlockEvent(tilePos, LevelListener.EVENT_DOOR_SOUND, 0); + world.playBlockEvent(player, tilePos, LevelListener.EVENT_DOOR_SOUND, 0); } else { int i1 = 0; if (player != null) { @@ -124,7 +124,7 @@ public class BlockLogicFenceGate data = (data & 0xF0) | i1; } world.setBlockDataNotify(tilePos, data | MASK_OPEN); - world.playBlockEvent(tilePos, LevelListener.EVENT_DOOR_SOUND, 0); + world.playBlockEvent(player, tilePos, LevelListener.EVENT_DOOR_SOUND, 0); } return true; diff --git a/game/core/src/main/java/net/minecraft/core/block/BlockLogicWool.java b/game/core/src/main/java/net/minecraft/core/block/BlockLogicWool.java index 13149ae0d..fc049d1d9 100644 --- a/game/core/src/main/java/net/minecraft/core/block/BlockLogicWool.java +++ b/game/core/src/main/java/net/minecraft/core/block/BlockLogicWool.java @@ -12,7 +12,7 @@ import net.minecraft.core.world.pos.TilePosc; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class BlockLogicWool extends BlockLogic implements IPainted +public class BlockLogicWool extends BlockLogic implements IPainted, BlockLogic.MatcherDataEquivalency { public BlockLogicWool(@NotNull Block block) { diff --git a/game/core/src/main/java/net/minecraft/core/entity/projectile/ProjectileArrowFlaming.java b/game/core/src/main/java/net/minecraft/core/entity/projectile/ProjectileArrowFlaming.java index f4220a2ee..6a1183704 100644 --- a/game/core/src/main/java/net/minecraft/core/entity/projectile/ProjectileArrowFlaming.java +++ b/game/core/src/main/java/net/minecraft/core/entity/projectile/ProjectileArrowFlaming.java @@ -2,6 +2,7 @@ package net.minecraft.core.entity.projectile; import net.minecraft.core.block.BlockLogicEmber; import net.minecraft.core.block.Blocks; +import net.minecraft.core.block.tag.BlockTags; import net.minecraft.core.block.Block; import net.minecraft.core.block.BlockLogicTNT; import net.minecraft.core.entity.Mob; @@ -13,6 +14,8 @@ import net.minecraft.core.util.helper.DamageType; import net.minecraft.core.util.helper.LightIndexHelper; import net.minecraft.core.util.phys.HitResult; import net.minecraft.core.world.World; +import net.minecraft.core.world.pos.TilePos; + import org.jetbrains.annotations.NotNull; @@ -82,33 +85,32 @@ public class ProjectileArrowFlaming extends ProjectileArrow { } } this.remove(); - } else if (hitResult instanceof HitResult.Tile hitTile && !this.world.isClientSide) { - int x = hitTile.tilePos.x(); - int y = hitTile.tilePos.y(); - int z = hitTile.tilePos.z(); - Block hitBlock = world.getBlockType(hitTile.tilePos); - - x += hitTile.side.offsetX(); - y += hitTile.side.offsetY(); - z += hitTile.side.offsetZ(); - - if (world.isAirBlock(x, y, z)) { - world.setBlockWithNotify(x, y, z, Blocks.FIRE.id()); - } - + } else if (hitResult instanceof HitResult.Tile hitTile && !this.world.isClientSide) block_interaction: { + final var hitBlock = world.getBlockType(hitTile.tilePos); if (hitBlock == Blocks.BRAZIER_INACTIVE) { world.setBlockType(hitTile.tilePos, Blocks.BRAZIER_ACTIVE); + break block_interaction; } if (hitBlock == Blocks.TNT) { world.getBlockLogic(hitTile.tilePos, BlockLogicTNT.class).ignite(world, hitTile.tilePos, true); + break block_interaction; } if (hitBlock == Blocks.EMBER) { world.getBlockLogic(hitTile.tilePos, BlockLogicEmber.class).ignite(world, hitTile.tilePos, null); + break block_interaction; } + if (hitBlock == Blocks.ICE) { world.setBlockTypeNotify(hitTile.tilePos, Blocks.FLUID_WATER_STILL); + break block_interaction; + } + + final var adjPos = hitTile.tilePos.add(hitTile.side, new TilePos()); + if (world.isAirBlock(adjPos)) { + final var fire = (hitBlock.hasTag(BlockTags.INFINITE_BURN_SULFURIC)) ? Blocks.FIRE_SULFURIC : Blocks.FIRE; + world.setBlockTypeNotify(adjPos, fire); } } diff --git a/game/core/src/main/java/net/minecraft/core/item/ItemBucket.java b/game/core/src/main/java/net/minecraft/core/item/ItemBucket.java index 198181725..9a4c86509 100644 --- a/game/core/src/main/java/net/minecraft/core/item/ItemBucket.java +++ b/game/core/src/main/java/net/minecraft/core/item/ItemBucket.java @@ -371,17 +371,19 @@ public abstract class ItemBucket extends ItemFood implements IItemContainer { world.playSoundEffect(player, SoundCategory.WORLD_SOUNDS, tilePos.x() + 0.5F, tilePos.y() + 0.5F, tilePos.z() + 0.5F, "item.pickup", 2.2f, 0.5f); result.used = true; + + final NamespaceID currentState = getState(itemStack); + if (!world.isClientSide && STATE_EMPTY.equals(currentState) && STATE_ACID.equals(targetState)) { + player.addStat(Achievements.COLLECT_ACID, 1); + } + if (itemStack.stackSize > 1) { result.itemStack = splitBucket(itemStack, player, targetState, world); return result; } - final NamespaceID currentState = getState(itemStack); if (STATE_EMPTY.equals(currentState)) { setState(itemStack, targetState); setCharges(itemStack, 1); - if (STATE_ACID.equals(targetState) && !world.isClientSide) { - player.addStat(Achievements.COLLECT_ACID, 1); - } } else { setCharges(itemStack, getCharges(itemStack) + 1); } diff --git a/game/core/src/main/java/net/minecraft/core/item/ItemStatue.java b/game/core/src/main/java/net/minecraft/core/item/ItemStatue.java index c759d0ed2..34c3a8983 100644 --- a/game/core/src/main/java/net/minecraft/core/item/ItemStatue.java +++ b/game/core/src/main/java/net/minecraft/core/item/ItemStatue.java @@ -39,8 +39,6 @@ public class ItemStatue extends ItemPlaceablePair { @NotNull World world, @Nullable Player player, @NotNull TilePosc blockPos, @NotNull Side side, double xHit, double yHit ) { - return - IPlaceable.canPlaceBlockDirectlyAtPosition(blockA, world, blockPos, side) && - IPlaceable.canPlaceBlockDirectlyAtPosition(blockB, world, blockPos.up(new TilePos()), side); + return IPlaceable.canPlaceBlockDirectlyAtPosition(blockA, world, blockPos, side); } } diff --git a/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotFurnace.java b/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotFurnace.java index 99eff9fee..abe84b983 100644 --- a/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotFurnace.java +++ b/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotFurnace.java @@ -33,7 +33,8 @@ public class SlotFurnace extends Slot { thePlayer.addStat(Achievements.COOK_FISH, 1); } - super.onTake(itemstack); + if(itemstack.itemID == Items.FOOD_BREAD.id) thePlayer.addStat(Achievements.MAKE_BREAD, 1); + super.onTake(itemstack); } @Override diff --git a/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java b/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java index 6bd157f89..f35fc8862 100644 --- a/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java +++ b/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java @@ -40,7 +40,6 @@ public class SlotResult extends Slot if(item.id == Blocks.WORKBENCH.id()) thePlayer.addStat(Achievements.BUILD_WORKBENCH, 1); if(item.id == Blocks.FURNACE_STONE_IDLE.id()) thePlayer.addStat(Achievements.BUILD_FURNACE, 1); if(item.id == Blocks.FURNACE_BLAST_IDLE.id()) thePlayer.addStat(Achievements.GET_STEEL_BLAST_FURNACE, 1); - if(item.id == Items.FOOD_BREAD.id) thePlayer.addStat(Achievements.MAKE_BREAD, 1); if(item.id == Items.FOOD_CAKE.id) thePlayer.addStat(Achievements.BAKE_CAKE, 1); if(item instanceof ItemBucket && ItemBucket.getState(itemStack) == ItemBucket.STATE_ICECREAM) thePlayer.addStat(Achievements.CRAFT_ICECREAM, 1); if(item.id == Items.FOOD_PUMPKIN_PIE.id) thePlayer.addStat(Achievements.CRAFT_PUMPKIN_PIE, 1);