-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added volatile conjured blocks, finished documentation of lamp
- Loading branch information
1 parent
9a8b23a
commit 825a2e4
Showing
13 changed files
with
120 additions
and
23 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
common/src/main/java/miyucomics/hexical/blocks/ConjuredVolatileBlock.kt
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,32 @@ | ||
package miyucomics.hexical.blocks | ||
|
||
import miyucomics.hexical.generics.GenericConjuredBlock | ||
import miyucomics.hexical.registry.HexicalBlocks | ||
import net.minecraft.block.BlockState | ||
import net.minecraft.block.Blocks | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.sound.SoundCategory | ||
import net.minecraft.sound.SoundEvents | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.util.math.Vec3i | ||
import net.minecraft.world.World | ||
|
||
class ConjuredVolatileBlock : GenericConjuredBlock<ConjuredVolatileBlockEntity>(baseMaterial(), ConjuredVolatileBlockEntity::init) { | ||
private val offsets: List<Vec3i> = listOf( | ||
Vec3i(-1, 0, 0), Vec3i(1, 0, 0), | ||
Vec3i(0, -1, 0), Vec3i(0, 1, 0), | ||
Vec3i(0, 0, -1), Vec3i(0, 0, 1), | ||
) | ||
|
||
override fun onBreak(world: World, position: BlockPos, state: BlockState, player: PlayerEntity) { | ||
world.setBlockState(position, Blocks.AIR.defaultState) | ||
world.playSound(position.x.toDouble(), position.y.toDouble(), position.z.toDouble(), SoundEvents.BLOCK_AMETHYST_BLOCK_BREAK, SoundCategory.BLOCKS, 1f, 1f, true) | ||
for (offset in offsets) { | ||
val positionToTest = position.add(offset); | ||
val otherState = world.getBlockState(positionToTest) | ||
val block = otherState.block | ||
if (block == HexicalBlocks.CONJURED_VOLATILE_BLOCK) | ||
block.onBreak(world, positionToTest, otherState, player) | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
common/src/main/java/miyucomics/hexical/blocks/ConjuredVolatileBlockEntity.kt
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,15 @@ | ||
package miyucomics.hexical.blocks | ||
|
||
import miyucomics.hexical.generics.GenericConjuredBlockEntity | ||
import miyucomics.hexical.registry.HexicalBlocks | ||
import net.minecraft.block.BlockState | ||
import net.minecraft.block.entity.BlockEntityType | ||
import net.minecraft.util.math.BlockPos | ||
|
||
class ConjuredVolatileBlockEntity(type: BlockEntityType<ConjuredVolatileBlockEntity>, pos: BlockPos?, state: BlockState?) : GenericConjuredBlockEntity<ConjuredVolatileBlockEntity>(pos, state, type) { | ||
companion object { | ||
fun init (pos: BlockPos?, state: BlockState?): ConjuredVolatileBlockEntity { | ||
return ConjuredVolatileBlockEntity(HexicalBlocks.CONJURED_VOLATILE_BLOCK_ENTITY, pos, state) | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
common/src/main/resources/assets/hexical/models/item/conjured_volatile_block.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "minecraft:item/amethyst_shard" | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
...ta/hexical/patchouli_books/hexicalbook/en_us/entries/hexomancy/conjure_falling_block.json
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...a/hexical/patchouli_books/hexicalbook/en_us/entries/hexomancy/conjure_volatile_block.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,15 @@ | ||
{ | ||
"name": "hexcasting.spell.hexical:conjure_volatile_block", | ||
"icon": "minecraft:scaffolding", | ||
"category": "hexical:hexical", | ||
"pages": [ | ||
{ | ||
"type": "hexcasting:pattern", | ||
"op_id": "hexical:conjure_volatile_block", | ||
"anchor": "hexical:conjure_volatile_block", | ||
"input": "vec", | ||
"output": "", | ||
"text": "hexical.page.conjure_volatile_block" | ||
} | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
...n/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/lamp/master_lamps.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,16 @@ | ||
{ | ||
"name": "hexical.page.master_lamps", | ||
"icon": "hexical:lamp", | ||
"category": "hexical:lamp", | ||
"sortnum": 3, | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "hexical.page.master_lamps.1" | ||
}, | ||
{ | ||
"type": "patchouli:text", | ||
"text": "hexical.page.master_lamps.2" | ||
} | ||
] | ||
} |
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
16 changes: 16 additions & 0 deletions
16
...sources/data/hexical/patchouli_books/hexicalbook/en_us/entries/lamp/replacement_mind.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,16 @@ | ||
{ | ||
"name": "hexical.page.replacement_mind", | ||
"icon": "minecraft:textures/particle/soul_7.png", | ||
"category": "hexical:lamp", | ||
"sortnum": 2, | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "hexical.page.replacement_mind.1" | ||
}, | ||
{ | ||
"type": "patchouli:text", | ||
"text": "hexical.page.replacement_mind.2" | ||
} | ||
] | ||
} |