Skip to content

Commit 3c69825

Browse files
committed
Add End Stone Smoker
and do some fixes for furnace
1 parent e04a404 commit 3c69825

File tree

17 files changed

+267
-6
lines changed

17 files changed

+267
-6
lines changed

src/client/java/io/github/openbagtwo/lighterend/blocks/CutoutRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public static void initialize() {
4242
LighterEndBlocks.AGAVE_FUR,
4343
LighterEndBlocks.AGAVE_SEED,
4444
LighterEndBlocks.AURANT_POLYPORE,
45-
LighterEndBlocks.END_FURNACE
45+
LighterEndBlocks.END_FURNACE,
46+
LighterEndBlocks.END_SMOKER
4647
);
4748
}
4849

src/client/java/io/github/openbagtwo/lighterend/datagen/BlockLootTableProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public void generate() {
130130
addDrop(LighterEndBlocks.AURANT_POLYPORE);
131131
addDrop(LighterEndBlocks.PURPLE_POLYPORE);
132132
addDrop(LighterEndBlocks.END_FURNACE, this::nameableContainerDrops);
133+
addDrop(LighterEndBlocks.END_SMOKER, this::nameableContainerDrops);
133134
}
134135

135136
private LootTable.Builder auroraCrystalDrops() {

src/client/java/io/github/openbagtwo/lighterend/datagen/RecipeProvider.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import net.minecraft.registry.RegistryKeys;
2525
import net.minecraft.registry.RegistryWrapper;
2626
import net.minecraft.registry.RegistryWrapper.WrapperLookup;
27+
import net.minecraft.registry.tag.ItemTags;
2728

2829
public class RecipeProvider extends FabricRecipeProvider {
2930

@@ -315,6 +316,30 @@ public void generate() {
315316
.pattern("###")
316317
.criterion(hasItem(Blocks.END_STONE), this.conditionsFromItem(Blocks.END_STONE))
317318
.offerTo(this.exporter);
319+
this.createShapeless(RecipeCategory.TRANSPORTATION, Items.FURNACE_MINECART)
320+
.input(LighterEndBlocks.END_FURNACE)
321+
.input(Items.MINECART)
322+
.criterion(
323+
hasItem(LighterEndBlocks.END_FURNACE),
324+
this.conditionsFromItem(LighterEndBlocks.END_FURNACE)
325+
).offerTo(
326+
exporter,
327+
RegistryKey.of(
328+
RegistryKeys.RECIPE,
329+
LighterEnd.of("furnace_minecart_from_end_stone_furnace")
330+
)
331+
);
332+
this.createShaped(RecipeCategory.DECORATIONS, LighterEndBlocks.END_SMOKER)
333+
.input('#', ItemTags.LOGS)
334+
.input('X', LighterEndBlocks.END_FURNACE)
335+
.pattern(" # ")
336+
.pattern("#X#")
337+
.pattern(" # ")
338+
.criterion(
339+
hasItem(LighterEndBlocks.END_FURNACE),
340+
this.conditionsFromItem(LighterEndBlocks.END_FURNACE)
341+
).offerTo(this.exporter);
342+
318343
}
319344

320345
public void generateMaterialRecipes(Material material) {

src/main/java/io/github/openbagtwo/lighterend/blocks/Furnaces.java

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@
55
import net.minecraft.block.Blocks;
66
import net.minecraft.block.FurnaceBlock;
77
import net.minecraft.block.MapColor;
8+
import net.minecraft.block.SmokerBlock;
89
import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
910
import net.minecraft.block.entity.BlockEntity;
1011
import net.minecraft.block.entity.BlockEntityTicker;
1112
import net.minecraft.block.entity.BlockEntityType;
1213
import net.minecraft.block.enums.NoteBlockInstrument;
1314
import net.minecraft.entity.player.PlayerEntity;
1415
import net.minecraft.entity.player.PlayerInventory;
16+
import net.minecraft.item.FuelRegistry;
17+
import net.minecraft.item.ItemStack;
1518
import net.minecraft.recipe.RecipeType;
1619
import net.minecraft.screen.FurnaceScreenHandler;
1720
import net.minecraft.screen.NamedScreenHandlerFactory;
1821
import net.minecraft.screen.ScreenHandler;
22+
import net.minecraft.screen.SmokerScreenHandler;
1923
import net.minecraft.stat.Stats;
2024
import net.minecraft.text.Text;
2125
import net.minecraft.util.math.BlockPos;
@@ -29,7 +33,7 @@ public static class EndFurnace extends FurnaceBlock {
2933
public EndFurnace(Settings settings) {
3034
super(
3135
settings
32-
.mapColor(MapColor.STONE_GRAY)
36+
.mapColor(MapColor.PALE_YELLOW)
3337
.instrument(NoteBlockInstrument.BASEDRUM)
3438
.requiresTool()
3539
.strength(7F)
@@ -77,4 +81,62 @@ protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerIn
7781
}
7882
}
7983

84+
public static class EndSmoker extends SmokerBlock {
85+
86+
public EndSmoker(Settings settings) {
87+
super(
88+
settings
89+
.mapColor(MapColor.PALE_YELLOW)
90+
.instrument(NoteBlockInstrument.BASEDRUM)
91+
.requiresTool()
92+
.strength(7F)
93+
.luminance(Blocks.createLightLevelFromLitBlockState(13))
94+
);
95+
}
96+
97+
@Override
98+
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
99+
return new EndSmokerEntity(pos, state);
100+
}
101+
102+
@Nullable
103+
@Override
104+
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
105+
World world, BlockState state, BlockEntityType<T> type
106+
) {
107+
return validateTicker(world, type, LighterEndBlockEntities.END_SMOKER);
108+
}
109+
110+
@Override
111+
protected void openScreen(World world, BlockPos pos, PlayerEntity player) {
112+
BlockEntity blockEntity = world.getBlockEntity(pos);
113+
if (blockEntity instanceof EndSmokerEntity) {
114+
player.openHandledScreen((NamedScreenHandlerFactory) blockEntity);
115+
player.incrementStat(Stats.INTERACT_WITH_SMOKER);
116+
}
117+
}
118+
}
119+
120+
public static class EndSmokerEntity extends AbstractFurnaceBlockEntity {
121+
122+
public EndSmokerEntity(BlockPos pos, BlockState state) {
123+
super(LighterEndBlockEntities.END_SMOKER, pos, state, RecipeType.SMOKING);
124+
}
125+
126+
@Override
127+
protected Text getContainerName() {
128+
return Text.translatable("container.smoker");
129+
}
130+
131+
@Override
132+
protected int getFuelTime(FuelRegistry fuelRegistry, ItemStack stack) {
133+
return super.getFuelTime(fuelRegistry, stack) / 2;
134+
}
135+
136+
@Override
137+
protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory) {
138+
return new SmokerScreenHandler(syncId, playerInventory, this, this.propertyDelegate);
139+
}
140+
}
141+
80142
}

