mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-24 01:19:19 +00:00
46 lines
2.6 KiB
Diff
46 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
Date: Tue, 12 Dec 2023 14:15:54 +0800
|
|
Subject: [PATCH] Crafter 1 gt delay
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
|
index 5afac5007bbd2010bb955eea6331875b52441b80..39072e41f640b6284813bac71fc9154982f31ee9 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
|
@@ -75,7 +75,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
|
boolean bl2 = state.getValue(TRIGGERED);
|
|
BlockEntity blockEntity = world.getBlockEntity(pos);
|
|
if (bl && !bl2) {
|
|
- world.scheduleTick(pos, this, 4);
|
|
+ world.scheduleTick(pos, this, !top.leavesmc.leaves.LeavesConfig.crafter1gt ? 4 : 1); // Leaves - crafter 1 gt delay
|
|
world.setBlock(pos, state.setValue(TRIGGERED, Boolean.valueOf(true)), 2);
|
|
this.setBlockEntityTriggered(blockEntity, true);
|
|
} else if (!bl && bl2) {
|
|
@@ -146,7 +146,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
|
}
|
|
|
|
if (state.getValue(TRIGGERED)) {
|
|
- world.scheduleTick(pos, this, 4);
|
|
+ world.scheduleTick(pos, this, !top.leavesmc.leaves.LeavesConfig.crafter1gt ? 4 : 1); // Leaves - crafter 1 gt delay
|
|
}
|
|
|
|
}
|
|
@@ -174,13 +174,13 @@ public class CrafterBlock extends BaseEntityBlock {
|
|
protected void dispenseFrom(BlockState state, ServerLevel world, BlockPos pos) {
|
|
BlockEntity optional = world.getBlockEntity(pos);
|
|
if (optional instanceof CrafterBlockEntity crafterBlockEntity) {
|
|
- Optional<CraftingRecipe> optional = getPotentialResults(world, crafterBlockEntity);
|
|
- if (optional.isEmpty()) {
|
|
+ Optional<CraftingRecipe> optional1 = getPotentialResults(world, crafterBlockEntity);
|
|
+ if (optional1.isEmpty()) {
|
|
world.levelEvent(1050, pos, 0);
|
|
} else {
|
|
crafterBlockEntity.setCraftingTicksRemaining(6);
|
|
world.setBlock(pos, state.setValue(CRAFTING, Boolean.valueOf(true)), 2);
|
|
- CraftingRecipe craftingRecipe = optional.get();
|
|
+ CraftingRecipe craftingRecipe = optional1.get();
|
|
ItemStack itemStack = craftingRecipe.assemble(crafterBlockEntity, world.registryAccess());
|
|
itemStack.onCraftedBySystem(world);
|
|
this.dispenseItem(world, pos, crafterBlockEntity, itemStack, state);
|