0.1.2: fix toggle hud

This commit is contained in:
yuesha-yc 2021-10-08 00:05:47 -07:00
parent 1a71781b42
commit 941360eced
No known key found for this signature in database
GPG key ID: 009D79A802D4ED01
4 changed files with 39 additions and 2 deletions

View file

@ -15,7 +15,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
group = 'com.teammoeg'
version = '1.16.5-0.1.1'
version = '1.16.5-0.1.2'
java {
archivesBaseName = 'steampowered'

View file

@ -0,0 +1,36 @@
package com.teammoeg.steampowered.mixin.client;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.curiosities.armor.CopperBacktankArmorLayer;
import com.simibubi.create.events.ClientEvents;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(ClientEvents.class)
public class MixinClientEvents {
/**
* @author yuesha-yc
* @reason fix overlay when the hotbar event is canceled
*/
@SubscribeEvent
@Overwrite(remap = false)
public static void onRenderOverlay(RenderGameOverlayEvent.Post event) {
MatrixStack ms = event.getMatrixStack();
IRenderTypeBuffer.Impl buffers = Minecraft.getInstance().renderBuffers().bufferSource();
int light = 15728880;
int overlay = OverlayTexture.NO_OVERLAY;
float pt = event.getPartialTicks();
if (event.getType() == RenderGameOverlayEvent.ElementType.AIR) {
CopperBacktankArmorLayer.renderRemainingAirOverlay(ms, buffers, light, overlay, pt);
}
if (event.getType() == RenderGameOverlayEvent.ElementType.SUBTITLES) {
ClientEvents.onRenderHotbar(ms, buffers, light, overlay, pt);
}
}
}

View file

@ -4,7 +4,7 @@ license = "GPLv3"
issueTrackerURL = "https://github.com/TeamMoegMC/Steam-Powered/issues"
[[mods]] #mandatory
modId = "steampowered" #mandatory
version = "1.16.5-0.1.0" #mandatory
version = "1.16.5-0.1.2" #mandatory
displayName = "Create: Steam Powered" #mandatory
authors = "YueSha, dashuaibia, duck_egg, Luyuuke"
description = '''

View file

@ -7,6 +7,7 @@
"FlywheelTileEntityAccess"
],
"client": [
"client.MixinClientEvents"
],
"injectors": {
"defaultRequire": 1