package me.km.commands; import me.km.api.GlobalText; import me.km.api.Module; import me.km.api.ModuleCommand; import me.km.permissions.Permissions; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; public class CommandGrow extends ModuleCommand { public CommandGrow(Module m) { super("grow", m); super.setDescription("Lässt die Pflanzen in deiner Umgebung wachsen"); super.setUsage("/grow"); super.setPermission(Permissions.GROW); } @Override public boolean execute(ICommandSender cs, String[] arg) { if(!(cs instanceof EntityPlayer)) { this.getModule().send(cs, GlobalText.onlyPlayer()); return true; } // TODO /*Block l = ((EntityPlayer) cs).getLocation().getBlock(); Block b; for(int x = -3; x < 4; x++) { for(int y = -3; y < 4; y++) { for(int z = -3; z < 4; z++) { b = l.getRelative(x, y, z); if(!(b.getState().getData() instanceof Crops)) { continue; } if(((Crops) b.getState().getData()).getState() != CropState.RIPE) { BlockState state = b.getState(); Crops crop = ((Crops) state.getData()); crop.setState(CropState.RIPE); state.setData(crop); state.update(); } } } } this.getModule().send(cs, "Die Pflanzen in deiner Umgebung sind gewachsen.");*/ return true; } }