Skip to content

Commit

Permalink
signs
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 16, 2024
1 parent 57c0551 commit ca113f3
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package net.id.paradiselost.blocks;

import net.id.paradiselost.blocks.decorative.ParadiseSignBlock;
import net.id.paradiselost.blocks.decorative.ParadiseWallSignBlock;
import net.id.paradiselost.blocks.natural.ParadiseLostSaplingBlock;
import net.id.paradiselost.blocks.natural.tree.FruitingLeavesBlock;
import net.id.paradiselost.blocks.natural.tree.ParadiseLostLeavesBlock;
import net.id.paradiselost.items.ParadiseLostItems;
import net.id.paradiselost.world.feature.tree.generator.MotherAurelSaplingGenerator;
import net.id.paradiselost.world.feature.tree.generator.OrangeSaplingGenerator;
import net.id.paradiselost.world.feature.tree.generator.*;
import net.minecraft.block.*;
import net.minecraft.block.sapling.SaplingGenerator;
import net.minecraft.registry.Registries;
Expand Down Expand Up @@ -268,8 +269,8 @@ public static SignSet registerSignSet(WoodType woodType) {

var signSettings = AbstractBlock.Settings.copy(Blocks.OAK_SIGN);

SignBlock signBlock = new SignBlock(signSettings, woodType);
WallSignBlock wallSignBlock = new WallSignBlock(signSettings.dropsLike(signBlock), woodType);
SignBlock signBlock = new ParadiseSignBlock(signSettings, woodType);
WallSignBlock wallSignBlock = new ParadiseWallSignBlock(signSettings.dropsLike(signBlock), woodType);

add(woodType.name() + "_sign", signBlock);
add(woodType.name() + "_wall_sign", wallSignBlock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import net.id.paradiselost.blocks.ParadiseLostBlocks;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;

Expand All @@ -14,13 +15,19 @@ public class ParadiseLostBlockEntityTypes {
public static final BlockEntityType<IncubatorBlockEntity> INCUBATOR = create(IncubatorBlockEntity::new, ParadiseLostBlocks.INCUBATOR).build();
public static final BlockEntityType<CherineCampfireBlockEntity> CHERINE_CAMPFIRE = create(CherineCampfireBlockEntity::new, ParadiseLostBlocks.CHERINE_CAMPFIRE).build();
public static final BlockEntityType<TreeTapBlockEntity> TREE_TAP = create(TreeTapBlockEntity::new, ParadiseLostBlocks.TREE_TAP).build();
// public static final BlockEntityType<DungeonSwitchBlockEntity> DUNGEON_SWITCH = create(DungeonSwitchBlockEntity::new, ParadiseLostBlocks.DUNGEON_SWITCH).build();
public static final BlockEntityType<ParadiseSignBlockEntity> SIGN = create(ParadiseSignBlockEntity::new,
ParadiseLostBlocks.AUREL_SIGNS.sign(), ParadiseLostBlocks.AUREL_SIGNS.wallSign(),
ParadiseLostBlocks.MOTHER_AUREL_SIGNS.sign(), ParadiseLostBlocks.MOTHER_AUREL_SIGNS.wallSign(),
ParadiseLostBlocks.ORANGE_SIGNS.sign(), ParadiseLostBlocks.ORANGE_SIGNS.wallSign(),
ParadiseLostBlocks.WISTERIA_SIGNS.sign(), ParadiseLostBlocks.WISTERIA_SIGNS.wallSign()
).build();

public static void init() {
register("food_bowl", FOOD_BOWL);
register("incubator", INCUBATOR);
register("cherine_campfire", CHERINE_CAMPFIRE);
register("tree_tap", TREE_TAP);
register("sign", SIGN);
// register("dungeonswitch", DUNGEON_SWITCH);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package net.id.paradiselost.blocks.blockentity;

import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.util.math.BlockPos;

public class ParadiseSignBlockEntity extends SignBlockEntity {
public ParadiseSignBlockEntity(BlockPos pos, BlockState state) {
super(ParadiseLostBlockEntityTypes.SIGN, pos, state);
}

public ParadiseSignBlockEntity(BlockEntityType blockEntityType, BlockPos blockPos, BlockState blockState) {
super(blockEntityType, blockPos, blockState);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.id.paradiselost.blocks.decorative;

import net.id.paradiselost.blocks.blockentity.ParadiseSignBlockEntity;
import net.minecraft.block.BlockState;
import net.minecraft.block.SignBlock;
import net.minecraft.block.WoodType;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;

public class ParadiseSignBlock extends SignBlock {

public ParadiseSignBlock(Settings settings, WoodType woodType) {
super(settings, woodType);
}

public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return new ParadiseSignBlockEntity(pos, state);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.id.paradiselost.blocks.decorative;

import net.id.paradiselost.blocks.blockentity.ParadiseSignBlockEntity;
import net.minecraft.block.BlockState;
import net.minecraft.block.WallSignBlock;
import net.minecraft.block.WoodType;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;

public class ParadiseWallSignBlock extends WallSignBlock {
public ParadiseWallSignBlock(Settings settings, WoodType woodType) {
super(settings, woodType);
}

public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return new ParadiseSignBlockEntity(pos, state);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.fabricmc.api.Environment;
import net.id.paradiselost.blocks.blockentity.ParadiseLostBlockEntityTypes;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;

@Environment(EnvType.CLIENT)
public class ParadiseLostBlockEntityRenderers {
Expand All @@ -12,7 +13,8 @@ public class ParadiseLostBlockEntityRenderers {
public static void initClient() {
BlockEntityRendererFactories.register(ParadiseLostBlockEntityTypes.INCUBATOR, IncubatorBlockEntityRenderer::new);
BlockEntityRendererFactories.register(ParadiseLostBlockEntityTypes.CHERINE_CAMPFIRE, CherineCampfireBlockEntityRenderer::new);
BlockEntityRendererFactories.register(ParadiseLostBlockEntityTypes.TREE_TAP, TreeTapBlockEntityRenderer::new);
BlockEntityRendererFactories.register(ParadiseLostBlockEntityTypes.TREE_TAP, TreeTapBlockEntityRenderer::new);
BlockEntityRendererFactories.register(ParadiseLostBlockEntityTypes.SIGN, SignBlockEntityRenderer::new);
// BlockEntityRendererFactories.register(ParadiseLostBlockEntityTypes.DUNGEON_SWITCH, DungeonSwitchBlockEntityRenderer::new);
}
}

0 comments on commit ca113f3

Please sign in to comment.