Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

P4NTH3R27

Members
  • Joined

  • Last visited

Everything posted by P4NTH3R27

  1. I'm working on a tiberium mod and I want the block to replace nearby grass and dirt, but it won't spread no matter how I try to make it. I'm not sure exactly what I'm missing here, but a few hours ago I felt close to figuring it out and now it's slipping from my grasp. I feel like it's staring me in the face, too. Forgive me if it's messy. package com.P4NTH3R27.arimod.blocks; import java.util.Random; import com.P4NTH3R27.arimod.init.BlockInit; import com.P4NTH3R27.arimod.init.ItemInit; import net.minecraft.block.Block; import net.minecraft.block.BlockDirt; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class TiberiumGrass extends BlockBase { public static final Block block = null; public TiberiumGrass(String name, Material material, float hardness, float resistance, int miningLevel, String tool) { super(name, material, hardness, resistance, miningLevel, name); setUnlocalizedName(name); setRegistryName(name); setHardness(5.0f); setResistance(5.0f); setHarvestLevel("shovel", 2); this.setItemDropped(() -> ItemInit.tiberium_shard); this.setTickRandomly(true); this.setDefaultState(this.blockState.getBaseState()); BlockInit.BLOCKS.add(this); ItemInit.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName())); } @Override public void onBlockAdded(World world, BlockPos pos, IBlockState state) { super.onBlockAdded(world, pos, state); int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); world.scheduleUpdate(new BlockPos(x, y, z), this, this.tickRate(world)); } @Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { BlockPos blockpos = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1); IBlockState iblockstate = worldIn.getBlockState(blockpos); IBlockState iblockstate1 = worldIn.getBlockState(blockpos); int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); if (((iblockstate1.getBlock() == Blocks.DIRT))) { worldIn.setBlockState(blockpos, this.getDefaultState()); } worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.