src/main/java/io/github/openbagtwo/lighterend/registries/LighterEndBlockEntities.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.openbagtwo.lighterend.registries;
22

33
import io.github.openbagtwo.lighterend.LighterEnd;
4-
import io.github.openbagtwo.lighterend.blocks.Furnaces.EndFurnaceEntity;
4+
import io.github.openbagtwo.lighterend.blocks.Furnaces;
55
import io.github.openbagtwo.lighterend.blocks.Signs.LighterEndHangingSignBlockEntity;
66
import io.github.openbagtwo.lighterend.blocks.Signs.LighterEndSignBlockEntity;
77
import io.github.openbagtwo.lighterend.blocks.entities.SilkMothNestEntity;
@@ -42,11 +42,18 @@ public class LighterEndBlockEntities {
4242
LighterEndBlocks.GLOWSHROOM.wallHangingSign
4343
).build(null));
4444

45-
public static final BlockEntityType<EndFurnaceEntity> END_FURNACE = Registry.register(
45+
public static final BlockEntityType<Furnaces.EndFurnaceEntity> END_FURNACE = Registry.register(
4646
Registries.BLOCK_ENTITY_TYPE,
47-
LighterEnd.of("end_furnace"),
47+
LighterEnd.of("end_stone_furnace"),
4848
FabricBlockEntityTypeBuilder.create(
49-
EndFurnaceEntity::new, LighterEndBlocks.END_FURNACE
49+
Furnaces.EndFurnaceEntity::new, LighterEndBlocks.END_FURNACE
50+
).build(null));
51+
52+
public static final BlockEntityType<Furnaces.EndSmokerEntity> END_SMOKER = Registry.register(
53+
Registries.BLOCK_ENTITY_TYPE,
54+
LighterEnd.of("end_stone_smoker"),
55+
FabricBlockEntityTypeBuilder.create(
56+
Furnaces.EndSmokerEntity::new, LighterEndBlocks.END_SMOKER
5057
).build(null));
5158

5259
public static final BlockEntityType<SilkMothNestEntity> SILK_MOTH_NEST = Registry.register(

src/main/java/io/github/openbagtwo/lighterend/registries/LighterEndBlocks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public class LighterEndBlocks {
200200
);
201201

202202
public static final Block END_FURNACE = register("end_stone_furnace", Furnaces.EndFurnace::new);
203+
public static final Block END_SMOKER = register("end_stone_smoker", Furnaces.EndSmoker::new);
203204

204205
public static Block register(String name, Function<Settings, Block> factory) {
205206
return register(name, factory, true);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"variants": {
3+
"facing=east,lit=false": {
4+
"model": "lighterend:block/end_stone_smoker",
5+
"y": 90
6+
},
7+
"facing=east,lit=true": {
8+
"model": "lighterend:block/end_stone_smoker_lit",
9+
"y": 90
10+
},
11+
"facing=north,lit=false": {
12+
"model": "lighterend:block/end_stone_smoker"
13+
},
14+
"facing=north,lit=true": {
15+
"model": "lighterend:block/end_stone_smoker_lit"
16+
},
17+
"facing=south,lit=false": {
18+
"model": "lighterend:block/end_stone_smoker",
19+
"y": 180
20+
},
21+
"facing=south,lit=true": {
22+
"model": "lighterend:block/end_stone_smoker_lit",
23+
"y": 180
24+
},
25+
"facing=west,lit=false": {
26+
"model": "lighterend:block/end_stone_smoker",
27+
"y": 270
28+
},
29+
"facing=west,lit=true": {
30+
"model": "lighterend:block/end_stone_smoker_lit",
31+
"y": 270
32+
}
33+
}
34+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"model": {
3+
"model": "lighterend:block/end_stone_smoker",
4+
"type": "minecraft:model"
5+
}
6+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"biome.lighterend.umbrella_jungle": "Umbrella Jungle",
88
"block.lighterend.end_lotus_hanging_sign": "Lotus Wood Hanging Sign",
99
"block.lighterend.end_lotus_sign": "Lotus Wood Sign",
10+
"block.lighterend.end_stone_furnace": "End Stone Furnace",
11+
"block.lighterend.end_stone_smoker": "End Stone Smoker",
1012
"block.lighterend.mossy_glowshroom_hanging_sign": "Glowshroom Hanging Sign",
1113
"block.lighterend.mossy_glowshroom_sign": "Glowshroom Sign",
1214
"block.lighterend.tenanea_hanging_sign": "Tenanea Hanging Sign",
@@ -94,6 +96,8 @@
9496
"item.lighterend.end_moss": "End Moss",
9597
"item.lighterend.end_powder": "End Powder",
9698
"item.lighterend.end_slime_spawn_egg": "End Slime Spawn Egg",
99+
"item.lighterend.end_stone_furnace": "End Stone Furnace",
100+
"item.lighterend.end_stone_smoker": "End Stone Smoker",
97101
"item.lighterend.ender_block": "Ender Block",
98102
"item.lighterend.glow_barb": "Glow Barb",
99103
"item.lighterend.lumecorn_popped": "Popped Lumecorn",

src/main/resources/assets/lighterend/models/block/end_stone_furnace_lit.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"emissive": "lighterend:block/end_stone_furnace_glow_e",
103103
"front": "lighterend:block/end_stone_furnace_front_on",
104104
"glow": "lighterend:block/end_stone_furnace_glow",
105+
"particle": "minecraft:block/end_stone",
105106
"side": "lighterend:block/end_stone_furnace_side",
106107
"top": "lighterend:block/end_stone_furnace_top"
107108
}

0 commit comments

Comments
 (0)