Skip to content

Commit f4a4c5e

Browse files
committed
All beds now implemented but not yet obtainable
1 parent d7cd0e1 commit f4a4c5e

31 files changed

Lines changed: 169 additions & 111 deletions

src/main/java/com/sheepingtoninc/rainbowsheep/RainbowSheep.java

Lines changed: 48 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.minecraft.world.item.BlockItem;
1515
import net.minecraft.world.item.Item;
1616
import net.minecraft.world.level.block.Block;
17+
import net.minecraft.world.level.block.Blocks;
1718
import net.minecraft.world.level.block.SoundType;
1819
import net.minecraft.world.level.block.entity.BlockEntityType;
1920
import net.minecraft.world.level.block.state.BlockBehaviour;
@@ -46,97 +47,54 @@ public class RainbowSheep {
4647
public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITY_TYPES =
4748
DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, MODID);
4849

49-
public static final DeferredBlock<Block> RAINBOW_WOOL_BLOCK = BLOCKS.register("rainbow_wool", registryName -> new FlagWoolBlock(BlockBehaviour.Properties.of()
50-
.mapColor(MapColor.COLOR_RED)
51-
.instrument(NoteBlockInstrument.GUITAR)
52-
.strength(0.8F)
53-
.sound(SoundType.WOOL)
54-
.ignitedByLava()
55-
));
56-
public static final DeferredBlock<Block> RAINBOW_CARPET_BLOCK = BLOCKS.register("rainbow_carpet", registryName -> new FlagCarpetBlock(BlockBehaviour.Properties.of()
57-
.mapColor(MapColor.COLOR_RED)
58-
.strength(0.1F)
59-
.sound(SoundType.WOOL)
60-
.ignitedByLava()
61-
));
62-
public static final DeferredBlock<Block> RAINBOW_BED_BLOCK = BLOCKS.register("rainbow_bed", registryName -> new FlagBedBlock(FlagWool.RAINBOW, BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED)
63-
.instrument(NoteBlockInstrument.GUITAR)
64-
.strength(0.8F)
65-
.sound(SoundType.WOOL)
66-
.ignitedByLava()
67-
));
68-
public static final DeferredBlock<Block> TRANSGENDER_WOOL_BLOCK = BLOCKS.register("transgender_wool", registryName -> new FlagWoolBlock(BlockBehaviour.Properties.of()
69-
.mapColor(MapColor.COLOR_LIGHT_BLUE)
70-
.instrument(NoteBlockInstrument.GUITAR)
71-
.strength(0.8F)
72-
.sound(SoundType.WOOL)
73-
.ignitedByLava()
74-
));
75-
public static final DeferredBlock<Block> TRANSGENDER_CARPET_BLOCK = BLOCKS.register("transgender_carpet", registryName -> new FlagCarpetBlock(BlockBehaviour.Properties.of()
76-
.mapColor(MapColor.COLOR_LIGHT_BLUE)
77-
.strength(0.1F)
78-
.sound(SoundType.WOOL)
79-
.ignitedByLava()
80-
));
81-
public static final DeferredBlock<Block> BISEXUAL_WOOL_BLOCK = BLOCKS.register("bisexual_wool", registryName -> new FlagWoolBlock(BlockBehaviour.Properties.of()
82-
.mapColor(MapColor.COLOR_MAGENTA)
83-
.instrument(NoteBlockInstrument.GUITAR)
84-
.strength(0.8F)
85-
.sound(SoundType.WOOL)
86-
.ignitedByLava()
87-
));
88-
public static final DeferredBlock<Block> BISEXUAL_CARPET_BLOCK = BLOCKS.register("bisexual_carpet", registryName -> new FlagCarpetBlock(BlockBehaviour.Properties.of()
89-
.mapColor(MapColor.COLOR_MAGENTA)
90-
.strength(0.1F)
91-
.sound(SoundType.WOOL)
92-
.ignitedByLava()
93-
));
94-
public static final DeferredBlock<Block> LESBIAN_WOOL_BLOCK = BLOCKS.register("lesbian_wool", registryName -> new FlagWoolBlock(BlockBehaviour.Properties.of()
95-
.mapColor(MapColor.COLOR_ORANGE)
96-
.instrument(NoteBlockInstrument.GUITAR)
97-
.strength(0.8F)
98-
.sound(SoundType.WOOL)
99-
.ignitedByLava()
100-
));
101-
public static final DeferredBlock<Block> LESBIAN_CARPET_BLOCK = BLOCKS.register("lesbian_carpet", registryName -> new FlagCarpetBlock(BlockBehaviour.Properties.of()
102-
.mapColor(MapColor.COLOR_ORANGE)
103-
.strength(0.1F)
104-
.sound(SoundType.WOOL)
105-
.ignitedByLava()
106-
));
107-
public static final DeferredBlock<Block> ASEXUAL_WOOL_BLOCK = BLOCKS.register("asexual_wool", registryName -> new FlagWoolBlock(BlockBehaviour.Properties.of()
108-
.mapColor(MapColor.COLOR_ORANGE)
109-
.instrument(NoteBlockInstrument.GUITAR)
110-
.strength(0.8F)
111-
.sound(SoundType.WOOL)
112-
.ignitedByLava()
113-
));
114-
public static final DeferredBlock<Block> ASEXUAL_CARPET_BLOCK = BLOCKS.register("asexual_carpet", registryName -> new FlagCarpetBlock(BlockBehaviour.Properties.of()
115-
.mapColor(MapColor.COLOR_ORANGE)
116-
.strength(0.1F)
117-
.sound(SoundType.WOOL)
118-
.ignitedByLava()
119-
));
120-
public static final DeferredBlock<Block> NONBINARY_WOOL_BLOCK = BLOCKS.register("nonbinary_wool", registryName -> new FlagWoolBlock(BlockBehaviour.Properties.of()
121-
.mapColor(MapColor.COLOR_YELLOW)
122-
.instrument(NoteBlockInstrument.GUITAR)
123-
.strength(0.8F)
124-
.sound(SoundType.WOOL)
125-
.ignitedByLava()
126-
));
127-
public static final DeferredBlock<Block> NONBINARY_CARPET_BLOCK = BLOCKS.register("nonbinary_carpet", registryName -> new FlagCarpetBlock(BlockBehaviour.Properties.of()
128-
.mapColor(MapColor.COLOR_YELLOW)
129-
.strength(0.1F)
130-
.sound(SoundType.WOOL)
131-
.ignitedByLava()
132-
));
50+
public static final DeferredBlock<Block> RAINBOW_WOOL_BLOCK = BLOCKS.register("rainbow_wool", registryName ->
51+
new FlagWoolBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.RED_WOOL)));
52+
public static final DeferredBlock<Block> RAINBOW_CARPET_BLOCK = BLOCKS.register("rainbow_carpet", registryName ->
53+
new FlagCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.RED_CARPET)));
54+
public static final DeferredBlock<Block> RAINBOW_BED_BLOCK = BLOCKS.register("rainbow_bed", registryName ->
55+
new FlagBedBlock(FlagWool.RAINBOW, BlockBehaviour.Properties.ofFullCopy(Blocks.RED_BED)));
56+
57+
public static final DeferredBlock<Block> TRANSGENDER_WOOL_BLOCK = BLOCKS.register("transgender_wool", registryName ->
58+
new FlagWoolBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.LIGHT_BLUE_WOOL)));
59+
public static final DeferredBlock<Block> TRANSGENDER_CARPET_BLOCK = BLOCKS.register("transgender_carpet", registryName ->
60+
new FlagCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.LIGHT_BLUE_CARPET)));
61+
public static final DeferredBlock<Block> TRANSGENDER_BED_BLOCK = BLOCKS.register("transgender_bed", registryName ->
62+
new FlagBedBlock(FlagWool.TRANSGENDER, BlockBehaviour.Properties.ofFullCopy(Blocks.LIGHT_BLUE_BED)));
63+
64+
public static final DeferredBlock<Block> BISEXUAL_WOOL_BLOCK = BLOCKS.register("bisexual_wool", registryName ->
65+
new FlagWoolBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MAGENTA_WOOL)));
66+
public static final DeferredBlock<Block> BISEXUAL_CARPET_BLOCK = BLOCKS.register("bisexual_carpet", registryName ->
67+
new FlagCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MAGENTA_CARPET)));
68+
public static final DeferredBlock<Block> BISEXUAL_BED_BLOCK = BLOCKS.register("bisexual_bed", registryName ->
69+
new FlagBedBlock(FlagWool.BISEXUAL, BlockBehaviour.Properties.ofFullCopy(Blocks.MAGENTA_BED)));
70+
71+
public static final DeferredBlock<Block> LESBIAN_WOOL_BLOCK = BLOCKS.register("lesbian_wool", registryName ->
72+
new FlagWoolBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.ORANGE_WOOL)));
73+
public static final DeferredBlock<Block> LESBIAN_CARPET_BLOCK = BLOCKS.register("lesbian_carpet", registryName ->
74+
new FlagCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.ORANGE_CARPET)));
75+
public static final DeferredBlock<Block> LESBIAN_BED_BLOCK = BLOCKS.register("lesbian_bed", registryName ->
76+
new FlagBedBlock(FlagWool.LESBIAN, BlockBehaviour.Properties.ofFullCopy(Blocks.ORANGE_BED)));
77+
78+
public static final DeferredBlock<Block> ASEXUAL_WOOL_BLOCK = BLOCKS.register("asexual_wool", registryName ->
79+
new FlagWoolBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.BLACK_WOOL)));
80+
public static final DeferredBlock<Block> ASEXUAL_CARPET_BLOCK = BLOCKS.register("asexual_carpet", registryName ->
81+
new FlagCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.BLACK_CARPET)));
82+
public static final DeferredBlock<Block> ASEXUAL_BED_BLOCK = BLOCKS.register("asexual_bed", registryName ->
83+
new FlagBedBlock(FlagWool.ASEXUAL, BlockBehaviour.Properties.ofFullCopy(Blocks.BLACK_BED)));
84+
85+
public static final DeferredBlock<Block> NONBINARY_WOOL_BLOCK = BLOCKS.register("nonbinary_wool", registryName ->
86+
new FlagWoolBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.YELLOW_WOOL)));
87+
public static final DeferredBlock<Block> NONBINARY_CARPET_BLOCK = BLOCKS.register("nonbinary_carpet", registryName ->
88+
new FlagCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.YELLOW_CARPET)));
89+
public static final DeferredBlock<Block> NONBINARY_BED_BLOCK = BLOCKS.register("nonbinary_bed", registryName ->
90+
new FlagBedBlock(FlagWool.NONBINARY, BlockBehaviour.Properties.ofFullCopy(Blocks.YELLOW_BED)));
13391

