Compare commits
5 Commits
v1.1-1.14-
...
v1.1.1-1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d955b3f81 | ||
|
|
711e6121d4 | ||
|
|
13045618ec | ||
|
|
5e553f2e72 | ||
|
|
2fe4ec56f8 |
@@ -100,7 +100,7 @@ dependencies {
|
||||
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
||||
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
|
||||
|
||||
// compile(fg.deobf("me.shedaniel.cloth:cloth-config-forge:${project.cloth_version}"))
|
||||
compile(fg.deobf("me.shedaniel.cloth:cloth-config-forge:${project.cloth_version}"))
|
||||
// You may put jars on which you depend on in ./libs or you may define them like so..
|
||||
// compile "some.group:artifact:version:classifier"
|
||||
// compile "some.group:artifact:version"
|
||||
|
||||
@@ -4,12 +4,13 @@ org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
# Forge Properties
|
||||
minecraft_version=1.14.2
|
||||
mappings=20190621-1.14.2
|
||||
forge_version=26.0.63
|
||||
minecraft_version=1.16.4
|
||||
mappings=20201028-1.16.3
|
||||
forge_version=35.1.37
|
||||
|
||||
cloth_version=4.11.14
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.1
|
||||
mod_version = 1.1.1
|
||||
maven_group = markil3
|
||||
archives_base_name = immersive_hud
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
|
||||
@@ -3,6 +3,7 @@ package markil3.immersive_hud;
|
||||
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
import com.electronwill.nightconfig.core.io.WritingMode;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
@@ -20,7 +21,8 @@ import static markil3.immersive_hud.Main.TICKS_PER_SECOND;
|
||||
* <p>
|
||||
* The methods that change this mod's configuration do not automatically write
|
||||
* those changes to the configuration file on disk. Instead, they only update
|
||||
* the configuration in memory.
|
||||
* the configuration in memory. To write any changes, use the {@link #save()}
|
||||
* method.
|
||||
*
|
||||
* @author Markil 3
|
||||
*/
|
||||
@@ -49,7 +51,7 @@ public class ConfigManager
|
||||
new ForgeConfigSpec.Builder().configure(ConfigManager::new);
|
||||
INSTANCE = specPair.getLeft();
|
||||
SPEC = specPair.getRight();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(CONFIG_PATH)
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(Minecraft.getInstance().gameDir.toPath().toAbsolutePath().resolve(CONFIG_PATH))
|
||||
.sync()
|
||||
.autoreload()
|
||||
.writingMode(WritingMode.REPLACE)
|
||||
@@ -131,20 +133,20 @@ public class ConfigManager
|
||||
return this.fadeOut.get();
|
||||
}
|
||||
|
||||
// public void setMaxTime(int time)
|
||||
// {
|
||||
// this.maxTime.set(time);
|
||||
// }
|
||||
//
|
||||
// public void setFadeInTime(int time)
|
||||
// {
|
||||
// this.fadeIn.set(time);
|
||||
// }
|
||||
//
|
||||
// public void setFadeOutTime(int time)
|
||||
// {
|
||||
// this.fadeOut.set(time);
|
||||
// }
|
||||
public void setMaxTime(int time)
|
||||
{
|
||||
this.maxTime.set(time);
|
||||
}
|
||||
|
||||
public void setFadeInTime(int time)
|
||||
{
|
||||
this.fadeIn.set(time);
|
||||
}
|
||||
|
||||
public void setFadeOutTime(int time)
|
||||
{
|
||||
this.fadeOut.set(time);
|
||||
}
|
||||
}
|
||||
|
||||
private final TimeValues hotbarTime;
|
||||
@@ -353,83 +355,83 @@ public class ConfigManager
|
||||
return this.minHunger.get();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Sets the time that the hands are allowed to display.
|
||||
// *
|
||||
// * @param time - The hand display time values.
|
||||
// */
|
||||
// public void setCrosshairTime(int time)
|
||||
// {
|
||||
// this.crosshairTime.set(time);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Sets whether the crosshairs should be hidden after a period of time.
|
||||
// *
|
||||
// * @param hide - Whether or not crosshairs will be hidden.
|
||||
// */
|
||||
// public void hideCrosshair(boolean hide)
|
||||
// {
|
||||
// this.hideCrosshair.set(hide);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Sets the time that the hands are allowed to display.
|
||||
// *
|
||||
// * @param time - The hand display time values.
|
||||
// */
|
||||
// public void setHandTime(int time)
|
||||
// {
|
||||
// this.handTime.set(time);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Sets whether hands should be hidden after a period of time.
|
||||
// *
|
||||
// * @param hide - Whether or not hands will be hidden.
|
||||
// */
|
||||
// public void hideHands(boolean hide)
|
||||
// {
|
||||
// this.hideHands.set(hide);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Determines whether the armor bar should render.
|
||||
// *
|
||||
// * @param show - Whether or not armor shows on the HUD.
|
||||
// */
|
||||
// public void shouldShowArmor(boolean show)
|
||||
// {
|
||||
// this.showArmor.set(show);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Sets the minimum health for fading. Anything below that and the health
|
||||
// * always displays.
|
||||
// *
|
||||
// * @param boundary - The health boundary, from 0 to 1.
|
||||
// */
|
||||
// public void setMinHealth(double boundary)
|
||||
// {
|
||||
// this.minHealth.set(MathHelper.clamp(boundary, 0, 1));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Sets the minimum hunger for fading. Anything below that and the hunger
|
||||
// * always displays.
|
||||
// *
|
||||
// * @param boundary - The hunger boundary, from 0 to 20.
|
||||
// */
|
||||
// public void setMinHunger(int boundary)
|
||||
// {
|
||||
// this.minHunger.set(MathHelper.clamp(boundary, 0, 20));
|
||||
// }
|
||||
/**
|
||||
* Sets the time that the hands are allowed to display.
|
||||
*
|
||||
* @param time - The hand display time values.
|
||||
*/
|
||||
public void setCrosshairTime(int time)
|
||||
{
|
||||
this.crosshairTime.set(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the crosshairs should be hidden after a period of time.
|
||||
*
|
||||
* @param hide - Whether or not crosshairs will be hidden.
|
||||
*/
|
||||
public void hideCrosshair(boolean hide)
|
||||
{
|
||||
this.hideCrosshair.set(hide);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the time that the hands are allowed to display.
|
||||
*
|
||||
* @param time - The hand display time values.
|
||||
*/
|
||||
public void setHandTime(int time)
|
||||
{
|
||||
this.handTime.set(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether hands should be hidden after a period of time.
|
||||
*
|
||||
* @param hide - Whether or not hands will be hidden.
|
||||
*/
|
||||
public void hideHands(boolean hide)
|
||||
{
|
||||
this.hideHands.set(hide);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the armor bar should render.
|
||||
*
|
||||
* @param show - Whether or not armor shows on the HUD.
|
||||
*/
|
||||
public void shouldShowArmor(boolean show)
|
||||
{
|
||||
this.showArmor.set(show);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum health for fading. Anything below that and the health
|
||||
* always displays.
|
||||
*
|
||||
* @param boundary - The health boundary, from 0 to 1.
|
||||
*/
|
||||
public void setMinHealth(double boundary)
|
||||
{
|
||||
this.minHealth.set(MathHelper.clamp(boundary, 0, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum hunger for fading. Anything below that and the hunger
|
||||
* always displays.
|
||||
*
|
||||
* @param boundary - The hunger boundary, from 0 to 20.
|
||||
*/
|
||||
public void setMinHunger(int boundary)
|
||||
{
|
||||
this.minHunger.set(MathHelper.clamp(boundary, 0, 20));
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves changes to this mod's configuration.
|
||||
*/
|
||||
// public void save()
|
||||
// {
|
||||
// SPEC.save();
|
||||
// }
|
||||
public void save()
|
||||
{
|
||||
SPEC.save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,12 @@
|
||||
*/
|
||||
package markil3.immersive_hud;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderSpecificHandEvent;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.event.entity.EntityMountEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
@@ -63,13 +61,18 @@ public class EventBus
|
||||
{
|
||||
try
|
||||
{
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
|
||||
DistExecutor.safeRunWhenOn(Dist.CLIENT,
|
||||
(DistExecutor.SafeSupplier<DistExecutor.SafeRunnable>) () -> new DistExecutor.SafeRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Item item =
|
||||
Optional.ofNullable(event.getItemStack())
|
||||
.map(ItemStack::getItem)
|
||||
.orElse(null);
|
||||
TimerUtils.onClick(event.getHand(), item);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -95,9 +98,14 @@ public class EventBus
|
||||
{
|
||||
try
|
||||
{
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
|
||||
DistExecutor.safeRunWhenOn(Dist.CLIENT,
|
||||
(DistExecutor.SafeSupplier<DistExecutor.SafeRunnable>) () -> new DistExecutor.SafeRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
TimerUtils.resetMountHealth();
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -116,11 +124,12 @@ public class EventBus
|
||||
* @param event - event data
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public static void onRenderHand(final RenderSpecificHandEvent event)
|
||||
public static void onRenderHand(final RenderHandEvent event)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TimerUtils.onRenderHand(event.getHand(),
|
||||
event.getMatrixStack(),
|
||||
event.getPartialTicks()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
@@ -173,7 +182,8 @@ public class EventBus
|
||||
TimerUtils.updatePotions(mc.player);
|
||||
event.setCanceled(true);
|
||||
RenderUtils.renderPotionIcons(mc,
|
||||
mc.ingameGUI, event.getPartialTicks());
|
||||
mc.ingameGUI,
|
||||
event.getMatrixStack(), event.getPartialTicks());
|
||||
resetAlpha();
|
||||
}
|
||||
break;
|
||||
@@ -184,6 +194,7 @@ public class EventBus
|
||||
if (!TimerUtils.drawHotbar(event.getPartialTicks()))
|
||||
{
|
||||
RenderUtils.renderHotbar(mc, mc.ingameGUI,
|
||||
event.getMatrixStack(),
|
||||
event.getPartialTicks(), TimerUtils.hotbarTime);
|
||||
}
|
||||
}
|
||||
@@ -191,21 +202,23 @@ public class EventBus
|
||||
case HEALTH:
|
||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||
{
|
||||
if (TimerUtils.drawHealth(event.getPartialTicks()))
|
||||
if (TimerUtils.drawHealth(event.getMatrixStack(),
|
||||
event.getPartialTicks()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||
{
|
||||
GlStateManager.popMatrix();
|
||||
event.getMatrixStack().pop();
|
||||
resetAlpha();
|
||||
}
|
||||
break;
|
||||
case FOOD:
|
||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||
{
|
||||
if (TimerUtils.drawHunger(event.getPartialTicks()))
|
||||
if (TimerUtils.drawHunger(event.getMatrixStack(),
|
||||
event.getPartialTicks()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
@@ -215,14 +228,15 @@ public class EventBus
|
||||
*/
|
||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||
{
|
||||
GlStateManager.popMatrix();
|
||||
event.getMatrixStack().pop();
|
||||
resetAlpha();
|
||||
}
|
||||
break;
|
||||
case ARMOR:
|
||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||
{
|
||||
if (TimerUtils.drawArmor(event.getPartialTicks()))
|
||||
if (TimerUtils.drawArmor(event.getMatrixStack(),
|
||||
event.getPartialTicks()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
@@ -232,14 +246,15 @@ public class EventBus
|
||||
*/
|
||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||
{
|
||||
GlStateManager.popMatrix();
|
||||
event.getMatrixStack().pop();
|
||||
resetAlpha();
|
||||
}
|
||||
break;
|
||||
case AIR:
|
||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||
{
|
||||
if (TimerUtils.drawAir(event.getPartialTicks()))
|
||||
if (TimerUtils.drawAir(event.getMatrixStack(),
|
||||
event.getPartialTicks()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
@@ -249,21 +264,22 @@ public class EventBus
|
||||
*/
|
||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||
{
|
||||
GlStateManager.popMatrix();
|
||||
event.getMatrixStack().pop();
|
||||
resetAlpha();
|
||||
}
|
||||
break;
|
||||
case HEALTHMOUNT:
|
||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||
{
|
||||
if (TimerUtils.drawMountHealth(event.getPartialTicks()))
|
||||
if (TimerUtils.drawMountHealth(event.getMatrixStack(),
|
||||
event.getPartialTicks()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||
{
|
||||
GlStateManager.popMatrix();
|
||||
event.getMatrixStack().pop();
|
||||
resetAlpha();
|
||||
}
|
||||
break;
|
||||
@@ -275,6 +291,7 @@ public class EventBus
|
||||
{
|
||||
RenderUtils.renderHorseJumpBar(mc,
|
||||
mc.ingameGUI,
|
||||
event.getMatrixStack(),
|
||||
event.getPartialTicks(),
|
||||
TimerUtils.jumpTime);
|
||||
}
|
||||
@@ -288,6 +305,7 @@ public class EventBus
|
||||
{
|
||||
RenderUtils.renderExperience(mc,
|
||||
mc.ingameGUI,
|
||||
event.getMatrixStack(),
|
||||
event.getPartialTicks(),
|
||||
TimerUtils.experienceTime);
|
||||
}
|
||||
|
||||
@@ -17,8 +17,11 @@
|
||||
*/
|
||||
package markil3.immersive_hud;
|
||||
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraftforge.fml.ExtensionPoint;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
@@ -53,7 +56,7 @@ public class Main
|
||||
{
|
||||
if (Class.forName("me.shedaniel.clothconfig2.api.ConfigBuilder") != null)
|
||||
{
|
||||
// ModMenu.setupScreen();
|
||||
ModMenu.setupScreen();
|
||||
}
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
|
||||
194
src/main/java/markil3/immersive_hud/ModMenu.java
Normal file
194
src/main/java/markil3/immersive_hud/ModMenu.java
Normal file
@@ -0,0 +1,194 @@
|
||||
package markil3.immersive_hud;
|
||||
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraftforge.fml.ExtensionPoint;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
|
||||
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||
import me.shedaniel.clothconfig2.gui.entries.DoubleListEntry;
|
||||
|
||||
import static markil3.immersive_hud.Main.TICKS_PER_SECOND;
|
||||
|
||||
public class ModMenu
|
||||
{
|
||||
|
||||
static void startTimeField(ConfigEntryBuilder entryBuilder,
|
||||
ConfigCategory cat,
|
||||
ConfigManager.TimeValues value)
|
||||
{
|
||||
final float SHOW_TIME = 6;
|
||||
final float FADE_IN = 0.25F;
|
||||
final float FADE_OUT = 0.5F;
|
||||
|
||||
DoubleListEntry maxTime =
|
||||
entryBuilder.startDoubleField(new TranslationTextComponent(
|
||||
"option.immersive_hud." + value.getName() +
|
||||
"MaxTime"),
|
||||
(float) value.getMaxTime() / TICKS_PER_SECOND)
|
||||
.setDefaultValue(SHOW_TIME)
|
||||
.setMin(0)
|
||||
.setMax(10 * 60 * TICKS_PER_SECOND) // 10 Minutes
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud." + value.getName() +
|
||||
"MaxTime"))
|
||||
.setSaveConsumer(val -> value.setMaxTime((int) (val * TICKS_PER_SECOND)))
|
||||
.build();
|
||||
|
||||
DoubleListEntry fadeIn =
|
||||
entryBuilder.startDoubleField(new TranslationTextComponent(
|
||||
"option.immersive_hud." + value.getName() +
|
||||
"FadeIn"),
|
||||
(float) value.getFadeInTime() / TICKS_PER_SECOND)
|
||||
.setDefaultValue(FADE_IN).setMin(0).setMax(10 * 60 * TICKS_PER_SECOND)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud." + value.getName() +
|
||||
"FadeIn"))
|
||||
.setSaveConsumer(val -> value.setFadeInTime((int) (val * TICKS_PER_SECOND)))
|
||||
.build();
|
||||
|
||||
DoubleListEntry fadeOut =
|
||||
entryBuilder.startDoubleField(new TranslationTextComponent(
|
||||
"option.immersive_hud." + value.getName() +
|
||||
"FadeOut"),
|
||||
(float) value.getFadeOutTime() / TICKS_PER_SECOND)
|
||||
.setDefaultValue(FADE_OUT)
|
||||
.setMin(0)
|
||||
.setMax(10 * 60 * TICKS_PER_SECOND)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud." + value.getName() +
|
||||
"FadeOut"))
|
||||
.setSaveConsumer(val -> value.setFadeOutTime((int) (val * TICKS_PER_SECOND)))
|
||||
.build();
|
||||
|
||||
cat.addEntry(maxTime);
|
||||
cat.addEntry(fadeIn);
|
||||
cat.addEntry(fadeOut);
|
||||
}
|
||||
|
||||
static void setupScreen()
|
||||
{
|
||||
ModLoadingContext.get()
|
||||
.registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
|
||||
() -> (mc, screen) -> {
|
||||
ConfigCategory general;
|
||||
ConfigEntryBuilder entryBuilder;
|
||||
final ConfigBuilder builder = ConfigBuilder.create()
|
||||
.setParentScreen(screen)
|
||||
.setTitle(new TranslationTextComponent(
|
||||
"immersive_hud.configGui.title"))
|
||||
.setSavingRunnable(() -> {
|
||||
ConfigManager.getInstance().save();
|
||||
});
|
||||
general =
|
||||
builder.getOrCreateCategory(new TranslationTextComponent(
|
||||
"category.immersive_hud.general"));
|
||||
entryBuilder = builder.entryBuilder();
|
||||
|
||||
startTimeField(entryBuilder,
|
||||
general,
|
||||
ConfigManager.getInstance()
|
||||
.getHotbarTime());
|
||||
startTimeField(entryBuilder,
|
||||
general,
|
||||
ConfigManager.getInstance()
|
||||
.getExperenceTime());
|
||||
startTimeField(entryBuilder,
|
||||
general,
|
||||
ConfigManager.getInstance().getJumpTime());
|
||||
startTimeField(entryBuilder,
|
||||
general,
|
||||
ConfigManager.getInstance()
|
||||
.getHealthTime());
|
||||
startTimeField(entryBuilder,
|
||||
general,
|
||||
ConfigManager.getInstance()
|
||||
.getHungerTime());
|
||||
startTimeField(entryBuilder,
|
||||
general,
|
||||
ConfigManager.getInstance()
|
||||
.getPotionTime());
|
||||
|
||||
general.addEntry(entryBuilder.startDoubleField(new TranslationTextComponent(
|
||||
"option.immersive_hud" +
|
||||
".crosshairTime"),
|
||||
(float) ConfigManager.getInstance()
|
||||
.getCrosshairTime() / TICKS_PER_SECOND)
|
||||
.setDefaultValue(6)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud" +
|
||||
".crosshairTime"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.setCrosshairTime((int) (val * TICKS_PER_SECOND)))
|
||||
.build());
|
||||
|
||||
general.addEntry(entryBuilder.startBooleanToggle(new TranslationTextComponent(
|
||||
"option.immersive_hud.hideCrosshair"), ConfigManager.getInstance().hideCrosshair())
|
||||
.setDefaultValue(true)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud.hideCrosshair"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.hideCrosshair(val))
|
||||
.build());
|
||||
|
||||
general.addEntry(entryBuilder.startDoubleField(new TranslationTextComponent(
|
||||
"option.immersive_hud.handTime"),
|
||||
(float) ConfigManager.getInstance()
|
||||
.getHandTime() / TICKS_PER_SECOND)
|
||||
.setDefaultValue(30)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud.handTime"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.setHandTime((int) (val * TICKS_PER_SECOND)))
|
||||
.build());
|
||||
|
||||
general.addEntry(entryBuilder.startBooleanToggle(new TranslationTextComponent(
|
||||
"option.immersive_hud.hideHands"), ConfigManager.getInstance().hideHands())
|
||||
.setDefaultValue(true)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud.hideHands"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.hideHands(val))
|
||||
.build());
|
||||
|
||||
general.addEntry(entryBuilder.startDoubleField(new TranslationTextComponent(
|
||||
"option.immersive_hud.minHealth"),
|
||||
ConfigManager.getInstance()
|
||||
.getMinHealth())
|
||||
.setDefaultValue(0.5)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud.minHealth"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.setMinHealth(
|
||||
val))
|
||||
.build());
|
||||
|
||||
general.addEntry(entryBuilder.startIntField(new TranslationTextComponent(
|
||||
"option.immersive_hud.minHunger"),
|
||||
ConfigManager.getInstance()
|
||||
.getMinHunger())
|
||||
.setDefaultValue(17)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud.minHunger"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.setMinHunger(
|
||||
val))
|
||||
.build());
|
||||
|
||||
general.addEntry(entryBuilder.startBooleanToggle(new TranslationTextComponent(
|
||||
"option.immersive_hud.showArmor"),
|
||||
ConfigManager.getInstance()
|
||||
.shouldShowArmor())
|
||||
.setDefaultValue(true)
|
||||
.setTooltip(new TranslationTextComponent(
|
||||
"tooltip.immersive_hud.showArmor"))
|
||||
.setSaveConsumer(val -> ConfigManager.getInstance()
|
||||
.shouldShowArmor(
|
||||
val))
|
||||
.build());
|
||||
|
||||
return builder.build();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -16,19 +16,22 @@ package markil3.immersive_hud;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.IngameGui;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.client.renderer.texture.PotionSpriteUploader;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.settings.AttackIndicatorStatus;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
@@ -40,10 +43,9 @@ import net.minecraft.potion.Effect;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.HandSide;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -58,79 +60,18 @@ import java.util.List;
|
||||
*/
|
||||
public class RenderUtils
|
||||
{
|
||||
private static int getBlitOffset(IngameGui gui)
|
||||
{
|
||||
Field blitAccessField = null;
|
||||
int blitAccess = 0;
|
||||
try
|
||||
{
|
||||
blitAccessField = AbstractGui.class.getDeclaredField("blitOffset");
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (!blitAccessField.isAccessible())
|
||||
{
|
||||
blitAccessField.setAccessible(true);
|
||||
}
|
||||
try
|
||||
{
|
||||
blitAccess = (int) blitAccessField.get(gui);
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return blitAccess;
|
||||
}
|
||||
|
||||
private static boolean setBlitOffset(IngameGui gui, int value)
|
||||
{
|
||||
Field blitAccessField = null;
|
||||
int blitAccess = 0;
|
||||
try
|
||||
{
|
||||
blitAccessField = AbstractGui.class.getDeclaredField("blitOffset");
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!blitAccessField.isAccessible())
|
||||
{
|
||||
blitAccessField.setAccessible(true);
|
||||
}
|
||||
try
|
||||
{
|
||||
blitAccessField.set(gui, value);
|
||||
return true;
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderPotionIcons(Minecraft mc,
|
||||
IngameGui gui,
|
||||
float ticks)
|
||||
MatrixStack matrixStack, float ticks)
|
||||
{
|
||||
|
||||
int scaledWidth = mc.mainWindow.getScaledWidth();
|
||||
int scaledHeight = mc.mainWindow.getScaledHeight();
|
||||
int scaledWidth = mc.getMainWindow().getScaledWidth();
|
||||
int scaledHeight = mc.getMainWindow().getScaledHeight();
|
||||
|
||||
Collection<EffectInstance> collection =
|
||||
mc.player.getActivePotionEffects();
|
||||
|
||||
|
||||
if (!collection.isEmpty())
|
||||
{
|
||||
GlStateManager.enableBlend();
|
||||
RenderSystem.enableBlend();
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
PotionSpriteUploader potionspriteuploader =
|
||||
@@ -145,10 +86,8 @@ public class RenderUtils
|
||||
.sortedCopy(collection))
|
||||
{
|
||||
Effect effect = effectinstance.getPotion();
|
||||
float effectAlpha = TimerUtils.getPotionAlpha(mc.player,
|
||||
effectinstance,
|
||||
ticks);
|
||||
if (!effectinstance.isShowIcon() || effectAlpha < 0.01F)
|
||||
float effectAlpha = TimerUtils.getPotionAlpha(mc.player, effectinstance, ticks);
|
||||
if (!effectinstance.shouldRenderHUD() || effectAlpha < 0.01F)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -176,35 +115,43 @@ public class RenderUtils
|
||||
l += 26;
|
||||
}
|
||||
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, effectAlpha);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, effectAlpha);
|
||||
if (effectinstance.isAmbient())
|
||||
{
|
||||
gui.blit(k, l, 165, 166, 24, 24);
|
||||
gui.blit(matrixStack, k, l, 165, 166, 24, 24);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.blit(k, l, 141, 166, 24, 24);
|
||||
gui.blit(matrixStack, k, l, 141, 166, 24, 24);
|
||||
}
|
||||
|
||||
float f_f = effectAlpha;
|
||||
int k_f = k;
|
||||
int l_f = l;
|
||||
|
||||
TextureAtlasSprite textureatlassprite =
|
||||
potionspriteuploader.func_215288_a(effect);
|
||||
potionspriteuploader.getSprite(effect);
|
||||
int j1 = k;
|
||||
int k1 = l;
|
||||
float f1 = effectAlpha;
|
||||
list.add(() -> {
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, f_f);
|
||||
gui.blit(k_f + 3, l_f + 3, getBlitOffset(gui), 18, 18, textureatlassprite);
|
||||
mc.getTextureManager()
|
||||
.bindTexture(textureatlassprite.getAtlasTexture()
|
||||
.getTextureLocation());
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);
|
||||
gui.blit(matrixStack,
|
||||
j1 + 3,
|
||||
k1 + 3,
|
||||
gui.getBlitOffset(),
|
||||
18,
|
||||
18,
|
||||
textureatlassprite);
|
||||
});
|
||||
effect.renderHUDEffect(effectinstance, gui,
|
||||
effectinstance.renderHUDEffect(gui,
|
||||
matrixStack,
|
||||
k,
|
||||
l,
|
||||
getBlitOffset(gui),
|
||||
gui.getBlitOffset(),
|
||||
effectAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
mc.getTextureManager().bindTexture(AtlasTexture.LOCATION_EFFECTS_TEXTURE);
|
||||
list.forEach(Runnable::run);
|
||||
}
|
||||
}
|
||||
@@ -214,47 +161,45 @@ public class RenderUtils
|
||||
*
|
||||
* @param mc - A Minecraft instance.
|
||||
* @param gui - The GUI.
|
||||
* @param matrixStack - The rendering transformation matrix stack.
|
||||
* @param ticks
|
||||
* @param renderTime - How much time before this element becomes fully
|
||||
* transparent.
|
||||
*
|
||||
* @see IngameGui#renderHorseJumpBar(int)
|
||||
* @see IngameGui#renderHorseJumpBar(MatrixStack, int)
|
||||
*/
|
||||
public static void renderHorseJumpBar(Minecraft mc,
|
||||
IngameGui gui,
|
||||
MatrixStack matrixStack,
|
||||
float ticks, double renderTime)
|
||||
{
|
||||
ConfigManager.TimeValues jump =
|
||||
ConfigManager.getInstance().getJumpTime();
|
||||
ConfigManager.TimeValues jump = ConfigManager.getInstance().getJumpTime();
|
||||
if (renderTime <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float alpha = Main.getAlpha(renderTime,
|
||||
jump.getMaxTime(),
|
||||
jump.getFadeInTime(),
|
||||
jump.getFadeOutTime());
|
||||
int scaledWidth = mc.mainWindow.getScaledWidth();
|
||||
int scaledHeight = mc.mainWindow.getScaledHeight();
|
||||
float alpha = Main.getAlpha(renderTime, jump.getMaxTime(), jump.getFadeInTime(), jump.getFadeOutTime());
|
||||
int scaledWidth = mc.getMainWindow().getScaledWidth();
|
||||
int scaledHeight = mc.getMainWindow().getScaledHeight();
|
||||
int xPosition = scaledWidth / 2 - 91;
|
||||
|
||||
mc.getProfiler().startSection("jumpBar");
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
|
||||
float f = mc.player.getHorseJumpPower();
|
||||
int i = 182;
|
||||
int j = (int) (f * 183.0F);
|
||||
int k = scaledHeight - TimerUtils.getJumpTranslation();
|
||||
gui.blit(xPosition, k, 0, 84, 182, 5);
|
||||
gui.blit(matrixStack, xPosition, k, 0, 84, 182, 5);
|
||||
if (j > 0)
|
||||
{
|
||||
gui.blit(xPosition, k, 0, 89, j, 5);
|
||||
gui.blit(matrixStack, xPosition, k, 0, 89, j, 5);
|
||||
}
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
RenderSystem.disableBlend();
|
||||
mc.getProfiler().endSection();
|
||||
}
|
||||
|
||||
@@ -263,39 +208,36 @@ public class RenderUtils
|
||||
*
|
||||
* @param mc - A Minecraft instance.
|
||||
* @param gui - The GUI.
|
||||
* @param matrixStack - The rendering transformation matrix stack.
|
||||
* @param ticks
|
||||
* @param renderTime - How much time before this element becomes fully
|
||||
* transparent.
|
||||
*
|
||||
* @see IngameGui#func_238454_b_(int)
|
||||
* @see IngameGui#func_238454_b_(MatrixStack, int)
|
||||
*/
|
||||
public static void renderExperience(Minecraft mc,
|
||||
IngameGui gui,
|
||||
MatrixStack matrixStack,
|
||||
float ticks, double renderTime)
|
||||
{
|
||||
ConfigManager.TimeValues experience =
|
||||
ConfigManager.getInstance().getHealthTime();
|
||||
ConfigManager.TimeValues hotbar =
|
||||
ConfigManager.getInstance().getHotbarTime();
|
||||
ConfigManager.TimeValues experience = ConfigManager.getInstance().getHealthTime();
|
||||
ConfigManager.TimeValues hotbar = ConfigManager.getInstance().getHotbarTime();
|
||||
if (renderTime <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float alpha = Main.getAlpha(renderTime,
|
||||
experience.getMaxTime(),
|
||||
experience.getFadeInTime(),
|
||||
experience.getFadeOutTime());
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
float alpha = Main.getAlpha(renderTime, experience.getMaxTime(), experience.getFadeInTime(), experience.getFadeOutTime());
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
|
||||
if (mc.playerController.gameIsSurvivalOrAdventure())
|
||||
{
|
||||
int scaledWidth = mc.mainWindow.getScaledWidth();
|
||||
int scaledHeight = mc.mainWindow.getScaledHeight();
|
||||
int scaledWidth = mc.getMainWindow().getScaledWidth();
|
||||
int scaledHeight = mc.getMainWindow().getScaledHeight();
|
||||
int x = scaledWidth / 2 - 91;
|
||||
|
||||
mc.getProfiler().startSection("expBar");
|
||||
GlStateManager.enableBlend();
|
||||
RenderSystem.enableBlend();
|
||||
mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
|
||||
int i = mc.player.xpBarCap();
|
||||
if (i > 0)
|
||||
@@ -303,57 +245,58 @@ public class RenderUtils
|
||||
int j = 182;
|
||||
int k = (int) (mc.player.experience * 183.0F);
|
||||
int l = scaledHeight - TimerUtils.getExperienceTranslation();
|
||||
gui.blit(x, l, 0, 64, 182, 5);
|
||||
gui.blit(matrixStack, x, l, 0, 64, 182, 5);
|
||||
if (k > 0)
|
||||
{
|
||||
gui.blit(x, l, 0, 69, k, 5);
|
||||
gui.blit(matrixStack, x, l, 0, 69, k, 5);
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
RenderSystem.disableBlend();
|
||||
mc.getProfiler().endSection();
|
||||
if (mc.player.experienceLevel > 0)
|
||||
{
|
||||
mc.getProfiler().startSection("expLevel");
|
||||
GlStateManager.enableBlend();
|
||||
RenderSystem.enableBlend();
|
||||
String s = "" + mc.player.experienceLevel;
|
||||
int i1 = (scaledWidth - gui.getFontRenderer()
|
||||
.getStringWidth(s)) / 2;
|
||||
int j1 =
|
||||
scaledHeight - (int) ((22F * Main.getAlpha(TimerUtils.hotbarTime,
|
||||
hotbar.getMaxTime(),
|
||||
hotbar.getFadeInTime(),
|
||||
hotbar.getFadeOutTime()) + 9F) * alpha) - (int) (4F * alpha);
|
||||
int j1 = scaledHeight - (int) ((22F * Main.getAlpha(TimerUtils.hotbarTime, hotbar.getMaxTime(), hotbar.getFadeInTime(), hotbar.getFadeOutTime()) + 9F) * alpha) - (int) (4F * alpha);
|
||||
gui.getFontRenderer()
|
||||
.drawString(s,
|
||||
.drawString(matrixStack,
|
||||
s,
|
||||
(float) (i1 + 1),
|
||||
(float) j1,
|
||||
0);
|
||||
gui.getFontRenderer()
|
||||
.drawString(s,
|
||||
.drawString(matrixStack,
|
||||
s,
|
||||
(float) (i1 - 1),
|
||||
(float) j1,
|
||||
0);
|
||||
gui.getFontRenderer()
|
||||
.drawString(s,
|
||||
.drawString(matrixStack,
|
||||
s,
|
||||
(float) i1,
|
||||
(float) (j1 + 1),
|
||||
0);
|
||||
gui.getFontRenderer()
|
||||
.drawString(s,
|
||||
.drawString(matrixStack,
|
||||
s,
|
||||
(float) i1,
|
||||
(float) (j1 - 1),
|
||||
0);
|
||||
gui.getFontRenderer()
|
||||
.drawString(s,
|
||||
.drawString(matrixStack,
|
||||
s,
|
||||
(float) i1,
|
||||
(float) j1,
|
||||
8453920);
|
||||
GlStateManager.disableBlend();
|
||||
RenderSystem.disableBlend();
|
||||
mc.getProfiler().endSection();
|
||||
}
|
||||
}
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
|
||||
@@ -362,19 +305,20 @@ public class RenderUtils
|
||||
*
|
||||
* @param mc - A Minecraft instance.
|
||||
* @param gui - The GUI.
|
||||
* @param matrixStack - The rendering transformation matrix stack.
|
||||
* @param partialTicks
|
||||
* @param renderTime - How much time before this element becomes fully
|
||||
* transparent.
|
||||
*
|
||||
* @see IngameGui#renderHotbar(float)
|
||||
* @see IngameGui#renderHotbar(float, MatrixStack)
|
||||
*/
|
||||
public static void renderHotbar(Minecraft mc,
|
||||
IngameGui gui,
|
||||
MatrixStack matrixStack,
|
||||
float partialTicks,
|
||||
double renderTime)
|
||||
{
|
||||
ConfigManager.TimeValues hotbar =
|
||||
ConfigManager.getInstance().getHotbarTime();
|
||||
ConfigManager.TimeValues hotbar = ConfigManager.getInstance().getHotbarTime();
|
||||
final ResourceLocation WIDGETS_TEX_PATH =
|
||||
new ResourceLocation("textures/gui/widgets.png");
|
||||
PlayerEntity playerentity = mc.player;
|
||||
@@ -384,27 +328,24 @@ public class RenderUtils
|
||||
return;
|
||||
}
|
||||
|
||||
float alpha = Main.getAlpha(renderTime,
|
||||
hotbar.getMaxTime(),
|
||||
hotbar.getFadeInTime(),
|
||||
hotbar.getFadeOutTime());
|
||||
float alpha = Main.getAlpha(renderTime, hotbar.getMaxTime(), hotbar.getFadeInTime(), hotbar.getFadeOutTime());
|
||||
|
||||
int scaledWidth = mc.mainWindow.getScaledWidth();
|
||||
int scaledHeight = mc.mainWindow.getScaledHeight();
|
||||
int scaledWidth = mc.getMainWindow().getScaledWidth();
|
||||
int scaledHeight = mc.getMainWindow().getScaledHeight();
|
||||
if (playerentity != null)
|
||||
{
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
|
||||
ItemStack itemstack = playerentity.getHeldItemOffhand();
|
||||
HandSide handside = playerentity.getPrimaryHand().opposite();
|
||||
int i = scaledWidth / 2;
|
||||
int j = getBlitOffset(gui);
|
||||
int j = gui.getBlitOffset();
|
||||
int k = 182;
|
||||
int l = 91;
|
||||
setBlitOffset(gui, -90);
|
||||
gui.blit(i - 91, scaledHeight - TimerUtils.getHotbarTranslation(), 0, 0, 182, 22);
|
||||
gui.blit(i - 91 - 1 + playerentity.inventory.currentItem * 20,
|
||||
gui.setBlitOffset(-90);
|
||||
gui.blit(matrixStack, i - 91, scaledHeight - TimerUtils.getHotbarTranslation(), 0, 0, 182, 22);
|
||||
gui.blit(matrixStack,
|
||||
i - 91 - 1 + playerentity.inventory.currentItem * 20,
|
||||
scaledHeight - (int) (22F * alpha) - 1,
|
||||
0,
|
||||
22,
|
||||
@@ -414,8 +355,9 @@ public class RenderUtils
|
||||
{
|
||||
if (handside == HandSide.LEFT)
|
||||
{
|
||||
gui.blit(i - 91 - 29,
|
||||
scaledHeight - (int) (23 * alpha),
|
||||
gui.blit(matrixStack,
|
||||
i - 91 - 29,
|
||||
scaledHeight - (int) (23F * alpha),
|
||||
24,
|
||||
22,
|
||||
29,
|
||||
@@ -423,26 +365,26 @@ public class RenderUtils
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.blit(i + 91, scaledHeight - (int) (23 * alpha), 53, 22, 29, 24);
|
||||
gui.blit(matrixStack,
|
||||
i + 91,
|
||||
scaledHeight - (int) (23F * alpha),
|
||||
53,
|
||||
22,
|
||||
29,
|
||||
24);
|
||||
}
|
||||
}
|
||||
|
||||
setBlitOffset(gui, j);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
|
||||
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA,
|
||||
GlStateManager.SourceFactor.ONE,
|
||||
GlStateManager.DestFactor.ZERO);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
gui.setBlitOffset(j);
|
||||
RenderSystem.enableRescaleNormal();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
|
||||
for (int i1 = 0; i1 < 9; ++i1)
|
||||
{
|
||||
int j1 = i - 90 + i1 * 20 + 2;
|
||||
int k1 = scaledHeight - (int) (16 * alpha) - 3;
|
||||
renderHotbarItem(mc,
|
||||
alpha,
|
||||
j1,
|
||||
int k1 = scaledHeight - (int) (16F * alpha) - 3;
|
||||
renderHotbarItem(mc, alpha, j1,
|
||||
k1,
|
||||
partialTicks,
|
||||
playerentity,
|
||||
@@ -451,12 +393,10 @@ public class RenderUtils
|
||||
|
||||
if (!itemstack.isEmpty())
|
||||
{
|
||||
int i2 = scaledHeight - (int) (16 * alpha) - 3;
|
||||
int i2 = scaledHeight - (int) (16F * alpha) - 3;
|
||||
if (handside == HandSide.LEFT)
|
||||
{
|
||||
renderHotbarItem(mc,
|
||||
alpha,
|
||||
i - 91 - 26,
|
||||
renderHotbarItem(mc, alpha, i - 91 - 26,
|
||||
i2,
|
||||
partialTicks,
|
||||
playerentity,
|
||||
@@ -464,9 +404,7 @@ public class RenderUtils
|
||||
}
|
||||
else
|
||||
{
|
||||
renderHotbarItem(mc,
|
||||
alpha,
|
||||
i + 91 + 10,
|
||||
renderHotbarItem(mc, alpha, i + 91 + 10,
|
||||
i2,
|
||||
partialTicks,
|
||||
playerentity,
|
||||
@@ -489,15 +427,20 @@ public class RenderUtils
|
||||
mc.getTextureManager()
|
||||
.bindTexture(AbstractGui.GUI_ICONS_LOCATION);
|
||||
int l1 = (int) (f * 19.0F);
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
gui.blit(k2, j2, 0, 94, 18, 18);
|
||||
gui.blit(k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
gui.blit(matrixStack, k2, j2, 0, 94, 18, 18);
|
||||
gui.blit(matrixStack,
|
||||
k2,
|
||||
j2 + 18 - l1,
|
||||
18,
|
||||
112 - l1,
|
||||
18,
|
||||
l1);
|
||||
}
|
||||
}
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.disableBlend();
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,99 +465,109 @@ public class RenderUtils
|
||||
{
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
float f = (float) stack.getAnimationsToGo() - partialTicks;
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
if (f > 0.0F)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
RenderSystem.pushMatrix();
|
||||
float f1 = 1.0F + f / 5.0F;
|
||||
GlStateManager.translatef((float) (x + 8),
|
||||
RenderSystem.translatef((float) (x + 8),
|
||||
(float) (y + 12),
|
||||
0.0F);
|
||||
GlStateManager.scalef(1.0F / f1, (f1 + 1.0F) / 2.0F, 1.0F);
|
||||
GlStateManager.translatef((float) (-(x + 8)),
|
||||
RenderSystem.scalef(1.0F / f1, (f1 + 1.0F) / 2.0F, 1.0F);
|
||||
RenderSystem.translatef((float) (-(x + 8)),
|
||||
(float) (-(y + 12)),
|
||||
0.0F);
|
||||
}
|
||||
|
||||
renderItemAndEffectIntoGUI(mc, player, stack, x, y, alpha);
|
||||
renderItemAndEffectIntoGUI(mc, alpha, player, stack, x, y);
|
||||
if (f > 0.0F)
|
||||
{
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
mc.getItemRenderer()
|
||||
.renderItemOverlays(mc.fontRenderer, stack, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
private static void renderItemAndEffectIntoGUI(Minecraft mc,
|
||||
LivingEntity entityIn,
|
||||
ItemStack itemIn,
|
||||
/**
|
||||
* Renders a single item on the HUD.
|
||||
*
|
||||
* @param mc - A Minecraft instance.
|
||||
* @param alpha - How transparent the item should be, on a scale from 0 to
|
||||
* 1.
|
||||
* @param ent - The player that the item is from.
|
||||
* @param stack - The item to render.
|
||||
* @param x - The x position of the item on the screen.
|
||||
* @param y - The y position of the item on the screen
|
||||
*
|
||||
* @see net.minecraft.client.renderer.ItemRenderer#renderItemIntoGUI(LivingEntity,
|
||||
* ItemStack, int, int)
|
||||
*/
|
||||
static void renderItemAndEffectIntoGUI(Minecraft mc,
|
||||
float alpha,
|
||||
PlayerEntity ent,
|
||||
ItemStack stack,
|
||||
int x,
|
||||
int y,
|
||||
float alpha)
|
||||
{
|
||||
if (!itemIn.isEmpty())
|
||||
{
|
||||
float zLevel = 50.0F;
|
||||
|
||||
try
|
||||
int y)
|
||||
{
|
||||
TextureManager textureManager = mc.textureManager;
|
||||
IBakedModel bakedmodel = mc.getItemRenderer()
|
||||
.getItemModelWithOverrides(itemIn,
|
||||
.getItemModelWithOverrides(stack,
|
||||
(World) null,
|
||||
entityIn);
|
||||
GlStateManager.pushMatrix();
|
||||
mc.getTextureManager()
|
||||
.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
mc.getTextureManager()
|
||||
.getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE)
|
||||
.setBlurMipmap(false, false);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableAlphaTest();
|
||||
GlStateManager.alphaFunc(516, 0.1F);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA,
|
||||
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
Method transformMethod = null;
|
||||
try
|
||||
{
|
||||
transformMethod = ItemRenderer.class.getDeclaredMethod("setupGuiTransform", int.class, int.class, boolean.class);
|
||||
}
|
||||
catch (NoSuchMethodException e)
|
||||
(LivingEntity) null);
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
transformMethod = ItemRenderer.class.getDeclaredMethod("func_180452_a", int.class, int.class, boolean.class);
|
||||
}
|
||||
catch (NoSuchMethodException e1)
|
||||
RenderSystem.pushMatrix();
|
||||
textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
textureManager.getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE)
|
||||
.setBlurMipmapDirect(false, false);
|
||||
RenderSystem.enableRescaleNormal();
|
||||
// RenderSystem.enableAlphaTest();
|
||||
// RenderSystem.defaultAlphaFunc();
|
||||
// RenderSystem.enableBlend();
|
||||
// RenderSystem.blendFunc(GlStateManager.SourceFactor
|
||||
// .SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
RenderSystem.translatef((float) x, (float) y, 100.0F + 50F);
|
||||
RenderSystem.translatef(8.0F, 8.0F, 0.0F);
|
||||
RenderSystem.scalef(1.0F, -1.0F, 1.0F);
|
||||
RenderSystem.scalef(16.0F, 16.0F, 16.0F);
|
||||
MatrixStack matrixstack = new MatrixStack();
|
||||
IRenderTypeBuffer.Impl irendertypebuffer$impl =
|
||||
Minecraft.getInstance()
|
||||
.getRenderTypeBuffers()
|
||||
.getBufferSource();
|
||||
boolean flag = !bakedmodel.isSideLit();
|
||||
if (flag)
|
||||
{
|
||||
e.printStackTrace();
|
||||
RenderHelper.setupGuiFlatDiffuseLighting();
|
||||
}
|
||||
}
|
||||
if (transformMethod != null)
|
||||
{
|
||||
if (!transformMethod.isAccessible())
|
||||
{
|
||||
transformMethod.setAccessible(true);
|
||||
}
|
||||
transformMethod.invoke(mc.getItemRenderer(), x, y, bakedmodel.isGui3d());
|
||||
}
|
||||
bakedmodel =
|
||||
net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(
|
||||
bakedmodel,
|
||||
|
||||
mc.getItemRenderer()
|
||||
.renderItem(stack,
|
||||
ItemCameraTransforms.TransformType.GUI,
|
||||
false);
|
||||
mc.getItemRenderer().renderItem(itemIn, bakedmodel);
|
||||
GlStateManager.disableAlphaTest();
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.popMatrix();
|
||||
mc.textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
mc.textureManager.getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE)
|
||||
.restoreLastBlurMipmap();
|
||||
false,
|
||||
matrixstack,
|
||||
irendertypebuffer$impl,
|
||||
15728880,
|
||||
OverlayTexture.NO_OVERLAY,
|
||||
bakedmodel);
|
||||
irendertypebuffer$impl.finish();
|
||||
RenderSystem.enableDepthTest();
|
||||
if (flag)
|
||||
{
|
||||
RenderHelper.setupGui3DDiffuseLighting();
|
||||
}
|
||||
|
||||
// RenderSystem.disableAlphaTest();
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -623,19 +576,19 @@ public class RenderUtils
|
||||
CrashReportCategory crashreportcategory =
|
||||
crashreport.makeCategory("Item being rendered");
|
||||
crashreportcategory.addDetail("Item Type", () -> {
|
||||
return String.valueOf((Object) itemIn.getItem());
|
||||
return String.valueOf((Object) stack.getItem());
|
||||
});
|
||||
crashreportcategory.addDetail("Registry Name",
|
||||
() -> String.valueOf(itemIn.getItem()
|
||||
() -> String.valueOf(stack.getItem()
|
||||
.getRegistryName()));
|
||||
crashreportcategory.addDetail("Item Damage", () -> {
|
||||
return String.valueOf(itemIn.getDamage());
|
||||
return String.valueOf(stack.getDamage());
|
||||
});
|
||||
crashreportcategory.addDetail("Item NBT", () -> {
|
||||
return String.valueOf((Object) itemIn.getTag());
|
||||
return String.valueOf((Object) stack.getTag());
|
||||
});
|
||||
crashreportcategory.addDetail("Item Foil", () -> {
|
||||
return String.valueOf(itemIn.hasEffect());
|
||||
return String.valueOf(stack.hasEffect());
|
||||
});
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package markil3.immersive_hud;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||
@@ -14,11 +15,10 @@ import net.minecraft.item.FilledMapItem;
|
||||
import net.minecraft.item.FishingRodItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.LingeringPotionItem;
|
||||
import net.minecraft.item.ShieldItem;
|
||||
import net.minecraft.item.ShootableItem;
|
||||
import net.minecraft.item.SnowballItem;
|
||||
import net.minecraft.item.SplashPotionItem;
|
||||
import net.minecraft.item.ThrowablePotionItem;
|
||||
import net.minecraft.item.TridentItem;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
@@ -169,7 +169,7 @@ public class TimerUtils
|
||||
*/
|
||||
public static void setAlpha(float alpha)
|
||||
{
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,6 +283,7 @@ public class TimerUtils
|
||||
* hands into and out of view as needed.
|
||||
*
|
||||
* @param hand - The hand being rendered.
|
||||
* @param matrixStack - The rendering stack.
|
||||
* @param ticks
|
||||
*
|
||||
* @return If true, then don't render this hand at all.
|
||||
@@ -290,6 +291,7 @@ public class TimerUtils
|
||||
* @since 0.2-1.16.4-forge
|
||||
*/
|
||||
public static boolean onRenderHand(Hand hand,
|
||||
MatrixStack matrixStack,
|
||||
float ticks)
|
||||
{
|
||||
float HAND_UP_TIME = 20F;
|
||||
@@ -306,8 +308,9 @@ public class TimerUtils
|
||||
/*
|
||||
* Undo the transformation of the previous hand
|
||||
*/
|
||||
GlStateManager.translatef(0,
|
||||
(float) (1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME),
|
||||
matrixStack
|
||||
.translate(0,
|
||||
1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME,
|
||||
0);
|
||||
}
|
||||
if (offHandTime == 0 && !offHandLock)
|
||||
@@ -322,8 +325,9 @@ public class TimerUtils
|
||||
}
|
||||
if (offHandTime < HAND_UP_TIME)
|
||||
{
|
||||
GlStateManager.translatef(0,
|
||||
(float) (-1.0F * (HAND_UP_TIME - offHandTime) / HAND_UP_TIME),
|
||||
matrixStack
|
||||
.translate(0,
|
||||
-1.0F * (HAND_UP_TIME - offHandTime) / HAND_UP_TIME,
|
||||
0);
|
||||
}
|
||||
}
|
||||
@@ -341,8 +345,9 @@ public class TimerUtils
|
||||
}
|
||||
if (mainHandTime < HAND_UP_TIME)
|
||||
{
|
||||
GlStateManager.translatef(0,
|
||||
(float) (-1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME),
|
||||
matrixStack
|
||||
.translate(0,
|
||||
-1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME,
|
||||
0);
|
||||
}
|
||||
}
|
||||
@@ -383,9 +388,7 @@ public class TimerUtils
|
||||
boolean changed = false;
|
||||
boolean canceled = false;
|
||||
|
||||
boolean hideCrosshair =
|
||||
ConfigManager.getInstance().hideCrosshair();
|
||||
if (hideCrosshair)
|
||||
if (ConfigManager.getInstance().hideCrosshair())
|
||||
{
|
||||
if (mc.objectMouseOver != null && mc.objectMouseOver.getType() != RayTraceResult.Type.MISS)
|
||||
{
|
||||
@@ -608,7 +611,7 @@ public class TimerUtils
|
||||
* Items that have the crosshairs enabled for as long
|
||||
* as the item is being held at all.
|
||||
*/
|
||||
else if (item instanceof SplashPotionItem || item instanceof LingeringPotionItem || item instanceof SnowballItem || item instanceof EggItem || item instanceof EnderPearlItem || item instanceof FishingRodItem)
|
||||
else if (item instanceof ThrowablePotionItem || item instanceof SnowballItem || item instanceof EggItem || item instanceof EnderPearlItem || item instanceof FishingRodItem)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
@@ -722,7 +725,7 @@ public class TimerUtils
|
||||
*
|
||||
* @since 0.2-1.16.4-forge
|
||||
*/
|
||||
public static boolean drawHealth(float ticks)
|
||||
public static boolean drawHealth(MatrixStack stack, float ticks)
|
||||
{
|
||||
/*
|
||||
* When the health percentage falls to this level or below, the
|
||||
@@ -768,8 +771,8 @@ public class TimerUtils
|
||||
{
|
||||
if (healthTime > 0)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
setAlpha(Main.getAlpha(healthTime,
|
||||
@@ -780,8 +783,8 @@ public class TimerUtils
|
||||
}
|
||||
return true;
|
||||
}
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
return false;
|
||||
@@ -795,7 +798,7 @@ public class TimerUtils
|
||||
*
|
||||
* @since 0.2-1.16.4-forge
|
||||
*/
|
||||
public static boolean drawHunger(float ticks)
|
||||
public static boolean drawHunger(MatrixStack stack, float ticks)
|
||||
{
|
||||
/*
|
||||
* When hunger falls to this level or below, the hunger bar won't
|
||||
@@ -842,16 +845,16 @@ public class TimerUtils
|
||||
hungerTimes.getMaxTime(),
|
||||
hungerTimes.getFadeInTime(),
|
||||
hungerTimes.getFadeOutTime()));
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
return false;
|
||||
@@ -861,13 +864,14 @@ public class TimerUtils
|
||||
* Determines whether or not to draw the armor bar, adjusting the alpha as
|
||||
* needed.
|
||||
*
|
||||
* @param stack
|
||||
* @param ticks
|
||||
*
|
||||
* @return If true, then cancel drawing the armor bar.
|
||||
*
|
||||
* @since 0.2-1.16.4-forge
|
||||
*/
|
||||
public static boolean drawArmor(float ticks)
|
||||
public static boolean drawArmor(MatrixStack stack, float ticks)
|
||||
{
|
||||
ConfigManager.TimeValues healthTimes;
|
||||
/*
|
||||
@@ -880,8 +884,8 @@ public class TimerUtils
|
||||
healthTimes.getMaxTime(),
|
||||
healthTimes.getFadeInTime(),
|
||||
healthTimes.getFadeOutTime()));
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
return false;
|
||||
@@ -892,16 +896,17 @@ public class TimerUtils
|
||||
/**
|
||||
* Repositions the oxygen bar.
|
||||
*
|
||||
* @param stack
|
||||
* @param ticks
|
||||
*
|
||||
* @return If true, then cancel drawing the oxygen bar.
|
||||
*
|
||||
* @since 0.2-1.16.4-forge
|
||||
*/
|
||||
public static boolean drawAir(float ticks)
|
||||
public static boolean drawAir(MatrixStack stack, float ticks)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
return false;
|
||||
@@ -911,13 +916,14 @@ public class TimerUtils
|
||||
* Determines whether or not to draw the mount's health, adjusting the alpha
|
||||
* as needed.
|
||||
*
|
||||
* @param stack
|
||||
* @param ticks
|
||||
*
|
||||
* @return If true, then cancel drawing the mount health bar.
|
||||
*
|
||||
* @since 0.2-1.16.4-forge
|
||||
*/
|
||||
public static boolean drawMountHealth(float ticks)
|
||||
public static boolean drawMountHealth(MatrixStack stack, float ticks)
|
||||
{
|
||||
/*
|
||||
* When the health percentage falls to this level or below, the
|
||||
@@ -972,8 +978,8 @@ public class TimerUtils
|
||||
{
|
||||
if (mountTime > 0)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
setAlpha(Main.getAlpha(mountTime,
|
||||
@@ -984,8 +990,8 @@ public class TimerUtils
|
||||
}
|
||||
return true;
|
||||
}
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(0F,
|
||||
stack.push();
|
||||
stack.translate(0F,
|
||||
getHealthTranslation(),
|
||||
0F);
|
||||
return false;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader="javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[26,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
loaderVersion="[35,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
||||
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
||||
license="GPL-3.0-only"
|
||||
@@ -57,7 +57,7 @@ The following elements will only show up under certain conditions:
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[26,)" #mandatory
|
||||
versionRange="[35,)" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
@@ -78,6 +78,7 @@ The following elements will only show up under certain conditions:
|
||||
[[dependencies.immersive_hud]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.14,1.15)"
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange="[1.16.4,1.17)"
|
||||
ordering="NONE"
|
||||
side="CLIENT"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "immersive_hud resources",
|
||||
"pack_format": 4,
|
||||
"_comment": "A pack_format of 4 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
|
||||
"pack_format": 6,
|
||||
"_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user