diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java b/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java index 7da6ad2..3c5afbc 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java @@ -2,20 +2,22 @@ import com.megatrex4.ukrainian_dlight.block.DrinkBottleBlock; import com.megatrex4.ukrainian_dlight.block.FoodJarBlocks; -import com.megatrex4.ukrainian_dlight.block.ModBlocks; +import com.megatrex4.ukrainian_dlight.registry.BlockRegistry; import com.megatrex4.ukrainian_dlight.block.entity.ModBlockEntities; //import com.megatrex4.ukrainian_dlight.compat.patchouli.CustomBrewingRecipeProcessor; import com.megatrex4.ukrainian_dlight.config.ModConfig; -import com.megatrex4.ukrainian_dlight.initialize.CustomizeLootTables; +import com.megatrex4.ukrainian_dlight.registry.initialize.CustomizeLootTables; import com.megatrex4.ukrainian_dlight.item.ModItemGroups; -import com.megatrex4.ukrainian_dlight.item.ModItems; +import com.megatrex4.ukrainian_dlight.registry.ItemsRegistry; import com.megatrex4.ukrainian_dlight.item.ToolTipHelper; import com.megatrex4.ukrainian_dlight.networking.ModMessages; -import com.megatrex4.ukrainian_dlight.recipe.ModRecipes; -import com.megatrex4.ukrainian_dlight.screen.ModScreenHandlers; -import com.megatrex4.ukrainian_dlight.screen.ModScreens; +import com.megatrex4.ukrainian_dlight.registry.RecipesRegistry; +import com.megatrex4.ukrainian_dlight.registry.ScreenHandlersRegistry; +import com.megatrex4.ukrainian_dlight.registry.ScreensRegistry; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; import net.minecraft.entity.damage.DamageType; +import net.minecraft.item.ItemConvertible; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.text.MutableText; @@ -41,15 +43,15 @@ public static MutableText i18n(String key, Object... args) { public void onInitialize() { FoodJarBlocks.registerFoodBlocks(); DrinkBottleBlock.registerDrinkBlock(); - ModBlocks.registerModBlocks(); - ModItems.registerModItems(); + BlockRegistry.registerModBlocks(); + ItemsRegistry.registerModItems(); ModItemGroups.registerItemGroups(); ToolTipHelper.registerTooltip(); ModBlockEntities.registerBlockEntities(); - ModScreenHandlers.registerModScreenHandlers(); + ScreenHandlersRegistry.registerModScreenHandlers(); ModMessages.registerS2CPackets(); - ModRecipes.registerRecipes(); - ModScreens.registerScreens(); + RecipesRegistry.registerRecipes(); + ScreensRegistry.registerScreens(); ModConfig.loadConfig(); CustomizeLootTables.register(); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDeligthClient.java b/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDeligthClient.java index 07b6b56..709fdb0 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDeligthClient.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDeligthClient.java @@ -1,18 +1,14 @@ package com.megatrex4.ukrainian_dlight; import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreen; -import com.megatrex4.ukrainian_dlight.screen.ModScreenHandlers; +import com.megatrex4.ukrainian_dlight.registry.ScreenHandlersRegistry; import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; -import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; -import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; import net.minecraft.client.gui.screen.ingame.HandledScreens; -import net.minecraft.client.render.RenderLayer; public class UkrainianDeligthClient implements ClientModInitializer { @Override public void onInitializeClient() { - HandledScreens.register(ModScreenHandlers.BREWING_KEG_SCREEN_HANDLER, BrewingKegScreen::new); + HandledScreens.register(ScreenHandlersRegistry.BREWING_KEG_SCREEN_HANDLER, BrewingKegScreen::new); } } diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BottleBlock.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/BottleBlock.java similarity index 99% rename from src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BottleBlock.java rename to src/main/java/com/megatrex4/ukrainian_dlight/block/BottleBlock.java index 7a5576f..eaea653 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BottleBlock.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/BottleBlock.java @@ -1,4 +1,4 @@ -package com.megatrex4.ukrainian_dlight.block.custom; +package com.megatrex4.ukrainian_dlight.block; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/BrewingKegBlock.java similarity index 96% rename from src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java rename to src/main/java/com/megatrex4/ukrainian_dlight/block/BrewingKegBlock.java index 7fee69a..c979d77 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/BrewingKegBlock.java @@ -1,10 +1,9 @@ -package com.megatrex4.ukrainian_dlight.block.custom; +package com.megatrex4.ukrainian_dlight.block; import com.megatrex4.ukrainian_dlight.UkrainianDelight; import com.megatrex4.ukrainian_dlight.block.entity.BrewingKegBlockEntity; import com.megatrex4.ukrainian_dlight.block.entity.ModBlockEntities; import com.megatrex4.ukrainian_dlight.screen.renderer.FluidStackRenderer; -import com.megatrex4.ukrainian_dlight.util.CompoundTagUtils; import com.megatrex4.ukrainian_dlight.util.FluidStack; import net.fabricmc.api.EnvType; @@ -18,39 +17,30 @@ import net.minecraft.entity.ItemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.FluidState; -import net.minecraft.fluid.Fluids; -import net.minecraft.inventory.Inventories; import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtElement; import net.minecraft.particle.ParticleTypes; -import net.minecraft.registry.Registries; import net.minecraft.screen.NamedScreenHandlerFactory; -import net.minecraft.screen.ScreenHandler; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.state.property.DirectionProperty; -import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.Properties; -import net.minecraft.state.property.Property; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.*; -import net.minecraft.util.collection.DefaultedList; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import java.util.Iterator; import java.util.List; public class BrewingKegBlock extends BlockWithEntity implements BlockEntityProvider { diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlockItem.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/BrewingKegBlockItem.java similarity index 97% rename from src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlockItem.java rename to src/main/java/com/megatrex4/ukrainian_dlight/block/BrewingKegBlockItem.java index 565ba3f..a372088 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlockItem.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/BrewingKegBlockItem.java @@ -1,4 +1,4 @@ -package com.megatrex4.ukrainian_dlight.block.custom; +package com.megatrex4.ukrainian_dlight.block; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/DrinkBottleBlock.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/DrinkBottleBlock.java index 3f884da..ee12ab0 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/DrinkBottleBlock.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/DrinkBottleBlock.java @@ -1,7 +1,6 @@ package com.megatrex4.ukrainian_dlight.block; import com.megatrex4.ukrainian_dlight.UkrainianDelight; -import com.megatrex4.ukrainian_dlight.block.custom.BottleBlock; import com.megatrex4.ukrainian_dlight.item.DrinkBlockItem; import net.minecraft.block.Block; import net.minecraft.entity.effect.StatusEffectInstance; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/FoodJarBlocks.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/FoodJarBlocks.java index daa43f7..0b35de5 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/FoodJarBlocks.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/FoodJarBlocks.java @@ -1,7 +1,6 @@ package com.megatrex4.ukrainian_dlight.block; import com.megatrex4.ukrainian_dlight.UkrainianDelight; -import com.megatrex4.ukrainian_dlight.block.custom.JarBlock; import com.megatrex4.ukrainian_dlight.item.FoodBlockItem; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/JarBlock.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/JarBlock.java similarity index 99% rename from src/main/java/com/megatrex4/ukrainian_dlight/block/custom/JarBlock.java rename to src/main/java/com/megatrex4/ukrainian_dlight/block/JarBlock.java index 64adaa2..1fcbc55 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/JarBlock.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/JarBlock.java @@ -1,4 +1,4 @@ -package com.megatrex4.ukrainian_dlight.block.custom; +package com.megatrex4.ukrainian_dlight.block; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/SaltBlock.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/SaltBlock.java similarity index 95% rename from src/main/java/com/megatrex4/ukrainian_dlight/block/custom/SaltBlock.java rename to src/main/java/com/megatrex4/ukrainian_dlight/block/SaltBlock.java index 5ecb7f5..9d40a44 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/SaltBlock.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/SaltBlock.java @@ -1,4 +1,4 @@ -package com.megatrex4.ukrainian_dlight.block.custom; +package com.megatrex4.ukrainian_dlight.block; import net.minecraft.block.Block; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java index a700b21..e54e58c 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java @@ -1,12 +1,10 @@ package com.megatrex4.ukrainian_dlight.block.entity; -import com.megatrex4.ukrainian_dlight.block.custom.BrewingKegBlock; import com.megatrex4.ukrainian_dlight.block.entity.inventory.ImplementedInventory; import com.megatrex4.ukrainian_dlight.config.ModConfig; import com.megatrex4.ukrainian_dlight.networking.ModMessages; import com.megatrex4.ukrainian_dlight.recipe.BrewingRecipe; -import com.megatrex4.ukrainian_dlight.recipe.ModRecipes; -import com.megatrex4.ukrainian_dlight.registry.ModTags; +import com.megatrex4.ukrainian_dlight.registry.RecipesRegistry; import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreenHandler; import com.megatrex4.ukrainian_dlight.util.CompoundTagUtils; import com.megatrex4.ukrainian_dlight.util.FluidStack; @@ -18,7 +16,6 @@ import net.fabricmc.fabric.api.networking.v1.PlayerLookup; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; -import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleVariantStorage; import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; @@ -31,7 +28,6 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.fluid.Fluids; import net.minecraft.inventory.Inventories; -import net.minecraft.item.Item; import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -39,8 +35,6 @@ import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.RecipeType; -import net.minecraft.registry.tag.ItemTags; import net.minecraft.screen.PropertyDelegate; import net.minecraft.screen.ScreenHandler; import net.minecraft.server.network.ServerPlayerEntity; @@ -53,13 +47,10 @@ import net.minecraft.util.math.*; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import vectorwing.farmersdelight.common.crafting.CookingPotRecipe; -import vectorwing.farmersdelight.common.mixin.accessor.RecipeManagerAccessor; -import vectorwing.farmersdelight.common.registry.ModRecipeTypes; import java.util.*; -import static com.megatrex4.ukrainian_dlight.block.custom.BrewingKegBlock.FACING; +import static com.megatrex4.ukrainian_dlight.block.BrewingKegBlock.FACING; public class BrewingKegBlockEntity extends BlockEntity implements ExtendedScreenHandlerFactory, ImplementedInventory { private final DefaultedList inventory = DefaultedList.ofSize(INVENTORY_SIZE, ItemStack.EMPTY); @@ -570,7 +561,7 @@ public void setFluidLevel(FluidVariant fluidVariant, long fluidLevel) { private Optional getCurrentRecipe() { if (world == null) return Optional.empty(); - return world.getRecipeManager().getFirstMatch(ModRecipes.BREWING, this, world); + return world.getRecipeManager().getFirstMatch(RecipesRegistry.BREWING, this, world); } public boolean isContainerValid(ItemStack containerItem) { diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/ModBlockEntities.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/ModBlockEntities.java index ed68523..c677b72 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/ModBlockEntities.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/ModBlockEntities.java @@ -2,7 +2,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; import com.megatrex4.ukrainian_dlight.UkrainianDelight; -import com.megatrex4.ukrainian_dlight.block.ModBlocks; +import com.megatrex4.ukrainian_dlight.registry.BlockRegistry; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.registry.Registries; @@ -15,7 +15,7 @@ public static void registerBlockEntities() { BREWING_KEG_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, new Identifier(UkrainianDelight.MOD_ID, "brewing_keg_be"), FabricBlockEntityTypeBuilder.create(BrewingKegBlockEntity::new, - ModBlocks.BREWING_KEG).build(null)); + BlockRegistry.BREWING_KEG).build(null)); FluidStorage.SIDED.registerForBlockEntity((blockEntity, direction) -> blockEntity.fluidStorage, BREWING_KEG_BLOCK_ENTITY); UkrainianDelight.LOGGER.info("Registering Mod Block Entities for " + UkrainianDelight.MOD_ID); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/features/Features.java b/src/main/java/com/megatrex4/ukrainian_dlight/gen/features/Features.java similarity index 76% rename from src/main/java/com/megatrex4/ukrainian_dlight/features/Features.java rename to src/main/java/com/megatrex4/ukrainian_dlight/gen/features/Features.java index df782ec..aa4d82b 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/features/Features.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/gen/features/Features.java @@ -1,8 +1,8 @@ -package com.megatrex4.ukrainian_dlight.features; +package com.megatrex4.ukrainian_dlight.gen.features; import com.megatrex4.ukrainian_dlight.UkrainianDelight; -import com.megatrex4.ukrainian_dlight.features.features.SaltCavesFeature; -import com.megatrex4.ukrainian_dlight.features.features.config.SaltCavesFeatureConfig; +import com.megatrex4.ukrainian_dlight.gen.features.features.SaltCavesFeature; +import com.megatrex4.ukrainian_dlight.gen.features.features.config.SaltCavesFeatureConfig; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.world.gen.feature.Feature; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/features/features/SaltCavesFeature.java b/src/main/java/com/megatrex4/ukrainian_dlight/gen/features/features/SaltCavesFeature.java similarity index 96% rename from src/main/java/com/megatrex4/ukrainian_dlight/features/features/SaltCavesFeature.java rename to src/main/java/com/megatrex4/ukrainian_dlight/gen/features/features/SaltCavesFeature.java index 33567c0..c76f35a 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/features/features/SaltCavesFeature.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/gen/features/features/SaltCavesFeature.java @@ -1,7 +1,7 @@ -package com.megatrex4.ukrainian_dlight.features.features; +package com.megatrex4.ukrainian_dlight.gen.features.features; -import com.megatrex4.ukrainian_dlight.features.features.config.SaltCavesFeatureConfig; +import com.megatrex4.ukrainian_dlight.gen.features.features.config.SaltCavesFeatureConfig; import com.mojang.serialization.Codec; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/features/features/config/SaltCavesFeatureConfig.java b/src/main/java/com/megatrex4/ukrainian_dlight/gen/features/features/config/SaltCavesFeatureConfig.java similarity index 94% rename from src/main/java/com/megatrex4/ukrainian_dlight/features/features/config/SaltCavesFeatureConfig.java rename to src/main/java/com/megatrex4/ukrainian_dlight/gen/features/features/config/SaltCavesFeatureConfig.java index 2c37132..e16d250 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/features/features/config/SaltCavesFeatureConfig.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/gen/features/features/config/SaltCavesFeatureConfig.java @@ -1,4 +1,4 @@ -package com.megatrex4.ukrainian_dlight.features.features.config; +package com.megatrex4.ukrainian_dlight.gen.features.features.config; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/item/DrinkBlockItem.java b/src/main/java/com/megatrex4/ukrainian_dlight/item/DrinkBlockItem.java index 78abd36..baa4c6c 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/item/DrinkBlockItem.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/item/DrinkBlockItem.java @@ -1,7 +1,7 @@ package com.megatrex4.ukrainian_dlight.item; import com.megatrex4.ukrainian_dlight.UkrainianDelight; -import com.megatrex4.ukrainian_dlight.registry.ModTags; +import com.megatrex4.ukrainian_dlight.registry.TagsRegistry; import com.megatrex4.ukrainian_dlight.util.StatusEffectUtil; import com.mojang.datafixers.util.Pair; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; @@ -22,12 +22,10 @@ import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.util.UseAction; -import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.TimeUnit; public class DrinkBlockItem extends BlockItem { private final FoodComponent foodComponent; @@ -155,13 +153,13 @@ public void appendTooltip(ItemStack stack, World world, List tooltip, Tool } // Check if the item is in the drink tags and add corresponding tooltip - if (stack.isIn(ModTags.LIGHT_DRINK)) { + if (stack.isIn(TagsRegistry.LIGHT_DRINK)) { tooltip.add(Text.literal("").formatted(Formatting.GRAY)); tooltip.add(UkrainianDelight.i18n("tooltip.light_drink").formatted(Formatting.GREEN)); - } else if (stack.isIn(ModTags.MID_DRINK)) { + } else if (stack.isIn(TagsRegistry.MID_DRINK)) { tooltip.add(Text.literal("").formatted(Formatting.GRAY)); tooltip.add(UkrainianDelight.i18n("tooltip.mid_drink").formatted(Formatting.YELLOW)); - } else if (stack.isIn(ModTags.STRONG_DRINK)) { + } else if (stack.isIn(TagsRegistry.STRONG_DRINK)) { tooltip.add(Text.literal("").formatted(Formatting.GRAY)); tooltip.add(UkrainianDelight.i18n("tooltip.strong_drink").formatted(Formatting.RED)); } diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/item/ItemBuilder.java b/src/main/java/com/megatrex4/ukrainian_dlight/item/FoodItemBuilder.java similarity index 78% rename from src/main/java/com/megatrex4/ukrainian_dlight/item/ItemBuilder.java rename to src/main/java/com/megatrex4/ukrainian_dlight/item/FoodItemBuilder.java index d5685d5..0f3a492 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/item/ItemBuilder.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/item/FoodItemBuilder.java @@ -4,27 +4,27 @@ import net.minecraft.item.FoodComponent; import net.minecraft.item.Item; -public class ItemBuilder { +public class FoodItemBuilder { private FoodComponent foodComponent; private int maxCount = 64; private Boolean returnsBowl = false; - public ItemBuilder food(FoodComponent foodComponent) { + public FoodItemBuilder food(FoodComponent foodComponent) { this.foodComponent = foodComponent; return this; } - public ItemBuilder maxCount(int maxCount) { + public FoodItemBuilder maxCount(int maxCount) { this.maxCount = maxCount; return this; } - public ItemBuilder returnsBowl() { + public FoodItemBuilder returnsBowl() { this.returnsBowl = true; return this; } - public ItemBuilder returnsBowl(boolean returnsBowl) { + public FoodItemBuilder returnsBowl(boolean returnsBowl) { this.returnsBowl = returnsBowl; return this; } diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/item/KrashankyItem.java b/src/main/java/com/megatrex4/ukrainian_dlight/item/KrashankyItem.java new file mode 100644 index 0000000..8d3f3de --- /dev/null +++ b/src/main/java/com/megatrex4/ukrainian_dlight/item/KrashankyItem.java @@ -0,0 +1,15 @@ +package com.megatrex4.ukrainian_dlight.item; + +import net.minecraft.client.item.TooltipContext; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.text.Text; +import net.minecraft.world.World; + +import java.util.List; + +public class KrashankyItem extends Item { + public KrashankyItem(Settings settings) { + super(settings); + } +} diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/item/ModItemGroups.java b/src/main/java/com/megatrex4/ukrainian_dlight/item/ModItemGroups.java index d5261fc..cfdf924 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/item/ModItemGroups.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/item/ModItemGroups.java @@ -3,7 +3,8 @@ import com.megatrex4.ukrainian_dlight.UkrainianDelight; import com.megatrex4.ukrainian_dlight.block.DrinkBottleBlock; import com.megatrex4.ukrainian_dlight.block.FoodJarBlocks; -import com.megatrex4.ukrainian_dlight.block.ModBlocks; +import com.megatrex4.ukrainian_dlight.registry.BlockRegistry; +import com.megatrex4.ukrainian_dlight.registry.ItemsRegistry; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; @@ -17,59 +18,59 @@ public class ModItemGroups { new Identifier(UkrainianDelight.MOD_ID, "meals_ukrainian_delight"), FabricItemGroup.builder() .displayName(Text.translatable("itemgroup.meals_ukrainian_delight")) - .icon(() -> new ItemStack(ModItems.BORSCHT)) + .icon(() -> new ItemStack(ItemsRegistry.BORSCHT)) .entries((displayContext, entries) -> { - entries.add(ModItems.BORSCHT); - entries.add(ModItems.LEAN_BORSCHT); - entries.add(ModItems.HOMEMADE_SAUSAGE); - entries.add(ModItems.VARENYK); + entries.add(ItemsRegistry.BORSCHT); + entries.add(ItemsRegistry.LEAN_BORSCHT); + entries.add(ItemsRegistry.HOMEMADE_SAUSAGE); + entries.add(ItemsRegistry.VARENYK); }).build()); public static final ItemGroup INGREDIENT_UKRAINIAN_DELIGHT = Registry.register(Registries.ITEM_GROUP, new Identifier(UkrainianDelight.MOD_ID, "ingredients_ukrainian_delight"), FabricItemGroup.builder() .displayName(Text.translatable("itemgroup.ingredients_ukrainian_delight")) - .icon(() -> new ItemStack(ModItems.CUCUMBER)) + .icon(() -> new ItemStack(ItemsRegistry.CUCUMBER)) .entries((displayContext, entries) -> { - entries.add(ModBlocks.BREWING_KEG); - entries.add(ModBlocks.SALT_BAG); - entries.add(ModBlocks.SALT_BLOCK); - entries.add(ModItems.SALT); + entries.add(BlockRegistry.BREWING_KEG); + entries.add(BlockRegistry.SALT_BAG); + entries.add(BlockRegistry.SALT_BLOCK); + entries.add(ItemsRegistry.SALT); - entries.add(ModItems.HORSERADISH); - entries.add(ModBlocks.CUCUMBER_CRATE); - entries.add(ModItems.CUCUMBER); - entries.add(ModItems.CUTTED_CUCUMBER); - entries.add(ModItems.APPLE_SLICE); - entries.add(ModItems.DRIED_APPLE_SLICE); - entries.add(ModItems.CHERRY_BERRY); - entries.add(ModItems.COTTAGE_CHEESE); - entries.add(ModItems.SALO); - entries.add(ModItems.YEAST); + entries.add(ItemsRegistry.HORSERADISH); + entries.add(BlockRegistry.CUCUMBER_CRATE); + entries.add(ItemsRegistry.CUCUMBER); + entries.add(ItemsRegistry.CUTTED_CUCUMBER); + entries.add(ItemsRegistry.APPLE_SLICE); + entries.add(ItemsRegistry.DRIED_APPLE_SLICE); + entries.add(ItemsRegistry.CHERRY_BERRY); + entries.add(ItemsRegistry.COTTAGE_CHEESE); + entries.add(ItemsRegistry.SALO); + entries.add(ItemsRegistry.YEAST); }).build()); public static final ItemGroup KRASHANKY_UKRAINIAN_DELIGHT = Registry.register(Registries.ITEM_GROUP, new Identifier(UkrainianDelight.MOD_ID, "krashanky_ukrainian_delight"), FabricItemGroup.builder() .displayName(Text.translatable("itemgroup.krashanky_ukrainian_delight")) - .icon(() -> new ItemStack(ModItems.APPLE_SLICE)) + .icon(() -> new ItemStack(ItemsRegistry.APPLE_SLICE)) .entries((displayContext, entries) -> { - entries.add(ModItems.BLACK_KRASHANKA); - entries.add(ModItems.BLUE_KRASHANKA); - entries.add(ModItems.BROWN_KRASHANKA); - entries.add(ModItems.CYAN_KRASHANKA); - entries.add(ModItems.GRAY_KRASHANKA); - entries.add(ModItems.GREEN_KRASHANKA); - entries.add(ModItems.LIGHT_BLUE_KRASHANKA); - entries.add(ModItems.LIGHT_GRAY_KRASHANKA); - entries.add(ModItems.LIME_KRASHANKA); - entries.add(ModItems.MAGENTA_KRASHANKA); - entries.add(ModItems.ORANGE_KRASHANKA); - entries.add(ModItems.PINK_KRASHANKA); - entries.add(ModItems.PURPLE_KRASHANKA); - entries.add(ModItems.RED_KRASHANKA); - entries.add(ModItems.WHITE_KRASHANKA); - entries.add(ModItems.YELLOW_KRASHANKA); + entries.add(ItemsRegistry.BLACK_KRASHANKA); + entries.add(ItemsRegistry.BLUE_KRASHANKA); + entries.add(ItemsRegistry.BROWN_KRASHANKA); + entries.add(ItemsRegistry.CYAN_KRASHANKA); + entries.add(ItemsRegistry.GRAY_KRASHANKA); + entries.add(ItemsRegistry.GREEN_KRASHANKA); + entries.add(ItemsRegistry.LIGHT_BLUE_KRASHANKA); + entries.add(ItemsRegistry.LIGHT_GRAY_KRASHANKA); + entries.add(ItemsRegistry.LIME_KRASHANKA); + entries.add(ItemsRegistry.MAGENTA_KRASHANKA); + entries.add(ItemsRegistry.ORANGE_KRASHANKA); + entries.add(ItemsRegistry.PINK_KRASHANKA); + entries.add(ItemsRegistry.PURPLE_KRASHANKA); + entries.add(ItemsRegistry.RED_KRASHANKA); + entries.add(ItemsRegistry.WHITE_KRASHANKA); + entries.add(ItemsRegistry.YELLOW_KRASHANKA); }).build()); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/recipe/BrewingRecipe.java b/src/main/java/com/megatrex4/ukrainian_dlight/recipe/BrewingRecipe.java index 5a8b371..a76b4fb 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/recipe/BrewingRecipe.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/recipe/BrewingRecipe.java @@ -1,7 +1,6 @@ package com.megatrex4.ukrainian_dlight.recipe; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; +import com.megatrex4.ukrainian_dlight.registry.RecipesRegistry; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Ingredient; @@ -10,7 +9,6 @@ import net.minecraft.recipe.RecipeType; import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.util.Identifier; -import net.minecraft.util.JsonHelper; import net.minecraft.util.collection.DefaultedList; import net.minecraft.world.World; @@ -68,12 +66,12 @@ public Identifier getId() { @Override public RecipeSerializer getSerializer() { - return ModRecipes.BREWING_RECIPE_SERIALIZER; + return RecipesRegistry.BREWING_RECIPE_SERIALIZER; } @Override public RecipeType getType() { - return ModRecipes.BREWING; + return RecipesRegistry.BREWING; } public ItemStack getContainer() { diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/ModBlocks.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/BlockRegistry.java similarity index 83% rename from src/main/java/com/megatrex4/ukrainian_dlight/block/ModBlocks.java rename to src/main/java/com/megatrex4/ukrainian_dlight/registry/BlockRegistry.java index f960923..a694eab 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/ModBlocks.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/BlockRegistry.java @@ -1,9 +1,9 @@ -package com.megatrex4.ukrainian_dlight.block; +package com.megatrex4.ukrainian_dlight.registry; import com.megatrex4.ukrainian_dlight.UkrainianDelight; -import com.megatrex4.ukrainian_dlight.block.custom.BrewingKegBlock; -import com.megatrex4.ukrainian_dlight.block.custom.BrewingKegBlockItem; -import com.megatrex4.ukrainian_dlight.block.custom.SaltBlock; +import com.megatrex4.ukrainian_dlight.block.BrewingKegBlock; +import com.megatrex4.ukrainian_dlight.block.BrewingKegBlockItem; +import com.megatrex4.ukrainian_dlight.block.SaltBlock; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.Blocks; @@ -14,7 +14,7 @@ import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.Identifier; -public class ModBlocks { +public class BlockRegistry { public static final Block SALT_BLOCK = registerBlock("salt_block", new SaltBlock(Block.Settings.copy(Blocks.STONE).sounds(BlockSoundGroup.STONE))); @@ -28,6 +28,7 @@ public class ModBlocks { public static final Block BREWING_KEG = registerBlock("brewing_keg", new BrewingKegBlock(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).sounds(BlockSoundGroup.WOOD).nonOpaque())); + private static Block registerBlock(String name, Block block){ registerBlockItem(name, block); return Registry.register(Registries.BLOCK, new Identifier(UkrainianDelight.MOD_ID, name), block); @@ -36,10 +37,8 @@ private static Block registerBlock(String name, Block block){ private static void registerBlockItem(String name, Block block){ Item item; if (block instanceof BrewingKegBlock) { - // Use custom BrewingKegBlockItem for BrewingKegBlock item = new BrewingKegBlockItem(block, new Item.Settings().maxCount(1)); } else { - // Default BlockItem for other blocks item = new BlockItem(block, new Item.Settings()); } Registry.register(Registries.ITEM, new Identifier(UkrainianDelight.MOD_ID, name), item); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/item/ModItems.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ItemsRegistry.java similarity index 57% rename from src/main/java/com/megatrex4/ukrainian_dlight/item/ModItems.java rename to src/main/java/com/megatrex4/ukrainian_dlight/registry/ItemsRegistry.java index 848a39f..a471349 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/item/ModItems.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ItemsRegistry.java @@ -1,88 +1,119 @@ -package com.megatrex4.ukrainian_dlight.item; +package com.megatrex4.ukrainian_dlight.registry; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; import com.megatrex4.ukrainian_dlight.UkrainianDelight; +import com.megatrex4.ukrainian_dlight.item.FoodItemBuilder; +import com.megatrex4.ukrainian_dlight.item.ModFoodComponents; +import com.megatrex4.ukrainian_dlight.item.KrashankyItem; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.minecraft.item.Item; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -public class ModItems { +import java.util.List; + +public class ItemsRegistry { // Define items using the ItemBuilder - public static final Item VARENYK = registerItem("varenyk", new ItemBuilder() + public static final Item VARENYK = registerItem("varenyk", new FoodItemBuilder() .food(ModFoodComponents.VARENYK) .build()); - public static final Item BORSCHT = registerItem("borscht", new ItemBuilder() + public static final Item BORSCHT = registerItem("borscht", new FoodItemBuilder() .food(ModFoodComponents.BORSCHT) .maxCount(16) .returnsBowl() .build()); - public static final Item LEAN_BORSCHT = registerItem("lean_borscht", new ItemBuilder() + public static final Item LEAN_BORSCHT = registerItem("lean_borscht", new FoodItemBuilder() .food(ModFoodComponents.LEAN_BORSCHT) .maxCount(16) .returnsBowl() .build()); - public static final Item HORSERADISH = registerItem("horseradish", new ItemBuilder() + public static final Item HORSERADISH = registerItem("horseradish", new FoodItemBuilder() .food(ModFoodComponents.HORSERADISH) .build()); - public static final Item CUCUMBER = registerItem("cucumber", new ItemBuilder() + public static final Item CUCUMBER = registerItem("cucumber", new FoodItemBuilder() .food(ModFoodComponents.CUCUMBER) .build()); - public static final Item CUTTED_CUCUMBER = registerItem("cutted_cucumber", new ItemBuilder() + public static final Item CUTTED_CUCUMBER = registerItem("cutted_cucumber", new FoodItemBuilder() .food(ModFoodComponents.CUTTED_CUCUMBER) .build()); - public static final Item APPLE_SLICE = registerItem("apple_slice", new ItemBuilder() + public static final Item APPLE_SLICE = registerItem("apple_slice", new FoodItemBuilder() .food(ModFoodComponents.APPLE_SLICE) .build()); - public static final Item DRIED_APPLE_SLICE = registerItem("dried_apple_slice", new ItemBuilder() + public static final Item DRIED_APPLE_SLICE = registerItem("dried_apple_slice", new FoodItemBuilder() .food(ModFoodComponents.DRIED_APPLE_SLICE) .build()); - public static final Item HOMEMADE_SAUSAGE = registerItem("homemade_sausage", new ItemBuilder() + public static final Item HOMEMADE_SAUSAGE = registerItem("homemade_sausage", new FoodItemBuilder() .food(ModFoodComponents.HOMEMADE_SAUSAGE) .build()); - public static final Item CHERRY_BERRY = registerItem("cherry_berry", new ItemBuilder() + public static final Item CHERRY_BERRY = registerItem("cherry_berry", new FoodItemBuilder() .food(ModFoodComponents.CHERRY_BERRY) .build()); - public static final Item COTTAGE_CHEESE = registerItem("cottage_cheese", new ItemBuilder() + public static final Item COTTAGE_CHEESE = registerItem("cottage_cheese", new FoodItemBuilder() .food(ModFoodComponents.COTTAGE_CHEESE) .build()); - public static final Item SALO = registerItem("salo", new ItemBuilder() + public static final Item SALO = registerItem("salo", new FoodItemBuilder() .food(ModFoodComponents.SALO) .build()); // Simple items without specifying maxCount, defaults to 64 - public static final Item SALT = registerItem("salt", new ItemBuilder().build()); - public static final Item YEAST = registerItem("yeast", new ItemBuilder().build()); - - public static final Item BLACK_KRASHANKA = registerItem("black_krashanka", new ItemBuilder().build()); - public static final Item BLUE_KRASHANKA = registerItem("blue_krashanka", new ItemBuilder().build()); - public static final Item BROWN_KRASHANKA = registerItem("brown_krashanka", new ItemBuilder().build()); - public static final Item CYAN_KRASHANKA = registerItem("cyan_krashanka", new ItemBuilder().build()); - public static final Item GREEN_KRASHANKA = registerItem("green_krashanka", new ItemBuilder().build()); - public static final Item GRAY_KRASHANKA = registerItem("gray_krashanka", new ItemBuilder().build()); - public static final Item LIGHT_BLUE_KRASHANKA = registerItem("light_blue_krashanka", new ItemBuilder().build()); - public static final Item LIGHT_GRAY_KRASHANKA = registerItem("light_gray_krashanka", new ItemBuilder().build()); - public static final Item LIME_KRASHANKA = registerItem("lime_krashanka", new ItemBuilder().build()); - public static final Item MAGENTA_KRASHANKA = registerItem("magenta_krashanka", new ItemBuilder().build()); - public static final Item ORANGE_KRASHANKA = registerItem("orange_krashanka", new ItemBuilder().build()); - public static final Item PINK_KRASHANKA = registerItem("pink_krashanka", new ItemBuilder().build()); - public static final Item PURPLE_KRASHANKA = registerItem("purple_krashanka", new ItemBuilder().build()); - public static final Item RED_KRASHANKA = registerItem("red_krashanka", new ItemBuilder().build()); - public static final Item WHITE_KRASHANKA = registerItem("white_krashanka", new ItemBuilder().build()); - public static final Item YELLOW_KRASHANKA = registerItem("yellow_krashanka", new ItemBuilder().build()); + public static final Item SALT = registerItem("salt", new FoodItemBuilder().build()); + public static final Item YEAST = registerItem("yeast", new FoodItemBuilder().build()); + + //KRASHANKY + public static final Item BLACK_KRASHANKA = registerItem("black_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item BLUE_KRASHANKA = registerItem("blue_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item BROWN_KRASHANKA = registerItem("brown_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item CYAN_KRASHANKA = registerItem("cyan_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item GREEN_KRASHANKA = registerItem("green_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item GRAY_KRASHANKA = registerItem("gray_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item LIGHT_BLUE_KRASHANKA = registerItem("light_blue_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item LIGHT_GRAY_KRASHANKA = registerItem("light_gray_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item LIME_KRASHANKA = registerItem("lime_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item MAGENTA_KRASHANKA = registerItem("magenta_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item ORANGE_KRASHANKA = registerItem("orange_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item PINK_KRASHANKA = registerItem("pink_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item PURPLE_KRASHANKA = registerItem("purple_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item RED_KRASHANKA = registerItem("red_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item WHITE_KRASHANKA = registerItem("white_krashanka", new KrashankyItem(new FabricItemSettings())); + public static final Item YELLOW_KRASHANKA = registerItem("yellow_krashanka", new KrashankyItem(new FabricItemSettings())); + +// public static final FluentIterable KRASHANKY_ITEMS = ; + + //make to add all KRASHANY to KRASHANY_ITEMS to FluentIterable + public static final ImmutableList KRASHANKY_ITEMS = ImmutableList.of( + BLACK_KRASHANKA, + BLUE_KRASHANKA, + BROWN_KRASHANKA, + CYAN_KRASHANKA, + GREEN_KRASHANKA, + GRAY_KRASHANKA, + LIGHT_BLUE_KRASHANKA, + LIGHT_GRAY_KRASHANKA, + LIME_KRASHANKA, + MAGENTA_KRASHANKA, + ORANGE_KRASHANKA, + PINK_KRASHANKA, + PURPLE_KRASHANKA, + RED_KRASHANKA, + WHITE_KRASHANKA, + YELLOW_KRASHANKA + ); + // Register items diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/recipe/ModRecipes.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/RecipesRegistry.java similarity index 79% rename from src/main/java/com/megatrex4/ukrainian_dlight/recipe/ModRecipes.java rename to src/main/java/com/megatrex4/ukrainian_dlight/registry/RecipesRegistry.java index 9c83a5a..01e06f1 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/recipe/ModRecipes.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/RecipesRegistry.java @@ -1,13 +1,15 @@ -package com.megatrex4.ukrainian_dlight.recipe; +package com.megatrex4.ukrainian_dlight.registry; import com.megatrex4.ukrainian_dlight.UkrainianDelight; +import com.megatrex4.ukrainian_dlight.recipe.BrewingRecipe; +import com.megatrex4.ukrainian_dlight.recipe.BrewingRecipeSerializer; import net.minecraft.recipe.RecipeSerializer; import net.minecraft.recipe.RecipeType; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -public class ModRecipes { +public class RecipesRegistry { public static final RecipeType BREWING = RecipeType.register(new Identifier("ukrainian_delight", "brewing").toString()); public static final RecipeSerializer BREWING_RECIPE_SERIALIZER = new BrewingRecipeSerializer(); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/screen/ModScreenHandlers.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ScreenHandlersRegistry.java similarity index 76% rename from src/main/java/com/megatrex4/ukrainian_dlight/screen/ModScreenHandlers.java rename to src/main/java/com/megatrex4/ukrainian_dlight/registry/ScreenHandlersRegistry.java index 9486978..2fe441a 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/screen/ModScreenHandlers.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ScreenHandlersRegistry.java @@ -1,13 +1,16 @@ -package com.megatrex4.ukrainian_dlight.screen; +package com.megatrex4.ukrainian_dlight.registry; import com.megatrex4.ukrainian_dlight.UkrainianDelight; +import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreenHandler; import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; +import net.minecraft.inventory.SimpleInventory; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.screen.ScreenHandlerContext; import net.minecraft.screen.ScreenHandlerType; import net.minecraft.util.Identifier; -public class ModScreenHandlers { +public class ScreenHandlersRegistry { public static final ScreenHandlerType BREWING_KEG_SCREEN_HANDLER = Registry.register(Registries.SCREEN_HANDLER, new Identifier(UkrainianDelight.MOD_ID, "brewing_keg_screen_handler"), new ExtendedScreenHandlerType<>(BrewingKegScreenHandler::new)); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/registry/ScreensRegistry.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ScreensRegistry.java new file mode 100644 index 0000000..5600da2 --- /dev/null +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ScreensRegistry.java @@ -0,0 +1,10 @@ +package com.megatrex4.ukrainian_dlight.registry; + +import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreen; +import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry; + +public class ScreensRegistry { + public static void registerScreens() { + ScreenRegistry.register(ScreenHandlersRegistry.BREWING_KEG_SCREEN_HANDLER, BrewingKegScreen::new); + } +} diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/TagsRegistry.java similarity index 97% rename from src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java rename to src/main/java/com/megatrex4/ukrainian_dlight/registry/TagsRegistry.java index fdf0304..7e6629b 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/TagsRegistry.java @@ -8,7 +8,7 @@ import net.minecraft.util.Identifier; import net.minecraft.registry.RegistryKeys; -public class ModTags { +public class TagsRegistry { public static final TagKey LIGHT_DRINK; public static final TagKey MID_DRINK; public static final TagKey STRONG_DRINK; diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/initialize/CustomizeLootTables.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/initialize/CustomizeLootTables.java similarity index 84% rename from src/main/java/com/megatrex4/ukrainian_dlight/initialize/CustomizeLootTables.java rename to src/main/java/com/megatrex4/ukrainian_dlight/registry/initialize/CustomizeLootTables.java index e086445..aca8fb9 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/initialize/CustomizeLootTables.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/initialize/CustomizeLootTables.java @@ -1,6 +1,6 @@ -package com.megatrex4.ukrainian_dlight.initialize; +package com.megatrex4.ukrainian_dlight.registry.initialize; -import com.megatrex4.ukrainian_dlight.item.ModItems; +import com.megatrex4.ukrainian_dlight.registry.ItemsRegistry; import net.fabricmc.fabric.api.loot.v2.LootTableEvents; import net.minecraft.loot.LootPool; import net.minecraft.loot.condition.RandomChanceLootCondition; @@ -18,7 +18,7 @@ public static void register() { LootTableEvents.MODIFY.register((resourceManager, lootManager, id, tableBuilder, source) -> { if (id.equals(CHERRY_TREE_LOOT_TABLE_ID)) { LootPool.Builder poolBuilder = LootPool.builder() - .with(ItemEntry.builder(ModItems.CHERRY_BERRY)) + .with(ItemEntry.builder(ItemsRegistry.CHERRY_BERRY)) .conditionally(RandomChanceLootCondition.builder(0.12f)) // 20% chance .apply(SetCountLootFunction.builder(ConstantLootNumberProvider.create(1)).build()); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/screen/BrewingKegScreenHandler.java b/src/main/java/com/megatrex4/ukrainian_dlight/screen/BrewingKegScreenHandler.java index 18b9c8d..d1f69c3 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/screen/BrewingKegScreenHandler.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/screen/BrewingKegScreenHandler.java @@ -2,11 +2,10 @@ import com.megatrex4.ukrainian_dlight.block.entity.BrewingKegBlockEntity; import com.megatrex4.ukrainian_dlight.block.entity.inventory.BrewingKegResultSlot; +import com.megatrex4.ukrainian_dlight.registry.ScreenHandlersRegistry; import com.megatrex4.ukrainian_dlight.util.FluidStack; -import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.fluid.Fluid; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -15,11 +14,6 @@ import net.minecraft.screen.PropertyDelegate; import net.minecraft.screen.ScreenHandler; import net.minecraft.screen.slot.Slot; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -import java.util.ArrayList; -import java.util.List; public class BrewingKegScreenHandler extends ScreenHandler { @@ -47,7 +41,7 @@ public BrewingKegScreenHandler(int syncId, PlayerInventory tileEntity, PacketByt } public BrewingKegScreenHandler(int syncId, PlayerInventory playerInventory, BrewingKegBlockEntity blockEntity, PropertyDelegate arrayPropertyDelegate) { - super(ModScreenHandlers.BREWING_KEG_SCREEN_HANDLER, syncId); + super(ScreenHandlersRegistry.BREWING_KEG_SCREEN_HANDLER, syncId); checkSize(blockEntity, INVENTORY_SIZE); // Corrected type casting this.tileEntity = blockEntity; // Corrected type casting diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/screen/ModScreens.java b/src/main/java/com/megatrex4/ukrainian_dlight/screen/ModScreens.java deleted file mode 100644 index a3f1563..0000000 --- a/src/main/java/com/megatrex4/ukrainian_dlight/screen/ModScreens.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.megatrex4.ukrainian_dlight.screen; - -import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry; - -public class ModScreens { - public static void registerScreens() { - ScreenRegistry.register(ModScreenHandlers.BREWING_KEG_SCREEN_HANDLER, BrewingKegScreen::new); - } -} diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/util/StatusEffectUtil.java b/src/main/java/com/megatrex4/ukrainian_dlight/util/StatusEffectUtil.java index 19e66df..e52ed24 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/util/StatusEffectUtil.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/util/StatusEffectUtil.java @@ -1,11 +1,9 @@ package com.megatrex4.ukrainian_dlight.util; -import com.megatrex4.ukrainian_dlight.registry.ModTags; +import com.megatrex4.ukrainian_dlight.registry.TagsRegistry; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.Identifier; -import net.minecraft.world.World; import java.util.Random; @@ -21,19 +19,19 @@ public static void applySecondaryEffects(PlayerEntity player, StatusEffectInstan int duration = mainEffect.getDuration(); int amplifier = mainEffect.getAmplifier() + 1; - if (player.getInventory().contains(ModTags.LIGHT_DRINK)) { + if (player.getInventory().contains(TagsRegistry.LIGHT_DRINK)) { applyWeakness(player, duration / 2, (int) (amplifier * 1.3)); applyNausea(player, duration / 2, (int) (amplifier * 1.3)); if (RANDOM.nextFloat() < 0.2) { applyBlindness(player, (int) (duration * 0.7), (int) (amplifier * 1.3)); } - } else if (player.getInventory().contains(ModTags.MID_DRINK)) { + } else if (player.getInventory().contains(TagsRegistry.MID_DRINK)) { applyWeakness(player, (int) (duration * 0.7), (int) (amplifier * 1.5)); applyNausea(player, (int) (duration * 0.7), (int) (amplifier * 1.5)); if (RANDOM.nextFloat() < 0.7) { applyBlindness(player, (int) (duration * 0.7), (int) (amplifier * 1.5)); } - } else if (player.getInventory().contains(ModTags.STRONG_DRINK)) { + } else if (player.getInventory().contains(TagsRegistry.STRONG_DRINK)) { applyWeakness(player, (int) (duration * 0.9), (int) (amplifier * 1.7)); applyNausea(player, (int) (duration * 0.9), (int) (amplifier * 1.7)); if (RANDOM.nextFloat() < 0.8) { diff --git a/src/main/resources/assets/ukrainian_delight/models/item/krashanky_item.json b/src/main/resources/assets/ukrainian_delight/models/item/krashanky_item.json new file mode 100644 index 0000000..7adc85e --- /dev/null +++ b/src/main/resources/assets/ukrainian_delight/models/item/krashanky_item.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ukrainian_dlight:item/krashanky" + } +} diff --git a/src/main/resources/assets/ukrainian_delight/textures/gui/container/pysankers_table.png b/src/main/resources/assets/ukrainian_delight/textures/gui/container/pysankers_table.png new file mode 100644 index 0000000..cdeff58 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/gui/container/pysankers_table.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/black_krashanka.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/black_krashanka.png index 9e509ea..8a51295 100644 Binary files a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/black_krashanka.png and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/black_krashanka.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/border.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/border.png new file mode 100644 index 0000000..b45e5f3 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/border.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/circle.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/circle.png new file mode 100644 index 0000000..1bd8519 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/circle.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/cross.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/cross.png new file mode 100644 index 0000000..fb0646d Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/cross.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/diagonal_left.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/diagonal_left.png new file mode 100644 index 0000000..359a2a6 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/diagonal_left.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/diagonal_right.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/diagonal_right.png new file mode 100644 index 0000000..30fd51f Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/diagonal_right.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/flower.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/flower.png new file mode 100644 index 0000000..a2fb3ed Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/flower.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/globe.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/globe.png new file mode 100644 index 0000000..2a163a7 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/globe.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/gradient.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/gradient.png new file mode 100644 index 0000000..4e2fd64 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/gradient.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/gradient_up.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/gradient_up.png new file mode 100644 index 0000000..f56e6e6 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/gradient_up.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/half_vertical.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/half_vertical.png new file mode 100644 index 0000000..405922b Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/half_vertical.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/half_vertical_right.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/half_vertical_right.png new file mode 100644 index 0000000..ab0838e Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/half_vertical_right.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/piglin.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/piglin.png new file mode 100644 index 0000000..1d3e9a8 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/piglin.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/rhombus.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/rhombus.png new file mode 100644 index 0000000..0266271 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/rhombus.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/small_stripes.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/small_stripes.png new file mode 100644 index 0000000..00eeb34 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/small_stripes.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/straight_cross.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/straight_cross.png new file mode 100644 index 0000000..dfefe88 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/straight_cross.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_bottom.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_bottom.png new file mode 100644 index 0000000..cd04d0b Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_bottom.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_center.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_center.png new file mode 100644 index 0000000..6f41ccb Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_center.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_downleft.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_downleft.png new file mode 100644 index 0000000..351c8d5 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_downleft.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_downright.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_downright.png new file mode 100644 index 0000000..41e2927 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_downright.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_middle.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_middle.png new file mode 100644 index 0000000..8815894 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_middle.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_top.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_top.png new file mode 100644 index 0000000..dca0156 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/stripe_top.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangle_bottom.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangle_bottom.png new file mode 100644 index 0000000..5fe4c4b Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangle_bottom.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangle_top.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangle_top.png new file mode 100644 index 0000000..dbcede8 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangle_top.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangles_bottom.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangles_bottom.png new file mode 100644 index 0000000..4c036c4 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangles_bottom.png differ diff --git a/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangles_top.png b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangles_top.png new file mode 100644 index 0000000..376bba0 Binary files /dev/null and b/src/main/resources/assets/ukrainian_delight/textures/item/krashanky/patterns/triangles_top.png differ