mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-13 16:53:35 -04:00
Update to Minecraft snapshot 24w39a (#4121)
This commit is contained in:
parent
e1e5711a24
commit
7dcfcf9c76
15 changed files with 50 additions and 30 deletions
|
@ -97,7 +97,7 @@ public final class ContentRegistryTest implements ModInitializer {
|
|||
// - assign a loot table to the nitwit villager type
|
||||
// - right-clicking a 'test_event' block will emit a 'test_event' game event, which will have a sculk sensor frequency of 2
|
||||
// - instant health potions can be brewed from awkward potions with any item in the 'minecraft:small_flowers' tag
|
||||
// - if Bundle experiment is enabled, luck potions can be brewed from awkward potions with a bundle
|
||||
// - if Redstone Experiments experiment is enabled, luck potions can be brewed from awkward potions with a bundle
|
||||
// - dirty potions can be brewed by adding any item in the 'minecraft:dirt' tag to any standard potion
|
||||
|
||||
CompostingChanceRegistry.INSTANCE.add(Items.OBSIDIAN, 0.5F);
|
||||
|
@ -180,7 +180,7 @@ public final class ContentRegistryTest implements ModInitializer {
|
|||
builder.registerItemRecipe(Items.POTION, Ingredient.fromTag(Registries.ITEM.getOrThrow(ItemTags.DIRT)), dirtyPotion);
|
||||
builder.registerPotionRecipe(Potions.AWKWARD, Ingredient.fromTag(Registries.ITEM.getOrThrow(ItemTags.SMALL_FLOWERS)), Potions.HEALING);
|
||||
|
||||
if (builder.getEnabledFeatures().contains(FeatureFlags.BUNDLE)) {
|
||||
if (builder.getEnabledFeatures().contains(FeatureFlags.REDSTONE_EXPERIMENTS)) {
|
||||
builder.registerPotionRecipe(Potions.AWKWARD, Ingredient.ofItems(Items.BUNDLE), Potions.LUCK);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.EntityTypeTags;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
|
@ -44,8 +45,16 @@ public final class EntityTypeTagGenerator extends FabricTagProvider.EntityTypeTa
|
|||
.add(EntityType.HOPPER_MINECART)
|
||||
.add(EntityType.SPAWNER_MINECART);
|
||||
getOrCreateTagBuilder(ConventionalEntityTypeTags.BOATS)
|
||||
.add(EntityType.BOAT)
|
||||
.add(EntityType.CHEST_BOAT);
|
||||
.addOptionalTag(EntityTypeTags.BOAT)
|
||||
.add(EntityType.OAK_CHEST_BOAT)
|
||||
.add(EntityType.SPRUCE_CHEST_BOAT)
|
||||
.add(EntityType.BIRCH_CHEST_BOAT)
|
||||
.add(EntityType.JUNGLE_CHEST_BOAT)
|
||||
.add(EntityType.ACACIA_CHEST_BOAT)
|
||||
.add(EntityType.CHERRY_CHEST_BOAT)
|
||||
.add(EntityType.DARK_OAK_CHEST_BOAT)
|
||||
.add(EntityType.MANGROVE_CHEST_BOAT)
|
||||
.add(EntityType.BAMBOO_CHEST_RAFT);
|
||||
getOrCreateTagBuilder(ConventionalEntityTypeTags.CAPTURING_NOT_SUPPORTED);
|
||||
getOrCreateTagBuilder(ConventionalEntityTypeTags.TELEPORTING_NOT_SUPPORTED);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
{
|
||||
"values": [
|
||||
"minecraft:boat",
|
||||
"minecraft:chest_boat"
|
||||
{
|
||||
"id": "#minecraft:boat",
|
||||
"required": false
|
||||
},
|
||||
"minecraft:oak_chest_boat",
|
||||
"minecraft:spruce_chest_boat",
|
||||
"minecraft:birch_chest_boat",
|
||||
"minecraft:jungle_chest_boat",
|
||||
"minecraft:acacia_chest_boat",
|
||||
"minecraft:cherry_chest_boat",
|
||||
"minecraft:dark_oak_chest_boat",
|
||||
"minecraft:mangrove_chest_boat",
|
||||
"minecraft:bamboo_chest_raft"
|
||||
]
|
||||
}
|
|
@ -73,19 +73,19 @@ abstract class LivingEntityMixin {
|
|||
}
|
||||
|
||||
@Redirect(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isDead()Z", ordinal = 1))
|
||||
boolean beforeEntityKilled(LivingEntity livingEntity, DamageSource source, float amount) {
|
||||
boolean beforeEntityKilled(LivingEntity livingEntity, ServerWorld world, DamageSource source, float amount) {
|
||||
return isDead() && ServerLivingEntityEvents.ALLOW_DEATH.invoker().allowDeath(livingEntity, source, amount);
|
||||
}
|
||||
|
||||
@Inject(method = "damage", at = @At(value = "INVOKE", target = "net/minecraft/entity/LivingEntity.isSleeping()Z"), cancellable = true)
|
||||
private void beforeDamage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
|
||||
private void beforeDamage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!ServerLivingEntityEvents.ALLOW_DAMAGE.invoker().allowDamage((LivingEntity) (Object) this, source, amount)) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "damage", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void afterDamage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir, float dealt, boolean blocked) {
|
||||
private void afterDamage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir, float dealt, boolean blocked) {
|
||||
if (!isDead()) {
|
||||
ServerLivingEntityEvents.AFTER_DAMAGE.invoker().afterDamage((LivingEntity) (Object) this, source, dealt, amount, blocked);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class FakePlayer extends ServerPlayerEntity {
|
|||
public void resetStat(Stat<?> stat) { }
|
||||
|
||||
@Override
|
||||
public boolean isInvulnerableTo(DamageSource damageSource) {
|
||||
public boolean isInvulnerableTo(ServerWorld world, DamageSource damageSource) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,12 +29,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.CreativeScreenHandler;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import net.fabricmc.fabric.api.client.itemgroup.v1.FabricCreativeInventoryScreen;
|
||||
|
@ -42,8 +42,8 @@ import net.fabricmc.fabric.impl.client.itemgroup.FabricCreativeGuiComponents;
|
|||
import net.fabricmc.fabric.impl.itemgroup.FabricItemGroupImpl;
|
||||
|
||||
@Mixin(CreativeInventoryScreen.class)
|
||||
public abstract class CreativeInventoryScreenMixin<T extends ScreenHandler> extends AbstractInventoryScreen<T> implements FabricCreativeInventoryScreen {
|
||||
public CreativeInventoryScreenMixin(T screenHandler, PlayerInventory playerInventory, Text text) {
|
||||
public abstract class CreativeInventoryScreenMixin extends HandledScreen<CreativeScreenHandler> implements FabricCreativeInventoryScreen {
|
||||
public CreativeInventoryScreenMixin(CreativeScreenHandler screenHandler, PlayerInventory playerInventory, Text text) {
|
||||
super(screenHandler, playerInventory, text);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ import net.minecraft.fluid.Fluid;
|
|||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public abstract class CustomFluid extends FlowableFluid {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInfinite(World world) {
|
||||
protected boolean isInfinite(ServerWorld world) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ import net.minecraft.fluid.Fluid;
|
|||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public abstract class NoOverlayFluid extends FlowableFluid {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInfinite(World world) {
|
||||
protected boolean isInfinite(ServerWorld world) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ import net.minecraft.fluid.Fluid;
|
|||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public abstract class OverlayFluid extends FlowableFluid {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInfinite(World world) {
|
||||
protected boolean isInfinite(ServerWorld world) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ import net.minecraft.fluid.Fluid;
|
|||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public abstract class UnregisteredFluid extends FlowableFluid {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInfinite(World world) {
|
||||
protected boolean isInfinite(ServerWorld world) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,14 +124,14 @@ public class DefaultResourceConditionsTest {
|
|||
public void featuresEnabled(TestContext context) {
|
||||
ResourceCondition vanilla = ResourceConditions.featuresEnabled(FeatureFlags.VANILLA);
|
||||
// Reminder: GameTest enables all features by default
|
||||
ResourceCondition vanillaAndBundle = ResourceConditions.featuresEnabled(FeatureFlags.VANILLA, FeatureFlags.BUNDLE);
|
||||
ResourceCondition vanillaAndRedstoneExperiments = ResourceConditions.featuresEnabled(FeatureFlags.VANILLA, FeatureFlags.REDSTONE_EXPERIMENTS);
|
||||
Identifier unknownId = Identifier.of(TESTMOD_ID, "unknown_feature_to_test_condition");
|
||||
ResourceCondition unknown = ResourceConditions.featuresEnabled(unknownId);
|
||||
// Passing an array to avoid type ambiguity
|
||||
ResourceCondition empty = ResourceConditions.featuresEnabled(new FeatureFlag[]{});
|
||||
|
||||
expectCondition(context, "vanilla only", vanilla, true);
|
||||
expectCondition(context, "vanilla and bundle", vanillaAndBundle, true);
|
||||
expectCondition(context, "vanilla and redstone experiments", vanillaAndRedstoneExperiments, true);
|
||||
expectCondition(context, "unknown feature ID", unknown, false);
|
||||
expectCondition(context, "no feature", empty, true);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"condition": "fabric:features_enabled",
|
||||
"features": [
|
||||
"minecraft:vanilla",
|
||||
"minecraft:bundle"
|
||||
"minecraft:redstone_experiments"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -45,7 +45,7 @@ public abstract class CreateWorldScreenMixin extends Screen {
|
|||
super(null);
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "show(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;Ljava/util/function/Function;Lnet/minecraft/client/world/GeneratorOptionsFactory;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/class_10241;)V",
|
||||
@ModifyVariable(method = "show(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;Ljava/util/function/Function;Lnet/minecraft/client/world/GeneratorOptionsFactory;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/client/gui/screen/world/CreateWorldCallback;)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;createServerConfig(Lnet/minecraft/resource/ResourcePackManager;Lnet/minecraft/resource/DataConfiguration;)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
|
||||
|
@ -53,7 +53,7 @@ public abstract class CreateWorldScreenMixin extends Screen {
|
|||
return manager;
|
||||
}
|
||||
|
||||
@Redirect(method = "show(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;Ljava/util/function/Function;Lnet/minecraft/client/world/GeneratorOptionsFactory;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/class_10241;)V",
|
||||
@Redirect(method = "show(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;Ljava/util/function/Function;Lnet/minecraft/client/world/GeneratorOptionsFactory;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/client/gui/screen/world/CreateWorldCallback;)V",
|
||||
at = @At(value = "FIELD", target = "Lnet/minecraft/resource/DataConfiguration;SAFE_MODE:Lnet/minecraft/resource/DataConfiguration;", ordinal = 0))
|
||||
private static DataConfiguration replaceDefaultSettings() {
|
||||
return ModResourcePackUtil.createDefaultDataConfiguration();
|
||||
|
|
|
@ -122,7 +122,7 @@ public class ComposterWrapper extends SnapshotParticipant<Float> {
|
|||
location.setBlockState(newState);
|
||||
|
||||
if (newLevel == 7) {
|
||||
location.world.method_64310(location.pos, state.getBlock(), 20);
|
||||
location.world.scheduleBlockTick(location.pos, state.getBlock(), 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ org.gradle.parallel=true
|
|||
fabric.loom.multiProjectOptimisation=true
|
||||
|
||||
version=0.105.0
|
||||
minecraft_version=24w38a
|
||||
yarn_version=+build.2
|
||||
minecraft_version=24w39a
|
||||
yarn_version=+build.4
|
||||
loader_version=0.16.4
|
||||
installer_version=1.0.1
|
||||
|
||||
|
|
Loading…
Reference in a new issue