Advertisement
Guest User

Untitled

a guest
Dec 31st, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.88 KB | None | 0 0
  1. package com.ancient.spc.fluids;
  2.  
  3. import net.minecraft.block.material.Material;
  4. import net.minecraft.init.SoundEvents;
  5. import net.minecraft.util.ResourceLocation;
  6. import net.minecraft.util.SoundEvent;
  7. import net.minecraftforge.fluids.Fluid;
  8. import net.minecraftforge.fluids.FluidStack;
  9.  
  10. public class SPCFluidBase extends Fluid
  11. {
  12.  
  13.     protected static int mapColor = 0xFFFFFFFF;
  14.     protected static float overlayAlpha = 0.2f;
  15.     protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY;
  16.     protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL;
  17.     protected static Material material = Material.WATER;
  18.    
  19.     public SPCFluidBase(String fluidName, String modId)
  20.     {
  21.         super(fluidName, new ResourceLocation(modId, "blocks/fluids/ + " + fluidName + "_still"), new ResourceLocation(modId, "blocks/fluids/ + " + fluidName + "_flow"));
  22.     }
  23.    
  24.     @Override
  25.     public int getColor()
  26.     {
  27.         return mapColor;
  28.     }
  29.    
  30.     public SPCFluidBase getColor (int color)
  31.     {
  32.         mapColor = color;
  33.         return this;
  34.     }
  35.    
  36.     public float getAlpha ()
  37.     {
  38.         return overlayAlpha;
  39.     }
  40.    
  41.     public SPCFluidBase setAlpha (float alpha)
  42.     {
  43.         overlayAlpha = alpha;
  44.         return this;
  45.     }
  46.    
  47.     @Override
  48.     public Fluid setEmptySound(SoundEvent sound)
  49.     {
  50.         emptySound = sound;
  51.         return this;
  52.     }
  53.    
  54.     @Override
  55.     public SoundEvent getEmptySound()
  56.     {
  57.         return emptySound;
  58.     }
  59.    
  60.     @Override
  61.     public Fluid setFillSound(SoundEvent sound)
  62.     {
  63.         fillSound = sound;
  64.         return this;
  65.     }
  66.    
  67.     @Override
  68.     public SoundEvent getFillSound()
  69.     {
  70.         return fillSound;
  71.     }
  72.    
  73.     public SPCFluidBase setMaterial(Material mat)
  74.     {
  75.         material = mat;
  76.         return this;
  77.     }
  78.    
  79.     public static Material getMaterial()
  80.     {
  81.         return material;
  82.     }
  83.    
  84.     @Override
  85.     public boolean doesVaporize(FluidStack fluidStack)
  86.     {
  87.         if (block == null)
  88.             return false;
  89.         return block.getDefaultState().getMaterial() == getMaterial();
  90.     }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement