21w37a
This commit is contained in:
1 parent
70754dbfe8
commit
bc175509a2
24 files changed
+155
-113
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.9-SNAPSHOT'
|
||||
id 'fabric-loom' version '0.10-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx1G
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
# or better: https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.18_experimental-snapshot-7
|
||||
yarn_mappings=1.18_experimental-snapshot-7+build.1
|
||||
loader_version=0.11.6
|
||||
fabric_version=0.40.0+1.18_experimental
|
||||
minecraft_version=21w37a
|
||||
yarn_mappings=21w37a+build.5
|
||||
loader_version=0.11.7
|
||||
fabric_version=0.40.1+1.17
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.4.45
|
||||
|
||||
@@ -189,7 +189,7 @@ public class PlayerCommand
|
||||
Messenger.m(context.getSource(), "r Player ", "rb " + playerName, "r is already logged on");
|
||||
return true;
|
||||
}
|
||||
GameProfile profile = server.getUserCache().method_14515(playerName); // findByName .orElse(null)
|
||||
GameProfile profile = server.getUserCache().findByName(playerName).orElse(null);
|
||||
if (profile == null)
|
||||
{
|
||||
if (!CarpetSettings.allowSpawningOfflinePlayers)
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
public interface BiomeArrayInterface
|
||||
public interface BiomeArrayInterface // unused
|
||||
{
|
||||
void setBiomeAtIndex(BlockPos pos, World world, Biome what);
|
||||
}
|
||||
@@ -13,5 +13,5 @@ import net.minecraft.world.gen.feature.FeatureConfig;
|
||||
public interface StructureFeatureInterface<C>
|
||||
{
|
||||
boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly,Biome biome, FeatureConfig config);
|
||||
boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, ChunkPos chpos, Biome biome, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
||||
boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, ChunkPos chpos, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
||||
}
|
||||
@@ -308,11 +308,11 @@ public class EntityPlayerActionPack
|
||||
case BLOCK:
|
||||
{
|
||||
player.updateLastActionTime();
|
||||
ServerWorld world = player.getServerWorld();
|
||||
ServerWorld world = player.method_37908();
|
||||
BlockHitResult blockHit = (BlockHitResult) hit;
|
||||
BlockPos pos = blockHit.getBlockPos();
|
||||
Direction side = blockHit.getSide();
|
||||
if (pos.getY() < player.getServerWorld().getTopY() - (side == Direction.UP ? 1 : 0) && world.canPlayerModifyAt(player, pos))
|
||||
if (pos.getY() < player.method_37908().getTopY() - (side == Direction.UP ? 1 : 0) && world.canPlayerModifyAt(player, pos))
|
||||
{
|
||||
ActionResult result = player.interactionManager.interactBlock(player, world, player.getStackInHand(hand), hand, blockHit);
|
||||
if (result.isAccepted())
|
||||
@@ -347,7 +347,7 @@ public class EntityPlayerActionPack
|
||||
}
|
||||
}
|
||||
ItemStack handItem = player.getStackInHand(hand);
|
||||
if (player.interactionManager.interactItem(player, player.getServerWorld(), handItem, hand).isAccepted())
|
||||
if (player.interactionManager.interactItem(player, player.method_37908(), handItem, hand).isAccepted())
|
||||
{
|
||||
ap.itemUseCooldown = 3;
|
||||
return true;
|
||||
@@ -400,7 +400,7 @@ public class EntityPlayerActionPack
|
||||
boolean blockBroken = false;
|
||||
if (player.interactionManager.getGameMode().isCreative())
|
||||
{
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.getServerWorld().getTopY());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.method_37908().getTopY());
|
||||
ap.blockHitDelay = 5;
|
||||
blockBroken = true;
|
||||
}
|
||||
@@ -408,9 +408,9 @@ public class EntityPlayerActionPack
|
||||
{
|
||||
if (ap.currentBlock != null)
|
||||
{
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, side, player.getServerWorld().getTopY());
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, side, player.method_37908().getTopY());
|
||||
}
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.getServerWorld().getTopY());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.method_37908().getTopY());
|
||||
boolean notAir = !state.isAir();
|
||||
if (notAir && ap.curBlockDamageMP == 0)
|
||||
{
|
||||
@@ -433,7 +433,7 @@ public class EntityPlayerActionPack
|
||||
ap.curBlockDamageMP += state.calcBlockBreakingDelta(player, player.world, pos);
|
||||
if (ap.curBlockDamageMP >= 1)
|
||||
{
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, side, player.getServerWorld().getTopY());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, side, player.method_37908().getTopY());
|
||||
ap.currentBlock = null;
|
||||
ap.blockHitDelay = 5;
|
||||
blockBroken = true;
|
||||
@@ -455,7 +455,7 @@ public class EntityPlayerActionPack
|
||||
EntityPlayerActionPack ap = ((ServerPlayerEntityInterface) player).getActionPack();
|
||||
if (ap.currentBlock == null) return;
|
||||
player.world.setBlockBreakingInfo(-1, ap.currentBlock, -1);
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.getServerWorld().getTopY());
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.method_37908().getTopY());
|
||||
ap.currentBlock = null;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -135,8 +135,13 @@ public class FeatureGenerator
|
||||
|
||||
private static ConfiguredStructureFeature<?, ?> getDefaultFeature(StructureFeature<?> structure, ServerWorld world, BlockPos pos, boolean tryHard)
|
||||
{
|
||||
ConfiguredStructureFeature<?, ?> configuredFeature = world.getBiome(pos).getGenerationSettings().method_30978(structure.configure(null));
|
||||
if (configuredFeature.config != null || !tryHard) return configuredFeature;
|
||||
var definedStructures = world.getServer().getSaveProperties().getGeneratorOptions().getChunkGenerator().getStructuresConfig().method_38424(structure);
|
||||
var optinalBiome = world.getRegistryManager().get(Registry.BIOME_KEY).getKey(world.getBiome(pos));
|
||||
if (optinalBiome.isPresent())
|
||||
for (var configureStructure: definedStructures.inverse().get(optinalBiome.get()))
|
||||
if (configureStructure.feature == structure)
|
||||
return configureStructure;
|
||||
if (!tryHard) return null;
|
||||
return world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY).getEntries().stream().
|
||||
filter(cS -> cS.getValue().feature == structure).
|
||||
findFirst().map(Map.Entry::getValue).orElse(null);
|
||||
@@ -147,26 +152,21 @@ public class FeatureGenerator
|
||||
long seed = world.getSeed();
|
||||
ChunkGenerator generator = world.getChunkManager().getChunkGenerator();
|
||||
StructureConfig params = generator.getStructuresConfig().getForType(structure);
|
||||
synchronized(boo) {
|
||||
if (!generator.getBiomeSource().hasStructureFeature(structure))
|
||||
return null;
|
||||
}
|
||||
BiomeAccess biomeAccess = world.getBiomeAccess().withSource(generator.getBiomeSource());
|
||||
ChunkRandom chunkRandom = new ChunkRandom();
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
Biome biome = biomeAccess.getBiome(new BlockPos(chunkPos.getStartX() + 9, 0, chunkPos.getStartZ() + 9));
|
||||
ConfiguredStructureFeature<?, ?> configuredFeature = biome.getGenerationSettings().method_30978(structure.configure(null));
|
||||
Biome biome = world.getBiome(new BlockPos(chunkPos.getStartX() + 9, 0, chunkPos.getStartZ() + 9));
|
||||
ConfiguredStructureFeature<?, ?> configuredFeature = getDefaultFeature(structure, world, pos, false);
|
||||
if (configuredFeature == null || configuredFeature.config == null) return null;
|
||||
ChunkPos chunkPos2 = structure.getStartChunk(params, seed, chunkRandom, chunkPos.x, chunkPos.z); //find some chunk I guess
|
||||
// using here world for heightview, rather than chunk since we - unlike vanilla, want to avoid creating any chunks even on the
|
||||
// structure starts level - lets see where would that take us.
|
||||
if (chunkPos.x == chunkPos2.x && chunkPos.z == chunkPos2.z && ((StructureFeatureInterface)structure).shouldStartPublicAt(generator, generator.getBiomeSource(), seed, chunkRandom, chunkPos, biome, chunkPos, configuredFeature.config, world)) // should start at
|
||||
if (chunkPos.x == chunkPos2.x && chunkPos.z == chunkPos2.z && ((StructureFeatureInterface)structure).shouldStartPublicAt(generator, generator.getBiomeSource(), seed, chunkRandom, chunkPos, chunkPos, configuredFeature.config, world)) // should start at
|
||||
{
|
||||
if (!computeBox) return StructureStart.DEFAULT;
|
||||
StructureManager manager = world.getStructureManager();
|
||||
StructureStart<T> structureStart3 = structure.getStructureStartFactory().create((StructureFeature<T>) configuredFeature.feature, chunkPos, 0, seed);
|
||||
synchronized (boo) {
|
||||
structureStart3.init(world.getRegistryManager(), generator, manager, chunkPos, biome, (T) configuredFeature.config, world);
|
||||
structureStart3.init(world.getRegistryManager(), generator, manager, chunkPos, (T) configuredFeature.config, world, (b) -> b == biome);
|
||||
}
|
||||
if (!structureStart3.hasChildren()) return null;
|
||||
return structureStart3;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.world.biome.source.BiomeArray;
|
||||
//import net.minecraft.world.biome.source.BiomeArray;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(BiomeArray.class)
|
||||
//@Mixin(BiomeArray.class)
|
||||
public class BiomeArray_cleanLogsMixin
|
||||
{
|
||||
// this changed in 21w18a - maybe its not needed anymore, please check
|
||||
@SuppressWarnings("UnresolvedMixinReference")
|
||||
@Redirect(method = "<init>(Lnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/HeightLimitView;[I)V", at = @At(
|
||||
//@SuppressWarnings("UnresolvedMixinReference")
|
||||
/*@Redirect(method = "<init>(Lnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/HeightLimitView;[I)V", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V")
|
||||
)
|
||||
private void skipLog(Logger logger, String message, Object p0, Object p1)
|
||||
{
|
||||
if (!CarpetSettings.cleanLogs) logger.warn(message, p0, p1);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -5,16 +5,16 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.BiomeArray;
|
||||
//import net.minecraft.world.biome.source.BiomeArray;
|
||||
import net.minecraft.world.biome.source.BiomeCoords;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(BiomeArray.class)
|
||||
public class BiomeArray_getBiomeArrayMixin implements BiomeArrayInterface
|
||||
//@Mixin(BiomeArray.class)
|
||||
public class BiomeArray_getBiomeArrayMixin //implements BiomeArrayInterface
|
||||
{
|
||||
|
||||
/*
|
||||
@Shadow @Final private static int HORIZONTAL_SECTION_COUNT;
|
||||
|
||||
@Shadow @Final public static int HORIZONTAL_BIT_MASK;
|
||||
@@ -35,4 +35,6 @@ public class BiomeArray_getBiomeArrayMixin implements BiomeArrayInterface
|
||||
int int_6 = BiomeCoords.fromBlock(pos.getZ()) & HORIZONTAL_BIT_MASK;
|
||||
data[(int_5 << (HORIZONTAL_SECTION_COUNT + HORIZONTAL_SECTION_COUNT)) | (int_6 << HORIZONTAL_SECTION_COUNT) | int_4] = what;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.mojang.datafixers.util.Either;
|
||||
import net.minecraft.server.world.ChunkHolder;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.thread.ThreadExecutor;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
@@ -29,7 +30,7 @@ public abstract class ChunkHolder_scarpetChunkCreationMixin implements ChunkHold
|
||||
{
|
||||
int i = ChunkStatus.EMPTY.getIndex();
|
||||
CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> completableFuture2 = CompletableFuture.supplyAsync(
|
||||
() -> Either.left(new ProtoChunk(chpos, UpgradeData.NO_UPGRADE_DATA, world)),
|
||||
() -> Either.left(new ProtoChunk(chpos, UpgradeData.NO_UPGRADE_DATA, world, world.getRegistryManager().get(Registry.BIOME_KEY))),
|
||||
executor
|
||||
);
|
||||
combineSavingFuture(completableFuture2, "unfull"); // possible debug data
|
||||
|
||||
@@ -142,12 +142,12 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
|
||||
}
|
||||
|
||||
@Inject(method = "writeNbt", at = @At(value = "RETURN", shift = At.Shift.BEFORE))
|
||||
private void onToTag(NbtCompound NbtCompound_1, CallbackInfoReturnable<NbtCompound> cir)
|
||||
private void onToTag(NbtCompound NbtCompound_1, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetSettings.movableBlockEntities && this.carriedBlockEntity != null)
|
||||
{
|
||||
//Leave name "carriedTileEntityCM" instead of "carriedBlockEntityCM" for upgrade compatibility with 1.13.2 movable TE
|
||||
NbtCompound_1.put("carriedTileEntityCM", this.carriedBlockEntity.writeNbt(new NbtCompound()));
|
||||
NbtCompound_1.put("carriedTileEntityCM", this.carriedBlockEntity.method_38244()); // toNBT
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class ServerPlayNetworkHandler_scarpetEventsMixin
|
||||
))
|
||||
private void onEntityInteract(PlayerInteractEntityC2SPacket playerInteractEntityC2SPacket_1, CallbackInfo ci)
|
||||
{
|
||||
PLAYER_INTERACTS_WITH_ENTITY.onEntityHandAction(player, playerInteractEntityC2SPacket_1.getEntity(player.getServerWorld()), playerInteractEntityC2SPacket_1.getHand());
|
||||
PLAYER_INTERACTS_WITH_ENTITY.onEntityHandAction(player, playerInteractEntityC2SPacket_1.getEntity(player.method_37908()), playerInteractEntityC2SPacket_1.getHand());
|
||||
}*/
|
||||
|
||||
/*@Inject(method = "onPlayerInteractEntity", at = @At(
|
||||
@@ -241,7 +241,7 @@ public class ServerPlayNetworkHandler_scarpetEventsMixin
|
||||
private void onEntityAttack(PlayerInteractEntityC2SPacket playerInteractEntityC2SPacket_1, CallbackInfo ci)
|
||||
{
|
||||
//todo add hit and hand in the future
|
||||
PLAYER_ATTACKS_ENTITY.onEntityHandAction(player, playerInteractEntityC2SPacket_1.getEntity(player.getServerWorld()), null);
|
||||
PLAYER_ATTACKS_ENTITY.onEntityHandAction(player, playerInteractEntityC2SPacket_1.getEntity(player.method_37908()), null);
|
||||
}*/
|
||||
|
||||
@Inject(method = "onButtonClick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;updateLastActionTime()V"))
|
||||
|
||||
@@ -2,25 +2,32 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import carpet.fakes.StructureFeatureInterface;
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.structure.StructureStart;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.HeightLimitView;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.BiomeCoords;
|
||||
import net.minecraft.world.biome.source.BiomeSource;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
import net.minecraft.world.gen.ChunkRandom;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.gen.feature.FeatureConfig;
|
||||
import net.minecraft.world.gen.feature.StructureFeature;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@Mixin(StructureFeature.class)
|
||||
public abstract class StructureFeatureMixin<C extends FeatureConfig> implements StructureFeatureInterface<C>
|
||||
@@ -29,7 +36,9 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
|
||||
@Shadow public abstract StructureFeature.StructureStartFactory getStructureStartFactory();
|
||||
|
||||
@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos chunkPos, Biome biome, ChunkPos chunkPos2, C featureConfig, HeightLimitView heightLimitView);
|
||||
//@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos chunkPos, Biome biome, ChunkPos chunkPos2, C featureConfig, HeightLimitView heightLimitView);
|
||||
|
||||
@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos pos, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
||||
|
||||
@Override
|
||||
public boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly, Biome biome, FeatureConfig config)
|
||||
@@ -48,12 +57,26 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
{
|
||||
return false;
|
||||
}
|
||||
world.getChunk(j, k).addStructureReference((StructureFeature) (Object)this, chId);
|
||||
StructureFeature<?> thiss = (StructureFeature) (Object)this;
|
||||
world.getChunk(j, k).addStructureReference(thiss, chId);
|
||||
|
||||
BlockBox box = structurestart.setBoundingBoxFromChildren(); // getBB
|
||||
|
||||
if (!wireOnly)
|
||||
{
|
||||
structurestart.generateStructure(world, world.getStructureAccessor(), generator, rand,box, new ChunkPos(j, k));
|
||||
Registry<StructureFeature<?>> registry3 = world.getRegistryManager().get(Registry.STRUCTURE_FEATURE_KEY);
|
||||
Registry<Biome> registry = world.getRegistryManager().get(Registry.BIOME_KEY);
|
||||
world.method_36972(() -> {
|
||||
Objects.requireNonNull(thiss);
|
||||
return registry3.getKey(thiss).map(Object::toString).orElseGet(thiss::toString);
|
||||
});
|
||||
ImmutableMultimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>> immutableMultimap = generator.getStructuresConfig().method_38424((StructureFeature) (Object)this);
|
||||
|
||||
Predicate<Biome> predicate = (b) -> {
|
||||
Objects.requireNonNull(immutableMultimap);
|
||||
return registry.getKey(b).filter(immutableMultimap::containsValue).isPresent();
|
||||
};
|
||||
structurestart.generateStructure(world, world.getStructureAccessor(), generator, rand, predicate, box, new ChunkPos(j, k));
|
||||
}
|
||||
//structurestart.notifyPostProcessAt(new ChunkPos(j, k));
|
||||
int i = Math.max(box.getBlockCountX(),box.getBlockCountZ())/16+1;
|
||||
@@ -67,7 +90,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
long nbchkid = ChunkPos.toLong(k1, l1);
|
||||
if (box.intersectsXZ(k1<<4, l1<<4, (k1<<4) + 15, (l1<<4) + 15))
|
||||
{
|
||||
world.getChunk(k1, l1).addStructureReference((StructureFeature) (Object)this, chId);
|
||||
world.getChunk(k1, l1).addStructureReference(thiss, chId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,6 +111,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
private StructureStart forceStructureStart(ServerWorld worldIn, ChunkGenerator generator, Random rand, long packedChunkPos, Biome biome, FeatureConfig config)
|
||||
{
|
||||
ChunkPos chunkpos = new ChunkPos(packedChunkPos);
|
||||
BlockPos centerpos = chunkpos.getBlockPos(9, 0, 9);
|
||||
StructureStart structurestart;
|
||||
|
||||
Chunk ichunk = worldIn.getChunk(chunkpos.x, chunkpos.z, ChunkStatus.STRUCTURE_STARTS, false);
|
||||
@@ -103,12 +127,13 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
}
|
||||
Biome biome_1 = biome;
|
||||
if (biome == null)
|
||||
biome_1 = generator.getBiomeSource().getBiomeForNoiseGen((chunkpos.getStartX() + 9) >> 2, 0, (chunkpos.getStartZ() + 9) >> 2 );
|
||||
biome_1 = generator.getBiomeForNoiseGen(BiomeCoords.fromBlock(centerpos.getX()),
|
||||
BiomeCoords.fromBlock(centerpos.getY()), BiomeCoords.fromBlock(centerpos.getZ()));
|
||||
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos,0,worldIn.getSeed());
|
||||
if (config == null)
|
||||
config = new DefaultFeatureConfig();
|
||||
structurestart1.init(worldIn.getRegistryManager(), generator, worldIn.getStructureManager() , chunkpos, biome_1, config, ichunk);
|
||||
structurestart1.init(worldIn.getRegistryManager(), generator, worldIn.getStructureManager() , chunkpos, config, ichunk, b -> true);
|
||||
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
||||
|
||||
if (structurestart.hasChildren())
|
||||
@@ -121,8 +146,8 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, ChunkPos chpos, Biome biome, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView)
|
||||
public boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, ChunkPos chpos, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView)
|
||||
{
|
||||
return shouldStartAt(chunkGenerator, biomeSource, l, chunkRandom, chpos, biome, chunkPos, featureConfig, heightLimitView);
|
||||
return shouldStartAt(chunkGenerator, biomeSource, l, chunkRandom, chpos, chunkPos, featureConfig, heightLimitView);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public abstract class TradeOutputSlot_scarpetEventMixin {
|
||||
target = "Lnet/minecraft/village/Merchant;trade(Lnet/minecraft/village/TradeOffer;)V")
|
||||
)
|
||||
private void onTrade(PlayerEntity player, ItemStack stack, CallbackInfo ci) {
|
||||
if(PLAYER_TRADES.isNeeded() && !this.merchant.getMerchantWorld().isClient())
|
||||
if(PLAYER_TRADES.isNeeded() && !player.world.isClient())
|
||||
{
|
||||
PLAYER_TRADES.onTrade((ServerPlayerEntity) player, merchant, merchantInventory.getTradeOffer());
|
||||
}
|
||||
|
||||
@@ -7,43 +7,46 @@ import net.minecraft.block.BlockEntityProvider;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.PistonExtensionBlock;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkSectionPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.HeightLimitView;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.TickScheduler;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkSection;
|
||||
import net.minecraft.world.chunk.UpgradeData;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
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.Redirect;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static net.minecraft.world.chunk.WorldChunk.EMPTY_SECTION;
|
||||
|
||||
@Mixin(WorldChunk.class)
|
||||
public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
|
||||
public abstract class WorldChunk_movableTEMixin extends Chunk implements WorldChunkInterface
|
||||
{
|
||||
@Shadow
|
||||
@Final
|
||||
private ChunkSection[] sections;
|
||||
@Shadow
|
||||
@Final
|
||||
private Map<Heightmap.Type, Heightmap> heightmaps;
|
||||
@Shadow
|
||||
private boolean shouldSave;
|
||||
@Shadow
|
||||
@Final
|
||||
private World world;
|
||||
|
||||
World world;
|
||||
|
||||
public WorldChunk_movableTEMixin(ChunkPos chunkPos, UpgradeData upgradeData, HeightLimitView heightLimitView, Registry<Biome> registry, long l, @Nullable ChunkSection[] chunkSections, TickScheduler<Block> tickScheduler, TickScheduler<Fluid> tickScheduler2)
|
||||
{
|
||||
super(chunkPos, upgradeData, heightLimitView, registry, l, chunkSections, tickScheduler, tickScheduler2);
|
||||
}
|
||||
|
||||
@Shadow
|
||||
/* @Nullable */
|
||||
public abstract BlockEntity getBlockEntity(BlockPos blockPos_1, WorldChunk.CreationType worldChunk$CreationType_1);
|
||||
|
||||
@Shadow protected abstract <T extends BlockEntity> void updateTicker(T blockEntity);
|
||||
|
||||
@Shadow public abstract void addBlockEntity(BlockEntity blockEntity);
|
||||
|
||||
// Fix Failure: If a moving BlockEntity is placed while BlockEntities are ticking, this will not find it and then replace it with a new TileEntity!
|
||||
// blockEntity_2 = this.getBlockEntity(blockPos_1, WorldChunk.CreationType.CHECK);
|
||||
// question is - with the changes in the BE handling this might not be a case anymore
|
||||
@@ -70,23 +73,20 @@ public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
|
||||
* @author 2No2Name
|
||||
*/
|
||||
/* @Nullable */
|
||||
// todo update me to the new version
|
||||
public BlockState setBlockStateWithBlockEntity(BlockPos blockPos_1, BlockState newBlockState, BlockEntity newBlockEntity,
|
||||
boolean boolean_1)
|
||||
{
|
||||
int x = blockPos_1.getX() & 15;
|
||||
int y = blockPos_1.getY();
|
||||
int z = blockPos_1.getZ() & 15;
|
||||
int section = world.getSectionIndex(y);
|
||||
ChunkSection chunkSection = this.sections[section];
|
||||
if (chunkSection == EMPTY_SECTION)
|
||||
ChunkSection chunkSection = this.getSection(this.getSectionIndex(y));
|
||||
if (chunkSection.isEmpty())
|
||||
{
|
||||
if (newBlockState.isAir())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
chunkSection = new ChunkSection(ChunkSectionPos.getSectionCoord(y));
|
||||
this.sections[section] = chunkSection;
|
||||
}
|
||||
|
||||
boolean boolean_2 = chunkSection.isEmpty();
|
||||
@@ -99,10 +99,10 @@ public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
|
||||
{
|
||||
Block newBlock = newBlockState.getBlock();
|
||||
Block oldBlock = oldBlockState.getBlock();
|
||||
((Heightmap) this.heightmaps.get(Heightmap.Type.MOTION_BLOCKING)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.heightmaps.get(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.heightmaps.get(Heightmap.Type.OCEAN_FLOOR)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.heightmaps.get(Heightmap.Type.WORLD_SURFACE)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.field_34541.get(Heightmap.Type.MOTION_BLOCKING)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.field_34541.get(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.field_34541.get(Heightmap.Type.OCEAN_FLOOR)).trackUpdate(x, y, z, newBlockState);
|
||||
((Heightmap) this.field_34541.get(Heightmap.Type.WORLD_SURFACE)).trackUpdate(x, y, z, newBlockState);
|
||||
boolean boolean_3 = chunkSection.isEmpty();
|
||||
if (boolean_2 != boolean_3)
|
||||
{
|
||||
@@ -156,7 +156,7 @@ public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
|
||||
newBlockState.onBlockAdded(this.world, blockPos_1, oldBlockState, boolean_1); //This can call setblockstate! (e.g. hopper does)
|
||||
}
|
||||
|
||||
this.shouldSave = true;
|
||||
this.field_34537 = true; // shouldSave
|
||||
return oldBlockState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
UserCache.setUseRemote(false);
|
||||
GameProfile gameprofile;
|
||||
try {
|
||||
gameprofile = server.getUserCache().method_14515(username); //findByName .orElse(null)
|
||||
gameprofile = server.getUserCache().findByName(username).orElse(null); //findByName .orElse(null)
|
||||
}
|
||||
finally {
|
||||
UserCache.setUseRemote(server.isDedicated() && server.isOnlineMode());
|
||||
@@ -70,7 +70,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
instance.interactionManager.changeGameMode(gamemode);
|
||||
server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(instance, (byte) (instance.headYaw * 256 / 360)), dimensionId);//instance.dimension);
|
||||
server.getPlayerManager().sendToDimension(new EntityPositionS2CPacket(instance), dimensionId);//instance.dimension);
|
||||
instance.getServerWorld().getChunkManager().updatePosition(instance);
|
||||
//instance.world.getChunkManager(). updatePosition(instance);
|
||||
instance.dataTracker.set(PLAYER_MODEL_PARTS, (byte) 0x7f); // show all model layers (incl. capes)
|
||||
instance.getAbilities().flying = flying;
|
||||
return instance;
|
||||
@@ -80,7 +80,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
{
|
||||
player.getServer().getPlayerManager().remove(player);
|
||||
player.networkHandler.disconnect(new TranslatableText("multiplayer.disconnect.duplicate_login"));
|
||||
ServerWorld worldIn = player.getServerWorld();//.getWorld(player.dimension);
|
||||
ServerWorld worldIn = player.method_37908();//.getWorld(player.dimension);
|
||||
GameProfile gameprofile = player.getGameProfile();
|
||||
EntityPlayerMPFake playerShadow = new EntityPlayerMPFake(server, worldIn, gameprofile, true);
|
||||
server.getPlayerManager().onPlayerConnect(new NetworkManagerFake(NetworkSide.SERVERBOUND), playerShadow);
|
||||
@@ -95,7 +95,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
|
||||
server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(playerShadow, (byte) (player.headYaw * 256 / 360)), playerShadow.world.getRegistryKey());
|
||||
server.getPlayerManager().sendToAll(new PlayerListS2CPacket(PlayerListS2CPacket.Action.ADD_PLAYER, playerShadow));
|
||||
player.getServerWorld().getChunkManager().updatePosition(playerShadow);
|
||||
//player.world.getChunkManager().updatePosition(playerShadow);
|
||||
playerShadow.getAbilities().flying = player.getAbilities().flying;
|
||||
return playerShadow;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
if (this.getServer().getTicks() % 10 == 0)
|
||||
{
|
||||
this.networkHandler.syncWithPlayerPosition();
|
||||
this.getServerWorld().getChunkManager().updatePosition(this);
|
||||
//this.world.getChunkManager().updatePosition(this);
|
||||
onTeleportationDone(); //<- causes hard crash but would need to be done to enable portals // not as of 1.17
|
||||
}
|
||||
try
|
||||
|
||||
@@ -494,7 +494,7 @@ public class CarpetEventServer
|
||||
{
|
||||
return Arrays.asList(
|
||||
new EntityValue(player),
|
||||
new BlockValue(null, player.getServerWorld(), blockpos),
|
||||
new BlockValue(null, player.method_37908(), blockpos),
|
||||
StringValue.of(facing.getName())
|
||||
);
|
||||
}, player::getCommandSource);
|
||||
@@ -515,7 +515,7 @@ public class CarpetEventServer
|
||||
new EntityValue(player),
|
||||
ValueConversions.of(itemstack),
|
||||
StringValue.of(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.getServerWorld(), blockpos),
|
||||
new BlockValue(null, player.method_37908(), blockpos),
|
||||
StringValue.of(enumfacing.getName()),
|
||||
ListValue.of(
|
||||
new NumericValue(vec3d.x),
|
||||
@@ -539,7 +539,7 @@ public class CarpetEventServer
|
||||
return Arrays.asList(
|
||||
new EntityValue(player),
|
||||
StringValue.of(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.getServerWorld(), blockpos),
|
||||
new BlockValue(null, player.method_37908(), blockpos),
|
||||
StringValue.of(enumfacing.getName()),
|
||||
ListValue.of(
|
||||
new NumericValue(vec3d.x),
|
||||
@@ -559,7 +559,7 @@ public class CarpetEventServer
|
||||
new EntityValue(player),
|
||||
ValueConversions.of(itemstack),
|
||||
StringValue.of(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.getServerWorld(), pos)
|
||||
new BlockValue(null, player.method_37908(), pos)
|
||||
), player::getCommandSource);
|
||||
}
|
||||
};
|
||||
@@ -569,7 +569,7 @@ public class CarpetEventServer
|
||||
public void onBlockBroken(ServerPlayerEntity player, BlockPos pos, BlockState previousBS)
|
||||
{
|
||||
handler.call(
|
||||
() -> Arrays.asList(new EntityValue(player), new BlockValue(previousBS, player.getServerWorld(), pos)),
|
||||
() -> Arrays.asList(new EntityValue(player), new BlockValue(previousBS, player.method_37908(), pos)),
|
||||
player::getCommandSource
|
||||
);
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@ public class CarpetEventServer
|
||||
valArgs.add(EntityValue.of(player));
|
||||
for (Object o: args)
|
||||
{
|
||||
valArgs.add(ValueConversions.guess(player.getServerWorld(), o));
|
||||
valArgs.add(ValueConversions.guess(player.method_37908(), o));
|
||||
}
|
||||
return valArgs;
|
||||
}, player::getCommandSource
|
||||
|
||||
@@ -84,6 +84,7 @@ import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.Heightmap;
|
||||
@@ -91,6 +92,7 @@ import net.minecraft.world.LightType;
|
||||
import net.minecraft.world.SpawnHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.BiomeCoords;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
@@ -1176,7 +1178,19 @@ public class WorldAccess {
|
||||
ServerWorld world = cc.s.getWorld();
|
||||
BlockPos pos = locator.block.getPos();
|
||||
Chunk chunk = world.getChunk(pos.getX() >> 4, pos.getZ() >> 4, ChunkStatus.BIOMES);
|
||||
((BiomeArrayInterface)chunk.getBiomeArray()).setBiomeAtIndex(pos, world, biome);
|
||||
if (chunk instanceof WorldChunk) return Value.FALSE; // questinoalble, but it makes sense
|
||||
int biomeX = BiomeCoords.fromBlock(pos.getX());
|
||||
int biomeY = BiomeCoords.fromBlock(pos.getY());
|
||||
int biomeZ = BiomeCoords.fromBlock(pos.getZ());
|
||||
try {
|
||||
int i = BiomeCoords.fromBlock(chunk.getBottomY());
|
||||
int j = i + BiomeCoords.fromBlock(chunk.getHeight()) - 1;
|
||||
int k = MathHelper.clamp(biomeY, i, j);
|
||||
int l = chunk.getSectionIndex(BiomeCoords.toBlock(k));
|
||||
chunk.getSection(l).method_38294().setSync(biomeX & 3, k & 3, biomeZ & 3, biome);
|
||||
} catch (Throwable var8) {
|
||||
return Value.FALSE;
|
||||
}
|
||||
if (doImmediateUpdate) WorldTools.forceChunkUpdate(pos, world);
|
||||
return Value.TRUE;
|
||||
});
|
||||
|
||||
@@ -46,9 +46,9 @@ public class BiomeInfo
|
||||
)
|
||||
);
|
||||
});
|
||||
put("structures", (w, b) -> {
|
||||
Registry<ConfiguredStructureFeature<?,?>> registry = w.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY);
|
||||
return ListValue.wrap(b.getGenerationSettings().getStructureFeatures().stream().map(str -> ValueConversions.of(registry.getId(str.get()))));
|
||||
});
|
||||
//put("structures", (w, b) -> {
|
||||
// Registry<ConfiguredStructureFeature<?,?>> registry = w.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY);
|
||||
// return ListValue.wrap(b.getGenerationSettings().getStructureFeatures().stream().map(str -> ValueConversions.of(registry.getId(str.get()))));
|
||||
//});
|
||||
}};
|
||||
}
|
||||
@@ -582,8 +582,8 @@ public class ShapeDispatcher
|
||||
Collections.singletonList(p),
|
||||
particle,
|
||||
density,
|
||||
relativiseRender(p.getServerWorld(), from, 0),
|
||||
relativiseRender(p.getServerWorld(), to, 0)
|
||||
relativiseRender(p.world, from, 0),
|
||||
relativiseRender(p.world, to, 0)
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -661,8 +661,8 @@ public class ShapeDispatcher
|
||||
if (p.world.getRegistryKey() == shapeDimension) drawParticleLine(
|
||||
Collections.singletonList(p),
|
||||
particle,
|
||||
relativiseRender(p.getServerWorld(), from, 0),
|
||||
relativiseRender(p.getServerWorld(), to, 0),
|
||||
relativiseRender(p.world, from, 0),
|
||||
relativiseRender(p.world, to, 0),
|
||||
density
|
||||
);
|
||||
};
|
||||
@@ -718,7 +718,7 @@ public class ShapeDispatcher
|
||||
ParticleEffect particle = replacementParticle();
|
||||
int partno = Math.min(1000,20*subdivisions);
|
||||
Random rand = p.world.getRandom();
|
||||
ServerWorld world = p.getServerWorld();
|
||||
ServerWorld world = p.method_37908();
|
||||
|
||||
Vec3d ccenter = relativiseRender(world, center, 0 );
|
||||
|
||||
@@ -796,7 +796,7 @@ public class ShapeDispatcher
|
||||
ParticleEffect particle = replacementParticle();
|
||||
int partno = (int)Math.min(1000,Math.sqrt(20*subdivisions*(1+height)));
|
||||
Random rand = p.world.getRandom();
|
||||
ServerWorld world = p.getServerWorld();
|
||||
ServerWorld world = p.method_37908();
|
||||
|
||||
Vec3d ccenter = relativiseRender(world, center, 0 );
|
||||
|
||||
@@ -1275,7 +1275,7 @@ public class ShapeDispatcher
|
||||
int parts = 0;
|
||||
for (ServerPlayerEntity player : playerList)
|
||||
{
|
||||
ServerWorld world = player.getServerWorld();
|
||||
ServerWorld world = player.method_37908();
|
||||
world.spawnParticles(player, particle, true,
|
||||
(towards.x)/2+from.x, (towards.y)/2+from.y, (towards.z)/2+from.z, particles/3,
|
||||
towards.x/6, towards.y/6, towards.z/6, 0.0);
|
||||
@@ -1292,7 +1292,7 @@ public class ShapeDispatcher
|
||||
int dev = 2*divider;
|
||||
for (ServerPlayerEntity player : playerList)
|
||||
{
|
||||
ServerWorld world = player.getServerWorld();
|
||||
ServerWorld world = player.method_37908();
|
||||
world.spawnParticles(player, particle, true,
|
||||
(towards.x)/center+from.x, (towards.y)/center+from.y, (towards.z)/center+from.z, particles/divider,
|
||||
towards.x/dev, towards.y/dev, towards.z/dev, 0.0);
|
||||
@@ -1313,7 +1313,7 @@ public class ShapeDispatcher
|
||||
int pcount = 0;
|
||||
if (distance < 100)
|
||||
{
|
||||
Random rand = players.get(0).getServerWorld().random;
|
||||
Random rand = players.get(0).world.random;
|
||||
int particles = (int)(distance/density)+1;
|
||||
Vec3d towards = to.subtract(from);
|
||||
for (int i = 0; i < particles; i++)
|
||||
@@ -1321,7 +1321,7 @@ public class ShapeDispatcher
|
||||
Vec3d at = from.add(towards.multiply( rand.nextDouble()));
|
||||
for (ServerPlayerEntity player : players)
|
||||
{
|
||||
player.getServerWorld().spawnParticles(player, particle, true,
|
||||
player.method_37908().spawnParticles(player, particle, true,
|
||||
at.x, at.y, at.z, 1,
|
||||
0.0, 0.0, 0.0, 0.0);
|
||||
pcount ++;
|
||||
@@ -1339,7 +1339,7 @@ public class ShapeDispatcher
|
||||
{
|
||||
for (ServerPlayerEntity player : players)
|
||||
{
|
||||
player.getServerWorld().spawnParticles(player, particle, true,
|
||||
player.method_37908().spawnParticles(player, particle, true,
|
||||
delta.x+from.x, delta.y+from.y, delta.z+from.z, 1,
|
||||
0.0, 0.0, 0.0, 0.0);
|
||||
pcount ++;
|
||||
|
||||
@@ -110,7 +110,11 @@ public class WorldTools
|
||||
//chunkGenerator2 = GeneratorOptions.createOverworldGenerator(server.getRegistryManager().get(Registry.BIOME_KEY), server.getRegistryManager().get(Registry.NOISE_SETTINGS_WORLDGEN), (seed==null)?l:seed);
|
||||
|
||||
// from world/gen/GeneratorOptions
|
||||
chunkGenerator2 = new NoiseChunkGenerator(MultiNoiseBiomeSource.createVanillaSource(server.getRegistryManager().get(Registry.BIOME_KEY), seed), seed, () -> {
|
||||
//chunkGenerator2 = new NoiseChunkGenerator(MultiNoiseBiomeSource.createVanillaSource(server.getRegistryManager().get(Registry.BIOME_KEY), seed), seed, () -> {
|
||||
// return server.getRegistryManager().get(Registry.CHUNK_GENERATOR_SETTINGS_KEY).getOrThrow(ChunkGeneratorSettings.OVERWORLD);
|
||||
//});
|
||||
|
||||
chunkGenerator2 = new NoiseChunkGenerator(MultiNoiseBiomeSource.Preset.OVERWORLD.getBiomeSource(server.getRegistryManager().get(Registry.BIOME_KEY)), seed, () -> {
|
||||
return server.getRegistryManager().get(Registry.CHUNK_GENERATOR_SETTINGS_KEY).getOrThrow(ChunkGeneratorSettings.OVERWORLD);
|
||||
});
|
||||
|
||||
@@ -142,7 +146,7 @@ public class WorldTools
|
||||
List<ServerPlayerEntity> nearbyPlayers = world.getPlayers(p -> pos.getSquaredDistance(p.getX(), pos.getY(), p.getZ(), true) < vvd);
|
||||
if (!nearbyPlayers.isEmpty())
|
||||
{
|
||||
ChunkDataS2CPacket packet = new ChunkDataS2CPacket(worldChunk);
|
||||
ChunkDataS2CPacket packet = new ChunkDataS2CPacket(worldChunk, world.getLightingProvider(), null, null, false); // false seems to update neighbours as well.
|
||||
ChunkPos chpos = new ChunkPos(pos);
|
||||
nearbyPlayers.forEach(p -> p.networkHandler.sendPacket(packet));
|
||||
}
|
||||
|
||||
@@ -118,13 +118,12 @@ public class BlockValue extends Value
|
||||
if (world != null && pos != null)
|
||||
{
|
||||
BlockEntity be = getBlockEntity(world, pos);
|
||||
NbtCompound tag = new NbtCompound();
|
||||
if (be == null)
|
||||
{
|
||||
data = tag;
|
||||
data = new NbtCompound();
|
||||
return null;
|
||||
}
|
||||
data = be.writeNbt(tag);
|
||||
data = be.method_38244(); // toNBT
|
||||
return data;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -763,7 +763,7 @@ public class EntityValue extends Value
|
||||
ServerPlayerInteractionManagerInterface manager = (ServerPlayerInteractionManagerInterface) (((ServerPlayerEntity) e).interactionManager);
|
||||
BlockPos pos = manager.getCurrentBreakingBlock();
|
||||
if (pos == null) return Value.NULL;
|
||||
return new BlockValue(null, ((ServerPlayerEntity) e).getServerWorld(), pos);
|
||||
return new BlockValue(null, (ServerWorld) e.world, pos);
|
||||
}
|
||||
return Value.NULL;
|
||||
});
|
||||
|
||||
@@ -110,8 +110,6 @@
|
||||
"FlatChunkGeneratorMixin",
|
||||
"ChunkGenerator_scarpetMixin",
|
||||
|
||||
"BiomeArray_getBiomeArrayMixin",
|
||||
|
||||
"GuardianEntityMixin",
|
||||
"DesertPyramidFeatureMixin",
|
||||
"HuskEntityMixin",
|
||||
@@ -237,7 +235,6 @@
|
||||
"DebugRenderer_scarpetRenderMixin",
|
||||
"WorldRenderer_scarpetRenderMixin",
|
||||
|
||||
"BiomeArray_cleanLogsMixin",
|
||||
"SoundEngineInt_cleanLogsMixin",
|
||||
"SoundSystem_cleanLogsMixin"
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user