mirror of
https://github.com/architectury/architectury-api.git
synced 2026-04-02 13:37:43 -05:00
Implement onDataPacket (#48)
This commit is contained in:
@@ -64,7 +64,7 @@ remapJar {
|
||||
publishing {
|
||||
publications {
|
||||
mavenForge(MavenPublication) {
|
||||
artifactId = rootProject.archives_base_name + "-forge"
|
||||
artifactId = rootProject.archivesBaseName + "-forge"
|
||||
artifact(remapJar.archivePath) {
|
||||
builtBy build
|
||||
classifier null
|
||||
|
||||
@@ -21,6 +21,9 @@ package me.shedaniel.architectury.mixin.forge;
|
||||
|
||||
import me.shedaniel.architectury.extensions.BlockEntityExtension;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.common.extensions.IForgeTileEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -36,4 +39,9 @@ public interface MixinBlockEntityExtension extends IForgeTileEntity {
|
||||
default void handleUpdateTag(BlockState state, CompoundTag tag) {
|
||||
loadClientData(state, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
default void onDataPacket(Connection connection, ClientboundBlockEntityDataPacket packet) {
|
||||
loadClientData(((BlockEntity) this).getBlockState(), packet.getTag());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user