use of net.minecraft.util.text.TextComponentTranslation in project BetterWithAddons by DaedalusGame.
the class TileEntityLegendarium method insertItem.
public ItemStack insertItem(EntityPlayer player, ItemStack stack) {
if (stack.getItem() == ModItems.artifactFrame) {
if (cleanItemFrames() == 0) {
populateItemFrames();
player.sendStatusMessage(new TextComponentTranslation("tile.legendarium.frames_populated"), true);
} else
player.sendStatusMessage(new TextComponentTranslation("tile.legendarium.frames_cleared"), true);
return stack;
}
String analysis = analyzeItem(stack);
if (analysis != null) {
player.sendStatusMessage(new TextComponentTranslation("tile.legendarium." + analysis), true);
return stack;
}
long timeUntilNextTurnIn = lastTurnIn + InteractionBWA.LEGENDARIUM_TURN_IN_DELAY - world.getTotalWorldTime();
if (timeUntilNextTurnIn > 0) {
long days = timeUntilNextTurnIn / 24000;
long hours = (timeUntilNextTurnIn % 24000) / 1000;
player.sendStatusMessage(new TextComponentTranslation("tile.legendarium.not_now", days, hours), true);
return stack;
}
ItemStack retain = queue.insertItem(0, ModItems.brokenArtifact.makeFrom(stack), false);
if (retain.isEmpty()) {
lastTurnIn = world.getTotalWorldTime();
populateItemFrames();
}
if (queue.getSlots() >= InteractionBWA.LEGENDARIUM_MIN_QUEUE_SIZE) {
player.sendStatusMessage(new TextComponentTranslation("tile.legendarium.ready"), true);
}
return retain;
}
use of net.minecraft.util.text.TextComponentTranslation in project BetterWithAddons by DaedalusGame.
the class TileEntityLegendarium method retrieveItem.
public ItemStack retrieveItem(EntityPlayer player) {
long time = world.getTotalWorldTime();
if (queue.getSlots() < InteractionBWA.LEGENDARIUM_MIN_QUEUE_SIZE) {
player.sendStatusMessage(new TextComponentTranslation("tile.legendarium.not_enough_artifacts"), true);
return ItemStack.EMPTY;
}
if (time - lastClick > 3 && queue.getSlots() >= InteractionBWA.LEGENDARIUM_MIN_QUEUE_SIZE) {
lastClick = time;
ItemStack retrieved = queue.extractItem(0, 1, false);
populateItemFrames();
return retrieved;
}
return ItemStack.EMPTY;
}
use of net.minecraft.util.text.TextComponentTranslation in project Almura by AlmuraDev.
the class CapabilityDualItemHandlerGuiHandler method getClientGuiElement.
@SideOnly(Side.CLIENT)
@Nullable
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
final BlockPos pos = new BlockPos(x, y, z);
final Block block = world.getBlockState(pos).getBlock();
final TileEntity te = world.getTileEntity(pos);
if (te == null || !(te instanceof MultiSlotTileEntity)) {
return null;
}
final IItemHandler teItemHandler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
if (teItemHandler == null) {
return null;
}
final IItemHandler playerItemHandler = player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
if (playerItemHandler == null) {
return null;
}
return new DualItemHandlerGui(teItemHandler, playerItemHandler, new TextComponentString(block.getLocalizedName()), new TextComponentTranslation("container.inventory"));
}
use of net.minecraft.util.text.TextComponentTranslation in project GregTech by GregTechCE.
the class VacuumFreezerInfo method generateBlockTooltips.
@Override
protected void generateBlockTooltips() {
super.generateBlockTooltips();
ITextComponent tooltip = new TextComponentTranslation("gregtech.multiblock.preview.limit", 14).setStyle(new Style().setColor(TextFormatting.AQUA));
addBlockTooltip(MetaBlocks.METAL_CASING.getItemVariant(MetalCasingType.ALUMINIUM_FROSTPROOF), tooltip);
}
use of net.minecraft.util.text.TextComponentTranslation in project GregTech by GregTechCE.
the class CrackerUnitInfo method generateBlockTooltips.
@Override
protected void generateBlockTooltips() {
super.generateBlockTooltips();
ITextComponent tooltip = new TextComponentTranslation("gregtech.multiblock.preview.limit", 20).setStyle(new Style().setColor(TextFormatting.AQUA));
addBlockTooltip(MetaBlocks.METAL_CASING.getItemVariant(BlockMetalCasing.MetalCasingType.STAINLESS_CLEAN), tooltip);
}
Aggregations