mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-03 10:39:57 -04:00
23w04a
This commit is contained in:
parent
f8bf55319b
commit
a1ccd7bfed
47 changed files with 149 additions and 129 deletions
deprecated/fabric-networking-v0/src
client/java/net/fabricmc/fabric
main/java/net/fabricmc/fabric
api/network
impl/networking/v0
fabric-api-base/src/testmod/java/net/fabricmc/fabric/test/base
fabric-biome-api-v1/src/testmod/java/net/fabricmc/fabric/test/biome
fabric-data-generation-api-v1/src/main/resources
fabric-entity-events-v1/src
main/java/net/fabricmc/fabric/mixin/entity/event
testmod/java/net/fabricmc/fabric/test/entity/event
fabric-events-interaction-v0/src
client/java/net/fabricmc/fabric/mixin/event/interaction/client
main/java/net/fabricmc/fabric/mixin/event/interaction
fabric-game-rule-api-v1/src/client/java/net/fabricmc/fabric/impl/gamerule/widget
fabric-item-api-v1/src
main/java/net/fabricmc/fabric/mixin/item
testmod/java/net/fabricmc/fabric/test/item
fabric-networking-api-v1/src
client/java/net/fabricmc/fabric
api/client/networking/v1
impl/networking/client
main/java/net/fabricmc/fabric
api/networking/v1
impl/networking
AbstractChanneledNetworkAddon.javaDisconnectPacketSource.javaGenericFutureListenerHolder.javaPacketCallbackListener.java
server
mixin/networking
testmod/java/net/fabricmc/fabric/test/networking/disconnectscreen
fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/mixin/recipe/ingredient
fabric-registry-sync-v0/src/client/java/net/fabricmc/fabric/impl/client/registry/sync
fabric-rendering-v1/src/testmod/java/net/fabricmc/fabric/test/rendering
fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader
fabric-screen-handler-api-v1/src
main
java/net/fabricmc/fabric
api/screenhandler/v1
mixin/screenhandler
resources
testmod/java/net/fabricmc/fabric/test/screenhandler
fabric-transitive-access-wideners-v1
gradle.properties
|
@ -19,7 +19,7 @@ package net.fabricmc.fabric.api.network;
|
|||
import io.netty.util.concurrent.Future;
|
||||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.thread.ThreadExecutor;
|
||||
|
@ -45,7 +45,7 @@ public class ClientSidePacketRegistryImpl implements ClientSidePacketRegistry, P
|
|||
@Override
|
||||
public void sendToServer(Packet<?> packet, GenericFutureListener<? extends Future<? super Void>> completionListener) {
|
||||
if (MinecraftClient.getInstance().getNetworkHandler() != null) {
|
||||
MinecraftClient.getInstance().getNetworkHandler().method_48296().send(packet, GenericFutureListenerHolder.create(completionListener));
|
||||
MinecraftClient.getInstance().getNetworkHandler().getConnection().send(packet, GenericFutureListenerHolder.create(completionListener));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.api.network;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import io.netty.util.concurrent.Future;
|
|||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import io.netty.util.concurrent.Future;
|
|||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.nio.file.Path;
|
|||
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
|
||||
import net.minecraft.class_8032;
|
||||
import net.minecraft.client.gui.screen.AccessibilityOnboardingScreen;
|
||||
import net.minecraft.client.gui.screen.ConfirmScreen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.screen.world.CreateWorldScreen;
|
||||
|
@ -68,10 +68,10 @@ public class FabricApiAutoTestClient implements ClientModInitializer {
|
|||
private void runTest() {
|
||||
waitForLoadingComplete();
|
||||
|
||||
final boolean onboardAccessibility = submitAndWait(client -> client.options.field_41785);
|
||||
final boolean onboardAccessibility = submitAndWait(client -> client.options.onboardAccessibility);
|
||||
|
||||
if (!onboardAccessibility) {
|
||||
waitForScreen(class_8032.class);
|
||||
waitForScreen(AccessibilityOnboardingScreen.class);
|
||||
takeScreenshot("onboarding_screen");
|
||||
clickScreenButton("gui.continue");
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public final class FabricClientTestHelper {
|
|||
}
|
||||
|
||||
if (drawable instanceof GridWidget gridWidget) {
|
||||
gridWidget.method_48206(clickableWidget -> pressMatchingButton(clickableWidget, buttonText));
|
||||
gridWidget.forEachChild(clickableWidget -> pressMatchingButton(clickableWidget, buttonText));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public final class TestBiomes {
|
|||
private static Biome composeEndSpawnSettings(GenerationSettings.Builder builder) {
|
||||
SpawnSettings.Builder builder2 = new SpawnSettings.Builder();
|
||||
DefaultBiomeFeatures.addPlainsMobs(builder2);
|
||||
return (new Biome.Builder()).method_48164(false).temperature(0.5F).downfall(0.5F).effects((new BiomeEffects.Builder()).waterColor(4159204).waterFogColor(329011).fogColor(10518688).skyColor(0).moodSound(
|
||||
return (new Biome.Builder()).precipitation(false).temperature(0.5F).downfall(0.5F).effects((new BiomeEffects.Builder()).waterColor(4159204).waterFogColor(329011).fogColor(10518688).skyColor(0).moodSound(
|
||||
BiomeMoodSound.CAVE).build()).spawnSettings(builder2.build()).generationSettings(builder.build()).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,9 @@ transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider off
|
|||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerSmelting (Ljava/util/function/Consumer;Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerBlasting (Ljava/util/function/Consumer;Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerMultipleOptions (Ljava/util/function/Consumer;Lnet/minecraft/recipe/RecipeSerializer;Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;Ljava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48531 (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/Item;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerNetheriteUpgradeRecipe (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/Item;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48530 (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offer2x2CompactingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerCompactingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerCompactingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
|
||||
|
@ -109,6 +111,8 @@ transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider off
|
|||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerReversibleCompactingRecipesWithCompactingRecipeGroup (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;Ljava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerReversibleCompactingRecipesWithReverseRecipeGroup (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;Ljava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerReversibleCompactingRecipes (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48532 (Ljava/util/function/Consumer;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/registry/tag/TagKey;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48533 (Ljava/util/function/Consumer;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider generateCookingRecipes (Ljava/util/function/Consumer;Ljava/lang/String;Lnet/minecraft/recipe/RecipeSerializer;I)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerFoodCookingRecipe (Ljava/util/function/Consumer;Ljava/lang/String;Lnet/minecraft/recipe/RecipeSerializer;ILnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;F)V
|
||||
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerWaxingRecipes (Ljava/util/function/Consumer;)V
|
||||
|
@ -287,6 +291,11 @@ transitive-accessible method net/minecraft/data/client/ItemModelGenerator regist
|
|||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator register (Lnet/minecraft/item/Item;Lnet/minecraft/item/Item;Lnet/minecraft/data/client/Model;)V
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator registerCompass (Lnet/minecraft/item/Item;)V
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator registerClock (Lnet/minecraft/item/Item;)V
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48517 (Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)V
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48518 (Lnet/minecraft/util/Identifier;Ljava/lang/String;)Lnet/minecraft/util/Identifier;
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48520 (Lnet/minecraft/item/ArmorItem;)Ljava/util/List;
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48519 (Lnet/minecraft/util/Identifier;Ljava/util/Map;Ljava/util/List;)Lcom/google/gson/JsonObject;
|
||||
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48523 (Lnet/minecraft/item/ArmorItem;)V
|
||||
transitive-extendable method net/minecraft/data/MetadataProvider getName ()Ljava/lang/String;
|
||||
transitive-extendable method net/minecraft/data/SnbtProvider getName ()Ljava/lang/String;
|
||||
transitive-extendable method net/minecraft/data/client/ModelProvider getName ()Ljava/lang/String;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.network.packet.s2c.play.Flag;
|
||||
import net.minecraft.network.packet.s2c.play.PositionFlag;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -50,8 +50,8 @@ abstract class EntityMixin {
|
|||
/**
|
||||
* We need to fire the change world event for entities that are teleported using the `/teleport` command.
|
||||
*/
|
||||
@Inject(method = "method_48105", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;setRemoved(Lnet/minecraft/entity/Entity$RemovalReason;)V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void afterEntityTeleportedToWorld(ServerWorld destination, double x, double y, double z, Set<Flag> flags, float yaw, float pitch, CallbackInfoReturnable<Boolean> cir, float i, Entity newEntity) {
|
||||
@Inject(method = "teleport(Lnet/minecraft/server/world/ServerWorld;DDDLjava/util/Set;FF)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;setRemoved(Lnet/minecraft/entity/Entity$RemovalReason;)V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void afterEntityTeleportedToWorld(ServerWorld destination, double x, double y, double z, Set<PositionFlag> flags, float yaw, float pitch, CallbackInfoReturnable<Boolean> cir, float i, Entity newEntity) {
|
||||
Entity originalEntity = (Entity) (Object) this;
|
||||
ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD.invoker().afterChangeWorld(originalEntity, newEntity, ((ServerWorld) originalEntity.world), destination);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package net.fabricmc.fabric.test.entity.event;
|
||||
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.ArmorMaterials;
|
||||
|
||||
|
@ -24,6 +23,6 @@ import net.fabricmc.fabric.api.entity.event.v1.FabricElytraItem;
|
|||
|
||||
public class DiamondElytraItem extends ArmorItem implements FabricElytraItem {
|
||||
public DiamondElytraItem() {
|
||||
super(ArmorMaterials.DIAMOND, EquipmentSlot.CHEST, new Settings().maxCount(1));
|
||||
super(ArmorMaterials.DIAMOND, class_8051.CHESTPLATE, new Settings().maxCount(1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public abstract class ClientPlayerInteractionManagerMixin {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/Packet;)V", ordinal = 0), method = "interactItem", cancellable = true)
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V", ordinal = 0), method = "interactItem", cancellable = true)
|
||||
public void interactItem(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> info) {
|
||||
// hook interactBlock between the spectator check and sending the first packet to invoke the use item event first
|
||||
// this needs to be in interactBlock to avoid sending a packet in line with the event javadoc
|
||||
|
@ -127,7 +127,7 @@ public abstract class ClientPlayerInteractionManagerMixin {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/Packet;)V", ordinal = 0), method = "attackEntity", cancellable = true)
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V", ordinal = 0), method = "attackEntity", cancellable = true)
|
||||
public void attackEntity(PlayerEntity player, Entity entity, CallbackInfo info) {
|
||||
ActionResult result = AttackEntityCallback.EVENT.invoker().interact(player, player.getEntityWorld(), Hand.MAIN_HAND /* TODO */, entity, null);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.listener.ClientPlayPacketListener;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket;
|
||||
|
|
|
@ -61,7 +61,7 @@ public final class DoubleRuleWidget extends EditGameRulesScreen.NamedRuleWidget
|
|||
// FIXME: Param names nightmare
|
||||
this.drawName(matrices, y, x);
|
||||
|
||||
this.textFieldWidget.method_48229(x + entryWidth - 44, y);
|
||||
this.textFieldWidget.setPosition(x + entryWidth - 44, y);
|
||||
this.textFieldWidget.render(matrices, mouseX, mouseY, tickDelta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public final class EnumRuleWidget<E extends Enum<E>> extends EditGameRulesScreen
|
|||
// FIXME: Param names nightmare
|
||||
this.drawName(matrices, y, x);
|
||||
|
||||
this.buttonWidget.method_48229(x + entryWidth - 89, y);
|
||||
this.buttonWidget.setPosition(x + entryWidth - 89, y);
|
||||
this.buttonWidget.render(matrices, mouseX, mouseY, tickDelta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,37 +16,37 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.item;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
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.ModifyVariable;
|
||||
|
||||
import net.minecraft.entity.attribute.EntityAttribute;
|
||||
import net.minecraft.entity.attribute.EntityAttributeModifier;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.attribute.EntityAttribute;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.ArmorMaterial;
|
||||
import net.minecraft.item.ArmorMaterials;
|
||||
|
||||
@Mixin(ArmorItem.class)
|
||||
public class ArmorItemMixin {
|
||||
@Shadow private static @Final UUID[] MODIFIERS;
|
||||
@Shadow private static @Final EnumMap<ArmorItem.class_8051, UUID> MODIFIERS;
|
||||
@Shadow protected @Final float knockbackResistance;
|
||||
|
||||
/* Vanilla only adds a knockback resistance modifier to ArmorItems made of ArmorMaterials.NETHERITE. This mixin
|
||||
* adds a knockback resistance modifier to any ArmorItem if knockbackResistance is > 0.0F.
|
||||
*/
|
||||
@ModifyVariable(method = "<init>", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/ImmutableMultimap$Builder;build()Lcom/google/common/collect/ImmutableMultimap;"))
|
||||
private ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> fabric_knockbackResistance(ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder, ArmorMaterial material, EquipmentSlot slot) {
|
||||
private ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> fabric_knockbackResistance(ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder, ArmorMaterial material, ArmorItem.class_8051 slot) {
|
||||
// Vanilla handles netherite
|
||||
if (material != ArmorMaterials.NETHERITE && knockbackResistance > 0.0F) {
|
||||
builder.put(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, new EntityAttributeModifier(
|
||||
MODIFIERS[slot.getEntitySlotId()], "Armor knockback resistance",
|
||||
MODIFIERS.get(slot), "Armor knockback resistance",
|
||||
knockbackResistance, EntityAttributeModifier.Operation.ADDITION));
|
||||
}
|
||||
|
||||
|
|
|
@ -16,29 +16,28 @@
|
|||
|
||||
package net.fabricmc.fabric.test.item;
|
||||
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.ArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.registry.tag.ItemTags;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.tag.ItemTags;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class ArmorKnockbackResistanceTest implements ModInitializer {
|
||||
private static final ArmorMaterial WOOD_ARMOR = new ArmorMaterial() {
|
||||
@Override
|
||||
public int getDurability(EquipmentSlot slot) {
|
||||
public int method_48402(ArmorItem.class_8051 arg) {
|
||||
return 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProtectionAmount(EquipmentSlot slot) {
|
||||
public int method_48403(ArmorItem.class_8051 arg) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
@ -71,11 +70,16 @@ public class ArmorKnockbackResistanceTest implements ModInitializer {
|
|||
public float getKnockbackResistance() {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean method_48404() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
Registry.register(Registries.ITEM, new Identifier("fabric-item-api-v1-testmod",
|
||||
"wooden_boots"), new ArmorItem(WOOD_ARMOR, EquipmentSlot.FEET, new Item.Settings()));
|
||||
"wooden_boots"), new ArmorItem(WOOD_ARMOR, ArmorItem.class_8051.BOOTS, new Item.Settings()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.item.Items;
|
|||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeSerializer;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.registry.DynamicRegistryManager;
|
||||
import net.minecraft.test.GameTest;
|
||||
import net.minecraft.test.GameTestException;
|
||||
import net.minecraft.test.TestContext;
|
||||
|
@ -79,7 +80,7 @@ public class RecipeGameTest implements FabricGameTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack craft(SimpleInventory inventory) {
|
||||
public ItemStack craft(SimpleInventory inventory, DynamicRegistryManager dynamicRegistryManager) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -89,7 +90,7 @@ public class RecipeGameTest implements FabricGameTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOutput() {
|
||||
public ItemStack getOutput(DynamicRegistryManager dynamicRegistryManager) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.listener.ServerPlayPacketListener;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.client.gui.screen.ConnectScreen;
|
|||
import net.minecraft.client.network.ClientLoginNetworkHandler;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.listener.ServerPlayPacketListener;
|
||||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.slf4j.Logger;
|
|||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -45,7 +45,7 @@ public final class ClientPlayNetworkAddon extends AbstractChanneledNetworkAddon<
|
|||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public ClientPlayNetworkAddon(ClientPlayNetworkHandler handler, MinecraftClient client) {
|
||||
super(ClientNetworkingImpl.PLAY, handler.method_48296(), "ClientPlayNetworkAddon for " + handler.getProfile().getName());
|
||||
super(ClientNetworkingImpl.PLAY, handler.getConnection(), "ClientPlayNetworkAddon for " + handler.getProfile().getName());
|
||||
this.handler = handler;
|
||||
this.client = client;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.netty.util.concurrent.Future;
|
|||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.PacketCallbacks;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.Set;
|
|||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.listener.ClientPlayPacketListener;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
|
|
@ -31,7 +31,7 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.PacketCallbacks;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.networking;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public interface DisconnectPacketSource {
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketCallbacks;
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.networking;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
|
||||
public interface PacketCallbackListener {
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.PacketCallbacks;
|
||||
import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.networking.server;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.listener.ClientPlayPacketListener;
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketCallbacks;
|
||||
import net.minecraft.network.listener.PacketListener;
|
||||
import net.minecraft.text.Text;
|
||||
|
@ -68,7 +68,7 @@ abstract class ClientConnectionMixin implements ChannelInfoHolder {
|
|||
}
|
||||
|
||||
// Must be fully qualified due to mixin not working in production without it
|
||||
@Redirect(method = "exceptionCaught", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/Packet;Lnet/minecraft/network/PacketCallbacks;)V"))
|
||||
@Redirect(method = "exceptionCaught", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V"))
|
||||
private void resendOnExceptionCaught(ClientConnection self, Packet<?> packet, PacketCallbacks listener, ChannelHandlerContext context, Throwable ex) {
|
||||
PacketListener handler = this.packetListener;
|
||||
Text disconnectMessage = Text.translatable("disconnect.genericReason", "Internal Exception: " + ex);
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.login.LoginDisconnectS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.login.LoginQueryRequestS2CPacket;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class DisconnectScreenTest implements ClientModInitializer {
|
|||
builder.append("\nLine ").append(i + 1);
|
||||
}
|
||||
|
||||
context.getSource().getPlayer().networkHandler.method_48296().disconnect(Text.of(builder.toString()));
|
||||
context.getSource().getPlayer().networkHandler.getConnection().disconnect(Text.of(builder.toString()));
|
||||
return 1;
|
||||
})));
|
||||
}
|
||||
|
|
|
@ -26,7 +26,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.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.PacketEncoder;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
|
@ -46,9 +46,9 @@ public class PacketEncoderMixin implements SupportedIngredientsPacketEncoder {
|
|||
@Inject(
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/network/Packet.write(Lnet/minecraft/network/PacketByteBuf;)V"
|
||||
target = "net/minecraft/network/packet/Packet.write(Lnet/minecraft/network/PacketByteBuf;)V"
|
||||
),
|
||||
method = "encode(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/Packet;Lio/netty/buffer/ByteBuf;)V"
|
||||
method = "encode(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;Lio/netty/buffer/ByteBuf;)V"
|
||||
)
|
||||
private void capturePacketEncoder(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf, CallbackInfo ci) {
|
||||
CustomIngredientSync.CURRENT_SUPPORTED_INGREDIENTS.set(fabric_supportedCustomIngredients);
|
||||
|
@ -59,17 +59,17 @@ public class PacketEncoderMixin implements SupportedIngredientsPacketEncoder {
|
|||
// Normal target after writing
|
||||
@At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/network/Packet.write(Lnet/minecraft/network/PacketByteBuf;)V",
|
||||
target = "net/minecraft/network/packet/Packet.write(Lnet/minecraft/network/PacketByteBuf;)V",
|
||||
shift = At.Shift.AFTER,
|
||||
by = 1
|
||||
),
|
||||
// In the catch handler in case some exception was thrown
|
||||
@At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/network/Packet.isWritingErrorSkippable()Z"
|
||||
target = "net/minecraft/network/packet/Packet.isWritingErrorSkippable()Z"
|
||||
)
|
||||
},
|
||||
method = "encode(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/Packet;Lio/netty/buffer/ByteBuf;)V"
|
||||
method = "encode(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;Lio/netty/buffer/ByteBuf;)V"
|
||||
)
|
||||
private void releasePacketEncoder(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf, CallbackInfo ci) {
|
||||
CustomIngredientSync.CURRENT_SUPPORTED_INGREDIENTS.set(null);
|
||||
|
|
|
@ -40,7 +40,7 @@ public class FabricRegistryClientInit implements ClientModInitializer {
|
|||
RegistrySyncManager.receivePacket(client, packetHandler, buf, RegistrySyncManager.DEBUG || !client.isInSingleplayer(), (e) -> {
|
||||
LOGGER.error("Registry remapping failed!", e);
|
||||
|
||||
client.execute(() -> handler.method_48296().disconnect(Text.literal("Registry remapping failed: " + e.getMessage())));
|
||||
client.execute(() -> handler.getConnection().disconnect(Text.literal("Registry remapping failed: " + e.getMessage())));
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,25 +18,24 @@ package net.fabricmc.fabric.test.rendering;
|
|||
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.client.item.TooltipData;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.ArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registry;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class TooltipComponentTestInit implements ModInitializer {
|
||||
public static Item CUSTOM_TOOLTIP_ITEM = new CustomTooltipItem();
|
||||
public static Item CUSTOM_ARMOR_ITEM = new ArmorItem(TestArmorMaterial.INSTANCE, EquipmentSlot.CHEST, new Item.Settings());
|
||||
public static Item CUSTOM_ARMOR_ITEM = new ArmorItem(TestArmorMaterial.INSTANCE, ArmorItem.class_8051.CHESTPLATE, new Item.Settings());
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
|
@ -65,12 +64,12 @@ public class TooltipComponentTestInit implements ModInitializer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getDurability(EquipmentSlot slot) {
|
||||
public int method_48402(ArmorItem.class_8051 arg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProtectionAmount(EquipmentSlot slot) {
|
||||
public int method_48403(ArmorItem.class_8051 arg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -103,5 +102,10 @@ public class TooltipComponentTestInit implements ModInitializer {
|
|||
public float getKnockbackResistance() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean method_48404() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class FabricModResourcePack extends GroupResourcePack {
|
|||
|
||||
if ("pack.mcmeta".equals(fileName)) {
|
||||
String description = "Mod resources.";
|
||||
String pack = String.format("{\"pack\":{\"pack_format\":" + SharedConstants.getGameVersion().method_48017(type) + ",\"description\":\"%s\"}}", description);
|
||||
String pack = String.format("{\"pack\":{\"pack_format\":" + SharedConstants.getGameVersion().getResourceVersion(type) + ",\"description\":\"%s\"}}", description);
|
||||
return () -> IOUtils.toInputStream(pack, Charsets.UTF_8);
|
||||
} else if ("pack.png".equals(fileName)) {
|
||||
return FabricLoader.getInstance().getModContainer("fabric-resource-loader-v0")
|
||||
|
|
|
@ -84,7 +84,7 @@ public final class ModResourcePackUtil {
|
|||
switch (filename) {
|
||||
case "pack.mcmeta":
|
||||
String description = Objects.requireNonNullElse(info.getName(), "");
|
||||
String metadata = serializeMetadata(SharedConstants.getGameVersion().method_48017(type), description);
|
||||
String metadata = serializeMetadata(SharedConstants.getGameVersion().getResourceVersion(type), description);
|
||||
return IOUtils.toInputStream(metadata, Charsets.UTF_8);
|
||||
default:
|
||||
return null;
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.Objects;
|
|||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.resource.featuretoggle.FeatureFlags;
|
||||
import net.minecraft.screen.NamedScreenHandlerFactory;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
@ -69,7 +70,7 @@ public class ExtendedScreenHandlerType<T extends ScreenHandler> extends ScreenHa
|
|||
* @param factory the screen handler factory used for {@link #create(int, PlayerInventory, PacketByteBuf)}
|
||||
*/
|
||||
public ExtendedScreenHandlerType(ExtendedFactory<T> factory) {
|
||||
super(null);
|
||||
super(null, FeatureFlags.VANILLA_FEATURES);
|
||||
this.factory = Objects.requireNonNull(factory, "screen handler factory cannot be null");
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package net.fabricmc.fabric.api.screenhandler.v1;
|
|||
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.resource.featuretoggle.FeatureFlags;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -87,7 +88,7 @@ public final class ScreenHandlerRegistry {
|
|||
public static <T extends ScreenHandler> ScreenHandlerType<T> registerSimple(Identifier id, SimpleClientHandlerFactory<T> factory) {
|
||||
// Wrap our factory in vanilla's factory; it will not be public for users.
|
||||
// noinspection Convert2MethodRef - Must be a lambda or else dedicated server will crash
|
||||
ScreenHandlerType<T> type = new ScreenHandlerType<>((syncId, inventory) -> factory.create(syncId, inventory));
|
||||
ScreenHandlerType<T> type = new ScreenHandlerType<>((syncId, inventory) -> factory.create(syncId, inventory), FeatureFlags.VANILLA_FEATURES);
|
||||
return Registry.register(Registries.SCREEN_HANDLER, id, type);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.screen.NamedScreenHandlerFactory;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
|
@ -69,7 +69,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(method = "openHandledScreen(Lnet/minecraft/screen/NamedScreenHandlerFactory;)Ljava/util/OptionalInt;", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;sendPacket(Lnet/minecraft/network/Packet;)V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
@Inject(method = "openHandledScreen(Lnet/minecraft/screen/NamedScreenHandlerFactory;)Ljava/util/OptionalInt;", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void fabric_storeOpenedScreenHandler(NamedScreenHandlerFactory factory, CallbackInfoReturnable<OptionalInt> info, ScreenHandler handler) {
|
||||
if (factory instanceof ExtendedScreenHandlerFactory || (factory instanceof SimpleNamedScreenHandlerFactory simpleFactory && simpleFactory.baseFactory instanceof ExtendedScreenHandlerFactory)) {
|
||||
fabric_openedScreenHandler.set(handler);
|
||||
|
@ -79,7 +79,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "openHandledScreen(Lnet/minecraft/screen/NamedScreenHandlerFactory;)Ljava/util/OptionalInt;", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;sendPacket(Lnet/minecraft/network/Packet;)V"))
|
||||
@Redirect(method = "openHandledScreen(Lnet/minecraft/screen/NamedScreenHandlerFactory;)Ljava/util/OptionalInt;", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V"))
|
||||
private void fabric_replaceVanillaScreenPacket(ServerPlayNetworkHandler networkHandler, Packet<?> packet, NamedScreenHandlerFactory factory) {
|
||||
if (factory instanceof SimpleNamedScreenHandlerFactory simpleFactory && simpleFactory.baseFactory instanceof ExtendedScreenHandlerFactory extendedFactory) {
|
||||
factory = extendedFactory;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
accessWidener v1 named
|
||||
accessible class net/minecraft/screen/ScreenHandlerType$Factory
|
||||
accessible method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;)V
|
||||
extendable method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;)V
|
||||
accessible method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;Lnet/minecraft/resource/featuretoggle/FeatureSet;)V
|
||||
extendable method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;Lnet/minecraft/resource/featuretoggle/FeatureSet;)V
|
||||
|
||||
accessible class net/minecraft/client/gui/screen/ingame/HandledScreens$Provider
|
||||
accessible method net/minecraft/client/gui/screen/ingame/HandledScreens register (Lnet/minecraft/screen/ScreenHandlerType;Lnet/minecraft/client/gui/screen/ingame/HandledScreens$Provider;)V
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.block.Blocks;
|
|||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.resource.featuretoggle.FeatureFlags;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registries;
|
||||
|
@ -46,7 +47,7 @@ public class ScreenHandlerTest implements ModInitializer {
|
|||
public static final Block BOX = new BoxBlock(AbstractBlock.Settings.copy(Blocks.OAK_WOOD));
|
||||
public static final Item BOX_ITEM = new BlockItem(BOX, new Item.Settings());
|
||||
public static final BlockEntityType<BoxBlockEntity> BOX_ENTITY = FabricBlockEntityTypeBuilder.create(BoxBlockEntity::new, BOX).build();
|
||||
public static final ScreenHandlerType<BagScreenHandler> BAG_SCREEN_HANDLER = new ScreenHandlerType<>(BagScreenHandler::new);
|
||||
public static final ScreenHandlerType<BagScreenHandler> BAG_SCREEN_HANDLER = new ScreenHandlerType<>(BagScreenHandler::new, FeatureFlags.VANILLA_FEATURES);
|
||||
public static final ScreenHandlerType<PositionedBagScreenHandler> POSITIONED_BAG_SCREEN_HANDLER = new ExtendedScreenHandlerType<>(PositionedBagScreenHandler::new);
|
||||
public static final ScreenHandlerType<BoxScreenHandler> BOX_SCREEN_HANDLER = new ExtendedScreenHandlerType<>(BoxScreenHandler::new);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ transitive-accessible method net/minecraft/advancement/criterion/Criteria regist
|
|||
|
||||
# Creating custom screen handler types
|
||||
transitive-accessible class net/minecraft/screen/ScreenHandlerType$Factory
|
||||
transitive-accessible method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;)V
|
||||
transitive-accessible method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;Lnet/minecraft/resource/featuretoggle/FeatureSet;)V
|
||||
|
||||
# Registering custom screen handler type -> screen mappings
|
||||
transitive-accessible class net/minecraft/client/gui/screen/ingame/HandledScreens$Provider
|
||||
|
@ -102,7 +102,7 @@ transitive-accessible method net/minecraft/entity/projectile/ProjectileEntity <i
|
|||
transitive-accessible method net/minecraft/entity/projectile/FishingBobberEntity <init> (Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;II)V
|
||||
|
||||
# Miscellaneous other methods
|
||||
transitive-accessible method net/minecraft/server/world/ServerWorld sendToPlayerIfNearby (Lnet/minecraft/server/network/ServerPlayerEntity;ZDDDLnet/minecraft/network/Packet;)Z
|
||||
transitive-accessible method net/minecraft/server/world/ServerWorld sendToPlayerIfNearby (Lnet/minecraft/server/network/ServerPlayerEntity;ZDDDLnet/minecraft/network/packet/Packet;)Z
|
||||
transitive-accessible method net/minecraft/text/TextColor getHexCode ()Ljava/lang/String;
|
||||
transitive-accessible method net/minecraft/text/TranslatableTextContent getArg (I)Lnet/minecraft/text/StringVisitable;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ transitive-accessible method net/minecraft/advancement/criterion/Criteria regist
|
|||
|
||||
# Creating custom screen handler types
|
||||
transitive-accessible class net/minecraft/screen/ScreenHandlerType$Factory
|
||||
transitive-accessible method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;)V
|
||||
transitive-accessible method net/minecraft/screen/ScreenHandlerType <init> (Lnet/minecraft/screen/ScreenHandlerType$Factory;Lnet/minecraft/resource/featuretoggle/FeatureSet;)V
|
||||
|
||||
# Registering custom screen handler type -> screen mappings
|
||||
transitive-accessible class net/minecraft/client/gui/screen/ingame/HandledScreens$Provider
|
||||
|
@ -97,7 +97,7 @@ transitive-accessible method net/minecraft/entity/projectile/ProjectileEntity <i
|
|||
transitive-accessible method net/minecraft/entity/projectile/FishingBobberEntity <init> (Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;II)V
|
||||
|
||||
# Miscellaneous other methods
|
||||
transitive-accessible method net/minecraft/server/world/ServerWorld sendToPlayerIfNearby (Lnet/minecraft/server/network/ServerPlayerEntity;ZDDDLnet/minecraft/network/Packet;)Z
|
||||
transitive-accessible method net/minecraft/server/world/ServerWorld sendToPlayerIfNearby (Lnet/minecraft/server/network/ServerPlayerEntity;ZDDDLnet/minecraft/network/packet/Packet;)Z
|
||||
transitive-accessible method net/minecraft/text/TextColor getHexCode ()Ljava/lang/String;
|
||||
transitive-accessible method net/minecraft/text/TranslatableTextContent getArg (I)Lnet/minecraft/text/StringVisitable;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
org.gradle.jvmargs=-Xmx2560M
|
||||
org.gradle.parallel=true
|
||||
|
||||
version=0.73.0
|
||||
minecraft_version=23w03a
|
||||
version=0.73.1
|
||||
minecraft_version=23w04a
|
||||
yarn_version=+build.1
|
||||
loader_version=0.14.13
|
||||
installer_version=0.11.1
|
||||
|
@ -10,53 +10,53 @@ installer_version=0.11.1
|
|||
prerelease=true
|
||||
|
||||
# Do not manually update, use the bumpversions task:
|
||||
fabric-api-base-version=0.4.21
|
||||
fabric-api-lookup-api-v1-version=1.6.20
|
||||
fabric-biome-api-v1-version=13.0.0
|
||||
fabric-api-base-version=0.4.22
|
||||
fabric-api-lookup-api-v1-version=1.6.21
|
||||
fabric-biome-api-v1-version=13.0.1
|
||||
fabric-block-api-v1-version=1.0.4
|
||||
fabric-blockrenderlayer-v1-version=1.1.30
|
||||
fabric-command-api-v1-version=1.2.22
|
||||
fabric-command-api-v2-version=2.2.1
|
||||
fabric-commands-v0-version=0.2.39
|
||||
fabric-containers-v0-version=0.1.47
|
||||
fabric-content-registries-v0-version=3.5.1
|
||||
fabric-blockrenderlayer-v1-version=1.1.31
|
||||
fabric-command-api-v1-version=1.2.23
|
||||
fabric-command-api-v2-version=2.2.2
|
||||
fabric-commands-v0-version=0.2.40
|
||||
fabric-containers-v0-version=0.1.48
|
||||
fabric-content-registries-v0-version=3.5.2
|
||||
fabric-crash-report-info-v1-version=0.2.13
|
||||
fabric-data-generation-api-v1-version=11.2.0
|
||||
fabric-dimensions-v1-version=2.1.41
|
||||
fabric-entity-events-v1-version=1.5.7
|
||||
fabric-events-interaction-v0-version=0.4.40
|
||||
fabric-events-lifecycle-v0-version=0.2.44
|
||||
fabric-game-rule-api-v1-version=1.0.30
|
||||
fabric-gametest-api-v1-version=1.1.17
|
||||
fabric-item-api-v1-version=2.1.10
|
||||
fabric-item-group-api-v1-version=2.1.12
|
||||
fabric-data-generation-api-v1-version=11.2.1
|
||||
fabric-dimensions-v1-version=2.1.42
|
||||
fabric-entity-events-v1-version=1.5.8
|
||||
fabric-events-interaction-v0-version=0.4.41
|
||||
fabric-events-lifecycle-v0-version=0.2.45
|
||||
fabric-game-rule-api-v1-version=1.0.31
|
||||
fabric-gametest-api-v1-version=1.1.18
|
||||
fabric-item-api-v1-version=2.1.11
|
||||
fabric-item-group-api-v1-version=2.1.13
|
||||
fabric-key-binding-api-v1-version=1.0.30
|
||||
fabric-keybindings-v0-version=0.2.28
|
||||
fabric-lifecycle-events-v1-version=2.2.10
|
||||
fabric-loot-api-v2-version=1.1.20
|
||||
fabric-loot-tables-v1-version=1.1.24
|
||||
fabric-message-api-v1-version=5.0.14
|
||||
fabric-mining-level-api-v1-version=2.1.31
|
||||
fabric-models-v0-version=0.3.27
|
||||
fabric-networking-api-v1-version=1.2.17
|
||||
fabric-networking-v0-version=0.3.34
|
||||
fabric-object-builder-api-v1-version=5.4.0
|
||||
fabric-particles-v1-version=1.0.20
|
||||
fabric-recipe-api-v1-version=1.0.1
|
||||
fabric-registry-sync-v0-version=2.0.5
|
||||
fabric-renderer-api-v1-version=2.2.1
|
||||
fabric-renderer-indigo-version=0.7.1
|
||||
fabric-renderer-registries-v1-version=3.2.30
|
||||
fabric-rendering-data-attachment-v1-version=0.3.25
|
||||
fabric-rendering-fluids-v1-version=3.0.18
|
||||
fabric-rendering-v0-version=1.1.33
|
||||
fabric-rendering-v1-version=1.12.1
|
||||
fabric-lifecycle-events-v1-version=2.2.11
|
||||
fabric-loot-api-v2-version=1.1.21
|
||||
fabric-loot-tables-v1-version=1.1.25
|
||||
fabric-message-api-v1-version=5.0.15
|
||||
fabric-mining-level-api-v1-version=2.1.32
|
||||
fabric-models-v0-version=0.3.28
|
||||
fabric-networking-api-v1-version=1.2.18
|
||||
fabric-networking-v0-version=0.3.35
|
||||
fabric-object-builder-api-v1-version=5.4.1
|
||||
fabric-particles-v1-version=1.0.21
|
||||
fabric-recipe-api-v1-version=1.0.2
|
||||
fabric-registry-sync-v0-version=2.0.6
|
||||
fabric-renderer-api-v1-version=2.2.2
|
||||
fabric-renderer-indigo-version=0.7.2
|
||||
fabric-renderer-registries-v1-version=3.2.31
|
||||
fabric-rendering-data-attachment-v1-version=0.3.26
|
||||
fabric-rendering-fluids-v1-version=3.0.19
|
||||
fabric-rendering-v0-version=1.1.34
|
||||
fabric-rendering-v1-version=1.12.2
|
||||
fabric-resource-conditions-api-v1-version=2.2.2
|
||||
fabric-resource-loader-v0-version=0.10.5
|
||||
fabric-screen-api-v1-version=1.0.41
|
||||
fabric-screen-handler-api-v1-version=1.3.13
|
||||
fabric-resource-loader-v0-version=0.10.6
|
||||
fabric-screen-api-v1-version=1.0.42
|
||||
fabric-screen-handler-api-v1-version=1.3.14
|
||||
fabric-sound-api-v1-version=1.0.7
|
||||
fabric-transfer-api-v1-version=2.1.15
|
||||
fabric-transitive-access-wideners-v1-version=2.3.0
|
||||
fabric-convention-tags-v1-version=1.2.2
|
||||
fabric-client-tags-api-v1-version=1.0.12
|
||||
fabric-transfer-api-v1-version=2.1.16
|
||||
fabric-transitive-access-wideners-v1-version=2.3.1
|
||||
fabric-convention-tags-v1-version=1.2.3
|
||||
fabric-client-tags-api-v1-version=1.0.13
|
||||
|
|
Loading…
Add table
Reference in a new issue