当前位置: 首页>>代码示例>>Java>>正文


Java ClientUtils类代码示例

本文整理汇总了Java中codechicken.core.ClientUtils的典型用法代码示例。如果您正苦于以下问题:Java ClientUtils类的具体用法?Java ClientUtils怎么用?Java ClientUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ClientUtils类属于codechicken.core包,在下文中一共展示了ClientUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadWorld

import codechicken.core.ClientUtils; //导入依赖的package包/类
public void loadWorld(World world, boolean fromServer) {
    if (world != lastworld) {
        SMPmagneticItems.clear();
        WorldOverlayRenderer.reset();

        if (!fromServer) {
            NEIClientConfig.setHasSMPCounterPart(false);
            NEIClientConfig.setInternalEnabled(false);

            if (!Minecraft.getMinecraft().isSingleplayer())//wait for server to initiate in singleplayer
                NEIClientConfig.loadWorld("remote/" + ClientUtils.getServerIP().replace(':', '~'));
        }

        lastworld = world;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:ClientHandler.java

示例2: handlePacket

import codechicken.core.ClientUtils; //导入依赖的package包/类
@Override
public void handlePacket(PacketCustom packet, Minecraft mc, INetHandlerPlayClient netHandler) {
    switch (packet.getType()) {
        case 1:
            handleSMPCheck(packet.readUByte(), packet.readString(), mc.theWorld);
            break;
        case 10:
            handleLoginState(packet);
            break;
        case 11:
            handleActionDisabled(packet);
            break;
        case 12:
            handleActionEnabled(packet);
            break;
        case 13:
            ClientHandler.instance().addSMPMagneticItem(packet.readInt(), mc.theWorld);
            break;
        case 14:
            handleGamemode(mc, packet.readUByte());
            break;
        case 21:
            ClientUtils.openSMPGui(packet.readUByte(), new GuiEnchantmentModifier(mc.thePlayer.inventory, mc.theWorld, 0, 0, 0));
            break;
        case 23:
            if (packet.readBoolean())
                ClientUtils.openSMPGui(packet.readUByte(), new GuiExtendedCreativeInv(new ContainerCreativeInv(mc.thePlayer, new ExtendedCreativeInv(null, Side.CLIENT))));
            else
                mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
            break;
        case 24:
            ClientUtils.openSMPGui(packet.readUByte(), new GuiPotionCreator(mc.thePlayer.inventory));
            break;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:36,代码来源:NEICPH.java

示例3: tickEvent

import codechicken.core.ClientUtils; //导入依赖的package包/类
@SubscribeEvent
public void tickEvent(TickEvent.ClientTickEvent event) {
    if(event.phase == Phase.END)
        return;

    Minecraft mc = Minecraft.getMinecraft();
    if(mc.theWorld != null) {
        if(loadWorld(mc.theWorld)) {
            NEIClientConfig.setHasSMPCounterPart(false);
            NEIClientConfig.setInternalEnabled(false);

            if (!Minecraft.getMinecraft().isSingleplayer())//wait for server to initiate in singleplayer
                NEIClientConfig.loadWorld("remote/" + ClientUtils.getServerIP().replace(':', '~'));
        }

        if (!NEIClientConfig.isEnabled())
            return;

        KeyManager.tickKeyStates();

        NEIController.updateUnlimitedItems(mc.thePlayer.inventory);
        if (mc.currentScreen == null)
            NEIController.processCreativeCycling(mc.thePlayer.inventory);

        updateMagnetMode(mc.theWorld, mc.thePlayer);
    }

    GuiScreen gui = mc.currentScreen;
    if (gui != lastGui) {
        if (gui instanceof GuiMainMenu)
            lastworld = null;
        else if (gui instanceof GuiSelectWorld)
            NEIClientConfig.reloadSaves();
    }
    lastGui = gui;
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:37,代码来源:ClientHandler.java

示例4: handlePacket

import codechicken.core.ClientUtils; //导入依赖的package包/类
@Override
public void handlePacket(PacketCustom packet, Minecraft mc, INetHandlerPlayClient netHandler) {
    switch (packet.getType()) {
        case 1:
            handleSMPCheck(packet.readUByte(), packet.readString(), mc.theWorld);
            break;
        case 10:
            handleLoginState(packet);
            break;
        case 11:
            handleActionDisabled(packet);
            break;
        case 12:
            handleActionEnabled(packet);
            break;
        case 13:
            ClientHandler.instance().addSMPMagneticItem(packet.readInt(), mc.theWorld);
            break;
        case 14:
            handleGamemode(mc, packet.readUByte());
            break;
        case 21:
            ClientUtils.openSMPGui(packet.readUByte(), new GuiEnchantmentModifier(mc.thePlayer.inventory, mc.theWorld));
            break;
        case 23:
            if (packet.readBoolean())
                ClientUtils.openSMPGui(packet.readUByte(), new GuiExtendedCreativeInv(new ContainerCreativeInv(mc.thePlayer, new ExtendedCreativeInv(null, Side.CLIENT))));
            else
                mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
            break;
        case 24:
            ClientUtils.openSMPGui(packet.readUByte(), new GuiPotionCreator(mc.thePlayer.inventory));
            break;
    }
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:36,代码来源:NEICPH.java

示例5: renderInventoryItem

import codechicken.core.ClientUtils; //导入依赖的package包/类
public void renderInventoryItem(RenderBlocks render, ItemStack item)
{
    int meta = item.getItemDamage();
    
    if(meta == 0)
        meta = ItemMobSpawner.idPig;

    String bossName = BossStatus.bossName;
    int bossTimeout = BossStatus.statusBarTime;
    try
    {
        World world = NEIClientUtils.mc().theWorld;
        ItemMobSpawner.loadSpawners(world);
        TextureUtils.bindAtlas(0);
        render.renderBlockAsItem(Blocks.mob_spawner, 0, 1F);
        GL11.glPushMatrix();
        
        Entity entity = ItemMobSpawner.getEntity(meta);
        entity.setWorld(world);
        float f1 = 0.4375F;
        if(entity.getShadowSize() > 1.5)
            f1 = 0.1F;
        GL11.glRotatef((float) (ClientUtils.getRenderTime()*10), 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-20F, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.4F, 0.0F);
        GL11.glScalef(f1, f1, f1);
        entity.setLocationAndAngles(0, 0, 0, 0.0F, 0.0F);
        RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 0);
        GL11.glPopMatrix();

        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
    }
    catch(Exception e)
    {
        if(Tessellator.instance.isDrawing)
            Tessellator.instance.draw();
    }
    BossStatus.bossName = bossName;
    BossStatus.statusBarTime = bossTimeout;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:44,代码来源:SpawnerRenderer.java

示例6: getSaveName

import codechicken.core.ClientUtils; //导入依赖的package包/类
private static String getSaveName(String worldName) {
    if (Minecraft.getMinecraft().isSingleplayer())
        return "local/" + ClientUtils.getWorldSaveName();

    return "remote/" + ClientUtils.getServerIP().replace(':', '~') + "/" + worldName;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:7,代码来源:NEICPH.java


注:本文中的codechicken.core.ClientUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。