-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I swear to god I've worked on this thing for like 10 hours now, why does wynntils have the most complicated ass code like bro you're not trying to go to mars it's okay to not make everything so complicated it could kill a Victorian era child just by looking at it please I just want this feature to be over and done with, why is it so hard to make it look good and actually function like I am not a front end developer what the fuck am I supposed to do with all of this like please I just want to see my family but I am being forced to work in the coal mines
- Loading branch information
Showing
4 changed files
with
128 additions
and
50 deletions.
There are no files selected for viewing
48 changes: 0 additions & 48 deletions
48
common/src/main/java/dev/lotnest/sequoia/commands/MessageCommand.java
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
common/src/main/java/dev/lotnest/sequoia/commands/PartyCommand.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,56 @@ | ||
/* | ||
* Copyright © sequoia-mod 2025. | ||
* This file is released under LGPLv3. See LICENSE for full license details. | ||
*/ | ||
package dev.lotnest.sequoia.commands; | ||
|
||
import com.mojang.brigadier.builder.LiteralArgumentBuilder; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import dev.lotnest.sequoia.core.consumers.command.Command; | ||
import dev.lotnest.sequoia.mc.screens.WarPartyScreen; | ||
import java.util.List; | ||
import java.util.concurrent.Executors; | ||
import java.util.concurrent.TimeUnit; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.commands.CommandSourceStack; | ||
import net.minecraft.network.chat.Component; | ||
|
||
public class PartyCommand extends Command { | ||
@Override | ||
public String getCommandName() { | ||
return "warparties"; | ||
} | ||
|
||
@Override | ||
public List<String> getAliases() { | ||
return List.of("wp"); | ||
} | ||
|
||
@Override | ||
public LiteralArgumentBuilder<CommandSourceStack> getCommandBuilder( | ||
LiteralArgumentBuilder<CommandSourceStack> base) { | ||
return base.executes(this::tryOpenWarPartyGUI); | ||
} | ||
|
||
private int tryOpenWarPartyGUI(CommandContext<CommandSourceStack> context) { | ||
try { | ||
System.out.println("[WarParties] Attempting to open WarPartyScreen..."); | ||
|
||
Executors.newSingleThreadScheduledExecutor() | ||
.schedule( | ||
() -> Minecraft.getInstance().execute(() -> { | ||
System.out.println("[WarParties] Opening WarPartyScreen now!"); | ||
Minecraft.getInstance().setScreen(new WarPartyScreen()); | ||
}), | ||
1, | ||
TimeUnit.MILLISECONDS); | ||
|
||
} catch (Exception exception) { | ||
System.err.println("[WarParties] Failed to open WarPartyScreen!"); | ||
exception.printStackTrace(); | ||
context.getSource().sendFailure(Component.literal("Error opening WarPartyScreen!")); | ||
} | ||
|
||
return 1; | ||
} | ||
} |
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
70 changes: 70 additions & 0 deletions
70
common/src/main/java/dev/lotnest/sequoia/mc/screens/WarPartyScreen.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,70 @@ | ||
/* | ||
* Copyright © sequoia-mod 2025. | ||
* This file is released under LGPLv3. See LICENSE for full license details. | ||
*/ | ||
package dev.lotnest.sequoia.mc.screens; | ||
|
||
import dev.lotnest.sequoia.features.war.GuildWarParty; | ||
import dev.lotnest.sequoia.models.war.WarPartyModel; | ||
import io.wispforest.owo.ui.base.BaseOwoScreen; | ||
import io.wispforest.owo.ui.component.Components; | ||
import io.wispforest.owo.ui.container.Containers; | ||
import io.wispforest.owo.ui.container.FlowLayout; | ||
import io.wispforest.owo.ui.core.HorizontalAlignment; | ||
import io.wispforest.owo.ui.core.Insets; | ||
import io.wispforest.owo.ui.core.OwoUIAdapter; | ||
import io.wispforest.owo.ui.core.Surface; | ||
import io.wispforest.owo.ui.core.VerticalAlignment; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import net.minecraft.core.component.DataComponents; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
|
||
public class WarPartyScreen extends BaseOwoScreen<FlowLayout> { | ||
private final Map<Integer, GuildWarParty> warParties; | ||
|
||
public WarPartyScreen() { | ||
super(Component.literal("War Parties")); | ||
this.warParties = generateMockData(); // Replace this with real data later | ||
} | ||
|
||
@Override | ||
protected OwoUIAdapter<FlowLayout> createAdapter() { | ||
return OwoUIAdapter.create(this, Containers::verticalFlow); | ||
} | ||
|
||
@Override | ||
protected void build(FlowLayout rootComponent) { | ||
rootComponent | ||
.surface(Surface.DARK_PANEL) | ||
.horizontalAlignment(HorizontalAlignment.CENTER) | ||
.verticalAlignment(VerticalAlignment.CENTER) | ||
.padding(Insets.of(5)); | ||
|
||
for (GuildWarParty party : warParties.values()) { | ||
ItemStack paper = new ItemStack(Items.PAPER); | ||
paper.set(DataComponents.CUSTOM_NAME, Component.literal("Leader: " + party.partyLeader())); | ||
|
||
String tooltipText = "Leader: " + party.partyLeader() + "\nTerritory: " + party.territory() + "\nMembers: " | ||
+ party.members().toString(); | ||
|
||
rootComponent.child(Components.item(paper).tooltip(Component.literal(tooltipText))); | ||
} | ||
} | ||
|
||
private static Map<Integer, GuildWarParty> generateMockData() { | ||
Map<Integer, GuildWarParty> parties = new HashMap<>(); | ||
parties.put(1, new GuildWarParty(123, "Steve", "Desert Outpost", Map.of("Alex", WarPartyModel.Role.DPS))); | ||
parties.put(2, new GuildWarParty(456, "Alex", "Jungle Base", Map.of("Steve", WarPartyModel.Role.HEALER))); | ||
parties.put( | ||
3, | ||
new GuildWarParty( | ||
666, | ||
"MaidKeeper", | ||
"Your Mom", | ||
Map.of("MaidKeeper", WarPartyModel.Role.SOLO, "The maid being kept", WarPartyModel.Role.SOLO))); | ||
return parties; | ||
} | ||
} |