return;
Train train = LinkageManager.instance().getTrain((EntityMinecart) entiyPlayer.ridingEntity);
if (binding == LOCOMOTIVE_INCREASE_SPEED) {
for (EntityMinecart cart : train) {
if (cart instanceof EntityLocomotive) {
EntityLocomotive loco = (EntityLocomotive) cart;
if (loco.canControl(entiyPlayer.getGameProfile()))
loco.increaseSpeed();
}
}
} else if (binding == LOCOMOTIVE_DECREASE_SPEED) {
for (EntityMinecart cart : train) {
if (cart instanceof EntityLocomotive) {
EntityLocomotive loco = (EntityLocomotive) cart;
if (loco.canControl(entiyPlayer.getGameProfile()))
loco.decreaseSpeed();
}
}
} else if (binding == LOCOMOTIVE_MODE_CHANGE) {
for (EntityMinecart cart : train) {
if (cart instanceof EntityLocomotive) {
EntityLocomotive loco = (EntityLocomotive) cart;
if (loco.canControl(entiyPlayer.getGameProfile())) {
LocoMode mode = loco.getMode();
if (mode == LocoMode.RUNNING)
loco.setMode(LocoMode.IDLE);
else
loco.setMode(LocoMode.RUNNING);
}
}
}
} else if (binding == LOCOMOTIVE_WHISTLE)
for (EntityMinecart cart : train) {
if (cart instanceof EntityLocomotive) {
EntityLocomotive loco = (EntityLocomotive) cart;
loco.whistle();
break;
}
}
}