This commit is contained in:
modmuss50 2022-03-24 20:18:23 +00:00
parent f21b1d345a
commit a67d2aa505
13 changed files with 45 additions and 61 deletions
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/mixin/biome
fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command
fabric-dimensions-v1/src/testmod/java/net/fabricmc/fabric/test/dimension
fabric-entity-events-v1/src/testmod/java/net/fabricmc/fabric/test/entity/event
fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/mixin/event/interaction
fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/mixin/gametest
fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric
api/object/builder/v1/block
mixin/object/builder
fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/client
fabric-screen-api-v1/src/main/java/net/fabricmc/fabric/mixin/screen
fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/mixin/transfer
gradle.properties

View file

@ -21,17 +21,17 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.class_7138;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.noise.NoiseConfig;
import net.fabricmc.fabric.impl.biome.TheEndBiomeData;
@Mixin(ChunkGenerator.class)
public class MixinChunkGenerator {
@Inject(method = "method_38267", at = @At("HEAD"))
private void populateBiomes_lambda_head(Chunk chunk, class_7138 rng, CallbackInfoReturnable<Chunk> ci) {
private void populateBiomes_lambda_head(Chunk chunk, NoiseConfig noiseConfig, CallbackInfoReturnable<Chunk> ci) {
// capture seed so TheEndBiomeData.Overrides has it if it needs it
TheEndBiomeData.Overrides.setSeed(rng.legacyLevelSeed());
TheEndBiomeData.Overrides.setSeed(noiseConfig.legacyWorldSeed());
}
}

View file

@ -24,7 +24,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.class_7157;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
@ -44,7 +44,7 @@ public abstract class CommandManagerMixin {
* @reason Add commands before ambiguities are calculated.
*/
@Inject(at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/CommandDispatcher;setConsumer(Lcom/mojang/brigadier/ResultConsumer;)V"), method = "<init>")
private void fabric_addCommands(CommandManager.RegistrationEnvironment environment, class_7157 arg, CallbackInfo ci) {
private void fabric_addCommands(CommandManager.RegistrationEnvironment environment, CommandRegistryAccess registryAccess, CallbackInfo ci) {
CommandRegistrationCallback.EVENT.invoker().register(this.dispatcher, environment == CommandManager.RegistrationEnvironment.DEDICATED);
}
}

View file

@ -24,7 +24,6 @@ import java.util.concurrent.Executor;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.class_7138;
import net.minecraft.block.BlockState;
import net.minecraft.structure.StructureSet;
import net.minecraft.util.dynamic.RegistryOps;
@ -43,6 +42,7 @@ import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.Blender;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.VerticalBlockSample;
import net.minecraft.world.gen.noise.NoiseConfig;
public class VoidChunkGenerator extends ChunkGenerator {
public static final Codec<VoidChunkGenerator> CODEC = RecordCodecBuilder.create((instance) ->
@ -62,11 +62,11 @@ public class VoidChunkGenerator extends ChunkGenerator {
}
@Override
public void carve(ChunkRegion chunkRegion, long l, class_7138 rng, BiomeAccess biomeAccess, StructureAccessor structureAccessor, Chunk chunk, GenerationStep.Carver carver) {
public void carve(ChunkRegion chunkRegion, long l, NoiseConfig noiseConfig, BiomeAccess biomeAccess, StructureAccessor structureAccessor, Chunk chunk, GenerationStep.Carver carver) {
}
@Override
public void buildSurface(ChunkRegion region, StructureAccessor structureAccessor, class_7138 rng, Chunk chunk) {
public void buildSurface(ChunkRegion region, StructureAccessor structureAccessor, NoiseConfig noiseConfig, Chunk chunk) {
}
@Override
@ -79,7 +79,7 @@ public class VoidChunkGenerator extends ChunkGenerator {
}
@Override
public CompletableFuture<Chunk> populateNoise(Executor executor, Blender blender, class_7138 rng, StructureAccessor structureAccessor, Chunk chunk) {
public CompletableFuture<Chunk> populateNoise(Executor executor, Blender blender, NoiseConfig noiseConfig, StructureAccessor structureAccessor, Chunk chunk) {
return CompletableFuture.completedFuture(chunk);
}
@ -94,16 +94,16 @@ public class VoidChunkGenerator extends ChunkGenerator {
}
@Override
public int getHeight(int x, int z, Heightmap.Type heightmapType, HeightLimitView heightLimitView, class_7138 rng) {
public int getHeight(int x, int z, Heightmap.Type heightmapType, HeightLimitView heightLimitView, NoiseConfig noiseConfig) {
return 0;
}
@Override
public VerticalBlockSample getColumnSample(int x, int z, HeightLimitView heightLimitView, class_7138 rng) {
public VerticalBlockSample getColumnSample(int x, int z, HeightLimitView heightLimitView, NoiseConfig noiseConfig) {
return new VerticalBlockSample(0, new BlockState[0]);
}
@Override
public void getDebugHudText(List<String> list, class_7138 rng, BlockPos blockPos) {
public void getDebugHudText(List<String> list, NoiseConfig noiseConfig, BlockPos blockPos) {
}
}

View file

@ -54,7 +54,7 @@ public class TestBedBlock extends Block {
return ActionResult.CONSUME;
}
if (world.getDimension().isBedWorking()) {
if (world.getDimension().bedWorks()) {
if (!world.isClient) {
player.trySleep(pos).ifLeft(sleepFailureReason -> {
Text message = sleepFailureReason.getMessage();

View file

@ -23,11 +23,11 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.class_7204;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.network.SequencedPacketCreator;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
@ -72,7 +72,7 @@ public abstract class MixinClientPlayerInteractionManager {
// We also need to let the server process the action if it's accepted.
if (result.isAccepted()) {
method_41931(client.world, id -> new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, id));
sendSequencedPacket(client.world, id -> new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, id));
}
}
}
@ -91,7 +91,7 @@ public abstract class MixinClientPlayerInteractionManager {
}
}
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;method_41931(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/class_7204;)V"), method = "interactBlock", cancellable = true)
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;sendSequencedPacket(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/network/SequencedPacketCreator;)V"), method = "interactBlock", cancellable = true)
public void interactBlock(ClientPlayerEntity player, Hand hand, BlockHitResult blockHitResult, CallbackInfoReturnable<ActionResult> info) {
// hook interactBlock between the world border check and the actual block interaction to invoke the use block event first
// this needs to be in interactBlock to avoid sending a packet in line with the event javadoc
@ -103,7 +103,7 @@ public abstract class MixinClientPlayerInteractionManager {
if (result != ActionResult.PASS) {
if (result == ActionResult.SUCCESS) {
// send interaction packet to the server with a new sequentially assigned id
method_41931(player.clientWorld, id -> new PlayerInteractBlockC2SPacket(hand, blockHitResult, id));
sendSequencedPacket(player.clientWorld, id -> new PlayerInteractBlockC2SPacket(hand, blockHitResult, id));
}
info.setReturnValue(result);
@ -121,7 +121,7 @@ public abstract class MixinClientPlayerInteractionManager {
// send the move packet like vanilla to ensure the position+view vectors are accurate
networkHandler.sendPacket(new PlayerMoveC2SPacket.Full(player.getX(), player.getY(), player.getZ(), player.getYaw(), player.getPitch(), player.isOnGround()));
// send interaction packet to the server with a new sequentially assigned id
method_41931((ClientWorld) player.world, id -> new PlayerInteractItemC2SPacket(hand, id));
sendSequencedPacket((ClientWorld) player.world, id -> new PlayerInteractItemC2SPacket(hand, id));
}
info.setReturnValue(result.getResult());
@ -156,5 +156,5 @@ public abstract class MixinClientPlayerInteractionManager {
}
@Shadow
public abstract void method_41931(ClientWorld clientWorld, class_7204 supplier);
public abstract void sendSequencedPacket(ClientWorld clientWorld, SequencedPacketCreator supplier);
}

View file

@ -34,7 +34,7 @@ import net.minecraft.util.registry.Registry;
@Mixin(ArgumentTypes.class)
public abstract class ArgumentTypesMixin {
@Shadow
private static <A extends ArgumentType<?>, T extends ArgumentSerializer.class_7217<A>> ArgumentSerializer<A, T> register(Registry<ArgumentSerializer<?, ?>> registry, String string, Class<? extends A> clazz, ArgumentSerializer<A, T> argumentSerializer) {
private static <A extends ArgumentType<?>, T extends ArgumentSerializer.ArgumentTypeProperties<A>> ArgumentSerializer<A, T> register(Registry<ArgumentSerializer<?, ?>> registry, String string, Class<? extends A> clazz, ArgumentSerializer<A, T> argumentSerializer) {
throw new AssertionError("Nope.");
}
@ -42,8 +42,8 @@ public abstract class ArgumentTypesMixin {
private static void register(Registry<ArgumentSerializer<?, ?>> registry, CallbackInfoReturnable<ArgumentSerializer<?, ?>> ci) {
// Registered by vanilla when isDevelopment is enabled.
if (!SharedConstants.isDevelopment) {
register(registry, "test_argument", TestFunctionArgumentType.class, ConstantArgumentSerializer.method_41999(TestFunctionArgumentType::testFunction));
register(registry, "test_class", TestClassArgumentType.class, ConstantArgumentSerializer.method_41999(TestClassArgumentType::testClass));
register(registry, "test_argument", TestFunctionArgumentType.class, ConstantArgumentSerializer.of(TestFunctionArgumentType::testFunction));
register(registry, "test_class", TestClassArgumentType.class, ConstantArgumentSerializer.of(TestClassArgumentType::testClass));
}
}
}

View file

@ -25,7 +25,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.SharedConstants;
import net.minecraft.class_7157;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.command.TestCommand;
@ -37,7 +37,7 @@ public abstract class CommandManagerMixin {
private CommandDispatcher<ServerCommandSource> dispatcher;
@Inject(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/command/WorldBorderCommand;register(Lcom/mojang/brigadier/CommandDispatcher;)V", shift = At.Shift.AFTER))
private void construct(CommandManager.RegistrationEnvironment environment, class_7157 arg, CallbackInfo info) {
private void construct(CommandManager.RegistrationEnvironment environment, CommandRegistryAccess registryAccess, CallbackInfo info) {
// Registered by vanilla when isDevelopment is enabled.
if (!SharedConstants.isDevelopment) {
TestCommand.register(this.dispatcher);

View file

@ -164,12 +164,6 @@ public class FabricBlockSettings extends AbstractBlock.Settings {
return this;
}
@Override
public FabricBlockSettings dropsNothing() {
super.dropsNothing();
return this;
}
@Override
public FabricBlockSettings dropsLike(Block block) {
super.dropsLike(block);

View file

@ -126,7 +126,4 @@ public interface AbstractBlockSettingsAccessor {
@Invoker
Block.Settings invokeTicksRandomly();
@Invoker
Block.Settings invokeDropsNothing();
}

View file

@ -46,7 +46,7 @@ public class CreateWorldScreenMixin {
private ResourcePackManager packManager;
@ModifyVariable(method = "create(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;method_41849(Lnet/minecraft/resource/ResourcePackManager;Lnet/minecraft/resource/DataPackSettings;)Lnet/minecraft/server/SaveLoading$ServerConfig;"))
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;createServerConfig(Lnet/minecraft/resource/ResourcePackManager;Lnet/minecraft/resource/DataPackSettings;)Lnet/minecraft/server/SaveLoading$ServerConfig;"))
private static ResourcePackManager onCreateResManagerInit(ResourcePackManager manager) {
// Add mod data packs to the initial res pack manager so they are active even if the user doesn't use custom data packs
((ResourcePackManagerAccessor) manager).getProviders().add(new ModResourcePackCreator(ResourceType.SERVER_DATA));

View file

@ -127,7 +127,7 @@ abstract class MouseMixin {
}
// Apply same calculations to horizontal scroll as vertical scroll amount has
this.horizontalScrollAmount = this.client.options.discreteMouseScroll ? Math.signum(horizontal) : horizontal * this.client.options.method_41806().method_41753();
this.horizontalScrollAmount = this.client.options.method_42439().getValue() ? Math.signum(horizontal) : horizontal * this.client.options.getMouseWheelSensitivity().getValue();
if (!ScreenMouseEvents.allowMouseScroll(this.currentScreen).invoker().allowMouseScroll(this.currentScreen, mouseX, mouseY, this.horizontalScrollAmount, verticalAmount)) {
this.currentScreen = null;

View file

@ -16,7 +16,6 @@
package net.fabricmc.fabric.mixin.transfer;
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;
@ -27,10 +26,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.LockableContainerBlockEntity;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.recipe.AbstractCookingRecipe;
import net.minecraft.recipe.RecipeType;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -49,9 +45,6 @@ public abstract class AbstractFurnaceBlockEntityMixin extends LockableContainerB
int cookTime;
@Shadow
int cookTimeTotal;
@Final
@Shadow
private RecipeType<? extends AbstractCookingRecipe> recipeType;
protected AbstractFurnaceBlockEntityMixin(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState) {
super(blockEntityType, blockPos, blockState);
@ -76,14 +69,14 @@ public abstract class AbstractFurnaceBlockEntityMixin extends LockableContainerB
boolean bl = !stack.isEmpty() && stack.isItemEqualIgnoreDamage(itemStack) && ItemStack.areNbtEqual(stack, itemStack);
if (!bl) {
this.cookTimeTotal = getCookTime(this.world, this.recipeType, this);
this.cookTimeTotal = getCookTime(this.world, (AbstractFurnaceBlockEntity) (Object) this);
this.cookTime = 0;
}
}
}
@Shadow
private static int getCookTime(World world, RecipeType<? extends AbstractCookingRecipe> recipeType, Inventory inventory) {
private static int getCookTime(World world, AbstractFurnaceBlockEntity abstractFurnaceBlockEntity) {
throw new AssertionError();
}
}

View file

@ -1,8 +1,8 @@
org.gradle.jvmargs=-Xmx2560M
version=0.49.3
minecraft_version=22w11a
yarn_version=+build.4
version=0.49.4
minecraft_version=22w12a
yarn_version=+build.1
loader_version=0.13.3
prerelease=true
@ -10,31 +10,31 @@ prerelease=true
# Do not manually update, use the bumpversions task:
fabric-api-base-version=0.4.4
fabric-api-lookup-api-v1-version=1.5.7
fabric-biome-api-v1-version=9.0.0
fabric-biome-api-v1-version=9.0.1
fabric-blockrenderlayer-v1-version=1.1.12
fabric-command-api-v1-version=1.1.10
fabric-commands-v0-version=0.2.9
fabric-command-api-v1-version=1.1.11
fabric-commands-v0-version=0.2.10
fabric-containers-v0-version=0.1.21
fabric-content-registries-v0-version=3.0.5
fabric-content-registries-v0-version=3.0.6
fabric-crash-report-info-v1-version=0.1.11
fabric-data-generation-api-v1-version=2.0.8
fabric-dimensions-v1-version=2.1.17
fabric-entity-events-v1-version=1.4.8
fabric-events-interaction-v0-version=0.4.20
fabric-dimensions-v1-version=2.1.18
fabric-entity-events-v1-version=1.4.9
fabric-events-interaction-v0-version=0.4.21
fabric-events-lifecycle-v0-version=0.2.13
fabric-game-rule-api-v1-version=1.0.13
fabric-gametest-api-v1-version=1.0.18
fabric-gametest-api-v1-version=1.0.19
fabric-item-api-v1-version=1.3.3
fabric-item-groups-v0-version=0.3.13
fabric-item-groups-v0-version=0.3.14
fabric-key-binding-api-v1-version=1.0.12
fabric-keybindings-v0-version=0.2.10
fabric-lifecycle-events-v1-version=2.0.2
fabric-loot-tables-v1-version=1.0.11
fabric-mining-level-api-v1-version=2.0.7
fabric-mining-level-api-v1-version=2.0.8
fabric-models-v0-version=0.3.6
fabric-networking-api-v1-version=1.0.21
fabric-networking-v0-version=0.3.8
fabric-object-builder-api-v1-version=2.0.6
fabric-object-builder-api-v1-version=3.0.0
fabric-particles-v1-version=0.2.12
fabric-registry-sync-v0-version=0.9.8
fabric-renderer-api-v1-version=0.4.13
@ -45,9 +45,9 @@ fabric-rendering-fluids-v1-version=2.0.2
fabric-rendering-v0-version=1.1.13
fabric-rendering-v1-version=1.10.7
fabric-resource-conditions-api-v1-version=2.0.2
fabric-resource-loader-v0-version=0.4.21
fabric-screen-api-v1-version=1.0.12
fabric-resource-loader-v0-version=0.4.22
fabric-screen-api-v1-version=1.0.13
fabric-screen-handler-api-v1-version=1.1.14
fabric-textures-v0-version=1.0.12
fabric-transfer-api-v1-version=1.5.14
fabric-transfer-api-v1-version=1.5.15
fabric-transitive-access-wideners-v1-version=1.0.0