diff --git a/src/main/java/gq/nkkx/oldanimations/client/mixin/screen/ingame/InventoryScreenMixin.java b/src/main/java/gq/nkkx/oldanimations/client/mixin/screen/ingame/InventoryScreenMixin.java deleted file mode 100644 index 98a2be7..0000000 --- a/src/main/java/gq/nkkx/oldanimations/client/mixin/screen/ingame/InventoryScreenMixin.java +++ /dev/null @@ -1,21 +0,0 @@ -package gq.nkkx.oldanimations.client.mixin.screen.ingame; - -import gq.nkkx.oldanimations.renderer.OldAnimationsInventoryScreen; -import net.minecraft.client.gui.screen.ingame.InventoryScreen; -import net.minecraft.client.util.math.MatrixStack; -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.CallbackInfo; - -@Mixin(InventoryScreen.class) -public class InventoryScreenMixin { - - private final OldAnimationsInventoryScreen renderer = new OldAnimationsInventoryScreen((InventoryScreen) (Object) this); - - @Inject(at = @At(value = "HEAD"), method = "render") - private void old_animations$render(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo callbackInfo) { - renderer.render(callbackInfo); - } - -} diff --git a/src/main/java/gq/nkkx/oldanimations/features/CenteredInventoryFeature.java b/src/main/java/gq/nkkx/oldanimations/features/CenteredInventoryFeature.java deleted file mode 100644 index 4896f5b..0000000 --- a/src/main/java/gq/nkkx/oldanimations/features/CenteredInventoryFeature.java +++ /dev/null @@ -1,26 +0,0 @@ -package gq.nkkx.oldanimations.features; - -import gq.nkkx.oldanimations.client.OldAnimationsClient; -import gq.nkkx.oldanimations.features.context.FeatureExecutionContext; -import net.minecraft.client.gui.screen.ingame.InventoryScreen; - -public class CenteredInventoryFeature implements OldAnimationsFeature { - - private final InventoryScreen parent; - - public CenteredInventoryFeature(InventoryScreen parent) { - this.parent = parent; - } - - public static boolean isEnabled() { - return OldAnimationsClient.options().getCenteredInventory().isEnabled(); - } - - @Override - public void transform(FeatureExecutionContext context) { - if (!context.player().getActiveStatusEffects().isEmpty()) { - parent.setZOffset(parent.width / 2); - } - } - -} diff --git a/src/main/java/gq/nkkx/oldanimations/options/CenteredInventoryOptions.java b/src/main/java/gq/nkkx/oldanimations/options/CenteredInventoryOptions.java deleted file mode 100644 index ce4dc27..0000000 --- a/src/main/java/gq/nkkx/oldanimations/options/CenteredInventoryOptions.java +++ /dev/null @@ -1,15 +0,0 @@ -package gq.nkkx.oldanimations.options; - -import me.shedaniel.autoconfig.ConfigData; -import me.shedaniel.autoconfig.annotation.Config; - -@Config(name = "centered-inventory") -public class CenteredInventoryOptions implements ConfigData { - - boolean isEnabled = true; - - public boolean isEnabled() { - return isEnabled; - } - -} diff --git a/src/main/java/gq/nkkx/oldanimations/options/OldAnimationsOptions.java b/src/main/java/gq/nkkx/oldanimations/options/OldAnimationsOptions.java index 859e04b..ba4fa1f 100644 --- a/src/main/java/gq/nkkx/oldanimations/options/OldAnimationsOptions.java +++ b/src/main/java/gq/nkkx/oldanimations/options/OldAnimationsOptions.java @@ -23,15 +23,6 @@ public class OldAnimationsOptions extends PartitioningSerializer.GlobalData { @Gui.TransitiveObject SwordBlockingOptions swordBlocking = new SwordBlockingOptions(); - @Category("centered-inventory") - @Gui.CollapsibleObject - @Gui.TransitiveObject - CenteredInventoryOptions centeredInventory = new CenteredInventoryOptions(); - - public CenteredInventoryOptions getCenteredInventory() { - return centeredInventory; - } - public OldSneakingFeatureOptions getOldSneaking() { return oldSneaking; } diff --git a/src/main/java/gq/nkkx/oldanimations/renderer/OldAnimationsInventoryScreen.java b/src/main/java/gq/nkkx/oldanimations/renderer/OldAnimationsInventoryScreen.java deleted file mode 100644 index b4d7efc..0000000 --- a/src/main/java/gq/nkkx/oldanimations/renderer/OldAnimationsInventoryScreen.java +++ /dev/null @@ -1,26 +0,0 @@ -package gq.nkkx.oldanimations.renderer; - -import gq.nkkx.oldanimations.features.CenteredInventoryFeature; -import gq.nkkx.oldanimations.features.context.FeatureExecutionContext; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.screen.ingame.InventoryScreen; -import net.minecraft.entity.player.PlayerEntity; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -public class OldAnimationsInventoryScreen { - - private final CenteredInventoryFeature feature; - - public OldAnimationsInventoryScreen(InventoryScreen parent) { - this.feature = new CenteredInventoryFeature(parent); - } - - public void render(CallbackInfo callbackInfo) { - PlayerEntity player = MinecraftClient.getInstance().player; - if (player != null && CenteredInventoryFeature.isEnabled() && !player.getActiveStatusEffects().isEmpty()) { - FeatureExecutionContext context = FeatureExecutionContext.create(callbackInfo); - feature.transform(context); - } - } - -}