Skip to content

Commit

Permalink
[1.20.5] Initial port
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMCLoveMan committed Apr 24, 2024
1 parent c2d3ed8 commit a1e4be7
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 50 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ unifiedPublishing {
token = curseforgeToken
id = project.curse_project_id
changelog = changes
gameVersions.addAll "Java 17"
gameVersions.addAll "Java 21"

relations {
depends "themcbroslib"
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ mod_version=10.0.0-alpha
artifact_type=release

# Minecraft
minecraft_version=1.20.5-rc1
minecraft_version_range=1.20.5-rc1
minecraft_version=1.20.5
minecraft_version_range=[1.20.5, 1.21)

# NeoForge
neo_version=20.5.0-alpha.1.20.5-rc1.20240419.085959
neo_version_range=20.5.0-alpha.1.20.5-rc1.20240419.085959
neo_version=20.5.0-beta
neo_version_range=[20.5.0,)
loader_version_range=[3,)

# Mappings
Expand All @@ -33,7 +33,7 @@ catalogue_item_icon=uselessmod:useless_ingot

# Dependencies
lib_version=7.0.0-SNAPSHOT
lib_version_range=1.20.5-rc1-7.0.0-SNAPSHOT
lib_version_range=[1.20.5-7.0.0,)
jei_version=17.3.0.49

# Publishing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import net.minecraft.world.entity.EquipmentSlot;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.client.event.RenderLivingEvent;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.world.item.UselessElytraItem;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE, modid = UselessMod.MOD_ID, value = Dist.CLIENT)
// TODO: rename class
@EventBusSubscriber(bus = EventBusSubscriber.Bus.GAME, modid = UselessMod.MOD_ID, value = Dist.CLIENT)
public class UselessForgeClientEvents {
private static boolean wasCloakVisible;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import net.minecraft.world.entity.player.Inventory;
import net.neoforged.neoforge.client.gui.widget.ExtendedButton;
import net.neoforged.neoforge.fluids.FluidStack;
import net.neoforged.neoforge.network.PacketDistributor;
import net.themcbrothers.lib.client.screen.widgets.EnergyBar;
import net.themcbrothers.lib.client.screen.widgets.FluidTank;
import net.themcbrothers.lib.network.PacketUtils;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.network.packets.CoffeeMachineMilkUpdatePacket;
import net.themcbrothers.uselessmod.network.packets.CoffeeMachineStartPacket;
Expand Down Expand Up @@ -122,7 +122,7 @@ public StartStopButton(int xPos, int yPos, int width, int height, boolean start)

@Override
public void onPress() {
PacketUtils.sendToServer(new CoffeeMachineStartPacket(this.start));
PacketDistributor.sendToServer(new CoffeeMachineStartPacket(this.start));
}

@Override
Expand Down Expand Up @@ -173,7 +173,7 @@ public void renderToolTip(@NotNull GuiGraphics guiGraphics, int mouseX, int mous
@Override
public void onPress() {
this.checked = !this.checked;
PacketUtils.sendToServer(new CoffeeMachineMilkUpdatePacket(this.isChecked()));
PacketDistributor.sendToServer(new CoffeeMachineMilkUpdatePacket(this.isChecked()));
}

public boolean isChecked() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.world.level.block.AirBlock;
import net.minecraft.world.level.block.Blocks;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.themcbrothers.uselessmod.UselessMod;
Expand All @@ -23,7 +23,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = UselessMod.MOD_ID)
@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD, modid = UselessMod.MOD_ID)
public final class UselessCreativeModeTabs {
static void register() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.common.data.AdvancementProvider;
import net.neoforged.neoforge.common.data.BlockTagsProvider;
import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider;
Expand All @@ -23,7 +23,7 @@
import java.util.Set;
import java.util.concurrent.CompletableFuture;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = UselessMod.MOD_ID)
@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD, modid = UselessMod.MOD_ID)
public class UselessDataGen {
@SubscribeEvent
public static void dataGen(final GatherDataEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ protected void buildRecipes(RecipeOutput consumer) {
bedFromPlanksAndWool(consumer, UselessBlocks.USELESS_BED, UselessBlocks.USELESS_WOOL.get());
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, UselessBlocks.LIGHT_SWITCH).requires(Items.LEVER).requires(Tags.Items.DYES_WHITE).unlockedBy("has_lever", has(Items.LEVER)).save(consumer);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, UselessBlocks.CUP, 2).define('#', Blocks.QUARTZ_SLAB).pattern("# #").pattern(" # ").unlockedBy("has_quartz_slab", has(Blocks.QUARTZ_SLAB)).save(consumer);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, UselessBlocks.MACHINE_SUPPLIER).define('#', Tags.Items.COBBLESTONE_NORMAL).define('X', Tags.Items.GLASS).define('R', Tags.Items.DUSTS_REDSTONE).pattern("#X#").pattern("XRX").pattern("#X#").unlockedBy("has_redstone", has(Tags.Items.DUSTS_REDSTONE)).save(consumer);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, UselessBlocks.COFFEE_MACHINE).define('#', Tags.Items.GLASS).define('X', UselessBlocks.MACHINE_SUPPLIER).define('R', Items.REDSTONE_TORCH).define('U', UselessTags.Items.INGOTS_USELESS).pattern("#U#").pattern("RXR").unlockedBy("has_supplier", has(UselessBlocks.MACHINE_SUPPLIER)).save(consumer);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, UselessBlocks.MACHINE_SUPPLIER).define('#', Tags.Items.COBBLESTONES_NORMAL).define('X', Tags.Items.GLASS_BLOCKS).define('R', Tags.Items.DUSTS_REDSTONE).pattern("#X#").pattern("XRX").pattern("#X#").unlockedBy("has_redstone", has(Tags.Items.DUSTS_REDSTONE)).save(consumer);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, UselessBlocks.COFFEE_MACHINE).define('#', Tags.Items.GLASS_BLOCKS).define('X', UselessBlocks.MACHINE_SUPPLIER).define('R', Items.REDSTONE_TORCH).define('U', UselessTags.Items.INGOTS_USELESS).pattern("#U#").pattern("RXR").unlockedBy("has_supplier", has(UselessBlocks.MACHINE_SUPPLIER)).save(consumer);
ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, UselessBlocks.PAINT_BUCKET).define('#', UselessTags.Items.INGOTS_USELESS).define('X', Tags.Items.RODS_WOODEN).pattern("#X#").pattern(" # ").unlockedBy(getHasName(UselessItems.USELESS_INGOT), has(UselessTags.Items.INGOTS_USELESS)).save(consumer);

// Lamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ protected void addTags(HolderLookup.Provider lookupProvider) {
this.tag(ItemTags.PICKAXES).add(UselessItems.USELESS_PICKAXE.get(), UselessItems.SUPER_USELESS_PICKAXE.get());
this.tag(ItemTags.AXES).add(UselessItems.USELESS_AXE.get(), UselessItems.SUPER_USELESS_AXE.get());
this.tag(ItemTags.HOES).add(UselessItems.USELESS_HOE.get(), UselessItems.SUPER_USELESS_HOE.get());
this.tag(ItemTags.TRIMMABLE_ARMOR).add(UselessItems.USELESS_HELMET.get(), UselessItems.USELESS_CHESTPLATE.get(), UselessItems.USELESS_LEGGINGS.get(), UselessItems.USELESS_BOOTS.get(), UselessItems.SUPER_USELESS_HELMET.get(), UselessItems.SUPER_USELESS_CHESTPLATE.get(), UselessItems.SUPER_USELESS_LEGGINGS.get(), UselessItems.SUPER_USELESS_BOOTS.get());
this.tag(ItemTags.HEAD_ARMOR).add(UselessItems.USELESS_HELMET.get(), UselessItems.SUPER_USELESS_HELMET.get());
this.tag(ItemTags.CHEST_ARMOR).add(UselessItems.USELESS_CHESTPLATE.get(), UselessItems.SUPER_USELESS_CHESTPLATE.get());
this.tag(ItemTags.LEG_ARMOR).add(UselessItems.USELESS_LEGGINGS.get(), UselessItems.SUPER_USELESS_LEGGINGS.get());
this.tag(ItemTags.FOOT_ARMOR).add(UselessItems.USELESS_BOOTS.get(), UselessItems.SUPER_USELESS_BOOTS.get());

