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


Java FluidContainerData类代码示例

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


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

示例1: loadCraftingRecipes

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(ItemStack result) {
    if (Utils.isFluidBlock(result)) {
        super.loadCraftingRecipes(result);
    }
    if (Config.handlerFluidRegistry) {
        for (Fluid fluid : this.getFluids()) {
            CachedFluidRegistryRecipe crecipe = new CachedFluidRegistryRecipe(fluid);
            if (crecipe.filledContainer != null && crecipe.filledContainer.contains(result)) {
                crecipe.setPermutation(crecipe.filledContainer, result);
                for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
                    if (Utils.areStacksSameTypeCraftingSafe(data.filledContainer, result)) {
                        crecipe.setPermutation(crecipe.emptyContainer, data.emptyContainer);
                    }
                }
                this.arecipes.add(crecipe);
            }
        }
    }
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:21,代码来源:RecipeHandlerFluidRegistry.java

示例2: loadUsageRecipes

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public void loadUsageRecipes(ItemStack ingredient) {
    super.loadUsageRecipes(ingredient);
    if (Config.handlerFluidRegistry) {
        for (Fluid fluid : this.getFluids()) {
            CachedFluidRegistryRecipe crecipe = new CachedFluidRegistryRecipe(fluid);
            if (crecipe.emptyContainer != null && crecipe.emptyContainer.contains(ingredient)) {
                crecipe.setPermutation(crecipe.emptyContainer, ingredient);
                for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
                    if (Utils.areStacksSameTypeCraftingSafe(data.emptyContainer, ingredient)) {
                        crecipe.setPermutation(crecipe.filledContainer, data.filledContainer);
                    }
                }
                this.arecipes.add(crecipe);
            }
        }
    }
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:19,代码来源:RecipeHandlerFluidRegistry.java

示例3: getInputs

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public List<ItemStack> getInputs() {
	List<ItemStack> ret = new ArrayList<ItemStack>();

	for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
		if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer);
	}
	ret.add(IC2Items.getItem("fluid_cell", fluid.getName()));

	return ret;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:12,代码来源:RecipeInputFluidContainer.java

示例4: preInit

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent event)
{
    playerHandler = new AsteroidsPlayerHandler();
    MinecraftForge.EVENT_BUS.register(playerHandler);
    FMLCommonHandler.instance().bus().register(playerHandler);
    AsteroidsEventHandler eventHandler = new AsteroidsEventHandler();
    MinecraftForge.EVENT_BUS.register(eventHandler);
    FMLCommonHandler.instance().bus().register(eventHandler);
    RecipeSorter.register("galacticraftmars:canisterRecipe", CanisterRecipes.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");

    AsteroidsModule.fluidMethaneGas = registerFluid("methane", 1, 11, 295, true);
    AsteroidsModule.fluidAtmosphericGases = registerFluid("atmosphericgases", 1, 13, 295, true);
    AsteroidsModule.fluidLiquidMethane = registerFluid("liquidmethane", 450, 120, 109, false);
    //Data source for liquid methane: http://science.nasa.gov/science-news/science-at-nasa/2005/25feb_titan2/
    AsteroidsModule.fluidLiquidOxygen = registerFluid("liquidoxygen", 1141, 140, 90, false);
    AsteroidsModule.fluidOxygenGas = registerFluid("oxygen", 1, 13, 295, true);
    AsteroidsModule.fluidLiquidNitrogen = registerFluid("liquidnitrogen", 808, 130, 90, false);
    AsteroidsModule.fluidNitrogenGas = registerFluid("nitrogen", 1, 12, 295, true);
    registerFluid("carbondioxide", 2, 20, 295, true);
    registerFluid("hydrogen", 1, 1, 295, true);
    registerFluid("argon", 1, 4, 295, true);
    AsteroidsModule.fluidLiquidArgon = registerFluid("liquidargon", 900, 100, 87, false);
    registerFluid("helium", 1, 1, 295, true);

    //AsteroidsModule.fluidCO2Gas = FluidRegistry.getFluid("carbondioxide");

    AsteroidBlocks.initBlocks();
    AsteroidBlocks.registerBlocks();
    AsteroidBlocks.setHarvestLevels();
    AsteroidBlocks.oreDictRegistration();
    
    AsteroidsItems.initItems();
    
    FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(AsteroidsModule.fluidMethaneGas, 1000), new ItemStack(AsteroidsItems.methaneCanister, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY)));
    FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(AsteroidsModule.fluidLiquidOxygen, 1000), new ItemStack(AsteroidsItems.canisterLOX, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY)));
    FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(AsteroidsModule.fluidLiquidNitrogen, 1000), new ItemStack(AsteroidsItems.canisterLN2, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY)));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:39,代码来源:AsteroidsModule.java

示例5: preInit

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	isPlanetsLoaded = Loader.isModLoaded(Constants.MOD_ID_PLANETS);
	GCCoreUtil.nextID = 0;
	
	MinecraftForge.EVENT_BUS.register(new EventHandlerGC());
    handler = new GCPlayerHandler();
    MinecraftForge.EVENT_BUS.register(handler);
    FMLCommonHandler.instance().bus().register(handler);
    GalacticraftCore.proxy.preInit(event);
    
    ConnectionPacket.bus = NetworkRegistry.INSTANCE.newEventDrivenChannel(ConnectionPacket.CHANNEL);
    ConnectionPacket.bus.register(new ConnectionPacket());

    ConfigManagerCore.initialize(new File(event.getModConfigurationDirectory(), GalacticraftCore.CONFIG_FILE));
    EnergyConfigHandler.setDefaultValues(new File(event.getModConfigurationDirectory(), GalacticraftCore.POWER_CONFIG_FILE));
    ChunkLoadingCallback.loadConfig(new File(event.getModConfigurationDirectory(), GalacticraftCore.CHUNKLOADER_CONFIG_FILE));

    this.registerOilandFuel();

    if (Loader.isModLoaded("PlayerAPI"))
    {
        ServerPlayerAPI.register(Constants.MOD_ID_CORE, GCPlayerBaseMP.class);
    }

    GCBlocks.initBlocks();
    GCItems.initItems();

    //Allow canisters to be filled from other mods' tanks containing fuel / oil fluids
    FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(GalacticraftCore.fluidFuel, 1000), new ItemStack(GCItems.fuelCanister, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY)));
    FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(GalacticraftCore.fluidOil, 1000), new ItemStack(GCItems.oilCanister, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY)));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:34,代码来源:GalacticraftCore.java

示例6: matches

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public boolean matches(ItemFilter filter, Object[] data, int dataIndex, SlotType type)
{
	if(!(data[dataIndex] instanceof FluidStack) ||
			(type != slotType && (
				type != SlotType.ANY_SLOT ||
				slotType == SlotType.DISPLAY_SLOT ||
				slotType == SlotType.HIDDEN_SLOT)))
	{
		return false;
	}

	FluidStack stack = (FluidStack)data[dataIndex];

	if(filter.matches(stack))
	{
		return true;
	}
	else
	{
		for(FluidContainerData liquidData: FluidContainerRegistry.getRegisteredFluidContainerData())
		{
			if(stack.isFluidEqual(liquidData.fluid) && filter.matches(liquidData.filledContainer))
			{
				return true;
			}
		}

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

示例7: getInputs

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public List<ItemStack> getInputs() {
	List<ItemStack> ret = new ArrayList<ItemStack>();

	for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
		if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer);
	}

	return ret;
}
 
开发者ID:nikita488,项目名称:RainbowElectricity,代码行数:11,代码来源:RecipeInputFluidContainer.java

示例8: setContainerItems

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
private void setContainerItems(Fluid fluid) {
    List<ItemStack> emptyContainers = new ArrayList<ItemStack>();
    List<ItemStack> filledContainers = new ArrayList<ItemStack>();
    for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
        if (data.fluid.getFluid() == fluid) {
            emptyContainers.add(data.emptyContainer);
            filledContainers.add(data.filledContainer);
        }
    }
    
    if (!emptyContainers.isEmpty() && !filledContainers.isEmpty()) {
        this.emptyContainer = new PositionedStack(emptyContainers, 71, 43);
        this.filledContainer = new PositionedStack(filledContainers, 112, 43);
    }
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:16,代码来源:RecipeHandlerFluidRegistry.java

示例9: prepare

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public void prepare() {
    guiClass = Utils.getClass("forestry.factory.gui.GuiBottler");
    for (FluidContainerData container : FluidContainerRegistry.getRegisteredFluidContainerData()) {
        MachineBottler.Recipe recipe = MachineBottler.RecipeManager.findMatchingRecipe(container.fluid, container.emptyContainer);
        if (recipe != null) {
            recipes.add(recipe);
        }
    }
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:11,代码来源:RecipeHandlerBottler.java

示例10: getInputs

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public List<ItemStack> getInputs() {
    List<ItemStack> ret = new ArrayList<ItemStack>();

    for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
        if (data.fluid.getFluid() == fluid) {
            ret.add(data.filledContainer);
        }
    }

    return ret;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:13,代码来源:RecipeInputFluidContainer.java

示例11: getInputs

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
@Override
public List<ItemStack> getInputs() {
    List<ItemStack> ret = new ArrayList<ItemStack>();

    for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
        if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer);
    }

    return ret;
}
 
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:11,代码来源:RecipeInputFluidContainer.java

