Skip to content

Commit 093ac22

Browse files
fix: AI comments
1 parent 468419c commit 093ac22

5 files changed

Lines changed: 11 additions & 29 deletions

File tree

src/client/java/com/tcm/MineTale/block/workbenches/screen/FurnaceWorkbenchScreen.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ private static MineTaleRecipeBookComponent createRecipeBookComponent(FurnaceWork
4141
List<RecipeBookComponent.TabInfo> tabs = List.of(
4242
new RecipeBookComponent.TabInfo(tabIcon.getItem(), ModRecipeDisplay.FURNACE_T1_SEARCH)
4343
);
44-
// List<RecipeBookComponent.TabInfo> tabs = List.of(
45-
// new RecipeBookComponent.TabInfo(tabIcon.getItem(), ModRecipeDisplay.CAMPFIRE_SEARCH)
46-
// );
4744

48-
// Ensure the last argument is the RecipeBookType, NOT the RecipeType
4945
return new MineTaleRecipeBookComponent(menu, tabs, ModRecipes.FURNACE_T1_TYPE);
5046
}
5147

src/client/java/com/tcm/MineTale/datagen/ModRecipeProvider.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,17 @@ protected RecipeProvider createRecipeProvider(HolderLookup.Provider registryLook
4747
public void buildRecipes() {
4848
new WorkbenchRecipeBuilder(ModRecipes.CAMPFIRE_TYPE, ModRecipes.CAMPFIRE_SERIALIZER)
4949
.input(Ingredient.of(Items.PORKCHOP))
50-
// Note: Slot 1 is optional in our logic, so we just don't add a second input
5150
.output(new ItemStack(Items.COOKED_PORKCHOP))
52-
.time(10) // Campfires usually take longer (30 seconds)
51+
.time(10)
5352
.unlockedBy("has_porkchop", has(Items.PORKCHOP))
5453
.category(CraftingBookCategory.MISC)
5554
.bookCategory(ModRecipeDisplay.CAMPFIRE_SEARCH)
5655
.save(exporter, Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "campfire_pork_cooking"));
5756

5857
new WorkbenchRecipeBuilder(ModRecipes.FURNACE_T1_TYPE, ModRecipes.FURNACE_SERIALIZER)
5958
.input(Ingredient.of(Items.PORKCHOP))
60-
// Note: Slot 1 is optional in our logic, so we just don't add a second input
6159
.output(new ItemStack(Items.ACACIA_BOAT))
62-
.time(10) // Campfires usually take longer (30 seconds)
60+
.time(10)
6361
.unlockedBy("has_porkchop", has(Items.PORKCHOP))
6462
.category(CraftingBookCategory.MISC)
6563
.bookCategory(ModRecipeDisplay.FURNACE_T1_SEARCH)

src/main/java/com/tcm/MineTale/block/workbenches/CampfireWorkbench.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,7 @@ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, Co
107107
@Override
108108
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
109109
// AbstractWorkbench logic ensures only the Master block gets the entity.
110-
// We override it here to point specifically to our Furnace entity.
110+
// We override it here to point specifically to our Campfire entity.
111111
return super.newBlockEntity(pos, state);
112112
}
113-
114-
// TODO: Check if we need this
115-
// /**
116-
// * Compute the master (base) block position for this block based on its state.
117-
// *
118-
// * @param state the block state of the current block
119-
// * @param pos the position of the current block
120-
// * @return the position of the master (base) block: if the block is the upper half, the block below is used; if the block's type is `RIGHT`, the position is offset one block counterclockwise from its facing direction; otherwise the original position
121-
// */
122-
// public BlockPos getMasterPos(BlockState state, BlockPos pos) {
123-
// BlockPos master = pos;
124-
// Direction facing = state.getValue(FACING);
125-
// if (state.getValue(HALF) == DoubleBlockHalf.UPPER) master = master.below();
126-
// if (state.getValue(TYPE) == ChestType.RIGHT) master = master.relative(facing.getCounterClockWise());
127-
// return master;
128-
// }
129-
130113
}

src/main/java/com/tcm/MineTale/block/workbenches/FurnaceWorkbench.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, Block
6767
}
6868

6969
/**
70-
* The codec used to serialize and deserialize this CampfireWorkbench type.
70+
* The codec used to serialize and deserialize this FurnaceWorkbench type.
7171
*
72-
* @return the MapCodec for this CampfireWorkbench
72+
* @return the MapCodec for this FurnaceWorkbench
7373
*/
7474
@Override
7575
protected MapCodec<? extends FurnaceWorkbench> codec() {

src/main/java/com/tcm/MineTale/block/workbenches/entity/CampfireWorkbenchEntity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class CampfireWorkbenchEntity extends AbstractWorkbenchEntity {
2828
private int cookTime;
2929
private int cookTimeTotal = 200;
3030
private int fuelTime;
31+
private int inputEnd = 3;
3132

3233
protected final ContainerData data = new ContainerData() {
3334
/**
@@ -110,6 +111,10 @@ public void tick(Level level, BlockPos pos, BlockState state) {
110111
if (shiftQueueForward()) {
111112
changed = true;
112113
}
114+
115+
if (changed) {
116+
setChanged();
117+
}
113118
}
114119

115120
/**
@@ -119,7 +124,7 @@ public void tick(Level level, BlockPos pos, BlockState state) {
119124
private boolean shiftQueueForward() {
120125
boolean moved = false;
121126
// Start from the front and pull from the back
122-
for (int i = Constants.INPUT_START; i < Constants.INPUT_START + 1; i++) {
127+
for (int i = Constants.INPUT_START; i < this.inputEnd; i++) {
123128
ItemStack current = inventory.getItem(i);
124129
ItemStack next = inventory.getItem(i + 1);
125130

0 commit comments

Comments
 (0)