Skip to content

Commit

Permalink
update BrewingKeg
Browse files Browse the repository at this point in the history
  • Loading branch information
MEGATREX4 committed Jul 7, 2024
1 parent 3904238 commit 1ecca88
Show file tree
Hide file tree
Showing 11 changed files with 499 additions and 113 deletions.
Binary file added projectfiles/interface3_sketch.psd
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import net.minecraft.entity.damage.DamageType;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -30,6 +32,10 @@ public static Identifier id(String id) {
return new Identifier(MOD_ID, id);
}

public static MutableText i18n(String key, Object... args) {
return Text.translatable(MOD_ID + "." + key, args);
}

@Override
public void onInitialize() {
RegistryKey<DamageType> GLASS_DAMAGE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.megatrex4.ukrainian_dlight.block.entity.BrewingKegBlockEntity;
import com.megatrex4.ukrainian_dlight.block.entity.ModBlockEntities;
import com.nhoryzon.mc.farmersdelight.block.state.CookingPotSupport;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
Expand Down Expand Up @@ -116,6 +115,9 @@ public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockSt
}
dropSlotContents(world, pos, brewingKegEntity, BrewingKegBlockEntity.WATER_SLOT);

// Drop the OUTPUT_SLOT
dropSlotContents(world, pos, brewingKegEntity, BrewingKegBlockEntity.OUTPUT_SLOT);

// Spawn the item entity with the BlockEntityTag and DisplaySlot NBT
ItemEntity itemEntity = new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), itemStack);
world.spawnEntity(itemEntity);
Expand All @@ -135,6 +137,7 @@ private void dropSlotContents(World world, BlockPos pos, BrewingKegBlockEntity b
}



@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, net.minecraft.util.hit.BlockHitResult hit) {
if (!world.isClient) {
Expand Down
Loading

0 comments on commit 1ecca88

Please sign in to comment.