diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e deleted file mode 100644 index d2709bb..0000000 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ /dev/null @@ -1,3 +0,0 @@ -// 1.21 2024-10-20T19:33:33.17977085 Recipes -2e6980f416efa1142b6278a6b8f6f4e3f7539d06 data/arcanus/advancement/recipes/test_recipe2.json -ae1039b108ce9a89255b16c55eda4a3903cea6df data/arcanus/recipe/test_recipe2.json diff --git a/src/generated/resources/data/arcanus/advancement/recipes/test_recipe2.json b/src/generated/resources/data/arcanus/advancement/recipes/test_recipe2.json deleted file mode 100644 index 4aa9907..0000000 --- a/src/generated/resources/data/arcanus/advancement/recipes/test_recipe2.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_the_recipe": { - "conditions": { - "recipe": "arcanus:test_recipe2" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "arcanus:test_recipe2" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/arcanus/recipe/test_recipe2.json b/src/generated/resources/data/arcanus/recipe/test_recipe2.json deleted file mode 100644 index 5f9dc46..0000000 --- a/src/generated/resources/data/arcanus/recipe/test_recipe2.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "type": "arcanus:ritual", - "ingredients": [ - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "minecraft:diamond" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - }, - { - "count": 1, - "id": "arcanus:air" - } - ], - "result": { - "count": 1, - "id": "minecraft:netherite_ingot" - } -} \ No newline at end of file diff --git a/src/main/java/org/styly/arcanus/Arcanus.java b/src/main/java/org/styly/arcanus/Arcanus.java index 2a6c86f..738cbc2 100644 --- a/src/main/java/org/styly/arcanus/Arcanus.java +++ b/src/main/java/org/styly/arcanus/Arcanus.java @@ -10,7 +10,6 @@ import org.slf4j.Logger; import org.styly.arcanus.events.CancelSpell; import org.styly.arcanus.events.RegisterISSslot; -import org.styly.arcanus.events.RegisterRecipes; import org.styly.arcanus.events.ServerPlayerEvents; import org.styly.arcanus.registry.*; diff --git a/src/main/java/org/styly/arcanus/block/RitualBlock.java b/src/main/java/org/styly/arcanus/block/RitualBlock.java index b74408e..ee6e739 100644 --- a/src/main/java/org/styly/arcanus/block/RitualBlock.java +++ b/src/main/java/org/styly/arcanus/block/RitualBlock.java @@ -7,6 +7,8 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LightningBolt; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -26,6 +28,7 @@ import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; import org.styly.arcanus.Arcanus; import org.styly.arcanus.recipe.RitualRecipe; @@ -179,6 +182,7 @@ public ItemInteractionResult useItemOn(ItemStack pStack, BlockState state, Level if(result!=ItemStack.EMPTY) { ritualTile.setHeldItem(result); clearPedestals(pLevel,pos); + spawnLightning(pLevel,pos); } } @@ -238,6 +242,61 @@ public static void clearPedestals(Level pLevel, BlockPos pos){ Objects.requireNonNull((PedestalTile) pLevel.getBlockEntity(blockPos)).setHeldItem(ItemStack.EMPTY); } } + public static void spawnLightning(Level pLevel, BlockPos pos){ + int level = getLevel(pLevel,pos); + ArrayList poss= new ArrayList<>(); + poss.add(pos); + if(level==1){ + poss.add( new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ() - 3)); + poss.add(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ() - 3)); + + poss.add(new BlockPos(pos.getX() - 3, pos.getY(), pos.getZ() - 1)); + poss.add(new BlockPos(pos.getX() + 3, pos.getY(), pos.getZ() - 1)); + + + poss.add(new BlockPos(pos.getX() - 3, pos.getY(), pos.getZ() + 1)); + poss.add(new BlockPos(pos.getX() + 3, pos.getY(), pos.getZ() + 1)); + + poss.add(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ() + 3)); + poss.add(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ() + 3)); + } else if (level==2){ + poss.add( new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ() - 3)); + poss.add(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ() - 3)); + + poss.add(new BlockPos(pos.getX() - 3, pos.getY(), pos.getZ() - 1)); + poss.add(new BlockPos(pos.getX() + 3, pos.getY(), pos.getZ() - 1)); + + + poss.add(new BlockPos(pos.getX() - 3, pos.getY(), pos.getZ() + 1)); + poss.add(new BlockPos(pos.getX() + 3, pos.getY(), pos.getZ() + 1)); + + poss.add(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ() + 3)); + poss.add(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ() + 3)); + + poss.add(new BlockPos(pos.getX() - 4, pos.getY(), pos.getZ() - 4)); //t2 + poss.add(new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 5)); //t2 + poss.add(new BlockPos(pos.getX() + 4, pos.getY(), pos.getZ() - 4)); //t2 + + poss.add(new BlockPos(pos.getX() - 5, pos.getY(), pos.getZ())); //t2 + poss.add(new BlockPos(pos.getX() + 5, pos.getY(), pos.getZ())); //t2 + + poss.add( new BlockPos(pos.getX() - 4, pos.getY(), pos.getZ() + 4)); //t2 + poss.add( new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 5)); //t2 + poss.add( new BlockPos(pos.getX() + 4, pos.getY(), pos.getZ() + 4)); //t2 + + + + } + for (BlockPos blockPos : poss) { + LightningBolt entity = EntityType.LIGHTNING_BOLT.create(pLevel); + assert entity != null; + entity.setPos(new Vec3(blockPos.getX(),blockPos.getY(),blockPos.getZ())); + entity.setDamage(50); + entity.setVisualOnly(true); + pLevel.addFreshEntity(entity); + + } + } public static boolean IsValid(Level pLevel, @NotNull BlockPos pos) { BlockPos b0 = new BlockPos(pos.getX(), pos.getY(), pos.getZ()); //center aka result!