Skip to content

Commit 11f0c0f

Browse files
committed
fungus cap block done and dullthorns started
1 parent cf2db08 commit 11f0c0f

File tree

19 files changed

+234
-4
lines changed

19 files changed

+234
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "infernalexp:block/dullthorns"
5+
}
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "infernalexp:block/dullthorns_block"
5+
}
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/cross",
3+
"textures": {
4+
"cross": "infernalexp:block/dullthorns"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/cube_all",
3+
"textures": {
4+
"all": "infernalexp:block/dullthorns_block"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:item/generated",
3+
"textures": {
4+
"layer0": "infernalexp:block/dullthorns"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"parent": "infernalexp:block/dullthorns_block"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"bonus_rolls": 0.0,
6+
"conditions": [
7+
{
8+
"condition": "minecraft:survives_explosion"
9+
}
10+
],
11+
"entries": [
12+
{
13+
"type": "minecraft:item",
14+
"name": "infernalexp:dullthorns"
15+
}
16+
],
17+
"rolls": 1.0
18+
}
19+
]
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"bonus_rolls": 0.0,
6+
"conditions": [
7+
{
8+
"condition": "minecraft:survives_explosion"
9+
}
10+
],
11+
"entries": [
12+
{
13+
"type": "minecraft:item",
14+
"name": "infernalexp:dullthorns_block"
15+
}
16+
],
17+
"rolls": 1.0
18+
}
19+
]
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"bonus_rolls": 0.0,
6+
"conditions": [
7+
{
8+
"condition": "minecraft:survives_explosion"
9+
}
10+
],
11+
"entries": [
12+
{
13+
"type": "minecraft:item",
14+
"name": "infernalexp:luminous_fungus_cap"
15+
}
16+
],
17+
"rolls": 1.0
18+
}
19+
]
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"replace": false,
3+
"values": [
4+
"infernalexp:dullthorns",
5+
"infernalexp:dullthorns_block"
6+
]
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"replace": false,
3+
"values": [
4+
"infernalexp:dullthorns",
5+
"infernalexp:dullthorns_block"
6+
]
7+
}

src/main/java/org/infernalstudios/infernalexp/block/ModBlocks.java

+27-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
44
import net.fabricmc.fabric.api.object.builder.v1.block.type.BlockSetTypeBuilder;
55
import net.minecraft.block.*;
6+
import net.minecraft.registry.tag.BlockTags;
67
import org.infernalstudios.infernalexp.InfernalExpansion;
8+
import org.infernalstudios.infernalexp.block.custom.DullthornsBlock;
9+
import org.infernalstudios.infernalexp.block.custom.FungusCapBlock;
710
import org.infernalstudios.infernalexp.block.custom.LuminousFungusBlock;
811
import org.infernalstudios.infernalexp.setup.ModRegistry;
912

@@ -28,13 +31,16 @@ public static void register() {
2831
private static final BlockSetType dullStoneSet =
2932
new BlockSetTypeBuilder().register(InfernalExpansion.makeID("dullstone"));
3033

34+
private static final FabricBlockSettings dullthorns =
35+
FabricBlockSettings.create().mapColor(MapColor.SPRUCE_BROWN).strength(0.4f);
36+
3137

3238
public static final Block SHIMMER_SAND = ModRegistry.ofBlock("shimmer_sand",
33-
new SandBlock(0xffffaa, FabricBlockSettings.copyOf(Blocks.SAND)))
39+
new SandBlock(0xffffaa, FabricBlockSettings.copyOf(Blocks.SAND)))
3440
.model(ModRegistry.Models.ROTATABLE).drop().tool("wood_shovel").build();
3541

3642
public static final Block SHIMMER_SHEET = ModRegistry.ofBlock("shimmer_sheet",
37-
new SnowBlock(FabricBlockSettings.copyOf(Blocks.SAND)))
43+
new SnowBlock(FabricBlockSettings.copyOf(Blocks.SAND)))
3844
.tool("wood_shovel").build();
3945

