本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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;
}
示例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)));
}
示例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)));
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}