// materials
this.tag(UselessTags.Items.INGOTS_USELESS).add(UselessItems.USELESS_INGOT.get());
Expand All @@ -145,21 +148,18 @@ protected void addTags(HolderLookup.Provider lookupProvider) {
this.tag(UselessTags.Items.RAW_MATERIALS_SUPER_USELESS).add(UselessItems.RAW_SUPER_USELESS.get());
this.tag(Tags.Items.RAW_MATERIALS).addTag(UselessTags.Items.RAW_MATERIALS_USELESS).addTag(UselessTags.Items.RAW_MATERIALS_SUPER_USELESS);

// other forge tags
this.tag(Tags.Items.SHEARS).add(UselessItems.USELESS_SHEARS.get());
// other common tags
this.tag(Tags.Items.TOOLS_SHEARS).add(UselessItems.USELESS_SHEARS.get());
this.tag(Tags.Items.TOOLS_SHIELDS).add(UselessItems.USELESS_SHIELD.get(), UselessItems.SUPER_USELESS_SHIELD.get());
this.tag(Tags.Items.ARMORS_HELMETS).add(UselessItems.USELESS_HELMET.get(), UselessItems.SUPER_USELESS_HELMET.get());
this.tag(Tags.Items.ARMORS_CHESTPLATES).add(UselessItems.USELESS_CHESTPLATE.get(), UselessItems.SUPER_USELESS_CHESTPLATE.get());
this.tag(Tags.Items.ARMORS_LEGGINGS).add(UselessItems.USELESS_LEGGINGS.get(), UselessItems.SUPER_USELESS_LEGGINGS.get());
this.tag(Tags.Items.ARMORS_BOOTS).add(UselessItems.USELESS_BOOTS.get(), UselessItems.SUPER_USELESS_BOOTS.get());

this.tag(UselessTags.Items.CROPS_USELESS_WHEAT).add(UselessItems.USELESS_WHEAT.get());
this.tag(UselessTags.Items.CROPS_COFFEEBEAN).add(UselessItems.COFFEE_BEANS.get());
this.tag(Tags.Items.CROPS).addTag(UselessTags.Items.CROPS_USELESS_WHEAT).addTag(UselessTags.Items.CROPS_COFFEEBEAN);
this.tag(UselessTags.Items.SEEDS_USELESS_WHEAT).add(UselessItems.USELESS_WHEAT_SEEDS.get());
this.tag(UselessTags.Items.SEEDS_COFFEEBEAN).add(UselessItems.COFFEE_SEEDS.get());
this.tag(Tags.Items.SEEDS).addTag(UselessTags.Items.SEEDS_USELESS_WHEAT).addTag(UselessTags.Items.SEEDS_COFFEEBEAN);
this.tag(Tags.Items.BONES).add(UselessItems.USELESS_BONE.get());
this.tag(Tags.Items.LEATHER).add(UselessItems.USELESS_LEATHER.get());
this.tag(Tags.Items.LEATHERS).add(UselessItems.USELESS_LEATHER.get());
this.tag(Tags.Items.FEATHERS).add(UselessItems.USELESS_FEATHER.get());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class UselessBlockLoot extends BlockLootSubProvider {
ItemEnchantmentsPredicate.enchantments(List.of(new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.atLeast(1))))
)
);
private static final LootItemCondition.Builder HAS_SHEARS = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Tags.Items.SHEARS));
private static final LootItemCondition.Builder HAS_SHEARS = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Tags.Items.TOOLS_SHEARS));
private static final LootItemCondition.Builder HAS_SHEARS_OR_SILK_TOUCH = HAS_SHEARS.or(HAS_SILK_TOUCH);
private static final LootItemCondition.Builder HAS_NO_SHEARS_OR_SILK_TOUCH = HAS_SHEARS_OR_SILK_TOUCH.invert();
private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[]{0.05F, 0.0625F, 0.083333336F, 0.1F};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import net.minecraft.world.item.DyeItem;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.world.entity.animal.UselessSheep;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE, modid = UselessMod.MOD_ID)
// TODO: rename class
@EventBusSubscriber(bus = EventBusSubscriber.Bus.GAME, modid = UselessMod.MOD_ID)
public class UselessForgeEvents {
@SubscribeEvent
static void onEntityInteract(final PlayerInteractEvent.EntityInteract event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ public UselessPacketHandler(IEventBus modEventBus, String modId, Version version
}

@Override
protected void registerClientToServer(PacketRegistrar registrar) {
registrar.play(CoffeeMachineStartPacket.TYPE, CoffeeMachineStartPacket.STREAM_CODEC);
registrar.play(CoffeeMachineMilkUpdatePacket.TYPE, CoffeeMachineMilkUpdatePacket.STREAM_CODEC);
protected void registerPackets(PacketRegistrar registrar) {
registrar.playToServer(CoffeeMachineStartPacket.TYPE, CoffeeMachineStartPacket.STREAM_CODEC);
registrar.playToServer(CoffeeMachineMilkUpdatePacket.TYPE, CoffeeMachineMilkUpdatePacket.STREAM_CODEC);

registrar.playBidirectional(BlockEntitySyncPacket.TYPE, BlockEntitySyncPacket.STREAM_CODEC);
}

@Override
protected void registerServerToClient(PacketRegistrar registrar) {
registrar.play(BlockEntitySyncPacket.TYPE, BlockEntitySyncPacket.STREAM_CODEC);
protected void registerPacketsNetworkThread(PacketRegistrar registrar) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.world.level.Level;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.network.handling.PlayPayloadContext;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import net.themcbrothers.lib.network.PacketMessage;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.network.MessageProxy;
import net.themcbrothers.uselessmod.world.level.block.entity.SyncableBlockEntity;

import java.util.Objects;

public record BlockEntitySyncPacket(BlockPos pos, CompoundTag tag) implements PacketMessage<PlayPayloadContext> {
public record BlockEntitySyncPacket(BlockPos pos, CompoundTag tag) implements PacketMessage {
public static final Type<BlockEntitySyncPacket> TYPE = new Type<>(UselessMod.rl("block_entity_sync"));
public static final StreamCodec<FriendlyByteBuf, BlockEntitySyncPacket> STREAM_CODEC = new StreamCodec<>() {
@Override
Expand All @@ -37,15 +38,15 @@ public Type<? extends CustomPacketPayload> type() {
}

@Override
public void handle(PlayPayloadContext context) {
public void handle(IPayloadContext context) {
if (context.flow().getReceptionSide() == LogicalSide.SERVER) {
context.level().ifPresent(level -> {
if (level.isAreaLoaded(this.pos, 1)) {
if (level.getBlockEntity(this.pos) instanceof SyncableBlockEntity blockEntity) {
blockEntity.receiveMessageFromClient(this.tag, level.registryAccess());
}
Level level = context.player().level();

if (level.isAreaLoaded(this.pos, 1)) {
if (level.getBlockEntity(this.pos) instanceof SyncableBlockEntity blockEntity) {
blockEntity.receiveMessageFromClient(this.tag, level.registryAccess());
}
});
}
} else {
if (FMLEnvironment.dist == Dist.CLIENT) {
MessageProxy.receiveServerUpdates(this.pos, this.tag).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.neoforged.neoforge.network.handling.PlayPayloadContext;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import net.themcbrothers.lib.network.PacketMessage;
import net.themcbrothers.lib.network.PacketUtils;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.world.inventory.CoffeeMachineMenu;
import net.themcbrothers.uselessmod.world.level.block.entity.CoffeeMachineBlockEntity;

public record CoffeeMachineMilkUpdatePacket(boolean useMilk) implements PacketMessage<PlayPayloadContext> {
public record CoffeeMachineMilkUpdatePacket(boolean useMilk) implements PacketMessage {
public static final Type<CoffeeMachineMilkUpdatePacket> TYPE = new Type<>(UselessMod.rl("coffee_machine_milk_update"));
public static final StreamCodec<FriendlyByteBuf, CoffeeMachineMilkUpdatePacket> STREAM_CODEC = new StreamCodec<>() {
@Override
Expand All @@ -30,7 +30,7 @@ public Type<? extends CustomPacketPayload> type() {
}

@Override
public void handle(PlayPayloadContext context) {
public void handle(IPayloadContext context) {
PacketUtils.container(context, CoffeeMachineMenu.class).ifPresent(menu -> {
CoffeeMachineBlockEntity coffeeMachine = menu.blockEntity;
coffeeMachine.updateUseMilk(this.useMilk);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.neoforged.neoforge.network.handling.PlayPayloadContext;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import net.themcbrothers.lib.network.PacketMessage;
import net.themcbrothers.lib.network.PacketUtils;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.world.inventory.CoffeeMachineMenu;
import net.themcbrothers.uselessmod.world.level.block.entity.CoffeeMachineBlockEntity;

public record CoffeeMachineStartPacket(boolean start) implements PacketMessage<PlayPayloadContext> {
public record CoffeeMachineStartPacket(boolean start) implements PacketMessage {
public static final Type<CoffeeMachineStartPacket> TYPE = new Type<>(UselessMod.rl("coffee_machine_start"));
public static final StreamCodec<FriendlyByteBuf, CoffeeMachineStartPacket> STREAM_CODEC = new StreamCodec<>() {
@Override
Expand All @@ -30,7 +30,7 @@ public Type<? extends CustomPacketPayload> type() {
}

@Override
public void handle(PlayPayloadContext context) {
public void handle(IPayloadContext context) {
PacketUtils.container(context, CoffeeMachineMenu.class).ifPresent(menu -> {
CoffeeMachineBlockEntity coffeeMachine = menu.blockEntity;
coffeeMachine.startMachine(this.start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
Expand All @@ -27,6 +28,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -37,8 +39,8 @@
import net.neoforged.neoforge.fluids.FluidUtil;
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
import net.neoforged.neoforge.fluids.capability.templates.FluidTank;
import net.neoforged.neoforge.network.PacketDistributor;
import net.themcbrothers.lib.energy.ExtendedEnergyStorage;
import net.themcbrothers.lib.network.PacketUtils;
import net.themcbrothers.lib.util.EnergyUtils;
import net.themcbrothers.uselessmod.UselessMod;
import net.themcbrothers.uselessmod.config.ServerConfig;
Expand Down Expand Up @@ -291,7 +293,7 @@ public void sendSyncPacket(int type) {
nbt.putBoolean("UseMilk", this.useMilk);
}

PacketUtils.sendToAllTracking(new BlockEntitySyncPacket(this.worldPosition, nbt), this.level, this.worldPosition);
PacketDistributor.sendToPlayersTrackingChunk((ServerLevel) this.level, new ChunkPos(this.worldPosition), new BlockEntitySyncPacket(this.worldPosition, nbt));
}

@Override
Expand Down

0 comments on commit a1e4be7

Please sign in to comment.