Skip to content

Commit

Permalink
Merge branch 'Gu-ZT:releases/1.20.1' into releases/1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BOTXue authored Apr 12, 2024
2 parents 240712b + 0b835d3 commit c55075b
Show file tree
Hide file tree
Showing 88 changed files with 1,359 additions and 754 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ public class AnvilCraftConfig implements ConfigData {
@ConfigEntry.BoundedDiscrete(max = 8, min = 1)
@SerializedName("Geode Search Interval")
public int geodeInterval = 4;

@Comment("The search cooldown of the geode (in seconds)")
@ConfigEntry.Gui.Tooltip
@ConfigEntry.BoundedDiscrete(max = 30, min = 5)
@SerializedName("Geode Search Cooldown")
public int geodeCooldown = 5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static void init(RegistrateRecipeProvider provider) {
bulging(ModItems.FLOUR.get(), ModItems.DOUGH.get(), provider);
bulging(ModItems.BARK.get(), ModItems.PULP.get(), provider);
bulging(ModItems.SPONGE_GEMMULE.get(), Items.WET_SPONGE, provider);
crystallize(ModItems.SEA_HEART_SHELL_SHARD.get(), ModItems.PRISMARINE_CLUSTER.get(),provider);

Check warning on line 33 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/BulgingAndCrystallizeRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/BulgingAndCrystallizeRecipesLoader.java#L33 <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck>

',' is not followed by whitespace.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/BulgingAndCrystallizeRecipesLoader.java:33:92: warning: ',' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)
}

private static void bulging(Item item, Item item1, RegistrateRecipeProvider provider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public static void init(RegistrateRecipeProvider provider) {
SmashRecipesLoader.init(provider);
SqueezeRecipesLoader.init(provider);
StampingRecipesLoader.init(provider);

TimeWarpRecipesLoader.init(provider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ public static void init(RegistrateRecipeProvider provider) {
.spawnItem(new Vec3(0.0, -0.75, 0.0), ModItems.COCOA_POWDER)
.unlockedBy(AnvilCraftDatagen.hasItem(Items.COCOA_BEANS), AnvilCraftDatagen.has(Items.COCOA_BEANS))
.save(provider, AnvilCraft.of("stamping/cocoa"));
AnvilRecipe.Builder.create(RecipeCategory.MISC)
.hasBlock(ModBlocks.STAMPING_PLATFORM.get())
.hasItemIngredient(new Vec3(0.0, -0.75, 0.0), Items.HEART_OF_THE_SEA)
.spawnItem(new Vec3(0.0, -0.75, 0.0), ModItems.SEA_HEART_SHELL_SHARD,3)

Check warning on line 35 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L35 <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck>

',' is not followed by whitespace.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:35:85: warning: ',' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)
.spawnItem(new Vec3(0.0, -0.75, 0.0), 0.5,ModItems.SEA_HEART_SHELL_SHARD)

Check warning on line 36 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L36 <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck>

',' is not followed by whitespace.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:36:58: warning: ',' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)
.spawnItem(new Vec3(0.0, -0.75, 0.0), 0.5,ModItems.SEA_HEART_SHELL_SHARD)

Check warning on line 37 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L37 <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck>

',' is not followed by whitespace.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:37:58: warning: ',' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)
.spawnItem(new Vec3(0.0, -0.75, 0.0), ModItems.SAPPHIRE)
.unlockedBy(AnvilCraftDatagen.hasItem(Items.HEART_OF_THE_SEA), AnvilCraftDatagen.has(Items.HEART_OF_THE_SEA))

Check warning on line 39 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L39 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>

Line is longer than 120 characters (found 125).
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:39:0: warning: Line is longer than 120 characters (found 125). (com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck)
.save(provider, AnvilCraft.of("stamping/sea_heart_shell_shard"));
AnvilRecipe.Builder.create(RecipeCategory.MISC)
.hasBlock(ModBlocks.STAMPING_PLATFORM.get())
.hasItemIngredient(new Vec3(0.0, -0.75, 0.0), ModItems.PRISMARINE_CLUSTER)
.spawnItem(new Vec3(0.0, -0.75, 0.0),0.15, ModItems.PRISMARINE_BLADE)

Check warning on line 44 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L44 <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck>

',' is not followed by whitespace.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:44:53: warning: ',' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)
.spawnItem(new Vec3(0.0, -0.75, 0.0), Items.PRISMARINE_CRYSTALS,2)

