Skip to content

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Dec 3, 2024
1 parent e051d4b commit 77ef160
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod_name=PolyNametag
# Sets the id of your mod that mod loaders use to recognize it.
mod_id=polynametag
# Sets the version of your mod. Make sure to update this when you make changes according to semver.
mod_version=1.0.7
mod_version=1.0.8
# Sets the name of the jar file that you put in your 'mods' folder.
mod_archives_name=PolyNametag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void drawBG(Entity entityIn, String str, double x, double y, double z, i
@Inject(method = "renderLivingLabel", at = @At("HEAD"), cancellable = true)
private void move(Entity entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) {
if (!ModConfig.INSTANCE.enabled) return;
PolyNametag.INSTANCE.setShouldDrawIndicator(PolyNametag.INSTANCE.getDrawingPlayerName() && NametagRenderingKt.canDrawIndicator(entityIn));
//PolyNametag.INSTANCE.setShouldDrawIndicator(PolyNametag.INSTANCE.getDrawingPlayerName() && NametagRenderingKt.canDrawIndicator(entityIn));
PolyNametag.INSTANCE.setDrawingPlayerName(false);
if (!PolyNametag.INSTANCE.getDrawingTags() && PolyNametag.INSTANCE.getDrawingWorld()) {
PolyNametag.INSTANCE.getNametags().add(new PolyNametag.LabelInfo((Render<Entity>) (Object) this, entityIn, str, x, y, z, maxDistance));
Expand All @@ -117,8 +117,8 @@ private void essential(Entity entityIn, String str, double x, double y, double z
if (!ModConfig.INSTANCE.enabled) return;
PolyNametag instance = PolyNametag.INSTANCE;
if (instance.isEssential() && instance.getShouldDrawIndicator()) {
NametagRenderingKt.drawIndicator(entityIn, str);
instance.setShouldDrawIndicator(false);
//NametagRenderingKt.drawIndicator(entityIn, str);
//instance.setShouldDrawIndicator(false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void drawBG(EntityLivingBase entity, double x, double y, double z, Callb
@Inject(method = "renderName(Lnet/minecraft/entity/EntityLivingBase;DDD)V", at = @At("HEAD"), cancellable = true)
private void move(EntityLivingBase entity, double x, double y, double z, CallbackInfo ci) {
if (!ModConfig.INSTANCE.enabled) return;
PolyNametag.INSTANCE.setShouldDrawIndicator(NametagRenderingKt.canDrawIndicator(entity));
//PolyNametag.INSTANCE.setShouldDrawIndicator(NametagRenderingKt.canDrawIndicator(entity));
if (!PolyNametag.INSTANCE.getDrawingTags() && PolyNametag.INSTANCE.getDrawingWorld()) {
PolyNametag.INSTANCE.getNametags().add(new PolyNametag.NameInfo((RendererLivingEntity<EntityLivingBase>) (Object) this, entity, x, y, z));
ci.cancel();
Expand All @@ -122,8 +122,8 @@ private void essential(EntityLivingBase entity, double x, double y, double z, Ca
if (!ModConfig.INSTANCE.enabled) return;
PolyNametag instance = PolyNametag.INSTANCE;
if (instance.isEssential() && instance.getShouldDrawIndicator()) {
NametagRenderingKt.drawIndicator(entity, entity.getDisplayName().getFormattedText());
instance.setShouldDrawIndicator(false);
//NametagRenderingKt.drawIndicator(entity, entity.getDisplayName().getFormattedText());
//instance.setShouldDrawIndicator(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,22 @@ fun drawBackground(xStart: Double, xEnd: Double, red: Int, green: Int, blue: Int
GL11.glDisable(GL11.GL_LINE_SMOOTH)
}

fun drawIndicator(entity: Entity, string: String) {
if (entity !is EntityPlayer) return
drawingIndicator = true
OnlineIndicator.drawNametagIndicator(UMatrixStack(), entity, string, 0)
drawingIndicator = false
}

fun Entity.canDrawIndicator(): Boolean {
if (!PolyNametag.isEssential) return false
if (OnboardingData.hasAcceptedTos() && EssentialConfig.showEssentialIndicatorOnNametag && this is EntityPlayer) {
if (Essential.getInstance().connectionManager.profileManager.getStatus(this.gameProfile.id) != ProfileStatus.OFFLINE) {
return true
}
}
return false
}
//fun drawIndicator(entity: Entity, string: String) {
// if (entity !is EntityPlayer) return
// drawingIndicator = true
// OnlineIndicator.drawNametagIndicator(UMatrixStack(), entity, string, 0)
// drawingIndicator = false
//}

//fun Entity.canDrawIndicator(): Boolean {
// if (!PolyNametag.isEssential) return false
// if (OnboardingData.hasAcceptedTos() && EssentialConfig.showEssentialIndicatorOnNametag && this is EntityPlayer) {
// if (Essential.getInstance().connectionManager.profileManager.getStatus(this.gameProfile.id) != ProfileStatus.OFFLINE) {
// return true
// }
// }
// return false
//}

internal fun FontRenderer.drawStringWithoutZFighting(text: String, x: Float, y: Float, color: Int): Int {
if (this !is FontRendererAccessor) return 0
Expand Down

0 comments on commit 77ef160

Please sign in to comment.