use of com.minecolonies.api.tileentities.AbstractTileEntityGrave in project minecolonies by Minecolonies.
the class BlockMinecoloniesGrave method spawnAfterBreak.
@Override
public void spawnAfterBreak(final BlockState state, final ServerWorld worldIn, final BlockPos pos, final ItemStack stack) {
final TileEntity tileentity = worldIn.getBlockEntity(pos);
if (tileentity instanceof TileEntityGrave) {
final IItemHandler handler = ((AbstractTileEntityGrave) tileentity).getInventory();
InventoryUtils.dropItemHandler(handler, worldIn, pos.getX(), pos.getY(), pos.getZ());
}
super.spawnAfterBreak(state, worldIn, pos, stack);
}
use of com.minecolonies.api.tileentities.AbstractTileEntityGrave in project minecolonies by ldtteam.
the class BlockMinecoloniesGrave method spawnAfterBreak.
@Override
public void spawnAfterBreak(final BlockState state, final ServerWorld worldIn, final BlockPos pos, final ItemStack stack) {
final TileEntity tileentity = worldIn.getBlockEntity(pos);
if (tileentity instanceof TileEntityGrave) {
final IItemHandler handler = ((AbstractTileEntityGrave) tileentity).getInventory();
InventoryUtils.dropItemHandler(handler, worldIn, pos.getX(), pos.getY(), pos.getZ());
}
super.spawnAfterBreak(state, worldIn, pos, stack);
}
use of com.minecolonies.api.tileentities.AbstractTileEntityGrave in project minecolonies by Minecolonies.
the class ColonyDeathpoints method tryCreatingWaypoint.
@Nullable
private static Waypoint tryCreatingWaypoint(@NotNull final Journeymap jmap, @NotNull final IColonyView colony, @NotNull final IChunk chunk, @NotNull final BlockPos pos) {
if (!jmap.getApi().playerAccepts(MOD_ID, DisplayType.Waypoint))
return null;
final TileEntity blockEntity = chunk.getBlockEntity(pos);
if (blockEntity instanceof AbstractTileEntityGrave) {
final IGraveData grave = ((AbstractTileEntityGrave) blockEntity).getGraveData();
if (grave != null) {
final String text = grave.getCitizenJobName() == null ? LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_name", grave.getCitizenName()) : LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_namejob", grave.getCitizenName(), grave.getCitizenJobName());
final Waypoint waypoint = new Waypoint(MOD_ID, text, colony.getDimension(), pos);
waypoint.setEditable(true).setPersistent(false).setIcon(deathIcon.get()).setColor(0x888888);
jmap.show(waypoint);
return waypoint;
}
}
return null;
}
use of com.minecolonies.api.tileentities.AbstractTileEntityGrave in project minecolonies by ldtteam.
the class ColonyDeathpoints method tryCreatingWaypoint.
@Nullable
private static Waypoint tryCreatingWaypoint(@NotNull final Journeymap jmap, @NotNull final IColonyView colony, @NotNull final IChunk chunk, @NotNull final BlockPos pos) {
if (!jmap.getApi().playerAccepts(MOD_ID, DisplayType.Waypoint))
return null;
final TileEntity blockEntity = chunk.getBlockEntity(pos);
if (blockEntity instanceof AbstractTileEntityGrave) {
final IGraveData grave = ((AbstractTileEntityGrave) blockEntity).getGraveData();
if (grave != null) {
final String text = grave.getCitizenJobName() == null ? LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_name", grave.getCitizenName()) : LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_namejob", grave.getCitizenName(), grave.getCitizenJobName());
final Waypoint waypoint = new Waypoint(MOD_ID, text, colony.getDimension(), pos);
waypoint.setEditable(true).setPersistent(false).setIcon(deathIcon.get()).setColor(0x888888);
jmap.show(waypoint);
return waypoint;
}
}
return null;
}
Aggregations