use of com.ldtteam.structurize.network.messages.AddRemoveTagMessage in project Structurize by ldtteam.
the class WindowTagTool method removeTag.
/**
* Removes a block pos
*
* @param button
*/
private void removeTag(final Button button) {
int row = tagList.getListElementIndexByPane(button);
BlockPos toRemove = positionsList.get(row);
TileEntity te = world.getBlockEntity(anchorPos);
if (te instanceof IBlueprintDataProvider) {
IBlueprintDataProvider dataTE = (IBlueprintDataProvider) te;
Map<BlockPos, List<String>> map = dataTE.getPositionedTags();
if (map.containsKey(toRemove) && !map.get(toRemove).isEmpty()) {
String tag = map.get(toRemove).get(map.get(toRemove).size() - 1);
dataTE.removeTag(toRemove, tag);
Network.getNetwork().sendToServer(new AddRemoveTagMessage(false, tag, toRemove, anchorPos));
}
updateResourceList();
} else {
close();
}
}
Aggregations