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


Java GCCoreUtil类代码示例

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


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

示例1: onActivated

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
public boolean onActivated(EntityPlayer entityPlayer)
{
    if (this.worldObj.isRemote)
    {
        return false;
    }

    EnumStatus enumstatus = this.sleepInBedAt(entityPlayer, this.xCoord, this.yCoord, this.zCoord);

    switch (enumstatus)
    {
    case OK:
        ((EntityPlayerMP) entityPlayer).playerNetServerHandler.setPlayerLocation(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, entityPlayer.rotationYaw, entityPlayer.rotationPitch);
        GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMars(EnumSimplePacketMars.C_BEGIN_CRYOGENIC_SLEEP, new Object[] { this.xCoord, this.yCoord, this.zCoord }), (EntityPlayerMP) entityPlayer);
        return true;
    case NOT_POSSIBLE_NOW:
        entityPlayer.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.cryogenic.chat.cantUse", GCPlayerStats.get((EntityPlayerMP) entityPlayer).cryogenicChamberCooldown / 20)));
        return false;
    default:
        return false;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:TileEntityCryogenicChamber.java

示例2: drawGuiContainerForegroundLayer

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
    this.fontRendererObj.drawString(this.compressor.getInventoryName(), 8, 10, 4210752);
    GCCoreUtil.drawStringRightAligned(GCCoreUtil.translate("gui.message.in.name") + ":", 99, 26, 4210752, this.fontRendererObj);
    GCCoreUtil.drawStringRightAligned(GCCoreUtil.translate("gui.message.in.name") + ":", 99, 38, 4210752, this.fontRendererObj);
    String status = GCCoreUtil.translate("gui.message.status.name") + ": " + this.getStatus();
    this.fontRendererObj.drawString(status, this.xSize / 2 - this.fontRendererObj.getStringWidth(status) / 2, 50, 4210752);
    status = GCCoreUtil.translate("gui.oxygenUse.desc") + ": " + TileEntityOxygenCompressor.TANK_TRANSFER_SPEED * 20 + GCCoreUtil.translate("gui.perSecond");
    this.fontRendererObj.drawString(status, this.xSize / 2 - this.fontRendererObj.getStringWidth(status) / 2, 60, 4210752);
    //		status = ElectricityDisplay.getDisplay(this.compressor.ueWattsPerTick * 20, ElectricUnit.WATT);
    //		this.fontRendererObj.drawString(status, this.xSize / 2 - this.fontRendererObj.getStringWidth(status) / 2, 70, 4210752);
    //		status = ElectricityDisplay.getDisplay(this.compressor.getVoltage(), ElectricUnit.VOLTAGE);
    //		this.fontRendererObj.drawString(status, this.xSize / 2 - this.fontRendererObj.getStringWidth(status) / 2, 80, 4210752);
    this.fontRendererObj.drawString(GCCoreUtil.translate("container.inventory"), 8, this.ySize - 104 + 17, 4210752);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:GuiOxygenCompressor.java

示例3: entityInit

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
protected void entityInit()
{
    super.entityInit();
    this.dataWatcher.addObject(18, new Float(this.getHealth()));
    this.dataWatcher.addObject(19, new Float(this.colorRed));
    this.dataWatcher.addObject(20, new Float(this.colorGreen));
    this.dataWatcher.addObject(21, new Float(this.colorBlue));
    this.dataWatcher.addObject(22, new Integer(this.age));
    this.dataWatcher.addObject(23, "");
    this.dataWatcher.addObject(24, new Integer(this.favFoodID));
    this.dataWatcher.addObject(25, new Float(this.attackDamage));
    this.dataWatcher.addObject(26, new Integer(this.kills));
    this.dataWatcher.addObject(27, new ItemStack(Blocks.stone));
    this.dataWatcher.addObject(28, "");
    this.setName(GCCoreUtil.translate("gui.message.unnamed.name"));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:EntitySlimeling.java

示例4: getStatus

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
private String getStatus()
{
    if (this.compressor.getStackInSlot(0) == null || !(this.compressor.getStackInSlot(0).getItem() instanceof ItemOxygenTank))
    {
        return EnumColor.DARK_RED + GCCoreUtil.translate("gui.status.missingtank.name");
    }

    if (this.compressor.getStackInSlot(0) != null && this.compressor.getStackInSlot(0).getItemDamage() == 0)
    {
        return EnumColor.DARK_RED + GCCoreUtil.translate("gui.status.fulltank.name");
    }

    if (this.compressor.storedOxygen < 1.0D)
    {
        return EnumColor.DARK_RED + GCCoreUtil.translate("gui.status.missingoxygen.name");
    }

    return this.compressor.getGUIstatus();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:GuiOxygenCompressor.java

示例5: getGUIstatus

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
public String getGUIstatus()
{
    if (this.getEnergyStoredGC() == 0)
    {
        return EnumColor.DARK_RED + GCCoreUtil.translate("gui.status.missingpower.name");
    }

    if (RedstoneUtil.isBlockReceivingRedstone(this.worldObj, this.xCoord, this.yCoord, this.zCoord))
    {
        return EnumColor.DARK_RED + GCCoreUtil.translate("gui.status.off.name");
    }

    if (this.getDisabled(0))
    {
        return EnumColor.ORANGE + GCCoreUtil.translate("gui.status.ready.name");
    }

    if (this.getEnergyStoredGC() < this.storage.getMaxExtract())
    {
        return EnumColor.ORANGE + GCCoreUtil.translate("gui.status.missingpower.name");
    }

   	return EnumColor.DARK_GREEN + GCCoreUtil.translate("gui.status.active.name");
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:TileBaseElectricBlock.java

示例6: drawGuiContainerBackgroundLayer

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
    GL11.glPushMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture(GuiLaunchController.launchControllerGui);
    final int var5 = (this.width - this.xSize) / 2;
    final int var6 = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);

    List<String> electricityDesc = new ArrayList<String>();
    electricityDesc.add(GCCoreUtil.translate("gui.energyStorage.desc.0"));
    EnergyDisplayHelper.getEnergyDisplayTooltip(this.launchController.getEnergyStoredGC(), this.launchController.getMaxEnergyStoredGC(), electricityDesc);
    this.electricInfoRegion.tooltipStrings = electricityDesc;

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    if (this.launchController.getEnergyStoredGC() > 0)
    {
        int scale = this.launchController.getScaledElecticalLevel(54);
        this.drawTexturedModalRect(var5 + 99, var6 + 114, 176, 0, Math.min(scale, 54), 7);
    }

    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:GuiLaunchController.java

示例7: initGui

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
    super.initGui();
    List<String> schematicSlotDesc = new ArrayList<String>();
    GuiButton nextButton;
    schematicSlotDesc.add(GCCoreUtil.translate("gui.newSchematic.slot.desc.0"));
    schematicSlotDesc.add(GCCoreUtil.translate("gui.newSchematic.slot.desc.1"));
    schematicSlotDesc.add(GCCoreUtil.translate("gui.newSchematic.slot.desc.2"));
    schematicSlotDesc.add(GCCoreUtil.translate("gui.newSchematic.slot.desc.3"));
    this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 79, (this.height - this.ySize) / 2, 18, 18, schematicSlotDesc, this.width, this.height, this));
    this.buttonList.add(new GuiButton(0, this.width / 2 - 130, this.height / 2 - 30 + 27 - 12, 40, 20, GCCoreUtil.translate("gui.button.back.name")));
    this.buttonList.add(nextButton = new GuiButton(1, this.width / 2 - 130, this.height / 2 - 30 + 27 + 12, 40, 20, GCCoreUtil.translate("gui.button.next.name")));
    this.buttonList.add(new GuiButton(2, this.width / 2 - 92 / 2, this.height / 2 - 52, 92, 20, GCCoreUtil.translate("gui.button.unlockschematic.name")));
    nextButton.enabled = false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:GuiSchematicInput.java

示例8: drawGuiContainerForegroundLayer

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
/**
     * Draw the foreground layer for the GuiContainer (everything in front of
     * the items)
     */
    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
        this.fontRendererObj.drawString(this.tileEntity.getInventoryName(), 45, 6, 4210752);
        String displayText = "";

        if (this.tileEntity.processTicks > 0)
        {
            displayText = EnumColor.BRIGHT_GREEN + GCCoreUtil.translate("gui.status.running.name");
        }
        else
        {
            displayText = EnumColor.ORANGE + GCCoreUtil.translate("gui.status.idle.name");
        }

        this.fontRendererObj.drawString(GCCoreUtil.translate("gui.message.status.name") + ": " + displayText, 97, 52, 4210752);
//		this.fontRendererObj.drawString("" + this.tileEntity.storage.getMaxExtract(), 97, 56, 4210752);
//		this.fontRendererObj.drawString("Voltage: " + (int) (this.tileEntity.getVoltage() * 1000.0F), 97, 68, 4210752);
        this.fontRendererObj.drawString(GCCoreUtil.translate("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
    }
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:GuiElectricFurnace.java

示例9: handleTooltip

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
    Point mousePos = getMousePosition();
	try {
    	Class<GuiContainer> clazz = GuiContainer.class;       	
    	mousePos.x -= (Integer) clazz.getField("field_147003_i").get(gui);
    	mousePos.y -= (Integer) clazz.getField("field_147009_r").get(gui);
	}  catch (Exception ee) { ee.printStackTrace(); }

    if (mousePos.x < 23 && mousePos.x > 6 && mousePos.y < 78 && mousePos.y > 39)
    	currenttip.add(GCCoreUtil.translate("fluid.hydrogen"));
    else if (mousePos.x < 44 && mousePos.x > 27 && mousePos.y < 60 && mousePos.y > 39)
		currenttip.add(GCCoreUtil.translate("gas.carbondioxide.name"));
    
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:MethaneSynthesizerRecipeHandler.java

示例10: addInformation

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
    if (par2EntityPlayer.worldObj.isRemote)
    {
        switch (par1ItemStack.getItemDamage())
        {
        case 0:
            par3List.add(GCCoreUtil.translate("schematic.rocketT3.name"));
            break;
        case 1:
            par3List.add(GCCoreUtil.translate("schematic.cargoRocket.name"));
            break;
        case 2:
            par3List.add(GCCoreUtil.translate("schematic.astroMiner.name"));
            break;
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:ItemSchematicTier2.java

示例11: getReceivingStatus

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public String getReceivingStatus()
{
    if (!this.addressValid)
    {
        return EnumColor.RED + GCCoreUtil.translate("gui.message.invalidAddress.name");
    }

    if (this.getEnergyStoredGC() <= 0.0F)
    {
        return EnumColor.RED + GCCoreUtil.translate("gui.message.noEnergy.name");
    }

    if (this.getEnergyStoredGC() <= ENERGY_USE_ON_TELEPORT)
    {
        return EnumColor.RED + GCCoreUtil.translate("gui.message.notEnoughEnergy.name");
    }

    if (this.getDisabled(0))
    {
        return EnumColor.ORANGE + GCCoreUtil.translate("gui.status.disabled.name");
    }

    return EnumColor.BRIGHT_GREEN + GCCoreUtil.translate("gui.message.receivingActive.name");
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:TileEntityShortRangeTelepad.java

示例12: drawGuiContainerForegroundLayer

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
        this.fontRendererObj.drawString(this.tileEntity.getInventoryName(), 10, 6, 4210752);
        String displayText;

        if (this.tileEntity.processTicks > 0)
        {
            displayText = EnumColor.BRIGHT_GREEN + GCCoreUtil.translate("gui.status.running.name");
        }
        else
        {
            displayText = EnumColor.ORANGE + GCCoreUtil.translate("gui.status.idle.name");
        }

        String str = GCCoreUtil.translate("gui.message.status.name") + ": " + displayText;
        this.fontRendererObj.drawString(str, 120 - this.fontRendererObj.getStringWidth(str) / 2, 75, 4210752);
        this.fontRendererObj.drawString(GCCoreUtil.translate("container.inventory"), 8, this.ySize - 93, 4210752);
//		str = "" + this.tileEntity.storage.getMaxExtract();
//		this.fontRendererObj.drawString(str, 120 - this.fontRendererObj.getStringWidth(str) / 2, 85, 4210752);
//		//		str = ElectricityDisplay.getDisplay(this.tileEntity.getVoltage(), ElectricUnit.VOLTAGE);
//		this.fontRendererObj.drawString(str, 120 - this.fontRendererObj.getStringWidth(str) / 2, 95, 4210752);
    }
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:GuiElectricIngotCompressor.java

示例13: getShiftDescription

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@Override
public String getShiftDescription(int meta)
{
    if (this == AsteroidBlocks.blockWalkway)
    {
        return GCCoreUtil.translate("tile.walkway.description");
    }
    else if (this == AsteroidBlocks.blockWalkwayWire)
    {
        return GCCoreUtil.translate("tile.walkwayAluminumWire.description");
    }
    else if (this == AsteroidBlocks.blockWalkwayOxygenPipe)
    {
        return GCCoreUtil.translate("tile.walkwayOxygenPipe.description");
    }

    return "";
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:BlockWalkway.java

示例14: onPlayerRemoval

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
public static void onPlayerRemoval(String player, SpaceRace race)
{
    for (String member : race.getPlayerNames())
    {
        EntityPlayerMP memberObj = PlayerUtil.getPlayerForUsernameVanilla(MinecraftServer.getServer(), member);

        if (memberObj != null)
        {
            memberObj.addChatMessage(new ChatComponentText(EnumColor.DARK_AQUA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.removeSuccess", EnumColor.RED + player + EnumColor.DARK_AQUA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
        }
    }

    List<String> playerList = new ArrayList<String>();
    playerList.add(player);
    SpaceRace newRace = SpaceRaceManager.addSpaceRace(new SpaceRace(playerList, SpaceRace.DEFAULT_NAME, new FlagData(48, 32), new Vector3(1, 1, 1)));
    EntityPlayerMP playerToRemove = PlayerUtil.getPlayerBaseServerFromPlayerUsername(player, true);

    if (playerToRemove != null)
    {
        SpaceRaceManager.sendSpaceRaceData(playerToRemove, newRace);
        SpaceRaceManager.sendSpaceRaceData(playerToRemove, race);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:SpaceRaceManager.java

示例15: initGui

import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
    super.initGui();
    List<String> electricityDesc = new ArrayList<String>();
    electricityDesc.add(GCCoreUtil.translate("gui.energyStorage.desc.0"));
    electricityDesc.add(EnumColor.YELLOW + GCCoreUtil.translate("gui.energyStorage.desc.1") + ((int) Math.floor(this.cargoUnloader.getEnergyStoredGC()) + " / " + (int) Math.floor(this.cargoUnloader.getMaxEnergyStoredGC())));
    this.electricInfoRegion.tooltipStrings = electricityDesc;
    this.electricInfoRegion.xPosition = (this.width - this.xSize) / 2 + 107;
    this.electricInfoRegion.yPosition = (this.height - this.ySize) / 2 + 101;
    this.electricInfoRegion.parentWidth = this.width;
    this.electricInfoRegion.parentHeight = this.height;
    this.infoRegions.add(this.electricInfoRegion);
    List<String> batterySlotDesc = new ArrayList<String>();
    batterySlotDesc.add(GCCoreUtil.translate("gui.batterySlot.desc.0"));
    batterySlotDesc.add(GCCoreUtil.translate("gui.batterySlot.desc.1"));
    this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 9, (this.height - this.ySize) / 2 + 26, 18, 18, batterySlotDesc, this.width, this.height, this));
    this.buttonList.add(this.buttonLoadItems = new GuiButton(0, this.width / 2 - 1, this.height / 2 - 23, 76, 20, GCCoreUtil.translate("gui.button.unloaditems.name")));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:GuiCargoUnloader.java


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