diff --git a/README.md b/README.md index c17e9116..c98c9462 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ This work, "PolyPatcher", is adapted from ["Patcher"](https://sk1er.club/mods/pa - Fix vanilla bug where a spaces are not trimmed in server address fields - Fix vanilla bug where entities don't render at certain camera angles below Y=0 and above Y=255 - Fix vanilla bug where invalid tile entities try to render +- Fix vanilla bug where damaged invulnerable entities stop rendering - Fix vanilla sky lighting calculation - Fix vanilla light initializing too early - Fix vanilla texture manager memory leak diff --git a/src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityExpOrbMixin_RenderDamagedInvulnerables.java b/src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityExpOrbMixin_RenderDamagedInvulnerables.java new file mode 100644 index 00000000..079132e7 --- /dev/null +++ b/src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityExpOrbMixin_RenderDamagedInvulnerables.java @@ -0,0 +1,28 @@ +package club.sk1er.patcher.mixins.bugfixes; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +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.CallbackInfoReturnable; + +@Mixin(EntityXPOrb.class) +public abstract class EntityExpOrbMixin_RenderDamagedInvulnerables + //#if MC==10809 + extends Entity + //#endif +{ + //#if MC==10809 + public EntityExpOrbMixin_RenderDamagedInvulnerables(World worldIn) { + super(worldIn); + } + + @Inject(method = "attackEntityFrom", at = @At("HEAD"), cancellable = true) + private void patcher$properInvulnerableCheck(DamageSource source, float amount, CallbackInfoReturnable cir) { + if (this.worldObj.isRemote) cir.setReturnValue(false); + } + //#endif +} diff --git a/src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityItemMixin_RenderDamagedInvulnerables.java b/src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityItemMixin_RenderDamagedInvulnerables.java new file mode 100644 index 00000000..0e68f47d --- /dev/null +++ b/src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityItemMixin_RenderDamagedInvulnerables.java @@ -0,0 +1,28 @@ +package club.sk1er.patcher.mixins.bugfixes; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +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.CallbackInfoReturnable; + +@Mixin(EntityItem.class) +public abstract class EntityItemMixin_RenderDamagedInvulnerables + //#if MC==10809 + extends Entity + //#endif +{ + //#if MC==10809 + public EntityItemMixin_RenderDamagedInvulnerables(World worldIn) { + super(worldIn); + } + + @Inject(method = "attackEntityFrom", at = @At("HEAD"), cancellable = true) + private void patcher$properInvulnerableCheck(DamageSource source, float amount, CallbackInfoReturnable cir) { + if (this.worldObj.isRemote) cir.setReturnValue(false); + } + //#endif +} diff --git a/src/main/resources/mixins.patcher.json b/src/main/resources/mixins.patcher.json index 4d27df15..4997c34d 100644 --- a/src/main/resources/mixins.patcher.json +++ b/src/main/resources/mixins.patcher.json @@ -40,6 +40,8 @@ "bugfixes.BlockModelRendererMixin_SmoothLighting", "bugfixes.CommandHandlerMixin_CaseCommands", "bugfixes.ContainerMixin_PlaySound", + "bugfixes.EntityExpOrbMixin_RenderDamagedInvulnerables", + "bugfixes.EntityItemMixin_RenderDamagedInvulnerables", "bugfixes.EntityLivingBaseMixin_MouseDelayFix", "bugfixes.EntityMixin_FixedBrightness", "bugfixes.EntityMixin_FixGlow",