Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.52 KB | None | 0 0
  1. private static void fluidTweaker(Block block) {
  2.         try {
  3.             if (block instanceof BlockFluidClassic) {
  4.                 Fluid fluid = ((BlockFluidClassic) block).getFluid();
  5.                 try {
  6.                     fluid.setDensity(
  7.                             config.getInt("Density", getCategory(block, SUBCAT_FLUID),
  8.                                     fluid.getDensity(), Integer.MIN_VALUE, Integer.MAX_VALUE,
  9.                                     "Overrides the density value with this value."
  10.                             )
  11.                     );
  12.                 } catch (Exception e) {
  13.                     LOGGER.error("Fail to tweak the density value for " + fluid.getName(), e);
  14.                 }
  15.                 try {
  16.                     fluid.setLuminosity(
  17.                             config.getInt("Luminosity", getCategory(block, SUBCAT_FLUID),
  18.                                     fluid.getLuminosity(), 0, Integer.MAX_VALUE,
  19.                                     "Overrides the luminosity value with this value."
  20.                             )
  21.                     );
  22.                 } catch (Exception e) {
  23.                     LOGGER.error("Fail to tweak the luminosity value for " + fluid.getName(), e);
  24.                 }
  25.                 try {
  26.                     fluid.setViscosity(
  27.                             config.getInt("Viscosity", getCategory(block, SUBCAT_FLUID),
  28.                                     fluid.getLuminosity(), 0, Integer.MAX_VALUE,
  29.                                     "Overrides the viscosity value with this value."
  30.                             )
  31.                     );
  32.                 } catch (Exception e) {
  33.                     LOGGER.error("Fail to tweak the viscosity value for " + fluid.getName(), e);
  34.                 }
  35.                 try {
  36.                     fluid.setTemperature(
  37.                             config.getInt("Temperature", getCategory(block, SUBCAT_FLUID),
  38.                                     fluid.getTemperature(), 0, Integer.MAX_VALUE,
  39.                                     "Overrides the temperature value with this value."
  40.                             )
  41.                     );
  42.                 } catch (Exception e) {
  43.                     LOGGER.error("Fail to tweak the temperature value for " + fluid.getName(), e);
  44.                 }
  45.                 config.setCategoryComment(getCategory(block, SUBCAT_FLUID), "Edit fluid properties for " + getFormattedBlockName(block));
  46.             }
  47.         } catch (Exception e) {
  48.             e.printStackTrace();
  49.         }
  50.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement