Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复部分模型,混凝土音效修正 #128

Merged
merged 1 commit into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public class ModBlocks {
@I18n(en_us = "Concrete", zh_cn = "混凝土", zh_tw = "混凝土")
@CubeAll
public static final DeferredBlock<Block> CONCRETE =
register("concrete", BlockBehaviour.Properties.of().strength(0.8F).sound(SoundType.STONE).ignitedByLava());
register("concrete", BlockBehaviour.Properties.ofFullCopy(Blocks.WHITE_CONCRETE).strength(0.8F).ignitedByLava());
public static final DeferredItem<BlockItem> CONCRETE_ITEM = register("concrete", CONCRETE);
@I18n(en_us = "Concrete Powder", zh_cn = "混凝土粉末", zh_tw = "混凝土粉末")
@CubeAll
public static final DeferredBlock<Block> CONCRETE_POWDER =
register("concrete_powder", properties -> new ConcretePowderBlock(CONCRETE.get(), properties), BlockBehaviour.Properties.of().sound(SoundType.STONE).ignitedByLava());
register("concrete_powder", properties -> new ConcretePowderBlock(CONCRETE.get(), properties), BlockBehaviour.Properties.ofFullCopy(Blocks.WHITE_CONCRETE_POWDER).ignitedByLava());
public static final DeferredItem<BlockItem> CONCRETE_POWDER_ITEM = register("concrete_powder", CONCRETE_POWDER);
@I18n(en_us ="Glazed Terracotta", zh_cn = "带釉陶瓦", zh_tw = "带釉陶瓦")
public static final DeferredBlock<GlazedTerracottaBlock> GLAZED_TERRACOTTA =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import net.minecraft.core.Direction;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.model.generators.*;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.neoforged.neoforge.registries.DeferredBlock;
import org.polaris2023.wild_wind.WildWindMod;
import org.polaris2023.wild_wind.common.block.BrittleIceBlock;
import org.polaris2023.wild_wind.common.block.GlowMucusBlock;
Expand Down Expand Up @@ -76,7 +79,13 @@ protected void registerStatesAndModels() {
simpleBlock(ModBlocks.BAOBAB_SAPLING.get(), models().cross("baobab_sapling", Helpers.location("block/baobab_sapling")).renderType("cutout"));

// Carpet
simpleBlock(ModBlocks.CARPET.get(), models().carpet("carpet", Helpers.location("block/wool")));
simpleBlockWithItem(ModBlocks.CARPET.get(), models().carpet("carpet", Helpers.location("block/wool")));

wallBlock(ModBlocks.STONE_WALL.get(), blockTexture(Blocks.STONE));
simpleBlockWithItem(ModBlocks.POLISHED_STONE.get(), models().cubeAll("polished_stone", Helpers.location("block/polished_stone")));
wallBlock(ModBlocks.POLISHED_STONE_WALL.get(), blockTexture(ModBlocks.POLISHED_STONE.get()));
stairsBlock(ModBlocks.POLISHED_STONE_STAIRS.get(), blockTexture(ModBlocks.POLISHED_STONE.get()));
slabBlock(ModBlocks.POLISHED_STONE_SLAB.get(), blockTexture(ModBlocks.POLISHED_STONE.get()), blockTexture(ModBlocks.POLISHED_STONE.get()));

// Glazed Terracotta
VariantBlockStateBuilder glazedTerracottaStates = getVariantBuilder(ModBlocks.GLAZED_TERRACOTTA.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static void gatherData(GatherDataEvent event) {
gen.addProvider(event.includeClient(), model.setModid(MOD_ID).setOutput(pack));
}
gen.addProvider(event.includeClient(), new ModBlockStateProvider(pack, helper));
gen.addProvider(event.includeClient(), new ModItemModelProvider(pack, helper));
gen.addProvider(event.includeServer(), new ModRecipeProvider(pack, provider));
gen.addProvider(event.includeServer(), new ModEntityTypeTagsProvider(pack, provider, helper));
ModBlockTagsProvider blockTagsProvider = new ModBlockTagsProvider(pack, provider, helper);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.polaris2023.wild_wind.datagen;

import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.neoforged.neoforge.client.model.generators.ItemModelProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.neoforged.neoforge.registries.DeferredBlock;
import org.polaris2023.wild_wind.WildWindMod;
import org.polaris2023.wild_wind.common.init.ModBlocks;

import javax.swing.*;

public class ModItemModelProvider extends ItemModelProvider {
public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
super(output, WildWindMod.MOD_ID, existingFileHelper);
}

@Override
protected void registerModels() {
stoneWallItem(ModBlocks.STONE_WALL, Blocks.STONE);
wallItem(ModBlocks.POLISHED_STONE_WALL, ModBlocks.POLISHED_STONE);
}

public void stoneWallItem(DeferredBlock<?> block, Block baseBlock) {
this.withExistingParent(block.getId().getPath(), mcLoc("block/wall_inventory"))
.texture("wall", ResourceLocation.fromNamespaceAndPath("minecraft",
"block/stone"));
}

public void wallItem(DeferredBlock<?> block, DeferredBlock<Block> baseBlock) {
this.withExistingParent(block.getId().getPath(), mcLoc("block/wall_inventory"))
.texture("wall", ResourceLocation.fromNamespaceAndPath(WildWindMod.MOD_ID,
"block/" + baseBlock.getId().getPath()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ protected void addTags(HolderLookup.Provider provider) {
tag(BlockTags.PLANKS).add(ModBlocks.AZALEA_PLANKS.get(), ModBlocks.PALM_PLANKS.get(), ModBlocks.BAOBAB_PLANKS.get());
tag(BlockTags.LEAVES).add(ModBlocks.PALM_LEAVES.get(), ModBlocks.BAOBAB_LEAVES.get());
tag(BlockTags.SAPLINGS).add(ModBlocks.PALM_SAPLING.get(), ModBlocks.BAOBAB_SAPLING.get());

tag(BlockTags.WALLS).add(ModBlocks.STONE_WALL.get(), ModBlocks.POLISHED_STONE_WALL.get());

ModBlockFamilies.AZALEA_PLANKS.generateBlockTags(this::tag);
ModBlockFamilies.PALM_PLANKS.generateBlockTags(this::tag);
ModBlockFamilies.BAOBAB_PLANKS.generateBlockTags(this::tag);
Expand Down
Loading