generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polished Label rendering stuff, added accessibility feature
- Loading branch information
Showing
9 changed files
with
106 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/me/av306/xenon/features/accessibility/LabelFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package me.av306.xenon.features.accessibility; | ||
|
||
import me.av306.xenon.event.EntityRendererEvents; | ||
import me.av306.xenon.event.MobEntityRendererEvents; | ||
import me.av306.xenon.feature.IToggleableFeature; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.ActionResult; | ||
|
||
public class LabelFeature extends IToggleableFeature | ||
{ | ||
public LabelFeature() | ||
{ | ||
super( "Labels", "label", "lb" ); | ||
|
||
EntityRendererEvents.GET_HAS_LABEL.register( this::onEntityRendererGetHasLabel ); | ||
MobEntityRendererEvents.GET_HAS_LABEL.register( this::onEntityRendererGetHasLabel ); | ||
} | ||
|
||
private ActionResult onEntityRendererGetHasLabel( Entity entity ) | ||
{ | ||
return this.isEnabled ? ActionResult.SUCCESS : ActionResult.PASS; | ||
} | ||
|
||
@Override | ||
protected void onEnable() | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
protected void onDisable() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters