9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-22 08:19:26 +00:00

rebuild patches

This commit is contained in:
Samsuik
2024-11-21 22:10:57 +00:00
parent b1667eea74
commit a164f5fc78
43 changed files with 35 additions and 50 deletions

View File

@@ -5,69 +5,54 @@ Subject: [PATCH] Add redstone implementation API
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
index b6c3aa283b8c6dcd5af4f770301a5481af82f945..43a579795c19d4edd06ec6f301d6c107beaca96f 100644 index 5d847016f6ee2d6340d8b2234ed35c3b9228632b..5fae13db49b60ea32e046aff64059a08ce626e3f 100644
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java --- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
@@ -268,7 +268,7 @@ public class RedStoneWireBlock extends Block { @@ -300,7 +300,7 @@ public class RedStoneWireBlock extends Block {
* Note: Added 'source' argument so as to help determine direction of information flow * Note: Added 'source' argument so as to help determine direction of information flow
*/ */
private void updateSurroundingRedstone(Level worldIn, BlockPos pos, BlockState state, BlockPos source) { private void updateSurroundingRedstone(Level worldIn, BlockPos pos, BlockState state, @Nullable Orientation orientation, boolean blockAdded) {
- if (worldIn.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.EIGENCRAFT) { - if (worldIn.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.EIGENCRAFT) {
+ if (worldIn.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.EIGENCRAFT) { // Sakura + if (worldIn.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.EIGENCRAFT) { // Sakura - redstone implementation api
turbo.updateSurroundingRedstone(worldIn, pos, state, source); // since 24w33a the source pos is no longer given, but instead an Orientation parameter
return; // when this is not null, it can be used to find the source pos, which the turbo uses
} // to find the direction of information flow
@@ -292,7 +292,7 @@ public class RedStoneWireBlock extends Block { @@ -373,7 +373,7 @@ public class RedStoneWireBlock extends Block {
int k = worldIn.getBestNeighborSignal(pos1);
this.shouldSignal = true;
- if (worldIn.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.VANILLA) {
+ if (worldIn.localConfig().config(pos1).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.VANILLA) { // Sakura
// This code is totally redundant to if statements just below the loop.
if (k > 0 && k > j - 1) {
j = k;
@@ -306,7 +306,7 @@ public class RedStoneWireBlock extends Block {
// redstone wire will be set to 'k'. If 'k' is already 15, then nothing inside the
// following loop can affect the power level of the wire. Therefore, the loop is
// skipped if k is already 15.
- if (worldIn.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.VANILLA || k < 15) {
+ if (worldIn.localConfig().config(pos1).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.VANILLA || k < 15) { // Sakura
for (Direction enumfacing : Direction.Plane.HORIZONTAL) {
BlockPos blockpos = pos1.relative(enumfacing);
boolean flag = blockpos.getX() != pos2.getX() || blockpos.getZ() != pos2.getZ();
@@ -325,7 +325,7 @@ public class RedStoneWireBlock extends Block {
}
}
- if (worldIn.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.VANILLA) {
+ if (worldIn.localConfig().config(pos1).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.VANILLA) { // Sakura
// The old code would decrement the wire value only by 1 at a time.
if (l > j) {
j = l - 1;
@@ -478,7 +478,7 @@ public class RedStoneWireBlock extends Block {
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (!oldState.is(state.getBlock()) && !world.isClientSide) { if (!oldState.is(state.getBlock()) && !world.isClientSide) {
// Paper start - optimize redstone - replace call to updatePowerStrength // Paper start - optimize redstone - replace call to updatePowerStrength
- if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { - if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
+ if (world.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { // Sakura + if (world.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { // Sakura - redstone implementation api
world.getWireHandler().onWireAdded(pos); // Alternate Current world.getWireHandler().onWireAdded(pos, state); // Alternate Current
} else { } else {
this.updateSurroundingRedstone(world, pos, state, null); // vanilla/Eigencraft this.updateSurroundingRedstone(world, pos, state, null, true); // Vanilla/Eigencraft
@@ -511,7 +511,7 @@ public class RedStoneWireBlock extends Block { @@ -398,7 +398,7 @@ public class RedStoneWireBlock extends Block {
} }
// Paper start - optimize redstone - replace call to updatePowerStrength // Paper start - optimize redstone - replace call to updatePowerStrength
- if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { - if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
+ if (world.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { // Sakura + if (world.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { // Sakura - redstone implementation api
world.getWireHandler().onWireRemoved(pos, state); // Alternate Current world.getWireHandler().onWireRemoved(pos, state); // Alternate Current
} else { } else {
this.updateSurroundingRedstone(world, pos, state, null); // vanilla/Eigencraft this.updateSurroundingRedstone(world, pos, state, null, false); // Vanilla/Eigencraft
@@ -552,7 +552,7 @@ public class RedStoneWireBlock extends Block { @@ -428,7 +428,7 @@ public class RedStoneWireBlock extends Block {
if (!world.isClientSide) { if (!world.isClientSide) {
// Paper start - optimize redstone (Alternate Current) // Paper start - optimize redstone (Alternate Current)
// Alternate Current handles breaking of redstone wires in the WireHandler. // Alternate Current handles breaking of redstone wires in the WireHandler.
- if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { - if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
+ if (world.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { // Sakura + if (world.localConfig().config(pos).redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) { // Sakura - redstone implementation api
world.getWireHandler().onWireUpdated(pos); world.getWireHandler().onWireUpdated(pos, state, wireOrientation);
} else } else
// Paper end - optimize redstone (Alternate Current) // Paper end - optimize redstone (Alternate Current)
diff --git a/src/main/java/net/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java b/src/main/java/net/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java
index 8342dd636531729a187aff1bd69878d7aef9d3eb..2272b081152fc70f5034186b36172b4a19e2680b 100644
--- a/src/main/java/net/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java
+++ b/src/main/java/net/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java
@@ -18,6 +18,7 @@ public class ExperimentalRedstoneUtils {
orientation = orientation.withFront(up);
}
// Paper start - Optimize redstone (Alternate Current) - use default front instead of random
+ // Sakura - redstone implementation api; conflict on change
else if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
orientation = orientation.withFront(Direction.WEST);
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Allow explosions to destroy lava
diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java
index 97debcf36d4aa3f8a6c83d35c53ba95342966fbf..0789f37ae89b22f9e3500b25cbe27ef853950b85 100644 index bdc3ff8cbe4e5eaa9d9a34f38fdd150f7368e33b..e857fd02a5e341a1a701da71874dbd850e3c5a5d 100644
--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java --- a/src/main/java/net/minecraft/world/level/ServerExplosion.java
+++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java +++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java
@@ -407,6 +407,11 @@ public class ServerExplosion implements Explosion { @@ -407,6 +407,11 @@ public class ServerExplosion implements Explosion {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Protect scaffolding from creepers
diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java
index ace34cc86061bb4c9b080c6e9bf912b1fe3533a6..280308766cd41924e209d5816c047ceae0ec1085 100644 index 0dae16d140666cae7633bbfef6d1c5b979d7dc9e..a9a63fa9d2c45298ebd4146e0dfeea54b6431797 100644
--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java --- a/src/main/java/net/minecraft/world/level/ServerExplosion.java
+++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java +++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java
@@ -412,6 +412,11 @@ public class ServerExplosion implements Explosion { @@ -412,6 +412,11 @@ public class ServerExplosion implements Explosion {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable left shooting and adjusting limits
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0868f3d8d93e4c360a0a53df741950789f3c6a1c..1dbad44adfb735d8ff4aa55f0b45353404386fef 100644 index ee8816ec238a38667cdf0f0f749c02b78a6477bd..9adc5164580a291585789948091ec192aff6d968 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -694,6 +694,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -694,6 +694,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@@ -42,7 +42,7 @@ index 5db5ba026462ca642dcee718af732f80fadabef5..51e26395b53628b34b1f7f68935a9ba4
boolean isEmpty(); boolean isEmpty();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 8c41282eafc1201bf1c0d001fb4fe791f3173f87..4361a08c3f60980c86f5b7953d6171016ad7166b 100644 index b8d59ca87e908ce2bdd978007e3a97e297a10278..cdd56fedb0e0703e820fe807789e0fad78d4b409 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1648,7 +1648,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @@ -1648,7 +1648,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl

View File

@@ -83,7 +83,7 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..32ac34e6ca4a7443e894369fee349911
return true; return true;
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7aaf3794338b8208ded6549e61479010c369ad87..4f5a34c27c281eee38c6c8262c365bd66725b340 100644 index 8bfa214dccc6e721ba68a442a2175c3f6c15bc95..bb73017b30a76fc515f4258b79b322d93964cc9a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1810,7 +1810,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1810,7 +1810,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..05e532f0aa3b1a5ab6570432662a8142
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1dbad44adfb735d8ff4aa55f0b45353404386fef..985abd0ad81045a07c9a6a50578412d607808e80 100644 index 9adc5164580a291585789948091ec192aff6d968..f3222939d68fbfe5e134b2484dfa9936605f1e0c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2086,6 +2086,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2086,6 +2086,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess