mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Specify NetworkHooks#getEntitySpawningPacket Generic Return Type (#9220)
This commit is contained in:
1 parent
81276b341a
commit
e688f136dd
1 file changed
+5
-2
@@ -16,6 +16,7 @@ import java.util.stream.Collectors;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
import net.minecraftforge.fml.util.thread.EffectiveSide;
|
||||
import net.minecraftforge.network.ConnectionData.ModMismatchData;
|
||||
@@ -66,9 +67,11 @@ public class NetworkHooks
|
||||
return ConnectionType.forVersionFlag(channel.attr(NetworkConstants.FML_NETVERSION).get());
|
||||
}
|
||||
|
||||
public static Packet<?> getEntitySpawningPacket(Entity entity)
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Packet<ClientGamePacketListener> getEntitySpawningPacket(Entity entity)
|
||||
{
|
||||
return NetworkConstants.playChannel.toVanillaPacket(new PlayMessages.SpawnEntity(entity), NetworkDirection.PLAY_TO_CLIENT);
|
||||
// ClientboundCustomPayloadPacket is an instance of Packet<ClientGamePacketListener>
|
||||
return (Packet<ClientGamePacketListener>) NetworkConstants.playChannel.toVanillaPacket(new PlayMessages.SpawnEntity(entity), NetworkDirection.PLAY_TO_CLIENT);
|
||||
}
|
||||
|
||||
public static boolean onCustomPayload(final ICustomPacket<?> packet, final Connection manager) {
|
||||
|
||||
Reference in new issue
Block a user