java类net.minecraftforge.fml.common.network.internal.FMLNetworkHandler的实例源码

BlockCabinet.java 文件源码 项目:Mods 阅读 16 收藏 0 点赞 0 评论 0
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
        EnumHand hand, @Nullable EnumFacing side, float hitX, float hitY, float hitZ) {
    if (!worldIn.isRemote)
        FMLNetworkHandler.openGui(playerIn, TF2weapons.instance, 1, worldIn, pos.getX(), pos.getY(), pos.getZ());
    return true;
}
BlockSkeletonMaker.java 文件源码 项目:Overlord 阅读 17 收藏 0 点赞 0 评论 0
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    if (worldIn.isRemote)
        return true;
    else if (!playerIn.isSneaking()) {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntitySkeletonMaker || tileentity instanceof TileEntityBabySkeletonMaker) {
            FMLNetworkHandler.openGui(playerIn, Overlord.MODID, 0, worldIn, pos.getX(), pos.getY(), pos.getZ());
        }
        return true;
    } else
        return false;
}
ItemSquadEditor.java 文件源码 项目:Overlord 阅读 14 收藏 0 点赞 0 评论 0
@SuppressWarnings("unchecked")
@Override
@Nonnull
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, @Nonnull EnumHand hand) {
    FMLNetworkHandler.openGui(playerIn, Overlord.instance, -2, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);
    return new ActionResult(EnumActionResult.SUCCESS, playerIn.getHeldItem(hand));
}
EntityLootableBody.java 文件源码 项目:LootableBodies 阅读 15 收藏 0 点赞 0 评论 0
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand, ItemStack item){
    if(player.getPosition().distanceSq(this.getPosition()) < 25) {
        FMLNetworkHandler.openGui(player, LootableBodies.getInstance(), 0, getEntityWorld(), this.getEntityId(), 0, 0);
        return true;
    }
    return false;
}
Tomb_Riser.java 文件源码 项目:TombCraft 阅读 15 收藏 0 点赞 0 评论 0
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if(!worldIn.isRemote)
    {
        FMLNetworkHandler.openGui(playerIn, TombCraft.instance, GuiId.TOMB_RISER.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
    }

    return true;
}
Relic_Lab.java 文件源码 项目:TombCraft 阅读 14 收藏 0 点赞 0 评论 0
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if(!worldIn.isRemote)
    {
        FMLNetworkHandler.openGui(playerIn, TombCraft.instance, GuiId.RELIC_LAB.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
    }

    return true;
}
EntityMinecartBase.java 文件源码 项目:MoarCarts 阅读 14 收藏 0 点赞 0 评论 0
@Override
public boolean interactFirst(EntityPlayer player)
{
    if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, player)))
    {
        return true;
    }

    if (!this.worldObj.isRemote && !player.isSneaking())
    {
        FMLNetworkHandler.openGui(player, MoarCarts.instance, 2, player.worldObj, this.getEntityId(), 0, 0);
    }

    return true;
}
PacketOpenTeamSelect.java 文件源码 项目:Wars-Mod 阅读 16 收藏 0 点赞 0 评论 0
@Override
public IMessage handleClientMessage(EntityPlayer player, PacketOpenTeamSelect message, MessageContext ctx) {
    System.out.println(String.format("Received %s from %s", "command to open team selection gui", player.getDisplayName().getUnformattedText()));

    FMLNetworkHandler.openGui(player, WarsMod.instance, 3, player.worldObj, 0, 0, 0);

    return null;
}
BlockSelectorGames.java 文件源码 项目:Wars-Mod 阅读 14 收藏 0 点赞 0 评论 0
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack held, EnumFacing side, float par7, float par8, float par9) {
    if (player.isSneaking())
        return false;
    FMLNetworkHandler.openGui(player, WarsMod.instance, 7, world, pos.getX(), pos.getY(), pos.getZ());
    return true;
}
BlockSelectorSpleef.java 文件源码 项目:Wars-Mod 阅读 16 收藏 0 点赞 0 评论 0
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack held, EnumFacing side, float par7, float par8, float par9) {
    if (player.isSneaking())
        return false;
    FMLNetworkHandler.openGui(player, WarsMod.instance, 5, world, pos.getX(), pos.getY(), pos.getZ());
    return true;
}


问题


面经


文章

微信
公众号

扫码关注公众号