Skip to content

Commit

Permalink
fixed map and health bug in dungeons
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeIsAParadox committed Sep 14, 2021
1 parent f1932e1 commit 731c943
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ This mod was created for those people who are tired of switching Minecraft versi

**Join The Skyblockers** [**Discord**](https://discord.com/invite/aNNJHQykck)

## Downloads/Releases [![Build Release](https://github.com/LifeIsAParadox/Skyblocker/actions/workflows/build.yml/badge.svg)](https://github.com/LifeIsAParadox/Skyblocker/actions/workflows/build.yml)
## Downloads/Releases [![Build Release](https://github.com/LifeIsAParadox/Skyblocker/actions/workflows/buildrelease.yml/badge.svg)](https://github.com/LifeIsAParadox/Skyblocker/actions/workflows/buildrelease.yml)
For the releases of Skyblocker see:
* [Modrinth](https://modrinth.com/mod/skyblocker)
* [Modrinth](https://modrinth.com/mod/skyblocker-liap)
* [GitHub releases](https://github.com/LifeIsAParadox/Skyblocker/releases)
* [![Build Beta](https://github.com/LifeIsAParadox/Skyblocker/actions/workflows/beta.yml/badge.svg)](https://github.com/LifeIsAParadox/Skyblocker/actions/workflows/beta.yml)

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ clothconfig_version=5.0.38
mod_menu_version=2.0.4

# Mod Properties
mod_version = 1.0.7
mod_version = 1.0.7.1
maven_group = me.xmrvizzy
archives_base_name = skyblocker
7 changes: 5 additions & 2 deletions src/main/java/me/xmrvizzy/skyblocker/SkyblockerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import me.xmrvizzy.skyblocker.config.SkyblockerConfig;
import me.xmrvizzy.skyblocker.skyblock.HotbarSlotLock;
import me.xmrvizzy.skyblocker.skyblock.dungeon.DungeonBlaze;
import me.xmrvizzy.skyblocker.utils.RenderUtils;
import me.xmrvizzy.skyblocker.utils.Utils;
import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.MinecraftClient;
Expand All @@ -27,10 +28,12 @@ public static void onTick() {
if (TICKS % 4 == 0)
try {
if(Utils.isDungeons){
DungeonBlaze.DungeonBlaze();
if (SkyblockerConfig.get().locations.dungeons.blazesolver) {
DungeonBlaze.DungeonBlaze();
}
}
}catch(Exception e) {
// do nothing :))
//System.out.println("Blazesolver: " + e);
}
if (TICKS % 20 == 0) {
if (client.world != null && !client.isInSingleplayer())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static class Locations {
public static class Dungeons {
public boolean enableMap = true;
public boolean solveThreeWeirdos = true;
public boolean blazesolver = true;
}

public static class DwarvenMines {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void renderStatusBars(MatrixStack matrices, CallbackInfo ci) {
if (Utils.isDungeons && SkyblockerConfig.get().locations.dungeons.enableMap)
DungeonMap.render(matrices);

this.client.getTextureManager().bindTexture(DrawableHelper.GUI_ICONS_TEXTURE);
RenderSystem.setShaderTexture(0, GUI_ICONS_TEXTURE);
}

@Inject(method = "renderMountHealth", at = @At("HEAD"), cancellable = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.map.MapState;
import net.minecraft.nbt.NbtCompound;
import org.apache.commons.lang3.StringUtils;

public class DungeonMap {

Expand All @@ -19,17 +20,17 @@ public static void render(MatrixStack matrices) {

if (tag != null && tag.contains("map")) {
String tag2 = tag.asString();
tag2 = tag2.substring(tag2.indexOf(":") + 1, tag2.indexOf("}"));
int tagid = Integer.parseInt(tag2);
tag2 = StringUtils.substringBetween(tag2, "map:", "}");
int mapid = Integer.parseInt(tag2);
VertexConsumerProvider.Immediate vertices = client.getBufferBuilders().getEffectVertexConsumers();
MapRenderer map = client.gameRenderer.getMapRenderer();
MapState state = FilledMapItem.getMapState(tagid, client.world);
MapState state = FilledMapItem.getMapState(mapid, client.world);

if (state == null) return;
matrices.push();
matrices.translate(2, 2, 0);
matrices.scale(1, 1, 0);
map.draw(matrices, vertices, 15728880,state, false,15728880);
map.draw( matrices, vertices, mapid, state, false, 15728880);
vertices.draw();
matrices.pop();
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"text.autoconfig.skyblocker.option.locations.dungeons": "Dungeons",
"text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map",
"text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "Solve Three Weirdos Puzzle",
"text.autoconfig.skyblocker.option.locations.dungeons.blazesolver": "Solve Blaze Puzzle",
"text.autoconfig.skyblocker.option.locations.dwarvenMines": "Dwarven Mines",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "Enable Drill Fuel",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "Solve Fetchur",
Expand Down

0 comments on commit 731c943

Please sign in to comment.