本文整理汇总了Java中ic2.api.recipe.RecipeOutput类的典型用法代码示例。如果您正苦于以下问题:Java RecipeOutput类的具体用法?Java RecipeOutput怎么用?Java RecipeOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecipeOutput类属于ic2.api.recipe包,在下文中一共展示了RecipeOutput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: scan
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public void scan() {
Map<IRecipeInput, RecipeOutput> recipeMap = Maps.newHashMap();
recipeMap.putAll(Recipes.metalformerCutting.getRecipes());
recipeMap.putAll(Recipes.metalformerExtruding.getRecipes());
recipeMap.putAll(Recipes.metalformerRolling.getRecipes());
for (Map.Entry<IRecipeInput, RecipeOutput> entry : recipeMap.entrySet()) {
IStackWrapper input = IC2ClassHelper.convert(entry.getKey());
for (ItemStack itemStack : entry.getValue().items) {
if (input instanceof VanillaStackWrapper) {
addRecipe(new VanillaStackWrapper(itemStack), (VanillaStackWrapper) input);
} else if (input instanceof OreStackWrapper) {
for (ItemStack oreStack : OreDictionary.getOres(((OreStackWrapper) input).getOreTag())) {
addRecipe(new VanillaStackWrapper(itemStack), new VanillaStackWrapper(oreStack));
}
}
}
}
}
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:21,代码来源:IC2MetalFormerScanner.java
示例2: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack input, boolean consume) {
if(ImmibisCore.areItemsEqual(input, Ic2Items.scrap)) {
if(input.stackSize < 9)
return null;
if(consume)
input.stackSize -= 9;
return scrapbox_out;
}
if(!consume)
return scrap_out;
input.stackSize--;
if(Recipes.recyclerBlacklist.contains(input))
return null_out;
return worldObj.rand.nextInt(8) == 0 ? scrap_out : null_out;
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:18,代码来源:TileEntityAdvancedRecycler.java
示例3: addEntryToMap
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
private static void addEntryToMap(Entry<IRecipeInput, RecipeOutput> entry)
{
List<ItemStack> recipeStackOutputs = entry.getValue().items;
if (!(recipeStackOutputs.size() > 1))
{
ItemStack recipeOutput = recipeStackOutputs.get(0);
if (recipeOutput != null)
{
WrappedStack stackOutput = getWrappedStack(recipeOutput);
List<ItemStack> recipeStackInputs = entry.getKey().getInputs();
for (ItemStack recipeInput : recipeStackInputs)
{
if (recipeInput != null)
{
recipeInput.stackSize = entry.getKey().getAmount();
WrappedStack stackInput = new WrappedStack(recipeInput);
Ic2Recipes.put(stackOutput, Arrays.asList(stackInput));
}
}
}
}
}
开发者ID:Dynious,项目名称:EnergyFromMatter,代码行数:23,代码来源:RecipesIC2.java
示例4: processRecipes
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
private void processRecipes(final IMachineRecipeManager manager) {
for (final Entry<IRecipeInput, RecipeOutput> e : manager.getRecipes().entrySet()) {
final IC2MachineRecipeAdaptor adaptor = new IC2MachineRecipeAdaptor(e);
final ItemStack input = RecipeDecomposition.getInput(adaptor);
if (!ItemRegistry.isRecipeIgnored(input)) {
final List<ItemStack> output = RecipeDecomposition.decompose(adaptor);
recycler.input(input).useRecipe(output).save();
}
}
}
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:11,代码来源:ModIndustrialCraft.java
示例5: IC2MachineRecipeAdaptor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
public IC2MachineRecipeAdaptor(final Entry<IRecipeInput, RecipeOutput> entry) {
this(entry.getValue(), entry.getKey());
}
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:4,代码来源:IC2MachineRecipeAdaptor.java
示例6: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack itemStack, boolean b) {
return new RecipeOutput(new NBTTagCompound(), getRecipePart(itemStack).output);
}
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:5,代码来源:RecipeBase.java
示例7: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack input, boolean consume) {
return Recipes.metalformerExtruding.getOutputFor(input, consume);
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:5,代码来源:TileEntityAdvancedExtruder.java
示例8: updateEntity
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public void updateEntity() {
super.updateEntity();
if(worldObj.isRemote) return;
if(exploding)
{
worldObj.newExplosion(null, xCoord+0.5, yCoord+0.5, zCoord+0.5, 2.0f, false, true);
return;
}
waterAmount -= (speed * 5 / MAX_SPEED);
if(waterAmount < 0)
waterAmount = 0;
ItemStack input = inv.getStackInSlot(SLOT_IN);
boolean spinUp;
boolean isRunning = false;
RecipeOutput output = Recipes.oreWashing.getOutputFor(input, false);
if(output != null && waterAmount >= WATER_PER_OP) {
ItemStack out1 = output.items.size() > 0 ? output.items.get(0) : null;
ItemStack out2 = output.items.size() > 1 ? output.items.get(1) : null;
ItemStack out3 = output.items.size() > 2 ? output.items.get(2) : null;
if(fitsInSlot(out1, SLOT_OUT1) && fitsInSlot(out2, SLOT_OUT2) && fitsInSlot(out3, SLOT_OUT3) && storedEnergy >= AdvancedMachines.runningEUPerTick_washer) {
spinUp = true;
progress += speed;
isRunning = true;
if(progress >= MAX_PROGRESS) {
progress -= MAX_PROGRESS;
waterAmount -= WATER_PER_OP;
Recipes.oreWashing.getOutputFor(input, true);
if(input.stackSize == 0)
inv.setInventorySlotContents(SLOT_IN, null);
addToSlot(out1, SLOT_OUT1);
addToSlot(out2, SLOT_OUT2);
addToSlot(out3, SLOT_OUT3);
}
} else {
spinUp = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
progress = 0;
}
} else {
spinUp = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
progress = 0;
}
if(spinUp || isRunning) {
int energyReq = isRunning ? AdvancedMachines.runningEUPerTick_washer : AdvancedMachines.idleEUPerTick_washer;
if(storedEnergy >= energyReq) {
storedEnergy -= energyReq;
speed += spinUpRate;
if(speed > MAX_SPEED)
speed = MAX_SPEED;
spinUp = true;
} else
spinUp = false;
}
if(!spinUp) {
speed -= spinDownRate;
if(speed <= 0)
speed = 0;
}
if(visuallyActive != (speed > 0)) {
visuallyActive = (speed > 0);
resendDescriptionPacket();
}
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:72,代码来源:TileEntityAdvancedWasher.java
示例9: updateEntity
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public void updateEntity() {
super.updateEntity();
if(worldObj.isRemote) return;
waterAmount -= (int)(speed * WATER_PER_TICK / (double)MAX_SPEED + worldObj.rand.nextDouble());
if(waterAmount < 0)
waterAmount = 0;
if(waterAmount == 0)
speed = 0;
ItemStack input = inv.getStackInSlot(SLOT_IN);
boolean spinUp;
boolean isRunning = false;
RecipeOutput output = Recipes.metalformerCutting.getOutputFor(input, false);
if(output != null && waterAmount >= WATER_PER_OP && output.items.size() == 1) {
ItemStack out = output.items.get(0);
ItemStack inOutSlot = inv.getStackInSlot(SLOT_OUT);
if(inOutSlot == null || (inOutSlot.stackSize + out.stackSize <= inOutSlot.getMaxStackSize()) && ImmibisCore.areItemsEqual(inOutSlot, out)) {
spinUp = true;
progress += speed;
isRunning = true;
if(progress >= MAX_PROGRESS) {
progress -= MAX_PROGRESS;
waterAmount -= WATER_PER_OP;
Recipes.metalformerCutting.getOutputFor(input, true);
if(input.stackSize == 0)
inv.setInventorySlotContents(SLOT_IN, null);
if(inOutSlot != null)
inOutSlot.stackSize += out.stackSize;
else
inOutSlot = out.copy();
inv.setInventorySlotContents(SLOT_OUT, inOutSlot);
}
} else {
spinUp = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
progress = 0;
}
} else {
spinUp = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
progress = 0;
}
if(spinUp || isRunning) {
int energyReq = isRunning ? AdvancedMachines.runningEUPerTick_cutter : AdvancedMachines.idleEUPerTick_cutter;
if(storedEnergy >= energyReq) {
storedEnergy -= energyReq;
speed += spinUpRate;
if(speed > MAX_SPEED)
speed = MAX_SPEED;
spinUp = true;
} else
spinUp = false;
}
if(!spinUp) {
speed -= spinDownRate;
if(speed <= 0)
speed = 0;
}
if(visuallyActive != (speed > 0)) {
visuallyActive = (speed > 0);
resendDescriptionPacket();
}
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:70,代码来源:TileEntityAdvancedCutter.java
示例10: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput) {
return Recipes.macerator.getOutputFor(input, adjustInput);
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:5,代码来源:TileEntityAdvancedMacerator.java
示例11: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput) {
return Recipes.compressor.getOutputFor(input, adjustInput);
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:5,代码来源:TileEntityAdvancedCompressor.java
示例12: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput) {
return Recipes.extractor.getOutputFor(input, adjustInput);
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:5,代码来源:TileEntityAdvancedExtractor.java
示例13: updateEntity
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public void updateEntity() {
super.updateEntity();
if(worldObj.isRemote) return;
ItemStack input = inv.getStackInSlot(0);
boolean spinUp = false;
boolean isRunning = false;
do {
if(input == null || storedEnergy < runningEUPerTick)
break;
RecipeOutput output = getOutputFor(input, false);
if(output == null)
break;
ItemStack outputStack = output.items.size() > 0 ? output.items.get(0) : null;
if(outputStack != null && !hasSpaceForOutput(outputStack.stackSize, outputStack))
break;
if(!isRunning) {
isRunning = true;
progress += speed;
}
if(progress >= MAX_PROGRESS) {
progress -= MAX_PROGRESS;
// consume input
output = getOutputFor(input, true);
outputStack = output.items.size() > 0 ? output.items.get(0) : null;
if(input.stackSize == 0)
inv.setInventorySlotContents(0, null);
if(outputStack != null)
addOutput(ItemStack.copyItemStack(outputStack));
continue;
}
break;
} while(true);
if(isRunning) {
spinUp = true;
storedEnergy -= runningEUPerTick;
} else {
spinUp = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
if(speed > 0 && progress >= speed)
playInterruptSound();
progress = 0;
}
if(spinUp && !isRunning) {
if(storedEnergy >= idleEUPerTick)
storedEnergy -= idleEUPerTick;
else
spinUp = false;
}
if(spinUp)
speed = Math.min(MAX_SPEED, speed + spinUpRate);
else
speed = Math.max(0, speed - spinDownRate);
if(visuallyActive != (speed > 0)) {
visuallyActive = (speed > 0);
resendDescriptionPacket();
}
setSound(isRunning);
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:72,代码来源:AM2BaseProcessorTileEntity.java
示例14: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
@Override
public RecipeOutput getOutputFor(ItemStack input, boolean consume) {
return Recipes.metalformerRolling.getOutputFor(input, consume);
}
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:5,代码来源:TileEntityAdvancedRoller.java
示例15: getOutputFor
import ic2.api.recipe.RecipeOutput; //导入依赖的package包/类
public abstract RecipeOutput getOutputFor(ItemStack input, boolean consume);
开发者ID:xbony2,项目名称:Bony-s-Advanced-Machines,代码行数:2,代码来源:AM2BaseProcessorTileEntity.java
注:本文中的ic2.api.recipe.RecipeOutput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论