13492
public static final Supplier<BlockEntityType<FlagBedBlockEntity>> FLAG_BED_ENTITY =
13593
BLOCK_ENTITY_TYPES.register(
13694
"flag_bed",
13795
() -> BlockEntityType.Builder.of(
13896
FlagBedBlockEntity::new,
139-
RAINBOW_BED_BLOCK.get()
97+
RAINBOW_BED_BLOCK.get(), TRANSGENDER_BED_BLOCK.get(), BISEXUAL_BED_BLOCK.get(), LESBIAN_BED_BLOCK.get(), ASEXUAL_BED_BLOCK.get(), NONBINARY_BED_BLOCK.get()
14098
).build(null)
14199
);
142100

@@ -160,6 +118,11 @@ public class RainbowSheep {
160118
public static final DeferredItem<RainbowDyeItem> ASEXUAL_DYE_ITEM = ITEMS.register("asexual_dye", () -> new RainbowDyeItem(new Item.Properties(), FlagWool.ASEXUAL));
161119
public static final DeferredItem<RainbowDyeItem> NONBINARY_DYE_ITEM = ITEMS.register("nonbinary_dye", () -> new RainbowDyeItem(new Item.Properties(), FlagWool.NONBINARY));
162120
public static final DeferredItem<BedItem> RAINBOW_BED_ITEM = ITEMS.register("rainbow_bed", () -> new BedItem(RAINBOW_BED_BLOCK.get(), new Item.Properties()));
121+
public static final DeferredItem<BedItem> TRANSGENDER_BED_ITEM = ITEMS.register("transgender_bed", () -> new BedItem(TRANSGENDER_BED_BLOCK.get(), new Item.Properties()));
122+
public static final DeferredItem<BedItem> BISEXUAL_BED_ITEM = ITEMS.register("bisexual_bed", () -> new BedItem(BISEXUAL_BED_BLOCK.get(), new Item.Properties()));
123+
public static final DeferredItem<BedItem> LESBIAN_BED_ITEM = ITEMS.register("lesbian_bed", () -> new BedItem(LESBIAN_BED_BLOCK.get(), new Item.Properties()));
124+
public static final DeferredItem<BedItem> ASEXUAL_BED_ITEM = ITEMS.register("asexual_bed", () -> new BedItem(ASEXUAL_BED_BLOCK.get(), new Item.Properties()));
125+
public static final DeferredItem<BedItem> NONBINARY_BED_ITEM = ITEMS.register("nonbinary_bed", () -> new BedItem(NONBINARY_BED_BLOCK.get(), new Item.Properties()));
163126

164127
public static final Supplier<AttachmentType<Integer>> WOOL_FLAG = ATTACHMENT_TYPES.register(
165128
"wool_flag", () -> AttachmentType.builder(() -> 0).serialize(Codec.INT).sync(ByteBufCodecs.INT).build()

src/main/java/com/sheepingtoninc/rainbowsheep/RainbowSheepClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ public static void entityRenderersEvent(EntityRenderersEvent.RegisterRenderers e
1919

2020
@SubscribeEvent
2121
public static void registerClientExtensions(RegisterClientExtensionsEvent event) {
22-
event.registerItem(new FlagBedItemExtension(), RainbowSheep.RAINBOW_BED_ITEM);
22+
event.registerItem(new FlagBedItemExtension(), RainbowSheep.RAINBOW_BED_ITEM, RainbowSheep.TRANSGENDER_BED_ITEM, RainbowSheep.BISEXUAL_BED_ITEM, RainbowSheep.LESBIAN_BED_ITEM, RainbowSheep.ASEXUAL_BED_ITEM, RainbowSheep.NONBINARY_BED_ITEM);
2323
}
2424
}

src/main/java/com/sheepingtoninc/rainbowsheep/block/FlagBedBlock.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import net.minecraft.core.BlockPos;
66
import net.minecraft.world.item.DyeColor;
77
import net.minecraft.world.level.block.BedBlock;
8-
import net.minecraft.world.level.block.RenderShape;
98
import net.minecraft.world.level.block.entity.BlockEntity;
109
import net.minecraft.world.level.block.state.BlockState;
1110

@@ -21,11 +20,6 @@ public FlagWool getFlag() {
2120
return this.flag;
2221
}
2322

24-
// @Override
25-
// public RenderShape getRenderShape(BlockState pState) {
26-
// return RenderShape.MODEL;
27-
// }
28-
//
2923
@Override
3024
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
3125
return new FlagBedBlockEntity(pos, state);

src/main/java/com/sheepingtoninc/rainbowsheep/blockentity/FlagBedBlockEntity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import com.sheepingtoninc.rainbowsheep.block.FlagBedBlock;
66
import net.minecraft.core.BlockPos;
77
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
8-
import net.minecraft.world.item.DyeColor;
9-
import net.minecraft.world.level.block.entity.BedBlockEntity;
108
import net.minecraft.world.level.block.entity.BlockEntity;
11-
import net.minecraft.world.level.block.entity.BlockEntityType;
129
import net.minecraft.world.level.block.state.BlockState;
1310

1411
public class FlagBedBlockEntity extends BlockEntity {

src/main/java/com/sheepingtoninc/rainbowsheep/client/FlagBedRenderer.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.mojang.blaze3d.vertex.VertexConsumer;
55
import com.mojang.math.Axis;
66
import com.sheepingtoninc.rainbowsheep.RainbowSheep;
7-
import com.sheepingtoninc.rainbowsheep.api.FlagWool;
87
import com.sheepingtoninc.rainbowsheep.blockentity.FlagBedBlockEntity;
98
import net.minecraft.client.model.geom.ModelLayers;
109
import net.minecraft.client.model.geom.ModelPart;
@@ -26,6 +25,7 @@
2625
import net.minecraft.world.level.block.state.properties.BedPart;
2726
import net.neoforged.api.distmarker.Dist;
2827
import net.neoforged.api.distmarker.OnlyIn;
28+
import static net.minecraft.client.renderer.Sheets.BED_SHEET;
2929

3030
@OnlyIn(Dist.CLIENT)
3131
public class FlagBedRenderer implements BlockEntityRenderer<FlagBedBlockEntity> {
@@ -38,8 +38,16 @@ public FlagBedRenderer(BlockEntityRendererProvider.Context context) {
3838
}
3939

4040
private Material getFlagMaterial(FlagBedBlockEntity blockEntity) {
41-
ResourceLocation sheet = ResourceLocation.withDefaultNamespace("textures/atlas/beds.png");
42-
return new Material(sheet, ResourceLocation.fromNamespaceAndPath(RainbowSheep.MODID, "rainbowsheep_rainbow"));
41+
String path = "rainbow";
42+
switch(blockEntity.getFlag()) {
43+
case RAINBOW -> path = "rainbow";
44+
case TRANSGENDER -> path = "transgender";
45+
case BISEXUAL -> path = "bisexual";
46+
case LESBIAN -> path = "lesbian";
47+
case ASEXUAL -> path = "asexual";
48+
case NONBINARY -> path = "nonbinary";
49+
}
50+
return new Material(BED_SHEET, ResourceLocation.fromNamespaceAndPath(RainbowSheep.MODID, "entity/bed/" + path));
4351
}
4452

4553
@Override

src/main/java/com/sheepingtoninc/rainbowsheep/item/ModCreativeModeTabs.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ public static void buildContents(BuildCreativeModeTabContentsEvent event) {
2626
event.accept(RainbowSheep.NONBINARY_CARPET_ITEM.get());
2727
}
2828

29+
if (event.getTabKey() == CreativeModeTabs.FUNCTIONAL_BLOCKS || event.getTabKey() == CreativeModeTabs.COLORED_BLOCKS) {
30+
event.accept(RainbowSheep.RAINBOW_BED_ITEM.get());
31+
event.accept(RainbowSheep.TRANSGENDER_BED_ITEM.get());
32+
event.accept(RainbowSheep.BISEXUAL_BED_ITEM.get());
33+
event.accept(RainbowSheep.LESBIAN_BED_ITEM.get());
34+
event.accept(RainbowSheep.ASEXUAL_BED_ITEM.get());
35+
event.accept(RainbowSheep.NONBINARY_BED_ITEM.get());
36+
}
37+
2938
if (event.getTabKey() == CreativeModeTabs.INGREDIENTS) {
3039
event.accept(RainbowSheep.RAINBOW_DYE_ITEM.get());
3140
event.accept(RainbowSheep.TRANSGENDER_DYE_ITEM.get());

src/main/resources/assets/minecraft/atlases/beds.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "minecraft:block/bed"
5+
}
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "minecraft:block/bed"
5+
}
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "minecraft:block/bed"
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)