diff --git a/src/main/java/ninety/megacells/datagen/MEGAItemModelProvider.java b/src/main/java/ninety/megacells/datagen/MEGAItemModelProvider.java index 09440709..d684e4f7 100644 --- a/src/main/java/ninety/megacells/datagen/MEGAItemModelProvider.java +++ b/src/main/java/ninety/megacells/datagen/MEGAItemModelProvider.java @@ -15,8 +15,8 @@ import ninety.megacells.core.MEGATier; import ninety.megacells.integration.appmek.AppMekCellType; import ninety.megacells.integration.appmek.AppMekItems; -import ninety.megacells.item.MEGACellType; import ninety.megacells.item.MEGAItems; +import ninety.megacells.item.core.MEGACellType; public class MEGAItemModelProvider extends ItemModelProvider { diff --git a/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java b/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java index 8a2f2855..3e61d3aa 100644 --- a/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java +++ b/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java @@ -25,11 +25,11 @@ import ninety.megacells.core.BlockDefinition; import ninety.megacells.core.MEGATier; import ninety.megacells.integration.appmek.AppMekCellType; -import ninety.megacells.item.IMEGACellType; -import ninety.megacells.item.MEGACellType; import ninety.megacells.item.MEGAItems; import ninety.megacells.item.MEGAPortableCell; import ninety.megacells.item.MEGAStorageCell; +import ninety.megacells.item.core.IMEGACellType; +import ninety.megacells.item.core.MEGACellType; public class MEGARecipeProvider extends RecipeProvider { public MEGARecipeProvider(DataGenerator generator) { diff --git a/src/main/java/ninety/megacells/init/InitUpgrades.java b/src/main/java/ninety/megacells/init/InitUpgrades.java index dfaa9b8d..e1d857fc 100644 --- a/src/main/java/ninety/megacells/init/InitUpgrades.java +++ b/src/main/java/ninety/megacells/init/InitUpgrades.java @@ -7,8 +7,8 @@ import appeng.core.localization.GuiText; import ninety.megacells.integration.appmek.AppMekCellType; -import ninety.megacells.item.MEGACellType; import ninety.megacells.item.MEGAItems; +import ninety.megacells.item.core.MEGACellType; public class InitUpgrades { public static void init() { diff --git a/src/main/java/ninety/megacells/init/client/InitCellModels.java b/src/main/java/ninety/megacells/init/client/InitCellModels.java index 942aaf6d..bdae83f9 100644 --- a/src/main/java/ninety/megacells/init/client/InitCellModels.java +++ b/src/main/java/ninety/megacells/init/client/InitCellModels.java @@ -6,8 +6,8 @@ import ninety.megacells.MEGACells; import ninety.megacells.integration.appmek.AppMekCellType; -import ninety.megacells.item.MEGACellType; import ninety.megacells.item.MEGAItems; +import ninety.megacells.item.core.MEGACellType; public class InitCellModels { public static void init() { diff --git a/src/main/java/ninety/megacells/init/client/InitItemColors.java b/src/main/java/ninety/megacells/init/client/InitItemColors.java index 9e27ea03..cbf6efb3 100644 --- a/src/main/java/ninety/megacells/init/client/InitItemColors.java +++ b/src/main/java/ninety/megacells/init/client/InitItemColors.java @@ -6,11 +6,10 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import ninety.megacells.integration.appmek.AppMekCellType; -import ninety.megacells.item.MEGABulkCell; -import ninety.megacells.item.MEGACellType; import ninety.megacells.item.MEGAItems; import ninety.megacells.item.MEGAPortableCell; import ninety.megacells.item.MEGAStorageCell; +import ninety.megacells.item.core.MEGACellType; public class InitItemColors { public static void init() { @@ -25,7 +24,7 @@ private static void initItemColors(ColorHandlerEvent.Item event) { AppMekCellType.CHEMICAL.getCells().stream()).flatMap(s -> s).toList()) { event.getItemColors().register(MEGAStorageCell::getColor, cell); } - event.getItemColors().register(MEGABulkCell::getColor, MEGAItems.BULK_ITEM_CELL.asItem()); + event.getItemColors().register(MEGAStorageCell::getColor, MEGAItems.BULK_ITEM_CELL.asItem()); for (var cell : Stream.of( MEGACellType.ITEM.getPortableCells().stream(), diff --git a/src/main/java/ninety/megacells/integration/appmek/AppMekCellType.java b/src/main/java/ninety/megacells/integration/appmek/AppMekCellType.java index ae0f93e6..ae1f91d6 100644 --- a/src/main/java/ninety/megacells/integration/appmek/AppMekCellType.java +++ b/src/main/java/ninety/megacells/integration/appmek/AppMekCellType.java @@ -15,7 +15,7 @@ import me.ramidzkh.mekae2.AMMenus; import me.ramidzkh.mekae2.ae2.MekanismKeyType; -import ninety.megacells.item.IMEGACellType; +import ninety.megacells.item.core.IMEGACellType; public enum AppMekCellType implements IMEGACellType { CHEMICAL; diff --git a/src/main/java/ninety/megacells/item/MEGABulkCell.java b/src/main/java/ninety/megacells/item/MEGABulkCell.java index bdc9acf5..dee9d3b1 100644 --- a/src/main/java/ninety/megacells/item/MEGABulkCell.java +++ b/src/main/java/ninety/megacells/item/MEGABulkCell.java @@ -94,29 +94,4 @@ public FuzzyMode getFuzzyMode(ItemStack is) { @Override public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { } - - public static int getColor(ItemStack is, int tintIndex) { - if (tintIndex == 1) { - // Determine LED color - - var handler = BasicCellHandler.INSTANCE.getCellInventory(is, null); - if (handler == null) { - return 0xFFFFFF; - } - - double used = handler.getUsedBytes(); - - if (used == 0) { - return 0xFFFFFF; - } else { - double p = 1 - used / (double) Integer.MAX_VALUE; - int r = (int) (255d * (Math.max(0, Math.min(2 - 2 * p, 1)))); - int g = (int) (255d * (Math.max(0, Math.min(2 * p, 1)))); - return 0xFF000000 + (r << 16) + (g << 8); - } - } else { - // White - return 0xFFFFFF; - } - } } diff --git a/src/main/java/ninety/megacells/item/MEGAItems.java b/src/main/java/ninety/megacells/item/MEGAItems.java index 9fadcbe9..d38e342a 100644 --- a/src/main/java/ninety/megacells/item/MEGAItems.java +++ b/src/main/java/ninety/megacells/item/MEGAItems.java @@ -17,6 +17,8 @@ import ninety.megacells.MEGACells; import ninety.megacells.core.ItemDefinition; import ninety.megacells.core.MEGATier; +import ninety.megacells.item.core.IMEGACellType; +import ninety.megacells.item.core.MEGACellType; public final class MEGAItems { diff --git a/src/main/java/ninety/megacells/item/MEGAPortableCell.java b/src/main/java/ninety/megacells/item/MEGAPortableCell.java index 49e935b6..697c11fa 100644 --- a/src/main/java/ninety/megacells/item/MEGAPortableCell.java +++ b/src/main/java/ninety/megacells/item/MEGAPortableCell.java @@ -8,6 +8,7 @@ import ninety.megacells.MEGACells; import ninety.megacells.core.MEGATier; +import ninety.megacells.item.core.IMEGACellType; public class MEGAPortableCell extends PortableCellItem { diff --git a/src/main/java/ninety/megacells/item/MEGAStorageCell.java b/src/main/java/ninety/megacells/item/MEGAStorageCell.java index a95fa390..9088da29 100644 --- a/src/main/java/ninety/megacells/item/MEGAStorageCell.java +++ b/src/main/java/ninety/megacells/item/MEGAStorageCell.java @@ -3,6 +3,7 @@ import appeng.items.storage.BasicStorageCell; import ninety.megacells.core.MEGATier; +import ninety.megacells.item.core.IMEGACellType; public class MEGAStorageCell extends BasicStorageCell { diff --git a/src/main/java/ninety/megacells/item/IMEGACellType.java b/src/main/java/ninety/megacells/item/core/IMEGACellType.java similarity index 91% rename from src/main/java/ninety/megacells/item/IMEGACellType.java rename to src/main/java/ninety/megacells/item/core/IMEGACellType.java index 677b6625..06781e13 100644 --- a/src/main/java/ninety/megacells/item/IMEGACellType.java +++ b/src/main/java/ninety/megacells/item/core/IMEGACellType.java @@ -1,4 +1,4 @@ -package ninety.megacells.item; +package ninety.megacells.item.core; import net.minecraft.tags.TagKey; import net.minecraft.world.inventory.MenuType; diff --git a/src/main/java/ninety/megacells/item/MEGACellType.java b/src/main/java/ninety/megacells/item/core/MEGACellType.java similarity index 97% rename from src/main/java/ninety/megacells/item/MEGACellType.java rename to src/main/java/ninety/megacells/item/core/MEGACellType.java index a3f8f3f6..cc1bb5a1 100644 --- a/src/main/java/ninety/megacells/item/MEGACellType.java +++ b/src/main/java/ninety/megacells/item/core/MEGACellType.java @@ -1,4 +1,4 @@ -package ninety.megacells.item; +package ninety.megacells.item.core; import java.util.List; @@ -10,6 +10,8 @@ import appeng.datagen.providers.tags.ConventionTags; import appeng.menu.me.common.MEStorageMenu; +import ninety.megacells.item.MEGAItems; + public enum MEGACellType implements IMEGACellType { ITEM(AEKeyType.items(), 63, "item"), FLUID(AEKeyType.fluids(), 9, "fluid");