Test fix for "Detected setBlock in a far chunk"
This commit is contained in:
parent
e9e39f7152
commit
dbfaa09b5b
4 changed files with 35 additions and 5 deletions
|
@ -72,7 +72,7 @@ def useApi(String dep) {
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
duplicatesStrategy = 'EXCLUDE'
|
duplicatesStrategy = 'WARN'
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include "fabric.mod.json"
|
include "fabric.mod.json"
|
||||||
|
|
|
@ -139,7 +139,6 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
||||||
if (blockEntity.age > blockEntity.maxAge) {
|
if (blockEntity.age > blockEntity.maxAge) {
|
||||||
blockEntity.age = 0;
|
blockEntity.age = 0;
|
||||||
}
|
}
|
||||||
System.out.println(blockEntity.age);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package ru.betterend.mixin.common;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.SectionPos;
|
||||||
|
import net.minecraft.server.level.WorldGenRegion;
|
||||||
|
import net.minecraft.world.level.ChunkPos;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.SpikeFeature;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
import ru.bclib.util.MHelper;
|
||||||
|
|
||||||
|
@Mixin(WorldGenRegion.class)
|
||||||
|
public class WorldGenRegionMixin {
|
||||||
|
@Final
|
||||||
|
@Shadow
|
||||||
|
private ChunkPos center;
|
||||||
|
|
||||||
|
@Inject(method = "ensureCanWrite", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void be_alterBlockCheck(BlockPos blockPos, CallbackInfoReturnable<Boolean> info) {
|
||||||
|
int x = blockPos.getX() >> 4;
|
||||||
|
int z = blockPos.getZ() >> 4;
|
||||||
|
WorldGenRegion region = (WorldGenRegion) (Object) this;
|
||||||
|
info.setReturnValue(Math.abs(x - center.x) < 2 && Math.abs(z - center.z) < 2);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,8 @@
|
||||||
"PotionBrewingAccessor",
|
"PotionBrewingAccessor",
|
||||||
"MinecraftServerMixin",
|
"MinecraftServerMixin",
|
||||||
"EndDragonFightMixin",
|
"EndDragonFightMixin",
|
||||||
|
"ShuffelingListMixin",
|
||||||
|
"WorldGenRegionMixin",
|
||||||
"BlockBehaviourMixin",
|
"BlockBehaviourMixin",
|
||||||
"DimensionTypeMixin",
|
"DimensionTypeMixin",
|
||||||
"CraftingMenuMixin",
|
"CraftingMenuMixin",
|
||||||
|
@ -31,8 +33,7 @@
|
||||||
"MonsterMixin",
|
"MonsterMixin",
|
||||||
"EntityMixin",
|
"EntityMixin",
|
||||||
"PlayerMixin",
|
"PlayerMixin",
|
||||||
"SlimeMixin",
|
"SlimeMixin"
|
||||||
"ShuffelingListMixin"
|
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue