• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EnergyValueRegistryProxy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: updateEntity

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Override
public void updateEntity() {
    super.updateEntity();
    if (!worldObj.isRemote && worldObj.getTotalWorldTime() % type.getSpeed() == 0) {
        if (hasTome()) {
            if (redstoneState.meetsCondition(worldObj, xCoord, yCoord, zCoord)) {
                ItemStack targetItem = inventory[TARGET_SLOT];
                if (EnergyValueRegistryProxy.hasEnergyValue(targetItem) && isStackKnown(targetItem)) {
                    EnergyValue targetValue = EnergyValueRegistryProxy.getEnergyValue(targetItem);
                    for (int i = 2; i < getSizeInventory(); i++) {
                        if (!matchesTarget(i, targetItem))
                            consumeItem(i);
                    }
                    if (storedEnergyValue.compareTo(targetValue) >= 0)
                        createNewItem(targetItem, targetValue);
                }
            }
        } else if (redstoneState.meetsCondition(worldObj, xCoord, yCoord, zCoord)) {
            for (int i = 2; i < getSizeInventory(); i++)
                consumeItem(i);
        }
    }
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:24,代码来源:TileCondenserBase.java


示例2: consumeInventoryForEnergyValue

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public void consumeInventoryForEnergyValue(ItemStack outputItemStack) {
    EnergyValue outputEnergyValue = EnergyValueRegistryProxy.getEnergyValue(outputItemStack);

    if (this.storedEnergyValue.compareTo(outputEnergyValue) >= 0)
        this.storedEnergyValue = new EnergyValue(this.storedEnergyValue.getValue() - outputEnergyValue.getValue());
    else {
        while (this.storedEnergyValue.compareTo(outputEnergyValue) < 0 && this.availableEnergyValue.compareTo(outputEnergyValue) >= 0) {
            for (int i = 0; i < STONE_INDEX; i++) {
                ItemStack stackInSlot = getStackInSlot(i);
                if (stackInSlot != null && EnergyValueRegistryProxy.hasEnergyValue(stackInSlot)) {
                    this.storedEnergyValue = new EnergyValue(this.storedEnergyValue.getValue() + EnergyValueRegistryProxy.getEnergyValue(stackInSlot).getValue());
                    decrStackSize(i, 1);
                }
            }
        }

        if (this.storedEnergyValue.getValue() >= outputEnergyValue.getValue())
            this.storedEnergyValue = new EnergyValue(this.storedEnergyValue.getValue() - outputEnergyValue.getValue());
    }

    updateEnergyValueFromInventory();
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:23,代码来源:InventoryPortableTablet.java


示例3: initEMCValues

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public static void initEMCValues() {
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModItems.greatStar, 1, 0), 8194f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModItems.chargedStar), 73846f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModBlocks.verdantCondenser), 74358f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModBlocks.azureCondenser), 107126f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModBlocks.miniumCondenser), 369270f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModItems.condenserUpgrade, 1, 0), 514f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModItems.condenserUpgrade, 1, 1), 33282f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModItems.condenserUpgrade, 1, 2), 295426f);
    EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ModItems.portableTablet), 8212f);

    AbilityRegistryProxy.setAsNotLearnable(ModBlocks.verdantCondenser);
    AbilityRegistryProxy.setAsNotLearnable(ModBlocks.azureCondenser);
    AbilityRegistryProxy.setAsNotLearnable(ModBlocks.miniumCondenser);
    AbilityRegistryProxy.setAsNotLearnable(ModItems.chargedStar);
    AbilityRegistryProxy.setAsNotLearnable(ModItems.portableTablet);
    AbilityRegistryProxy.setAsNotLearnable(new ItemStack(ModItems.condenserUpgrade, 1, 0));
    AbilityRegistryProxy.setAsNotLearnable(new ItemStack(ModItems.condenserUpgrade, 1, 1));
    AbilityRegistryProxy.setAsNotLearnable(new ItemStack(ModItems.condenserUpgrade, 1, 2));
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:21,代码来源:ModRecipes.java


示例4: preInit

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Mod.EventHandler
void preInit(FMLPreInitializationEvent event) {
    if (Loader.isModLoaded("EE3")) {
        Stopwatch watch = Stopwatch.createStarted();
        AELog.info("Pre Initialization ( started )");

        final IDefinitions definitions = AEApi.instance().definitions();
        final IMaterials materials = definitions.materials();
        final IItems items = definitions.items();
        final IBlocks blocks = definitions.blocks();

        // Register Base AE Materials
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(blocks.skyStone().maybeBlock().get(), 64);                         // Set the same as obsidian
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(materials.certusQuartzCrystal().maybeStack(1).get(), 256);         //
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(materials.certusQuartzCrystalCharged().maybeStack(1).get(), 256);  //
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(materials.matterBall().maybeStack(1).get(), 256);
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(materials.singularity().maybeStack(1).get(), 256000);

        // Non Learnable AE Materials
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(blocks.quartzOre().maybeBlock().get(), 256);
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(blocks.quartzOreCharged().maybeBlock().get(), 256);
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(items.cellCreative().maybeStack(1).get(), 1725);
        AbilityRegistryProxy.setAsNotLearnable(blocks.quartzOre().maybeBlock().get());
        AbilityRegistryProxy.setAsNotLearnable(blocks.quartzOreCharged().maybeBlock().get());
        AbilityRegistryProxy.setAsNotLearnable(items.cellCreative().maybeStack(1).get());

        AELog.info("Pre Initialization ( ended after " + watch.elapsed(TimeUnit.MILLISECONDS) + "ms )");
    } else {
        AELog.info("EE3 not found, not sure why you would add this mod?");
    }
}
 
开发者ID:FireBall1725,项目名称:ae2ee3emcaddon,代码行数:32,代码来源:ae2ee3emcaddon.java


示例5: canInsertItem

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Override
public boolean canInsertItem(int slot, ItemStack stack, int side) {
    if (side == 1) {
        if (slot == TOME_SLOT && getStackInSlot(TOME_SLOT) == null)
            return ItemLib.isTome(stack);
        else if (slot == TARGET_SLOT && getStackInSlot(TARGET_SLOT) == null)
            return isStackKnown(stack);
    } else if (slot > TARGET_SLOT)
        return EnergyValueRegistryProxy.hasEnergyValue(stack);
    return false;
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:12,代码来源:TileCondenserBase.java


示例6: consumeItem

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public EnergyValue consumeItem(int slot) {
    ItemStack stack = getStackInSlot(slot);
    if (stack != null && EnergyValueRegistryProxy.hasEnergyValue(stack)) {
        EnergyValue value = EnergyValueRegistryProxy.getEnergyValue(stack);
        if (value != null && value.getValue() > 0) {
            storedEnergyValue = new EnergyValue(storedEnergyValue.getValue() + value.getValue());
            decrStackSize(slot, 1);
        }
    }
    return storedEnergyValue;
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:12,代码来源:TileCondenserBase.java


示例7: updateEnergyValueFromInventory

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public void updateEnergyValueFromInventory() {
    float newEnergyValue = storedEnergyValue.getValue();
    for (int i = 0; i <= STONE_INDEX; i++) {
        if (inventory[i] != null && EnergyValueRegistryProxy.hasEnergyValue(inventory[i]))
            newEnergyValue += EnergyValueRegistryProxy.getEnergyValueForStack(inventory[i]).getValue();
    }
    this.availableEnergyValue = new EnergyValue(newEnergyValue);
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:9,代码来源:InventoryPortableTablet.java


示例8: addOre

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
private static void addOre(String name, float value) {
    WrappedStack stack = WrappedStack.wrap(new OreStack(name));
    EnergyValue energyValue = new EnergyValue(value);

    EnergyValueRegistryProxy.addPreAssignedEnergyValue(stack, energyValue);
}
 
开发者ID:modmuss50,项目名称:EE3-Compatiblity,代码行数:7,代码来源:IC2EE3.java


示例9: addStack

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
private static void addStack(ItemStack itemStack, float value) {
    WrappedStack stack = WrappedStack.wrap(itemStack);
    EnergyValue energyValue = new EnergyValue(value);

    EnergyValueRegistryProxy.addPreAssignedEnergyValue(stack, energyValue);
}
 
开发者ID:modmuss50,项目名称:EE3-Compatiblity,代码行数:7,代码来源:IC2EE3.java


示例10: getWailaBody

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Override
public List<String> getWailaBody(Entity entity, List<String> tooltip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
    if (!ModConfig.ee3Entity)
        return tooltip;
    EntityPlayer player = accessor.getPlayer();
    if (entity != null && player != null) {
        EnergyValue entityValue = null;
        EnergyValue itemEnergy = null;
        ItemStack entityItem = null;
        if (entity instanceof EntityPainting)
            entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.painting));
        else if (entity instanceof EntityItemFrame) {
            entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.item_frame));
            if (ModConfig.showItemFrameEMC) {
                ItemStack stack = ((EntityItemFrame) entity).getDisplayedItem();
                if (stack != null && stack.getItem() != null && EnergyValueRegistryProxy.hasEnergyValue(stack))
                    itemEnergy = EnergyValueRegistryProxy.getEnergyValue(stack);
            }
        } else if (entity instanceof EntityMinecart) {
            if (entity instanceof EntityMinecartChest)
                entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.chest_minecart));
            else if (entity instanceof EntityMinecartFurnace)
                entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.furnace_minecart));
            else if (entity instanceof EntityMinecartTNT)
                entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.tnt_minecart));
            else if (entity instanceof EntityMinecartHopper)
                entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.hopper_minecart));
            else if (entity instanceof EntityMinecartEmpty)
                entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.minecart));
        } else if (entity instanceof EntityBoat)
            entityValue = EnergyValueRegistryProxy.getEnergyValue(entityItem = new ItemStack(Items.boat));

        if (entityItem != null) {
            boolean isKnown = WIIEMC.proxy.doesPlayerKnow(entityItem);
            boolean canBeLearned = WIIEMC.proxy.canPlayerLearn(entityItem);
            if (entityValue != null && entityValue.getValue() > 0f) {
                if (ModConfig.showEMC) {
                    String tip = StatCollector.translateToLocal(ModLang.ENERGY_VALUE_EE3);
                    String energy = energyValueDecimalFormat.format(entityValue.getValue());
                    tooltip.add(String.format(tip, energy));
                }
                if (itemEnergy != null && ModConfig.showItemFrameEMC) {
                    String itemTip = StatCollector.translateToLocal(ModLang.ITEMFRAME_ITEM_ENERGY_EE3);
                    String itemValue = energyValueDecimalFormat.format(itemEnergy.getValue());
                    tooltip.add(String.format(itemTip, itemValue));
                }
            } else {
                if (ModConfig.showNoEMC)
                    tooltip.add(StatCollector.translateToLocal(ModLang.NO_ENERGY_EE3));
            }

            if (canBeLearned) {
                if (ModConfig.showCanLearn)
                    tooltip.add(StatCollector.translateToLocal(ModLang.UNKNOWN));
            } else {
                if (isKnown && ModConfig.showIsLearned)
                    tooltip.add(StatCollector.translateToLocal(ModLang.IS_KNOWN));
                else if (ModConfig.showCantLearn)
                    tooltip.add(StatCollector.translateToLocal(ModLang.NOT_LEARNABLE));
            }
        }
    }
    return tooltip;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:65,代码来源:EntityEMCDataProvider.java


