-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
153 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/teammoeg/caupona/blocks/decoration/CPCeilingHangingSignBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.teammoeg.caupona.blocks.decoration; | ||
|
||
import com.teammoeg.caupona.CPBlocks; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.CeilingHangingSignBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.WoodType; | ||
|
||
public class CPCeilingHangingSignBlock extends CeilingHangingSignBlock { | ||
|
||
public CPCeilingHangingSignBlock(WoodType type, Properties properties) { | ||
super(type, properties); | ||
CPBlocks.hanging_signs.add(this); | ||
} | ||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { | ||
return new CPHangingSignBlockEntity(pPos, pState); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/teammoeg/caupona/blocks/decoration/CPHangingSignBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.teammoeg.caupona.blocks.decoration; | ||
|
||
import com.teammoeg.caupona.CPBlockEntityTypes; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.sounds.SoundEvent; | ||
import net.minecraft.sounds.SoundEvents; | ||
import net.minecraft.world.level.block.entity.SignBlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
public class CPHangingSignBlockEntity extends SignBlockEntity { | ||
private static final int MAX_TEXT_LINE_WIDTH = 60; | ||
private static final int TEXT_LINE_HEIGHT = 9; | ||
public CPHangingSignBlockEntity(BlockPos p_250603_, BlockState p_251674_) { | ||
super(CPBlockEntityTypes.HANGING_SIGN.get(), p_250603_, p_251674_); | ||
} | ||
|
||
@Override | ||
public int getTextLineHeight() { | ||
return TEXT_LINE_HEIGHT; | ||
} | ||
|
||
@Override | ||
public int getMaxTextLineWidth() { | ||
return MAX_TEXT_LINE_WIDTH; | ||
} | ||
|
||
@Override | ||
public SoundEvent getSignInteractionFailedSoundEvent() { | ||
return SoundEvents.WAXED_HANGING_SIGN_INTERACT_FAIL; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/teammoeg/caupona/blocks/decoration/CPWallHangingSignBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.teammoeg.caupona.blocks.decoration; | ||
|
||
import com.teammoeg.caupona.CPBlocks; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.WallHangingSignBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.WoodType; | ||
|
||
public class CPWallHangingSignBlock extends WallHangingSignBlock { | ||
|
||
public CPWallHangingSignBlock(WoodType type, Properties properties) { | ||
super(type, properties); | ||
CPBlocks.hanging_signs.add(this); | ||
} | ||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { | ||
return new CPHangingSignBlockEntity(pPos, pState); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/com/teammoeg/caupona/item/CPHangingSignItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.teammoeg.caupona.item; | ||
|
||
import com.teammoeg.caupona.util.CreativeTabItemHelper; | ||
import com.teammoeg.caupona.util.ICreativeModeTabItem; | ||
import com.teammoeg.caupona.util.TabType; | ||
|
||
import net.minecraft.world.item.HangingSignItem; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
public class CPHangingSignItem extends HangingSignItem implements ICreativeModeTabItem { | ||
|
||
public CPHangingSignItem(Block block, Block wallBlock, Properties properties, TabType tab) { | ||
super(block, wallBlock, properties); | ||
this.tab = tab; | ||
} | ||
|
||
TabType tab; | ||
|
||
@Override | ||
public void fillItemCategory(CreativeTabItemHelper helper) { | ||
if(helper.isType(tab))helper.accept(this); | ||
} | ||
|
||
|
||
} |