Skip to content

Commit

Permalink
move more shit around i guess
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Aug 17, 2023
1 parent d9c4fbc commit b1351f0
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 72 deletions.
2 changes: 0 additions & 2 deletions common/src/main/java/gripe/_90/megacells/MEGACells.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import gripe._90.megacells.definition.MEGABlockEntities;
import gripe._90.megacells.definition.MEGABlocks;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.integration.ae2wt.AE2WTIntegration;
import gripe._90.megacells.integration.appbot.AppBotIntegration;
import gripe._90.megacells.integration.appbot.AppBotItems;
Expand All @@ -47,7 +46,6 @@ public static void initCommon() {
MEGAItems.init();
MEGABlocks.init();
MEGABlockEntities.init();
MEGAParts.init();

if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPBOT)) {
AppBotItems.init();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gripe._90.megacells.item;
package gripe._90.megacells.block;

import static gripe._90.megacells.definition.MEGABlocks.CRAFTING_ACCELERATOR;
import static gripe._90.megacells.definition.MEGABlocks.MEGA_CRAFTING_UNIT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gripe._90.megacells.item;
package gripe._90.megacells.block;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import appeng.decorative.AEDecorativeBlock;

import gripe._90.megacells.MEGACells;
import gripe._90.megacells.block.MEGACraftingBlockItem;
import gripe._90.megacells.block.MEGACraftingUnitType;
import gripe._90.megacells.block.MEGAPatternProviderBlock;
import gripe._90.megacells.item.MEGACraftingBlockItem;
import gripe._90.megacells.item.MEGAPatternProviderBlockItem;
import gripe._90.megacells.block.MEGAPatternProviderBlockItem;

public final class MEGABlocks {
public static void init() {
Expand Down
20 changes: 20 additions & 0 deletions common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
import java.util.List;
import java.util.function.Function;

import net.minecraft.Util;
import net.minecraft.world.item.Item;

import appeng.api.parts.PartModels;
import appeng.api.stacks.AEKeyType;
import appeng.core.definitions.ItemDefinition;
import appeng.items.materials.EnergyCardItem;
import appeng.items.materials.MaterialItem;
import appeng.items.materials.StorageComponentItem;
import appeng.items.materials.UpgradeCardItem;
import appeng.items.parts.PartItem;
import appeng.items.parts.PartModelsHelper;
import appeng.items.storage.BasicStorageCell;
import appeng.items.storage.StorageTier;
import appeng.menu.me.common.MEStorageMenu;
Expand All @@ -21,6 +25,9 @@
import gripe._90.megacells.crafting.DecompressionPatternItem;
import gripe._90.megacells.item.MEGABulkCell;
import gripe._90.megacells.item.MEGAPortableCell;
import gripe._90.megacells.part.DecompressionModulePart;
import gripe._90.megacells.part.MEGAPatternProviderPart;
import gripe._90.megacells.part.MEGAPatternProviderPartItem;

public final class MEGAItems {
public static void init() {
Expand Down Expand Up @@ -98,6 +105,19 @@ public static List<ItemDefinition<?>> getItems() {
public static final ItemDefinition<DecompressionPatternItem> DECOMPRESSION_PATTERN =
item("Decompression Pattern", "decompression_pattern", DecompressionPatternItem::new);

public static final ItemDefinition<MEGAPatternProviderPartItem> MEGA_PATTERN_PROVIDER = Util.make(() -> {
PartModels.registerModels(PartModelsHelper.createModels(MEGAPatternProviderPart.class));
return item("MEGA Pattern Provider", "cable_mega_pattern_provider", MEGAPatternProviderPartItem::new);
});

public static final ItemDefinition<PartItem<DecompressionModulePart>> DECOMPRESSION_MODULE = Util.make(() -> {
PartModels.registerModels(PartModelsHelper.createModels(DecompressionModulePart.class));
return item(
"MEGA Decompression Module",
"decompression_module",
p -> new PartItem<>(p, DecompressionModulePart.class, DecompressionModulePart::new));
});

public static List<ItemDefinition<?>> getItemCells() {
return List.of(ITEM_CELL_1M, ITEM_CELL_4M, ITEM_CELL_16M, ITEM_CELL_64M, ITEM_CELL_256M);
}
Expand Down
46 changes: 0 additions & 46 deletions common/src/main/java/gripe/_90/megacells/definition/MEGAParts.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import gripe._90.megacells.MEGACells;
import gripe._90.megacells.block.MEGAPatternProviderBlock;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.menu.MEGAPatternProviderMenu;

public class MEGAPatternProviderPart extends PatternProviderPart {
Expand Down Expand Up @@ -65,6 +65,6 @@ public IPartModel getStaticModels() {

@Override
public ItemStack getMainMenuIcon() {
return MEGAParts.MEGA_PATTERN_PROVIDER.stack();
return MEGAItems.MEGA_PATTERN_PROVIDER.stack();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gripe._90.megacells.item;
package gripe._90.megacells.part;

import java.util.List;

Expand All @@ -11,7 +11,6 @@
import appeng.items.parts.PartItem;

import gripe._90.megacells.definition.MEGATranslations;
import gripe._90.megacells.part.MEGAPatternProviderPart;

public class MEGAPatternProviderPartItem extends PartItem<MEGAPatternProviderPart> {
public MEGAPatternProviderPartItem(Properties properties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import gripe._90.megacells.MEGACells;
import gripe._90.megacells.definition.MEGABlocks;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.definition.MEGATags;
import gripe._90.megacells.integration.appbot.AppBotItems;
import gripe._90.megacells.util.Addons;
Expand Down Expand Up @@ -281,7 +280,7 @@ public void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
.unlockedBy("has_advanced_card", has(AEItems.ADVANCED_CARD))
.unlockedBy("has_matter_ball", has(AEItems.MATTER_BALL))
.save(consumer, MEGACells.makeId("crafting/compression_card"));
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, MEGAParts.DECOMPRESSION_MODULE)
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, MEGAItems.DECOMPRESSION_MODULE)
.pattern("IAI")
.pattern("C#E")
.pattern("ILI")
Expand All @@ -302,13 +301,13 @@ public void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
.unlockedBy("has_pattern_provider", has(ConventionTags.PATTERN_PROVIDER))
.save(consumer, MEGACells.makeId("network/mega_pattern_provider"));

ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGAParts.MEGA_PATTERN_PROVIDER)
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGAItems.MEGA_PATTERN_PROVIDER)
.requires(MEGABlocks.MEGA_PATTERN_PROVIDER)
.unlockedBy("has_mega_pattern_provider", has(MEGABlocks.MEGA_PATTERN_PROVIDER))
.save(consumer, MEGACells.makeId("network/mega_pattern_provider_part"));
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGABlocks.MEGA_PATTERN_PROVIDER)
.requires(MEGAParts.MEGA_PATTERN_PROVIDER)
.unlockedBy("has_cable_mega_pattern_provider", has(MEGAParts.MEGA_PATTERN_PROVIDER))
.requires(MEGAItems.MEGA_PATTERN_PROVIDER)
.unlockedBy("has_cable_mega_pattern_provider", has(MEGAItems.MEGA_PATTERN_PROVIDER))
.save(consumer, MEGACells.makeId("network/mega_pattern_provider_block"));

if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPBOT)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import gripe._90.megacells.definition.MEGABlocks;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.definition.MEGATags;

abstract class TagProvider {
Expand All @@ -35,7 +34,7 @@ protected void addTags(HolderLookup.Provider provider) {
.add(getKey(MEGABlocks.MEGA_ENERGY_CELL));
tag(MEGATags.MEGA_PATTERN_PROVIDER)
.add(getKey(MEGABlocks.MEGA_PATTERN_PROVIDER))
.add(getKey(MEGAParts.MEGA_PATTERN_PROVIDER));
.add(getKey(MEGAItems.MEGA_PATTERN_PROVIDER));
}

private ResourceKey<Item> getKey(ItemDefinition<?> item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import gripe._90.megacells.MEGACells;
import gripe._90.megacells.definition.MEGABlocks;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.integration.appbot.AppBotItems;
import gripe._90.megacells.integration.appmek.AppMekItems;
import gripe._90.megacells.util.Addons;
Expand Down Expand Up @@ -155,7 +154,7 @@ private void driveCell(String texture) {
}

private void patternProviderPart() {
withExistingParent(MEGAParts.MEGA_PATTERN_PROVIDER.id().getPath(), CABLE_INTERFACE)
withExistingParent(MEGAItems.MEGA_PATTERN_PROVIDER.id().getPath(), CABLE_INTERFACE)
.texture("back", "part/mega_monitor_back")
.texture("front", "part/mega_pattern_provider")
.texture("sides", "part/mega_monitor_sides");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import gripe._90.megacells.MEGACells;
import gripe._90.megacells.definition.MEGABlocks;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.definition.MEGATags;
import gripe._90.megacells.integration.appbot.AppBotItems;
import gripe._90.megacells.integration.appmek.AppMekItems;
Expand Down Expand Up @@ -288,7 +287,7 @@ protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
.unlockedBy("has_advanced_card", has(AEItems.ADVANCED_CARD))
.unlockedBy("has_matter_ball", has(AEItems.MATTER_BALL))
.save(consumer, MEGACells.makeId("crafting/compression_card"));
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, MEGAParts.DECOMPRESSION_MODULE)
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, MEGAItems.DECOMPRESSION_MODULE)
.pattern("IAI")
.pattern("C#E")
.pattern("ILI")
Expand All @@ -309,13 +308,13 @@ protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
.unlockedBy("has_pattern_provider", has(ConventionTags.PATTERN_PROVIDER))
.save(consumer, MEGACells.makeId("network/mega_pattern_provider"));

ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGAParts.MEGA_PATTERN_PROVIDER)
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGAItems.MEGA_PATTERN_PROVIDER)
.requires(MEGABlocks.MEGA_PATTERN_PROVIDER)
.unlockedBy("has_mega_pattern_provider", has(MEGABlocks.MEGA_PATTERN_PROVIDER))
.save(consumer, MEGACells.makeId("network/mega_pattern_provider_part"));
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGABlocks.MEGA_PATTERN_PROVIDER)
.requires(MEGAParts.MEGA_PATTERN_PROVIDER)
.unlockedBy("has_cable_mega_pattern_provider", has(MEGAParts.MEGA_PATTERN_PROVIDER))
.requires(MEGAItems.MEGA_PATTERN_PROVIDER)
.unlockedBy("has_cable_mega_pattern_provider", has(MEGAItems.MEGA_PATTERN_PROVIDER))
.save(consumer, MEGACells.makeId("network/mega_pattern_provider_block"));

if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPMEK)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import gripe._90.megacells.MEGACells;
import gripe._90.megacells.definition.MEGABlocks;
import gripe._90.megacells.definition.MEGAItems;
import gripe._90.megacells.definition.MEGAParts;
import gripe._90.megacells.definition.MEGATags;

abstract class TagProvider {
Expand All @@ -45,7 +44,7 @@ protected void addTags(@NotNull HolderLookup.Provider provider) {
.add(getKey(MEGABlocks.MEGA_ENERGY_CELL));
tag(MEGATags.MEGA_PATTERN_PROVIDER)
.add(getKey(MEGABlocks.MEGA_PATTERN_PROVIDER))
.add(getKey(MEGAParts.MEGA_PATTERN_PROVIDER));
.add(getKey(MEGAItems.MEGA_PATTERN_PROVIDER));
}

private ResourceKey<Item> getKey(ItemDefinition<?> item) {
Expand Down

0 comments on commit b1351f0

Please sign in to comment.