示例11: getWailaBody

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> tooltip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
    if (!ModConfig.ee3Block)
        return tooltip;
    Block block = accessor.getBlock();
    int meta = accessor.getMetadata();
    MovingObjectPosition pos = accessor.getPosition();
    if (block != null) {
        ItemStack stack = new ItemStack(block, 1, meta);
        boolean isKnown = WIIEMC.proxy.doesPlayerKnow(stack);
        boolean canBeLearned = WIIEMC.proxy.canPlayerLearn(stack);
        EnergyValue value = EnergyValueRegistryProxy.getEnergyValue(stack);

        if (value == null) {
            Item item;
            if (block == Blocks.redstone_wire)
                item = Items.redstone;
            else if (block instanceof BlockBush)
                item = block.getItem(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ);
            else if (block == Blocks.wooden_door)
                item = Items.wooden_door;
            else if (block == Blocks.iron_door)
                item = Items.iron_door;
            else
                item = Item.getItemFromBlock(block);

            if (item != null) {
                stack = new ItemStack(item);
                value = EnergyValueRegistryProxy.getEnergyValue(stack);
                isKnown = WIIEMC.proxy.doesPlayerKnow(stack);
                canBeLearned = WIIEMC.proxy.canPlayerLearn(stack);
            }
        }
        if (value != null && value.getValue() > 0f) {
            if (ModConfig.showEMC) {
                String tip = StatCollector.translateToLocal(ModLang.ENERGY_VALUE_EE3);
                String energy = energyValueDecimalFormat.format(value.getValue());
                tooltip.add(String.format(tip, energy));
            }
        } else {
            if (ModConfig.showNoEMC)
                tooltip.add(StatCollector.translateToLocal(ModLang.NO_ENERGY_EE3));
        }

        if (canBeLearned && value != null) {
            if (ModConfig.showCanLearn)
                tooltip.add(StatCollector.translateToLocal(ModLang.UNKNOWN));
        } else {
            if (isKnown && ModConfig.showIsLearned)
                tooltip.add(StatCollector.translateToLocal(ModLang.IS_KNOWN));
            else if (ModConfig.showCantLearn)
                tooltip.add(StatCollector.translateToLocal(ModLang.NOT_LEARNABLE));
        }
    }
    return tooltip;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:57,代码来源:BlockEMCDataProvider.java


