Skip to content

Commit

Permalink
Optimize imports + Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Noaaan committed Aug 18, 2024
1 parent c63a97a commit 844687b
Show file tree
Hide file tree
Showing 115 changed files with 635 additions and 740 deletions.
22 changes: 11 additions & 11 deletions src/main/java/nourl/mythicmetals/MythicMetals.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ public class MythicMetals implements ModInitializer, EntityComponentInitializer
public static MythicMetalsConfig CONFIG = MythicMetalsConfig.createAndLoad();

public static final OwoItemGroup TABBED_GROUP = OwoItemGroup.builder(RegistryHelper.id("main"), () -> Icon.of(MythicItems.STORMYX.getIngot()))
.initializer(group -> {
group.addTab(Icon.of(MythicItems.ADAMANTITE.getIngot()), "items", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("item_tab")), false);
group.addTab(Icon.of(MythicBlocks.ADAMANTITE.getStorageBlock()), "blocks", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("blocks")), false);
group.addTab(Icon.of(MythicTools.ADAMANTITE.getPickaxe()), "tools", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("tool_tab")), false);
group.addTab(Icon.of(MythicArmor.ADAMANTITE.getChestplate()), "armor", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("armor_tab")), false);
group.addButton(ItemGroupButton.github(group, "https://github.com/Noaaan/MythicMetals/issues"));
group.addButton(ItemGroupButton.curseforge(group, "https://www.curseforge.com/minecraft/mc-mods/mythicmetals"));
group.addButton(ItemGroupButton.modrinth(group, "https://modrinth.com/mod/mythicmetals"));
group.addButton(ItemGroupButton.discord(group, "https://discord.gg/69cKvQWScC"));
})
.build();
.initializer(group -> {
group.addTab(Icon.of(MythicItems.ADAMANTITE.getIngot()), "items", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("item_tab")), false);
group.addTab(Icon.of(MythicBlocks.ADAMANTITE.getStorageBlock()), "blocks", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("blocks")), false);
group.addTab(Icon.of(MythicTools.ADAMANTITE.getPickaxe()), "tools", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("tool_tab")), false);
group.addTab(Icon.of(MythicArmor.ADAMANTITE.getChestplate()), "armor", TagKey.of(RegistryKeys.ITEM, RegistryHelper.id("armor_tab")), false);
group.addButton(ItemGroupButton.github(group, "https://github.com/Noaaan/MythicMetals/issues"));
group.addButton(ItemGroupButton.curseforge(group, "https://www.curseforge.com/minecraft/mc-mods/mythicmetals"));
group.addButton(ItemGroupButton.modrinth(group, "https://modrinth.com/mod/mythicmetals"));
group.addButton(ItemGroupButton.discord(group, "https://discord.gg/69cKvQWScC"));
})
.build();

public static final ComponentKey<CarmotShield> CARMOT_SHIELD = ComponentRegistry.getOrCreate(RegistryHelper.id("carmot_shield"), CarmotShield.class);
public static final ComponentKey<CombustionCooldown> COMBUSTION_COOLDOWN = ComponentRegistry.getOrCreate(RegistryHelper.id("combustion_cooldown"), CombustionCooldown.class);
Expand Down
20 changes: 4 additions & 16 deletions src/main/java/nourl/mythicmetals/MythicMetalsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.*;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.client.render.entity.feature.FeatureRendererContext;
import net.minecraft.client.render.entity.model.PlayerEntityModel;
Expand All @@ -36,28 +33,19 @@
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.World;
import nourl.mythicmetals.armor.CelestiumElytra;
import nourl.mythicmetals.armor.HallowedArmor;
import nourl.mythicmetals.armor.MythicArmor;
import nourl.mythicmetals.armor.*;
import nourl.mythicmetals.blocks.MythicBlocks;
import nourl.mythicmetals.client.CarmotShieldHudHandler;
import nourl.mythicmetals.client.models.MythicModelHandler;
import nourl.mythicmetals.client.rendering.*;
import nourl.mythicmetals.compat.IsometricArmorStandExporter;
import nourl.mythicmetals.component.DrillComponent;
import nourl.mythicmetals.component.GoldFoldedComponent;
import nourl.mythicmetals.component.MythicDataComponents;
import nourl.mythicmetals.component.PrometheumComponent;
import nourl.mythicmetals.component.*;
import nourl.mythicmetals.data.MythicTags;
import nourl.mythicmetals.entity.MythicEntities;
import nourl.mythicmetals.item.tools.*;
import nourl.mythicmetals.misc.BlockBreaker;
import nourl.mythicmetals.misc.RegistryHelper;
import nourl.mythicmetals.misc.ShieldUsePredicate;
import nourl.mythicmetals.misc.UsefulSingletonForColorUtil;
import nourl.mythicmetals.misc.*;
import nourl.mythicmetals.mixin.WorldRendererInvoker;
import nourl.mythicmetals.registry.RegisterBlockEntityTypes;

