Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. package com.gunn.modtest.tileentity;
  2.  
  3. import com.gunn.modtest.ModInfo;
  4. import com.gunn.modtest.ModStates;
  5. import com.gunn.modtest.ModStates.MarkerColors;
  6. import com.gunn.modtest.blocks.ModBlocks;
  7.  
  8. import net.minecraft.client.renderer.texture.ITickable;
  9. import net.minecraft.init.Blocks;
  10. import net.minecraft.tileentity.TileEntity;
  11. import net.minecraft.util.math.BlockPos;
  12. import net.minecraft.world.World;
  13. import net.minecraftforge.fml.common.registry.GameRegistry;
  14.  
  15. public class TileEntityBomb extends TileEntity implements ITickable{
  16. private int timer;
  17. World world = this.getWorld();
  18.  
  19. public TileEntityBomb(){
  20. this.timer = 100;
  21. }
  22.  
  23. private void spread(BlockPos pos){
  24. if(world.isAirBlock(pos)){
  25. world.setBlockState(pos, ModBlocks.blockbomb.getDefaultState(), 3);
  26. }
  27. }
  28.  
  29. @Override
  30. public void tick() {
  31. System.out.println("Ticking Apparently");
  32. timer--;
  33. if(!world.isRemote && timer == 0){
  34. System.out.println("Timer Is 0");
  35. spread(new BlockPos(pos.getX() +1, pos.getY(), pos.getZ()));
  36. spread(new BlockPos(pos.getX() -1, pos.getY(), pos.getZ()));
  37. spread(new BlockPos(pos.getX() , pos.getY(), pos.getZ() +1));
  38. spread(new BlockPos(pos.getX() , pos.getY(), pos.getZ() -1));
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement