use of net.minecraft.world.level.block.state.properties.WoodType in project blueprint by team-abnormals.
the class BlockSubRegistryHelper method createSignBlock.
/**
* Creates and registers a {@link BlueprintStandingSignBlock} and a {@link BlueprintWallSignBlock} with a {@link SignItem}.
*
* @param name The name for the sign blocks.
* @param color The {@link MaterialColor} for the sign blocks.
* @return A {@link Pair} containing {@link RegistryObject}s of the {@link BlueprintStandingSignBlock} and the {@link BlueprintWallSignBlock}.
*/
public Pair<RegistryObject<BlueprintStandingSignBlock>, RegistryObject<BlueprintWallSignBlock>> createSignBlock(String name, MaterialColor color) {
WoodType type = SignManager.registerWoodType(WoodType.create(this.parent.getModId() + ":" + name));
RegistryObject<BlueprintStandingSignBlock> standing = this.deferredRegister.register(name + "_sign", () -> new BlueprintStandingSignBlock(Block.Properties.of(Material.WOOD).noCollission().strength(1.0F).sound(SoundType.WOOD), type));
RegistryObject<BlueprintWallSignBlock> wall = this.deferredRegister.register(name + "_wall_sign", () -> new BlueprintWallSignBlock(Block.Properties.of(Material.WOOD, color).noCollission().strength(1.0F).sound(SoundType.WOOD).dropsLike(standing.get()), type));
this.itemRegister.register(name + "_sign", () -> new SignItem(new Item.Properties().stacksTo(16).tab(CreativeModeTab.TAB_DECORATIONS), standing.get(), wall.get()));
return Pair.of(standing, wall);
}
use of net.minecraft.world.level.block.state.properties.WoodType in project Create by Creators-of-Create.
the class AllSpriteShifts method populateMaps.
private static void populateMaps() {
WoodType[] supportedWoodTypes = new WoodType[] { WoodType.OAK, WoodType.SPRUCE, WoodType.BIRCH, WoodType.ACACIA, WoodType.JUNGLE, WoodType.DARK_OAK, WoodType.CRIMSON, WoodType.WARPED };
Arrays.stream(supportedWoodTypes).forEach(woodType -> WOODEN_WINDOWS.put(woodType, vertical("palettes/" + woodType.name() + "_window")));
for (DyeColor color : DyeColor.values()) {
String id = color.getSerializedName();
DYED_BELTS.put(color, SpriteShifter.get("block/belt", "block/belt/" + id + "_scroll"));
DYED_OFFSET_BELTS.put(color, SpriteShifter.get("block/belt_offset", "block/belt/" + id + "_scroll"));
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal_scroll"));
}
}
use of net.minecraft.world.level.block.state.properties.WoodType in project pollen by MoonflowerTeam.
the class PollinatedBlockRegistry method registerSign.
/**
* Registers a standing and wall sign block and sign item with custom properties.
*
* @param id The name of the sign
* @param blockProperties The properties of the sign blocks
* @param itemProperties The properties of the sign item
* @return A pair of a wall and standing sign block supplier
*/
public Pair<Supplier<PollinatedStandingSignBlock>, Supplier<PollinatedWallSignBlock>> registerSign(String id, BlockBehaviour.Properties blockProperties, Item.Properties itemProperties) {
WoodType type = SignRegistry.register(new ResourceLocation(this.modId, id));
Supplier<PollinatedStandingSignBlock> standing = this.register(id + "_sign", () -> new PollinatedStandingSignBlock(blockProperties, type));
Supplier<PollinatedWallSignBlock> wall = this.register(id + "_wall_sign", () -> new PollinatedWallSignBlock(blockProperties.dropsLike(standing.get()), type));
this.itemRegistry.register(id + "_sign", () -> new PollinatedSignItem(itemProperties, standing.get(), wall.get()));
return Pair.of(standing, wall);
}
Aggregations