First look of 22w42a while we wait

This commit is contained in:
shedaniel
2022-10-21 00:04:42 +08:00
parent 6a9d61aa42
commit 2bc32b35d2
24 changed files with 269 additions and 261 deletions

View File

@@ -0,0 +1,48 @@
/*
* This file is part of architectury.
* Copyright (C) 2020, 2021, 2022 architectury
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package dev.architectury.event.events.client;
import dev.architectury.event.CompoundEventResult;
import dev.architectury.event.Event;
import dev.architectury.event.EventFactory;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.network.chat.Component;
@Environment(EnvType.CLIENT)
public interface ClientSystemMessageEvent {
/**
* @see Received#process(Component)
*/
Event<Received> RECEIVED = EventFactory.createCompoundEventResult();
@Environment(EnvType.CLIENT)
interface Received {
/**
* Event to intercept the receiving of a system message.
* Invoked as soon as the client receives the system message packet.
*
* @param message The chat message.
* @return A {@link CompoundEventResult} determining the outcome of the event,
* if an outcome is set, the received message is overridden.
*/
CompoundEventResult<Component> process(Component message);
}
}

View File

@@ -25,19 +25,22 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.Resource;
import net.minecraft.server.packs.resources.ResourceManager;
import java.util.function.Consumer;
import java.util.function.BiConsumer;
@Environment(EnvType.CLIENT)
public interface ClientTextureStitchEvent {
/**
* @see Pre#stitch(TextureAtlas, Consumer)
* @see Pre#stitch(TextureAtlas, ResourceManager, BiConsumer)
*/
Event<Pre> PRE = EventFactory.createLoop();
/**
* @see Post#stitch(TextureAtlas)
*/
Event<Post> POST = EventFactory.createLoop();
// Event<Post> POST = EventFactory.createLoop();
@Environment(EnvType.CLIENT)
interface Pre {
@@ -45,10 +48,11 @@ public interface ClientTextureStitchEvent {
* Invoked before the texture atlas is stitched together.
* Equivalent to Forge's {@code TextureStitchEvent.Pre} event.
*
* @param atlas The TextureAtlas.
* @param spriteAdder A consumer where you can add your own sprites to be stitched.
* @param atlas The TextureAtlas.
* @param resourceManager The resource manager.
* @param spriteAdder A consumer where you can add your own sprites to be stitched.
*/
void stitch(TextureAtlas atlas, Consumer<ResourceLocation> spriteAdder);
void stitch(TextureAtlas atlas, ResourceManager resourceManager, BiConsumer<ResourceLocation, Resource> spriteAdder);
}
@Environment(EnvType.CLIENT)

View File

@@ -29,6 +29,7 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity;
@@ -107,7 +108,7 @@ public final class NetworkManager {
* @see Entity#getAddEntityPacket()
*/
@ExpectPlatform
public static Packet<?> createAddEntityPacket(Entity entity) {
public static Packet<ClientGamePacketListener> createAddEntityPacket(Entity entity) {
throw new AssertionError();
}

View File

@@ -21,9 +21,11 @@ package dev.architectury.registry;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
public final class CreativeTabRegistry {
@@ -32,7 +34,7 @@ public final class CreativeTabRegistry {
// I am sorry, fabric wants a resource location instead of the translation key for whatever reason
@ExpectPlatform
public static CreativeModeTab create(ResourceLocation name, Supplier<ItemStack> icon) {
public static CreativeModeTab create(ResourceLocation name, Supplier<ItemStack> icon, BiConsumer<FeatureFlagSet, CreativeModeTab.Output> filler) {
throw new AssertionError();
}
}

View File

@@ -129,6 +129,7 @@ transitive-accessible method net/minecraft/client/renderer/RenderType create (Lj
transitive-accessible class net/minecraft/client/renderer/RenderType$CompositeState
transitive-accessible class net/minecraft/client/renderer/RenderType$CompositeRenderType
transitive-accessible class net/minecraft/client/renderer/RenderType$OutlineProperty
accessible class net/minecraft/client/resources/model/AtlasSet$AtlasEntry
accessible field net/minecraft/world/item/SpawnEggItem BY_ID Ljava/util/Map;
accessible field net/minecraft/world/item/SpawnEggItem defaultType Lnet/minecraft/world/entity/EntityType;
mutable field net/minecraft/world/item/SpawnEggItem defaultType Lnet/minecraft/world/entity/EntityType;
@@ -136,6 +137,8 @@ accessible field net/minecraft/world/item/RecordItem BY_NAME Ljava/util/Map;
accessible field net/minecraft/client/particle/ParticleEngine textureAtlas Lnet/minecraft/client/renderer/texture/TextureAtlas;
accessible class net/minecraft/client/particle/ParticleEngine$MutableSpriteSet
accessible field net/minecraft/client/particle/ParticleEngine$MutableSpriteSet sprites Ljava/util/List;
transitive-accessible class net/minecraft/world/item/CreativeModeTab$Output
transitive-accessible class net/minecraft/world/item/CreativeModeTab$TabVisibility
##############################
# This section is generated automatically with Gradle task generateAccessWidener!!!
@@ -161,6 +164,7 @@ transitive-accessible method net/minecraft/world/level/block/BigDripleafBlock <i
transitive-accessible method net/minecraft/world/level/block/BigDripleafStemBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/BlastFurnaceBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/BushBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/ButtonBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;IZLnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V
transitive-accessible method net/minecraft/world/level/block/CactusBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/CakeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/CandleCakeBlock <init> (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
@@ -178,7 +182,7 @@ transitive-accessible method net/minecraft/world/level/block/CrossCollisionBlock
transitive-accessible method net/minecraft/world/level/block/DeadBushBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/DirtPathBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/DispenserBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/DoorBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/DoorBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V
transitive-accessible method net/minecraft/world/level/block/EnchantmentTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/EndGatewayBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/EndPortalBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
@@ -210,7 +214,7 @@ transitive-accessible method net/minecraft/world/level/block/PipeBlock <init> (F
transitive-accessible method net/minecraft/world/level/block/PlayerHeadBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/PlayerWallHeadBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/PoweredRailBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/PressurePlateBlock <init> (Lnet/minecraft/world/level/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/PressurePlateBlock <init> (Lnet/minecraft/world/level/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V
transitive-accessible method net/minecraft/world/level/block/PumpkinBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/RailBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/RedstoneTorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
@@ -231,21 +235,19 @@ transitive-accessible method net/minecraft/world/level/block/SpawnerBlock <init>
transitive-accessible method net/minecraft/world/level/block/SpongeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/StairBlock <init> (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/StemBlock <init> (Lnet/minecraft/world/level/block/StemGrownBlock;Ljava/util/function/Supplier;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/StoneButtonBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/StructureBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/StructureVoidBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/SugarCaneBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/TallGrassBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/TorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V
transitive-accessible method net/minecraft/world/level/block/TrapDoorBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/TrapDoorBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V
transitive-accessible method net/minecraft/world/level/block/WallSkullBlock <init> (Lnet/minecraft/world/level/block/SkullBlock$Type;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WallTorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V
transitive-accessible method net/minecraft/world/level/block/WaterlilyBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WeightedPressurePlateBlock <init> (ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WeightedPressurePlateBlock <init> (ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V
transitive-accessible method net/minecraft/world/level/block/WetSpongeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WitherSkullBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WitherWallSkullBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WoodButtonBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
transitive-accessible method net/minecraft/world/level/block/WoolCarpetBlock <init> (Lnet/minecraft/world/item/DyeColor;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
# RenderStateShard fields