Skip to content

Commit

Permalink
Change pack.mcmeta format
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Dec 29, 2019
1 parent e1958cc commit 55a6a53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/main/java/dmillerw/ping/client/PingHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.client.model.pipeline.TRSRTransformer;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
Expand Down Expand Up @@ -72,12 +73,12 @@ public static void onRenderWorld(RenderWorldLastEvent event) {
double pz = ping.pos.getZ() + 0.5D - interpZ;

//if (camera.isBoundingBoxInFrustum(ping.getAABB())) {
ping.isOffscreen = false;
if (Config.VISUAL.blockOverlay.get()) {
Vec3d staticPos = TileEntityRendererDispatcher.instance.renderInfo.getProjectedView();
renderPingOverlay(ping.pos.getX() - staticPos.getX(), ping.pos.getY() - staticPos.getY(), ping.pos.getZ() - staticPos.getZ(), ping);
//renderPing(px, py, pz, renderEntity, ping);
}
ping.isOffscreen = false;
if (Config.VISUAL.blockOverlay.get()) {
Vec3d staticPos = TileEntityRendererDispatcher.instance.renderInfo.getProjectedView();
renderPingOverlay(ping.pos.getX() - staticPos.getX(), ping.pos.getY() - staticPos.getY(), ping.pos.getZ() - staticPos.getZ(), ping);
}
renderPing(px, py, pz, renderEntity, ping);
/*} else {
ping.isOffscreen = true;
translatePingCoordinates(px, py, pz, ping);
Expand Down Expand Up @@ -193,6 +194,7 @@ public static void onClientTick(TickEvent.ClientTickEvent event) {
}

private static void renderPing(double px, double py, double pz, Entity renderEntity, PingWrapper ping) {
Minecraft mc = Minecraft.getInstance();
RenderSystem.pushMatrix();
RenderSystem.disableDepthTest();
RenderSystem.translated(px, py, pz);
Expand All @@ -202,7 +204,7 @@ private static void renderPing(double px, double py, double pz, Entity renderEnt
RenderSystem.rotatef(renderEntity.rotationPitch, 1.0F, 0.0F, 0.0F);
RenderSystem.rotatef(180.0F, 0.0F, 0.0F, 1.0F);

Minecraft.getInstance().textureManager.bindTexture(TEXTURE);
mc.textureManager.bindTexture(TEXTURE);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
Expand All @@ -221,7 +223,7 @@ private static void renderPing(double px, double py, double pz, Entity renderEnt
bufferBuilder.func_225582_a_(min, min, 0).func_225583_a_(PingType.BACKGROUND.minU, PingType.BACKGROUND.minV).func_225586_a_(r, g, b, 255).endVertex();
tessellator.draw();

int alpha = ping.type == PingType.ALERT ? (int) (1.3F + Math.sin(Minecraft.getInstance().world.getDayTime())) : 175;
int alpha = ping.type == PingType.ALERT ? mc.world != null ? (int) (1.3F + Math.sin(mc.world.getDayTime())) : 175 : 175;

// Block Overlay Icon
bufferBuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "Ping resources",
"pack_format": 4
"pack_format": 5
}
}

0 comments on commit 55a6a53

Please sign in to comment.