/** Set world coordinates that are in the center of the GUI. */ public void setBrowsingPosition(int x, int y, double zoom) { this.browsingX = x; this.browsingY = y; this.browsingZoom = zoom; if (browsingZoom <= 0) { Log.warn("Setting map zoom to invalid value of %f", zoom); browsingZoom = SettingsConfig.userInterface.minScale; } parent.markDirty(); }
@Override public void setTile(int x, int y, Tile tile) { ShortVec2 groupPos = getKey().set((int)Math.floor(x / (float) TileGroup.CHUNK_STEP), (int)Math.floor(y / (float) TileGroup.CHUNK_STEP)); TileGroup tg = tileGroups.get(groupPos); if (tg == null) { tg = new TileGroup(groupPos.x * TileGroup.CHUNK_STEP, groupPos.y * TileGroup.CHUNK_STEP); tileGroups.put(groupPos, tg); } tg.setTile(x, y, tile); scope.extendTo(x, y); parent.markDirty(); }
(int)Math.round(-player.posZ * SettingsConfig.userInterface.defaultScale), SettingsConfig.userInterface.defaultScale); atlasData.markDirty();
this.setTile(player.dimension, x, z, new Tile(biomeId)); updatedTiles.add(new TileInfo(x, z, biomeId)); this.markDirty();
/**Reads from NBT version 2. This is designed to allow easy upgrading to version 3.*/ public void readFromNBT2(NBTTagCompound compound) { this.nbt = compound; int version = compound.getInteger(TAG_VERSION); if (version < 2) { Log.warn("Loading map with version 2 failed"); this.markDirty(); return; } NBTTagList dimensionMapList = compound.getTagList(TAG_DIMENSION_MAP_LIST, Constants.NBT.TAG_COMPOUND); for (int d = 0; d < dimensionMapList.tagCount(); d++) { NBTTagCompound dimTag = dimensionMapList.getCompoundTagAt(d); int dimensionID = dimTag.getInteger(TAG_DIMENSION_ID); int[] intArray = dimTag.getIntArray(TAG_VISITED_CHUNKS); DimensionData dimData = getDimensionData(dimensionID); for (int i = 0; i < intArray.length; i += 3) { if (dimData.getTile(intArray[i], intArray[i+1]) != null){ Log.warn("Duplicate tile at "+ intArray[i] + ", " + intArray[i]); } dimData.setTile(intArray[i], intArray[i+1], new Tile(intArray[i+2])); } Log.info("Updated " + intArray.length/3 + " chunks"); double zoom = (double)dimTag.getInteger(TAG_BROWSING_ZOOM) / BrowsingPositionPacket.ZOOM_SCALE_FACTOR; if (zoom == 0) zoom = 0.5; dimData.setBrowsingPosition(dimTag.getInteger(TAG_BROWSING_X), dimTag.getInteger(TAG_BROWSING_Y), zoom); } }
destBiomes.markDirty(); MarkersData destMarkers = AntiqueAtlasMod.markersData.getMarkersData(atlasID, world); destMarkers.markDirty();