Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix MC-53850 #61

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Boolean> cir) {
if (this.worldObj.isRemote) cir.setReturnValue(false);
}
//#endif
}
Original file line number Diff line number Diff line change
@@ -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<Boolean> cir) {
if (this.worldObj.isRemote) cir.setReturnValue(false);
}
//#endif
}
2 changes: 2 additions & 0 deletions src/main/resources/mixins.patcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading