Skip to content

Commit

Permalink
Merge branch 'main' into main-menu-selection-(wyvest-version)
Browse files Browse the repository at this point in the history
Signed-off-by: Su386 <83100266+Su386yt@users.noreply.github.com>
  • Loading branch information
Su386yt authored Jul 4, 2024
2 parents dce072f + 908b8f7 commit 62cc281
Show file tree
Hide file tree
Showing 34 changed files with 619 additions and 195 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/label-merge-conflicts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# https://github.com/marketplace/actions/label-conflicting-pull-requests

name: "Merge Conflicts Label"
on:
# So that PRs touching the same files as the push are updated
push:
branches: [ main ]
# So that the `dirtyLabel` is removed if conflicts are resolve
# We recommend `pull_request_target` so that GitHub secrets are available.
# In `pull_request` we wouldn't be able to change labels of fork PRs
pull_request_target:
types: [ opened, synchronize ]

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Update PRs with merge conflicts label
uses: eps1lon/actions-label-merge-conflict@v3
with:
dirtyLabel: "Merge Conflicts"
#removeOnDirtyLabel: "PR: ready to ship"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "This pull request has conflicts, please resolve those before the pull request can be reviewed."
commentOnClean: "Conflicts have been resolved!"
2 changes: 2 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Discord and GitHub information for all contributors.

