package me.km.commands; import me.km.api.GlobalText; import me.km.api.Module; import me.km.api.ModuleCommand; import me.km.api.Utils; import me.km.permissions.Permissions; import net.minecraft.command.ICommandSender; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; public class CommandTest extends ModuleCommand { public CommandTest(Module m) { super("test", m); super.setDescription("Für Tests"); super.setUsage("/test"); super.setPermission(Permissions.TEST); } @Override public boolean execute(ICommandSender cs, String[] arg) { if(!(cs instanceof EntityPlayer)) { this.getModule().send(cs, GlobalText.onlyPlayer()); return true; } EntityPlayer p = (EntityPlayer) cs; Entity test = Utils.getTargetedEntity(p, 30, EntityLivingBase.class); if(test == null) { this.getModule().send(cs, "null"); return true; } p.getEntityWorld().setBlockState(test.getPosition(), Blocks.REDSTONE_BLOCK.getDefaultState()); //p.getEntityWorld().setBlockState(pos, Blocks.REDSTONE_BLOCK.getDefaultState()); //this.getModule().send(cs, "Es passiert nichts."); return true; } }