25w37a
This commit is contained in:
1 parent
7ee917716f
commit
0a925c833c
6 files changed
+12
-10
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package carpet.fakes;
|
||||
|
||||
import net.minecraft.world.level.redstone.CollectingNeighborUpdater;
|
||||
import net.minecraft.world.level.redstone.NeighborUpdater;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -21,5 +22,5 @@ public interface LevelInterface
|
||||
|
||||
List<Entity> getOtherEntitiesLimited(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate, int limit);
|
||||
|
||||
NeighborUpdater getNeighborUpdater();
|
||||
CollectingNeighborUpdater getNeighborUpdater();
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import carpet.fakes.LevelInterface;
|
||||
import net.minecraft.world.level.redstone.NeighborUpdater;
|
||||
import net.minecraft.world.level.redstone.CollectingNeighborUpdater;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.redstone.Orientation;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -36,7 +36,7 @@ public class BarrierBlock_updateSuppressionBlockMixin extends Block {
|
||||
BlockState stateAbove = level.getBlockState(pos.above());
|
||||
if (stateAbove.is(Blocks.ACTIVATOR_RAIL) && !stateAbove.getValue(PoweredRailBlock.POWERED)) {
|
||||
level.scheduleTick(pos, this, 1);
|
||||
NeighborUpdater updater = ((LevelInterface)level).getNeighborUpdater();
|
||||
CollectingNeighborUpdater updater = ((LevelInterface)level).getNeighborUpdater();
|
||||
if (updater instanceof CollectingNeighborUpdaterAccessor cnua)
|
||||
cnua.setCount(cnua.getMaxChainedNeighborUpdates()-CarpetSettings.updateSuppressionBlock);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.IntFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -94,8 +95,8 @@ public abstract class ChunkMap_scarpetChunkCreationMixin implements ThreadedAnvi
|
||||
@Shadow
|
||||
protected abstract boolean promoteChunkMap();
|
||||
|
||||
@Shadow
|
||||
protected abstract Iterable<ChunkHolder> getChunks();
|
||||
//@Shadow
|
||||
//protected abstract void forEachReadyToSendChunk(Consumer<LevelChunk> consumer); // for getChunks()
|
||||
|
||||
|
||||
@Shadow
|
||||
|
||||
@@ -2,7 +2,7 @@ package carpet.mixins;
|
||||
|
||||
import carpet.fakes.LevelInterface;
|
||||
import carpet.utils.CarpetProfiler;
|
||||
import net.minecraft.world.level.redstone.NeighborUpdater;
|
||||
import net.minecraft.world.level.redstone.CollectingNeighborUpdater;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.world.level.Level;
|
||||
public abstract class Level_tickMixin implements LevelInterface
|
||||
{
|
||||
@Shadow @Final public boolean isClientSide;
|
||||
@Shadow @Final protected NeighborUpdater neighborUpdater;
|
||||
@Shadow @Final protected CollectingNeighborUpdater neighborUpdater;
|
||||
CarpetProfiler.ProfilerToken currentSection;
|
||||
CarpetProfiler.ProfilerToken entitySection;
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class Level_tickMixin implements LevelInterface
|
||||
|
||||
@Override
|
||||
@Unique
|
||||
public NeighborUpdater getNeighborUpdater() {
|
||||
public CollectingNeighborUpdater getNeighborUpdater() {
|
||||
return this.neighborUpdater;
|
||||
}
|
||||
|
||||
|
||||
@@ -921,7 +921,7 @@ public class EntityValue extends Value
|
||||
}
|
||||
else
|
||||
{
|
||||
((ServerLevel) e.level()).getChunkSource().broadcastAndSend(e, ClientboundEntityPositionSyncPacket.of(e));
|
||||
((ServerLevel) e.level()).getChunkSource().sendToTrackingPlayersAndSelf(e, ClientboundEntityPositionSyncPacket.of(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user