Tabnine Logo
BlockFluidBase
Code IndexAdd Tabnine to your IDE (free)

How to use
BlockFluidBase
in
net.minecraftforge.fluids

Best Java code snippets using net.minecraftforge.fluids.BlockFluidBase (Showing top 5 results out of 315)

origin: squeek502/VeganOption

public static int getStillFluidLevel(Block block)
{
  return block instanceof BlockFluidBase ? ((BlockFluidBase) block).getMaxRenderHeightMeta() : 0;
}
origin: GregTechCE/GregTech

public static void initPotionFluids() {
  MinecraftForge.EVENT_BUS.register(new PotionFluids());
  for(ResourceLocation registryName : ForgeRegistries.POTION_TYPES.getKeys()) {
    if(registryName.getResourceDomain().equals("minecraft") &&
      registryName.getResourcePath().equals("empty")) continue;
    PotionType potion = ForgeRegistries.POTION_TYPES.getValue(registryName);
    Preconditions.checkNotNull(potion);
    Fluid potionFluid;
    if(potion != PotionTypes.WATER) {
      String fluidName = String.format("potion.%s.%s", registryName.getResourceDomain(), registryName.getResourcePath());
      potionFluid = new Fluid(fluidName, AUTO_GENERATED_FLUID_TEXTURE, AUTO_GENERATED_FLUID_TEXTURE) {
        @Override
        public String getUnlocalizedName() {
          return potion.getNamePrefixed("potion.effect.");
        }
      };
      potionFluid.setColor(GTUtility.convertRGBtoOpaqueRGBA_MC(PotionUtils.getPotionColor(potion)));
      FluidRegistry.registerFluid(potionFluid);
      FluidRegistry.addBucketForFluid(potionFluid);
      BlockFluidBase fluidBlock = new BlockPotionFluid(potionFluid, potion);
      fluidBlock.setRegistryName("fluid." + fluidName);
      MetaBlocks.FLUID_BLOCKS.add(fluidBlock);
    } else {
      potionFluid = FluidRegistry.WATER;
    }
    potionFluidMap.put(potion.getRegistryName(), potionFluid);
  }
}
origin: TerraFirmaCraft/TerraFirmaCraft

@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerColorHandlerBlocks(ColorHandlerEvent.Block event)
{
  BlockColors blockcolors = event.getBlockColors();
  blockcolors.registerBlockColorHandler((state, worldIn, pos, tintIndex) ->
      worldIn != null && pos != null ? BiomeColorHelper.getGrassColorAtPos(worldIn, pos) : ColorizerGrass.getGrassColor(0.5D, 1.0D),
    BlocksTFC.getAllBlockRockVariants().stream().filter(x -> x.type.isGrass).toArray(BlockRockVariant[]::new));
  blockcolors.registerBlockColorHandler((state, worldIn, pos, tintIndex) -> BlockFarmlandTFC.TINT[state.getValue(BlockFarmlandTFC.MOISTURE)],
    BlocksTFC.getAllBlockRockVariants().stream().filter(x -> x.type == Rock.Type.FARMLAND).toArray(BlockRockVariant[]::new));
  blockcolors.registerBlockColorHandler((state, worldIn, pos, tintIndex) ->
      worldIn != null && pos != null ? BiomeColorHelper.getGrassColorAtPos(worldIn, pos) : ColorizerGrass.getGrassColor(0.5D, 1.0D),
    BlocksTFC.PEAT_GRASS);
  blockcolors.registerBlockColorHandler((state, worldIn, pos, tintIndex) ->
      worldIn != null && pos != null ? BiomeColorHelper.getWaterColorAtPos(worldIn, pos) : 0,
    BlocksTFC.getAllFluidBlocks().stream().filter(x -> x.getDefaultState().getMaterial() == Material.WATER).toArray(BlockFluidBase[]::new));
  blockcolors.registerBlockColorHandler((state, worldIn, pos, tintIndex) ->
      worldIn != null && pos != null ? BiomeColorHelper.getFoliageColorAtPos(worldIn, pos) : ColorizerFoliage.getFoliageColorBasic(),
    BlocksTFC.getAllLeafBlocks().toArray(new Block[0]));
}
origin: sinkillerj/ProjectE

event.getToolTip().add("Fluid: " + ((BlockFluidBase) currentBlock).getFluid().getName());
origin: GregTechCE/GregTech

fluidBlock.setRegistryName("fluid." + materialName);
MetaBlocks.FLUID_BLOCKS.add(fluidBlock);
net.minecraftforge.fluidsBlockFluidBase

Most used methods

  • getDefaultState
  • getFluid
  • getMaxRenderHeightMeta
  • setRegistryName

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now