From 3506e661b10181ac029c60dbb563ee60af4c2fdf Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 29 Aug 2021 16:49:02 +0700 Subject: [PATCH] Add second variant of condensation drive --- src/main/java/ru/dbotthepony/mc/otm/Registry.java | 6 +++++- .../mc/otm/item/ItemPortableCondensationDrive.java | 11 +++++++---- .../assets/overdrive_that_matters/lang/en_us.json | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/ru/dbotthepony/mc/otm/Registry.java b/src/main/java/ru/dbotthepony/mc/otm/Registry.java index 0cd89a339..8c6daa5fd 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/Registry.java +++ b/src/main/java/ru/dbotthepony/mc/otm/Registry.java @@ -112,6 +112,7 @@ public class Registry { public static final ResourceLocation NUTRIENT_PASTE = new ResourceLocation(OverdriveThatMatters.MOD_ID, "nutrient_paste"); public static final ResourceLocation PORTABLE_CONDENSATION_DRIVE = new ResourceLocation(OverdriveThatMatters.MOD_ID, "portable_condensation_drive"); + public static final ResourceLocation PORTABLE_DENSE_CONDENSATION_DRIVE = new ResourceLocation(OverdriveThatMatters.MOD_ID, "portable_dense_condensation_drive"); // android features and research public static final ResourceLocation AIR_BAGS = new ResourceLocation(OverdriveThatMatters.MOD_ID, "air_bags"); @@ -238,7 +239,8 @@ public class Registry { public static final ItemPatternStorage PATTERN_DRIVE_NORMAL = new ItemPatternStorage(4); public static final ItemPatternStorage PATTERN_DRIVE_CREATIVE = new ItemPatternStorage(); - public static final ItemPortableCondensationDrive PORTABLE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(); + public static final ItemPortableCondensationDrive PORTABLE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(4000); + public static final ItemPortableCondensationDrive PORTABLE_DENSE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(25000); public static final Item NUTRIENT_PASTE = new Item(new Item.Properties().stacksTo(64).food(new FoodProperties.Builder().meat().nutrition(8).saturationMod(0.9F).build()).tab(OverdriveThatMatters.CREATIVE_TAB)); @@ -270,6 +272,7 @@ public class Registry { PATTERN_DRIVE_NORMAL.setRegistryName(Names.PATTERN_DRIVE_NORMAL); PATTERN_DRIVE_CREATIVE.setRegistryName(Names.PATTERN_DRIVE_CREATIVE); PORTABLE_CONDENSATION_DRIVE.setRegistryName(Names.PORTABLE_CONDENSATION_DRIVE); + PORTABLE_DENSE_CONDENSATION_DRIVE.setRegistryName(Names.PORTABLE_DENSE_CONDENSATION_DRIVE); NUTRIENT_PASTE.setRegistryName(Names.NUTRIENT_PASTE); } @@ -303,6 +306,7 @@ public class Registry { event.getRegistry().register(PATTERN_DRIVE_NORMAL); event.getRegistry().register(PATTERN_DRIVE_CREATIVE); event.getRegistry().register(PORTABLE_CONDENSATION_DRIVE); + event.getRegistry().register(PORTABLE_DENSE_CONDENSATION_DRIVE); event.getRegistry().register(NUTRIENT_PASTE); diff --git a/src/main/java/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.java b/src/main/java/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.java index 42579bf01..934b43f5e 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.java +++ b/src/main/java/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.java @@ -47,8 +47,11 @@ import java.util.UUID; import java.util.function.Supplier; public class ItemPortableCondensationDrive extends Item { - public ItemPortableCondensationDrive() { + public final int capacity; + + public ItemPortableCondensationDrive(int capacity) { super(new Properties().stacksTo(1).tab(OverdriveThatMatters.CREATIVE_TAB)); + this.capacity = capacity; } @SubscribeEvent @@ -109,15 +112,15 @@ public class ItemPortableCondensationDrive extends Item { } } - private static class DriveCapability implements ICapabilityProvider { + private class DriveCapability implements ICapabilityProvider { private UUID uuid; private final ItemStack stack; private final LazyOptional resolver = LazyOptional.of(() -> { return DrivePool.get(uuid, (tag) -> { - var drive = new MatteryDrive(4000); + var drive = new MatteryDrive(capacity); drive.deserializeNBT(tag); return drive; - }, () -> new MatteryDrive(4000)); + }, () -> new MatteryDrive(capacity)); }); DriveCapability(ItemStack stack) { diff --git a/src/main/resources/assets/overdrive_that_matters/lang/en_us.json b/src/main/resources/assets/overdrive_that_matters/lang/en_us.json index d117a20a4..70bd836b3 100644 --- a/src/main/resources/assets/overdrive_that_matters/lang/en_us.json +++ b/src/main/resources/assets/overdrive_that_matters/lang/en_us.json @@ -138,7 +138,8 @@ "item.overdrive_that_matters.pill_android": "Android pill", "item.overdrive_that_matters.pill_humane": "Humane pill", - "item.overdrive_that_matters.portable_condensation_drive": "Portable condensation drive", + "item.overdrive_that_matters.portable_condensation_drive": "Portable Condensation drive", + "item.overdrive_that_matters.portable_dense_condensation_drive": "Portable Dense Condensation drive", "item.overdrive_that_matters.nutrient_paste": "Nutrient paste",