Skip to content

Instantly share code, notes, and snippets.

@Densamisten
Densamisten / ALORSearchCommand
Created March 5, 2024 06:00
Usage: /alorsearch <repository><architecture> <package>. Where repository is any of Core, Core-Testing, Extra, Extra-Testing, Multilib, Multilib-Testing. And architecture is either any or x86_64. And package is a package from arch linux official repositories.
package io.github.densamisten.command;
import com.google.common.collect.ImmutableList;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.commands.CommandSourceStack;
@Densamisten
Densamisten / ClipboardCommand.java
Created March 3, 2024 08:16
Copies the clipboard contents onto the clipboard in MinecraftForge! Usage: /clipboard
package net.kaupenjoe.mccourse.command;
import com.mojang.blaze3d.platform.ClipboardManager;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.minecraft.client.Minecraft;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.network.chat.Component;
package net.kaupenjoe;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.Proxy;
import java.net.URL;
import java.net.*;
@Densamisten
Densamisten / TestCommand.java
Created March 1, 2024 04:53
Shows a way to do brigadier suggestions
package io.github.densamisten.troubleshootingmod.command;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.ChatFormatting;
import net.minecraft.commands.CommandSourceStack;
package io.github.densamisten.firstfootsteps.event;
import com.mojang.blaze3d.platform.ClipboardManager;
import io.github.densamisten.firstfootsteps.FirstFootsteps;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.ExperienceOrb;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
package io.github.densamisten.firstfootsteps.event;
import com.mojang.blaze3d.platform.ClipboardManager;
import io.github.densamisten.firstfootsteps.FirstFootsteps;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.ExperienceOrb;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
@Densamisten
Densamisten / FireworkCommand.java
Last active March 17, 2024 20:23 — forked from Ensamisten/FireworkCommand.java
FireworkCommand. (Tested for Forge in Minecraft: 1,18-1.20.4). The mixin allows for firework to pass through blocks sometimes. Usage: /firework
package io.github.ensamisten.fireworkmod;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.context.CommandContext;
import io.github.ensamisten.forgient.mixin.FireworkRocketEntityMixin;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.arguments.EntityArgument;
package io.github.densamisten.command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
import org.lwjgl.glfw.GLFW;
@Densamisten
Densamisten / VerboseFabrientSayCommand
Last active April 2, 2024 08:33
Overwrites console text limit by pasting the clipboard directly to the console. Usage /vsay
package io.github.densamisten.command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.minecraft.client.util.Clipboard;
import net.minecraft.command.argument.ColorArgumentType;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
@Densamisten
Densamisten / troubleshootLocale.java
Last active February 20, 2024 16:11
I never got this to work. But it essentially, theoretically, switches at random the language of Minecraft. The code is provided as-is. License: CC0-1.0
List<String> languageCountryCodes = new ArrayList<>();
Collections.addAll(languageCountryCodes,
"af_za", "ara_sa", "ast_es", "aze_az", "bak_ru", "bar_de", "bel_by", "bul_bg", "bre_fr", "qbr_nl",
"bos_ba", "cat_es", "ces_cz", "cym_gb", "dan_dk", "bar_at", "gsw_ch", "deu_de", "ell_gr", "eng_au",
"eng_ca", "eng_gb", "eng_nz", "qpe", "eng_qabs_gb", "en_ud", "epo", "spa_ar", "spa_cl", "spa_ec",
"spa_es", "spa_mx", "spa_uy", "spa_ve", "spa_es_an", "est_ee", "eus_es", "fas_ir", "fin_fi", "fil_ph",
"fao_fo", "fra_ca", "fra_fr", "fra_de", "fur_it", "fry_nl", "gle_ie", "gla_gb", "glg_es", "haw_us",
"heb_il", "hin_in", "hrv_hr", "hun_hu", "hye_am", "id_id", "ibo_ng", "is_is", "qis", "ita_it", "jpn_jp",
"jbo", "kat_ge", "kaz_kz", "kan_in", "kor_kr", "ksh_de", "kw_gb", "lat_va", "ltz_lu", "lim_nl", "lmo_it",
"lao_la", "qll", "lit_lt", "lav_lv", "lzh", "mkd_mk", "mon_mn", "zlm_my", "mlt