23w16a
This commit is contained in:
1 parent
97ab52a917
commit
d68c252180
11 files changed
+23
-35
No files matched your search
@@ -99,13 +99,14 @@ public abstract class ChunkMap_scarpetChunkCreationMixin implements ThreadedAnvi
|
||||
@Shadow
|
||||
protected abstract boolean promoteChunkMap();
|
||||
|
||||
@Shadow
|
||||
protected abstract CompletableFuture<Either<List<ChunkAccess>, ChunkLoadingFailure>> getChunkRangeFuture (final ChunkPos centerChunk, final int margin, final IntFunction<ChunkStatus> distanceToStatus);
|
||||
|
||||
@Shadow
|
||||
protected abstract Iterable<ChunkHolder> getChunks();
|
||||
|
||||
|
||||
@Shadow protected abstract CompletableFuture<Either<List<ChunkAccess>, ChunkLoadingFailure>> getChunkRangeFuture(final ChunkHolder chunkHolder, final int i, final IntFunction<ChunkStatus> intFunction);
|
||||
|
||||
//@Shadow protected abstract void postLoadProtoChunk(final ServerLevel serverLevel, final List<CompoundTag> list);
|
||||
|
||||
ThreadLocal<Boolean> generated = ThreadLocal.withInitial(() -> null);
|
||||
|
||||
// in protoChunkToFullChunk
|
||||
@@ -289,7 +290,8 @@ public abstract class ChunkMap_scarpetChunkCreationMixin implements ThreadedAnvi
|
||||
if (!(chunk.getStatus().isOrAfter(ChunkStatus.LIGHT.getParent()))) return;
|
||||
((ServerLightingProviderInterface) this.lightEngine).removeLightData(chunk);
|
||||
this.addRelightTicket(pos);
|
||||
final CompletableFuture<?> lightFuture = this.getChunkRangeFuture (pos, 1, (pos_) -> ChunkStatus.LIGHT)
|
||||
ChunkHolder chunkHolder = this.updatingChunkMap.get(pos.toLong());
|
||||
final CompletableFuture<?> lightFuture = this.getChunkRangeFuture(chunkHolder, 1, (pos_) -> ChunkStatus.LIGHT)
|
||||
.thenCompose(
|
||||
either -> either.map(
|
||||
list -> ((ServerLightingProviderInterface) this.lightEngine).relight(chunk),
|
||||
@@ -414,7 +416,7 @@ public abstract class ChunkMap_scarpetChunkCreationMixin implements ThreadedAnvi
|
||||
{
|
||||
final ChunkPos pos = chunk.getPos();
|
||||
|
||||
lightFutures.add(this.getChunkRangeFuture (pos, 1, (pos_) -> ChunkStatus.LIGHT).thenCompose(
|
||||
lightFutures.add(this.getChunkRangeFuture (this.updatingChunkMap.get(pos.toLong()), 1, (pos_) -> ChunkStatus.LIGHT).thenCompose(
|
||||
either -> either.map(
|
||||
list -> ((ServerLightingProviderInterface) this.lightEngine).relight(chunk),
|
||||
unloaded -> {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class FlowingFluid_liquidDamageDisabledMixin
|
||||
method = "canHoldFluid",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/material/Material;blocksMotion()Z"
|
||||
target = "Lnet/minecraft/world/level/block/state/BlockState;blocksMotion()Z"
|
||||
),
|
||||
cancellable = true
|
||||
)
|
||||
|
||||
@@ -7,8 +7,8 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.PickaxeItem;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(PickaxeItem.class)
|
||||
@@ -21,9 +21,10 @@ public class PickaxeItem_missingToolsMixin extends DiggerItem
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, BlockState state) {
|
||||
Material material = state.getMaterial();
|
||||
if (CarpetSettings.missingTools && material == Material.GLASS)
|
||||
return speed;
|
||||
if (CarpetSettings.missingTools && state.getBlock().getSoundType(state) == SoundType.GLASS)
|
||||
{
|
||||
return speed;
|
||||
}
|
||||
return super.getDestroySpeed(stack, state);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -8,13 +8,13 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(SculkSensorBlockEntity.VibrationConfig.class)
|
||||
@Mixin(SculkSensorBlockEntity.VibrationUser.class)
|
||||
public class SculkSensorBlockEntityVibrationConfig_sculkSensorRangeMixin
|
||||
{
|
||||
@Inject(method = "getListenerRadius", at = @At("HEAD"), cancellable = true)
|
||||
private void sculkSensorRange(CallbackInfoReturnable<Integer> cir)
|
||||
{
|
||||
if (CarpetSettings.sculkSensorRange != SculkSensorBlockEntity.VibrationConfig.LISTENER_RANGE) {
|
||||
if (CarpetSettings.sculkSensorRange != SculkSensorBlockEntity.VibrationUser.LISTENER_RANGE) {
|
||||
cir.setReturnValue(CarpetSettings.sculkSensorRange);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user