-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Anvil-Dev:releases/1.20.1' into releases/1.20.1
- Loading branch information
Showing
72 changed files
with
1,947 additions
and
203 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
common/src/main/java/dev/dubhe/anvilcraft/block/MeltGemCauldron.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,29 @@ | ||
package dev.dubhe.anvilcraft.block; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.cauldron.CauldronInteraction; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.AbstractCauldronBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
public class MeltGemCauldron extends AbstractCauldronBlock { | ||
|
||
public MeltGemCauldron(Properties properties) { | ||
super(properties, CauldronInteraction.EMPTY); | ||
} | ||
|
||
@Override | ||
protected double getContentHeight(BlockState state) { | ||
return 0.9375; | ||
} | ||
|
||
@Override | ||
public boolean isFull(BlockState state) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos) { | ||
return 3; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/HeaterRecipesLoader.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,50 @@ | ||
package dev.dubhe.anvilcraft.data.generator.recipe; | ||
|
||
import com.tterrag.registrate.providers.RegistrateRecipeProvider; | ||
import dev.dubhe.anvilcraft.AnvilCraft; | ||
import dev.dubhe.anvilcraft.data.generator.AnvilCraftDatagen; | ||
import dev.dubhe.anvilcraft.data.recipe.anvil.AnvilRecipe; | ||
import dev.dubhe.anvilcraft.init.ModBlocks; | ||
import net.minecraft.data.recipes.RecipeCategory; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.phys.Vec3; | ||
|
||
import java.util.Map; | ||
|
||
import static dev.dubhe.anvilcraft.api.power.IPowerComponent.OVERLOAD; | ||
|
||
public class HeaterRecipesLoader { | ||
/** | ||
* 初始化加热器配方 | ||
* | ||
* @param provider 提供器 | ||
*/ | ||
public static void init(RegistrateRecipeProvider provider) { | ||
AnvilRecipe.Builder.create(RecipeCategory.MISC) | ||
.icon(Items.EMERALD_BLOCK) | ||
.hasBlock(ModBlocks.HEATER.get(), new Vec3(0, -2, 0), Map.entry(OVERLOAD, false)) | ||
.hasBlockIngredient(new Vec3(0, -1, 0), Blocks.CAULDRON) | ||
.hasItemIngredient( | ||
new Vec3(0, -1, 0), | ||
Items.EMERALD_BLOCK, | ||
ModBlocks.RUBY_BLOCK, | ||
ModBlocks.TOPAZ_BLOCK, | ||
ModBlocks.SAPPHIRE_BLOCK | ||
) | ||
.setBlock(new Vec3(0, -1, 0), ModBlocks.MELT_GEM_CAULDRON.get()) | ||
.unlockedBy( | ||
AnvilCraftDatagen.hasItem(Items.EMERALD_BLOCK), AnvilCraftDatagen.has(Items.EMERALD_BLOCK) | ||
) | ||
.unlockedBy( | ||
AnvilCraftDatagen.hasItem(ModBlocks.RUBY_BLOCK), AnvilCraftDatagen.has(ModBlocks.RUBY_BLOCK) | ||
) | ||
.unlockedBy( | ||
AnvilCraftDatagen.hasItem(ModBlocks.TOPAZ_BLOCK), AnvilCraftDatagen.has(ModBlocks.TOPAZ_BLOCK) | ||
) | ||
.unlockedBy( | ||
AnvilCraftDatagen.hasItem(ModBlocks.SAPPHIRE_BLOCK), AnvilCraftDatagen.has(ModBlocks.SAPPHIRE_BLOCK) | ||
) | ||
.save(provider, AnvilCraft.of("heating/melt_gem_cauldron")); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
common/src/main/resources/assets/anvilcraft/blockstates/melt_gem_cauldron.json
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,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "anvilcraft:block/melt_gem_cauldron" | ||
} | ||
} | ||
} |
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
Oops, something went wrong.