So I renamed everything

This commit is contained in:
MrMelon54 committed 2023-06-27 18:59:20 +01:00
1 parent f4943e0897
commit fa9ded7d9b
42 files changed
+131 -133

No files matched your search

@@ -1,6 +1,6 @@
package com.mrmelon54.Draggable;
package com.mrmelon54.DraggableLists;
import com.mrmelon54.Draggable.config.ConfigStructure;
import com.mrmelon54.DraggableLists.config.ConfigStructure;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer;
import net.minecraft.client.gui.screens.Screen;
@@ -9,7 +9,7 @@ import net.minecraft.server.packs.repository.Pack;
import java.util.function.Supplier;
public class Draggable {
public class DraggableLists {
public static final String MOD_ID = "draggable";
private static ConfigStructure config;
@@ -1,9 +1,9 @@
package com.mrmelon54.Draggable.config;
package com.mrmelon54.DraggableLists.config;
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
@Config(name = "draggable")
@Config(name = "draggable_lists")
@Config.Gui.Background("minecraft:textures/block/brain_coral_block.png")
public class ConfigStructure implements ConfigData {
public boolean disableResourcePackArrows = true;
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.duck;
package com.mrmelon54.DraggableLists.duck;
public interface AbstractPackDuckProvider {
void moveTo(int j);
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.duck;
package com.mrmelon54.DraggableLists.duck;
import net.minecraft.client.multiplayer.ServerData;
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.duck;
package com.mrmelon54.DraggableLists.duck;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.packs.PackSelectionModel;
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.duck;
package com.mrmelon54.DraggableLists.duck;
public interface ResourcePackOrganizerDuckProvider {
void updateSelectedList();
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.duck;
package com.mrmelon54.DraggableLists.duck;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.multiplayer.ServerData;
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.duck;
package com.mrmelon54.DraggableLists.duck;
import net.minecraft.client.multiplayer.ServerData;
@@ -1,6 +1,6 @@
package com.mrmelon54.Draggable.mixin.packs;
package com.mrmelon54.DraggableLists.mixin.packs;
import com.mrmelon54.Draggable.duck.ResourcePackOrganizerDuckProvider;
import com.mrmelon54.DraggableLists.duck.ResourcePackOrganizerDuckProvider;
import net.minecraft.client.gui.screens.packs.PackSelectionModel;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -1,8 +1,8 @@
package com.mrmelon54.Draggable.mixin.packs;
package com.mrmelon54.DraggableLists.mixin.packs;
import com.mrmelon54.Draggable.Draggable;
import com.mrmelon54.Draggable.duck.AbstractPackDuckProvider;
import com.mrmelon54.Draggable.duck.ResourcePackOrganizerDuckProvider;
import com.mrmelon54.DraggableLists.DraggableLists;
import com.mrmelon54.DraggableLists.duck.AbstractPackDuckProvider;
import com.mrmelon54.DraggableLists.duck.ResourcePackOrganizerDuckProvider;
import net.minecraft.client.gui.screens.packs.PackSelectionModel;
import net.minecraft.server.packs.repository.Pack;
import org.spongepowered.asm.mixin.Dynamic;
@@ -29,14 +29,14 @@ public abstract class MixinPackSelectionModel_EntryBase implements AbstractPackD
@Override
public void moveTo(int j) {
if (Draggable.shouldNotTouch(pack)) return;
if (DraggableLists.shouldNotTouch(pack)) return;
List<Pack> list = getSelfList();
list.remove(pack);
list.add(j, pack);
// get all fixed position resource packs, remove them and add them all at the end
Stream<Pack> packStream = list.stream().filter(Draggable::shouldNotTouch);
Stream<Pack> packStream = list.stream().filter(DraggableLists::shouldNotTouch);
List<Pack> list1 = packStream.toList();
list.removeAll(list1);
list.addAll(list1);
@@ -1,4 +1,4 @@
package com.mrmelon54.Draggable.mixin.packs;
package com.mrmelon54.DraggableLists.mixin.packs;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.packs.PackSelectionScreen;
@@ -1,8 +1,8 @@
package com.mrmelon54.Draggable.mixin.packs;
package com.mrmelon54.DraggableLists.mixin.packs;
import com.mrmelon54.Draggable.Draggable;
import com.mrmelon54.Draggable.duck.AbstractPackDuckProvider;
import com.mrmelon54.Draggable.duck.ResourcePackEntryDuckProvider;
import com.mrmelon54.DraggableLists.DraggableLists;
import com.mrmelon54.DraggableLists.duck.AbstractPackDuckProvider;
import com.mrmelon54.DraggableLists.duck.ResourcePackEntryDuckProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.Util;
@@ -174,6 +174,6 @@ public abstract class MixinTransferableSelectionList extends ObjectSelectionList
}
boolean isValidForDragging(ResourcePackEntryDuckProvider resourcePackEntryDuckProvider) {
return !Draggable.shouldNotTouch(resourcePackEntryDuckProvider.getUnderlyingPack()) && resourcePackEntryDuckProvider.getUnderlyingPack().isSelected();
return !DraggableLists.shouldNotTouch(resourcePackEntryDuckProvider.getUnderlyingPack()) && resourcePackEntryDuckProvider.getUnderlyingPack().isSelected();
}
}
@@ -1,8 +1,8 @@
package com.mrmelon54.Draggable.mixin.packs;
package com.mrmelon54.DraggableLists.mixin.packs;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mrmelon54.Draggable.Draggable;
import com.mrmelon54.Draggable.duck.ResourcePackEntryDuckProvider;
import com.mrmelon54.DraggableLists.DraggableLists;
import com.mrmelon54.DraggableLists.duck.ResourcePackEntryDuckProvider;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.ObjectSelectionList;
import net.minecraft.client.gui.screens.packs.PackSelectionModel;
@@ -40,31 +40,31 @@ public abstract class MixinTransferableSelectionList_PackEntry extends ObjectSel
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 5))
public void removeOnUpArrowButtons(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableResourcePackArrows) return;
if (DraggableLists.getConfig().disableResourcePackArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 6))
public void removeOffUpArrowButtons(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableResourcePackArrows) return;
if (DraggableLists.getConfig().disableResourcePackArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 7))
public void removeOnDownArrowButtons(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableResourcePackArrows) return;
if (DraggableLists.getConfig().disableResourcePackArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 8))
public void removeOffDownArrowButtons(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableResourcePackArrows) return;
if (DraggableLists.getConfig().disableResourcePackArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Inject(method = "mouseClicked", at = @At("HEAD"), cancellable = true)
public void removeMoveTowardEnd(double d, double e, int i, CallbackInfoReturnable<Boolean> cir) {
if (!Draggable.getConfig().disableResourcePackArrows) return;
if (!DraggableLists.getConfig().disableResourcePackArrows) return;
if (d > getRectangle().width() / 2f) return;
double f = d - (double) parent.getRowLeft();
@@ -1,6 +1,6 @@
package com.mrmelon54.Draggable.mixin.server;
package com.mrmelon54.DraggableLists.mixin.server;
import com.mrmelon54.Draggable.duck.MultiplayerScreenDuckProvider;
import com.mrmelon54.DraggableLists.duck.MultiplayerScreenDuckProvider;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
import net.minecraft.client.gui.screens.multiplayer.ServerSelectionList;
@@ -1,8 +1,8 @@
package com.mrmelon54.Draggable.mixin.server;
package com.mrmelon54.DraggableLists.mixin.server;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mrmelon54.Draggable.Draggable;
import com.mrmelon54.Draggable.duck.ServerEntryDuckProvider;
import com.mrmelon54.DraggableLists.DraggableLists;
import com.mrmelon54.DraggableLists.duck.ServerEntryDuckProvider;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.ObjectSelectionList;
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
@@ -74,25 +74,25 @@ public abstract class MixinOnlineServerEntry extends ObjectSelectionList.Entry<S
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 3))
public void removeUpOnButton(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableServerArrows) return;
if (DraggableLists.getConfig().disableServerArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 4))
public void removeUpButton(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableServerArrows) return;
if (DraggableLists.getConfig().disableServerArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 5))
public void removeDownOnButton(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableServerArrows) return;
if (DraggableLists.getConfig().disableServerArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V", ordinal = 6))
public void removeDownButton(GuiGraphics instance, ResourceLocation resourceLocation, int i, int j, float f, float g, int k, int l, int m, int n) {
if (Draggable.getConfig().disableServerArrows) return;
if (DraggableLists.getConfig().disableServerArrows) return;
instance.blit(resourceLocation, i, j, f, g, k, l, m, n);
}
@@ -1,6 +1,6 @@
package com.mrmelon54.Draggable.mixin.server;
package com.mrmelon54.DraggableLists.mixin.server;
import com.mrmelon54.Draggable.duck.ServerListDuckProvider;
import com.mrmelon54.DraggableLists.duck.ServerListDuckProvider;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import org.spongepowered.asm.mixin.Final;
@@ -1,8 +1,8 @@
package com.mrmelon54.Draggable.mixin.server;
package com.mrmelon54.DraggableLists.mixin.server;
import com.mrmelon54.Draggable.duck.MultiplayerScreenDuckProvider;
import com.mrmelon54.Draggable.duck.ServerEntryDuckProvider;
import com.mrmelon54.Draggable.duck.ServerListDuckProvider;
import com.mrmelon54.DraggableLists.duck.MultiplayerScreenDuckProvider;
import com.mrmelon54.DraggableLists.duck.ServerEntryDuckProvider;
import com.mrmelon54.DraggableLists.duck.ServerListDuckProvider;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
@@ -1,3 +1,3 @@
{
"accessWidener": "draggable.accesswidener"
"accessWidener": "draggable_lists.accesswidener"
}
@@ -1,6 +1,6 @@
{
"required": true,
"package": "com.mrmelon54.Draggable.mixin",
"package": "com.mrmelon54.DraggableLists.mixin",
"compatibilityLevel": "JAVA_17",
"minVersion": "0.8",
"client": [