Skip to content

Commit

Permalink
SpotlessCheck and SpotlessApply
Browse files Browse the repository at this point in the history
Run ./gradlew :spotlessCheck --warning-mode all --build-cache and ./gradlew :spotlessApply --warning-mode all to fix and clean code
  • Loading branch information
jude123412 committed Dec 21, 2024
1 parent 2bbcd6e commit 04f8246
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 139 deletions.
4 changes: 2 additions & 2 deletions src/main/java/gregtech/GregTechMod.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package gregtech;

import codechicken.lib.texture.TextureUtils;

import gregtech.api.GTValues;
import gregtech.api.GregTechAPI;
import gregtech.api.items.metaitem.MetaItem;
Expand Down Expand Up @@ -31,6 +29,8 @@
import net.minecraftforge.fml.common.event.FMLServerStoppedEvent;
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;

import codechicken.lib.texture.TextureUtils;

import static gregtech.api.util.Mods.Avaritia;

@Mod(modid = GTValues.MODID,
Expand Down
61 changes: 29 additions & 32 deletions src/main/java/gregtech/api/items/materialitem/MetaPrefixItem.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package gregtech.api.items.materialitem;

import codechicken.lib.model.ModelRegistryHelper;
import codechicken.lib.util.TransformUtils;

import gregtech.api.GTValues;
import gregtech.api.damagesources.DamageSources;
import gregtech.api.items.armor.ArmorMetaItem;
import gregtech.api.items.metaitem.StandardMetaItem;
import gregtech.api.items.metaitem.MetaItem.MetaValueItem.CosmicTexture;
import gregtech.api.items.metaitem.StandardMetaItem;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
Expand All @@ -19,15 +16,9 @@
import gregtech.api.unification.material.registry.MaterialRegistry;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.unification.stack.UnificationEntry;
import gregtech.common.creativetab.GTCreativeTabs;

import gregtech.api.util.Mods;
import gregtech.client.renderer.item.CosmicItemRenderer;

import morph.avaritia.api.ICosmicRenderItem;
import morph.avaritia.api.IHaloRenderItem;
import morph.avaritia.api.registration.IModelRegister;
import morph.avaritia.init.AvaritiaTextures;
import gregtech.common.creativetab.GTCreativeTabs;

import net.minecraft.block.BlockCauldron;
import net.minecraft.block.state.IBlockState;
Expand All @@ -48,7 +39,13 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.model.ModelRegistryHelper;
import codechicken.lib.util.TransformUtils;
import it.unimi.dsi.fastutil.shorts.Short2ObjectOpenHashMap;
import morph.avaritia.api.ICosmicRenderItem;
import morph.avaritia.api.IHaloRenderItem;
import morph.avaritia.api.registration.IModelRegister;
import morph.avaritia.init.AvaritiaTextures;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -57,19 +54,19 @@
import static gregtech.api.util.Mods.Avaritia;

@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.ICosmicRenderItem")
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.ICosmicRenderItem")
@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.IHaloRenderItem")
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.IHaloRenderItem")
@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.registration.IModelRegister")
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.registration.IModelRegister")
@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.init.AvaritiaTextures")
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.init.AvaritiaTextures")
public class MetaPrefixItem extends StandardMetaItem implements IHaloRenderItem, ICosmicRenderItem,
IModelRegister {
IModelRegister {

private final MaterialRegistry registry;
private final OrePrefix prefix;
Expand Down Expand Up @@ -154,10 +151,10 @@ public void registerModels() {
ModelBakery.registerItemVariants(this, resourceLocation);
alreadyRegistered.put(registrationKey, new ModelResourceLocation(resourceLocation, "inventory"));


if (Avaritia.isModLoaded()) {
ModelResourceLocation location = new ModelResourceLocation(resourceLocation, "inventory");
IBakedModel wrapped = new CosmicItemRenderer(TransformUtils.DEFAULT_ITEM, (modelRegistry) -> modelRegistry.getObject(location));
IBakedModel wrapped = new CosmicItemRenderer(TransformUtils.DEFAULT_ITEM,
(modelRegistry) -> modelRegistry.getObject(location));
ModelRegistryHelper.register(location, wrapped);

String processedLocation = resourceLocation.toString().replace("gregtech:", "gregtech:items/");
Expand Down Expand Up @@ -312,9 +309,9 @@ protected void addMaterialTooltip(@NotNull List<String> lines, @NotNull ItemStac
}
}

@Override @SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public boolean shouldDrawHalo(ItemStack stack) {

Material material = getMaterial(stack);
assert material != null;

Expand All @@ -327,9 +324,9 @@ public boolean shouldDrawHalo(ItemStack stack) {
}
}

@Override @SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public TextureAtlasSprite getHaloTexture(ItemStack stack) {

Material material = getMaterial(stack);
assert material != null;

Expand All @@ -342,9 +339,9 @@ public TextureAtlasSprite getHaloTexture(ItemStack stack) {
}
}

@Override @SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public int getHaloColour(ItemStack stack) {

Material material = getMaterial(stack);
assert material != null;

Expand All @@ -357,9 +354,9 @@ public int getHaloColour(ItemStack stack) {
}
}

@Override @SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public int getHaloSize(ItemStack stack) {

Material material = getMaterial(stack);
assert material != null;

Expand All @@ -370,10 +367,10 @@ public int getHaloSize(ItemStack stack) {
} else {
return 0;
}

}

@Override @SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public boolean shouldDrawPulse(ItemStack stack) {
Material material = getMaterial(stack);
assert material != null;
Expand Down
Loading

0 comments on commit 04f8246

Please sign in to comment.