Skip to content

Commit

Permalink
Fix screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
hube12 committed Dec 22, 2022
1 parent b42a8fb commit a527eca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,18 @@ private void refreshHeightImageCache() {
}

private void refreshBiomeCache() {
MapPanel panel = MineMap.INSTANCE.worldTabs.getSelectedMapPanel();
int cheating;
if (panel != null && panel.manager != null) {
cheating = Math.max(1, (int) (panel.manager.blocksPerFragment / 16 / panel.manager.pixelsPerFragment));
if (this.biomeCache != null && this.layerIdCache == this.context.getLayerId() && lastCheatingBiome <= cheating) return;
} else {
cheating = 1;
int cheating=1;
if (MineMap.INSTANCE ==null){
if(this.biomeCache != null && this.layerIdCache == this.context.getLayerId())return;
}else{
MapPanel panel = MineMap.INSTANCE.worldTabs.getSelectedMapPanel();
if (panel != null && panel.manager != null) {
cheating = Math.max(1, (int) (panel.manager.blocksPerFragment / 16 / panel.manager.pixelsPerFragment));
if (this.biomeCache != null && this.layerIdCache == this.context.getLayerId() && lastCheatingBiome <= cheating) return;
}
lastCheatingBiome = cheating;
}
lastCheatingBiome = cheating;

this.layerIdCache = this.context.getLayerId();
BiomeLayer layer = this.context.getBiomeLayer();
int effectiveRegion = Math.max(Math.max(this.regionSize / layer.getScale(), 1) / cheating, 1);
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/Test.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.seedfinding.mcfeature.misc.SlimeChunk;
import com.seedfinding.mcfeature.structure.Mineshaft;
import com.seedfinding.minemap.feature.chests.Chests;
import com.seedfinding.minemap.init.Configs;
import com.seedfinding.minemap.init.Features;
import com.seedfinding.minemap.init.Icons;
Expand All @@ -20,8 +21,9 @@ public class Test {
public static void main(String[] args) throws IOException {
//Initializes the icons, features and biome colors.
Features.registerFeatures();
Chests.registerChests();
Configs.registerConfigs();
Icons.registerIcons();
Icons.registerIcons(); // this depends on config

MapSettings settings = new MapSettings(MCVersion.v1_12, Dimension.OVERWORLD).refresh();
MapContext context = new MapContext(1234L, settings);
Expand Down

0 comments on commit a527eca

Please sign in to comment.