package dk.codingpirates.minecraft.mods.item;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.ServerChatEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class TowerItems {

	@SubscribeEvent
	public void buildTower(ServerChatEvent event) {
		
		if (event.getMessage().contains("tower")) {

			World world = event.getPlayer().getEntityWorld();

			BlockPos position = event.getPlayer().getPosition();
			
			Block blk = Blocks.DIAMOND_BLOCK;
			IBlockState defaultState = blk.getDefaultState();
			
			int startX = position.getX();
			int startY = position.getY();
			int startZ = position.getZ();
			BlockPos position1 = null;

			System.out.println("BlockPos pos=" + position.toString());
			
			for (int z = 0 ; z < 10 ; z++){
			
				for (int y = 0 ; y < 10 ; y++){
					for (int x = 0 ; x < 10 ; x++){
						position1 = new BlockPos(position.getX() + x, position.getY() + y, position.getZ() + z);
						world.setBlockState(position1, defaultState);
						System.out.println("BlockPos pos0=" + position1.toString());
					}	
				}				
			}
				
			

			

				
			
		}

	}
}
@@ -698,21 +698,17 @@
 cks.
-DIAMOND_BLOCK
+GLOWSTONE
 ;%0A%09%09
@@ -762,16 +762,134 @@
 ();%0A%09%09%09%0A
+%09%09%09Block blk1 = Blocks.GRAVEL;%0A%09%09%09IBlockState defaultState1 = blk1.getDefaultState();%0A%09%09%09%0A%09%09%09boolean glow = true;%0A%09%09%09%0A
 %09%09%09int s
@@ -1111,20 +1111,16 @@
 ; z++)%7B%0A
-%09%09%09%0A
 %09%09%09%09for 
@@ -1180,24 +1180,99 @@
  10 ; x++)%7B%0A
+%09%09%09%09%09%09if((z == 0 %7C%7C z == 9) %7C%7C (y == 0 %7C%7C y == 9) %7C%7C (x == 0 %7C%7C x == 9))%7B%0A%09
 %09%09%09%09%09%09positi
@@ -1354,16 +1354,35 @@
 ) + z);%0A
+%09%09%09%09%09%09%09if(glow)%7B%0A%09%09
 %09%09%09%09%09%09wo
@@ -1425,16 +1425,138 @@
 State);%0A
+%09%09%09%09%09%09%09%09glow = false;%0A%09%09%09%09%09%09%09%7Delse%7B%0A%09%09%09%09%09%09%09%09world.setBlockState(position1, defaultState1);%0A%09%09%09%09%09%09%09%09glow = true;%0A%09%09%09%09%09%09%09%7D%0A%09
 %09%09%09%09%09%09Sy
@@ -1609,24 +1609,33 @@
 toString());
+%09%0A%09%09%09%09%09%09%7D
 %0A%09%09%09%09%09%7D%09%0A%09%09%09
@@ -1678,9 +1678,10 @@
 %09%09%7D%0A%0A%09%7D%0A
-
 %7D
+%0A

Update TowerItems.java