use of net.minecraft.util.ChatComponentTranslation in project NyaSamaRailway by NSDN.
the class ItemNTP8Bit method clearCart.
public void clearCart(ItemStack itemStack, EntityPlayer player) {
power.set(itemStack, 0);
brake.set(itemStack, 5);
dir.set(itemStack, 0);
cart.set(itemStack, -1);
if (player instanceof EntityPlayerMP) {
TrainPacket packet = new TrainPacket();
packet.fromStack(itemStack);
NetworkWrapper.instance.sendTo(packet, (EntityPlayerMP) player);
}
player.addChatComponentMessage(new ChatComponentTranslation("info.ntp.cleared"));
}
use of net.minecraft.util.ChatComponentTranslation in project NyaSamaRailway by NSDN.
the class NSPCT10M method interactFirst.
@Override
public boolean interactFirst(EntityPlayer player) {
if (MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, player))) {
return true;
} else if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != player) {
return true;
} else if (this.riddenByEntity != null && this.riddenByEntity != player) {
return false;
} else {
if (player != null) {
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null) {
if (stack.getItem() instanceof Item1N4148 || stack.getItem() instanceof ItemNTP8Bit || stack.getItem() instanceof ItemNTP32Bit) {
return true;
}
if (stack.getItem() instanceof ItemMinecart)
return true;
}
if (!this.worldObj.isRemote) {
player.mountEntity(this);
player.addChatComponentMessage(new ChatComponentTranslation("info.nsr.x"));
}
}
return true;
}
}
use of net.minecraft.util.ChatComponentTranslation in project NyaSamaRailway by NSDN.
the class NSPCT8J method modifyHighSpeedMode.
public void modifyHighSpeedMode(EntityPlayer player) {
setHighSpeedMode(!getHighSpeedMode());
player.addChatComponentMessage(new ChatComponentTranslation("info.nspc8j.mode", String.valueOf(getHighSpeedMode()).toUpperCase()));
}
use of net.minecraft.util.ChatComponentTranslation in project Minechem by iopleke.
the class ElementAchievement method func_150951_e.
/**
* Returns the title
*
* @return an {@link net.minecraft.util.IChatComponent}
*/
@Override
public IChatComponent func_150951_e() {
IChatComponent iChatComponent = new ChatComponentTranslation(defaultElementTitle, element.shortName);
iChatComponent.getChatStyle().setColor(this.getSpecial() ? EnumChatFormatting.DARK_PURPLE : EnumChatFormatting.GREEN);
return iChatComponent;
}
use of net.minecraft.util.ChatComponentTranslation in project LogisticsPipes by RS485.
the class LogisticsEventListener method onPlayerInteract.
@SubscribeEvent
public void onPlayerInteract(final PlayerInteractEvent event) {
if (MainProxy.isServer(event.entityPlayer.worldObj)) {
if (event.action == Action.LEFT_CLICK_BLOCK) {
final TileEntity tile = event.entityPlayer.worldObj.getTileEntity(event.x, event.y, event.z);
if (tile instanceof LogisticsTileGenericPipe) {
if (((LogisticsTileGenericPipe) tile).pipe instanceof CoreRoutedPipe) {
if (!((CoreRoutedPipe) ((LogisticsTileGenericPipe) tile).pipe).canBeDestroyedByPlayer(event.entityPlayer)) {
event.setCanceled(true);
event.entityPlayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
((LogisticsTileGenericPipe) tile).scheduleNeighborChange();
event.entityPlayer.worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord);
((CoreRoutedPipe) ((LogisticsTileGenericPipe) tile).pipe).delayTo = System.currentTimeMillis() + 200;
((CoreRoutedPipe) ((LogisticsTileGenericPipe) tile).pipe).repeatFor = 10;
} else {
((CoreRoutedPipe) ((LogisticsTileGenericPipe) tile).pipe).setDestroyByPlayer();
}
}
}
}
if (event.action == Action.RIGHT_CLICK_BLOCK) {
WorldCoordinatesWrapper worldCoordinates = new WorldCoordinatesWrapper(event.entityPlayer.worldObj, event.x, event.y, event.z);
TileEntity tileEntity = worldCoordinates.getTileEntity();
if (tileEntity instanceof TileEntityChest || SimpleServiceLocator.ironChestProxy.isIronChest(tileEntity)) {
//@formatter:off
List<WeakReference<ModuleQuickSort>> list = worldCoordinates.getAdjacentTileEntities().filter(adjacent -> adjacent.tileEntity instanceof LogisticsTileGenericPipe).filter(adjacent -> ((LogisticsTileGenericPipe) adjacent.tileEntity).pipe instanceof PipeLogisticsChassi).filter(adjacent -> ((PipeLogisticsChassi) ((LogisticsTileGenericPipe) adjacent.tileEntity).pipe).getPointedOrientation() == adjacent.direction.getOpposite()).map(adjacent -> (PipeLogisticsChassi) ((LogisticsTileGenericPipe) adjacent.tileEntity).pipe).flatMap(pipeLogisticsChassi -> Arrays.stream(pipeLogisticsChassi.getModules().getModules())).filter(logisticsModule -> logisticsModule instanceof ModuleQuickSort).map(logisticsModule -> new WeakReference<>((ModuleQuickSort) logisticsModule)).collect(Collectors.toList());
if (!list.isEmpty()) {
LogisticsEventListener.chestQuickSortConnection.put(event.entityPlayer, list);
}
}
}
}
}
Aggregations