import java.util.ArrayList;
import java.util.Calendar;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/nourl/mythicmetals/abilities/Ability.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void addTooltip(Item item, Style style) {
});
}

public static void addTooltipOnStack(ItemStack stack, List<Text> lines, Style style, String translationKey) {
public static void addTooltipOnStack(ItemStack stack, List<Text> lines, Style style, String translationKey) {
MutableText text = Text.literal("");
text.append(Text.translatable(translationKey));
text.setStyle(style);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/nourl/mythicmetals/armor/AquariumToolSet.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.component.type.AttributeModifierSlot;
import net.minecraft.component.type.AttributeModifiersComponent;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.item.*;
import nourl.mythicmetals.item.tools.ToolSet;
import nourl.mythicmetals.misc.RegistryHelper;
import java.util.function.Consumer;

public class AquariumToolSet extends ToolSet {

Expand Down
5 changes: 1 addition & 4 deletions src/main/java/nourl/mythicmetals/armor/BanglumArmorSet.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Item;

import net.minecraft.item.*;
import java.util.function.Consumer;

public class BanglumArmorSet extends ArmorSet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.*;
import java.util.function.Consumer;

public class CelestiumArmorSet extends ArmorSet {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/nourl/mythicmetals/armor/CelestiumElytra.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ public void doVanillaElytraTick(LivingEntity entity, ItemStack chestStack) {
}

public static AttributeModifiersComponent createDefaultAttributes() {
var builder = AttributeModifiersComponent.builder();
var armor = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_armor_protection"), 5.0F, EntityAttributeModifier.Operation.ADD_VALUE);
var toughness = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_armor_toughness"), 3.0F, EntityAttributeModifier.Operation.ADD_VALUE);
var speed = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_speed_bonus"), 0.08F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL);
var rocketSpeedBonus = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_rocket_speed_bonus"), 0.20F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL);
builder.add(EntityAttributes.GENERIC_ARMOR, armor, AttributeModifierSlot.CHEST);
builder.add(EntityAttributes.GENERIC_ARMOR_TOUGHNESS, toughness, AttributeModifierSlot.CHEST);
builder.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, speed, AttributeModifierSlot.CHEST);
builder.add(RegisterEntityAttributes.ELYTRA_ROCKET_SPEED, rocketSpeedBonus, AttributeModifierSlot.CHEST);
return builder.build();
var builder = AttributeModifiersComponent.builder();
var armor = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_armor_protection"), 5.0F, EntityAttributeModifier.Operation.ADD_VALUE);
var toughness = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_armor_toughness"), 3.0F, EntityAttributeModifier.Operation.ADD_VALUE);
var speed = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_speed_bonus"), 0.08F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL);
var rocketSpeedBonus = new EntityAttributeModifier(RegistryHelper.id("celestium_elytra_rocket_speed_bonus"), 0.20F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL);
builder.add(EntityAttributes.GENERIC_ARMOR, armor, AttributeModifierSlot.CHEST);
builder.add(EntityAttributes.GENERIC_ARMOR_TOUGHNESS, toughness, AttributeModifierSlot.CHEST);
builder.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, speed, AttributeModifierSlot.CHEST);
builder.add(RegisterEntityAttributes.ELYTRA_ROCKET_SPEED, rocketSpeedBonus, AttributeModifierSlot.CHEST);
return builder.build();
}
}
4 changes: 1 addition & 3 deletions src/main/java/nourl/mythicmetals/armor/HallowedArmorSet.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.*;
import java.util.function.Consumer;

public class HallowedArmorSet extends ArmorSet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Item;

import net.minecraft.item.*;
import java.util.function.Consumer;

public class MetallurgiumArmorSet extends ArmorSet {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/nourl/mythicmetals/armor/MythicArmor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import io.wispforest.owo.registration.reflect.SimpleFieldProcessingSubject;
import net.minecraft.item.Item;
import net.minecraft.util.Rarity;
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/nourl/mythicmetals/armor/MythicArmorMaterials.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MythicArmorMaterials implements AutoRegistryContainer<ArmorMaterial
ArmorItem.Type.HELMET, 3,
ArmorItem.Type.CHESTPLATE, 8,
ArmorItem.Type.LEGGINGS, 6,
ArmorItem.Type.BOOTS, 3),16, sound(RegisterSounds.EQUIP_ADAMANTITE), () -> {
ArmorItem.Type.BOOTS, 3), 16, sound(RegisterSounds.EQUIP_ADAMANTITE), () -> {
return Ingredient.ofItems(MythicItems.ADAMANTITE.getIngot());
}, List.of(layer("adamantite")), 2.0f, 0.0f);

