1.16.2-pre2

This commit is contained in:
gnembon committed 2020-08-05 19:54:20 -03:00
1 parent ba56fc7bd7
commit 1aadf361ec
6 files changed
+17 -12

No files matched your search

@@ -16,6 +16,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.source.BiomeAccess;
@@ -52,7 +53,7 @@ public class FeatureGenerator
{
return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere(
world, pos, world.getChunkManager().getChunkGenerator(),
false, Biomes.PLAINS, structureFeature.config);
false, world.getRegistryManager().get(Registry.BIOME_KEY).method_31140(Biomes.PLAINS), structureFeature.config);
}
@@ -89,7 +90,7 @@ public class FeatureGenerator
{
return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere(
world, pos, world.getChunkManager().getChunkGenerator(),
true, Biomes.PLAINS, structureFeature.config);
true, world.getRegistryManager().get(Registry.BIOME_KEY).method_31140(Biomes.PLAINS), structureFeature.config);
}
@FunctionalInterface
@@ -118,17 +119,17 @@ public class FeatureGenerator
return simplePlop(Feature.TREE.configure(config));
}
private static Thing spawnCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome)
private static Thing spawnCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey<Biome> biome)
{
return setupCustomStructure(structure, conf, biome, false);
}
private static Thing gridCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome)
private static Thing gridCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey<Biome> biome)
{
return setupCustomStructure(structure, conf, biome, true);
}
private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome, boolean wireOnly)
private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey<Biome> biome, boolean wireOnly)
{
return (w, p) -> ((StructureFeatureInterface)structure).plopAnywhere(w, p, w.getChunkManager().getChunkGenerator(), wireOnly, biome, conf);
return (w, p) -> ((StructureFeatureInterface)structure).plopAnywhere(w, p, w.getChunkManager().getChunkGenerator(), wireOnly, w.getRegistryManager().get(Registry.BIOME_KEY).method_31140(biome), conf);
}
public static Boolean spawn(String name, ServerWorld world, BlockPos pos)
@@ -254,7 +254,7 @@ public class OptimizedExplosion
LootContext.Builder lootBuilder = (new LootContext.Builder((ServerWorld)eAccess.getWorld()))
.random(eAccess.getWorld().random)
.parameter(LootContextParameters.POSITION, blockpos)
.parameter(LootContextParameters.ORIGIN, Vec3d.ofCenter(blockpos))
.parameter(LootContextParameters.TOOL, ItemStack.EMPTY)
.optionalParameter(LootContextParameters.BLOCK_ENTITY, blockEntity)
.optionalParameter(LootContextParameters.THIS_ENTITY, eAccess.getEntity());
@@ -32,7 +32,8 @@ public class ClientPlayNetworkHandler_smoothClientAnimationsMixin
shift = At.Shift.AFTER
))
private void recreateMovingPistons(ChunkDataS2CPacket packet, CallbackInfo ci,
int i, int j, BiomeArray biomeArray, WorldChunk worldChunk, Iterator var5, CompoundTag tag, BlockPos blockPos)
//int i, int j, BiomeArray biomeArray, WorldChunk worldChunk,
Iterator var5, CompoundTag tag, BlockPos blockPos)
{
if (CarpetSettings.smoothClientAnimations)
{
@@ -7,6 +7,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.SaplingBlock;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -23,7 +24,7 @@ public abstract class SaplingBlockMixin
cancellable = true)
private void onGenerate(ServerWorld serverWorld_1, BlockPos blockPos_1, BlockState blockState_1, Random random_1, CallbackInfo ci)
{
if(CarpetSettings.desertShrubs && serverWorld_1.getBiome(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1))
if(CarpetSettings.desertShrubs && serverWorld_1.getBiome(blockPos_1).getCategory() == Biome.Category.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1))
{
serverWorld_1.setBlockState(blockPos_1, Blocks.DEAD_BUSH.getDefaultState(), 3);
ci.cancel();
@@ -284,6 +284,8 @@ public class CarpetExpression
{
Chunk chunk = world.getChunk(pos);
chunk.setShouldSave(true);
/*
for (int i = 0; i<16; i++)
{
BlockPos section = new BlockPos((pos.getX()>>4 <<4)+8, 16*i, (pos.getZ()>>4 <<4)+8);
@@ -291,7 +293,7 @@ public class CarpetExpression
world.getChunkManager().markForUpdate(section.east());
world.getChunkManager().markForUpdate(section.west());
world.getChunkManager().markForUpdate(section.north());
}
}*/
}
private boolean tryBreakBlock_copy_from_ServerPlayerInteractionManager(ServerPlayerEntity player, BlockPos blockPos_1)