diff --git a/build.gradle b/build.gradle index 0d97ff234..396d316ed 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ plugins { def ENV = System.getenv() def baseVersion = "0.3.0" -def mcVersion = "1.14.2" +def mcVersion = "1.14.3" def yarnVersion = "+build.1" def getSubprojectVersion(project, version) { @@ -182,7 +182,7 @@ curseforge { project { id = '306612' changelog = 'A changelog can be found at https://github.com/FabricMC/fabric/commits/master' - releaseType = 'beta' + releaseType = 'alpha' addGameVersion '1.14-Snapshot' mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) { displayName = "[$mcVersion] Fabric API $baseVersion build $ENV.BUILD_NUMBER" diff --git a/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java b/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java index 95d17c28c..b331f4dc2 100644 --- a/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java +++ b/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java @@ -105,12 +105,12 @@ public final class FabricItemGroupBuilder { } @Override - public void appendItems(DefaultedList stacks) { + public void appendStacks(DefaultedList stacks) { if (stacksForDisplay != null) { stacksForDisplay.accept(stacks); return; } - super.appendItems(stacks); + super.appendStacks(stacks); } }; } diff --git a/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java b/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java index 3b5d3599c..93980eb35 100644 --- a/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java +++ b/fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java @@ -23,7 +23,7 @@ import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; import net.minecraft.container.Container; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemGroup; -import net.minecraft.network.chat.Component; +import net.minecraft.text.Text; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -34,7 +34,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(CreativeInventoryScreen.class) public abstract class MixinCreativePlayerInventoryGui extends AbstractInventoryScreen implements CreativeGuiExtensions { - public MixinCreativePlayerInventoryGui(Container container_1, PlayerInventory playerInventory_1, Component textComponent_1) { + public MixinCreativePlayerInventoryGui(Container container_1, PlayerInventory playerInventory_1, Text textComponent_1) { super(container_1, playerInventory_1, textComponent_1); } diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/MixinLootManager.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/MixinLootManager.java index e170149c7..fffc6fdf8 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/MixinLootManager.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/MixinLootManager.java @@ -16,10 +16,13 @@ package net.fabricmc.fabric.mixin.loot; +import com.google.common.collect.ImmutableMap; +import com.google.gson.JsonObject; import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback; import net.fabricmc.fabric.api.loot.v1.FabricLootSupplierBuilder; import net.minecraft.resource.ResourceManager; import net.minecraft.util.Identifier; +import net.minecraft.util.profiler.Profiler; import net.minecraft.world.loot.LootManager; import net.minecraft.world.loot.LootSupplier; import org.spongepowered.asm.mixin.Final; @@ -34,10 +37,10 @@ import java.util.Map; @Mixin(LootManager.class) public class MixinLootManager { - @Shadow @Final private Map suppliers; + @Shadow private Map suppliers; - @Inject(method = "apply", at = @At("RETURN")) - private void apply(ResourceManager manager, CallbackInfo info) { + @Inject(method = "method_20712", at = @At("RETURN")) + private void apply(Map objectMap, ResourceManager manager, Profiler profiler, CallbackInfo info) { Map newSuppliers = new HashMap<>(); suppliers.forEach((id, supplier) -> { @@ -51,8 +54,6 @@ public class MixinLootManager { newSuppliers.computeIfAbsent(id, (i) -> builder.create()); }); - for (Identifier id : newSuppliers.keySet()) { - suppliers.put(id, newSuppliers.get(id)); - } + suppliers = ImmutableMap.copyOf(newSuppliers); } } diff --git a/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java b/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java index 696aa92e8..fe99bcea5 100644 --- a/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java +++ b/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java @@ -88,7 +88,7 @@ public final class ToolManager { private static int getMiningLevel(ItemStack stack) { if (stack.getItem() instanceof ToolItem) { - return ((ToolItem) stack.getItem()).getType().getMiningLevel(); + return ((ToolItem) stack.getItem()).getMaterial().getMiningLevel(); } else { return 0; } @@ -102,7 +102,7 @@ public final class ToolManager { if (entry != null) { Item item = stack.getItem(); for (int i = 0; i < entry.tags.length; i++) { - if (item.matches(entry.tags[i])) { + if (item.isIn(entry.tags[i])) { return TriState.of(getMiningLevel(stack) >= entry.tagLevels[i]); } } diff --git a/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java b/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java index 8a3a88ab9..9b23a88e6 100644 --- a/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java +++ b/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java @@ -23,5 +23,5 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(MiningToolItem.class) public interface MiningToolItemAccessor { @Accessor - float getBlockBreakingSpeed(); + float getMiningSpeed(); } diff --git a/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java b/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java index a9ed87703..9fbdaea49 100644 --- a/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java +++ b/fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java @@ -41,12 +41,12 @@ public abstract class MixinItemStack { } } - @Inject(at = @At("HEAD"), method = "getBlockBreakingSpeed", cancellable = true) + @Inject(at = @At("HEAD"), method = "getMiningSpeed", cancellable = true) public void getBlockBreakingSpeed(BlockState state, CallbackInfoReturnable info) { if (this.getItem() instanceof MiningToolItemAccessor) { TriState triState = ToolManager.handleIsEffectiveOn((ItemStack) (Object) this, state); if (triState != TriState.DEFAULT) { - info.setReturnValue(triState.get() ? ((MiningToolItemAccessor) this.getItem()).getBlockBreakingSpeed() : 1.0F); + info.setReturnValue(triState.get() ? ((MiningToolItemAccessor) this.getItem()).getMiningSpeed() : 1.0F); info.cancel(); } } diff --git a/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java b/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java index 298627de6..26d4daa81 100644 --- a/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java +++ b/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java @@ -19,7 +19,7 @@ package net.fabricmc.fabric.api.entity; import net.fabricmc.fabric.impl.entity.FabricEntityType; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCategory; -import net.minecraft.entity.EntitySize; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.world.World; import org.apache.logging.log4j.LogManager; @@ -44,7 +44,7 @@ public class FabricEntityTypeBuilder { private int updateIntervalTicks = -1; private Boolean alwaysUpdateVelocity; private boolean immuneToFire = false; - private EntitySize size = EntitySize.resizeable(-1.0f, -1.0f); + private EntityDimensions size = EntityDimensions.changing(-1.0f, -1.0f); protected FabricEntityTypeBuilder(EntityCategory category, EntityType.EntityFactory function) { this.category = category; @@ -83,15 +83,15 @@ public class FabricEntityTypeBuilder { } /** - * @deprecated Use {@link FabricEntityTypeBuilder#size(EntitySize)} + * @deprecated Use {@link FabricEntityTypeBuilder#size(EntityDimensions)} */ @Deprecated public FabricEntityTypeBuilder size(float width, float height) { - this.size = EntitySize.resizeable(width, height); + this.size = EntityDimensions.changing(width, height); return this; } - public FabricEntityTypeBuilder size(EntitySize size) { + public FabricEntityTypeBuilder size(EntityDimensions size) { this.size = size; return this; } diff --git a/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java b/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java index 4b144211d..30da89706 100644 --- a/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java +++ b/fabric-object-builders-v0/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java @@ -19,14 +19,14 @@ package net.fabricmc.fabric.impl.entity; import com.mojang.datafixers.types.Type; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCategory; -import net.minecraft.entity.EntitySize; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; public class FabricEntityType extends EntityType { private final int maxTrackDistance, trackTickInterval; private final Boolean alwaysUpdateVelocity; - public FabricEntityType(EntityFactory entityType$EntityFactory_1, EntityCategory entityCategory_1, boolean boolean_1, boolean boolean_2, boolean boolean_3, Type type_1, EntitySize entitySize_1, int maxTrackDistance, int trackTickInterval, Boolean alwaysUpdateVelocity) { + public FabricEntityType(EntityFactory entityType$EntityFactory_1, EntityCategory entityCategory_1, boolean boolean_1, boolean boolean_2, boolean boolean_3, Type type_1, EntityDimensions entitySize_1, int maxTrackDistance, int trackTickInterval, Boolean alwaysUpdateVelocity) { super(entityType$EntityFactory_1, entityCategory_1, boolean_1, boolean_2, boolean_3, type_1, entitySize_1); this.maxTrackDistance = maxTrackDistance; this.trackTickInterval = trackTickInterval; diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java index ece17b090..2f76b2cc9 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java @@ -20,7 +20,7 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.network.ClientSidePacketRegistry; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.network.chat.TextComponent; +import net.minecraft.text.LiteralText; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -35,7 +35,7 @@ public class FabricRegistryClientInit implements ClientModInitializer { LOGGER.error("Registry remapping failed!", e); MinecraftClient.getInstance().execute(() -> { ((ClientPlayerEntity) ctx.getPlayer()).networkHandler.getClientConnection().disconnect( - new TextComponent("Registry remapping failed: " + e.getMessage()) + new LiteralText("Registry remapping failed: " + e.getMessage()) ); }); }); diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/trackers/vanilla/BlockItemTracker.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/trackers/vanilla/BlockItemTracker.java index acab3f9af..4c13a1e56 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/trackers/vanilla/BlockItemTracker.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/trackers/vanilla/BlockItemTracker.java @@ -35,7 +35,7 @@ public final class BlockItemTracker implements RegistryEntryAddedCallback @Override public void onEntryAdded(int rawId, Identifier id, Item object) { if (object instanceof BlockItem) { - ((BlockItem) object).registerBlockItemMap(Item.BLOCK_ITEM_MAP, object); + ((BlockItem) object).appendBlocks(Item.BLOCK_ITEMS, object); } } }