Expand Down Expand Up @@ -60,15 +60,15 @@ public class MythicArmorMaterials implements AutoRegistryContainer<ArmorMaterial
ArmorItem.Type.HELMET, 4,
ArmorItem.Type.CHESTPLATE, 10,
ArmorItem.Type.LEGGINGS, 7,
ArmorItem.Type.BOOTS, 4),30, sound(RegisterSounds.EQUIP_CELESTIUM), () -> {
ArmorItem.Type.BOOTS, 4), 30, sound(RegisterSounds.EQUIP_CELESTIUM), () -> {
return Ingredient.ofItems(MythicItems.CELESTIUM.getIngot());
}, List.of(layer("celestium")), 3.0f, 0.0f);

public static final ArmorMaterial COPPER = new ArmorMaterial(Map.of(
ArmorItem.Type.HELMET, 2,
ArmorItem.Type.CHESTPLATE, 4,
ArmorItem.Type.LEGGINGS, 3,
ArmorItem.Type.BOOTS, 1),8, sound(RegisterSounds.EQUIP_COPPER), () -> {
ArmorItem.Type.BOOTS, 1), 8, sound(RegisterSounds.EQUIP_COPPER), () -> {
return Ingredient.ofItems(Items.COPPER_INGOT);
}, List.of(layer("copper")), 0.0f, 0.0f);

Expand All @@ -84,7 +84,7 @@ public class MythicArmorMaterials implements AutoRegistryContainer<ArmorMaterial
ArmorItem.Type.HELMET, 4,
ArmorItem.Type.CHESTPLATE, 9,
ArmorItem.Type.LEGGINGS, 7,
ArmorItem.Type.BOOTS, 4),20, sound(RegisterSounds.EQUIP_HALLOWED), () -> {
ArmorItem.Type.BOOTS, 4), 20, sound(RegisterSounds.EQUIP_HALLOWED), () -> {
return Ingredient.ofItems(MythicItems.HALLOWED.getIngot());
}, List.of(layer("hallowed")), 4.0f, 0.0f);

Expand Down Expand Up @@ -232,4 +232,5 @@ private static RegistryEntry<SoundEvent> sound(SoundEvent sound) {

private static ArmorMaterial.Layer layer(String name) {
return new ArmorMaterial.Layer(RegistryHelper.id(name));
}}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package nourl.mythicmetals.armor;

