-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
152 additions
and
307 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
9 changes: 9 additions & 0 deletions
9
src/main/java/net/ludocrypt/limlib/access/ItemRendererAccess.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,9 @@ | ||
package net.ludocrypt.limlib.access; | ||
|
||
public interface ItemRendererAccess { | ||
|
||
public boolean isInGui(); | ||
|
||
public void setInGui(boolean in); | ||
|
||
} |
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
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
16 changes: 16 additions & 0 deletions
16
src/main/java/net/ludocrypt/limlib/impl/LimlibRendering.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,16 @@ | ||
package net.ludocrypt.limlib.impl; | ||
|
||
import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder; | ||
import net.fabricmc.fabric.api.event.registry.RegistryAttribute; | ||
import net.ludocrypt.limlib.api.render.LiminalCoreShader; | ||
import net.ludocrypt.limlib.api.render.LiminalQuadRenderer; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.SimpleRegistry; | ||
|
||
public class LimlibRendering { | ||
|
||
public static final SimpleRegistry<LiminalQuadRenderer> LIMINAL_QUAD_RENDERER = FabricRegistryBuilder.createSimple(LiminalQuadRenderer.class, new Identifier("limlib", "limlib_quad_renderer")).attribute(RegistryAttribute.SYNCED).buildAndRegister(); | ||
|
||
public static final SimpleRegistry<LiminalCoreShader> LIMINAL_CORE_SHADER = FabricRegistryBuilder.createSimple(LiminalCoreShader.class, new Identifier("limlib", "limlib_core_shader")).attribute(RegistryAttribute.SYNCED).buildAndRegister(); | ||
|
||
} |
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
30 changes: 30 additions & 0 deletions
30
src/main/java/net/ludocrypt/limlib/mixin/InventoryScreenMixin.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,30 @@ | ||
package net.ludocrypt.limlib.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import net.ludocrypt.limlib.access.ItemRendererAccess; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.ingame.InventoryScreen; | ||
import net.minecraft.entity.LivingEntity; | ||
|
||
@Mixin(InventoryScreen.class) | ||
public class InventoryScreenMixin { | ||
|
||
@Unique | ||
private static final MinecraftClient CLIENT = MinecraftClient.getInstance(); | ||
|
||
@Inject(method = "Lnet/minecraft/client/gui/screen/ingame/InventoryScreen;drawEntity(IIIFFLnet/minecraft/entity/LivingEntity;)V", at = @At("HEAD")) | ||
private static void limlib$drawEntity$head(int x, int y, int size, float mouseX, float mouseY, LivingEntity entity, CallbackInfo ci) { | ||
((ItemRendererAccess) CLIENT.getItemRenderer()).setInGui(true); | ||
} | ||
|
||
@Inject(method = "Lnet/minecraft/client/gui/screen/ingame/InventoryScreen;drawEntity(IIIFFLnet/minecraft/entity/LivingEntity;)V", at = @At("TAIL")) | ||
private static void limlib$drawEntity$tail(int x, int y, int size, float mouseX, float mouseY, LivingEntity entity, CallbackInfo ci) { | ||
((ItemRendererAccess) CLIENT.getItemRenderer()).setInGui(false); | ||
} | ||
|
||
} |
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
Oops, something went wrong.