Skip to content

Commit

Permalink
working on custom crafting table
Browse files Browse the repository at this point in the history
  • Loading branch information
RealYusufIsmail committed Jun 18, 2024
1 parent 6c169db commit bef7d0a
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 4 deletions.
5 changes: 1 addition & 4 deletions TEMPLATE_LICENSE.txt → LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
MIT License

Copyright (c) 2023 NeoForged project

This license applies to the template files as supplied by github.com/NeoForged/MDK

Copyright (c) 2023 RealYusufIsmail

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.github.realyusufismail.tutorialmod.blocks.chest;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.AbstractChestBlock;
import net.minecraft.world.level.block.DoubleBlockCombiner;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.ChestBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;

import java.util.function.Supplier;

/**
* @see net.minecraft.world.level.block.ChestBlock
*/
public class ExampleChestBlock extends AbstractChestBlock<ExampleChestBlockEntity> implements SimpleWaterloggedBlock {
protected ExampleChestBlock(Properties pProperties, Supplier<BlockEntityType<? extends ExampleChestBlockEntity>> pBlockEntityType) {
super(pProperties, pBlockEntityType);
}

@Override
protected MapCodec<? extends AbstractChestBlock<ExampleChestBlockEntity>> codec() {
return null;
}

@Override
public DoubleBlockCombiner.NeighborCombineResult<? extends ChestBlockEntity> combine(BlockState pState, Level pLevel, BlockPos pPos, boolean pOverride) {
return null;
}

@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package io.github.realyusufismail.tutorialmod.blocks.chest;

import net.minecraft.core.BlockPos;
import net.minecraft.core.NonNullList;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.LidBlockEntity;
import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity;
import net.minecraft.world.level.block.state.BlockState;

/**
* @see net.minecraft.world.level.block.entity.ChestBlockEntity
*/
public class ExampleChestBlockEntity extends RandomizableContainerBlockEntity implements LidBlockEntity {
protected ExampleChestBlockEntity(BlockEntityType<?> pType, BlockPos pPos, BlockState pBlockState) {
super(pType, pPos, pBlockState);
}

@Override
protected Component getDefaultName() {
return null;
}

@Override
protected NonNullList<ItemStack> getItems() {
return null;
}

@Override
protected void setItems(NonNullList<ItemStack> pItems) {

}

@Override
protected AbstractContainerMenu createMenu(int pContainerId, Inventory pInventory) {
return null;
}

@Override
public int getContainerSize() {
return 0;
}

@Override
public float getOpenNess(float pPartialTicks) {
return 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.github.realyusufismail.tutorialmod.blocks.chest;

/**
* @see net.minecraft.world.inventory.ChestMenu
*/
public class ExampleChestMenu {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.github.realyusufismail.tutorialmod.blocks.crafting;

/**
* @see net.minecraft.world.level.block.CrafterBlock
*/
public class ExampleCraftingBlock {
}

0 comments on commit bef7d0a

Please sign in to comment.