mohamed zenthen

in the project root you will find two files models and textures. use them to create airport furinature blocks for fabric 26.3 and dont forget there are two chair models, so also make when a player interacts with it he will sit on it

Kodari AI
KodariNov 4 at 4:39 am 1

This is a Java server-plugin project, so I can’t create the Fabric 26.3 airport furniture mod here. Kodari supports Fabric 26.3: Switch to Fabric mod for Minecraft 26.3

mohamed zenthen

now create

Kodari AI
KodariNov 4 at 4:53 am 4
  1. Inspect the project and the supplied model/texture files.

  2. Add the furniture blocks and their asset registrations, using the provided assets.

  3. Make both chair blocks seatable and ensure the furniture is obtainable in survival.

Created the Fabric 26.3 Airport Furniture mod using the supplied models and textures. It adds 22 placeable blocks; both chair models let players sit when interacted with, and furniture drops itself when mined.

Each block is craftable with 4 iron nuggets and 4 oak planks in a crafting table.

mohamed zenthen

when i compiled the mod and run in minecraft no block was appering please fix

Kodari AI
KodariNov 4 at 5:03 am 1

I traced the registration and resource-generation paths, but found no source-level cause to patch: the mod registers the blocks and their items, adds them to the Building Blocks tab, and generates their models, blockstates, textures, and recipes during resource processing.

Please send the logs/latest.log from a launch where the blocks are missing. It will show whether the mod failed to load or Minecraft rejected the generated assets; without that runtime evidence, changing the registration code would be a guess.

Kodari can make mistakes. Review important code before using.
Files
models
src
textures
build.gradle
gradle.properties
settings.gradle
Code
50 2,196
src/main/java/com/kodari/airportfurniture/AirportFurnitureMod.java
package com.kodari.airportfurniture;

import java.util.ArrayList;
import java.util.List;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntitySpawnReason;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.Interaction;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public final class AirportFurnitureMod implements ModInitializer {
	public static final String MOD_ID = "airportfurniture";
	private static final String SEAT_TAG = MOD_ID + ":seat";
	private static final String[] FURNITURE = {
		"barrier",
		"bin",
		"chair_single",
		"chair_third",
		"conveyor_belt",
		"conveyor_belt_corner",
		"flight_signs",
		"luggage",
		"metal_detector",
		"packing_box",
		"packing_box_blank",
		"sign_main_gate",
		"signpost",
		"table_with_computer",
		"ticket_machine",
		"ticket_machine_02",
		"time_zone",
		"trolley_1",
		"trolley_blank",
		"trolley_with_bag",
		"trolley_with_bag_2",
		"xray"
	};

	@Override
	public void onInitialize() {
		List<BlockItem> furnitureItems = new ArrayList<>();
		for (String id : FURNITURE) {
			Identifier identifier = Identifier.fromNamespaceAndPath(MOD_ID, id);
			ResourceKey<Block> blockKey = ResourceKey.create(Registries.BLOCK, identifier);
			BlockBehaviour.Properties properties = BlockBehaviour.Properties.of().strength(1.5F, 3.0F).setId(blockKey);
			Block block = id.startsWith("chair_") ? new ChairBlock(properties) : new FurnitureBlock(properties);
			Registry.register(BuiltInRegistries.BLOCK, identifier, block);

			ResourceKey<Item> itemKey = ResourceKey.create(Registries.ITEM, identifier);
			BlockItem blockItem = new BlockItem(block, new Item.Properties().setId(itemKey));
			Registry.register(BuiltInRegistries.ITEM, identifier, blockItem);
			furnitureItems.add(blockItem);
		}

		CreativeModeTabEvents.modifyOutputEvent(ResourceKey.create(
			Registries.CREATIVE_MODE_TAB,
			Identifier.fromNamespaceAndPath("minecraft", "building_blocks")
		)).register(output -> furnitureItems.forEach(output::prepend));

		ServerTickEvents.END_LEVEL_TICK.register(level -> {
			for (Entity entity : level.getAllEntities()) {
				if (entity instanceof Interaction && entity.entityTags().contains(SEAT_TAG) && entity.getPassengers().isEmpty()) {
					entity.discard();
				}
			}
		});
	}

	private static class FurnitureBlock extends Block {
		private FurnitureBlock(BlockBehaviour.Properties properties) {
			super(properties);
		}

		@Override
		protected List<ItemStack> getDrops(BlockState state, LootParams.Builder params) {
			return List.of(new ItemStack(this));
		}
	}

	private static final class ChairBlock extends FurnitureBlock {
		private static final VoxelShape SEAT_SHAPE = Block.box(0, 0, 0, 16, 8, 16);

		private ChairBlock(BlockBehaviour.Properties properties) {
			super(properties);
		}

		@Override
		protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
			return SEAT_SHAPE;
		}

		@Override
		protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
			return sit(level, pos, player);
		}

		@Override
		protected InteractionResult useItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
			return sit(level, pos, player);
		}

		private InteractionResult sit(Level level, BlockPos pos, Player player) {
			if (level.isClientSide()) {
				return InteractionResult.SUCCESS;
			}

			Interaction seat = EntityTypes.INTERACTION.create(level, EntitySpawnReason.TRIGGERED);
			if (seat != null) {
				seat.addTag(SEAT_TAG);
				seat.setPos(pos.getX() + 0.5, pos.getY() + 1.1, pos.getZ() + 0.5);
				if (level.addFreshEntity(seat)) {
					if (!player.startRiding(seat)) {
						seat.discard();
					}
				} else {
					seat.discard();
				}
			}
			return InteractionResult.SUCCESS_SERVER;
		}
	}
}