Check warning on line 45 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L45 <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck>

',' is not followed by whitespace.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:45:80: warning: ',' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)
.spawnItem(new Vec3(0.0, -0.75, 0.0), 0.5, Items.PRISMARINE_CRYSTALS)
.spawnItem(new Vec3(0.0, -0.75, 0.0), Items.PRISMARINE_SHARD)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.PRISMARINE_CLUSTER.get()), AnvilCraftDatagen.has(ModItems.PRISMARINE_CLUSTER))

Check warning on line 48 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L48 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>

Line is longer than 120 characters (found 141).
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:48:0: warning: Line is longer than 120 characters (found 141). (com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck)
.save(provider, AnvilCraft.of("stamping/prismarine_blade"));
}

public static void stamping(Item item, Item item1, RegistrateRecipeProvider provider) {

Check warning on line 52 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java#L52 <com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck>

Missing a Javadoc comment.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/StampingRecipesLoader.java:52:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 dev.dubhe.anvilcraft.init.ModItems;
import java.util.Map;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LayeredCauldronBlock;
import net.minecraft.world.phys.Vec3;

public class TimeWarpRecipesLoader {
public static void init(RegistrateRecipeProvider provider) {

Check warning on line 16 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/TimeWarpRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/TimeWarpRecipesLoader.java#L16 <com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck>

Missing a Javadoc comment.
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/TimeWarpRecipesLoader.java:16:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)
AnvilRecipe.Builder.create(RecipeCategory.MISC)
.icon(ModItems.SEA_HEART_SHELL)
.hasBlock(ModBlocks.CORRUPTED_BEACON.get(), new Vec3(0.0, -2.0, 0.0))
.hasBlock(Blocks.WATER_CAULDRON, new Vec3(0.0, -1.0, 0.0), Map.entry(LayeredCauldronBlock.LEVEL, 3))
.hasItemIngredient(new Vec3(0.0, -1.0, 0.0), ModItems.SEA_HEART_SHELL_SHARD)
.spawnItem(new Vec3(0.0, -1.0, 0.0), ModItems.SEA_HEART_SHELL)
.setBlock(Blocks.CAULDRON.defaultBlockState())
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.SEA_HEART_SHELL_SHARD.get()), AnvilCraftDatagen.has(ModItems.SEA_HEART_SHELL_SHARD))

Check warning on line 24 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/TimeWarpRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/TimeWarpRecipesLoader.java#L24 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>

Line is longer than 120 characters (found 143).
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/TimeWarpRecipesLoader.java:24:0: warning: Line is longer than 120 characters (found 143). (com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck)
.save(provider, AnvilCraft.of("timewarp/sea_heart_shell"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ public static void init(RegistrateRecipeProvider provider) {
.unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_BLOCK), AnvilCraftDatagen.has(Items.IRON_BLOCK))
.unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_INGOT), AnvilCraftDatagen.has(Items.IRON_INGOT))
.save(provider);
ShapedRecipeBuilder.shaped(RecipeCategory.COMBAT, Items.TRIDENT)
.pattern(" AA")
.pattern(" BA")
.pattern("B ")
.define('A', ModItems.PRISMARINE_BLADE)
.define('B', Items.PRISMARINE_BRICKS)
.unlockedBy("hasitem", AnvilCraftDatagen.has(ModItems.PRISMARINE_BLADE))
.save(provider);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.HEART_OF_THE_SEA)
.pattern("A")
.pattern("B")
.pattern("A")
.define('A', ModItems.SEA_HEART_SHELL)
.define('B', ModItems.SAPPHIRE)
.unlockedBy("hasitem", AnvilCraftDatagen.has(ModItems.SEA_HEART_SHELL))
.save(provider);

SimpleCookingRecipeBuilder.campfireCooking(Ingredient.of(ModItemTags.DOUGH), RecipeCategory.FOOD, Items.BREAD, 0.35f, 600)

Check warning on line 64 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/VanillaRecipesLoader.java

View workflow job for this annotation

GitHub Actions / Checkstyle

[Checkstyle] common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/VanillaRecipesLoader.java#L64 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>

Line is longer than 120 characters (found 130).
Raw output
/home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/VanillaRecipesLoader.java:64:0: warning: Line is longer than 120 characters (found 130). (com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.DOUGH.get()), AnvilCraftDatagen.has(ModItems.DOUGH))
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/java/dev/dubhe/anvilcraft/init/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ public class ModBlocks {
.block("resin_block", SlimeBlock::new)
.initialProperties(() -> Blocks.SLIME_BLOCK)
.blockstate((ctx, provider) -> {
provider.simpleBlock(ctx.get());
provider.models().cubeAll(ctx.getName(), provider.modLoc("block/" + ctx.getName())).renderType("translucent");
})
.properties(properties -> properties.sound(SoundType.HONEY_BLOCK))
.simpleItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public class ModItemGroups {
entries.accept(ModItems.RESIN.get().getDefaultInstance());
entries.accept(ModItems.AMBER.get().getDefaultInstance());
entries.accept(ModItems.SPONGE_GEMMULE.get().getDefaultInstance());
entries.accept(ModItems.SEA_HEART_SHELL_SHARD.get().getDefaultInstance());
entries.accept(ModItems.SEA_HEART_SHELL.get().getDefaultInstance());
entries.accept(ModItems.PRISMARINE_CLUSTER.get().getDefaultInstance());
entries.accept(ModItems.PRISMARINE_BLADE.get().getDefaultInstance());
entries.accept(ModItems.COCOA_LIQUOR.get().getDefaultInstance());
entries.accept(ModItems.COCOA_BUTTER.get().getDefaultInstance());
entries.accept(ModItems.COCOA_POWDER.get().getDefaultInstance());
Expand Down
37 changes: 31 additions & 6 deletions common/src/main/java/dev/dubhe/anvilcraft/init/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,23 @@ public void appendHoverText(@NotNull ItemStack stack, @Nullable Level level, @No
.pattern("AAA")
.pattern("AAA")
.define('A', ModItems.ROYAL_STEEL_NUGGET)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.ROYAL_STEEL_NUGGET.get()), AnvilCraftDatagen.has(ModItems.ROYAL_STEEL_NUGGET))
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.ROYAL_STEEL_NUGGET.get()),
AnvilCraftDatagen.has(ModItems.ROYAL_STEEL_NUGGET))
.save(provider, AnvilCraft.of("royal_steel_ingot_from_royal_steel_nugget"));
})
.register();
public static final ItemEntry<Item> ROYAL_STEEL_NUGGET = REGISTRATE
.item("royal_steel_nugget", Item::new)
.recipe((ctx, provider) -> ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ctx.get(), 9)
.requires(ModItems.ROYAL_STEEL_INGOT)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.ROYAL_STEEL_NUGGET.get()), AnvilCraftDatagen.has(ModItems.ROYAL_STEEL_NUGGET))
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.ROYAL_STEEL_NUGGET.get()),
AnvilCraftDatagen.has(ModItems.ROYAL_STEEL_NUGGET))
.save(provider)
)
.register();
public static final ItemEntry<? extends Item> ROYAL_STEEL_PICKAXE = REGISTRATE
.item("royal_steel_pickaxe", properties -> new PickaxeItem(Tiers.DIAMOND, 1, -2.8f, properties.durability(2559)) {
.item("royal_steel_pickaxe", properties -> new PickaxeItem(Tiers.DIAMOND, 1, -2.8f,
properties.durability(2559)) {
@Override
public @NotNull ItemStack getDefaultInstance() {
return super.getDefaultInstance();
Expand All @@ -364,22 +367,25 @@ public void appendHoverText(@NotNull ItemStack stack, @Nullable Level level, @No
.recipe((ctx, provider) -> {
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ctx.get(), 9)
.requires(ModBlocks.CURSED_GOLD_BLOCK)
.unlockedBy(AnvilCraftDatagen.hasItem(ModBlocks.CURSED_GOLD_BLOCK.asItem()), AnvilCraftDatagen.has(ModBlocks.CURSED_GOLD_BLOCK))
.unlockedBy(AnvilCraftDatagen.hasItem(ModBlocks.CURSED_GOLD_BLOCK.asItem()),
AnvilCraftDatagen.has(ModBlocks.CURSED_GOLD_BLOCK))
.save(provider, AnvilCraft.of("craft/cursed_gold_ingot_1"));
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ctx.get())
.pattern("AAA")
.pattern("AAA")
.pattern("AAA")
.define('A', ModItems.CURSED_GOLD_NUGGET)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.CURSED_GOLD_NUGGET.get()), AnvilCraftDatagen.has(ModItems.CURSED_GOLD_NUGGET))
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.CURSED_GOLD_NUGGET.get()),
AnvilCraftDatagen.has(ModItems.CURSED_GOLD_NUGGET))
.save(provider, AnvilCraft.of("craft/cursed_gold_ingot_2"));
})
.register();
public static final ItemEntry<CursedItem> CURSED_GOLD_NUGGET = REGISTRATE
.item("cursed_gold_nugget", CursedItem::new)
.recipe((ctx, provider) -> ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ctx.get(), 9)
.requires(ModItems.CURSED_GOLD_INGOT)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.CURSED_GOLD_INGOT.get()), AnvilCraftDatagen.has(ModItems.CURSED_GOLD_INGOT))
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.CURSED_GOLD_INGOT.get()),
AnvilCraftDatagen.has(ModItems.CURSED_GOLD_INGOT))
.save(provider))
.register();
public static final ItemEntry<TopazItem> TOPAZ = REGISTRATE
Expand Down Expand Up @@ -425,10 +431,29 @@ public void appendHoverText(@NotNull ItemStack stack, @Nullable Level level, @No
.save(provider)
)
.register();
public static final ItemEntry<Item> PRISMARINE_BLADE = REGISTRATE
.item("prismarine_blade", Item::new)
.register();
public static final ItemEntry<Item> PRISMARINE_CLUSTER = REGISTRATE
.item("prismarine_cluster", Item::new)
.register();
public static final ItemEntry<Item> SEA_HEART_SHELL = REGISTRATE
.item("sea_heart_shell", Item::new)
.register();
public static final ItemEntry<Item> SEA_HEART_SHELL_SHARD = REGISTRATE
.item("sea_heart_shell_shard", Item::new)
.register();
public static final ItemEntry<AnvilHammerItem> ANVIL_HAMMER = REGISTRATE
.item("anvil_hammer", properties -> new AnvilHammerItem(properties.durability(35)))
.model((ctx, provider) -> {
})
.recipe((ctx, provider) -> ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get())
.pattern("A")
.pattern("B")
.define('A', Items.ANVIL)
.define('B', Items.LIGHTNING_ROD)
.unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.LIGHTNING_ROD))
.save(provider))
.register();