4046
public static final Block GLOWLIGHT_GLASS = ModRegistry.ofBlock("glowlight_glass",
@@ -100,8 +106,25 @@ public static void register() {
100106
.model().drop().tool("stone_hoe").build();
101107

102108

109+
public static final Block DULLTHORNS = ModRegistry.ofBlock("dullthorns",
110+
new DullthornsBlock(Block.createCuboidShape(3, 0, 3, 13, 16, 13),
111+
FabricBlockSettings.copyOf(dullthorns).collidable(false).nonOpaque()))
112+
.model(ModRegistry.Models.CROSS).drop().tool("wood_axe")
113+
.tag(BlockTags.CLIMBABLE).cutout().build();
114+
115+
public static final Block DULLTHORNS_BLOCK = ModRegistry.ofBlock("dullthorns_block",
116+
new DullthornsBlock(Block.createCuboidShape(0.1, 0, 0.1, 15.9, 16, 15.9), dullthorns))
117+
.model().drop().tool("wood_axe")
118+
.tag(BlockTags.CLIMBABLE).build();
119+
120+
103121
public static final Block LUMINOUS_FUNGUS = ModRegistry.ofBlock("luminous_fungus",
104-
new LuminousFungusBlock(FabricBlockSettings.copyOf(Blocks.WARPED_FUNGUS)
105-
.luminance(a -> a.get(LuminousFungusBlock.IS_LIT) ? 15 : 0).ticksRandomly()))
122+
new LuminousFungusBlock(FabricBlockSettings.copyOf(Blocks.WARPED_FUNGUS)
123+
.luminance(a -> a.get(LuminousFungusBlock.IS_LIT) ? 15 : 0).ticksRandomly()))
106124
.drop().cutout().build();
125+
126+
public static final Block LUMINOUS_FUNGUS_CAP = ModRegistry.ofBlock("luminous_fungus_cap",
127+
new FungusCapBlock(FabricBlockSettings.copyOf(Blocks.WARPED_FUNGUS)
128+
.luminance(8).collidable(true)))
129+
.tool("wood_hoe").drop().build();
107130
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.infernalstudios.infernalexp.block.custom;
2+
3+
import net.minecraft.block.Block;
4+
import net.minecraft.block.BlockState;
5+
import net.minecraft.block.CactusBlock;
6+
import net.minecraft.block.ShapeContext;
7+
import net.minecraft.entity.Entity;
8+
import net.minecraft.util.math.BlockPos;
9+
import net.minecraft.util.shape.VoxelShape;
10+
import net.minecraft.world.BlockView;
11+
import net.minecraft.world.World;
12+
13+
public class DullthornsBlock extends Block {
14+
public VoxelShape shape;
15+
16+
public DullthornsBlock(VoxelShape collision, Settings settings) {
17+
super(settings);
18+
this.shape = collision;
19+
}
20+
21+
@Override
22+
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
23+
super.onEntityCollision(state, world, pos, entity);
24+
entity.damage(entity.getDamageSources().cactus(), 1);
25+
}
26+
27+
@Override
28+
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
29+
return this.shape;
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package org.infernalstudios.infernalexp.block.custom;
2+
3+
import net.minecraft.block.Block;
4+
import net.minecraft.block.BlockState;
5+
import net.minecraft.block.SlimeBlock;
6+
import net.minecraft.entity.Entity;
7+
import net.minecraft.entity.LivingEntity;
8+
import net.minecraft.util.math.BlockPos;
9+
import net.minecraft.util.math.Vec3d;
10+
import net.minecraft.world.BlockView;
11+
import net.minecraft.world.World;
12+
13+
public class FungusCapBlock extends Block {
14+
public FungusCapBlock(Settings settings) {
15+
super(settings);
16+
}
17+
18+
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
19+
if (entity.bypassesLandingEffects()) {
20+
super.onLandedUpon(world, state, pos, entity, fallDistance);
21+
} else {
22+
entity.handleFallDamage(fallDistance, 0.0F, world.getDamageSources().fall());
23+
}
24+
}
25+
26+
public void onEntityLand(BlockView world, Entity entity) {
27+
if (entity.bypassesLandingEffects()) {
28+
super.onEntityLand(world, entity);
29+
} else {
30+
this.bounce(entity);
31+
}
32+
}
33+
34+
private void bounce(Entity entity) {
35+
Vec3d vec3d = entity.getVelocity();
36+
if (vec3d.y < 0.0D) {
37+
entity.setVelocity(vec3d.x, -vec3d.y * 0.7, vec3d.z);
38+
}
39+
}
40+
}

src/main/java/org/infernalstudios/infernalexp/item/ModItemGroups.java

+4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public class ModItemGroups {
3939

4040
entries.add(ModBlocks.GLOWSILK_COCOON);
4141

42+
entries.add(ModBlocks.DULLTHORNS);
43+
entries.add(ModBlocks.DULLTHORNS_BLOCK);
44+
4245
entries.add(ModBlocks.LUMINOUS_FUNGUS);
46+
entries.add(ModBlocks.LUMINOUS_FUNGUS_CAP);
4347

4448
})
4549
.build());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "infernalexp:block/luminous_fungus_cap"
5+
}
6+
}
7+
}

src/main/resources/assets/infernalexp/lang/en_us.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"block.infernalexp.dullstone_pressure_plate": "Dullstone Pressure Plate",
2020
"block.infernalexp.glowsilk_cocoon": "Glowsilk Cocoon",
2121
"block.infernalexp.luminous_fungus": "Luminous Fungus",
22+
"block.infernalexp.luminous_fungus_cap": "Luminous Fungus Cap",
2223

2324
"item.infernalexp.dullrocks": "Dullrocks",
2425
"item.infernalexp.tab_icon": "Infernal Expansion"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"parent": "minecraft:block/cube",
3+
"textures": {
4+
"down": "infernalexp:block/luminous_fungus_cap_bottom",
5+
"east": "infernalexp:block/luminous_fungus_cap_side",
6+
"north": "infernalexp:block/luminous_fungus_cap_side",
7+
"particle": "infernalexp:block/luminous_fungus_cap_side",
8+
"south": "infernalexp:block/luminous_fungus_cap_side",
9+
"up": "infernalexp:block/luminous_fungus_cap_top",
10+
"west": "infernalexp:block/luminous_fungus_cap_side"
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"parent": "infernalexp:block/luminous_fungus_cap"
3+
}

0 commit comments

Comments
 (0)