forked from Sk1erLLC/Patcher
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dont try to render removed tile entities (#43)
- Loading branch information
1 parent
074ee92
commit b400fbf
Showing
4 changed files
with
23 additions
and
2 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
21 changes: 21 additions & 0 deletions
21
...r/patcher/mixins/performance/TileEntityRendererDispatcherMixin_RemoveInvalidEntities.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,21 @@ | ||
package club.sk1er.patcher.mixins.performance; | ||
|
||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; | ||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; | ||
import net.minecraft.tileentity.TileEntity; | ||
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(TileEntityRendererDispatcher.class) | ||
public class TileEntityRendererDispatcherMixin_RemoveInvalidEntities { | ||
//#if MC==10809 | ||
@Inject(method = "getSpecialRenderer", at = @At("HEAD"), cancellable = true) | ||
private <T extends TileEntity> void patcher$returnNullIfInvalid(TileEntity tileEntityIn, CallbackInfoReturnable<TileEntitySpecialRenderer<T>> cir) { | ||
if (tileEntityIn == null || tileEntityIn.isInvalid()) { | ||
cir.setReturnValue(null); | ||
} | ||
} | ||
//#endif | ||
} |
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