use of net.minecraft.tileentity.SignTileEntity in project minecolonies by ldtteam.
the class WorkerUtil method updateLevelSign.
/**
* Updated the level sign of a certain level in the world.
*
* @param world the world.
* @param level the level to update.
* @param levelId the id of the level.
*/
public static void updateLevelSign(final World world, final Level level, final int levelId) {
@Nullable final BlockPos levelSignPos = level.getLevelSign();
if (levelSignPos != null) {
final TileEntity te = world.getBlockEntity(levelSignPos);
if (te instanceof SignTileEntity) {
final BlockState BlockState = world.getBlockState(levelSignPos);
final SignTileEntity teLevelSign = (SignTileEntity) te;
teLevelSign.setMessage(0, new StringTextComponent(TextFormatting.stripFormatting(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.minerMineNode") + ": " + levelId)));
teLevelSign.setMessage(1, new StringTextComponent(TextFormatting.stripFormatting("Y: " + (level.getDepth() + 1))));
teLevelSign.setMessage(2, new StringTextComponent(TextFormatting.stripFormatting(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.minerNode") + ": " + level.getNumberOfBuiltNodes())));
teLevelSign.setMessage(3, new StringTextComponent(TextFormatting.stripFormatting("")));
teLevelSign.setChanged();
world.sendBlockUpdated(levelSignPos, BlockState, BlockState, 3);
}
}
}
use of net.minecraft.tileentity.SignTileEntity in project minecolonies by Minecolonies.
the class WorkerUtil method updateLevelSign.
/**
* Updated the level sign of a certain level in the world.
*
* @param world the world.
* @param level the level to update.
* @param levelId the id of the level.
*/
public static void updateLevelSign(final World world, final Level level, final int levelId) {
@Nullable final BlockPos levelSignPos = level.getLevelSign();
if (levelSignPos != null) {
final TileEntity te = world.getBlockEntity(levelSignPos);
if (te instanceof SignTileEntity) {
final BlockState BlockState = world.getBlockState(levelSignPos);
final SignTileEntity teLevelSign = (SignTileEntity) te;
teLevelSign.setMessage(0, new StringTextComponent(TextFormatting.stripFormatting(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.minerMineNode") + ": " + levelId)));
teLevelSign.setMessage(1, new StringTextComponent(TextFormatting.stripFormatting("Y: " + (level.getDepth() + 1))));
teLevelSign.setMessage(2, new StringTextComponent(TextFormatting.stripFormatting(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.minerNode") + ": " + level.getNumberOfBuiltNodes())));
teLevelSign.setMessage(3, new StringTextComponent(TextFormatting.stripFormatting("")));
teLevelSign.setChanged();
world.sendBlockUpdated(levelSignPos, BlockState, BlockState, 3);
}
}
}
Aggregations