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


Java Optional.Method方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.Optional.Method方法的典型用法代码示例。如果您正苦于以下问题:Java Optional.Method方法的具体用法?Java Optional.Method怎么用?Java Optional.Method使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.common.Optional的用法示例。


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

示例1: onIGWAction

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = ModIds.IGWMOD)
private void onIGWAction() {
    int x = lastMouseX;
    int y = lastMouseY;

    IProgWidget hoveredWidget = programmerUnit.getHoveredWidget(x, y);
    if(hoveredWidget != null) {
        WikiRegistry.getWikiHooks().showWikiGui("pneumaticcraft:progwidget/" + CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, hoveredWidget.getWidgetString()));
    }

    for(IProgWidget widget : visibleSpawnWidgets) {
        if(widget != draggingWidget && x - guiLeft >= widget.getX() && y - guiTop >= widget.getY() && x - guiLeft <= widget.getX() + widget.getWidth() / 2 && y - guiTop <= widget.getY() + widget.getHeight() / 2) {
            WikiRegistry.getWikiHooks().showWikiGui("pneumaticcraft:progwidget/" + CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, widget.getWidgetString()));
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:17,代码来源:GuiProgrammer.java

示例2: checkForInterface

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = ModIds.AE2)
private boolean checkForInterface(){
    if(isPlacedOnInterface()) {
        TileEntity te = getTileEntity();
        if(te instanceof IGridHost) {
            if(((IGridHost)te).getGridNode(null) == null) return true;
            if(getGridNode(null) == null) return true;
            try {
                AEApi.instance().grid().createGridConnection(((IGridHost)te).getGridNode(null), getGridNode(null));
            } catch(FailedConnectionException e) {
                Log.error("Couldn't connect to an ME Interface!");
                e.printStackTrace();
            }
        }
    }
    return false;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:18,代码来源:SemiBlockRequester.java

示例3: copyPrepareGasRender

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = "mekanism")
public HybridFluidRenderer<T> copyPrepareGasRender(int width, int height, int capacityMb, boolean showCapacity, @Nullable IDrawable overlay) {
    HybridFluidRenderer<T> copy = new HybridFluidRenderer<>();
    copy.gasRenderer = new GasStackRenderer(capacityMb, showCapacity, width, height, overlay);
    copy.fluidStackRenderer = this.fluidStackRenderer;
    return copy;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:8,代码来源:HybridFluidRenderer.java

示例4: notifyNetworkOfCraftingChange

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = ModIds.AE2)
private void notifyNetworkOfCraftingChange(){
    if(gridNode != null) {
        IGrid grid = ((IGridNode)gridNode).getGrid();
        if(grid != null) grid.postEvent(new MENetworkCraftingPatternChange(this, (IGridNode)gridNode));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:SemiBlockRequester.java

示例5: init

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = "immersiveengineering")
public static void init()
{
	if (Loader.isModLoaded("mysticalagriculture"))
	{
		BelljarHandler.registerBasicItemFertilizer(new ItemStack(ModItems.itemMysticalFertilizer), 2.25f);
	}
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:9,代码来源:IntegrationIEngineering.java

示例6: isPrioritized

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public boolean isPrioritized(IAEItemStack arg0){
    return false;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:SemiBlockRequester.java

示例7: getSlot

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public int getSlot(){
    return 0;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:SemiBlockRequester.java

示例8: securityBreak

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public void securityBreak(){
    drop();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:SemiBlockRequester.java

示例9: readMekGasData

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = "mekanism")
private void readMekGasData(NBTTagCompound compound) {
    if(this.tank instanceof HybridGasTank) {
        ((HybridGasTank) this.tank).readGasFromNBT(compound);
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:7,代码来源:TileFluidTank.java

示例10: updateWatcher

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public void updateWatcher(ICraftingWatcher watcher){
    craftingWatcher = watcher;
    updateProvidingItems();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:SemiBlockRequester.java

示例11: writeGasTag

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = "mekanism")
private static void writeGasTag(HybridTank tank, NBTTagCompound compound) {
    if(tank instanceof HybridGasTank) {
        ((HybridGasTank) tank).writeGasToNBT(compound);
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:7,代码来源:CopyHandlerHelper.java

示例12: isBusy

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public boolean isBusy(){
    return true;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:SemiBlockRequester.java

示例13: emitsEnergyTo

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = "ic2")
public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing side) {
    return true;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:6,代码来源:TileEnergyOutputHatch.java

示例14: getSourceTier

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = "ic2")
public int getSourceTier() {
    return size.energyTier;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:6,代码来源:TileEnergyOutputHatch.java

示例15: preInit

import net.minecraftforge.fml.common.Optional; //导入方法依赖的package包/类
@Optional.Method(modid = "thermalexpansion")
	public static void preInit()
	{
//		ThermalExpansionHelper.addCompressionFuel("liquid_butter", 64000);
	}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:6,代码来源:IntegrationThermal.java


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