-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
8fc8e7b
commit 4151979
Showing
15 changed files
with
79 additions
and
71 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
src/main/java/dev/latvian/mods/literalskyblock/LSBBlockEntities.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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
package dev.latvian.mods.literalskyblock; | ||
|
||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import java.util.Arrays; | ||
import java.util.function.Supplier; | ||
|
||
public interface LSBBlockEntities { | ||
DeferredRegister<BlockEntityType<?>> REGISTER = DeferredRegister.create(Registries.BLOCK_ENTITY_TYPE, LiteralSkyBlock.MOD_ID); | ||
|
||
Supplier<BlockEntityType<SkyBlockEntity>> SKY_BLOCK = REGISTER.register("sky_block", () -> BlockEntityType.Builder.of(SkyBlockEntity::new, LSBBlocks.SKY_BLOCK.get()).build(null)); | ||
Supplier<BlockEntityType<VoidBlockEntity>> VOID_BLOCK = REGISTER.register("void_block", () -> BlockEntityType.Builder.of(VoidBlockEntity::new, LSBBlocks.VOID_BLOCK.get()).build(null)); | ||
Supplier<BlockEntityType<SkyBlockEntity>> SKY_BLOCK = REGISTER.register("sky_block", () -> BlockEntityType.Builder.of(SkyBlockEntity::new, Arrays.stream(ProjectionType.VALUES).map(p -> p.skyBlock).map(DeferredHolder::get).toArray(Block[]::new)).build(null)); | ||
} |
5 changes: 0 additions & 5 deletions
5
src/main/java/dev/latvian/mods/literalskyblock/LSBBlocks.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 |
---|---|---|
@@ -1,14 +1,9 @@ | ||
package dev.latvian.mods.literalskyblock; | ||
|
||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
import net.neoforged.neoforge.registries.DeferredBlock; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
public interface LSBBlocks { | ||
DeferredRegister.Blocks REGISTER = DeferredRegister.createBlocks(LiteralSkyBlock.MOD_ID); | ||
|
||
DeferredBlock<Block> SKY_BLOCK = REGISTER.registerBlock("sky_block", SkyBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE)); | ||
DeferredBlock<Block> VOID_BLOCK = REGISTER.registerBlock("void_block", VoidBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE)); | ||
} |
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
package dev.latvian.mods.literalskyblock; | ||
|
||
import net.minecraft.world.item.BlockItem; | ||
import net.neoforged.neoforge.registries.DeferredItem; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
public interface LSBItems { | ||
DeferredRegister.Items REGISTER = DeferredRegister.createItems(LiteralSkyBlock.MOD_ID); | ||
|
||
DeferredItem<BlockItem> SKY_BLOCK = REGISTER.registerSimpleBlockItem("sky_block", LSBBlocks.SKY_BLOCK); | ||
DeferredItem<BlockItem> VOID_BLOCK = REGISTER.registerSimpleBlockItem("void_block", LSBBlocks.VOID_BLOCK); | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/dev/latvian/mods/literalskyblock/ProjectionType.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,33 @@ | ||
package dev.latvian.mods.literalskyblock; | ||
|
||
import com.mojang.serialization.Codec; | ||
import net.minecraft.util.StringRepresentable; | ||
import net.minecraft.world.item.BlockItem; | ||
import net.minecraft.world.level.block.Block; | ||
import net.neoforged.neoforge.registries.DeferredBlock; | ||
import net.neoforged.neoforge.registries.DeferredItem; | ||
|
||
public enum ProjectionType implements StringRepresentable { | ||
SKY("sky", false), | ||
VOID("void", false); | ||
|
||
public static final ProjectionType[] VALUES = values(); | ||
public static final Codec<ProjectionType> CODEC = StringRepresentable.fromEnum(() -> VALUES); | ||
|
||
private final String name; | ||
public final boolean uvs; | ||
|
||
public Object renderType; | ||
public DeferredBlock<Block> skyBlock; | ||
public DeferredItem<BlockItem> skyBlockItem; | ||
|
||
ProjectionType(String name, boolean uvs) { | ||
this.name = name; | ||
this.uvs = uvs; | ||
} | ||
|
||
@Override | ||
public String getSerializedName() { | ||
return name; | ||
} | ||
} |
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
26 changes: 0 additions & 26 deletions
26
src/main/java/dev/latvian/mods/literalskyblock/VoidBlock.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/dev/latvian/mods/literalskyblock/VoidBlockEntity.java
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
} | ||
}, | ||
"result": { | ||
"item": "literalskyblock:void_block", | ||
"id": "literalskyblock:void_block", | ||
"count": 8 | ||
} | ||
} |