-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
289 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/generated/resources/data/gcyr/tags/worldgen/biome/is_venus.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/argent_matter/gcyr/common/gui/EntityOxygenHUD.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package argent_matter.gcyr.common.gui; | ||
|
||
import argent_matter.gcyr.GCyR; | ||
import argent_matter.gcyr.common.item.armor.SpaceSuitArmorItem; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraftforge.client.gui.overlay.ForgeGui; | ||
import net.minecraftforge.client.gui.overlay.IGuiOverlay; | ||
|
||
public class EntityOxygenHUD implements IGuiOverlay { | ||
public static final ResourceLocation GUI_TEXTURE = GCyR.id("textures/gui/oxygen_bar.png"); | ||
|
||
@Override | ||
public void render(ForgeGui gui, GuiGraphics graphics, float partialTick, int screenWidth, int screenHeight) { | ||
if (!gui.getMinecraft().options.hideGui) { | ||
if (SpaceSuitArmorItem.hasFullSet(gui.getMinecraft().player)) { | ||
gui.setupOverlayRenderState(true, false); | ||
int minX = 32; | ||
int minY = screenHeight - 32; | ||
int maxY = minY + 16; | ||
graphics.blit(GUI_TEXTURE, minX, minY, 0, 0, 32, 64, 64, 64); | ||
|
||
long oxygenAmount = SpaceSuitArmorItem.oxygenAmount(gui.getMinecraft().player); | ||
long maxOxygen = SpaceSuitArmorItem.oxygenMax(gui.getMinecraft().player); | ||
if (maxOxygen == 0) { | ||
return; | ||
} | ||
graphics.blit(GUI_TEXTURE, minX, minY, 0, 0, (int) (minX + (oxygenAmount * 32.0 / maxOxygen)), 64, 64, 64); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.