Skip to content

Commit

Permalink
Fix my mistakes :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Gegy committed Nov 18, 2024
1 parent 1274a92 commit c07d35b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
2 changes: 0 additions & 2 deletions src/generated/resources/assets/ltextras/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@
"block.ltextras.yellow_terracotta_slab": "qɐןS ɐʇʇoɔɐɹɹǝ⟘ ʍoןןǝʎ",
"block.ltextras.yellow_terracotta_stairs": "sɹıɐʇS ɐʇʇoɔɐɹɹǝ⟘ ʍoןןǝʎ",
"block.ltextras.yellow_terracotta_wall": "ןןɐM ɐʇʇoɔɐɹɹǝ⟘ ʍoןןǝʎ",
"commands.nametag.success": "%s :sbɐʇǝɯɐu ɹǝpuǝɹ sʎɐʍןⱯ",
"commands.tpa.general_error": "ʇɹodǝןǝʇ oʇ ǝןqɐu∩",
"commands.tpa.help.back": "buıʇɹodǝןǝʇ ǝɹoɟǝq ǝɹǝʍ noʎ ǝɹǝɥʍ oʇ ʞɔɐq ʇɹodǝןǝ⟘ - ʞɔɐq/",
"commands.tpa.help.tpa": "ɹǝʎɐןd ɐ oʇ ʇɹodǝןǝʇ oʇ ʇsǝnbǝᴚ - >ɹǝʎɐןd< ɐdʇ/",
Expand All @@ -381,7 +380,6 @@
"commands.tpa.request_sent": "ʇuǝs ʇsǝnbǝᴚ",
"commands.tpa.too_much": "ɥɔnɯ ooʇ ʇɐɥʇ buıop ǝɹɐ noʎ",
"commands.tpa.tp_accepted": "uɹnʇǝɹ oʇ ʞɔɐq/ ǝs∩ ˙ʇsǝnbǝɹ ʇɹodǝןǝʇ ɹnoʎ pǝʇdǝɔɔɐ sɐɥ %s",
"commands.warp.general_error": "ǝɹǝɥʇ ob ʇ,upןnoƆ",
"commands.warp.not_found": "punoɟ ʇou uoıʇɐuıʇsǝᗡ",
"commands.warp.success": "%s oʇ pǝdɹɐM",
"effect.ltextras.fish_eye": "ǝʎƎ ɥsıℲ",
Expand Down
2 changes: 0 additions & 2 deletions src/generated/resources/assets/ltextras/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@
"block.ltextras.yellow_terracotta_slab": "Yellow Terracotta Slab",
"block.ltextras.yellow_terracotta_stairs": "Yellow Terracotta Stairs",
"block.ltextras.yellow_terracotta_wall": "Yellow Terracotta Wall",
"commands.nametag.success": "Always render nametags: %s",
"commands.tpa.general_error": "Unable to teleport",
"commands.tpa.help.back": "/back - Teleport back to where you were before teleporting",
"commands.tpa.help.tpa": "/tpa <player> - Request to teleport to a player",
Expand All @@ -381,7 +380,6 @@
"commands.tpa.request_sent": "Request sent",
"commands.tpa.too_much": "You are doing that too much",
"commands.tpa.tp_accepted": "%s has accepted your teleport request. Use /back to return",
"commands.warp.general_error": "Couldn't go there",
"commands.warp.not_found": "Destination not found",
"commands.warp.success": "Warped to %s",
"effect.ltextras.fish_eye": "Fish Eye",
Expand Down
47 changes: 0 additions & 47 deletions src/main/java/com/lovetropics/extras/LTExtras.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.lovetropics.extras;

import com.google.common.collect.Sets;
import com.lovetropics.extras.client.command.NameTagModeCommand;
import com.lovetropics.extras.client.entity.model.RaveKoaModel;
import com.lovetropics.extras.client.particle.ExtraParticles;
Expand All @@ -19,23 +18,17 @@
import com.mojang.brigadier.CommandDispatcher;
import com.tterrag.registrate.Registrate;
import com.tterrag.registrate.providers.ProviderType;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import net.minecraft.commands.CommandBuildContext;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.RangedAttribute;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
Expand All @@ -54,12 +47,7 @@
import net.neoforged.neoforge.event.entity.EntityAttributeModificationEvent;

import javax.annotation.Nullable;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

@Mod("ltextras")
public class LTExtras {
Expand Down Expand Up @@ -145,41 +133,6 @@ private void onRegisterCommands(RegisterCommandsEvent event) {
WorldEffectCommand.register(dispatcher);
WarpCommand.register(dispatcher);
PoiCommand.register(dispatcher, buildContext);
dispatcher.register(Commands.literal("test").executes(context -> {
context.getSource().sendSystemMessage(Component.literal("" + Block.BLOCK_STATE_REGISTRY.size()));
List<Map.Entry<Block, List<BlockState>>> sorted = StreamSupport.stream(Block.BLOCK_STATE_REGISTRY.spliterator(), false)
.collect(Collectors.groupingBy(BlockBehaviour.BlockStateBase::getBlock))
.entrySet()
.stream()
// .sorted(Comparator.comparing(e -> -e.getValue().size()))
.toList();
Object2IntOpenHashMap<String> wordToCount = new Object2IntOpenHashMap<>();
for (Map.Entry<Block, List<BlockState>> entry : sorted) {
String[] parts = entry.getKey().builtInRegistryHolder().key().location().getPath().split("_");
for (String part : Sets.newHashSet(parts)) {
wordToCount.addTo(part, entry.getValue().size());
}
wordToCount.addTo(entry.getKey().builtInRegistryHolder().key().location().getNamespace(), entry.getValue().size());
}
List<Object2IntMap.Entry<String>> list = wordToCount.object2IntEntrySet().stream()
.sorted(Comparator.comparing(e -> -e.getIntValue()))
.toList();
int i = 0;
for (Object2IntMap.Entry<String> entry : list) {
context.getSource().sendSystemMessage(Component.literal(entry.getKey() + ": " + entry.getIntValue()));
if (i++ > 50) {
break;
}
}
// int i = 0;
// for (Map.Entry<Block, List<BlockState>> entry : sorted) {
// context.getSource().sendSystemMessage(Component.literal(entry.getKey() + ": " + entry.getValue().size()));
// if (i++ > 500) {
// break;
// }
// }
return 1;
}));
}

private void onRegisterClientCommands(RegisterClientCommandsEvent event) {
Expand Down

0 comments on commit c07d35b

Please sign in to comment.