Skip to content

Commit

Permalink
I refuse to do so...
Browse files Browse the repository at this point in the history
  • Loading branch information
MEGATREX4 committed Aug 11, 2024
1 parent 301ca88 commit 16648be
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.megatrex4.ukrainian_dlight.block.DrinkBottleBlock;
import com.megatrex4.ukrainian_dlight.block.FoodJarBlocks;
import com.megatrex4.ukrainian_dlight.item.KrashankyItem;
import com.megatrex4.ukrainian_dlight.registry.BlockRegistry;
import com.megatrex4.ukrainian_dlight.block.entity.ModBlockEntities;
//import com.megatrex4.ukrainian_dlight.compat.patchouli.CustomBrewingRecipeProcessor;
Expand All @@ -16,7 +15,9 @@
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

This file was deleted.

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

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<ItemStack> inventory = DefaultedList.ofSize(INVENTORY_SIZE, ItemStack.EMPTY);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class ModItemGroups {
.icon(() -> new ItemStack(ItemsRegistry.CUCUMBER))
.entries((displayContext, entries) -> {
entries.add(BlockRegistry.BREWING_KEG);
entries.add(BlockRegistry.PYSANKER_TABLE);
entries.add(BlockRegistry.SALT_BAG);
entries.add(BlockRegistry.SALT_BLOCK);
entries.add(ItemsRegistry.SALT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
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.PysankerTableBlock;
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;
Expand All @@ -29,8 +28,6 @@ public class BlockRegistry {
public static final Block BREWING_KEG = registerBlock("brewing_keg",
new BrewingKegBlock(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).sounds(BlockSoundGroup.WOOD).nonOpaque()));

public static final Block PYSANKER_TABLE = registerBlock("pysankers_table",
new PysankerTableBlock(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).sounds(BlockSoundGroup.WOOD)));

private static Block registerBlock(String name, Block block){
registerBlockItem(name, block);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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;
Expand All @@ -10,6 +12,8 @@
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

import java.util.List;

public class ItemsRegistry {

// Define items using the ItemBuilder
Expand Down Expand Up @@ -70,6 +74,7 @@ public class ItemsRegistry {
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()));
Expand All @@ -87,6 +92,29 @@ public class ItemsRegistry {
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<Object> KRASHANKY_ITEMS = ;

//make to add all KRASHANY to KRASHANY_ITEMS to FluentIterable<Object>
public static final ImmutableList<Item> 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
public static Item registerItem(String name, Item item) {
Expand Down

This file was deleted.

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

import com.megatrex4.ukrainian_dlight.UkrainianDelight;
import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreenHandler;
import com.megatrex4.ukrainian_dlight.screen.PysankersTableScreenHandler;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
import net.minecraft.inventory.SimpleInventory;
import net.minecraft.registry.Registries;
Expand All @@ -16,12 +15,6 @@ public class ScreenHandlersRegistry {
Registry.register(Registries.SCREEN_HANDLER, new Identifier(UkrainianDelight.MOD_ID, "brewing_keg_screen_handler"),
new ExtendedScreenHandlerType<>(BrewingKegScreenHandler::new));


//register PYSANKERS_TABLE
public static final ScreenHandlerType<PysankersTableScreenHandler> PYSANKERS_TABLE_SCREEN_HANDLER =
Registry.register(Registries.SCREEN_HANDLER, new Identifier(UkrainianDelight.MOD_ID, "pysankers_table_screen_handler"),
new ExtendedScreenHandlerType<>((syncId, inv, buf) -> new PysankersTableScreenHandler(syncId, inv, null, new SimpleInventory(PysankersTableScreenHandler.INVENTORY_SIZE), ScreenHandlerContext.EMPTY)));

public static void registerModScreenHandlers() {
UkrainianDelight.LOGGER.info("Registering Mod Screen Handlers for " + UkrainianDelight.MOD_ID);
// If there are more screen handlers, register them here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.megatrex4.ukrainian_dlight.registry;

import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreen;
import com.megatrex4.ukrainian_dlight.screen.PysankersTableScreen;
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);
ScreenRegistry.register(ScreenHandlersRegistry.PYSANKERS_TABLE_SCREEN_HANDLER, PysankersTableScreen::new);
}
}
Loading

0 comments on commit 16648be

Please sign in to comment.