Skip to content

Commit 000451c

Browse files
committed
Generation of glowing mushrooms
1 parent fa626a3 commit 000451c

File tree

15 files changed

+1131
-13
lines changed

15 files changed

+1131
-13
lines changed

src/generated/resources/assets/emi/lang/en_gb.json

Lines changed: 912 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "forge:add_features",
3+
"biomes": "#minecraft:is_nether",
4+
"features": "nuclearcraft:glowing_mushroom_placed",
5+
"step": "underground_decoration"
6+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"bonus_rolls": 0.0,
6+
"entries": [
7+
{
8+
"type": "minecraft:item",
9+
"name": "nuclearcraft:glowing_mushroom"
10+
}
11+
],
12+
"name": "block",
13+
"rolls": 1.0
14+
}
15+
],
16+
"random_sequence": "nuclearcraft:blocks/glowing_mushroom"
17+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"type": "minecraft:random_patch",
3+
"config": {
4+
"feature": {
5+
"feature": {
6+
"type": "minecraft:simple_block",
7+
"config": {
8+
"to_place": {
9+
"type": "minecraft:simple_state_provider",
10+
"state": {
11+
"Name": "nuclearcraft:glowing_mushroom"
12+
}
13+
}
14+
}
15+
},
16+
"placement": [
17+
{
18+
"type": "minecraft:block_predicate_filter",
19+
"predicate": {
20+
"type": "minecraft:all_of",
21+
"predicates": [
22+
{
23+
"type": "minecraft:matching_blocks",
24+
"blocks": "minecraft:air"
25+
},
26+
{
27+
"type": "minecraft:matching_blocks",
28+
"blocks": [
29+
"minecraft:soul_soil",
30+
"minecraft:soul_sand",
31+
"minecraft:glowstone"
32+
],
33+
"offset": [
34+
0,
35+
-1,
36+
0
37+
]
38+
}
39+
]
40+
}
41+
}
42+
]
43+
},
44+
"tries": 96,
45+
"xz_spread": 7,
46+
"y_spread": 3
47+
}
48+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"feature": "nuclearcraft:glowing_mushroom_feature",
3+
"placement": [
4+
{
5+
"type": "minecraft:rarity_filter",
6+
"chance": 2
7+
},
8+
{
9+
"type": "minecraft:in_square"
10+
},
11+
{
12+
"type": "minecraft:height_range",
13+
"height": {
14+
"type": "minecraft:uniform",
15+
"max_inclusive": {
16+
"below_top": 0
17+
},
18+
"min_inclusive": {
19+
"above_bottom": 0
20+
}
21+
}
22+
},
23+
{
24+
"type": "minecraft:biome"
25+
}
26+
]
27+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package igentuman.nc.block;
2+
3+
import net.minecraft.core.BlockPos;
4+
import net.minecraft.server.level.ServerLevel;
5+
import net.minecraft.util.RandomSource;
6+
import net.minecraft.world.level.Level;
7+
import net.minecraft.world.level.LevelReader;
8+
import net.minecraft.world.level.block.MushroomBlock;
9+
import net.minecraft.world.level.block.state.BlockBehaviour;
10+
import net.minecraft.world.level.block.state.BlockState;
11+
12+
public class GlowingMushroomBlock extends MushroomBlock {
13+
14+
public GlowingMushroomBlock(BlockBehaviour.Properties pProperties) {
15+
super(pProperties, null);
16+
}
17+
18+
@Override
19+
public boolean isValidBonemealTarget(LevelReader pLevel, BlockPos pPos, BlockState pState, boolean pIsClient) {
20+
return false;
21+
}
22+
23+
public boolean isBonemealSuccess(Level pLevel, RandomSource pRandom, BlockPos pPos, BlockState pState) {
24+
return false;
25+
}
26+
27+
@Override
28+
public void performBonemeal(ServerLevel pLevel, RandomSource pRandom, BlockPos pPos, BlockState pState) {
29+
}
30+
}

src/main/java/igentuman/nc/datagen/NCLootTables.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void machines() {
6666
for(String name: NC_RF_AMPLIFIERS.keySet()) {
6767
add(NC_RF_AMPLIFIERS.get(name).get(), block -> createSimpleTable("block", NC_RF_AMPLIFIERS.get(name).get()));
6868
}
69-
// add(REDSTONE_DIMMER_BLOCK.get(), block -> createSimpleTable("block", REDSTONE_DIMMER_BLOCK.get()));
69+
add(MUSHROOM_BLOCK.get(), block -> createSimpleTable("block", MUSHROOM_BLOCK.get()));
7070
}
7171

7272
@Override
@@ -91,6 +91,7 @@ public void generate() {
9191
all.addAll(STORAGE_BLOCKS.values().stream().map(RegistryObject::get).toList());
9292
all.addAll(NC_ELECTROMAGNETS.values().stream().map(RegistryObject::get).toList());
9393
all.addAll(NC_RF_AMPLIFIERS.values().stream().map(RegistryObject::get).toList());
94+
all.add(MUSHROOM_BLOCK.get());
9495
return all;
9596
}
9697
}

src/main/java/igentuman/nc/datagen/tags/NCBlockTags.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private void ores() {
8787
private void blocks() {
8888
tag(BlockTags.MINEABLE_WITH_PICKAXE).add(REDSTONE_DIMMER_BLOCK.get());
8989
tag(BlockTags.NEEDS_IRON_TOOL).add(REDSTONE_DIMMER_BLOCK.get());
90+
9091
for(String block: NCBlocks.NC_BLOCKS.keySet()) {
9192
tag(BlockTags.MINEABLE_WITH_PICKAXE).add(NCBlocks.NC_BLOCKS.get(block).get());
9293
tag(BlockTags.NEEDS_IRON_TOOL).add(NCBlocks.NC_BLOCKS.get(block).get());

src/main/java/igentuman/nc/setup/registration/CreativeTabs.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ private static List<ItemStack> getItems()
136136
items.add(new ItemStack(MULTITOOL.get()));
137137
items.add(new ItemStack(GEIGER_COUNTER.get()));
138138
items.add(new ItemStack(LITHIUM_ION_CELL.get()));
139+
items.add(new ItemStack(MUSHROOM_BLOCK.get()));
139140
return items;
140141
}
141142

src/main/java/igentuman/nc/setup/registration/NCBlocks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class NCBlocks {
5252
public static final RegistryObject<Item> REDSTONE_DIMMER_ITEM_BLOCK = fromBlock(REDSTONE_DIMMER_BLOCK);
5353
public static final RegistryObject<BlockEntityType<RedstoneDimmerBE>> REDSTONE_DIMMER_BE = BLOCK_ENTITIES.register("redstone_dimmer",
5454
() -> BlockEntityType.Builder.of(RedstoneDimmerBE::new, REDSTONE_DIMMER_BLOCK.get()).build(null));
55-
public static final RegistryObject<Block> MUSHROOM_BLOCK = BLOCKS.register("glowing_mushroom", () -> new GrassBlock(
55+
public static final RegistryObject<Block> MUSHROOM_BLOCK = BLOCKS.register("glowing_mushroom", () -> new GlowingMushroomBlock(
5656
BlockBehaviour.Properties.of().sound(SoundType.GRASS).noCollission().instabreak().randomTicks().lightLevel($ -> 10)
5757
));
5858
public static final RegistryObject<MenuType<RedstoneDImmerContainer>> REDSTONE_DIMMER_CONTAINER = CONTAINERS.register("redstone_dimmer",

0 commit comments

Comments
 (0)