-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logged error upon loading a world
- Loading branch information
1 parent
61e44bd
commit fbed533
Showing
4 changed files
with
41 additions
and
3 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
14 changes: 14 additions & 0 deletions
14
src/main/java/net/vulkanmod/mixin/chunk/SectionRenderDispatcherM.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,14 @@ | ||
package net.vulkanmod.mixin.chunk; | ||
|
||
import net.minecraft.client.renderer.chunk.SectionRenderDispatcher; | ||
import net.minecraft.util.thread.ProcessorMailbox; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(SectionRenderDispatcher.class) | ||
public class SectionRenderDispatcherM { | ||
|
||
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/thread/ProcessorMailbox;tell(Ljava/lang/Object;)V")) | ||
private void redirectTask(ProcessorMailbox instance, Object object) {} | ||
} |
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,22 @@ | ||
package net.vulkanmod.mixin.chunk; | ||
|
||
import net.minecraft.client.renderer.ViewArea; | ||
import net.minecraft.client.renderer.chunk.SectionRenderDispatcher; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ViewArea.class) | ||
public class ViewAreaM { | ||
|
||
@Shadow public SectionRenderDispatcher.RenderSection[] sections; | ||
|
||
@Inject(method = "createSections", at = @At("HEAD"), cancellable = true) | ||
private void skipAllocation(SectionRenderDispatcher sectionRenderDispatcher, CallbackInfo ci) { | ||
this.sections = new SectionRenderDispatcher.RenderSection[0]; | ||
|
||
ci.cancel(); | ||
} | ||
} |
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