public static void register() {
Expand Down
9 changes: 7 additions & 2 deletions common/src/main/java/dev/dubhe/anvilcraft/item/GeodeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ public GeodeItem(Properties properties) {
}

@Override
public @NotNull InteractionResultHolder<ItemStack> use(Level level, Player player, @NotNull InteractionHand usedHand) {
public @NotNull InteractionResultHolder<ItemStack> use(
@NotNull Level level,
@NotNull Player player,
@NotNull InteractionHand usedHand
) {
ItemStack itemStack = player.getItemInHand(usedHand);
BlockPos pos = player.getOnPos().below();
player.getCooldowns().addCooldown(itemStack.getItem(), AnvilCraft.config.geodeCooldown * 20);
if (!level.isClientSide) return InteractionResultHolder.success(itemStack);
int interval = AnvilCraft.config.geodeInterval;
int radius = AnvilCraft.config.geodeRadius;
Expand All @@ -32,7 +37,7 @@ public GeodeItem(Properties properties) {
for (int y = level.getMinBuildHeight(); y <= height; y += interval) {
BlockPos offsetPos = pos.offset(x, y, z);
BlockState state = level.getBlockState(offsetPos);
if(!state.is(BlockTags.CRYSTAL_SOUND_BLOCKS)) continue;
if (!state.is(BlockTags.CRYSTAL_SOUND_BLOCKS)) continue;
BlockHighlightUtil.highlightBlock(level, offsetPos);
break;
}
Expand Down
12 changes: 9 additions & 3 deletions common/src/main/java/dev/dubhe/anvilcraft/item/MagnetItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ public MagnetItem(Properties properties) {
}

@Override
public @NotNull InteractionResultHolder<ItemStack> use(@NotNull Level level, @NotNull Player player, InteractionHand usedHand) {
public @NotNull InteractionResultHolder<ItemStack> use(
@NotNull Level level,
@NotNull Player player,
@NotNull InteractionHand usedHand
) {
ItemStack item = player.getItemInHand(usedHand);
double radius = AnvilCraft.config.magnetItemAttractsRadius;
AABB aabb = new AABB(player.position().add(-radius, -radius, -radius), player.position().add(radius, radius, radius));
level.getEntities(EntityTypeTest.forClass(ItemEntity.class), aabb, Entity::isAlive).forEach(e -> e.moveTo(player.position()));
AABB aabb = new AABB(player.position().add(-radius, -radius, -radius), player.position()
.add(radius, radius, radius));
level.getEntities(EntityTypeTest.forClass(ItemEntity.class), aabb, Entity::isAlive)
.forEach(e -> e.moveTo(player.position()));
item.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(usedHand));
return InteractionResultHolder.sidedSuccess(item, level.isClientSide());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"credit": "Made by XeKr with Blockbench",
"parent": "minecraft:block/block",
"render_type": "minecraft:translucent",
"textures": {
"0": "anvilcraft:block/resin_block",
"particle": "anvilcraft:block/resin_block"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@
"item.anvilcraft.nether_star_shard": "pɹɐɥS ɹɐʇS ɹǝɥʇǝN",
"item.anvilcraft.netherite_coil": "ןıoƆ ǝʇıɹǝɥʇǝN",
"item.anvilcraft.netherite_core": "ǝɹoƆ ǝʇıɹǝɥʇǝN",
"item.anvilcraft.prismarine_blade": "ǝpɐןᗺ ǝuıɹɐɯsıɹԀ",
"item.anvilcraft.prismarine_cluster": "ɹǝʇsnןƆ ǝuıɹɐɯsıɹԀ",
"item.anvilcraft.pulp": "dןnԀ",
"item.anvilcraft.resin": "uısǝᴚ",
"item.anvilcraft.royal_steel_ingot": "ʇobuI ןǝǝʇS ןɐʎoᴚ",
"item.anvilcraft.royal_steel_nugget": "ʇǝbbnN ןǝǝʇS ןɐʎoᴚ",
"item.anvilcraft.royal_steel_pickaxe": "ǝxɐʞɔıԀ ןǝǝʇS ןɐʎoᴚ",
"item.anvilcraft.ruby": "ʎqnᴚ",
"item.anvilcraft.sapphire": "ǝɹıɥddɐS",
"item.anvilcraft.sea_heart_shell": "ןןǝɥS ʇɹɐǝH ɐǝS",
"item.anvilcraft.sea_heart_shell_shard": "pɹɐɥS ןןǝɥS ʇɹɐǝH ɐǝS",
"item.anvilcraft.sponge_gemmule": "ǝןnɯɯǝ⅁ ǝbuodS",
"item.anvilcraft.topaz": "zɐdo⟘",
"item.anvilcraft.utusan": "uɐsnʇ∩",
Expand Down Expand Up @@ -92,6 +96,8 @@
"text.autoconfig.anvilcraft.option.autoCrafterCooldown.@Tooltip": ")sʞɔıʇ uı( ɹǝʇɟɐɹɔ oʇnɐ ɟo ǝɯıʇ uʍopןooɔ ɯnɯıxɐW",
"text.autoconfig.anvilcraft.option.chuteMaxCooldown": "uʍopןooƆ xɐW ǝʇnɥƆ",
"text.autoconfig.anvilcraft.option.chuteMaxCooldown.@Tooltip": ")sʞɔıʇ uı( ǝʇnɥɔ ɟo ǝɯıʇ uʍopןooɔ ɯnɯıxɐW",
"text.autoconfig.anvilcraft.option.geodeCooldown": "uʍopןooƆ ɥɔɹɐǝS ǝpoǝ⅁",
"text.autoconfig.anvilcraft.option.geodeCooldown.@Tooltip": ")spuoɔǝs uı( ǝpoǝb ǝɥʇ ɟo uʍopןooɔ ɥɔɹɐǝs ǝɥ⟘",
"text.autoconfig.anvilcraft.option.geodeInterval": "ןɐʌɹǝʇuI ɥɔɹɐǝS ǝpoǝ⅁",
"text.autoconfig.anvilcraft.option.geodeInterval.@Tooltip": "ǝpoǝb ǝɥʇ ɟo ןɐʌɹǝʇuı ɥɔɹɐǝs ǝɥ⟘",
"text.autoconfig.anvilcraft.option.geodeRadius": "snıpɐᴚ ɥɔɹɐǝS ɯnɯıxɐW ǝpoǝ⅁",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@
"item.anvilcraft.nether_star_shard": "Nether Star Shard",
"item.anvilcraft.netherite_coil": "Netherite Coil",
"item.anvilcraft.netherite_core": "Netherite Core",
"item.anvilcraft.prismarine_blade": "Prismarine Blade",
"item.anvilcraft.prismarine_cluster": "Prismarine Cluster",
"item.anvilcraft.pulp": "Pulp",
"item.anvilcraft.resin": "Resin",
"item.anvilcraft.royal_steel_ingot": "Royal Steel Ingot",
"item.anvilcraft.royal_steel_nugget": "Royal Steel Nugget",
"item.anvilcraft.royal_steel_pickaxe": "Royal Steel Pickaxe",
"item.anvilcraft.ruby": "Ruby",
"item.anvilcraft.sapphire": "Sapphire",
"item.anvilcraft.sea_heart_shell": "Sea Heart Shell",
"item.anvilcraft.sea_heart_shell_shard": "Sea Heart Shell Shard",
"item.anvilcraft.sponge_gemmule": "Sponge Gemmule",
"item.anvilcraft.topaz": "Topaz",
"item.anvilcraft.utusan": "Utusan",
Expand Down Expand Up @@ -92,6 +96,8 @@
"text.autoconfig.anvilcraft.option.autoCrafterCooldown.@Tooltip": "Maximum cooldown time of auto crafter (in ticks)",
"text.autoconfig.anvilcraft.option.chuteMaxCooldown": "Chute Max Cooldown",
"text.autoconfig.anvilcraft.option.chuteMaxCooldown.@Tooltip": "Maximum cooldown time of chute (in ticks)",
"text.autoconfig.anvilcraft.option.geodeCooldown": "Geode Search Cooldown",
"text.autoconfig.anvilcraft.option.geodeCooldown.@Tooltip": "The search cooldown of the geode (in seconds)",
"text.autoconfig.anvilcraft.option.geodeInterval": "Geode Search Interval",
"text.autoconfig.anvilcraft.option.geodeInterval.@Tooltip": "The search interval of the geode",
"text.autoconfig.anvilcraft.option.geodeRadius": "Geode Maximum Search Radius",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "anvilcraft:item/prismarine_blade"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "anvilcraft:item/prismarine_cluster"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "anvilcraft:item/sea_heart_shell"
}
}
Loading

0 comments on commit c55075b

Please sign in to comment.