feat: add minium stone block overlay

This commit is contained in:
LordMZTE 2023-01-08 16:12:43 +01:00
parent f8b31d8a7c
commit a0c12060d1
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
1 changed files with 58 additions and 60 deletions

View File

@ -34,8 +34,8 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class DrawBlockHighlightEventHandler { public class DrawBlockHighlightEventHandler {
private static int pulse; private static int pulse = 0;
private static boolean doInc; private static boolean doInc = true;
@SubscribeEvent @SubscribeEvent
public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event) { public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event) {
@ -735,63 +735,63 @@ public class DrawBlockHighlightEventHandler {
+ ((event.player).posZ - (event.player).prevPosZ) * event.partialTicks; + ((event.player).posZ - (event.player).prevPosZ) * event.partialTicks;
//final int texture = //final int texture =
//event.context.renderEngine.func_78341_b("/mods/ee3/textures/effects/noise.png"); //event.context.renderEngine.func_78341_b("/mods/ee3/textures/effects/noise.png");
float xScale = 1.0f; float xScale = 1.1f;
float yScale = 1.0f; float yScale = 1.1f;
float zScale = 1.0f; float zScale = 1.1f;
float xShift = 0.1f; float xShift = 0.0f;
float yShift = 0.1f; float yShift = 0.0f;
float zShift = 0.1f; float zShift = 0.0f;
int itemChargeLevel = 0; int itemChargeLevel = 0;
final int chargeLevel = 1 + itemChargeLevel * 2; final int chargeLevel = 1 + itemChargeLevel * 2;
final ForgeDirection sideHit final ForgeDirection sideHit
= ForgeDirection.getOrientation(event.target.sideHit); = ForgeDirection.getOrientation(event.target.sideHit);
switch (sideHit) { //switch (sideHit) {
case UP: { // case UP: {
xScale = chargeLevel + 0.1f; // xScale = chargeLevel + 0.1f;
zScale = chargeLevel + 0.1f; // zScale = chargeLevel + 0.1f;
xShift = 0.0f; // xShift = 0.0f;
zShift = 0.0f; // zShift = 0.0f;
break; // break;
} // }
case DOWN: { // case DOWN: {
xScale = chargeLevel + 0.1f; // xScale = chargeLevel + 0.1f;
zScale = chargeLevel + 0.1f; // zScale = chargeLevel + 0.1f;
xShift = 0.0f; // xShift = 0.0f;
yShift = -yShift; // yShift = -yShift;
zShift = 0.0f; // zShift = 0.0f;
break; // break;
} // }
case NORTH: { // case NORTH: {
xScale = chargeLevel + 0.1f; // xScale = chargeLevel + 0.1f;
yScale = chargeLevel + 0.1f; // yScale = chargeLevel + 0.1f;
xShift = 0.0f; // xShift = 0.0f;
yShift = 0.0f; // yShift = 0.0f;
zShift = -zShift; // zShift = -zShift;
break; // break;
} // }
case SOUTH: { // case SOUTH: {
xScale = chargeLevel + 0.1f; // xScale = chargeLevel + 0.1f;
yScale = chargeLevel + 0.1f; // yScale = chargeLevel + 0.1f;
xShift = 0.0f; // xShift = 0.0f;
yShift = 0.0f; // yShift = 0.0f;
break; // break;
} // }
case EAST: { // case EAST: {
yScale = chargeLevel + 0.1f; // yScale = chargeLevel + 0.1f;
zScale = chargeLevel + 0.1f; // zScale = chargeLevel + 0.1f;
yShift = 0.0f; // yShift = 0.0f;
zShift = 0.0f; // zShift = 0.0f;
break; // break;
} // }
case WEST: { // case WEST: {
yScale = chargeLevel + 0.1f; // yScale = chargeLevel + 0.1f;
zScale = chargeLevel + 0.1f; // zScale = chargeLevel + 0.1f;
xShift = -xShift; // xShift = -xShift;
yShift = 0.0f; // yShift = 0.0f;
zShift = 0.0f; // zShift = 0.0f;
break; // break;
} // }
} //}
GL11.glDepthMask(false); GL11.glDepthMask(false);
GL11.glDisable(2884); GL11.glDisable(2884);
for (int i = 0; i < 6; ++i) { for (int i = 0; i < 6; ++i) {
@ -806,9 +806,7 @@ public class DrawBlockHighlightEventHandler {
(float) forgeDir.offsetY, (float) forgeDir.offsetY,
(float) forgeDir.offsetZ (float) forgeDir.offsetZ
); );
GL11.glTranslated(0.0, 0.0, (double) (0.5f * zCorrection)); GL11.glTranslated(0.0, 0.0, (double) (0.5f * zCorrection)); GL11.glClear(256); renderPulsingQuad(
GL11.glClear(256);
renderPulsingQuad(
new ResourceLocation("ee3", "textures/effects/noise.png"), 0.75f new ResourceLocation("ee3", "textures/effects/noise.png"), 0.75f
); );
GL11.glPopMatrix(); GL11.glPopMatrix();
@ -843,10 +841,10 @@ public class DrawBlockHighlightEventHandler {
} else { } else {
DrawBlockHighlightEventHandler.pulse -= 8; DrawBlockHighlightEventHandler.pulse -= 8;
} }
if (DrawBlockHighlightEventHandler.pulse == 3000) { if (DrawBlockHighlightEventHandler.pulse >= 3000) {
DrawBlockHighlightEventHandler.doInc = false; DrawBlockHighlightEventHandler.doInc = false;
} }
if (DrawBlockHighlightEventHandler.pulse == 0) { if (DrawBlockHighlightEventHandler.pulse <= 0) {
DrawBlockHighlightEventHandler.doInc = true; DrawBlockHighlightEventHandler.doInc = true;
} }
return DrawBlockHighlightEventHandler.pulse; return DrawBlockHighlightEventHandler.pulse;