This commit is contained in:
modmuss50 2021-01-20 19:50:47 +00:00
parent 92519afafe
commit 36b77c3e9f
31 changed files with 41 additions and 39 deletions
build.gradle
fabric-biome-api-v1
build.gradle
src/main/java/net/fabricmc/fabric/mixin/biome
fabric-item-api-v1
build.gradle
src/main/java/net/fabricmc/fabric/mixin/item
fabric-key-binding-api-v1
build.gradle
src
main/java/net/fabricmc/fabric
testmod/java/net/fabricmc/fabric/test/client/keybinding
fabric-keybindings-v0
build.gradle
src/main/java/net/fabricmc/fabric/api/client/keybinding
fabric-lifecycle-events-v1
build.gradle
src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/client
fabric-networking-api-v1
build.gradle
src
main/java/net/fabricmc/fabric
api/networking/v1
mixin/networking/accessor
testmod/java/net/fabricmc/fabric/test/networking
fabric-resource-loader-v0
build.gradle
src/main/java/net/fabricmc/fabric/mixin/resource/loader/client
fabric-tool-attribute-api-v1
build.gradle
src
main/java/net/fabricmc/fabric
testmod/java/net/fabricmc/fabric/test/tool/attribute

View file

@ -18,8 +18,8 @@ plugins {
def ENV = System.getenv()
class Globals {
static def baseVersion = "0.29.4"
static def mcVersion = "20w51a"
static def baseVersion = "0.29.5"
static def mcVersion = "21w03a"
static def yarnVersion = "+build.1"
static def loaderVersion = "0.10.5+build.213"
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-biome-api-v1"
version = getSubprojectVersion(project, "3.1.2")
version = getSubprojectVersion(project, "3.1.3")
minecraft {
accessWidener = file("src/main/resources/fabric-biome-api-v1.accesswidener")

View file

@ -31,7 +31,7 @@ public interface AddHillsLayerAccessor {
* <p>For example, it contains a mapping for 1 -> 129 where 1 is the raw id of plains, while 129 is the raw id
* of the sunflower plains, which is derived from plains.
*/
@Accessor("field_26727")
@Accessor("MUTATED_BIOMES")
static Int2IntMap getBaseToVariantMap() {
throw new AssertionError("mixin");
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-item-api-v1"
version = getSubprojectVersion(project, "1.2.2")
version = getSubprojectVersion(project, "1.2.3")
moduleDependencies(project, [
'fabric-api-base'

View file

@ -32,7 +32,7 @@ import net.fabricmc.fabric.impl.item.ItemExtensions;
@Mixin(LivingEntity.class)
abstract class LivingEntityMixin {
@Inject(method = "method_32326", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
@Inject(method = "getPreferredEquipmentSlot", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
private static void onGetPreferredEquipmentSlot(ItemStack stack, CallbackInfoReturnable<EquipmentSlot> info, Item item) {
EquipmentSlotProvider equipmentSlotProvider = ((ItemExtensions) item).fabric_getEquipmentSlotProvider();

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-key-binding-api-v1"
version = getSubprojectVersion(project, "1.0.2")
version = getSubprojectVersion(project, "1.0.3")
dependencies {
testmodCompile project(path: ':fabric-api-base', configuration: 'dev')

View file

@ -16,7 +16,7 @@
package net.fabricmc.fabric.api.client.keybinding.v1;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl;

View file

@ -24,7 +24,7 @@ import com.google.common.collect.Lists;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.fabricmc.fabric.mixin.client.keybinding.KeyBindingAccessor;

View file

@ -21,7 +21,7 @@ import java.util.Map;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
@Mixin(KeyBinding.class)
public interface KeyBindingAccessor {

View file

@ -19,7 +19,7 @@ package net.fabricmc.fabric.mixin.client.keybinding;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
@Mixin(KeyBinding.class)

View file

@ -24,8 +24,8 @@ 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.client.options.GameOptions;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.GameOptions;
import net.minecraft.client.option.KeyBinding;
import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl;

View file

@ -18,8 +18,8 @@ package net.fabricmc.fabric.test.client.keybinding;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.options.StickyKeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.option.StickyKeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.LiteralText;

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-keybindings-v0"
version = getSubprojectVersion(project, "0.2.1")
version = getSubprojectVersion(project, "0.2.2")
moduleDependencies(project, [
'fabric-key-binding-api-v1'

View file

@ -16,7 +16,7 @@
package net.fabricmc.fabric.api.client.keybinding;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;

View file

@ -16,7 +16,7 @@
package net.fabricmc.fabric.api.client.keybinding;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl;

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-lifecycle-events-v1"
version = getSubprojectVersion(project, "1.4.1")
version = getSubprojectVersion(project, "1.4.2")
moduleDependencies(project, [
'fabric-api-base'

View file

@ -16,6 +16,8 @@
package net.fabricmc.fabric.mixin.event.lifecycle.client;
import java.util.BitSet;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@ -45,7 +47,7 @@ public abstract class ClientChunkManagerMixin {
private ClientWorld world;
@Inject(method = "loadChunkFromPacket", at = @At("TAIL"))
private void onChunkLoad(int x, int z, @Nullable BiomeArray biomes, PacketByteBuf buf, CompoundTag tag, int verticalStripBitmask, CallbackInfoReturnable<WorldChunk> info) {
private void onChunkLoad(int x, int z, @Nullable BiomeArray biomes, PacketByteBuf buf, CompoundTag tag, BitSet verticalStripBitmask, CallbackInfoReturnable<WorldChunk> info) {
ClientChunkEvents.CHUNK_LOAD.invoker().onChunkLoad(this.world, info.getReturnValue());
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-networking-api-v1"
version = getSubprojectVersion(project, "1.0.2")
version = getSubprojectVersion(project, "1.0.3")
moduleDependencies(project, [
'fabric-api-base'

View file

@ -113,7 +113,7 @@ public final class PlayerLookup {
if (manager instanceof ServerChunkManager) {
ThreadedAnvilChunkStorage storage = ((ServerChunkManager) manager).threadedAnvilChunkStorage;
EntityTrackerAccessor tracker = ((ThreadedAnvilChunkStorageAccessor) storage).getEntityTrackers().get(entity.getEntityId());
EntityTrackerAccessor tracker = ((ThreadedAnvilChunkStorageAccessor) storage).getEntityTrackers().get(entity.getId());
// return an immutable collection to guard against accidental removals.
if (tracker != null) {

View file

@ -30,6 +30,6 @@ import net.fabricmc.api.Environment;
@Mixin(MinecraftClient.class)
public interface MinecraftClientAccessor {
@Nullable
@Accessor
@Accessor("integratedServerConnection")
ClientConnection getConnection();
}

View file

@ -22,7 +22,7 @@ import java.util.Set;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;

View file

@ -18,7 +18,7 @@ package net.fabricmc.fabric.test.networking.keybindreciever;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.fabricmc.api.ClientModInitializer;

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-resource-loader-v0"
version = getSubprojectVersion(project, "0.4.2")
version = getSubprojectVersion(project, "0.4.3")
dependencies {
testmodCompile project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')

View file

@ -42,15 +42,15 @@ import net.fabricmc.fabric.mixin.resource.loader.ResourcePackManagerAccessor;
@Mixin(CreateWorldScreen.class)
public class CreateWorldScreenMixin {
@Shadow
private ResourcePackManager field_25792;
private ResourcePackManager packManager;
@Inject(method = "method_30296", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ResourcePackManager;scanPacks()V", shift = At.Shift.BEFORE))
private void onScanPacks(CallbackInfoReturnable<Pair<File, ResourcePackManager>> cir) {
// Allow to display built-in data packs in the data pack selection screen at world creation.
((ResourcePackManagerAccessor) this.field_25792).getProviders().add(new ModResourcePackCreator(ResourceType.SERVER_DATA));
((ResourcePackManagerAccessor) this.packManager).getProviders().add(new ModResourcePackCreator(ResourceType.SERVER_DATA));
}
@ModifyArg(method = "method_31130", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;<init>(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/resource/DataPackSettings;Lnet/minecraft/client/gui/screen/world/MoreOptionsDialog;)V"), index = 1)
@ModifyArg(method = "create", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;<init>(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/resource/DataPackSettings;Lnet/minecraft/client/gui/screen/world/MoreOptionsDialog;)V"), index = 1)
private static DataPackSettings onNew(DataPackSettings settings) {
ModResourcePackCreator modResourcePackCreator = new ModResourcePackCreator(ResourceType.SERVER_DATA);
List<ResourcePackProfile> moddedResourcePacks = new ArrayList<>();

View file

@ -25,7 +25,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.client.options.GameOptions;
import net.minecraft.client.option.GameOptions;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourcePackProfile;

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-tool-attribute-api-v1"
version = getSubprojectVersion(project, "1.2.8")
version = getSubprojectVersion(project, "1.2.9")
dependencies {
testmodCompile project(path: ':fabric-object-builder-api-v1', configuration: 'dev')

View file

@ -38,7 +38,7 @@ public final class ToolManager {
* @return whether the tool is effective
*/
public static boolean handleIsEffectiveOn(BlockState state, ItemStack stack, @Nullable LivingEntity user) {
return stack.isEffectiveOn(state) || handleIsEffectiveOnIgnoresVanilla(state, stack, user, false);
return stack.isSuitableFor(state) || handleIsEffectiveOnIgnoresVanilla(state, stack, user, false);
}
/**

View file

@ -66,7 +66,7 @@ public class ModdedToolsVanillaBlocksToolHandler implements ToolManagerImpl.Tool
if (miningLevel < 0) return ActionResult.PASS;
ToolItem vanillaItem = getVanillaItem(miningLevel);
return vanillaItem.isEffectiveOn(state) ? ActionResult.SUCCESS : ActionResult.PASS;
return vanillaItem.isSuitableFor(state) ? ActionResult.SUCCESS : ActionResult.PASS;
}
return ActionResult.PASS;

View file

@ -53,9 +53,9 @@ public class ShearsVanillaBlocksToolHandler implements ToolManagerImpl.ToolHandl
if (!(stack.getItem() instanceof DynamicAttributeTool)) {
if (!(stack.getItem() instanceof ShearsItem)) {
return vanillaItem.isEffectiveOn(state) ? ActionResult.SUCCESS : ActionResult.PASS;
return vanillaItem.isSuitableFor(state) ? ActionResult.SUCCESS : ActionResult.PASS;
} else {
return stack.getItem().isEffectiveOn(state) ? ActionResult.SUCCESS : ActionResult.PASS;
return stack.getItem().isSuitableFor(state) ? ActionResult.SUCCESS : ActionResult.PASS;
}
}

View file

@ -40,7 +40,7 @@ public abstract class MixinItemStack {
@Shadow
public abstract Item getItem();
@Inject(at = @At("RETURN"), method = "isEffectiveOn", cancellable = true)
@Inject(at = @At("RETURN"), method = "isSuitableFor", cancellable = true)
public void isEffectiveOn(BlockState state, CallbackInfoReturnable<Boolean> info) {
info.setReturnValue(ToolManager.handleIsEffectiveOnIgnoresVanilla(state, (ItemStack) (Object) this, null, info.getReturnValueZ()));
}

View file

@ -69,7 +69,7 @@ public class ToolAttributeTest implements ModInitializer {
testPickaxe = Registry.register(Registry.ITEM, new Identifier("fabric-tool-attribute-api-v1-testmod", "test_pickaxe"), new TestTool(new Item.Settings(), FabricToolTags.PICKAXES, 2));
// Register a block that requires a shovel that is as strong or stronger than an iron one.
gravelBlock = Registry.register(Registry.BLOCK, new Identifier("fabric-tool-attribute-api-v1-testmod", "hardened_gravel_block"),
new Block(FabricBlockSettings.of(new FabricMaterialBuilder(MapColor.SAND).build(), MapColor.STONE)
new Block(FabricBlockSettings.of(new FabricMaterialBuilder(MapColor.PALE_YELLOW).build(), MapColor.STONE_GRAY)
.breakByTool(FabricToolTags.SHOVELS, 2)
.requiresTool()
.strength(0.6F)
@ -77,7 +77,7 @@ public class ToolAttributeTest implements ModInitializer {
Registry.register(Registry.ITEM, new Identifier("fabric-tool-attribute-api-v1-testmod", "hardened_gravel_block"), new BlockItem(gravelBlock, new Item.Settings()));
// Register a block that requires a pickaxe that is as strong or stronger than an iron one.
stoneBlock = Registry.register(Registry.BLOCK, new Identifier("fabric-tool-attribute-api-v1-testmod", "hardened_stone_block"),
new Block(FabricBlockSettings.of(Material.STONE, MapColor.STONE)
new Block(FabricBlockSettings.of(Material.STONE, MapColor.STONE_GRAY)
.breakByTool(FabricToolTags.PICKAXES, 2)
.requiresTool()
.strength(0.6F)
@ -159,7 +159,7 @@ public class ToolAttributeTest implements ModInitializer {
}
private void testToolOnBlock(ItemStack item, Block block, boolean inEffective, float inSpeed) {
boolean effective = item.isEffectiveOn(block.getDefaultState());
boolean effective = item.isSuitableFor(block.getDefaultState());
float speed = item.getMiningSpeedMultiplier(block.getDefaultState());
if (inEffective != effective) {