use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class BindCommands method dvorak.
@Command(shortDescription = "Switches to typical keybinds for DVORAK", requiredPermission = PermissionManager.NO_PERMISSION)
public String dvorak() {
bindsManager.linkBindButtonToKey(Keyboard.KeyId.COMMA, new SimpleUri("engine:forwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.A, new SimpleUri("engine:left"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.O, new SimpleUri("engine:backwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.E, new SimpleUri("engine:right"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.C, new SimpleUri("engine:inventory"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.PERIOD, new SimpleUri("engine:useItem"));
return "Changed key bindings to DVORAK keyboard layout.";
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class BindCommands method neo.
@Command(shortDescription = "Switches to typical key binds for NEO 2 keyboard layout", requiredPermission = PermissionManager.NO_PERMISSION)
public String neo() {
bindsManager.linkBindButtonToKey(Keyboard.KeyId.V, new SimpleUri("engine:forwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.I, new SimpleUri("engine:backwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.U, new SimpleUri("engine:left"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.A, new SimpleUri("engine:right"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.L, new SimpleUri("engine:useItem"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.G, new SimpleUri("engine:inventory"));
return "Changed key bindings to NEO 2 keyboard layout.";
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class BindCommands method azerty.
@Command(shortDescription = "Switches to typical key binds for AZERTY", requiredPermission = PermissionManager.NO_PERMISSION)
public String azerty() {
bindsManager.linkBindButtonToKey(Keyboard.KeyId.Z, new SimpleUri("engine:forwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.S, new SimpleUri("engine:backwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.Q, new SimpleUri("engine:left"));
return "Changed key bindings to AZERTY keyboard layout.";
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class AICommands method destroyAI.
/**
* Destroys all entities with attached SimpleAIComponent or HierarchicalAIComponent in the world
* @return String string containing number of simple AIs and hierarchical AIs destroyed
*/
@Command(runOnServer = true, shortDescription = "Destroys all AIs in the world")
public String destroyAI() {
int simpleAI = 0;
for (EntityRef ref : entityManager.getEntitiesWith(SimpleAIComponent.class)) {
ref.destroy();
simpleAI++;
}
int hierarchicalAI = 0;
for (EntityRef ref : entityManager.getEntitiesWith(HierarchicalAIComponent.class)) {
ref.destroy();
hierarchicalAI++;
}
return "Simple AIs (" + simpleAI + ") Destroyed, Hierarchical AIs (" + hierarchicalAI + ") Destroyed ";
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Anatomy by Terasology.
the class AnatomySystem method dmgAnatomyPartAll.
@Command(shortDescription = "Damage ALL Anatomy parts for amount")
public void dmgAnatomyPartAll(@CommandParam("amount") int amount) {
for (EntityRef clientEntity : entityManager.getEntitiesWith(AnatomyComponent.class)) {
AnatomyComponent anatomyComponent = clientEntity.getComponent(AnatomyComponent.class);
List<String> keys = new ArrayList<>(anatomyComponent.parts.keySet());
for (String key : keys) {
AnatomyPartTag partTag = anatomyComponent.parts.get(key);
clientEntity.send(new AnatomyPartImpactedEvent(amount, partTag));
}
}
}
Aggregations