示例12: onBlockActivated

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer ep, int side, float par7, float par8, float par9) {
	TileEntityMagiCrucible mag = (TileEntityMagiCrucible) world.getBlockTileEntity(x, y, z);
	ItemStack itemstack = ep.inventory.getCurrentItem();

	if (world.isRemote) {
		if (!FluidContainerRegistry.isEmptyContainer(itemstack)) {
			mag.showAmount();
		}
		return true;
	} else {
		if (FluidContainerRegistry.isEmptyContainer(itemstack)) {
			// TODO - Fill Container
			for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
				if (data.emptyContainer != null && itemstack.isItemEqual(data.emptyContainer)) {
					if (data.fluid != null && data.fluid.isFluidEqual(mag.getTankInfo(null)[0].fluid)) {
						if (mag.getTankInfo(null)[0].fluid.amount >= data.fluid.amount) {

							ItemStack result = data.filledContainer.copy();

							mag.getTankInfo(null)[0].fluid.amount -= data.fluid.amount;

							if (--itemstack.stackSize <= 0) {
								ep.inventory.mainInventory[ep.inventory.currentItem] = result;
								return true;
							}

							if (!ep.inventory.addItemStackToInventory(result)) {
								ep.dropPlayerItem(result);
							}
						}
					}
				}
			}
		}
	}

	return true;
}
 
开发者ID:froschi3b,项目名称:Magitech,代码行数:42,代码来源:BlockMagiCrucible.java

示例13: storesFluid

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
public static boolean storesFluid(ItemStack itemstack) {
  if (itemstack.getItem() instanceof IFluidContainerItem) {
    return true;
  }
  for (FluidContainerData f : getFluidData()) {
    if (Item.getIdFromItem(f.filledContainer.getItem()) == Item.getIdFromItem(itemstack.getItem()) && f.filledContainer.getItemDamage() == itemstack.getItemDamage()) {
      return true;
    }
  }
  return false;
}
 
开发者ID:ictrobot,项目名称:Open-Exchange,代码行数:12,代码来源:FluidUtil.java

示例14: getStoringItemStacks

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
public static List<ItemStack> getStoringItemStacks(int fluidID) {
  List<ItemStack> data = new ArrayList<ItemStack>();
  for (FluidContainerData f : getFluidData()) {
    if (f.fluid.fluidID == fluidID) {
      data.add(f.filledContainer);
    }
  }
  return data;
}
 
开发者ID:ictrobot,项目名称:Open-Exchange,代码行数:10,代码来源:FluidUtil.java

示例15: registerFluid

import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; //导入依赖的package包/类
public FluidFactoryProduct registerFluid(UnregisteredFluid fluidData) throws IllegalArgumentException
{
    // Pass the data object into the product to activate it, creates needed data structures inside it based on data supplied.
    FluidFactoryProduct fluidProduct = new FluidFactoryProduct( fluidData );

    // Check to make sure we have not added this item before.
    if (! isValidFluidID( fluidProduct.getFluidName() ))
    {
        throw new IllegalArgumentException( "Duplicate FluidFactoryProduct '" +
                                            fluidProduct.getFluidName() +
                                            "' was added. Execution halted!" );
    }

    // Debugging!
    ModLoader.log().info( "[FluidFactory]Registering fluid: " + fluidProduct.getFluidName() );

    // Actually register the fluid with the product listing.
    registeredFluids.put( fluidProduct.getFluidName(),
                          fluidProduct );

    // Register the fluid with Minecraft/Forge.
    GameRegistry.registerBlock( fluidProduct.getFluidBlock(),
                                ItemBlockTooltip.class,
                                fluidProduct.getFluidName() );

    // Only register container item and call backs if they are enabled.
    if (fluidData.hasFluidContainerItem())
    {
        // Register fluid container item.
        GameRegistry.registerItem( fluidProduct.getFluidContainer(),
                                   fluidProduct.getFluidContainerName() );

        // Register our class as a valid container for our fluid.
        FluidContainerRegistry.registerFluidContainer( new FluidContainerData( FluidRegistry.getFluidStack( fluidProduct.getFluidName(),
                                                                                                            FluidContainerRegistry.BUCKET_VOLUME ),
                                                                               new ItemStack( fluidProduct.getFluidContainer() ),
                                                                               new ItemStack( Item.bucketEmpty ) ) );

        // Hook event in forge for filling a bucket with liquid.
        MinecraftForge.EVENT_BUS.register( fluidProduct.getFluidContainer() );
    }

    // Register custom rendering for GUI's.
    ForgeMod.proxy.registerRenderingHandler( fluidProduct.getFluidID() );

    return fluidProduct;
}
 
开发者ID:Maxwolf,项目名称:MC-MineAPI.Java,代码行数:48,代码来源:FluidFactory.java


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