mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 19:25:23 -05:00
Merge branch 'snapshot/1.14.3'
This commit is contained in:
commit
dd6c927b12
11 changed files with 28 additions and 27 deletions
|
@ -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"
|
||||
|
|
|
@ -105,12 +105,12 @@ public final class FabricItemGroupBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void appendItems(DefaultedList<ItemStack> stacks) {
|
||||
public void appendStacks(DefaultedList<ItemStack> stacks) {
|
||||
if (stacksForDisplay != null) {
|
||||
stacksForDisplay.accept(stacks);
|
||||
return;
|
||||
}
|
||||
super.appendItems(stacks);
|
||||
super.appendStacks(stacks);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Identifier, LootSupplier> suppliers;
|
||||
@Shadow private Map<Identifier, LootSupplier> 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<Identifier, JsonObject> objectMap, ResourceManager manager, Profiler profiler, CallbackInfo info) {
|
||||
Map<Identifier, LootSupplier> 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,5 +23,5 @@ import org.spongepowered.asm.mixin.gen.Accessor;
|
|||
@Mixin(MiningToolItem.class)
|
||||
public interface MiningToolItemAccessor {
|
||||
@Accessor
|
||||
float getBlockBreakingSpeed();
|
||||
float getMiningSpeed();
|
||||
}
|
||||
|
|
|
@ -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<Float> 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<T extends Entity> {
|
|||
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<T> function) {
|
||||
this.category = category;
|
||||
|
@ -83,15 +83,15 @@ public class FabricEntityTypeBuilder<T extends Entity> {
|
|||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link FabricEntityTypeBuilder#size(EntitySize)}
|
||||
* @deprecated Use {@link FabricEntityTypeBuilder#size(EntityDimensions)}
|
||||
*/
|
||||
@Deprecated
|
||||
public FabricEntityTypeBuilder<T> size(float width, float height) {
|
||||
this.size = EntitySize.resizeable(width, height);
|
||||
this.size = EntityDimensions.changing(width, height);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FabricEntityTypeBuilder<T> size(EntitySize size) {
|
||||
public FabricEntityTypeBuilder<T> size(EntityDimensions size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -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<T extends Entity> extends EntityType<T> {
|
||||
private final int maxTrackDistance, trackTickInterval;
|
||||
private final Boolean alwaysUpdateVelocity;
|
||||
|
||||
public FabricEntityType(EntityFactory<T> 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<T> 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;
|
||||
|
|
|
@ -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())
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ public final class BlockItemTracker implements RegistryEntryAddedCallback<Item>
|
|||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue