if player healing - damage -1 then allow
Some checks failed
/ Auto-Build-App (push) Failing after 40s
Some checks failed
/ Auto-Build-App (push) Failing after 40s
This commit is contained in:
parent
88d1bcfea1
commit
87cf78834b
2 changed files with 4 additions and 0 deletions
|
|
@ -32,6 +32,8 @@ public class EntityMixin {
|
|||
|
||||
@Inject(method = "hit", at = @At("HEAD"), cancellable = true)
|
||||
private void event_player_hit(CallbackInfo ci, @Local(argsOnly = true) IDamageSource damageSource, @Local(argsOnly = true) float amount){
|
||||
if (amount<0)
|
||||
return;
|
||||
if (damageSource instanceof Entity) {
|
||||
if (damageSource instanceof PlayerEntity) {
|
||||
Account account = ((PlayerEntity) damageSource).getPlayer().getAccount();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ public class PlayerEntityMixin extends EntityMixin{
|
|||
|
||||
@Inject(method = "hit", at = @At("HEAD"), cancellable = true)
|
||||
private void event_player_hit(CallbackInfo ci, @Local(argsOnly = true) IDamageSource damageSource, @Local(argsOnly = true) float amount){
|
||||
if (amount<0)
|
||||
return;
|
||||
if (damageSource instanceof Entity) {
|
||||
if (damageSource instanceof PlayerEntity) {
|
||||
Account account = ((PlayerEntity) damageSource).getPlayer().getAccount();
|
||||
|
|
|
|||
Loading…
Reference in a new issue