forked from cookies-mod/mod
-
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.
backup cause i almost lost it that was terrifying
- Loading branch information
1 parent
197835a
commit b85fba3
Showing
45 changed files
with
1,625 additions
and
743 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 10 additions & 8 deletions
18
src/main/java/codes/cookies/mod/commands/dev/debug/OpenCraftHelperPlacementScreen.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 |
---|---|---|
@@ -1,20 +1,22 @@ | ||
package codes.cookies.mod.commands.dev.debug; | ||
|
||
import codes.cookies.mod.features.crafthelper.CraftHelperPlacementScreen; | ||
import com.mojang.brigadier.builder.LiteralArgumentBuilder; | ||
import codes.cookies.mod.CookiesMod; | ||
import codes.cookies.mod.commands.system.ClientCommand; | ||
import codes.cookies.mod.features.misc.utils.crafthelper.CraftHelperPlacement; | ||
|
||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class OpenCraftHelperPlacementScreen extends ClientCommand { | ||
|
||
@Override | ||
public @NotNull LiteralArgumentBuilder<FabricClientCommandSource> getCommand() { | ||
return literal("openCraftHelperPlacementScreen").executes(run(this::openScreen)); | ||
} | ||
@Override | ||
public @NotNull LiteralArgumentBuilder<FabricClientCommandSource> getCommand() { | ||
return literal("openCraftHelperPlacementScreen").executes(run(this::openScreen)); | ||
} | ||
|
||
private void openScreen() { | ||
CookiesMod.openScreen(new CraftHelperPlacement()); | ||
} | ||
private void openScreen() { | ||
CookiesMod.openScreen(new CraftHelperPlacementScreen()); | ||
} | ||
} |
64 changes: 34 additions & 30 deletions
64
...ain/java/codes/cookies/mod/commands/dev/debug/SetSelectedCraftHelperItemDebugCommand.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 |
---|---|---|
@@ -1,49 +1,53 @@ | ||
package codes.cookies.mod.commands.dev.debug; | ||
|
||
import codes.cookies.mod.features.crafthelper.CraftHelperManager; | ||
import com.mojang.brigadier.builder.LiteralArgumentBuilder; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import codes.cookies.mod.commands.arguments.RealIdentifierArgument; | ||
import codes.cookies.mod.commands.system.ClientCommand; | ||
import codes.cookies.mod.features.misc.utils.crafthelper.CraftHelperManager; | ||
import codes.cookies.mod.repository.RepositoryItem; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
|
||
import net.minecraft.util.Identifier; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* | ||
*/ | ||
public class SetSelectedCraftHelperItemDebugCommand extends ClientCommand { | ||
@Override | ||
public @NotNull LiteralArgumentBuilder<FabricClientCommandSource> getCommand() { | ||
List<Identifier> identifiers = new ArrayList<>(); | ||
RepositoryItem.getItemMap().keySet().forEach( | ||
item -> identifiers.add( | ||
Identifier.of("skyblock", item.replace(":", "/").replace("-", "/").replace(";", "/").toLowerCase(Locale.ROOT)) | ||
) | ||
); | ||
|
||
return literal("setSelectedCraftHelperItem") | ||
.then( | ||
argument( | ||
"item", | ||
new RealIdentifierArgument(identifiers) | ||
).executes(run(this::setSelectedItem)) | ||
); | ||
} | ||
|
||
private void setSelectedItem(CommandContext<FabricClientCommandSource> context) { | ||
final Identifier item = context.getArgument("item", Identifier.class); | ||
final RepositoryItem repositoryItem = RepositoryItem.of(item.getPath()); | ||
|
||
if (repositoryItem != null) { | ||
CraftHelperManager.pushNewCraftHelperItem(repositoryItem, 1); | ||
sendSuccessMessage("Switched to item " + item); | ||
} else { | ||
sendFailedMessage("Could not find item " + item.getPath()); | ||
} | ||
} | ||
@Override | ||
public @NotNull LiteralArgumentBuilder<FabricClientCommandSource> getCommand() { | ||
List<Identifier> identifiers = new ArrayList<>(); | ||
RepositoryItem.getItemMap().keySet().forEach( | ||
item -> identifiers.add( | ||
Identifier.of("skyblock", item.replace(":", "/").replace("-", "/").replace(";", "/").toLowerCase(Locale.ROOT)) | ||
) | ||
); | ||
|
||
return literal("setSelectedCraftHelperItem") | ||
.then( | ||
argument( | ||
"item", | ||
new RealIdentifierArgument(identifiers) | ||
).executes(run(this::setSelectedItem)) | ||
); | ||
} | ||
|
||
private void setSelectedItem(CommandContext<FabricClientCommandSource> context) { | ||
final Identifier item = context.getArgument("item", Identifier.class); | ||
final RepositoryItem repositoryItem = RepositoryItem.of(item.getPath()); | ||
|
||
if (repositoryItem != null) { | ||
CraftHelperManager.pushNewCraftHelperItem(repositoryItem, 1); | ||
sendSuccessMessage("Switched to item " + item); | ||
} else { | ||
sendFailedMessage("Could not find item " + item.getPath()); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.