diff options
author | nea <nea@nea.moe> | 2023-10-28 04:07:47 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-10-28 04:07:47 +0200 |
commit | ad490f2ea7967cb6bb97cb797b33aa3554de46a5 (patch) | |
tree | c45cf7f4b8a6d60399fcc46f793c75bd8387211d | |
parent | 9e7da2829cdc949d211ef5021131b4a48ddc3054 (diff) | |
download | Firmament-ad490f2ea7967cb6bb97cb797b33aa3554de46a5.tar.gz Firmament-ad490f2ea7967cb6bb97cb797b33aa3554de46a5.tar.bz2 Firmament-ad490f2ea7967cb6bb97cb797b33aa3554de46a5.zip |
Rename mixins after what they do, rather than where they do it
[no changelog]
Mixins are now named after what they do, and mixins for the same class that do different things should be in two
separate mixins now.
-rw-r--r-- | TODO.txt | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/CaseInsensitiveCommandMapPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinCommandNode.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/ChatPeekingPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinChatHud.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinModelLoader.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinItemModels.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/CustomSkullTexturePatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinEntityIdFix.java) | 4 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/FirmKeybindsInVanillaControlsPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinKeybindsScreen.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/HudRenderEvents.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinInGameHud.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/IncomingPacketListenerPatches.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinClientPacketHandler.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/KeyPressInWorldEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinKeyboard.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/OutgoingPacketEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinClientCommonNetworkHandler.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinClientPlayerEntity.java) | 4 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/PropertySignatureIgnorePatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinProperty.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/SaveCursorPositionPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinMouse.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/ScreenChangeEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinMinecraft.java) | 8 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/ToggleSprintPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinDownloadingTerrainScreen.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java) | 2 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/YggdrasilSignatureIgnorePatch.java (renamed from src/main/java/moe/nea/firmament/mixins/MixinYggdrasilServicesKeyInfo.java) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/ScreenChangeEvent.kt (renamed from src/main/kotlin/moe/nea/firmament/events/ScreenOpenEvent.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlay.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt | 4 |
24 files changed, 33 insertions, 33 deletions
@@ -14,7 +14,7 @@ Priority 1: - Pet/Equipment hud in inventory - Pet Overlay - Price Graphs -- Minion Helper +- Minion -Helper - Fishing - Highlighters - Metal Detector diff --git a/src/main/java/moe/nea/firmament/mixins/MixinCommandNode.java b/src/main/java/moe/nea/firmament/mixins/CaseInsensitiveCommandMapPatch.java index aa8e584..2696a6f 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinCommandNode.java +++ b/src/main/java/moe/nea/firmament/mixins/CaseInsensitiveCommandMapPatch.java @@ -16,7 +16,7 @@ import java.util.Locale; import java.util.Map; @Mixin(value = CommandNode.class, remap = false) -public class MixinCommandNode<S> { +public class CaseInsensitiveCommandMapPatch<S> { @WrapOperation(method = "getRelevantNodes", at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;"), remap = false) public Object modify(Map map, Object text, Operation<Object> op) { var original = op.call(map, text); diff --git a/src/main/java/moe/nea/firmament/mixins/MixinChatHud.java b/src/main/java/moe/nea/firmament/mixins/ChatPeekingPatch.java index aa1bf54..25ba0eb 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinChatHud.java +++ b/src/main/java/moe/nea/firmament/mixins/ChatPeekingPatch.java @@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @Mixin(ChatHud.class) -public class MixinChatHud { +public class ChatPeekingPatch { @ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z")) public boolean onGetChatHud(boolean old) { diff --git a/src/main/java/moe/nea/firmament/mixins/MixinModelLoader.java b/src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java index 78beba2..2da4176 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinModelLoader.java +++ b/src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.function.BiFunction; @Mixin(ModelLoader.class) -public abstract class MixinModelLoader { +public abstract class CustomModelBakerPatch { @Shadow protected abstract void addModel(ModelIdentifier modelId); diff --git a/src/main/java/moe/nea/firmament/mixins/MixinItemModels.java b/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java index 7e8d78b..e8f02d4 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinItemModels.java +++ b/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java @@ -19,7 +19,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(ItemModels.class) -public class MixinItemModels { +public class CustomModelEventPatch { @Shadow @Final private BakedModelManager modelManager; diff --git a/src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java b/src/main/java/moe/nea/firmament/mixins/CustomSkullTexturePatch.java index 7f54150..a8cede4 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java +++ b/src/main/java/moe/nea/firmament/mixins/CustomSkullTexturePatch.java @@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(SkullBlockEntityRenderer.class) -public class MixinSkullBlockEntityRenderer { +public class CustomSkullTexturePatch { @Inject(method = "getRenderLayer", at = @At("HEAD"), cancellable = true) private static void onGetRenderLayer(SkullBlock.SkullType type, GameProfile profile, CallbackInfoReturnable<RenderLayer> cir) { CustomSkyBlockTextures.INSTANCE.modifySkullTexture(type, profile, cir); diff --git a/src/main/java/moe/nea/firmament/mixins/MixinEntityIdFix.java b/src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java index 45c3ddd..8f16686 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinEntityIdFix.java +++ b/src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java @@ -22,12 +22,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.Map; @Mixin(EntityIdFix.class) -public abstract class MixinEntityIdFix extends DataFix { +public abstract class DFUEntityIdFixPatch extends DataFix { @Shadow @Final private static Map<String, String> RENAMED_ENTITIES; - public MixinEntityIdFix(Schema outputSchema, boolean changesType) { + public DFUEntityIdFixPatch(Schema outputSchema, boolean changesType) { super(outputSchema, changesType); } diff --git a/src/main/java/moe/nea/firmament/mixins/MixinKeybindsScreen.java b/src/main/java/moe/nea/firmament/mixins/FirmKeybindsInVanillaControlsPatch.java index 3a17983..be3a3c0 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinKeybindsScreen.java +++ b/src/main/java/moe/nea/firmament/mixins/FirmKeybindsInVanillaControlsPatch.java @@ -23,7 +23,7 @@ import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ControlsListWidget.KeyBindingEntry.class) -public class MixinKeybindsScreen { +public class FirmKeybindsInVanillaControlsPatch { @Mutable @Shadow diff --git a/src/main/java/moe/nea/firmament/mixins/MixinInGameHud.java b/src/main/java/moe/nea/firmament/mixins/HudRenderEvents.java index 826d4e2..5ed969d 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinInGameHud.java +++ b/src/main/java/moe/nea/firmament/mixins/HudRenderEvents.java @@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(InGameHud.class) -public class MixinInGameHud { +public class HudRenderEvents { @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getSleepTimer()I")) public void renderCallBack(DrawContext context, float tickDelta, CallbackInfo ci) { HudRenderEvent.Companion.publish(new HudRenderEvent(context, tickDelta)); diff --git a/src/main/java/moe/nea/firmament/mixins/MixinClientPacketHandler.java b/src/main/java/moe/nea/firmament/mixins/IncomingPacketListenerPatches.java index 0dbf60c..0984264 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinClientPacketHandler.java +++ b/src/main/java/moe/nea/firmament/mixins/IncomingPacketListenerPatches.java @@ -19,7 +19,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ClientPlayNetworkHandler.class) -public abstract class MixinClientPacketHandler { +public abstract class IncomingPacketListenerPatches { @ModifyExpressionValue(method = "onCommandTree", at = @At(value = "NEW", target = "(Lcom/mojang/brigadier/tree/RootCommandNode;)Lcom/mojang/brigadier/CommandDispatcher;")) diff --git a/src/main/java/moe/nea/firmament/mixins/MixinKeyboard.java b/src/main/java/moe/nea/firmament/mixins/KeyPressInWorldEventPatch.java index 8307ae0..79c575b 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinKeyboard.java +++ b/src/main/java/moe/nea/firmament/mixins/KeyPressInWorldEventPatch.java @@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(Keyboard.class) -public class MixinKeyboard { +public class KeyPressInWorldEventPatch { @Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V")) public void onKeyBoardInWorld(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) { diff --git a/src/main/java/moe/nea/firmament/mixins/MixinClientCommonNetworkHandler.java b/src/main/java/moe/nea/firmament/mixins/OutgoingPacketEventPatch.java index 767d25c..de1f722 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinClientCommonNetworkHandler.java +++ b/src/main/java/moe/nea/firmament/mixins/OutgoingPacketEventPatch.java @@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ClientCommonNetworkHandler.class) -public class MixinClientCommonNetworkHandler { +public class OutgoingPacketEventPatch { @Inject(method = "sendPacket(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true) public void onSendPacket(Packet<?> packet, CallbackInfo ci) { if (OutgoingPacketEvent.Companion.publish(new OutgoingPacketEvent(packet)).getCancelled()) { diff --git a/src/main/java/moe/nea/firmament/mixins/MixinClientPlayerEntity.java b/src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java index 16e8fc3..9f6d83b 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinClientPlayerEntity.java +++ b/src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java @@ -17,8 +17,8 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(ClientPlayerEntity.class) -public abstract class MixinClientPlayerEntity extends PlayerEntity { - public MixinClientPlayerEntity() { +public abstract class PlayerDropEventPatch extends PlayerEntity { + public PlayerDropEventPatch() { super(null, null, 0, null); } diff --git a/src/main/java/moe/nea/firmament/mixins/MixinProperty.java b/src/main/java/moe/nea/firmament/mixins/PropertySignatureIgnorePatch.java index 15ff6e4..4c1f3be 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinProperty.java +++ b/src/main/java/moe/nea/firmament/mixins/PropertySignatureIgnorePatch.java @@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.security.PublicKey; @Mixin(value = Property.class, remap = false) -public class MixinProperty { +public class PropertySignatureIgnorePatch { @Inject(method = "isSignatureValid", cancellable = true, at = @At("HEAD"), remap = false) public void onValidateSignature(PublicKey publicKey, CallbackInfoReturnable<Boolean> cir) { if (Fixes.TConfig.INSTANCE.getFixUnsignedPlayerSkins()) { diff --git a/src/main/java/moe/nea/firmament/mixins/MixinMouse.java b/src/main/java/moe/nea/firmament/mixins/SaveCursorPositionPatch.java index 68dda34..30d435f 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinMouse.java +++ b/src/main/java/moe/nea/firmament/mixins/SaveCursorPositionPatch.java @@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(Mouse.class) -public class MixinMouse { +public class SaveCursorPositionPatch { @Shadow private double x; diff --git a/src/main/java/moe/nea/firmament/mixins/MixinMinecraft.java b/src/main/java/moe/nea/firmament/mixins/ScreenChangeEventPatch.java index 90ecd36..1f46f25 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinMinecraft.java +++ b/src/main/java/moe/nea/firmament/mixins/ScreenChangeEventPatch.java @@ -6,7 +6,7 @@ package moe.nea.firmament.mixins; -import moe.nea.firmament.events.ScreenOpenEvent; +import moe.nea.firmament.events.ScreenChangeEvent; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; import org.jetbrains.annotations.Nullable; @@ -17,15 +17,15 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(MinecraftClient.class) -public abstract class MixinMinecraft { +public abstract class ScreenChangeEventPatch { @Shadow @Nullable public Screen currentScreen; @Inject(method = "setScreen", at = @At("HEAD"), cancellable = true) public void onScreenChange(Screen screen, CallbackInfo ci) { - var event = new ScreenOpenEvent(currentScreen, screen); - if (ScreenOpenEvent.Companion.publish(event).getCancelled()) { + var event = new ScreenChangeEvent(currentScreen, screen); + if (ScreenChangeEvent.Companion.publish(event).getCancelled()) { ci.cancel(); } } diff --git a/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java b/src/main/java/moe/nea/firmament/mixins/ToggleSprintPatch.java index f77caf5..d223ed0 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java +++ b/src/main/java/moe/nea/firmament/mixins/ToggleSprintPatch.java @@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(KeyBinding.class) -public class MixinKeyBinding { +public class ToggleSprintPatch { @Inject(method = "isPressed", at = @At("HEAD"), cancellable = true) public void onIsPressed(CallbackInfoReturnable<Boolean> cir) { Fixes.INSTANCE.handleIsPressed((KeyBinding) (Object) this, cir); diff --git a/src/main/java/moe/nea/firmament/mixins/MixinDownloadingTerrainScreen.java b/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java index 0f23af1..33b5894 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinDownloadingTerrainScreen.java +++ b/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java @@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(DownloadingTerrainScreen.class) -public class MixinDownloadingTerrainScreen { +public class WorldReadyEventPatch { @Inject(method = "close", at = @At("HEAD")) public void onClose(CallbackInfo ci) { WorldReadyEvent.Companion.publish(new WorldReadyEvent()); diff --git a/src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java b/src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java index 8aa105f..268aa01 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java +++ b/src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java @@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(WorldRenderer.class) -public class MixinWorldRenderer { +public class WorldRenderLastEventPatch { @Shadow @Final private BufferBuilderStorage bufferBuilders; diff --git a/src/main/java/moe/nea/firmament/mixins/MixinYggdrasilServicesKeyInfo.java b/src/main/java/moe/nea/firmament/mixins/YggdrasilSignatureIgnorePatch.java index 38c380b..2018b06 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinYggdrasilServicesKeyInfo.java +++ b/src/main/java/moe/nea/firmament/mixins/YggdrasilSignatureIgnorePatch.java @@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(value = YggdrasilServicesKeyInfo.class, remap = false) -public class MixinYggdrasilServicesKeyInfo { +public class YggdrasilSignatureIgnorePatch { @Inject(method = "validateProperty", at = @At("HEAD"), cancellable = true, remap = false) public void validate(Property property, CallbackInfoReturnable<Boolean> cir) { if (Fixes.TConfig.INSTANCE.getFixUnsignedPlayerSkins()) { diff --git a/src/main/kotlin/moe/nea/firmament/events/ScreenOpenEvent.kt b/src/main/kotlin/moe/nea/firmament/events/ScreenChangeEvent.kt index 034fe13..c6b0a7f 100644 --- a/src/main/kotlin/moe/nea/firmament/events/ScreenOpenEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/ScreenChangeEvent.kt @@ -8,6 +8,6 @@ package moe.nea.firmament.events import net.minecraft.client.gui.screen.Screen -data class ScreenOpenEvent(val old: Screen?, val new: Screen?) : FirmamentEvent.Cancellable() { - companion object : FirmamentEventBus<ScreenOpenEvent>() +data class ScreenChangeEvent(val old: Screen?, val new: Screen?) : FirmamentEvent.Cancellable() { + companion object : FirmamentEventBus<ScreenChangeEvent>() } diff --git a/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt b/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt index 52834f3..8c9baf7 100644 --- a/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt +++ b/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt @@ -15,7 +15,7 @@ import net.minecraft.util.hit.HitResult import moe.nea.firmament.events.CustomItemModelEvent import moe.nea.firmament.events.HandledScreenKeyPressedEvent import moe.nea.firmament.events.ItemTooltipEvent -import moe.nea.firmament.events.ScreenOpenEvent +import moe.nea.firmament.events.ScreenChangeEvent import moe.nea.firmament.events.TickEvent import moe.nea.firmament.events.WorldKeyboardEvent import moe.nea.firmament.features.FirmamentFeature @@ -91,7 +91,7 @@ object PowerUserTools : FirmamentFeature { lastCopiedStack = null lastCopiedStackViewTime = false } - ScreenOpenEvent.subscribe { + ScreenChangeEvent.subscribe { lastCopiedStack = null } HandledScreenKeyPressedEvent.subscribe { diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlay.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlay.kt index 7d1c72e..cb8a8d8 100644 --- a/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlay.kt +++ b/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlay.kt @@ -8,7 +8,7 @@ package moe.nea.firmament.features.inventory.storageoverlay import java.util.* import kotlinx.serialization.serializer -import moe.nea.firmament.events.ScreenOpenEvent +import moe.nea.firmament.events.ScreenChangeEvent import moe.nea.firmament.events.TickEvent import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.gui.config.ManagedConfig @@ -36,7 +36,7 @@ object StorageOverlay : FirmamentFeature { var currentHandler: StorageBackingHandle? = StorageBackingHandle.None override fun onLoad() { - ScreenOpenEvent.subscribe { event -> + ScreenChangeEvent.subscribe { event -> currentHandler = StorageBackingHandle.fromScreen(event.new) if (event.old is StorageOverlayScreen && !event.old.isClosing) { event.old.setHandler(currentHandler) diff --git a/src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt b/src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt index 1e7853c..1643ab1 100644 --- a/src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt +++ b/src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt @@ -13,7 +13,7 @@ import net.minecraft.client.MinecraftClient import net.minecraft.server.command.CommandOutput import net.minecraft.text.Text import moe.nea.firmament.Firmament -import moe.nea.firmament.events.ScreenOpenEvent +import moe.nea.firmament.events.ScreenChangeEvent interface IDataHolder<T> { companion object { @@ -60,7 +60,7 @@ interface IDataHolder<T> { } fun registerEvents() { - ScreenOpenEvent.subscribe { event -> + ScreenChangeEvent.subscribe { event -> performSaves() val p = MinecraftClient.getInstance().player if (p != null) { |