import net.minecraft.entity.Entity;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.*;
import net.minecraft.world.World;
import nourl.mythicmetals.component.PrometheumComponent;
import nourl.mythicmetals.misc.RegistryHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.*;
import nourl.mythicmetals.component.MythicDataComponents;
import nourl.mythicmetals.component.PrometheumComponent;

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/nourl/mythicmetals/armor/RuniteArmorSet.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.*;

public class RuniteArmorSet extends ArmorSet {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import nourl.mythicmetals.client.models.MythicModelHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package nourl.mythicmetals.armor;

import net.minecraft.item.Item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.*;
import java.util.function.Consumer;

public class TidesingerArmorSet extends ArmorSet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package nourl.mythicmetals.blocks;

import net.minecraft.block.*;
import net.minecraft.block.entity.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import nourl.mythicmetals.registry.RegisterBlockEntityTypes;
import org.jetbrains.annotations.Nullable;

public class AquariumResonatorBlock {}/*extends BlockWithEntity {
public class AquariumResonatorBlock {
}/*extends BlockWithEntity {
protected AquariumResonatorBlock(Settings settings) {
super(settings);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
package nourl.mythicmetals.blocks;

import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import nourl.mythicmetals.registry.RegisterBlockEntityTypes;
import java.util.List;

public class AquariumResonatorBlockEntity{} /* extends BlockEntity implements ConduitPowered {
public class AquariumResonatorBlockEntity {
} /* extends BlockEntity implements ConduitPowered {
private static final int MAX_RANGE = 24;
private boolean activated = false;
private int activeTime = 50;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package nourl.mythicmetals.blocks;

import net.minecraft.block.*;
import net.minecraft.block.entity.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import nourl.mythicmetals.registry.RegisterBlockEntityTypes;
import org.jetbrains.annotations.Nullable;

public class AquariumStewardBlock {} /* extends BlockWithEntity {
public class AquariumStewardBlock {
} /* extends BlockWithEntity {
protected AquariumStewardBlock(Settings settings) {
super(settings);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
package nourl.mythicmetals.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.Monster;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import nourl.mythicmetals.registry.RegisterBlockEntityTypes;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.UUID;

public class AquariumStewardBlockEntity {} /*extends BlockEntity implements ConduitPowered {
public class AquariumStewardBlockEntity {
} /*extends BlockEntity implements ConduitPowered {
private static final int MAX_RANGE = 16;
private static final float DAMAGE = 5.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void init() {
var targetBlock = world.getBlockState(hitResult.getBlockPos());

if (!targetBlock.isOf(MythicBlocks.BANGLUM.getStorageBlock())
&& !targetBlock.isOf(MythicBlocks.MORKITE.getStorageBlock()))
&& !targetBlock.isOf(MythicBlocks.MORKITE.getStorageBlock()))
return ActionResult.PASS;

var pos = hitResult.getBlockPos();
Expand All @@ -53,7 +53,7 @@ public static boolean tryLightBigTntWithDispenser(BlockPointer dispenser) {
var pos = dispenser.pos().offset(dispenser.state().get(DispenserBlock.FACING));

if (!state.isOf(MythicBlocks.BANGLUM.getStorageBlock())
&& !state.isOf(MythicBlocks.MORKITE.getStorageBlock()))
&& !state.isOf(MythicBlocks.MORKITE.getStorageBlock()))
return false;

for (int x = 0; x < 3; x++) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/nourl/mythicmetals/blocks/BanglumOreBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import io.wispforest.owo.particles.ClientParticles;
import net.minecraft.block.*;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.math.BlockPos;
Expand All @@ -19,7 +17,7 @@ public class BanglumOreBlock extends ExperienceDroppingBlock {
public BanglumOreBlock(AbstractBlock.Settings settings) {
super(ConstantIntProvider.ZERO, settings);
}

@Override
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
int rng = random.nextInt(130);
Expand Down
Loading

0 comments on commit 844687b

Please sign in to comment.