This commit is contained in:
huanmeng-qwq 2025-07-20 18:57:01 +08:00
parent 56e64cde5b
commit 64021bb0dc
No known key found for this signature in database
GPG key ID: A282328441529B42
2 changed files with 6 additions and 3 deletions

View file

@ -5,9 +5,8 @@ import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
import com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState; import com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState;
import me.tofaa.entitylib.meta.Metadata; import me.tofaa.entitylib.meta.Metadata;
import me.tofaa.entitylib.meta.types.MobMeta; import me.tofaa.entitylib.meta.types.MobMeta;
import org.jetbrains.annotations.Nullable;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.Nullable;
public class EndermanMeta extends MobMeta { public class EndermanMeta extends MobMeta {
@ -33,6 +32,10 @@ public class EndermanMeta extends MobMeta {
} }
public void setCarriedBlockState(WrappedBlockState blockState) { public void setCarriedBlockState(WrappedBlockState blockState) {
if (blockState == null) {
setCarriedBlockID(null);
return;
}
setCarriedBlockID(blockState.getGlobalId()); setCarriedBlockID(blockState.getGlobalId());
} }

View file

@ -40,7 +40,7 @@ public class FallingBlockMeta extends EntityMeta implements ObjectData {
return WrappedBlockState.getByGlobalId(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion(), getBlockStateId()); return WrappedBlockState.getByGlobalId(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion(), getBlockStateId());
} }
public void setBlockStateId(WrappedBlockState blockState) { public void setBlockState(WrappedBlockState blockState) {
setBlockStateId(blockState.getGlobalId()); setBlockStateId(blockState.getGlobalId());
} }