Skip to content

Commit

Permalink
Add Portable Storage Unit (#502)
Browse files Browse the repository at this point in the history
Closes #165.
  • Loading branch information
Azercoco authored Aug 14, 2023
1 parent 5dcb427 commit c8201ca
Show file tree
Hide file tree
Showing 31 changed files with 591 additions and 150 deletions.
1 change: 1 addition & 0 deletions docs/ADDING_MATERIALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ MIMaterialEvents.addMaterials(event => {
// and 8.0 blast resistance (also optional, default is 6.0)
.machineCasing(8.0) // same as above but for machine casings but the custom name and path are optional
.pipeCasing(8.0) // add a pipe casing, only blast resistance can be specified
.battery(5000000) // add a battery with 5M EU capacity for the Portable Storage Unit
.ore({
"generate": true, // does the ore generate in the world
"ore_set": "copper", // texture set, same principle as for blocks (found in "textures/materialsets/ores")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
"item.modern_industrialization.plutonium_tiny_dust": "Plutonium Tiny Dust",
"item.modern_industrialization.polyethylene_bucket": "Polyethylene Bucket",
"item.modern_industrialization.polyvinyl_chloride_bucket": "Polyvinyl Chloride Bucket",
"item.modern_industrialization.portable_storage_unit": "Portable Storage Unit",
"item.modern_industrialization.processing_unit": "Processing Unit",
"item.modern_industrialization.processing_unit_board": "Processing Unit Board",
"item.modern_industrialization.propene_bucket": "Propene Bucket",
Expand Down Expand Up @@ -1464,6 +1465,7 @@
"text.modern_industrialization.BaseEuRecipe": "Recipe Base : %s",
"text.modern_industrialization.BaseEuTotal": "Total : %s",
"text.modern_industrialization.BaseEuTotalStored": "Total Energy Stored : %s",
"text.modern_industrialization.BatteryInStorageUnit": "Insert in a Portable Storage Unit to add %s of capacity",
"text.modern_industrialization.Blacklist": "Blacklist mode enabled",
"text.modern_industrialization.BookSubtitle": "Technology For Newbies",
"text.modern_industrialization.Both": "Both",
Expand Down Expand Up @@ -1525,6 +1527,7 @@
"text.modern_industrialization.EmptyWhitelistWarning": "⚠ Empty Filter",
"text.modern_industrialization.Enabled": "Enabled",
"text.modern_industrialization.EnergyFill": "Energy: %s %%",
"text.modern_industrialization.EnergyStored": "Energy Stored : %s",
"text.modern_industrialization.Eu": "%s%s EU",
"text.modern_industrialization.EuCable": "%s - Max network transfer : %s",
"text.modern_industrialization.EuGenerationMode": "EU Generation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@
"item.modern_industrialization.plutonium_tiny_dust": "작은 플루토늄 가루",
"item.modern_industrialization.polyethylene_bucket": "[UNTRANSLATED] Polyethylene Bucket",
"item.modern_industrialization.polyvinyl_chloride_bucket": "[UNTRANSLATED] Polyvinyl Chloride Bucket",
"item.modern_industrialization.portable_storage_unit": "[UNTRANSLATED] Portable Storage Unit",
"item.modern_industrialization.processing_unit": "처리 유닛",
"item.modern_industrialization.processing_unit_board": "처리 유닛 판",
"item.modern_industrialization.propene_bucket": "[UNTRANSLATED] Propene Bucket",
Expand Down Expand Up @@ -1674,6 +1675,7 @@
"text.modern_industrialization.BaseEuRecipe": "[UNTRANSLATED] Recipe Base : %s",
"text.modern_industrialization.BaseEuTotal": "[UNTRANSLATED] Total : %s",
"text.modern_industrialization.BaseEuTotalStored": "[UNTRANSLATED] Total Energy Stored : %s",
"text.modern_industrialization.BatteryInStorageUnit": "[UNTRANSLATED] Insert in a Portable Storage Unit to add %s of capacity",
"text.modern_industrialization.Blacklist": "[UNTRANSLATED] Blacklist mode enabled",
"text.modern_industrialization.BookSubtitle": "[UNTRANSLATED] Technology For Newbies",
"text.modern_industrialization.Both": "[UNTRANSLATED] Both",
Expand Down Expand Up @@ -1735,6 +1737,7 @@
"text.modern_industrialization.EmptyWhitelistWarning": "[UNTRANSLATED] ⚠ Empty Filter",
"text.modern_industrialization.Enabled": "[UNTRANSLATED] Enabled",
"text.modern_industrialization.EnergyFill": "[UNTRANSLATED] Energy: %s %%",
"text.modern_industrialization.EnergyStored": "[UNTRANSLATED] Energy Stored : %s",
"text.modern_industrialization.Eu": "[UNTRANSLATED] %s%s EU",
"text.modern_industrialization.EuCable": "[UNTRANSLATED] %s - Max network transfer : %s",
"text.modern_industrialization.EuGenerationMode": "[UNTRANSLATED] EU Generation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
"item.modern_industrialization.plutonium_tiny_dust": "Pó Pequeno de Plutônio",
"item.modern_industrialization.polyethylene_bucket": "Balde de Polietileno",
"item.modern_industrialization.polyvinyl_chloride_bucket": "Balde de Policloreto de Vinila",
"item.modern_industrialization.portable_storage_unit": "[UNTRANSLATED] Portable Storage Unit",
"item.modern_industrialization.processing_unit": "Unidade de Processamento",
"item.modern_industrialization.processing_unit_board": "Placa de Unidade de Processamento",
"item.modern_industrialization.propene_bucket": "Balde de Propileno",
Expand Down Expand Up @@ -1466,6 +1467,7 @@
"text.modern_industrialization.BaseEuRecipe": "Receita Base : %s",
"text.modern_industrialization.BaseEuTotal": "Total : %s",
"text.modern_industrialization.BaseEuTotalStored": "Energia Armazenada Total : %s",
"text.modern_industrialization.BatteryInStorageUnit": "[UNTRANSLATED] Insert in a Portable Storage Unit to add %s of capacity",
"text.modern_industrialization.Blacklist": "Modo Lista Negra ativado",
"text.modern_industrialization.BookSubtitle": "Tecnologia para Novatos",
"text.modern_industrialization.Both": "Ambos(as)",
Expand Down Expand Up @@ -1527,6 +1529,7 @@
"text.modern_industrialization.EmptyWhitelistWarning": "⚠ Filtro Vazio",
"text.modern_industrialization.Enabled": "Ativado",
"text.modern_industrialization.EnergyFill": "Energia: %s %%",
"text.modern_industrialization.EnergyStored": "[UNTRANSLATED] Energy Stored : %s",
"text.modern_industrialization.Eu": "%s%s EU",
"text.modern_industrialization.EuCable": "%s - Transferência na Rede : %s",
"text.modern_industrialization.EuGenerationMode": "Geração de EU",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
"item.modern_industrialization.plutonium_tiny_dust": "Плутониевый мельчайший порошок",
"item.modern_industrialization.polyethylene_bucket": "Ведро полиэтилена",
"item.modern_industrialization.polyvinyl_chloride_bucket": "Ведро поливинилхлорида",
"item.modern_industrialization.portable_storage_unit": "[UNTRANSLATED] Portable Storage Unit",
"item.modern_industrialization.processing_unit": "Процессор",
"item.modern_industrialization.processing_unit_board": "Плата для процессора",
"item.modern_industrialization.propene_bucket": "Ведро пропилена",
Expand Down Expand Up @@ -1466,6 +1467,7 @@
"text.modern_industrialization.BaseEuRecipe": "Основа рецепта: %s",
"text.modern_industrialization.BaseEuTotal": "Всего: %s",
"text.modern_industrialization.BaseEuTotalStored": "Хранит суммарной энергии: %s",
"text.modern_industrialization.BatteryInStorageUnit": "[UNTRANSLATED] Insert in a Portable Storage Unit to add %s of capacity",
"text.modern_industrialization.Blacklist": "Включён режим чёрного списка",
"text.modern_industrialization.BookSubtitle": "Технология для начинающих",
"text.modern_industrialization.Both": "Оба",
Expand Down Expand Up @@ -1527,6 +1529,7 @@
"text.modern_industrialization.EmptyWhitelistWarning": "⚠ Пустой фильтр",
"text.modern_industrialization.Enabled": "Включён(а)",
"text.modern_industrialization.EnergyFill": "Энергия: %s %%",
"text.modern_industrialization.EnergyStored": "[UNTRANSLATED] Energy Stored : %s",
"text.modern_industrialization.Eu": "%s%s ЭЕ",
"text.modern_industrialization.EuCable": "%s — Максимальная передача сети: %s",
"text.modern_industrialization.EuGenerationMode": "Генерация ЭЕ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
"item.modern_industrialization.plutonium_tiny_dust": "小堆钚粉",
"item.modern_industrialization.polyethylene_bucket": "[UNTRANSLATED] Polyethylene Bucket",
"item.modern_industrialization.polyvinyl_chloride_bucket": "[UNTRANSLATED] Polyvinyl Chloride Bucket",
"item.modern_industrialization.portable_storage_unit": "[UNTRANSLATED] Portable Storage Unit",
"item.modern_industrialization.processing_unit": "处理单元",
"item.modern_industrialization.processing_unit_board": "处理单元板",
"item.modern_industrialization.propene_bucket": "[UNTRANSLATED] Propene Bucket",
Expand Down Expand Up @@ -1464,6 +1465,7 @@
"text.modern_industrialization.BaseEuRecipe": "[UNTRANSLATED] Recipe Base : %s",
"text.modern_industrialization.BaseEuTotal": "[UNTRANSLATED] Total : %s",
"text.modern_industrialization.BaseEuTotalStored": "[UNTRANSLATED] Total Energy Stored : %s",
"text.modern_industrialization.BatteryInStorageUnit": "[UNTRANSLATED] Insert in a Portable Storage Unit to add %s of capacity",
"text.modern_industrialization.Blacklist": "[UNTRANSLATED] Blacklist mode enabled",
"text.modern_industrialization.BookSubtitle": "[UNTRANSLATED] Technology For Newbies",
"text.modern_industrialization.Both": "[UNTRANSLATED] Both",
Expand Down Expand Up @@ -1525,6 +1527,7 @@
"text.modern_industrialization.EmptyWhitelistWarning": "[UNTRANSLATED] ⚠ Empty Filter",
"text.modern_industrialization.Enabled": "[UNTRANSLATED] Enabled",
"text.modern_industrialization.EnergyFill": "[UNTRANSLATED] Energy: %s %%",
"text.modern_industrialization.EnergyStored": "[UNTRANSLATED] Energy Stored : %s",
"text.modern_industrialization.Eu": "[UNTRANSLATED] %s%s EU",
"text.modern_industrialization.EuCable": "[UNTRANSLATED] %s - Max network transfer : %s",
"text.modern_industrialization.EuGenerationMode": "[UNTRANSLATED] EU Generation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@
"item.modern_industrialization.plutonium_tiny_dust": "[UNTRANSLATED] Plutonium Tiny Dust",
"item.modern_industrialization.polyethylene_bucket": "[UNTRANSLATED] Polyethylene Bucket",
"item.modern_industrialization.polyvinyl_chloride_bucket": "[UNTRANSLATED] Polyvinyl Chloride Bucket",
"item.modern_industrialization.portable_storage_unit": "[UNTRANSLATED] Portable Storage Unit",
"item.modern_industrialization.processing_unit": "[UNTRANSLATED] Processing Unit",
"item.modern_industrialization.processing_unit_board": "[UNTRANSLATED] Processing Unit Board",
"item.modern_industrialization.propene_bucket": "[UNTRANSLATED] Propene Bucket",
Expand Down Expand Up @@ -1671,6 +1672,7 @@
"text.modern_industrialization.BaseEuRecipe": "[UNTRANSLATED] Recipe Base : %s",
"text.modern_industrialization.BaseEuTotal": "[UNTRANSLATED] Total : %s",
"text.modern_industrialization.BaseEuTotalStored": "[UNTRANSLATED] Total Energy Stored : %s",
"text.modern_industrialization.BatteryInStorageUnit": "[UNTRANSLATED] Insert in a Portable Storage Unit to add %s of capacity",
"text.modern_industrialization.Blacklist": "[UNTRANSLATED] Blacklist mode enabled",
"text.modern_industrialization.BookSubtitle": "[UNTRANSLATED] Technology For Newbies",
"text.modern_industrialization.Both": "[UNTRANSLATED] Both",
Expand Down Expand Up @@ -1732,6 +1734,7 @@
"text.modern_industrialization.EmptyWhitelistWarning": "[UNTRANSLATED] ⚠ Empty Filter",
"text.modern_industrialization.Enabled": "[UNTRANSLATED] Enabled",
"text.modern_industrialization.EnergyFill": "[UNTRANSLATED] Energy: %s %%",
"text.modern_industrialization.EnergyStored": "[UNTRANSLATED] Energy Stored : %s",
"text.modern_industrialization.Eu": "[UNTRANSLATED] %s%s EU",
"text.modern_industrialization.EuCable": "[UNTRANSLATED] %s - Max network transfer : %s",
"text.modern_industrialization.EuGenerationMode": "[UNTRANSLATED] EU Generation",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "modern_industrialization:item/portable_storage_unit"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"type": "modern_industrialization:assembler",
"duration": 200,
"eu": 8,
"item_inputs": [
{
"amount": 4,
"tag": "c:battery_alloy_plates"
},
{
"amount": 2,
"item": "modern_industrialization:battery_alloy_curved_plate"
},
{
"amount": 2,
"item": "modern_industrialization:tin_cable"
},
{
"amount": 1,
"item": "modern_industrialization:analog_circuit"
}
],
"item_outputs": [
{
"amount": 1,
"item": "modern_industrialization:portable_storage_unit"
}
]
}
12 changes: 6 additions & 6 deletions src/main/java/aztech/modern_industrialization/MIItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@

import static aztech.modern_industrialization.items.SortOrder.*;

import aztech.modern_industrialization.api.energy.EnergyApi;
import aztech.modern_industrialization.definition.ItemDefinition;
import aztech.modern_industrialization.items.ConfigCardItem;
import aztech.modern_industrialization.items.FluidFuelItemHelper;
import aztech.modern_industrialization.items.ForgeTool;
import aztech.modern_industrialization.items.GuideBookItem;
import aztech.modern_industrialization.items.SortOrder;
import aztech.modern_industrialization.items.SteamDrillItem;
import aztech.modern_industrialization.items.*;
import aztech.modern_industrialization.items.armor.GraviChestPlateItem;
import aztech.modern_industrialization.items.armor.JetpackItem;
import aztech.modern_industrialization.items.armor.QuantumArmorItem;
Expand All @@ -53,6 +49,7 @@
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.*;
import team.reborn.energy.api.base.SimpleEnergyItem;

@SuppressWarnings("unused")
public final class MIItem {
Expand Down Expand Up @@ -149,6 +146,9 @@ public final class MIItem {
public static final ItemDefinition<DieselToolItem> DIESEL_CHAINSAW = itemHandheld("Diesel Chainsaw", "diesel_chainsaw", p -> new DieselToolItem(p, 12))
.withItemRegistrationEvent((item) -> FluidStorage.ITEM.registerForItems((stack, ctx) -> new FluidFuelItemHelper.ItemStorage(DieselToolItem.CAPACITY, ctx), item));

public static final ItemDefinition<PortableStorageUnit> PORTABLE_STORAGE_UNIT = itemHandheld("Portable Storage Unit", "portable_storage_unit", PortableStorageUnit::new)
.withItemRegistrationEvent(item -> EnergyApi.ITEM.registerForItems((stack, ctx) -> SimpleEnergyItem.createStorage(ctx, item.getEnergyCapacity(stack), item.getEnergyMaxInput(stack), item.getEnergyMaxOutput(stack)), item));

// Armor
public static final ItemDefinition<ArmorItem> RUBBER_HELMET = item("Rubber Helmet", "rubber_helmet", s -> new ArmorItem(RubberArmorMaterial.INSTANCE, EquipmentSlot.HEAD, s.maxCount(1)), ITEMS_OTHER);
public static final ItemDefinition<ArmorItem> RUBBER_BOOTS = item("Rubber Boots", "rubber_boots", s -> new ArmorItem(RubberArmorMaterial.INSTANCE, EquipmentSlot.FEET, s.maxCount(1)), ITEMS_OTHER);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/aztech/modern_industrialization/MIText.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public enum MIText {
BaseEuRecipe("Recipe Base : %s"),
BaseEuTotal("Total : %s"),
BaseEuTotalStored("Total Energy Stored : %s"),
BatteryInStorageUnit("Insert in a Portable Storage Unit to add %s of capacity"),
Blacklist("Blacklist mode enabled"),
BookSubtitle("Technology For Newbies"),
Both("Both"),
Expand Down Expand Up @@ -113,6 +114,7 @@ public enum MIText {
EmptyWhitelistWarning("⚠ Empty Filter"),
Enabled("Enabled"),
EnergyFill("Energy: %s %%"),
EnergyStored("Energy Stored : %s"),
Eu("%s%s EU"),
EuCable("%s - Max network transfer : %s"),
EuGenerationMode("EU Generation"),
Expand Down
Loading

0 comments on commit c8201ca

Please sign in to comment.