示例12: EnergyValueEvent

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public EnergyValueEvent(Object object, EnergyValueRegistryProxy.Phase phase, EntityPlayer entityPlayer)
{
    this.object = object;
    this.phase = phase;
    this.entityPlayer = entityPlayer;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:7,代码来源:EnergyValueEvent.java


示例13: SetEnergyValueEvent

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public SetEnergyValueEvent(Object object, EnergyValue newEnergyValue, EnergyValueRegistryProxy.Phase phase, EntityPlayer entityPlayer)
{
    super(object, phase, entityPlayer);
    this.newEnergyValue = newEnergyValue;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:6,代码来源:EnergyValueEvent.java


示例14: RemoveEnergyValueEvent

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
public RemoveEnergyValueEvent(Object object, EnergyValueRegistryProxy.Phase phase, EntityPlayer entityPlayer)
{
    super(object, phase, entityPlayer);
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:5,代码来源:EnergyValueEvent.java


示例15: isItemValid

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Override
public boolean isItemValid(ItemStack itemStack) {
    return EnergyValueRegistryProxy.hasEnergyValue(itemStack) && AbilityRegistryProxy.isRecoverable(itemStack);
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:5,代码来源:SlotTabletInput.java


示例16: mergeTransmutatedItemStack

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
protected boolean mergeTransmutatedItemStack(EntityPlayer entityPlayer, Slot transmutationOutputSlot, ItemStack itemStack, int slotMin, int slotMax, boolean ascending) {
    if (this.tabletInventory.getAvailableEnergyValue().compareTo(EnergyValueRegistryProxy.getEnergyValue(itemStack)) < 0)
        return false;

    transmutationOutputSlot.onPickupFromSlot(entityPlayer, itemStack);

    boolean slotFound = false;
    int currentSlotIndex = ascending ? slotMax - 1 : slotMin;

    Slot slot;
    ItemStack stackInSlot;

    if (itemStack.isStackable()) {
        while (itemStack.stackSize > 0 && (!ascending && currentSlotIndex < slotMax || ascending && currentSlotIndex >= slotMin)) {
            slot = (Slot) this.inventorySlots.get(currentSlotIndex);
            stackInSlot = slot.getStack();

            if (slot.isItemValid(itemStack) && ItemLib.equalsIgnoreStackSize(itemStack, stackInSlot)) {
                int combinedStackSize = stackInSlot.stackSize + itemStack.stackSize;
                int slotStackSizeLimit = Math.min(stackInSlot.getMaxStackSize(), slot.getSlotStackLimit());

                if (combinedStackSize <= slotStackSizeLimit) {
                    itemStack.stackSize = 0;
                    stackInSlot.stackSize = combinedStackSize;
                    slot.onSlotChanged();
                    slotFound = true;
                } else if (stackInSlot.stackSize < slotStackSizeLimit) {
                    itemStack.stackSize -= slotStackSizeLimit - stackInSlot.stackSize;
                    stackInSlot.stackSize = slotStackSizeLimit;
                    slot.onSlotChanged();
                    slotFound = true;
                }
            }

            currentSlotIndex += ascending ? -1 : 1;
        }
    }

    if (itemStack.stackSize > 0) {
        currentSlotIndex = ascending ? slotMax - 1 : slotMin;

        while (!ascending && currentSlotIndex < slotMax || ascending && currentSlotIndex >= slotMin) {
            slot = (Slot) this.inventorySlots.get(currentSlotIndex);
            stackInSlot = slot.getStack();

            if (slot.isItemValid(itemStack) && stackInSlot == null) {
                slot.putStack(ItemUtil.cloneStack(itemStack, Math.min(itemStack.stackSize, slot.getSlotStackLimit())));
                slot.onSlotChanged();

                if (slot.getStack() != null) {
                    itemStack.stackSize = 0;
                    slotFound = true;
                }

                break;
            }

            currentSlotIndex += ascending ? -1 : 1;
        }
    }
    itemStack.stackSize = 1;
    return slotFound;
}
 
开发者ID:Lomeli12,项目名称:SimpleCondenser,代码行数:64,代码来源:ContainerPortableTablet.java


示例17: preInit

import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy; //导入依赖的package包/类
@Override
public void preInit(){
    for(ItemStack seed : ItemPlasticPlants.getBlockToSeedMap().values()) {
        EnergyValueRegistryProxy.addPreAssignedEnergyValue(seed, 16);
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:7,代码来源:EE3.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HeatRegistry类代码示例发布时间:2022-05-23
下一篇:
Java TextFormater类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap