Advertisement
Creepinson

TileEntityMeepino

May 11th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. package me.creepinson.entities.tileentity;
  2.  
  3. import me.creepinson.blocks.BlockMeepino;
  4. import net.minecraft.block.BlockClay;
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.multiplayer.WorldClient;
  7. import net.minecraft.init.Blocks;
  8. import net.minecraft.tileentity.TileEntity;
  9. import net.minecraft.util.ITickable;
  10. import net.minecraft.util.math.BlockPos;
  11. import net.minecraftforge.common.capabilities.ICapabilityProvider;
  12.  
  13. public class TileEntityMeepino extends TileEntity implements ITickable, ICapabilityProvider{
  14.  
  15.  
  16. public TileEntityMeepino() {
  17.  
  18.  
  19. }
  20. @Override
  21. public void update() {
  22.  
  23. if(BlockMeepino.isActivated){
  24.  
  25. BlockPos frontC = new BlockPos(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 1);
  26. BlockPos backC = new BlockPos(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 1);
  27. BlockPos leftC = new BlockPos(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 1);
  28. BlockPos rightC = new BlockPos(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 1);
  29.  
  30. BlockPos frontL = new BlockPos(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 1);
  31. BlockPos backL = new BlockPos(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 1);
  32. BlockPos frontR = new BlockPos(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 1);
  33. BlockPos backR = new BlockPos(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 1);
  34.  
  35.  
  36. BlockPos veryCenterBlock = new BlockPos(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
  37.  
  38. this.world.setBlockState(veryCenterBlock, Blocks.MOSSY_COBBLESTONE.getDefaultState());
  39. this.world.setBlockState(backC, Blocks.LAPIS_BLOCK.getDefaultState());
  40. this.world.setBlockState(frontC, Blocks.LAPIS_BLOCK.getDefaultState());
  41. this.world.setBlockState(frontL, Blocks.LAPIS_BLOCK.getDefaultState());
  42. this.world.setBlockState(frontR, Blocks.LAPIS_BLOCK.getDefaultState());
  43. this.world.setBlockState(backL, Blocks.LAPIS_BLOCK.getDefaultState());
  44. this.world.setBlockState(backR, Blocks.LAPIS_BLOCK.getDefaultState());
  45. this.world.setBlockState(leftC, Blocks.LAPIS_BLOCK.getDefaultState());
  46. this.world.setBlockState(rightC, Blocks.LAPIS_BLOCK.getDefaultState());
  47. BlockMeepino.isActivated = false;
  48. }
  49.  
  50.  
  51.  
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement