Skip to content

Commit

Permalink
24w19b
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed May 10, 2024
1 parent ad0af49 commit 5e47b9c
Show file tree
Hide file tree
Showing 240 changed files with 68 additions and 45 deletions.
1 change: 1 addition & 0 deletions fabric-data-generation-api-v1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,4 @@ def hasAncestor(ClassNode classNode, Map<String, ClassNode> classes, String ance
}

generateResources.dependsOn generateAccessWidener
generateResources.dependsOn runDatagen
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;

import com.mojang.serialization.MapCodec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
Expand Down Expand Up @@ -75,7 +74,7 @@ public int getWorldHeight() {
}

@Override
public CompletableFuture<Chunk> populateNoise(Executor executor, Blender blender, NoiseConfig noiseConfig, StructureAccessor structureAccessor, Chunk chunk) {
public CompletableFuture<Chunk> populateNoise(Blender blender, NoiseConfig noiseConfig, StructureAccessor structureAccessor, Chunk chunk) {
return CompletableFuture.completedFuture(chunk);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.Vec3d;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.UseItemCallback;
Expand All @@ -42,7 +43,7 @@ public void onInitialize() {
if (!player.isSpectator()) {
if (player.getStackInHand(hand).isOf(Items.BLAZE_ROD)) {
if (!world.isClient()) {
player.getWorld().spawnEntity(new FireballEntity(player.getWorld(), player, 0, 0, 0, 0));
player.getWorld().spawnEntity(new FireballEntity(player.getWorld(), player, new Vec3d(0, 0, 0), 0));
}

return TypedActionResult.success(player.getStackInHand(hand), world.isClient());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.fabricmc.fabric.mixin.event.lifecycle;

import org.spongepowered.asm.mixin.Mixin;
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_9761;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkGenerating;
import net.minecraft.world.chunk.ChunkGenerationContext;
import net.minecraft.world.chunk.WorldChunk;

import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;

@Mixin(ChunkGenerating.class)
abstract class ChunkGeneratingMixin {
@Inject(method = "method_60553", at = @At("TAIL"))
private static void onChunkLoad(Chunk chunk, ChunkGenerationContext chunkGenerationContext, class_9761 arg, CallbackInfoReturnable<Chunk> callbackInfoReturnable) {
// We fire the event at TAIL since the chunk is guaranteed to be a WorldChunk then.
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad(chunkGenerationContext.world(), (WorldChunk) callbackInfoReturnable.getReturnValue());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@

package net.fabricmc.fabric.mixin.event.lifecycle;

import java.util.concurrent.CompletableFuture;

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 net.minecraft.server.world.ChunkHolder;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.server.world.ThreadedAnvilChunkStorage;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.WorldChunk;

import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;
Expand All @@ -47,22 +43,8 @@ public abstract class ThreadedAnvilChunkStorageMixin {
* Injection is inside of tryUnloadChunk.
* We inject just after "setLoadedToWorld" is made false, since here the WorldChunk is guaranteed to be unloaded.
*/
@Inject(method = "method_18843", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/WorldChunk;setLoadedToWorld(Z)V", shift = At.Shift.AFTER))
private void onChunkUnload(ChunkHolder chunkHolder, CompletableFuture<Chunk> chunkFuture, long pos, Chunk chunk, CallbackInfo ci) {
ServerChunkEvents.CHUNK_UNLOAD.invoker().onChunkUnload(this.world, (WorldChunk) chunk);
}

/**
* Injection is inside of convertToFullChunk?
*
* <p>The following is expected contractually
*
* <ul><li>the chunk being loaded MUST be a WorldChunk.
* <li>everything within the chunk has been loaded into the world. Entities, BlockEntities, etc.</ul>
*/
@Inject(method = "method_17227", at = @At("TAIL"))
private void onChunkLoad(ChunkHolder chunkHolder, Chunk protoChunk, CallbackInfoReturnable<Chunk> callbackInfoReturnable) {
// We fire the event at TAIL since the chunk is guaranteed to be a WorldChunk then.
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad(this.world, (WorldChunk) callbackInfoReturnable.getReturnValue());
@Inject(method = "method_60440", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/WorldChunk;setLoadedToWorld(Z)V", shift = At.Shift.AFTER))
private void onChunkUnload(ChunkHolder chunkHolder, long l, CallbackInfo ci) {
ServerChunkEvents.CHUNK_UNLOAD.invoker().onChunkUnload(this.world, (WorldChunk) chunkHolder.method_60471());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"package": "net.fabricmc.fabric.mixin.event.lifecycle",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ChunkGeneratingMixin",
"DataPackContentsMixin",
"LivingEntityMixin",
"MinecraftServerMixin",
Expand Down
42 changes: 21 additions & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx2560M
org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true

version=0.98.0
minecraft_version=24w18a
yarn_version=+build.2
version=0.98.1
minecraft_version=24w19b
yarn_version=+build.1
loader_version=0.15.11
installer_version=1.0.1

Expand All @@ -13,34 +13,34 @@ curseforge_minecraft_version=1.21-Snapshot

# Do not manually update, use the bumpversions task:
fabric-api-base-version=0.4.41
fabric-api-lookup-api-v1-version=1.6.60
fabric-api-lookup-api-v1-version=1.6.61
fabric-biome-api-v1-version=13.0.26
fabric-block-api-v1-version=1.0.21
fabric-block-view-api-v2-version=1.0.9
fabric-blockrenderlayer-v1-version=1.1.51
fabric-command-api-v1-version=1.2.46
fabric-command-api-v2-version=2.2.25
fabric-commands-v0-version=0.2.63
fabric-content-registries-v0-version=8.0.6
fabric-content-registries-v0-version=8.0.7
fabric-crash-report-info-v1-version=0.2.28
fabric-data-attachment-api-v1-version=1.1.17
fabric-data-generation-api-v1-version=20.1.0
fabric-dimensions-v1-version=2.1.69
fabric-data-attachment-api-v1-version=1.1.18
fabric-data-generation-api-v1-version=20.1.1
fabric-dimensions-v1-version=2.1.70
fabric-entity-events-v1-version=1.6.9
fabric-events-interaction-v0-version=0.7.7
fabric-events-interaction-v0-version=0.7.8
fabric-game-rule-api-v1-version=1.0.51
fabric-gametest-api-v1-version=1.3.18
fabric-item-api-v1-version=9.1.0
fabric-item-group-api-v1-version=4.0.40
fabric-gametest-api-v1-version=1.3.19
fabric-item-api-v1-version=9.1.1
fabric-item-group-api-v1-version=4.0.41
fabric-key-binding-api-v1-version=1.0.46
fabric-keybindings-v0-version=0.2.44
fabric-lifecycle-events-v1-version=2.3.5
fabric-loot-api-v2-version=3.0.6
fabric-lifecycle-events-v1-version=2.3.6
fabric-loot-api-v2-version=3.0.7
fabric-message-api-v1-version=6.0.11
fabric-model-loading-api-v1-version=1.0.13
fabric-models-v0-version=0.4.12
fabric-networking-api-v1-version=4.0.9
fabric-object-builder-api-v1-version=15.1.5
fabric-object-builder-api-v1-version=15.1.6
fabric-particles-v1-version=4.0.1
fabric-recipe-api-v1-version=5.0.4
fabric-registry-sync-v0-version=5.0.17
Expand All @@ -51,13 +51,13 @@ fabric-rendering-data-attachment-v1-version=0.3.47
fabric-rendering-fluids-v1-version=3.1.4
fabric-rendering-v0-version=1.1.65
fabric-rendering-v1-version=4.2.5
fabric-resource-conditions-api-v1-version=4.1.0
fabric-resource-loader-v0-version=1.1.0
fabric-resource-conditions-api-v1-version=4.1.1
fabric-resource-loader-v0-version=1.1.1
fabric-screen-api-v1-version=2.0.22
fabric-screen-handler-api-v1-version=1.3.74
fabric-sound-api-v1-version=1.0.22
fabric-transfer-api-v1-version=5.1.7
fabric-transfer-api-v1-version=5.1.8
fabric-transitive-access-wideners-v1-version=6.0.11
fabric-convention-tags-v1-version=2.0.5
fabric-convention-tags-v2-version=2.1.0
fabric-client-tags-api-v1-version=1.1.13
fabric-convention-tags-v1-version=2.0.6
fabric-convention-tags-v2-version=2.1.1
fabric-client-tags-api-v1-version=1.1.14

0 comments on commit 5e47b9c

Please sign in to comment.