mirror of
https://github.com/FabricMC/fabric
synced 2026-08-19 06:26:07 -04:00
26.1-snapshot-7
* Start porting to 26.1-snapshot-7 * More fixes * Bump version
This commit is contained in:
parent
13d23d8ad6
commit
e2bdee78f0
29 changed files with 86 additions and 187 deletions
|
|
@ -43,7 +43,7 @@ public class InspectorBlock extends Block {
|
|||
|
||||
if (inspectable != null) {
|
||||
if (!level.isClientSide()) {
|
||||
player.displayClientMessage(inspectable.inspect(), true);
|
||||
player.sendOverlayMessage(inspectable.inspect());
|
||||
}
|
||||
|
||||
return InteractionResult.SUCCESS;
|
||||
|
|
@ -59,7 +59,7 @@ public class InspectorBlock extends Block {
|
|||
|
||||
if (inspectable != null) {
|
||||
for (ServerPlayer player : level.getServer().getPlayerList().getPlayers()) {
|
||||
player.displayClientMessage(inspectable.inspect(), true);
|
||||
player.sendOverlayMessage(inspectable.inspect());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@
|
|||
"entrypoints": {
|
||||
"main": [
|
||||
"net.fabricmc.fabric.test.block.ClimbableTrapdoorTest"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.test.block.client.ClimbableTrapdoorClientTest"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.test.block.client;
|
||||
|
||||
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.ChunkSectionLayerMap;
|
||||
import net.fabricmc.fabric.test.block.ClimbableTrapdoorTest;
|
||||
|
||||
public final class ClimbableTrapdoorClientTest implements ClientModInitializer {
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
ChunkSectionLayerMap.putBlocks(
|
||||
ChunkSectionLayer.CUTOUT,
|
||||
ClimbableTrapdoorTest.customLadderBlock,
|
||||
ClimbableTrapdoorTest.customNonLadderBlock
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ abstract class ClientSuggestionProviderMixin implements FabricClientCommandSourc
|
|||
|
||||
@Override
|
||||
public void sendFeedback(Component message) {
|
||||
this.minecraft.gui.getChat().addMessage(message);
|
||||
this.minecraft.gui.getChat().addClientSystemMessage(message);
|
||||
this.minecraft.getNarrator().saySystemChatQueued(message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public class AttachmentTestMod implements ModInitializer {
|
|||
|
||||
if (blockEntity != null) {
|
||||
blockEntity.setAttached(SYNCED_WITH_ALL, true);
|
||||
player.displayClientMessage(Component.literal("Attached"), false);
|
||||
player.sendSystemMessage(Component.literal("Attached"));
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
} else if (player.getItemInHand(hand).getItem() == Items.GOLDEN_CARROT) {
|
||||
|
|
@ -132,7 +132,7 @@ public class AttachmentTestMod implements ModInitializer {
|
|||
|
||||
if (blockEntity != null) {
|
||||
blockEntity.getAttachedOrCreate(SYNCED_LARGE);
|
||||
player.displayClientMessage(Component.literal("Attached LARGE"), false);
|
||||
player.sendSystemMessage(Component.literal("Attached LARGE"));
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class AttachmentClientTestMod implements ClientModInitializer {
|
|||
|
||||
if (viewDistance.get() < newValue) {
|
||||
viewDistance.set(newValue);
|
||||
Minecraft.getInstance().gui.getChat().addMessage(Component.nullToEmpty("The server requested to up the render distance to " + newValue));
|
||||
Minecraft.getInstance().gui.getChat().addClientSystemMessage(Component.nullToEmpty("The server requested to up the render distance to " + newValue));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ transitive-accessible method net/minecraft/client/data/models/BlockModelGenerato
|
|||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createPassiveRail (Lnet/minecraft/world/level/block/Block;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createActiveRail (Lnet/minecraft/world/level/block/Block;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createAirLikeBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/item/Item;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createAirLikeBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/resources/Identifier;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createAirLikeBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/client/renderer/block/model/Material;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createParticleOnlyBlockModel (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/Block;)Lnet/minecraft/client/data/models/MultiVariant;
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createParticleOnlyBlock (Lnet/minecraft/world/level/block/Block;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/BlockModelGenerators createFullAndCarpetBlocks (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/Block;)V
|
||||
|
|
@ -377,9 +377,9 @@ transitive-accessible method net/minecraft/client/data/models/ItemModelGenerator
|
|||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateStandardCompassItem (Lnet/minecraft/world/item/Item;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateRecoveryCompassItem (Lnet/minecraft/world/item/Item;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateClockItem (Lnet/minecraft/world/item/Item;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateLayeredItem (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/Identifier;Lnet/minecraft/resources/Identifier;)Lnet/minecraft/resources/Identifier;
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateLayeredItem (Lnet/minecraft/resources/Identifier;Lnet/minecraft/resources/Identifier;Lnet/minecraft/resources/Identifier;)Lnet/minecraft/resources/Identifier;
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateLayeredItem (Lnet/minecraft/resources/Identifier;Lnet/minecraft/resources/Identifier;Lnet/minecraft/resources/Identifier;Lnet/minecraft/resources/Identifier;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateLayeredItem (Lnet/minecraft/world/item/Item;Lnet/minecraft/client/renderer/block/model/Material;Lnet/minecraft/client/renderer/block/model/Material;)Lnet/minecraft/resources/Identifier;
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateLayeredItem (Lnet/minecraft/resources/Identifier;Lnet/minecraft/client/renderer/block/model/Material;Lnet/minecraft/client/renderer/block/model/Material;)Lnet/minecraft/resources/Identifier;
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateLayeredItem (Lnet/minecraft/resources/Identifier;Lnet/minecraft/client/renderer/block/model/Material;Lnet/minecraft/client/renderer/block/model/Material;Lnet/minecraft/client/renderer/block/model/Material;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateTrimmableItem (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/resources/Identifier;Z)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateBundleModels (Lnet/minecraft/world/item/Item;)V
|
||||
transitive-accessible method net/minecraft/client/data/models/ItemModelGenerators generateBundleCoverModel (Lnet/minecraft/world/item/Item;Lnet/minecraft/client/data/models/model/ModelTemplate;Ljava/lang/String;)Lnet/minecraft/resources/Identifier;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ import net.minecraft.data.recipes.RecipeProvider;
|
|||
import net.minecraft.data.registries.RegistryPatchGenerator;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.references.Blocks;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.resources.RegistryFixedCodec;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
|
|
@ -71,7 +70,7 @@ import net.minecraft.world.item.Items;
|
|||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
|
||||
import net.minecraft.world.level.storage.loot.LootPool;
|
||||
|
|
@ -485,9 +484,8 @@ public class DataGeneratorTestEntrypoint implements DataGeneratorEntrypoint {
|
|||
|
||||
@Override
|
||||
protected void configure(BiConsumer<Identifier, LootItemCondition> provider, HolderLookup.Provider registryLookup) {
|
||||
HolderGetter<Block> blocks = registryLookup.lookupOrThrow(Registries.BLOCK);
|
||||
provider.accept(Identifier.fromNamespaceAndPath(MOD_ID, "predicate_test"), LootItemBlockStatePropertyCondition.hasBlockStateProperties(
|
||||
blocks.getOrThrow(Blocks.MELON).value()).build()); // Pretend this actually does something and we cannot access the blocks directly
|
||||
Blocks.MELON).build()); // Pretend this actually does something and we cannot access the blocks directly
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class TestBedBlock extends Block {
|
|||
@Override
|
||||
public InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hit) {
|
||||
if (state.getValue(OCCUPIED)) {
|
||||
player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true);
|
||||
player.sendOverlayMessage(Component.translatable("block.minecraft.bed.occupied"));
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ public class TestBedBlock extends Block {
|
|||
Component message = sleepFailureReason.message();
|
||||
|
||||
if (message != null) {
|
||||
player.displayClientMessage(message, true);
|
||||
player.sendOverlayMessage(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,19 +44,19 @@ public class KeyMappingsTest implements ClientModInitializer {
|
|||
if (client.player == null) return;
|
||||
|
||||
while (binding1.consumeClick()) {
|
||||
client.player.displayClientMessage(Component.literal("Key 1 was pressed!"), false);
|
||||
client.player.sendSystemMessage(Component.literal("Key 1 was pressed!"));
|
||||
}
|
||||
|
||||
while (binding2.consumeClick()) {
|
||||
client.player.displayClientMessage(Component.literal("Key 2 was pressed!"), false);
|
||||
client.player.sendSystemMessage(Component.literal("Key 2 was pressed!"));
|
||||
}
|
||||
|
||||
if (stickyBinding.isDown()) {
|
||||
client.player.displayClientMessage(Component.literal("Sticky Key was pressed!"), false);
|
||||
client.player.sendSystemMessage(Component.literal("Sticky Key was pressed!"));
|
||||
}
|
||||
|
||||
while (duplicateBinding.consumeClick()) {
|
||||
client.player.displayClientMessage(Component.literal("Duplicate Key was pressed!"), false);
|
||||
client.player.sendSystemMessage(Component.literal("Duplicate Key was pressed!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,8 +64,9 @@ public final class ClientReceiveMessageEvents {
|
|||
* {@link #GAME_CANCELED} will be triggered instead of {@link #MODIFY_GAME}.
|
||||
*
|
||||
* <p>Overlay is whether the message will be displayed in the action bar.
|
||||
* To toggle overlay, return false and call
|
||||
* {@link net.minecraft.client.player.LocalPlayer#displayClientMessage(Component, boolean) LocalPlayer.displayClientMessage(message, overlay)}.
|
||||
* To toggle overlay, return false and call either
|
||||
* {@link net.minecraft.client.player.LocalPlayer#sendSystemMessage(Component) LocalPlayer.sendSystemMessage(message)} or
|
||||
* {@link net.minecraft.client.player.LocalPlayer#sendOverlayMessage(Component) LocalPlayer.sendOverlayMessage(message)}.
|
||||
*/
|
||||
public static final Event<AllowGame> ALLOW_GAME = EventFactory.createArrayBacked(AllowGame.class, listeners -> (message, overlay) -> {
|
||||
boolean allow = true;
|
||||
|
|
@ -102,7 +103,7 @@ public final class ClientReceiveMessageEvents {
|
|||
* Mods can use this to listen to the message.
|
||||
*
|
||||
* <p>If mods want to modify the message, they should use {@link #ALLOW_CHAT}
|
||||
* and manually add the new message to the chat hud using {@link ChatComponent#addMessage(Component)}
|
||||
* and manually add the new message to the chat hud using {@link ChatComponent#addPlayerMessage(Component, net.minecraft.network.chat.MessageSignature, net.minecraft.client.gui.components.GuiMessageTag)}
|
||||
*/
|
||||
public static final Event<Chat> CHAT = EventFactory.createArrayBacked(Chat.class, listeners -> (message, playerChatMessage, sender, boundChatType, timeStamp) -> {
|
||||
for (Chat listener : listeners) {
|
||||
|
|
@ -172,8 +173,9 @@ public final class ClientReceiveMessageEvents {
|
|||
* {@link #GAME_CANCELED} will be triggered instead of {@link #MODIFY_GAME}.
|
||||
*
|
||||
* <p>Overlay is whether the message will be displayed in the action bar.
|
||||
* To toggle overlay, return false and call
|
||||
* {@link net.minecraft.client.player.LocalPlayer#displayClientMessage(Component, boolean) ClientPlayerEntity.sendMessage(message, overlay)}.
|
||||
* To toggle overlay, return false and call either
|
||||
* {@link net.minecraft.client.player.LocalPlayer#sendSystemMessage(Component) LocalPlayer.sendSystemMessage(message)} or
|
||||
* {@link net.minecraft.client.player.LocalPlayer#sendOverlayMessage(Component) LocalPlayer.sendOverlayMessage(message)}.
|
||||
*
|
||||
* @param message the message received from the server
|
||||
* @param overlay whether the message will be displayed in the action bar
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
|||
// In response the server will send a message containing the keybind text letting the client know it pressed that key.
|
||||
public final class NetworkingKeybindPacketTest implements ModInitializer {
|
||||
private static void receive(KeybindPayload payload, ServerPlayNetworking.Context context) {
|
||||
context.player().level().getServer().execute(() -> context.player().displayClientMessage(Component.literal("So you pressed ").append(Component.keybind("fabric-networking-api-v1-testmod-keybind").withStyle(style -> style.applyFormat(ChatFormatting.BLUE))), false));
|
||||
context.player().level().getServer().execute(() -> context.player().sendSystemMessage(Component.literal("So you pressed ").append(Component.keybind("fabric-networking-api-v1-testmod-keybind").withStyle(style -> style.applyFormat(ChatFormatting.BLUE)))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ 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.client.renderer.MaterialMapper;
|
||||
import net.minecraft.client.renderer.Sheets;
|
||||
import net.minecraft.client.resources.model.Material;
|
||||
import net.minecraft.client.renderer.SpriteMapper;
|
||||
import net.minecraft.client.resources.model.SpriteId;
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.impl.object.builder.client.SignTypeTextureHelper;
|
||||
|
|
@ -36,13 +36,13 @@ abstract class SheetsMixin {
|
|||
SignTypeTextureHelper.shouldAddTextures = true;
|
||||
}
|
||||
|
||||
@Redirect(method = "createSignMaterial", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/MaterialMapper;defaultNamespaceApply(Ljava/lang/String;)Lnet/minecraft/client/resources/model/Material;"))
|
||||
private static Material redirectSignVanillaId(MaterialMapper instance, String name) {
|
||||
@Redirect(method = "createSignSprite", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/SpriteMapper;defaultNamespaceApply(Ljava/lang/String;)Lnet/minecraft/client/resources/model/SpriteId;"))
|
||||
private static SpriteId redirectSignVanillaId(SpriteMapper instance, String name) {
|
||||
return instance.apply(Identifier.parse(name));
|
||||
}
|
||||
|
||||
@Redirect(method = "createHangingSignMaterial", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/MaterialMapper;defaultNamespaceApply(Ljava/lang/String;)Lnet/minecraft/client/resources/model/Material;"))
|
||||
private static Material redirectHangingVanillaId(MaterialMapper instance, String name) {
|
||||
@Redirect(method = "createHangingSignSprite", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/SpriteMapper;defaultNamespaceApply(Ljava/lang/String;)Lnet/minecraft/client/resources/model/SpriteId;"))
|
||||
private static SpriteId redirectHangingVanillaId(SpriteMapper instance, String name) {
|
||||
return instance.apply(Identifier.parse(name));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ abstract class WoodTypeMixin {
|
|||
private static void onReturnRegister(WoodType type, CallbackInfoReturnable<WoodType> cir) {
|
||||
if (SignTypeTextureHelper.shouldAddTextures) {
|
||||
final Identifier identifier = Identifier.parse(type.name());
|
||||
Sheets.SIGN_MATERIALS.put(type, Sheets.SIGN_MAPPER.apply(identifier));
|
||||
Sheets.HANGING_SIGN_MATERIALS.put(type, Sheets.HANGING_SIGN_MAPPER.apply(identifier));
|
||||
Sheets.SIGN_SPRITES.put(type, Sheets.SIGN_MAPPER.apply(identifier));
|
||||
Sheets.HANGING_SIGN_SPRITES.put(type, Sheets.HANGING_SIGN_MAPPER.apply(identifier));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class BlockEntityTypeBuilderTest implements ModInitializer {
|
|||
Component posComponent = Component.translatable("chat.coordinates", pos.getX(), pos.getY(), pos.getZ());
|
||||
Component message = Component.translatableEscape("text.fabric-object-builder-api-v1-testmod.block_entity_type_success", posComponent, BLOCK_ENTITY_TYPE_ID);
|
||||
|
||||
player.displayClientMessage(message, false);
|
||||
player.sendSystemMessage(message);
|
||||
}
|
||||
|
||||
return InteractionResult.SUCCESS;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class TrackStackEntity extends Mob {
|
|||
|
||||
@Override
|
||||
protected SoundEvent getAmbientSound() {
|
||||
return SoundEvents.CAT_AMBIENT;
|
||||
return SoundEvents.CAT_AMBIENT_BABY.value();
|
||||
}
|
||||
|
||||
public Iterable<Component> getLabelLines() {
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ public class RegistryRemapTest {
|
|||
public static final ThisThreadExecutor INSTANCE = new ThisThreadExecutor();
|
||||
|
||||
private ThisThreadExecutor() {
|
||||
super("Test thread executor");
|
||||
super("Test thread executor", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ public interface QuadView {
|
|||
* @param sprite The sprite is not serialized so it must be provided by the caller. Retrieve it using
|
||||
* {@link SpriteFinder#find(QuadView)} if it is not already known.
|
||||
*/
|
||||
default BakedQuad toBakedQuad(TextureAtlasSprite sprite) {
|
||||
default BakedQuad toBakedQuad(BakedQuad.SpriteInfo sprite) {
|
||||
Vector3f position0 = copyPos(0, null);
|
||||
Vector3f position1 = copyPos(1, null);
|
||||
Vector3f position2 = copyPos(2, null);
|
||||
|
|
|
|||
|
|
@ -17,46 +17,19 @@
|
|||
package net.fabricmc.fabric.api.client.rendering.v1;
|
||||
|
||||
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
import net.fabricmc.fabric.impl.client.rendering.ChunkSectionLayerMapImpl;
|
||||
|
||||
/**
|
||||
* Use to associate blocks or fluids with a chunk section layer other than default (solid).
|
||||
* Use to associate fluids with a chunk section layer other than default (solid).
|
||||
*
|
||||
* <p>{@link ChunkSectionLayer} control how sprite pixels for fluids and blocks are blended with the scene. Consult the
|
||||
* <p>{@link ChunkSectionLayer} control how sprite pixels for fluids are blended with the scene. Consult the
|
||||
* vanilla {@link ChunkSectionLayer} implementation for examples.
|
||||
*
|
||||
* <p>The Fabric Renderer API can be used to control this at a per-quad level.
|
||||
*/
|
||||
public final class ChunkSectionLayerMap {
|
||||
/**
|
||||
* Map (or re-map) a block to a section layer. Re-mapping is not recommended but if done, last one in wins. Must be
|
||||
* called from client thread prior to level load/rendering. Best practice will be to call from mod's client
|
||||
* initializer.
|
||||
*
|
||||
* @param block the block to be mapped
|
||||
* @param layer the section layer
|
||||
*/
|
||||
public static void putBlock(Block block, ChunkSectionLayer layer) {
|
||||
ChunkSectionLayerMapImpl.putBlock(block, layer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map (or re-map) multiple blocks to a section layer. Re-mapping is not recommended but if done, last one in wins.
|
||||
* Must be called from client thread prior to level load/rendering. Best practice will be to call from mod's client
|
||||
* initializer.
|
||||
*
|
||||
* @param layer the section layer
|
||||
* @param blocks the blocks to be mapped
|
||||
*/
|
||||
public static void putBlocks(ChunkSectionLayer layer, Block... blocks) {
|
||||
for (Block block : blocks) {
|
||||
putBlock(block, layer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map (or re-map) a fluid to a section layer. Re-mapping is not recommended but if done, last one in wins. Must be
|
||||
* called from client thread prior to level load/rendering. Best practice will be to call from mod's client
|
||||
|
|
|
|||
|
|
@ -22,24 +22,14 @@ import java.util.Objects;
|
|||
import java.util.function.BiConsumer;
|
||||
|
||||
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
public final class ChunkSectionLayerMapImpl {
|
||||
private static final Map<Block, ChunkSectionLayer> BLOCK_RENDER_LAYER_MAP = new HashMap<>();
|
||||
private static final Map<Fluid, ChunkSectionLayer> FLUID_RENDER_LAYER_MAP = new HashMap<>();
|
||||
|
||||
// These consumers initially add to the maps above, and then are later set (when setup is called) to insert straight into the target map.
|
||||
private static BiConsumer<Block, ChunkSectionLayer> blockHandler = BLOCK_RENDER_LAYER_MAP::put;
|
||||
private static BiConsumer<Fluid, ChunkSectionLayer> fluidHandler = FLUID_RENDER_LAYER_MAP::put;
|
||||
|
||||
public static void putBlock(Block block, ChunkSectionLayer layer) {
|
||||
Objects.requireNonNull(block, "block must not be null");
|
||||
Objects.requireNonNull(layer, "render layer must not be null");
|
||||
|
||||
blockHandler.accept(block, layer);
|
||||
}
|
||||
|
||||
public static void putFluid(Fluid fluid, ChunkSectionLayer layer) {
|
||||
Objects.requireNonNull(fluid, "fluid must not be null");
|
||||
Objects.requireNonNull(layer, "render layer must not be null");
|
||||
|
|
@ -47,13 +37,11 @@ public final class ChunkSectionLayerMapImpl {
|
|||
fluidHandler.accept(fluid, layer);
|
||||
}
|
||||
|
||||
public static void setup(BiConsumer<Block, ChunkSectionLayer> vanillaBlockHandler, BiConsumer<Fluid, ChunkSectionLayer> vanillaFluidHandler) {
|
||||
public static void setup(BiConsumer<Fluid, ChunkSectionLayer> vanillaFluidHandler) {
|
||||
// Add all the preexisting render layers
|
||||
BLOCK_RENDER_LAYER_MAP.forEach(vanillaBlockHandler);
|
||||
FLUID_RENDER_LAYER_MAP.forEach(vanillaFluidHandler);
|
||||
|
||||
// Set the handlers to directly accept later additions
|
||||
blockHandler = vanillaBlockHandler;
|
||||
fluidHandler = vanillaFluidHandler;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,22 +27,18 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
|
||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
import net.fabricmc.fabric.impl.client.rendering.ChunkSectionLayerMapImpl;
|
||||
|
||||
@Mixin(ItemBlockRenderTypes.class)
|
||||
abstract class ItemBlockRenderTypesMixin {
|
||||
@Shadow
|
||||
@Final
|
||||
private static Map<Block, ChunkSectionLayer> TYPE_BY_BLOCK;
|
||||
@Shadow
|
||||
@Final
|
||||
private static Map<Fluid, ChunkSectionLayer> LAYER_BY_FLUID;
|
||||
|
||||
@Inject(method = "<clinit>*", at = @At("RETURN"))
|
||||
private static void onInitialize(CallbackInfo ci) {
|
||||
ChunkSectionLayerMapImpl.setup(TYPE_BY_BLOCK::put, LAYER_BY_FLUID::put);
|
||||
ChunkSectionLayerMapImpl.setup(LAYER_BY_FLUID::put);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,14 +43,10 @@ import net.minecraft.client.renderer.LevelRenderer;
|
|||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderBuffers;
|
||||
import net.minecraft.client.renderer.SubmitNodeStorage;
|
||||
import net.minecraft.client.renderer.WorldBorderRenderer;
|
||||
import net.minecraft.client.renderer.chunk.ChunkSectionLayerGroup;
|
||||
import net.minecraft.client.renderer.chunk.ChunkSectionsToRender;
|
||||
import net.minecraft.client.renderer.culling.Frustum;
|
||||
import net.minecraft.client.renderer.state.CameraRenderState;
|
||||
import net.minecraft.client.renderer.state.LevelRenderState;
|
||||
import net.minecraft.client.renderer.state.WorldBorderRenderState;
|
||||
import net.minecraft.world.level.border.WorldBorder;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.InvalidateRenderStateCallback;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
|
||||
|
|
@ -81,15 +77,11 @@ public abstract class LevelRendererMixin {
|
|||
private final LevelExtractionContextImpl extractionContext = new LevelExtractionContextImpl();
|
||||
|
||||
@Inject(method = "renderLevel", at = @At("HEAD"))
|
||||
private void beforeRender(GraphicsResourceAllocator allocator, DeltaTracker deltaTracker, boolean renderBlockOutline, Camera camera, Matrix4f viewMatrix, Matrix4f projectionMatrix, Matrix4f cullProjectionMatrix, GpuBufferSlice fogBuffer, Vector4f fogColor, boolean renderSky, CallbackInfo ci) {
|
||||
private void beforeRender(GraphicsResourceAllocator allocator, DeltaTracker deltaTracker, boolean renderBlockOutline, CameraRenderState cameraState, Matrix4f viewMatrix, GpuBufferSlice fogBuffer, Vector4f fogColor, boolean renderSky, ChunkSectionsToRender chunkSectionsToRender, CallbackInfo ci) {
|
||||
extractionContext.prepare(minecraft.gameRenderer, (LevelRenderer) (Object) this, levelRenderState, level,
|
||||
deltaTracker, renderBlockOutline, camera, viewMatrix, cullProjectionMatrix);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;prepareCullFrustum(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/client/renderer/culling/Frustum;"))
|
||||
private Frustum onSetupFrustum(Frustum frustum) {
|
||||
extractionContext.setFrustum(frustum);
|
||||
return frustum;
|
||||
deltaTracker, renderBlockOutline, minecraft.gameRenderer.getMainCamera(), viewMatrix, viewMatrix);
|
||||
extractionContext.setFrustum(cameraState.cullFrustum);
|
||||
renderContext.prepare(minecraft.gameRenderer, (LevelRenderer) (Object) this, levelRenderState, chunkSectionsToRender, submitNodeStorage, renderBuffers.bufferSource());
|
||||
}
|
||||
|
||||
@Inject(method = "extractBlockOutline", at = @At("RETURN"))
|
||||
|
|
@ -97,18 +89,11 @@ public abstract class LevelRendererMixin {
|
|||
LevelRenderEvents.AFTER_BLOCK_OUTLINE_EXTRACTION.invoker().afterBlockOutlineExtraction(extractionContext, minecraft.hitResult);
|
||||
}
|
||||
|
||||
@WrapOperation(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldBorderRenderer;extract(Lnet/minecraft/world/level/border/WorldBorder;FLnet/minecraft/world/phys/Vec3;DLnet/minecraft/client/renderer/state/WorldBorderRenderState;)V"))
|
||||
private void onWorldBorderExtraction(WorldBorderRenderer instance, WorldBorder worldBorder, float tickProgress, Vec3 vec3d, double viewDistanceBlocks, WorldBorderRenderState worldBorderRenderState, Operation<Void> original) {
|
||||
original.call(instance, worldBorder, tickProgress, vec3d, viewDistanceBlocks, worldBorderRenderState);
|
||||
@Inject(method = "extractLevel", at = @At("RETURN"))
|
||||
private void afterExtractLevel(DeltaTracker deltaTracker, Camera camera, float deltaPartialTick, CallbackInfo ci) {
|
||||
LevelRenderEvents.END_EXTRACTION.invoker().endExtraction(extractionContext);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(method = "lambda$addMainPass$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;prepareChunkRenders(Lorg/joml/Matrix4fc;DDD)Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;"))
|
||||
private ChunkSectionsToRender onRenderBlockLayers(ChunkSectionsToRender chunkSectionsToRender) {
|
||||
renderContext.prepare(minecraft.gameRenderer, (LevelRenderer) (Object) this, levelRenderState, chunkSectionsToRender, submitNodeStorage, renderBuffers.bufferSource());
|
||||
return chunkSectionsToRender;
|
||||
}
|
||||
|
||||
@WrapOperation(method = "lambda$addMainPass$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;renderGroup(Lnet/minecraft/client/renderer/chunk/ChunkSectionLayerGroup;Lcom/mojang/blaze3d/textures/GpuSampler;)V", ordinal = 0))
|
||||
private void wrapRenderOpaqueTerrain(ChunkSectionsToRender chunkSectionsToRender, ChunkSectionLayerGroup group, GpuSampler sampler, Operation<Void> original) {
|
||||
LevelRenderEvents.START_MAIN.invoker().startMain(renderContext);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import net.minecraft.client.renderer.MultiBufferSource;
|
|||
import net.minecraft.client.renderer.blockentity.BannerRenderer;
|
||||
import net.minecraft.client.renderer.feature.FeatureRenderDispatcher;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.util.LightCoordsUtil;
|
||||
import net.minecraft.util.Unit;
|
||||
import net.minecraft.world.level.block.entity.BannerPatternLayers;
|
||||
|
|
@ -55,13 +54,10 @@ public class BannerGuiElementRenderer extends PictureInPictureRenderer<BannerGui
|
|||
OverlayTexture.NO_OVERLAY,
|
||||
new BannerModel(Minecraft.getInstance().getEntityModels().bakeLayer(ModelLayers.STANDING_BANNER_FLAG).getChild("flag")),
|
||||
Unit.INSTANCE,
|
||||
ModelBakery.BANNER_BASE,
|
||||
true,
|
||||
state.color(),
|
||||
BannerPatternLayers.EMPTY,
|
||||
false,
|
||||
null,
|
||||
0);
|
||||
null);
|
||||
renderDispatcher.renderAllFeatures();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class MinecraftServerMixin implements DataResourceStore, FabricOriginalKn
|
|||
}
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void init(Thread serverThread, LevelStorageSource.LevelStorageAccess storageAccess, PackRepository dataPackManager, WorldStem worldStem, Optional<GameRules> gameRules, Proxy proxy, DataFixer dataFixer, Services apiServices, LevelLoadListener chunkLoadProgress, CallbackInfo ci) {
|
||||
private void init(Thread serverThread, LevelStorageSource.LevelStorageAccess storageAccess, PackRepository dataPackManager, WorldStem worldStem, Optional<GameRules> gameRules, Proxy proxy, DataFixer dataFixer, Services apiServices, LevelLoadListener chunkLoadProgress, boolean propagatesCrashes, CallbackInfo ci) {
|
||||
this.originalKnownPacks = worldStem.resourceManager().listPacks().flatMap(pack -> pack.location().knownPackInfo().stream()).toList();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,8 @@ public class ExtractStickItem extends Item {
|
|||
|
||||
if (!requireExact || extracted == FluidConstants.BUCKET) {
|
||||
if (context.getPlayer() != null) {
|
||||
context.getPlayer().displayClientMessage(
|
||||
Component.literal("Extracted some ").append(FluidVariantAttributes.getName(stored)).append("."),
|
||||
true);
|
||||
context.getPlayer().sendOverlayMessage(
|
||||
Component.literal("Extracted some ").append(FluidVariantAttributes.getName(stored)).append("."));
|
||||
}
|
||||
|
||||
transaction.commit();
|
||||
|
|
|
|||
|
|
@ -69,11 +69,10 @@ public class FluidChuteBlock extends Block implements EntityBlock {
|
|||
if (level.getBlockEntity(pos) instanceof FluidChuteBlockEntity chute) {
|
||||
if (!FluidStorageUtil.interactWithFluidStorage(chute.storage, player, hand)) {
|
||||
if (!level.isClientSide()) {
|
||||
player.displayClientMessage(
|
||||
player.sendSystemMessage(
|
||||
Component.literal("Fluid: ")
|
||||
.append(FluidVariantAttributes.getName(chute.storage.variant))
|
||||
.append(", amount: " + chute.storage.amount),
|
||||
false
|
||||
.append(", amount: " + chute.storage.amount)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ transitive-accessible method net/minecraft/world/level/block/SkullBlock <init> (
|
|||
transitive-accessible method net/minecraft/world/level/block/SmithingTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SmokerBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SnowLayerBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SnowyDirtBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SnowyBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SpawnerBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
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
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ org.gradle.jvmargs=-Xmx2560M
|
|||
org.gradle.parallel=true
|
||||
org.gradle.configuration-cache=false
|
||||
|
||||
version=0.143.3
|
||||
minecraft_version=26.1-snapshot-6
|
||||
version=0.143.4
|
||||
minecraft_version=26.1-snapshot-7
|
||||
loader_version=0.18.4
|
||||
installer_version=1.0.1
|
||||
|
||||
|
|
@ -12,46 +12,46 @@ curseforge_minecraft_version=26.1-snapshot
|
|||
|
||||
# Do not manually update, use the bumpversions task:
|
||||
fabric-api-base-version=2.0.2
|
||||
fabric-api-lookup-api-v1-version=2.0.6
|
||||
fabric-api-lookup-api-v1-version=2.0.7
|
||||
fabric-biome-api-v1-version=18.0.2
|
||||
fabric-block-api-v1-version=3.0.0
|
||||
fabric-block-getter-api-v2-version=2.0.4
|
||||
fabric-client-gametest-api-v1-version=5.0.6
|
||||
fabric-command-api-v2-version=3.0.3
|
||||
fabric-content-registries-v0-version=11.0.6
|
||||
fabric-command-api-v2-version=3.0.4
|
||||
fabric-content-registries-v0-version=11.0.7
|
||||
fabric-crash-report-info-v1-version=1.0.2
|
||||
fabric-data-attachment-api-v1-version=2.1.3
|
||||
fabric-data-generation-api-v1-version=24.0.10
|
||||
fabric-data-attachment-api-v1-version=2.1.4
|
||||
fabric-data-generation-api-v1-version=24.0.11
|
||||
fabric-debug-api-v1-version=1.0.0
|
||||
fabric-dimensions-v1-version=5.1.1
|
||||
fabric-entity-events-v1-version=5.0.0
|
||||
fabric-events-interaction-v0-version=5.1.5
|
||||
fabric-entity-events-v1-version=5.0.1
|
||||
fabric-events-interaction-v0-version=5.1.6
|
||||
fabric-game-rule-api-v1-version=4.0.3
|
||||
fabric-gametest-api-v1-version=4.0.7
|
||||
fabric-item-api-v1-version=14.0.1
|
||||
fabric-creative-tab-api-v1-version=5.0.6
|
||||
fabric-key-mapping-api-v1-version=2.0.2
|
||||
fabric-gametest-api-v1-version=4.0.8
|
||||
fabric-item-api-v1-version=14.0.2
|
||||
fabric-creative-tab-api-v1-version=5.0.7
|
||||
fabric-key-mapping-api-v1-version=2.0.3
|
||||
fabric-lifecycle-events-v1-version=4.0.4
|
||||
fabric-loot-api-v3-version=3.0.7
|
||||
fabric-message-api-v1-version=7.0.2
|
||||
fabric-loot-api-v3-version=3.0.8
|
||||
fabric-message-api-v1-version=7.0.3
|
||||
fabric-model-loading-api-v1-version=7.0.11
|
||||
fabric-networking-api-v1-version=6.2.0
|
||||
fabric-object-builder-api-v1-version=23.0.7
|
||||
fabric-particles-v1-version=5.0.7
|
||||
fabric-recipe-api-v1-version=9.0.7
|
||||
fabric-registry-sync-v0-version=7.0.6
|
||||
fabric-networking-api-v1-version=6.2.1
|
||||
fabric-object-builder-api-v1-version=23.0.8
|
||||
fabric-particles-v1-version=5.0.8
|
||||
fabric-recipe-api-v1-version=9.0.8
|
||||
fabric-registry-sync-v0-version=7.0.7
|
||||
fabric-renderer-api-v1-version=10.1.0
|
||||
fabric-renderer-indigo-version=6.0.12
|
||||
fabric-rendering-fluids-v1-version=4.0.2
|
||||
fabric-rendering-v1-version=19.0.0
|
||||
fabric-rendering-v1-version=20.0.0
|
||||
fabric-resource-conditions-api-v1-version=6.0.4
|
||||
fabric-resource-loader-v0-version=3.3.12
|
||||
fabric-resource-loader-v1-version=2.0.5
|
||||
fabric-resource-loader-v0-version=3.3.13
|
||||
fabric-resource-loader-v1-version=2.0.6
|
||||
fabric-screen-api-v1-version=4.0.2
|
||||
fabric-menu-api-v1-version=2.0.6
|
||||
fabric-menu-api-v1-version=2.0.7
|
||||
fabric-serialization-api-v1-version=2.0.2
|
||||
fabric-sound-api-v1-version=2.0.3
|
||||
fabric-tag-api-v1-version=2.0.5
|
||||
fabric-transfer-api-v1-version=7.0.7
|
||||
fabric-transitive-access-wideners-v1-version=8.0.7
|
||||
fabric-tag-api-v1-version=2.0.6
|
||||
fabric-transfer-api-v1-version=7.0.8
|
||||
fabric-transitive-access-wideners-v1-version=8.0.8
|
||||
fabric-convention-tags-v2-version=4.2.0
|
||||
|
|
|
|||
|
|
@ -49,14 +49,14 @@ include 'fabric-lifecycle-events-v1'
|
|||
include 'fabric-loot-api-v3'
|
||||
include 'fabric-menu-api-v1'
|
||||
include 'fabric-message-api-v1'
|
||||
include 'fabric-model-loading-api-v1'
|
||||
//include 'fabric-model-loading-api-v1'
|
||||
include 'fabric-networking-api-v1'
|
||||
include 'fabric-object-builder-api-v1'
|
||||
include 'fabric-particles-v1'
|
||||
include 'fabric-recipe-api-v1'
|
||||
include 'fabric-registry-sync-v0'
|
||||
include 'fabric-renderer-api-v1'
|
||||
include 'fabric-renderer-indigo'
|
||||
//include 'fabric-renderer-api-v1'
|
||||
//include 'fabric-renderer-indigo'
|
||||
include 'fabric-rendering-fluids-v1'
|
||||
include 'fabric-rendering-v1'
|
||||
include 'fabric-resource-conditions-api-v1'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue