SHARE
TWEET

BlockGasoline.java

Nuparu00 Jun 1st, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class BlockGasoline extends BlockFluidClassic implements IBlockBase {
  2.  
  3.     public BlockGasoline(Fluid fluid, Material material) {
  4.         super(fluid, material);
  5.     }
  6.  
  7.     @Override
  8.     public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
  9.         for (EnumFacing side : EnumFacing.VALUES) {
  10.  
  11.             BlockPos off = pos.offset(side, 1);
  12.             if (worldIn.getBlockState(off).getMaterial() == Material.FIRE
  13.                     || worldIn.getBlockState(off).getMaterial() == Material.LAVA) {
  14.                 worldIn.setBlockState(pos, Blocks.FIRE.getDefaultState());
  15.  
  16.             }
  17.  
  18.         }
  19.  
  20.         super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
  21.     }
  22.  
  23.     public boolean metaItemBlock() {
  24.         return false;
  25.     }
  26.  
  27.     public ItemBlock createItemBlock() {
  28.         return new ItemBlock(this);
  29.     }
  30.  
  31.     public static ItemBlock createItemBlock(Block block) {
  32.         return new ItemBlock(block);
  33.     }
  34.    
  35.     @Override
  36.     public EnumBlockRenderType getRenderType(IBlockState state) {
  37.        
  38.         return EnumBlockRenderType.MODEL;
  39.     }
  40.  
  41.     @Override
  42.     @SideOnly(Side.CLIENT)
  43.     public boolean hasCustomStateMapper() {
  44.         return true;
  45.     }
  46.  
  47.     @Override
  48.     @SideOnly(Side.CLIENT)
  49.     public IStateMapper getStateMapper() {
  50.         return new StateMapperBase() {
  51.  
  52.             @Override
  53.             protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
  54.                 return new ModelResourceLocation(SevenDaysToMine.MODID+":gasoline", "fluid");
  55.             }
  56.         };
  57.  
  58.     }
  59.    
  60.     @Override
  61.     @SideOnly(Side.CLIENT)
  62.     public boolean hasCustomItemMesh() {
  63.         return true;
  64.     }
  65.  
  66.     @Override
  67.     @SideOnly(Side.CLIENT)
  68.     public ItemMeshDefinition getItemMesh() {
  69.         return new ItemMeshDefinition() {
  70.  
  71.             @Override
  72.             public ModelResourceLocation getModelLocation(ItemStack stack) {
  73.                 return new ModelResourceLocation(SevenDaysToMine.MODID+"gasoline", "fluid");
  74.             }
  75.         };
  76.     }
  77.  
  78. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top