diff --git a/build.gradle b/build.gradle index 3a77a09e..ba0880af 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ apply(plugin: "net.minecraftforge.gradle") apply plugin: 'org.spongepowered.mixin' group = "ninety" -version = "1.1.1" +version = "1.2.0" repositories { maven { diff --git a/gradle.properties b/gradle.properties index d467baf2..93eea693 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ minecraft_version=1.18.2 -forge_version=40.0.44 -ae2_version=11.0.0 -jei_version=9.7.0.180 -mekanism_version=10.2.0.459 -appmek_fileid=3793491 +forge_version=40.1.31 +ae2_version=11.1.0 +jei_version=9.7.0.195 +mekanism_version=10.2.2.462 +appmek_fileid=3807443 # Temp fix for Spotless / Remove Unused Imports: # https://github.com/diffplug/spotless/issues/834 diff --git a/src/main/java/ninety/megacells/MEGACells.java b/src/main/java/ninety/megacells/MEGACells.java index d831235d..3b09cdfb 100644 --- a/src/main/java/ninety/megacells/MEGACells.java +++ b/src/main/java/ninety/megacells/MEGACells.java @@ -2,6 +2,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.DistExecutor; @@ -10,10 +12,8 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import ninety.megacells.datagen.MEGADataGenerators; -import ninety.megacells.init.InitCellModels; -import ninety.megacells.init.InitItems; -import ninety.megacells.init.InitUpgrades; -import ninety.megacells.init.client.InitItemColors; +import ninety.megacells.init.*; +import ninety.megacells.init.client.*; @Mod(MEGACells.MODID) public class MEGACells { @@ -28,6 +28,8 @@ public MEGACells() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addGenericListener(Item.class, InitItems::register); + bus.addGenericListener(Block.class, InitBlocks::register); + bus.addGenericListener(BlockEntityType.class, InitBlockEntities::register); bus.addListener(MEGADataGenerators::onGatherData); bus.addListener((FMLCommonSetupEvent event) -> { @@ -35,6 +37,10 @@ public MEGACells() { event.enqueueWork(InitUpgrades::init); }); - DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> InitItemColors::initialize); + DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> InitAutoRotatingModel::init); + DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> InitBlockEntityRenderers::init); + DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> InitBuiltInModels::init); + DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> InitItemColors::init); + DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> InitRenderTypes::init); } } diff --git a/src/main/java/ninety/megacells/block/MEGABlocks.java b/src/main/java/ninety/megacells/block/MEGABlocks.java new file mode 100644 index 00000000..373c04be --- /dev/null +++ b/src/main/java/ninety/megacells/block/MEGABlocks.java @@ -0,0 +1,110 @@ +package ninety.megacells.block; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.function.BiFunction; +import java.util.function.Supplier; + +import javax.annotation.Nullable; + +import com.google.common.base.Preconditions; + +import org.jetbrains.annotations.NotNull; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.material.Material; + +import appeng.block.crafting.CraftingMonitorBlock; +import appeng.block.crafting.CraftingUnitBlock; +import appeng.core.definitions.AEItems; +import appeng.core.definitions.AEParts; + +import ninety.megacells.MEGACells; +import ninety.megacells.item.MEGAItems; + +public class MEGABlocks { + + private static final List> BLOCKS = new ArrayList<>(); + + public static List> getBlocks() { + return Collections.unmodifiableList(BLOCKS); + } + + private static BlockBehaviour.Properties props = BlockBehaviour.Properties.of(Material.METAL) + .strength(2.2f, 11.0f) + .sound(SoundType.METAL); + + // spotless:off + public static final BlockDefinition MEGA_CRAFTING_UNIT = block("mega_crafting_unit", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.UNIT)); + public static final BlockDefinition CRAFTING_ACCELERATOR = craftingBlock("mega_crafting_accelerator", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.ACCELERATOR), () -> AEItems.ENGINEERING_PROCESSOR); + public static final BlockDefinition CRAFTING_STORAGE_1M = craftingBlock("1m_crafting_storage", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.STORAGE_1M), () -> MEGAItems.CELL_COMPONENT_1M); + public static final BlockDefinition CRAFTING_STORAGE_4M = craftingBlock("4m_crafting_storage", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.STORAGE_4M), () -> MEGAItems.CELL_COMPONENT_4M); + public static final BlockDefinition CRAFTING_STORAGE_16M = craftingBlock("16m_crafting_storage", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.STORAGE_16M), () -> MEGAItems.CELL_COMPONENT_16M); + public static final BlockDefinition CRAFTING_STORAGE_64M = craftingBlock("64m_crafting_storage", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.STORAGE_64M), () -> MEGAItems.CELL_COMPONENT_64M); + public static final BlockDefinition CRAFTING_STORAGE_256M = craftingBlock("256m_crafting_storage", () -> new CraftingUnitBlock(props, MEGACraftingUnitType.STORAGE_256M), () -> MEGAItems.CELL_COMPONENT_256M); + public static final BlockDefinition CRAFTING_MONITOR = craftingBlock("mega_crafting_monitor", () -> new CraftingMonitorBlock(props, MEGACraftingUnitType.MONITOR), () -> AEParts.STORAGE_MONITOR); + // spotless:on + + private static BlockDefinition craftingBlock(String id, Supplier blockSupplier, + Supplier disassemblyExtra) { + return block(id, blockSupplier, (block, props) -> new MEGACraftingBlockItem(block, props, disassemblyExtra)); + } + + private static BlockDefinition block(String id, Supplier blockSupplier) { + return block(id, blockSupplier, null); + } + + private static BlockDefinition block( + String id, + Supplier blockSupplier, + @Nullable BiFunction itemFactory) { + + // Create block and matching item + T block = blockSupplier.get(); + + Item.Properties itemProperties = new Item.Properties().tab(MEGAItems.CREATIVE_TAB); + + BlockItem item; + if (itemFactory != null) { + item = itemFactory.apply(block, itemProperties); + if (item == null) { + throw new IllegalArgumentException("BlockItem factory for " + id + " returned null"); + } + } else { + item = new BlockItem(block, itemProperties); + } + + BlockDefinition definition = new BlockDefinition<>(MEGACells.makeId(id), block, item); + + BLOCKS.add(definition); + return definition; + } + + public static class BlockDefinition extends MEGAItems.ItemDefinition { + + private final T block; + + public BlockDefinition(ResourceLocation id, T block, BlockItem item) { + super(id, item); + this.block = Objects.requireNonNull(block, "block"); + } + + public final @NotNull T asBlock() { + return this.block; + } + + public final ItemStack stack(int stackSize) { + Preconditions.checkArgument(stackSize > 0); + return new ItemStack(block, stackSize); + } + } +} diff --git a/src/main/java/ninety/megacells/block/MEGACraftingBlockItem.java b/src/main/java/ninety/megacells/block/MEGACraftingBlockItem.java new file mode 100644 index 00000000..8d058737 --- /dev/null +++ b/src/main/java/ninety/megacells/block/MEGACraftingBlockItem.java @@ -0,0 +1,35 @@ +package ninety.megacells.block; + +import java.util.function.Supplier; + +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; + +import appeng.block.crafting.CraftingBlockItem; +import appeng.core.AEConfig; +import appeng.util.InteractionUtil; + +public class MEGACraftingBlockItem extends CraftingBlockItem { + public MEGACraftingBlockItem(Block id, Properties props, Supplier disassemblyExtra) { + super(id, props, disassemblyExtra); + } + + @Override + public InteractionResultHolder use(Level level, Player player, InteractionHand hand) { + if (AEConfig.instance().isDisassemblyCraftingEnabled() && InteractionUtil.isInAlternateUseMode(player)) { + int itemCount = player.getItemInHand(hand).getCount(); + player.setItemInHand(hand, ItemStack.EMPTY); + + player.getInventory().placeItemBackInInventory(MEGABlocks.MEGA_CRAFTING_UNIT.stack(itemCount)); + player.getInventory().placeItemBackInInventory(new ItemStack(disassemblyExtra.get(), itemCount)); + + return InteractionResultHolder.sidedSuccess(player.getItemInHand(hand), level.isClientSide()); + } + return super.use(level, player, hand); + } +} diff --git a/src/main/java/ninety/megacells/block/MEGACraftingUnitType.java b/src/main/java/ninety/megacells/block/MEGACraftingUnitType.java new file mode 100644 index 00000000..415a656b --- /dev/null +++ b/src/main/java/ninety/megacells/block/MEGACraftingUnitType.java @@ -0,0 +1,53 @@ +package ninety.megacells.block; + +import net.minecraft.world.item.Item; + +import appeng.block.crafting.ICraftingUnitType; + +public enum MEGACraftingUnitType implements ICraftingUnitType { + UNIT(0, "unit"), + ACCELERATOR(0, "accelerator"), + STORAGE_1M(1, "1m_storage"), + STORAGE_4M(4, "4m_storage"), + STORAGE_16M(16, "16m_storage"), + STORAGE_64M(64, "64m_storage"), + STORAGE_256M(256, "256m_storage"), + MONITOR(0, "monitor"); + + private final int storageMb; + private final String affix; + + MEGACraftingUnitType(int storageMb, String affix) { + this.storageMb = storageMb; + this.affix = affix; + } + + @Override + public int getStorageBytes() { + return 1024 * 1024 * storageMb; + } + + @Override + public int getAcceleratorThreads() { + return this == ACCELERATOR ? 4 : 0; + } + + public String getAffix() { + return this.affix; + } + + @Override + public Item getItemFromType() { + var definition = switch (this) { + case UNIT -> MEGABlocks.MEGA_CRAFTING_UNIT; + case ACCELERATOR -> MEGABlocks.CRAFTING_ACCELERATOR; + case STORAGE_1M -> MEGABlocks.CRAFTING_STORAGE_1M; + case STORAGE_4M -> MEGABlocks.CRAFTING_STORAGE_4M; + case STORAGE_16M -> MEGABlocks.CRAFTING_STORAGE_16M; + case STORAGE_64M -> MEGABlocks.CRAFTING_STORAGE_64M; + case STORAGE_256M -> MEGABlocks.CRAFTING_STORAGE_256M; + case MONITOR -> MEGABlocks.CRAFTING_MONITOR; + }; + return definition.asItem(); + } +} diff --git a/src/main/java/ninety/megacells/block/entity/MEGABlockEntities.java b/src/main/java/ninety/megacells/block/entity/MEGABlockEntities.java new file mode 100644 index 00000000..80507207 --- /dev/null +++ b/src/main/java/ninety/megacells/block/entity/MEGABlockEntities.java @@ -0,0 +1,86 @@ +package ninety.megacells.block.entity; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; + +import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +import appeng.block.AEBaseEntityBlock; +import appeng.blockentity.AEBaseBlockEntity; +import appeng.blockentity.ClientTickingBlockEntity; +import appeng.blockentity.ServerTickingBlockEntity; +import appeng.blockentity.crafting.CraftingBlockEntity; +import appeng.blockentity.crafting.CraftingMonitorBlockEntity; + +import ninety.megacells.MEGACells; +import ninety.megacells.block.MEGABlocks; + +@SuppressWarnings("unused") +public class MEGABlockEntities { + + private static final Map> BLOCK_ENTITY_TYPES = new HashMap<>(); + + public static Map> getBlockEntityTypes() { + return ImmutableMap.copyOf(BLOCK_ENTITY_TYPES); + } + + // spotless:off + public static final BlockEntityType MEGA_CRAFTING_UNIT = create("mega_crafting_unit", CraftingBlockEntity.class, CraftingBlockEntity::new, MEGABlocks.MEGA_CRAFTING_UNIT, MEGABlocks.CRAFTING_ACCELERATOR); + public static final BlockEntityType MEGA_CRAFTING_STORAGE = create("mega_crafting_storage", CraftingBlockEntity.class, CraftingBlockEntity::new, MEGABlocks.CRAFTING_STORAGE_1M, MEGABlocks.CRAFTING_STORAGE_4M, MEGABlocks.CRAFTING_STORAGE_16M, MEGABlocks.CRAFTING_STORAGE_64M, MEGABlocks.CRAFTING_STORAGE_256M); + public static final BlockEntityType MEGA_CRAFTING_MONITOR = create("mega_crafting_monitor", CraftingMonitorBlockEntity.class, CraftingMonitorBlockEntity::new, MEGABlocks.CRAFTING_MONITOR); + // spotless:on + + @SafeVarargs + private static BlockEntityType create(String id, Class entityClass, + BlockEntityFactory factory, + MEGABlocks.BlockDefinition>... blockDefinitions) { + Preconditions.checkArgument(blockDefinitions.length > 0); + + var blocks = Arrays.stream(blockDefinitions) + .map(MEGABlocks.BlockDefinition::asBlock) + .toArray(AEBaseEntityBlock[]::new); + + AtomicReference> typeHolder = new AtomicReference<>(); + BlockEntityType.BlockEntitySupplier supplier = (blockPos, blockState) -> factory.create(typeHolder.get(), + blockPos, blockState); + var type = BlockEntityType.Builder.of(supplier, blocks).build(null); + type.setRegistryName(MEGACells.makeId(id)); + typeHolder.set(type); // Makes it available to the supplier used above + BLOCK_ENTITY_TYPES.put(type.getRegistryName(), type); + + AEBaseBlockEntity.registerBlockEntityItem(type, blockDefinitions[0].asItem()); + + // If the block entity classes implement specific interfaces, automatically register them + // as tickers with the blocks that create that entity. + BlockEntityTicker serverTicker = null; + if (ServerTickingBlockEntity.class.isAssignableFrom(entityClass)) { + serverTicker = (level, pos, state, entity) -> ((ServerTickingBlockEntity) entity).serverTick(); + } + BlockEntityTicker clientTicker = null; + if (ClientTickingBlockEntity.class.isAssignableFrom(entityClass)) { + clientTicker = (level, pos, state, entity) -> ((ClientTickingBlockEntity) entity).clientTick(); + } + + for (var block : blocks) { + AEBaseEntityBlock baseBlock = (AEBaseEntityBlock) block; + baseBlock.setBlockEntity(entityClass, type, clientTicker, serverTicker); + } + + return type; + } + + @FunctionalInterface + interface BlockEntityFactory { + T create(BlockEntityType type, BlockPos pos, BlockState state); + } + +} diff --git a/src/main/java/ninety/megacells/client/render/MEGACraftingUnitModelProvider.java b/src/main/java/ninety/megacells/client/render/MEGACraftingUnitModelProvider.java new file mode 100644 index 00000000..870f77cc --- /dev/null +++ b/src/main/java/ninety/megacells/client/render/MEGACraftingUnitModelProvider.java @@ -0,0 +1,89 @@ +package ninety.megacells.client.render; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Function; + +import net.minecraft.client.renderer.texture.TextureAtlas; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.client.resources.model.Material; + +import appeng.client.render.crafting.AbstractCraftingUnitModelProvider; +import appeng.client.render.crafting.LightBakedModel; +import appeng.client.render.crafting.MonitorBakedModel; +import appeng.client.render.crafting.UnitBakedModel; + +import ninety.megacells.MEGACells; +import ninety.megacells.block.MEGACraftingUnitType; + +public class MEGACraftingUnitModelProvider extends AbstractCraftingUnitModelProvider { + + private static final List MATERIALS = new ArrayList<>(); + + protected static final Material RING_CORNER = texture("ring_corner"); + protected static final Material RING_SIDE_HOR = texture("ring_side_hor"); + protected static final Material RING_SIDE_VER = texture("ring_side_ver"); + protected static final Material UNIT_BASE = texture("unit_base"); + protected static final Material LIGHT_BASE = texture("light_base"); + protected static final Material ACCELERATOR_LIGHT = texture("accelerator_light"); + protected static final Material STORAGE_1M_LIGHT = texture("1m_storage_light"); + protected static final Material STORAGE_4M_LIGHT = texture("4m_storage_light"); + protected static final Material STORAGE_16M_LIGHT = texture("16m_storage_light"); + protected static final Material STORAGE_64M_LIGHT = texture("64m_storage_light"); + protected static final Material STORAGE_256M_LIGHT = texture("256m_storage_light"); + protected static final Material MONITOR_BASE = texture("monitor_base"); + protected static final Material MONITOR_LIGHT_DARK = texture("monitor_light_dark"); + protected static final Material MONITOR_LIGHT_MEDIUM = texture("monitor_light_medium"); + protected static final Material MONITOR_LIGHT_BRIGHT = texture("monitor_light_bright"); + + public MEGACraftingUnitModelProvider(MEGACraftingUnitType type) { + super(type); + } + + @Override + public List getMaterials() { + return Collections.unmodifiableList(MATERIALS); + } + + public TextureAtlasSprite getLightMaterial(Function textureGetter) { + return switch (this.type) { + case ACCELERATOR -> textureGetter.apply(ACCELERATOR_LIGHT); + case STORAGE_1M -> textureGetter.apply(STORAGE_1M_LIGHT); + case STORAGE_4M -> textureGetter.apply(STORAGE_4M_LIGHT); + case STORAGE_16M -> textureGetter.apply(STORAGE_16M_LIGHT); + case STORAGE_64M -> textureGetter.apply(STORAGE_64M_LIGHT); + case STORAGE_256M -> textureGetter.apply(STORAGE_256M_LIGHT); + default -> throw new IllegalArgumentException( + "Crafting unit type " + this.type + " does not use a light texture."); + }; + } + + @Override + public BakedModel getBakedModel(Function spriteGetter) { + TextureAtlasSprite ringCorner = spriteGetter.apply(RING_CORNER); + TextureAtlasSprite ringSideHor = spriteGetter.apply(RING_SIDE_HOR); + TextureAtlasSprite ringSideVer = spriteGetter.apply(RING_SIDE_VER); + + return switch (this.type) { + case UNIT -> new UnitBakedModel(ringCorner, ringSideHor, ringSideVer, + spriteGetter.apply(UNIT_BASE)); + case ACCELERATOR, STORAGE_1M, STORAGE_4M, STORAGE_16M, STORAGE_64M, STORAGE_256M -> new LightBakedModel( + ringCorner, ringSideHor, ringSideVer, spriteGetter.apply(LIGHT_BASE), + this.getLightMaterial(spriteGetter)); + case MONITOR -> new MonitorBakedModel(ringCorner, ringSideHor, ringSideVer, + spriteGetter.apply(UNIT_BASE), + spriteGetter.apply(MONITOR_BASE), + spriteGetter.apply(MONITOR_LIGHT_DARK), + spriteGetter.apply(MONITOR_LIGHT_MEDIUM), + spriteGetter.apply(MONITOR_LIGHT_BRIGHT)); + }; + } + + private static Material texture(String name) { + var material = new Material(TextureAtlas.LOCATION_BLOCKS, MEGACells.makeId("block/crafting/" + name)); + MATERIALS.add(material); + return material; + } +} diff --git a/src/main/java/ninety/megacells/datagen/MEGABlockModelProvider.java b/src/main/java/ninety/megacells/datagen/MEGABlockModelProvider.java new file mode 100644 index 00000000..ff7af70c --- /dev/null +++ b/src/main/java/ninety/megacells/datagen/MEGABlockModelProvider.java @@ -0,0 +1,49 @@ +package ninety.megacells.datagen; + +import net.minecraft.data.DataGenerator; +import net.minecraftforge.client.model.generators.BlockStateProvider; +import net.minecraftforge.client.model.generators.ConfiguredModel; +import net.minecraftforge.client.model.generators.CustomLoaderBuilder; +import net.minecraftforge.common.data.ExistingFileHelper; + +import appeng.block.crafting.AbstractCraftingUnitBlock; + +import ninety.megacells.MEGACells; +import ninety.megacells.block.MEGABlocks; + +public class MEGABlockModelProvider extends BlockStateProvider { + + public MEGABlockModelProvider(DataGenerator gen, ExistingFileHelper exFileHelper) { + super(gen, MEGACells.MODID, exFileHelper); + } + + @Override + protected void registerStatesAndModels() { + craftingModel(MEGABlocks.MEGA_CRAFTING_UNIT, "unit"); + craftingModel(MEGABlocks.CRAFTING_STORAGE_1M, "1m_storage"); + craftingModel(MEGABlocks.CRAFTING_STORAGE_4M, "4m_storage"); + craftingModel(MEGABlocks.CRAFTING_STORAGE_16M, "16m_storage"); + craftingModel(MEGABlocks.CRAFTING_STORAGE_64M, "64m_storage"); + craftingModel(MEGABlocks.CRAFTING_STORAGE_256M, "256m_storage"); + craftingModel(MEGABlocks.CRAFTING_ACCELERATOR, "accelerator"); + builtInBlockModel("crafting/monitor_formed"); + } + + private void builtInBlockModel(String name) { + var model = models().getBuilder("block/" + name); + var loaderId = MEGACells.makeId("block/" + name); + model.customLoader((bmb, efh) -> new CustomLoaderBuilder<>(loaderId, bmb, efh) { + }); + } + + private void craftingModel(MEGABlocks.BlockDefinition block, String name) { + builtInBlockModel("crafting/" + name + "_formed"); + var blockModel = models().cubeAll("block/crafting/" + name, MEGACells.makeId("block/crafting/" + name)); + getVariantBuilder(block.asBlock()) + .partialState().with(AbstractCraftingUnitBlock.FORMED, false).setModels( + new ConfiguredModel(blockModel)) + .partialState().with(AbstractCraftingUnitBlock.FORMED, true).setModels( + new ConfiguredModel(models().getBuilder("block/crafting/" + name + "_formed"))); + simpleBlockItem(block.asBlock(), blockModel); + } +} diff --git a/src/main/java/ninety/megacells/datagen/MEGADataGenerators.java b/src/main/java/ninety/megacells/datagen/MEGADataGenerators.java index 9564017e..58885d23 100644 --- a/src/main/java/ninety/megacells/datagen/MEGADataGenerators.java +++ b/src/main/java/ninety/megacells/datagen/MEGADataGenerators.java @@ -17,7 +17,7 @@ public static void onGatherData(GatherDataEvent event) { ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); generator.addProvider(new MEGAItemModelProvider(generator, existingFileHelper)); - generator.addProvider(new MEGABlockStateProvider(generator, existingFileHelper)); + generator.addProvider(new MEGABlockModelProvider(generator, existingFileHelper)); generator.addProvider(new MEGARecipeProvider(generator)); } } diff --git a/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java b/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java index 3f6b3983..5d82c5ef 100644 --- a/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java +++ b/src/main/java/ninety/megacells/datagen/MEGARecipeProvider.java @@ -11,12 +11,16 @@ import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.world.item.Item; +import net.minecraft.world.level.ItemLike; +import appeng.api.util.AEColor; import appeng.core.definitions.AEBlocks; import appeng.core.definitions.AEItems; +import appeng.core.definitions.AEParts; +import appeng.datagen.providers.tags.ConventionTags; import ninety.megacells.MEGACells; -import ninety.megacells.integration.appmek.AppMekIntegration; +import ninety.megacells.block.MEGABlocks; import ninety.megacells.integration.appmek.ChemicalCellType; import ninety.megacells.item.IMEGACellType; import ninety.megacells.item.MEGACellType; @@ -32,7 +36,6 @@ public MEGARecipeProvider(DataGenerator generator) { @Override protected void buildCraftingRecipes(@NotNull Consumer consumer) { - // spotless:off component(consumer, MEGATier._1M, AEItems.SKY_DUST.asItem()); component(consumer, MEGATier._4M, AEItems.MATTER_BALL.asItem()); component(consumer, MEGATier._16M, AEItems.MATTER_BALL.asItem()); @@ -42,23 +45,36 @@ protected void buildCraftingRecipes(@NotNull Consumer consumer) housing(consumer, MEGACellType.ITEM); housing(consumer, MEGACellType.FLUID); - for (var storage : Stream.concat(MEGACellType.ITEM.getCells().stream(), MEGACellType.FLUID.getCells().stream()).toList()) { + for (var storage : Stream.of( + MEGACellType.ITEM.getCells().stream(), + MEGACellType.FLUID.getCells().stream(), + ChemicalCellType.TYPE.getCells().stream()).flatMap(s -> s).toList()) { cell(consumer, storage); } - for (var portable : Stream.concat(MEGACellType.ITEM.getPortableCells().stream(), MEGACellType.FLUID.getPortableCells().stream()).toList()) { + for (var portable : Stream.of( + MEGACellType.ITEM.getPortableCells().stream(), + MEGACellType.FLUID.getPortableCells().stream(), + ChemicalCellType.TYPE.getPortableCells().stream()).flatMap(s -> s).toList()) { portable(consumer, portable); } - if (AppMekIntegration.isAppMekLoaded()) { // this check doesn't actually do shit lol - housing(consumer, ChemicalCellType.TYPE); - for (var chemStorage : ChemicalCellType.TYPE.getCells()) { - cell(consumer, chemStorage); - } - for (var chemPortable : ChemicalCellType.TYPE.getPortableCells()) { - portable(consumer, chemPortable); - } - } - // spotless:on + ShapedRecipeBuilder.shaped(MEGABlocks.MEGA_CRAFTING_UNIT) + .pattern("aba") + .pattern("cdc") + .pattern("aba") + .define('a', ConventionTags.IRON_INGOT) + .define('b', AEItems.LOGIC_PROCESSOR) + .define('c', AEParts.SMART_CABLE.item(AEColor.TRANSPARENT)) + .define('d', AEItems.ENGINEERING_PROCESSOR) + .unlockedBy("has_logic_processor", has(AEItems.LOGIC_PROCESSOR)) + .save(consumer, MEGACells.makeId("crafting/mega_crafting_unit")); + craftingBlock(consumer, MEGABlocks.CRAFTING_ACCELERATOR, AEItems.ENGINEERING_PROCESSOR); + craftingBlock(consumer, MEGABlocks.CRAFTING_STORAGE_1M, MEGAItems.CELL_COMPONENT_1M); + craftingBlock(consumer, MEGABlocks.CRAFTING_STORAGE_4M, MEGAItems.CELL_COMPONENT_4M); + craftingBlock(consumer, MEGABlocks.CRAFTING_STORAGE_16M, MEGAItems.CELL_COMPONENT_16M); + craftingBlock(consumer, MEGABlocks.CRAFTING_STORAGE_64M, MEGAItems.CELL_COMPONENT_64M); + craftingBlock(consumer, MEGABlocks.CRAFTING_STORAGE_256M, MEGAItems.CELL_COMPONENT_256M); + craftingBlock(consumer, MEGABlocks.CRAFTING_MONITOR, AEParts.STORAGE_MONITOR); } private void component(Consumer consumer, MEGATier tier, Item binder) { @@ -130,4 +146,12 @@ private void housing(Consumer consumer, IMEGACellType type) { .unlockedBy("has_dusts/sky_stone", has(AEItems.SKY_DUST)) .save(consumer, MEGACells.makeId("cells/" + MEGAItems.getItemPath(housing))); } + + private void craftingBlock(Consumer consumer, MEGABlocks.BlockDefinition unit, ItemLike part) { + ShapelessRecipeBuilder.shapeless(unit) + .requires(MEGABlocks.MEGA_CRAFTING_UNIT) + .requires(part) + .unlockedBy("has_mega_crafting_unit", has(MEGABlocks.MEGA_CRAFTING_UNIT)) + .save(consumer, MEGACells.makeId("crafting/" + MEGAItems.getItemPath(unit.asItem()))); + } } diff --git a/src/main/java/ninety/megacells/init/InitBlockEntities.java b/src/main/java/ninety/megacells/init/InitBlockEntities.java new file mode 100644 index 00000000..80140eab --- /dev/null +++ b/src/main/java/ninety/megacells/init/InitBlockEntities.java @@ -0,0 +1,19 @@ +package ninety.megacells.init; + +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.registries.IForgeRegistry; + +import ninety.megacells.block.entity.MEGABlockEntities; + +public class InitBlockEntities { + public static void init(IForgeRegistry> registry) { + for (var be : MEGABlockEntities.getBlockEntityTypes().entrySet()) { + registry.register(be.getValue()); + } + } + + public static void register(RegistryEvent.Register> event) { + init(event.getRegistry()); + } +} diff --git a/src/main/java/ninety/megacells/init/InitBlocks.java b/src/main/java/ninety/megacells/init/InitBlocks.java new file mode 100644 index 00000000..cf123d7f --- /dev/null +++ b/src/main/java/ninety/megacells/init/InitBlocks.java @@ -0,0 +1,21 @@ +package ninety.megacells.init; + +import net.minecraft.world.level.block.Block; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.registries.IForgeRegistry; + +import ninety.megacells.block.MEGABlocks; + +public class InitBlocks { + public static void init(IForgeRegistry registry) { + for (var definition : MEGABlocks.getBlocks()) { + Block block = definition.asBlock(); + block.setRegistryName(definition.getId()); + registry.register(block); + } + } + + public static void register(RegistryEvent.Register event) { + init(event.getRegistry()); + } +} diff --git a/src/main/java/ninety/megacells/init/InitItems.java b/src/main/java/ninety/megacells/init/InitItems.java index 18424d57..2e492242 100644 --- a/src/main/java/ninety/megacells/init/InitItems.java +++ b/src/main/java/ninety/megacells/init/InitItems.java @@ -4,10 +4,16 @@ import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.registries.IForgeRegistry; +import ninety.megacells.block.MEGABlocks; import ninety.megacells.item.MEGAItems; public class InitItems { public static void init(IForgeRegistry registry) { + for (var definition : MEGABlocks.getBlocks()) { + var item = definition.asItem(); + item.setRegistryName(definition.getId()); + registry.register(item); + } for (var definition : MEGAItems.getItems()) { var item = definition.asItem(); item.setRegistryName(definition.getId()); diff --git a/src/main/java/ninety/megacells/init/client/InitAutoRotatingModel.java b/src/main/java/ninety/megacells/init/client/InitAutoRotatingModel.java new file mode 100644 index 00000000..c1a8fe60 --- /dev/null +++ b/src/main/java/ninety/megacells/init/client/InitAutoRotatingModel.java @@ -0,0 +1,100 @@ +package ninety.megacells.init.client; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; + +import appeng.block.AEBaseBlock; +import appeng.client.render.crafting.MonitorBakedModel; +import appeng.client.render.model.AutoRotatingBakedModel; + +import ninety.megacells.MEGACells; +import ninety.megacells.block.MEGABlocks; + +public class InitAutoRotatingModel { + private static final Set> NO_AUTO_ROTATION = ImmutableSet.of( + MEGABlocks.MEGA_CRAFTING_UNIT, + MEGABlocks.CRAFTING_ACCELERATOR, + MEGABlocks.CRAFTING_STORAGE_1M, + MEGABlocks.CRAFTING_STORAGE_4M, + MEGABlocks.CRAFTING_STORAGE_16M, + MEGABlocks.CRAFTING_STORAGE_64M, + MEGABlocks.CRAFTING_STORAGE_256M, + MEGABlocks.CRAFTING_MONITOR); + + private static final Map> CUSTOMIZERS = new HashMap<>(); + + public static void init() { + var bus = FMLJavaModLoadingContext.get().getModEventBus(); + bus.addListener(InitAutoRotatingModel::initAutoRotatingModels); + bus.addListener(InitAutoRotatingModel::onModelBake); + } + + public static void initAutoRotatingModels(ModelRegistryEvent event) { + register(MEGABlocks.CRAFTING_MONITOR, InitAutoRotatingModel::customizeCraftingMonitorModel); + + for (var block : MEGABlocks.getBlocks()) { + if (NO_AUTO_ROTATION.contains(block)) { + continue; + } + + if (block.asBlock() instanceof AEBaseBlock) { + // This is a default rotating model if the base-block uses an AE block entity + // which exposes UP/FRONT as extended props + register(block, AutoRotatingBakedModel::new); + } + } + } + + private static void register(MEGABlocks.BlockDefinition block, Function customizer) { + String path = block.getId().getPath(); + CUSTOMIZERS.put(path, customizer); + } + + private static BakedModel customizeCraftingMonitorModel(BakedModel model) { + // The formed model handles rotations itself, the unformed one does not + if (model instanceof MonitorBakedModel) { + return model; + } + return new AutoRotatingBakedModel(model); + } + + private static void onModelBake(ModelBakeEvent event) { + Map modelRegistry = event.getModelRegistry(); + Set keys = Sets.newHashSet(modelRegistry.keySet()); + BakedModel missingModel = modelRegistry.get(ModelBakery.MISSING_MODEL_LOCATION); + + for (ResourceLocation location : keys) { + if (!location.getNamespace().equals(MEGACells.MODID)) { + continue; + } + + BakedModel orgModel = modelRegistry.get(location); + + // Don't customize the missing model. This causes Forge to swallow exceptions + if (orgModel == missingModel) { + continue; + } + + Function customizer = CUSTOMIZERS.get(location.getPath()); + if (customizer != null) { + BakedModel newModel = customizer.apply(orgModel); + + if (newModel != orgModel) { + modelRegistry.put(location, newModel); + } + } + } + } +} diff --git a/src/main/java/ninety/megacells/init/client/InitBlockEntityRenderers.java b/src/main/java/ninety/megacells/init/client/InitBlockEntityRenderers.java new file mode 100644 index 00000000..5eb66086 --- /dev/null +++ b/src/main/java/ninety/megacells/init/client/InitBlockEntityRenderers.java @@ -0,0 +1,24 @@ +package ninety.megacells.init.client; + +import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; + +import appeng.client.render.crafting.CraftingMonitorRenderer; + +import ninety.megacells.block.entity.MEGABlockEntities; + +@OnlyIn(Dist.CLIENT) +public class InitBlockEntityRenderers { + + public static void init() { + var bus = FMLJavaModLoadingContext.get().getModEventBus(); + bus.addListener(InitBlockEntityRenderers::initBERenderers); + } + + private static void initBERenderers(ModelRegistryEvent event) { + BlockEntityRenderers.register(MEGABlockEntities.MEGA_CRAFTING_MONITOR, CraftingMonitorRenderer::new); + } +} diff --git a/src/main/java/ninety/megacells/init/client/InitBuiltInModels.java b/src/main/java/ninety/megacells/init/client/InitBuiltInModels.java new file mode 100644 index 00000000..fa1dd07f --- /dev/null +++ b/src/main/java/ninety/megacells/init/client/InitBuiltInModels.java @@ -0,0 +1,41 @@ +package ninety.megacells.init.client; + +import java.util.function.Supplier; + +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.client.model.ModelLoaderRegistry; +import net.minecraftforge.client.model.geometry.IModelGeometry; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; + +import appeng.client.render.SimpleModelLoader; +import appeng.client.render.crafting.CraftingCubeModel; + +import ninety.megacells.MEGACells; +import ninety.megacells.block.MEGACraftingUnitType; +import ninety.megacells.client.render.MEGACraftingUnitModelProvider; + +@OnlyIn(Dist.CLIENT) +public class InitBuiltInModels { + + public static void init() { + var bus = FMLJavaModLoadingContext.get().getModEventBus(); + bus.addListener(InitBuiltInModels::initModels); + } + + private static void initModels(ModelRegistryEvent event) { + for (var type : MEGACraftingUnitType.values()) { + craftingModel(type); + } + } + + private static void craftingModel(MEGACraftingUnitType type) { + addBuiltInModel("block/crafting/" + type.getAffix() + "_formed", + () -> new CraftingCubeModel(new MEGACraftingUnitModelProvider(type))); + } + + private static > void addBuiltInModel(String id, Supplier modelFactory) { + ModelLoaderRegistry.registerLoader(MEGACells.makeId(id), new SimpleModelLoader<>(modelFactory)); + } +} diff --git a/src/main/java/ninety/megacells/init/client/InitItemColors.java b/src/main/java/ninety/megacells/init/client/InitItemColors.java index a273f6e9..fb44b5ea 100644 --- a/src/main/java/ninety/megacells/init/client/InitItemColors.java +++ b/src/main/java/ninety/megacells/init/client/InitItemColors.java @@ -11,7 +11,7 @@ import ninety.megacells.item.MEGAStorageCell; public class InitItemColors { - public static void initialize() { + public static void init() { var bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(InitItemColors::initItemColors); } diff --git a/src/main/java/ninety/megacells/init/client/InitRenderTypes.java b/src/main/java/ninety/megacells/init/client/InitRenderTypes.java new file mode 100644 index 00000000..5ee914f2 --- /dev/null +++ b/src/main/java/ninety/megacells/init/client/InitRenderTypes.java @@ -0,0 +1,35 @@ +package ninety.megacells.init.client; + +import net.minecraft.client.renderer.ItemBlockRenderTypes; +import net.minecraft.client.renderer.RenderType; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; + +import ninety.megacells.block.MEGABlocks; + +@OnlyIn(Dist.CLIENT) +public class InitRenderTypes { + private static final MEGABlocks.BlockDefinition[] CUTOUT_BLOCKS = { + MEGABlocks.MEGA_CRAFTING_UNIT, + MEGABlocks.CRAFTING_ACCELERATOR, + MEGABlocks.CRAFTING_STORAGE_1M, + MEGABlocks.CRAFTING_STORAGE_4M, + MEGABlocks.CRAFTING_STORAGE_16M, + MEGABlocks.CRAFTING_STORAGE_64M, + MEGABlocks.CRAFTING_STORAGE_256M, + MEGABlocks.CRAFTING_MONITOR + }; + + public static void init() { + var bus = FMLJavaModLoadingContext.get().getModEventBus(); + bus.addListener(InitRenderTypes::initRenderTypes); + } + + private static void initRenderTypes(ModelRegistryEvent event) { + for (var definition : CUTOUT_BLOCKS) { + ItemBlockRenderTypes.setRenderLayer(definition.asBlock(), RenderType.cutout()); + } + } +} diff --git a/src/main/java/ninety/megacells/item/MEGAItems.java b/src/main/java/ninety/megacells/item/MEGAItems.java index f0201f25..ff2775b6 100644 --- a/src/main/java/ninety/megacells/item/MEGAItems.java +++ b/src/main/java/ninety/megacells/item/MEGAItems.java @@ -24,7 +24,7 @@ public final class MEGAItems { - public static final List> ITEMS = new ArrayList<>(); + private static final List> ITEMS = new ArrayList<>(); public static List> getItems() { return Collections.unmodifiableList(ITEMS); @@ -137,7 +137,7 @@ public ResourceLocation getId() { @Override public final @NotNull T asItem() { - return item; + return this.item; } } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 161085f5..7417fb2f 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -2,12 +2,15 @@ modLoader="javafml" loaderVersion="[40,)" license="LGPLv3.0" +issueTrackerURL="https://github.com/62832/MEGACells/issues" +displayURL="https://github.com/62832/MEGACells" + [[mods]] modId="megacells" version="${version}" displayName="MEGA Cells" -# logoFile="icon.png" -credits="big up AE2" +logoFile="logo.png" +credits="s/o to Technici4n, Gimpansor, MasterYodA, PrototypeTrousers, ramidzkh, RaVen" authors="90" description=''' ME Greater Accumulation Cells - For when kilobytes just won't do. @@ -16,7 +19,7 @@ ME Greater Accumulation Cells - For when kilobytes just won't do. [[dependencies.megacells]] modId="ae2" mandatory=true - versionRange = "(,12.0.0)" + versionRange = "[11.1.0,12.0.0)" ordering="AFTER" side="BOTH" diff --git a/src/main/resources/assets/megacells/blockstates/mega_crafting_monitor.json b/src/main/resources/assets/megacells/blockstates/mega_crafting_monitor.json new file mode 100644 index 00000000..01d55fe9 --- /dev/null +++ b/src/main/resources/assets/megacells/blockstates/mega_crafting_monitor.json @@ -0,0 +1,10 @@ +{ + "variants": { + "formed=false": { + "model": "megacells:block/crafting/monitor" + }, + "formed=true": { + "model": "megacells:block/crafting/monitor_formed" + } + } +} diff --git a/src/main/resources/assets/megacells/lang/en_us.json b/src/main/resources/assets/megacells/lang/en_us.json index 0353518a..b4edaf81 100644 --- a/src/main/resources/assets/megacells/lang/en_us.json +++ b/src/main/resources/assets/megacells/lang/en_us.json @@ -4,6 +4,7 @@ "item.megacells.mega_item_cell_housing": "MEGA Item Cell Housing", "item.megacells.mega_fluid_cell_housing": "MEGA Fluid Cell Housing", "item.megacells.mega_chemical_cell_housing": "MEGA Chemical Cell Housing", + "block.megacells.mega_crafting_unit": "MEGA Crafting Unit", "item.megacells.cell_component_1m": "1M MEGA Storage Component", "item.megacells.cell_component_4m": "4M MEGA Storage Component", @@ -45,5 +46,13 @@ "item.megacells.portable_chemical_cell_4m": "4M Portable Chemical Cell", "item.megacells.portable_chemical_cell_16m": "16M Portable Chemical Cell", "item.megacells.portable_chemical_cell_64m": "64M Portable Chemical Cell", - "item.megacells.portable_chemical_cell_256m": "256M Portable Chemical Cell" + "item.megacells.portable_chemical_cell_256m": "256M Portable Chemical Cell", + + "block.megacells.1m_crafting_storage": "1M MEGA Crafting Storage", + "block.megacells.4m_crafting_storage": "4M MEGA Crafting Storage", + "block.megacells.16m_crafting_storage": "16M MEGA Crafting Storage", + "block.megacells.64m_crafting_storage": "64M MEGA Crafting Storage", + "block.megacells.256m_crafting_storage": "256M MEGA Crafting Storage", + "block.megacells.mega_crafting_accelerator": "MEGA Crafting Co-Processing Unit", + "block.megacells.mega_crafting_monitor": "MEGA Crafting Monitor" } diff --git a/src/main/resources/assets/megacells/models/block/crafting/monitor.json b/src/main/resources/assets/megacells/models/block/crafting/monitor.json new file mode 100644 index 00000000..0499cace --- /dev/null +++ b/src/main/resources/assets/megacells/models/block/crafting/monitor.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "megacells:block/crafting/monitor", + "north": "megacells:block/crafting/monitor", + "east": "megacells:block/crafting/unit", + "west": "megacells:block/crafting/unit", + "south": "megacells:block/crafting/unit", + "up": "megacells:block/crafting/unit", + "down": "megacells:block/crafting/unit" + } +} diff --git a/src/main/resources/assets/megacells/models/item/mega_crafting_monitor.json b/src/main/resources/assets/megacells/models/item/mega_crafting_monitor.json new file mode 100644 index 00000000..956bc18c --- /dev/null +++ b/src/main/resources/assets/megacells/models/item/mega_crafting_monitor.json @@ -0,0 +1,3 @@ +{ + "parent": "megacells:block/crafting/monitor" +} diff --git a/src/main/resources/assets/megacells/textures/block/crafting/16m_storage.png b/src/main/resources/assets/megacells/textures/block/crafting/16m_storage.png new file mode 100644 index 00000000..a17da851 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/16m_storage.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/16m_storage_light.png b/src/main/resources/assets/megacells/textures/block/crafting/16m_storage_light.png new file mode 100644 index 00000000..4641735b Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/16m_storage_light.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/16m_storage_light.png.mcmeta b/src/main/resources/assets/megacells/textures/block/crafting/16m_storage_light.png.mcmeta new file mode 100644 index 00000000..69a97833 --- /dev/null +++ b/src/main/resources/assets/megacells/textures/block/crafting/16m_storage_light.png.mcmeta @@ -0,0 +1,39 @@ +{ + "animation": { + "interpolate": true, + "frames": [ + { + "index": 0, + "time": 90 + }, + { + "index": 1, + "time": 2 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 2 + }, + { + "index": 6, + "time": 2 + }, + { + "index": 7, + "time": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/megacells/textures/block/crafting/1m_storage.png b/src/main/resources/assets/megacells/textures/block/crafting/1m_storage.png new file mode 100644 index 00000000..05af70a0 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/1m_storage.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/1m_storage_light.png b/src/main/resources/assets/megacells/textures/block/crafting/1m_storage_light.png new file mode 100644 index 00000000..a2e250d8 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/1m_storage_light.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/1m_storage_light.png.mcmeta b/src/main/resources/assets/megacells/textures/block/crafting/1m_storage_light.png.mcmeta new file mode 100644 index 00000000..5d93bebe --- /dev/null +++ b/src/main/resources/assets/megacells/textures/block/crafting/1m_storage_light.png.mcmeta @@ -0,0 +1,39 @@ +{ + "animation": { + "interpolate": true, + "frames": [ + { + "index": 0, + "time": 70 + }, + { + "index": 1, + "time": 2 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 2 + }, + { + "index": 6, + "time": 2 + }, + { + "index": 7, + "time": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/megacells/textures/block/crafting/256m_storage.png b/src/main/resources/assets/megacells/textures/block/crafting/256m_storage.png new file mode 100644 index 00000000..068d4d96 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/256m_storage.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/256m_storage_light.png b/src/main/resources/assets/megacells/textures/block/crafting/256m_storage_light.png new file mode 100644 index 00000000..f42ee63d Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/256m_storage_light.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/256m_storage_light.png.mcmeta b/src/main/resources/assets/megacells/textures/block/crafting/256m_storage_light.png.mcmeta new file mode 100644 index 00000000..4c526367 --- /dev/null +++ b/src/main/resources/assets/megacells/textures/block/crafting/256m_storage_light.png.mcmeta @@ -0,0 +1,39 @@ +{ + "animation": { + "interpolate": true, + "frames": [ + { + "index": 0, + "time": 100 + }, + { + "index": 1, + "time": 2 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 2 + }, + { + "index": 6, + "time": 2 + }, + { + "index": 7, + "time": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/megacells/textures/block/crafting/4m_storage.png b/src/main/resources/assets/megacells/textures/block/crafting/4m_storage.png new file mode 100644 index 00000000..eb1fcec4 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/4m_storage.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/4m_storage_light.png b/src/main/resources/assets/megacells/textures/block/crafting/4m_storage_light.png new file mode 100644 index 00000000..91ad16b7 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/4m_storage_light.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/4m_storage_light.png.mcmeta b/src/main/resources/assets/megacells/textures/block/crafting/4m_storage_light.png.mcmeta new file mode 100644 index 00000000..7cdd858b --- /dev/null +++ b/src/main/resources/assets/megacells/textures/block/crafting/4m_storage_light.png.mcmeta @@ -0,0 +1,39 @@ +{ + "animation": { + "interpolate": true, + "frames": [ + { + "index": 0, + "time": 80 + }, + { + "index": 1, + "time": 2 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 2 + }, + { + "index": 6, + "time": 2 + }, + { + "index": 7, + "time": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/megacells/textures/block/crafting/64m_storage.png b/src/main/resources/assets/megacells/textures/block/crafting/64m_storage.png new file mode 100644 index 00000000..08f7ebe1 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/64m_storage.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/64m_storage_light.png b/src/main/resources/assets/megacells/textures/block/crafting/64m_storage_light.png new file mode 100644 index 00000000..27050ffe Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/64m_storage_light.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/64m_storage_light.png.mcmeta b/src/main/resources/assets/megacells/textures/block/crafting/64m_storage_light.png.mcmeta new file mode 100644 index 00000000..4c526367 --- /dev/null +++ b/src/main/resources/assets/megacells/textures/block/crafting/64m_storage_light.png.mcmeta @@ -0,0 +1,39 @@ +{ + "animation": { + "interpolate": true, + "frames": [ + { + "index": 0, + "time": 100 + }, + { + "index": 1, + "time": 2 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 2 + }, + { + "index": 6, + "time": 2 + }, + { + "index": 7, + "time": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/megacells/textures/block/crafting/accelerator.png b/src/main/resources/assets/megacells/textures/block/crafting/accelerator.png new file mode 100644 index 00000000..0dbb25fc Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/accelerator.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/accelerator_light.png b/src/main/resources/assets/megacells/textures/block/crafting/accelerator_light.png new file mode 100644 index 00000000..ce97d9d7 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/accelerator_light.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/light_base.png b/src/main/resources/assets/megacells/textures/block/crafting/light_base.png new file mode 100644 index 00000000..0db713f7 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/light_base.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/monitor.png b/src/main/resources/assets/megacells/textures/block/crafting/monitor.png new file mode 100644 index 00000000..9ad046f9 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/monitor.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/monitor_base.png b/src/main/resources/assets/megacells/textures/block/crafting/monitor_base.png new file mode 100644 index 00000000..b0fd6306 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/monitor_base.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_bright.png b/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_bright.png new file mode 100644 index 00000000..2ffe58e3 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_bright.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_dark.png b/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_dark.png new file mode 100644 index 00000000..33c57bf5 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_dark.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_medium.png b/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_medium.png new file mode 100644 index 00000000..05b71406 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/monitor_light_medium.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/ring_corner.png b/src/main/resources/assets/megacells/textures/block/crafting/ring_corner.png new file mode 100644 index 00000000..8c692e60 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/ring_corner.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/ring_side_hor.png b/src/main/resources/assets/megacells/textures/block/crafting/ring_side_hor.png new file mode 100644 index 00000000..6297f4fd Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/ring_side_hor.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/ring_side_ver.png b/src/main/resources/assets/megacells/textures/block/crafting/ring_side_ver.png new file mode 100644 index 00000000..90deb2fd Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/ring_side_ver.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/unit.png b/src/main/resources/assets/megacells/textures/block/crafting/unit.png new file mode 100644 index 00000000..0f6923f6 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/unit.png differ diff --git a/src/main/resources/assets/megacells/textures/block/crafting/unit_base.png b/src/main/resources/assets/megacells/textures/block/crafting/unit_base.png new file mode 100644 index 00000000..0ff49a99 Binary files /dev/null and b/src/main/resources/assets/megacells/textures/block/crafting/unit_base.png differ diff --git a/src/main/resources/data/megacells/loot_tables/blocks/16m_crafting_storage.json b/src/main/resources/data/megacells/loot_tables/blocks/16m_crafting_storage.json new file mode 100644 index 00000000..eca99bdd --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/16m_crafting_storage.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:16m_crafting_storage" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/1m_crafting_storage.json b/src/main/resources/data/megacells/loot_tables/blocks/1m_crafting_storage.json new file mode 100644 index 00000000..2af49440 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/1m_crafting_storage.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:1m_crafting_storage" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/256m_crafting_storage.json b/src/main/resources/data/megacells/loot_tables/blocks/256m_crafting_storage.json new file mode 100644 index 00000000..e5d1e850 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/256m_crafting_storage.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:256m_crafting_storage" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/4m_crafting_storage.json b/src/main/resources/data/megacells/loot_tables/blocks/4m_crafting_storage.json new file mode 100644 index 00000000..4e1bd005 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/4m_crafting_storage.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:4m_crafting_storage" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/64m_crafting_storage.json b/src/main/resources/data/megacells/loot_tables/blocks/64m_crafting_storage.json new file mode 100644 index 00000000..440c21d8 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/64m_crafting_storage.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:64m_crafting_storage" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_accelerator.json b/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_accelerator.json new file mode 100644 index 00000000..11171c36 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_accelerator.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:mega_crafting_accelerator" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_monitor.json b/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_monitor.json new file mode 100644 index 00000000..7bb06ee0 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_monitor.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:mega_crafting_monitor" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_unit.json b/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_unit.json new file mode 100644 index 00000000..5c8239c0 --- /dev/null +++ b/src/main/resources/data/megacells/loot_tables/blocks/mega_crafting_unit.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "megacells:mega_crafting_unit" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png new file mode 100644 index 00000000..c5c6d38c Binary files /dev/null and b/src/main/resources/logo.png differ