Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Apr 24, 2024
1 parent 94d5a2b commit e7c14b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ index e9bb7feb591032904516d1b9374f486d8a7d066c..04771be6128491bc7b9e6a0a400dfd32
public abstract class LivingEntity extends Entity implements Attackable {

diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
index 03092417cd8ab5c6d266f3af9f20f47b34cfaba3..d27075ae2b4f2570f0b4db283e1603ae9a5929aa 100644
index 03092417cd8ab5c6d266f3af9f20f47b34cfaba3..9d720df44cab753533bf1c2f7d07fc41cded1ed2 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
@@ -16,7 +16,6 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
Expand Down Expand Up @@ -1704,14 +1704,20 @@ index 03092417cd8ab5c6d266f3af9f20f47b34cfaba3..d27075ae2b4f2570f0b4db283e1603ae
return true;
} else {
return false;
@@ -73,7 +69,6 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
@@ -73,13 +69,11 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro

@Override
public final void tickOrStop(ServerLevel world, E entity, long time) {
- this.timing.startTiming(); // Paper - behavior timings
if (!this.timedOut(time) && this.canStillUse(world, entity, time)) {
this.tick(world, entity, time);
} else {
this.doStop(world, entity, time);
}
- this.timing.stopTiming(); // Paper - behavior timings
}

protected void tick(ServerLevel world, E entity, long time) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
index 9e90cb2f51d1bacacb287e912d14ab9152523205..06fab5e6b38d7b5509cc175d3921f500dee6443c 100644
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
Expand Down
9 changes: 6 additions & 3 deletions patches/server/0012-Redstone-Shears-Wrench.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Redstone Shears Wrench


diff --git a/src/main/java/net/minecraft/world/item/ShearsItem.java b/src/main/java/net/minecraft/world/item/ShearsItem.java
index 7ce81a910ceaa979499b7be269ac8a49e75d3a1c..a2852f9eb20de046bf2a8abb69300521258869e6 100644
index 7ce81a910ceaa979499b7be269ac8a49e75d3a1c..c55459bb9a03432afd3ea15c8e38a5faeaedeaa1 100644
--- a/src/main/java/net/minecraft/world/item/ShearsItem.java
+++ b/src/main/java/net/minecraft/world/item/ShearsItem.java
@@ -1,7 +1,9 @@
Expand All @@ -18,9 +18,11 @@ index 7ce81a910ceaa979499b7be269ac8a49e75d3a1c..a2852f9eb20de046bf2a8abb69300521
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
@@ -13,9 +15,19 @@ import net.minecraft.world.entity.player.Player;
@@ -12,10 +14,21 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
+import net.minecraft.world.level.block.ComparatorBlock;
+import net.minecraft.world.level.block.DispenserBlock;
Expand All @@ -38,11 +40,12 @@ index 7ce81a910ceaa979499b7be269ac8a49e75d3a1c..a2852f9eb20de046bf2a8abb69300521

public class ShearsItem extends Item {
public ShearsItem(Item.Properties settings) {
@@ -79,6 +91,59 @@ public class ShearsItem extends Item {
@@ -79,6 +92,60 @@ public class ShearsItem extends Item {
return InteractionResult.sidedSuccess(level.isClientSide);
}

+ // Leaves start - shears wrench
+ Block block = blockState.getBlock();
+ if (top.leavesmc.leaves.LeavesConfig.redstoneShearsWrench && block instanceof ObserverBlock || block instanceof DispenserBlock ||
+ block instanceof PistonBaseBlock || block instanceof HopperBlock || block instanceof RepeaterBlock || block instanceof ComparatorBlock) {
+ StateDefinition<Block, BlockState> blockstatelist = block.getStateDefinition();
Expand Down

0 comments on commit e7c14b8

Please # to comment.