package me.km.environment; 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 CommandTemperature extends ModuleCommand { public CommandTemperature(Module m) { super("temperature", m); super.setDescription("Zeigt dir die aktuelle Temperatur an"); super.setUsage("/temperature"); super.setPermission(Permissions.TEMPERATURE); super.addAlias("temp"); } @Override public boolean execute(ICommandSender cs, String[] arg) { if(!(cs instanceof EntityPlayer)) { this.getModule().send(cs, GlobalText.onlyPlayer()); return true; } EntityPlayer p = (EntityPlayer) cs; this.getModule().send(cs, "Die Temperatur beträgt hier " + EnvironmentAPI.getTemperature(p.getEntityWorld(), p.getPosition()) + "°C."); return true; } }