Skip to content

Commit

Permalink
Remove redundant bottle class
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Jul 2, 2024
1 parent a249406 commit 8637bc5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
17 changes: 0 additions & 17 deletions src/main/java/ivorius/psychedelicraft/item/BottleItem.java

This file was deleted.

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

import ivorius.psychedelicraft.entity.MolotovCocktailEntity;
import ivorius.psychedelicraft.fluid.Combustable;
import ivorius.psychedelicraft.fluid.ConsumableFluid.ConsumptionType;
import ivorius.psychedelicraft.fluid.ConsumableFluid;
import ivorius.psychedelicraft.fluid.FluidVolumes;
import ivorius.psychedelicraft.item.component.ItemFluids;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -20,9 +21,9 @@
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;

public class MolotovCocktailItem extends BottleItem {
public class MolotovCocktailItem extends DrinkableItem {
public MolotovCocktailItem(Settings settings) {
super(settings, DrinkableItem.FLUID_PER_DRINKING, ConsumptionType.DRINK);
super(settings, FluidVolumes.BOTTLE, DEFAULT_MAX_USE_TIME, ConsumableFluid.ConsumptionType.DRINK);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ivorius/psychedelicraft/item/PSItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public interface PSItems {
.component(PSComponents.FLUID_CAPACITY, FluidCapacity.create(FluidVolumes.CHALLICE)), FluidVolumes.GULP, DrinkableItem.DEFAULT_MAX_USE_TIME, ConsumableFluid.ConsumptionType.DRINK));
DrinkableItem SHOT_GLASS = register("shot_glass", new DrinkableItem(new Settings()
.component(PSComponents.FLUID_CAPACITY, FluidCapacity.create(FluidVolumes.SHOT)), FluidVolumes.GULP, DrinkableItem.DEFAULT_MAX_USE_TIME / 4, ConsumableFluid.ConsumptionType.DRINK));
DrinkableItem BOTTLE = register("bottle", new BottleItem(new Settings()
DrinkableItem BOTTLE = register("bottle", new DrinkableItem(new Settings()
.component(DataComponentTypes.DYED_COLOR, new DyedColorComponent(Colors.WHITE, true))
.component(PSComponents.FLUID_CAPACITY, FluidCapacity.create(FluidVolumes.BOTTLE)), FluidVolumes.GULP, ConsumableFluid.ConsumptionType.DRINK));
.component(PSComponents.FLUID_CAPACITY, FluidCapacity.create(FluidVolumes.BOTTLE)), FluidVolumes.GULP, DrinkableItem.DEFAULT_MAX_USE_TIME, ConsumableFluid.ConsumptionType.DRINK));
MolotovCocktailItem MOLOTOV_COCKTAIL = register("molotov_cocktail", new MolotovCocktailItem(new Settings()
.component(DataComponentTypes.DYED_COLOR, new DyedColorComponent(Colors.WHITE, true))
.component(PSComponents.FLUID_CAPACITY, FluidCapacity.create(FluidVolumes.BOTTLE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;

import ivorius.psychedelicraft.item.BottleItem;
import ivorius.psychedelicraft.item.PSItems;
import ivorius.psychedelicraft.item.PaperBagItem;
import net.minecraft.item.Item;
import net.minecraft.item.Item.TooltipContext;
Expand Down Expand Up @@ -60,7 +60,7 @@ public static ItemStack withdraw(ItemStack stack, int count) {
}

public static int getMaxCountForItem(Item item) {
if (item instanceof BottleItem) {
if (item == PSItems.BOTTLE || item == PSItems.MOLOTOV_COCKTAIL) {
return 1;
}
return 64 * 1000;
Expand Down

0 comments on commit 8637bc5

Please sign in to comment.