-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix nametag checks & move to mdg for neo & vanilla
- Loading branch information
Showing
12 changed files
with
172 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package vazkii.neat; | ||
|
||
public interface NeatRenderState { | ||
boolean neat$isBoss(); | ||
void neat$setBoss(boolean value); | ||
boolean neat$isFriendly(); | ||
void neat$setFriendly(boolean value); | ||
boolean neat$isIdBlacklisted(); | ||
void neat$setIdBlacklisted(boolean value); | ||
} |
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
48 changes: 48 additions & 0 deletions
48
Xplat/src/main/java/vazkii/neat/mixin/LivingEntityRenderStateMixin.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,48 @@ | ||
package vazkii.neat.mixin; | ||
|
||
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
import vazkii.neat.NeatRenderState; | ||
|
||
@Mixin(LivingEntityRenderState.class) | ||
public class LivingEntityRenderStateMixin implements NeatRenderState { | ||
@Unique | ||
public boolean neat$isBoss; | ||
@Unique | ||
public boolean neat$isFriendly; | ||
@Unique | ||
public boolean neat$isIdBlacklisted; | ||
|
||
@Override | ||
public boolean neat$isBoss() { | ||
return neat$isBoss; | ||
} | ||
|
||
@Override | ||
public void neat$setBoss(boolean value) { | ||
this.neat$isBoss = value; | ||
} | ||
|
||
@Override | ||
public boolean neat$isFriendly() { | ||
return neat$isFriendly; | ||
} | ||
|
||
@Override | ||
public void neat$setFriendly(boolean value) { | ||
this.neat$isFriendly = value; | ||
} | ||
|
||
@Override | ||
public boolean neat$isIdBlacklisted() { | ||
return neat$isIdBlacklisted; | ||
} | ||
|
||
@Override | ||
public void neat$setIdBlacklisted(boolean value) { | ||
this.neat$isIdBlacklisted = value; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Xplat/src/main/java/vazkii/neat/mixin/LivingEntityRendererMixin.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,29 @@ | ||
package vazkii.neat.mixin; | ||
|
||
import net.minecraft.client.renderer.entity.LivingEntityRenderer; | ||
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.world.entity.LivingEntity; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import vazkii.neat.HealthBarRenderer; | ||
import vazkii.neat.NeatConfig; | ||
import vazkii.neat.NeatRenderState; | ||
|
||
@Mixin(LivingEntityRenderer.class) | ||
public class LivingEntityRendererMixin { | ||
|
||
@Inject( | ||
method = "extractRenderState(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)V", | ||
at = @At("TAIL") | ||
) | ||
public void neat$extractRenderState(LivingEntity entity, LivingEntityRenderState entityRenderState, float partialTick, CallbackInfo ci) { | ||
((NeatRenderState) entityRenderState).neat$setBoss(HealthBarRenderer.isBoss(entity)); | ||
((NeatRenderState) entityRenderState).neat$setFriendly(entity.getType().getCategory().isFriendly()); | ||
((NeatRenderState) entityRenderState).neat$setIdBlacklisted(NeatConfig.instance.blacklist().contains(BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString())); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Xplat/src/main/resources/META-INF/accesstransformer_xplat.cfg
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,2 @@ | ||
public net.minecraft.client.renderer.RenderType$CompositeRenderType | ||
public net.minecraft.client.renderer.RenderType$CompositeState |
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 was deleted.
Oops, something went wrong.
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