Skip to content

Commit

Permalink
remove the usage of camera
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-1F committed Jan 9, 2021
1 parent 041a0eb commit e5da974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/me/ivan/gatewayer/Gatewayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public ActionResult onPlayerRightClickBlock(World world, PlayerEntity player, Ha
return ActionResult.FAIL;
}

public void renderInfo(float tickDelta, Camera camera) {
public void renderInfo(float tickDelta) {
MinecraftClient mc = MinecraftClient.getInstance();
Camera camera = mc.gameRenderer.getCamera();
if (gatewayInfo.isEnabled() && camera.getPos().squaredDistanceTo(new Vec3d(gatewayInfo.getPos().getX(), gatewayInfo.getPos().getY(), gatewayInfo.getPos().getZ())) < MAX_RENDER_DISTANCE * MAX_RENDER_DISTANCE) {
BlockPos gatewayPos = gatewayInfo.getPos();
BlockPos entityExitPos = gatewayInfo.getEntityExitPos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class WorldRendererMixin {
)
private void renderGatewayer(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, CallbackInfo ci)
{
Gatewayer.getInstance().renderInfo(tickDelta, camera);
Gatewayer.getInstance().renderInfo(tickDelta);
}


Expand Down

0 comments on commit e5da974

Please sign in to comment.