- @salamibrod ([@DerGruenkohl](https://github.com/DerGruenkohl))

- @empa_ ([@ItsEmpa](https://github.com/ItsEmpa/))

## Artists

The FurfSky team does all textures labeled FurfSky. This includes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;

public class ChatAlertsManager {
static String DATA_PATH_NAME = "./config/partly-sane-skies/chatAlertsData.json";
Expand Down Expand Up @@ -61,7 +62,7 @@ public static void registerCommand() {
.addAlias("chatAlert")
.addAlias("chal")
.setDescription("Operates the chat alerts feature: /chatalerts <add/remove/list> ")
.setRunnable(((sender, args) -> {
.setRunnable(args -> {
// If the user doesn't provide any arguments whatsoever print message
if (args.length == 0) {
ChatUtils.INSTANCE.sendClientMessage("§cIncorrect usage. Correct usage: /chatalerts add/remove/list");
Expand Down Expand Up @@ -125,7 +126,7 @@ public static void registerCommand() {
ChatUtils.INSTANCE.sendClientMessage("§cIncorrect usage. Correct usage: /chatalerts add/remove/list");
break;
}
}))
})
.register();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static String handleWordEditorMessage(String message) {
// Quick while hes not looking! add the session id stealer code ~su

/*
*
*
sjw _..----.._ _
.' .--. "-.(0)_
'-.__.-'"'=:| , _)_ \__ . c\'-..
Expand Down Expand Up @@ -109,7 +109,7 @@ public static void registerWordEditorCommand() {
.addAlias("wordreplace")
.addAlias("wr")
.setDescription("Operates the word editor: /wordeditor add <word> <replacement>, /wordeditor list or /wordeditor remove <index>")
.setRunnable(((sender, args) -> {
.setRunnable(args -> {
if (args.length == 0 || args[0].equalsIgnoreCase("list")) {

ChatUtils.INSTANCE.sendClientMessage("§7To add a word to replace, run §b/wordeditor add <word> <replacement>§7. To remove a word, run §b/wordeditor remove <index>§7. To list all of the words, run §b/wordeditor list§7.");
Expand Down Expand Up @@ -166,7 +166,7 @@ public static void registerWordEditorCommand() {
e.printStackTrace();
}
}
}))
})
.register();
}

Expand Down Expand Up @@ -204,4 +204,4 @@ public static void load() throws IOException {

wordsToEdit = new Gson().fromJson(reader, String[][].class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void registerCommand() {
.addAlias("fp")
.addAlias("pf")
.setDescription("Parties all friends in the friend list")
.setRunnable((s, a) -> {
.setRunnable(a -> {
PartyFriendManager.startPartyManager();
})
.register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void registerCommand() {
.addAlias("pm")
.addAlias("partym")
.setDescription("Opens the Party Manager")
.setRunnable((s, a) -> {
.setRunnable(a -> {
PartyManager.startPartyManager();
})
.register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void registerCommand() {
.addAlias("pp")
.addAlias("permp")
.setDescription("Operates the perm party manager: /permparty [<partyid>/add/remove/list/delete/new/fav]")
.setRunnable((sender, args) -> {
.setRunnable(args -> {
if (args.length == 0) {
ChatUtils.INSTANCE.sendClientMessage(
(
Expand Down Expand Up @@ -239,7 +239,7 @@ public static boolean addParty(String name, List<String> partyMembers) {
return true;
}

// Sets the party as the favorite party
// Sets the party as the favorite party
public static boolean favoriteParty(String name) {
// Removes all favorites from other parties
for (Entry<String, PermParty> en : permPartyMap.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void registerCommand() {
.addAlias("bestminion")
.addAlias("mc")
.setDescription("Opens the best minion calculator")
.setRunnable((s, a) -> {
.setRunnable(a -> {
ChatUtils.INSTANCE.sendClientMessage("§bOpening Minion Calculator...");
MinecraftUtils.INSTANCE.displayGuiScreen(new ProfitMinionCalculator(ElementaVersion.V2));
})
Expand Down Expand Up @@ -208,6 +208,7 @@ public HashMap<String, PSSToggle> addFuelButtons() {
.setX(fromWidthScaleFactor(10))
.setY(new PixelConstraint(yPos))
.setWidth(new PixelConstraint(leftBar.getLeft() - mainTextScrollComponent.getLeft() - fromWidthScaleFactor(20).getValue()))
.setHeight(fromWidthScaleFactor(40))
.setChildOf(mainTextScrollComponent);

PSSToggle toggle = new PSSToggle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static void registerCommand() {
.addAlias("skillu")
.addAlias("su")
.setDescription("Recommends which skill to upgrade: /skillup [username]")
.setRunnable((s, a) -> {
.setRunnable(a -> {
ChatUtils.INSTANCE.sendClientMessage("Loading...");

new Thread(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ import me.partlysanestudios.partlysaneskies.features.farming.MathematicalHoeRigh
import me.partlysanestudios.partlysaneskies.features.farming.WrongToolCropWarning
import me.partlysanestudios.partlysaneskies.features.farming.endoffarmnotifer.EndOfFarmNotifier
import me.partlysanestudios.partlysaneskies.features.farming.endoffarmnotifer.RangeHighlight
import me.partlysanestudios.partlysaneskies.features.farming.garden.CompostValue
import me.partlysanestudios.partlysaneskies.features.farming.garden.SkymartValue
import me.partlysanestudios.partlysaneskies.features.farming.garden.VisitorLogbookStats
import me.partlysanestudios.partlysaneskies.features.farming.garden.VisitorTradeValue
import me.partlysanestudios.partlysaneskies.features.farming.garden.*
import me.partlysanestudios.partlysaneskies.features.foraging.TreecapitatorCooldown
import me.partlysanestudios.partlysaneskies.features.gui.RefreshKeybinds
import me.partlysanestudios.partlysaneskies.features.gui.hud.CooldownHud
Expand All @@ -78,7 +75,10 @@ import me.partlysanestudios.partlysaneskies.features.mining.crystalhollows.gemst
import me.partlysanestudios.partlysaneskies.features.mining.crystalhollows.gemstonewaypoints.GemstoneWaypointRender
import me.partlysanestudios.partlysaneskies.features.security.PrivacyMode
import me.partlysanestudios.partlysaneskies.features.security.modschecker.ModChecker
import me.partlysanestudios.partlysaneskies.features.skills.BestiaryMilestoneWebhook
import me.partlysanestudios.partlysaneskies.features.skills.BestiaryLevelUpWebhook
import me.partlysanestudios.partlysaneskies.features.skills.PetAlert
import me.partlysanestudios.partlysaneskies.features.skills.PetLevelUpWebhook
import me.partlysanestudios.partlysaneskies.features.skills.SkillUpgradeRecommendation
import me.partlysanestudios.partlysaneskies.features.skills.SkillUpgradeWebhook
import me.partlysanestudios.partlysaneskies.features.sound.EnhancedSound
Expand Down Expand Up @@ -125,11 +125,8 @@ class PartlySaneSkies {
private var cachedFirstLaunch = false
val isFirstLaunch get() = cachedFirstLaunch

val minecraft: Minecraft
get() {
return pssMinecraft ?: Minecraft.getMinecraft()
}
private var pssMinecraft: Minecraft? = null
lateinit var minecraft: Minecraft
private set

// Names of all the ranks to remove from people's names
val RANK_NAMES = arrayOf(
Expand Down Expand Up @@ -161,7 +158,7 @@ class PartlySaneSkies {
@Mod.EventHandler
fun init(event: FMLInitializationEvent) {
log(Level.INFO, "Hallo World!")
pssMinecraft = Minecraft.getMinecraft()
minecraft = Minecraft.getMinecraft()

// Creates the partly-sane-skies directory if not already made
File("./config/partly-sane-skies/").mkdirs()
Expand Down Expand Up @@ -258,6 +255,10 @@ class PartlySaneSkies {
registerEvent(WrongToolCropWarning.CropToolData)
registerEvent(PetAlert)
registerEvent(SkillUpgradeWebhook)
registerEvent(CropMilestoneWebhook)
registerEvent(BestiaryMilestoneWebhook)
registerEvent(BestiaryLevelUpWebhook)
registerEvent(PetLevelUpWebhook)


// Registers all client side commands
Expand Down Expand Up @@ -292,6 +293,10 @@ class PartlySaneSkies {
ExampleWebhook.register()
DropWebhook.register()
SkillUpgradeWebhook.register()
CropMilestoneWebhook.register()
BestiaryMilestoneWebhook.register()
BestiaryLevelUpWebhook.register()
PetLevelUpWebhook.register()



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,37 @@ object CommandManager {

var commandList = HashMap<String, PSSCommand>()

fun getCommand(commandName: String): PSSCommand? {
return commandList[commandName]
}
fun getCommand(commandName: String): PSSCommand? = commandList[commandName]

fun registerCommand(pssCommand: PSSCommand): ICommand? {
if (pssCommand.isRegistered) {
return null
}
if (pssCommand.isRegistered) return null
val iCommand: ICommand = object : ICommand {
override fun getCommandName(): String {
return pssCommand.name
}
override fun getCommandName(): String = pssCommand.name

override fun getCommandUsage(sender: ICommandSender): String {
return pssCommand.getDescription()
}
override fun getCommandUsage(sender: ICommandSender): String = pssCommand.description

override fun getCommandAliases(): List<String> {
return pssCommand.getAliases()
}
override fun getCommandAliases(): List<String> = pssCommand.aliases

@Throws(CommandException::class)
override fun processCommand(sender: ICommandSender, args: Array<String>) {
pssCommand.runRunnable(sender, args)
pssCommand.runRunnable(args)
}

override fun canCommandSenderUseCommand(sender: ICommandSender): Boolean {
return true
}
override fun canCommandSenderUseCommand(sender: ICommandSender): Boolean = true

override fun addTabCompletionOptions(
sender: ICommandSender,
args: Array<String>,
pos: BlockPos
): List<String> {
return ArrayList()
}
): List<String> = ArrayList()

override fun isUsernameIndex(args: Array<String>, index: Int): Boolean {
return false
}
override fun isUsernameIndex(args: Array<String>, index: Int): Boolean = false

override fun compareTo(o: ICommand): Int {
return this.commandName.compareTo(o.commandName)
}
override fun compareTo(other: ICommand): Int = commandName.compareTo(other.commandName)
}
pssCommand.setICommand(iCommand)
pssCommand.iCommand = iCommand
ClientCommandHandler.instance.registerCommand(iCommand)
pssCommand.isRegistered = true
commandList[pssCommand.name] = pssCommand
return iCommand
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ package me.partlysanestudios.partlysaneskies.commands

import me.partlysanestudios.partlysaneskies.commands.CommandManager.registerCommand
import net.minecraft.command.ICommand
import net.minecraft.command.ICommandSender

class PSSCommand(val name: String) {

private var aliases: MutableList<String> = ArrayList<String>()
private var description: String = ""
private var runnable = PSSCommandRunnable { _: ICommandSender?, _: Array<String> -> }
var aliases: MutableList<String> = mutableListOf()
private set
var description: String = ""
private set
private var runnable = PSSCommandRunnable{}
var iCommand: ICommand? = null
var isRegistered = false

constructor(
name: String,
aliases: MutableList<String>,
aliases: MutableList<String> = mutableListOf(),
description: String,
runnable: PSSCommandRunnable,
) : this(name, aliases, description) {
Expand All @@ -33,11 +34,6 @@ class PSSCommand(val name: String) {
this.aliases = aliases
}

fun addAlias(alias: String): PSSCommand {
aliases.add(alias)
return this
}

fun addAlias(vararg aliases: String): PSSCommand {
this.aliases.addAll(aliases)
return this
Expand All @@ -53,24 +49,7 @@ class PSSCommand(val name: String) {
return this
}

fun runRunnable(sender: ICommandSender, args: Array<String>) {
runnable.run(sender, args)
}

fun register(): ICommand? {
return registerCommand(this)
}

fun setICommand(iCommand: ICommand?): PSSCommand {
this.iCommand = iCommand
return this
}

fun getAliases(): List<String> {
return aliases
}
fun runRunnable(args: Array<String>) = runnable.run(args)

fun getDescription(): String {
return description
}
fun register(): ICommand? = registerCommand(this)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//
package me.partlysanestudios.partlysaneskies.commands

import net.minecraft.command.ICommandSender

fun interface PSSCommandRunnable {
fun run(sender: ICommandSender, args: Array<String>)
fun run(args: Array<String>)
}
Loading

0 comments on commit 62cc281

Please sign in to comment.