Skip to content

Commit

Permalink
Dirty 1.20.1
Browse files Browse the repository at this point in the history
container presets don't work atm
  • Loading branch information
samolego committed Jul 16, 2023
1 parent 68da2c4 commit 9e2be96
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class FabricConfig extends Config {
private static Config serverConfig = null;
public boolean focusSearchBar = false;
public boolean enableItemTransfers = true;
public boolean armorAccess = false;
private boolean allowSyncServer = true;

public FabricConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public abstract class MAbstractContainerScreen {
target = "Lnet/minecraft/client/gui/screens/inventory/AbstractContainerScreen;renderBg(Lnet/minecraft/client/gui/GuiGraphics;FII)V",
shift = At.Shift.AFTER))
private void addArmorSlotBg(GuiGraphics graphics, int x, int y, float f, CallbackInfo ci) {
if (!config.enabled || self instanceof InventoryScreen) {
}
if (!config.enabled || self instanceof InventoryScreen || !config.armorAccess) return;

// Draw background
}
Expand All @@ -49,7 +48,7 @@ private void addArmorSlotBg(GuiGraphics graphics, int x, int y, float f, Callbac
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/gui/screens/inventory/AbstractContainerScreen;renderLabels(Lnet/minecraft/client/gui/GuiGraphics;II)V"))
private void addArmorSlots(GuiGraphics graphics, int x, int y, float f, CallbackInfo ci) {
if (!config.enabled || self instanceof InventoryScreen) return;
if (!config.enabled || self instanceof InventoryScreen || !config.armorAccess) return;
// Draw 5 armor slots
NonNullList<ArmorSlot> armorSlots = ((IArmorMenu) this.self.getMenu()).cs_getArmorSlots();
for (Slot slot : armorSlots) {
Expand All @@ -67,7 +66,7 @@ private void addArmorSlots(GuiGraphics graphics, int x, int y, float f, Callback

@Inject(method = "hasClickedOutside", at = @At("HEAD"), cancellable = true)
private void hasClickedOutside(double clickX, double clickY, int i, int j, int k, CallbackInfoReturnable<Boolean> cir) {
if (!config.enabled || self instanceof InventoryScreen || this.hoveredSlot == null) return;
if (!config.enabled || self instanceof InventoryScreen || this.hoveredSlot == null || !config.armorAccess) return;

int startX = this.hoveredSlot.x;
int startY = this.hoveredSlot.y;
Expand All @@ -81,7 +80,7 @@ private void hasClickedOutside(double clickX, double clickY, int i, int j, int k

@Inject(method = "findSlot", at = @At("TAIL"), cancellable = true)
private void findSlot(double x, double y, CallbackInfoReturnable<Slot> cir) {
if (!config.enabled || self instanceof InventoryScreen) return;
if (!config.enabled || self instanceof InventoryScreen || !config.armorAccess) return;

// Loop through armor slots
NonNullList<ArmorSlot> armorSlots = ((IArmorMenu) this.self.getMenu()).cs_getArmorSlots();
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.1
yarn_mappings=1.20.1+build.9
loader_version=0.14.21
#Fabric api
fabric_version=0.83.1+1.20.1
fabric_version=0.85.0+1.20.1
# Mod Properties
mod_version=2.2.2
maven_group=org.samo_lego
Expand Down

0 comments on commit 9e2be96

Please sign in to comment.