EXPLOSIVE RUNES
This commit is contained in:
parent
b17c304dc9
commit
585031ab79
30 changed files with 1704 additions and 6 deletions
|
@ -4,6 +4,7 @@ aed50918bad8a7b00cd26e45d67eb509a04c9f6c assets/hexcasting/blockstates/amethyst_
|
|||
27cedb7c1bb8fe4bc1c9b0ecb69678999ca08377 assets/hexcasting/blockstates/ancient_scroll_paper.json
|
||||
080fce1ae9fb8eeb7fc0cb7ad0a2db05b2ca3dc5 assets/hexcasting/blockstates/ancient_scroll_paper_lantern.json
|
||||
4d62b41c90cb0c5b94697e151c4aad964fb56727 assets/hexcasting/blockstates/empty_impetus.json
|
||||
9576c8f1813ad7dac658a7438e6ec99faff8748b assets/hexcasting/blockstates/impetus_look.json
|
||||
8d7c7bfdca1def0205714465422d327dbcc00539 assets/hexcasting/blockstates/impetus_rightclick.json
|
||||
1c138caef4d5964cba77dc2b5dc3febe28ab65b7 assets/hexcasting/blockstates/scroll_paper.json
|
||||
77e723163f415795437b810fe87c348c96a989be assets/hexcasting/blockstates/scroll_paper_lantern.json
|
||||
|
@ -25,6 +26,18 @@ a9d44cb1769f8b434c842004efff40f511fba98b assets/hexcasting/models/block/empty_im
|
|||
384ff24868e37611c32237320e5309462a4cde63 assets/hexcasting/models/block/empty_impetus_lit_south.json
|
||||
2d175aaca651b51d89c935a202af2eb1e4b942c2 assets/hexcasting/models/block/empty_impetus_lit_up.json
|
||||
04f99f505b02cc09298b6580e0ebaef79071a418 assets/hexcasting/models/block/empty_impetus_lit_west.json
|
||||
ec77ba9e9f1be4f8830e6e26fe58fbffef0d160a assets/hexcasting/models/block/impetus_look_dim_down.json
|
||||
094edbbb04c331f61551c59470c7032510235426 assets/hexcasting/models/block/impetus_look_dim_east.json
|
||||
e60cb9f02d067b79f51525cdb079e007cde87c67 assets/hexcasting/models/block/impetus_look_dim_north.json
|
||||
7caec1d9feb2a088e383184a97648f117204223b assets/hexcasting/models/block/impetus_look_dim_south.json
|
||||
256f8eaa7a9bca0155e28439d099ac2f3fb5f5e1 assets/hexcasting/models/block/impetus_look_dim_up.json
|
||||
395ee54997ad39382c782b250436c774525f9a97 assets/hexcasting/models/block/impetus_look_dim_west.json
|
||||
6334ad09b5237fa1f2ebc66f8e5827ec422247cc assets/hexcasting/models/block/impetus_look_lit_down.json
|
||||
99df6242835b3ef057f42c36adf4595479668441 assets/hexcasting/models/block/impetus_look_lit_east.json
|
||||
407b535a2c45b2b274b98a5fe62b4c306872ed66 assets/hexcasting/models/block/impetus_look_lit_north.json
|
||||
b74631a641542242f4994274912996bdc0f64396 assets/hexcasting/models/block/impetus_look_lit_south.json
|
||||
09789fe60836deb078831aad99cdd6edf77a51ad assets/hexcasting/models/block/impetus_look_lit_up.json
|
||||
cef80ada89d096a55722dabeba0f032b23fc5af8 assets/hexcasting/models/block/impetus_look_lit_west.json
|
||||
6b7fd1b238fb586bd3d429575d085d801cc0d44f assets/hexcasting/models/block/impetus_rightclick_dim_down.json
|
||||
803eedcc8f947f0894092b191616a5cb9ffad5c4 assets/hexcasting/models/block/impetus_rightclick_dim_east.json
|
||||
afd49062ada4999442b93c4cc713d525287daa06 assets/hexcasting/models/block/impetus_rightclick_dim_north.json
|
||||
|
@ -85,6 +98,7 @@ a6cabea2984ed2b5b0dcd0087c762c9b9892a5fe assets/hexcasting/models/item/focus_pat
|
|||
44db2dda5b3d2b7d1591804bdaaf5692c2a4cc5f assets/hexcasting/models/item/focus_vec3_sealed.json
|
||||
5228a94d6ef14d1694551d33646d3b103fdf658b assets/hexcasting/models/item/focus_widget.json
|
||||
48a791a807603d131cdf8ea16948164006a6dc6f assets/hexcasting/models/item/focus_widget_sealed.json
|
||||
991af62ccdc4c063321cc7994e0a106a432d1487 assets/hexcasting/models/item/impetus_look.json
|
||||
199a1c37b3fdb1e7da93408bbe85c5a2222e264e assets/hexcasting/models/item/impetus_rightclick.json
|
||||
0cdfde8339a08638fd11ce7bef4a0769eb15bcf9 assets/hexcasting/models/item/lens.json
|
||||
22ec49ee56e2d0d9fca4473f965c64b82d712f79 assets/hexcasting/models/item/patchouli_book.json
|
||||
|
@ -138,6 +152,7 @@ b6593ea802a692c29b5032292df31beb84878ad8 data/hexcasting/advancements/aaa_wastef
|
|||
a165e3959b7d0c37bea586d0e94609b483255569 data/hexcasting/advancements/enlightenment.json
|
||||
eb6393ffc79966e4b5983a68157742b78cd12414 data/hexcasting/advancements/opened_eyes.json
|
||||
7e93886be31c3762a5b70e56a7214d19f64d58a8 data/hexcasting/advancements/recipes/brainsweep/brainsweep/budding_amethyst.json
|
||||
ed6ce219b2ee65d69ea45a43fb9a71b1f5da88bb data/hexcasting/advancements/recipes/brainsweep/brainsweep/impetus_look.json
|
||||
d225f90cc1e3b8200014106cd2d3bede9c783817 data/hexcasting/advancements/recipes/brainsweep/brainsweep/impetus_rightclick.json
|
||||
47000a9b5a409038e369dbef156a72ec93cb51db data/hexcasting/advancements/recipes/hexcasting/abacus.json
|
||||
5a17fa9a1496f5fbedd0362f94a5231e0e5ebbfc data/hexcasting/advancements/recipes/hexcasting/ageing_scroll_paper_lantern.json
|
||||
|
@ -225,6 +240,7 @@ e5c835d3866e8f5ecfb03c9e7c2c134a50951d67 data/hexcasting/recipes/amethyst_tiles.
|
|||
3f9756b2c5137b285c4faa88ab43c4996b6b2bb6 data/hexcasting/recipes/ancient_scroll_paper_lantern.json
|
||||
6e6e4d01097c10316892e274f33cb0faaf9dc0df data/hexcasting/recipes/artifact.json
|
||||
2f8404bf839fa109f0eb157704721d5a5734a4e1 data/hexcasting/recipes/brainsweep/budding_amethyst.json
|
||||
66e750931a0dca143955f182cc3954647d834f9c data/hexcasting/recipes/brainsweep/impetus_look.json
|
||||
9631f6616c6a63c9e0a9eaa8126e2f116636fab5 data/hexcasting/recipes/brainsweep/impetus_rightclick.json
|
||||
ea32d82fc3f2cb974038c311a3538aae481ea4c0 data/hexcasting/recipes/cypher.json
|
||||
33fed8fb8e34df026e1eea0df8161c7f842a8648 data/hexcasting/recipes/dye_colorizer_black.json
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/look_dim",
|
||||
"up": "hexcasting:block/impetus/back_dim",
|
||||
"north": "hexcasting:block/impetus/down_dim",
|
||||
"south": "hexcasting:block/impetus/down_dim",
|
||||
"east": "hexcasting:block/impetus/down_dim",
|
||||
"west": "hexcasting:block/impetus/down_dim",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/right_dim",
|
||||
"up": "hexcasting:block/impetus/right_dim",
|
||||
"north": "hexcasting:block/impetus/left_dim",
|
||||
"south": "hexcasting:block/impetus/right_dim",
|
||||
"east": "hexcasting:block/impetus/look_dim",
|
||||
"west": "hexcasting:block/impetus/back_dim",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/down_dim",
|
||||
"up": "hexcasting:block/impetus/up_dim",
|
||||
"north": "hexcasting:block/impetus/look_dim",
|
||||
"south": "hexcasting:block/impetus/back_dim",
|
||||
"east": "hexcasting:block/impetus/right_dim",
|
||||
"west": "hexcasting:block/impetus/left_dim",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/up_dim",
|
||||
"up": "hexcasting:block/impetus/down_dim",
|
||||
"north": "hexcasting:block/impetus/back_dim",
|
||||
"south": "hexcasting:block/impetus/look_dim",
|
||||
"east": "hexcasting:block/impetus/left_dim",
|
||||
"west": "hexcasting:block/impetus/right_dim",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/back_dim",
|
||||
"up": "hexcasting:block/impetus/look_dim",
|
||||
"north": "hexcasting:block/impetus/up_dim",
|
||||
"south": "hexcasting:block/impetus/up_dim",
|
||||
"east": "hexcasting:block/impetus/up_dim",
|
||||
"west": "hexcasting:block/impetus/up_dim",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/left_dim",
|
||||
"up": "hexcasting:block/impetus/left_dim",
|
||||
"north": "hexcasting:block/impetus/right_dim",
|
||||
"south": "hexcasting:block/impetus/left_dim",
|
||||
"east": "hexcasting:block/impetus/back_dim",
|
||||
"west": "hexcasting:block/impetus/look_dim",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/look_lit",
|
||||
"up": "hexcasting:block/impetus/back_lit",
|
||||
"north": "hexcasting:block/impetus/down_lit",
|
||||
"south": "hexcasting:block/impetus/down_lit",
|
||||
"east": "hexcasting:block/impetus/down_lit",
|
||||
"west": "hexcasting:block/impetus/down_lit",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/right_lit",
|
||||
"up": "hexcasting:block/impetus/right_lit",
|
||||
"north": "hexcasting:block/impetus/left_lit",
|
||||
"south": "hexcasting:block/impetus/right_lit",
|
||||
"east": "hexcasting:block/impetus/look_lit",
|
||||
"west": "hexcasting:block/impetus/back_lit",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/down_lit",
|
||||
"up": "hexcasting:block/impetus/up_lit",
|
||||
"north": "hexcasting:block/impetus/look_lit",
|
||||
"south": "hexcasting:block/impetus/back_lit",
|
||||
"east": "hexcasting:block/impetus/right_lit",
|
||||
"west": "hexcasting:block/impetus/left_lit",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/up_lit",
|
||||
"up": "hexcasting:block/impetus/down_lit",
|
||||
"north": "hexcasting:block/impetus/back_lit",
|
||||
"south": "hexcasting:block/impetus/look_lit",
|
||||
"east": "hexcasting:block/impetus/left_lit",
|
||||
"west": "hexcasting:block/impetus/right_lit",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/back_lit",
|
||||
"up": "hexcasting:block/impetus/look_lit",
|
||||
"north": "hexcasting:block/impetus/up_lit",
|
||||
"south": "hexcasting:block/impetus/up_lit",
|
||||
"east": "hexcasting:block/impetus/up_lit",
|
||||
"west": "hexcasting:block/impetus/up_lit",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube",
|
||||
"textures": {
|
||||
"down": "hexcasting:block/impetus/left_lit",
|
||||
"up": "hexcasting:block/impetus/left_lit",
|
||||
"north": "hexcasting:block/impetus/right_lit",
|
||||
"south": "hexcasting:block/impetus/left_lit",
|
||||
"east": "hexcasting:block/impetus/back_lit",
|
||||
"west": "hexcasting:block/impetus/look_lit",
|
||||
"particle": "hexcasting:block/slate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "hexcasting:block/impetus_look_dim_east"
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"hexcasting:brainsweep/impetus_look"
|
||||
]
|
||||
},
|
||||
"criteria": {
|
||||
"enlightenment": {
|
||||
"trigger": "hexcasting:overcast",
|
||||
"conditions": {
|
||||
"health_used": {
|
||||
"min": 17.95
|
||||
},
|
||||
"mojang_i_am_begging_and_crying_please_add_an_entity_health_criterion": {
|
||||
"min": 0.1,
|
||||
"max": 2.05
|
||||
}
|
||||
}
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"trigger": "minecraft:recipe_unlocked",
|
||||
"conditions": {
|
||||
"recipe": "hexcasting:brainsweep/impetus_look"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"enlightenment",
|
||||
"has_the_recipe"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"type": "hexcasting:brainsweep",
|
||||
"blockIn": {
|
||||
"type": "block",
|
||||
"block": "hexcasting:empty_impetus"
|
||||
},
|
||||
"villagerIn": {
|
||||
"profession": "minecraft:fletcher",
|
||||
"minLevel": 1
|
||||
},
|
||||
"result": {
|
||||
"name": "hexcasting:impetus_look",
|
||||
"properties": {
|
||||
"facing": "north",
|
||||
"energized": "false",
|
||||
"look_amount": "0"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ public abstract class BlockAbstractImpetus extends BlockCircleComponent implemen
|
|||
@Override
|
||||
public boolean canEnterFromDirection(Direction enterDir, Direction normalDir, BlockPos pos, BlockState bs,
|
||||
Level world) {
|
||||
return enterDir != bs.getValue(FACING).getOpposite();
|
||||
return enterDir != bs.getValue(FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +57,7 @@ public abstract class BlockAbstractImpetus extends BlockCircleComponent implemen
|
|||
|
||||
@Override
|
||||
public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, Random pRandom) {
|
||||
if (pLevel.getBlockEntity(pPos) instanceof BlockEntityAbstractImpetus tile) {
|
||||
if (pLevel.getBlockEntity(pPos) instanceof BlockEntityAbstractImpetus tile && pState.getValue(ENERGIZED)) {
|
||||
tile.stepCircle();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public abstract class BlockEntityAbstractImpetus extends PaucalBlockEntity imple
|
|||
|
||||
this.level.setBlockAndUpdate(this.getBlockPos(),
|
||||
this.getBlockState().setValue(BlockAbstractImpetus.ENERGIZED, true));
|
||||
this.setChanged();
|
||||
this.stepCircle();
|
||||
}
|
||||
|
||||
protected void stepCircle() {
|
||||
|
|
|
@ -5,11 +5,14 @@ import at.petrak.hexcasting.api.circle.BlockAbstractImpetus;
|
|||
import at.petrak.hexcasting.common.blocks.circles.BlockEmptyImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.circles.BlockEntitySlate;
|
||||
import at.petrak.hexcasting.common.blocks.circles.BlockSlate;
|
||||
import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockEntityLookingImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockEntityRightClickImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockLookingImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockRightClickImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.decoration.BlockSconce;
|
||||
import at.petrak.hexcasting.common.items.HexItems;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
|
@ -26,7 +29,7 @@ public class HexBlocks {
|
|||
public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITIES = DeferredRegister.create(
|
||||
ForgeRegistries.BLOCK_ENTITIES, HexMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Block> CONJURED = BLOCKS.register("conjured",
|
||||
public static final RegistryObject<Block> CONJURED = blockItem("conjured",
|
||||
() -> new BlockConjured(
|
||||
BlockBehaviour.Properties.of(Material.AMETHYST, MaterialColor.DIAMOND)
|
||||
.sound(SoundType.AMETHYST)
|
||||
|
@ -34,7 +37,8 @@ public class HexBlocks {
|
|||
.instabreak()
|
||||
.noOcclusion()
|
||||
.isSuffocating(HexBlocks::never)
|
||||
.isViewBlocking(HexBlocks::never)));
|
||||
.isViewBlocking(HexBlocks::never)),
|
||||
new Item.Properties());
|
||||
|
||||
private static BlockBehaviour.Properties slateish() {
|
||||
return BlockBehaviour.Properties
|
||||
|
@ -55,10 +59,15 @@ public class HexBlocks {
|
|||
|
||||
public static final RegistryObject<BlockEmptyImpetus> EMPTY_IMPETUS = blockItem("empty_impetus",
|
||||
() -> new BlockEmptyImpetus(slateish()));
|
||||
|
||||
public static final RegistryObject<BlockRightClickImpetus> IMPETUS_RIGHTCLICK = blockItem(
|
||||
"impetus_rightclick",
|
||||
() -> new BlockRightClickImpetus(slateish()
|
||||
.lightLevel(bs -> bs.getValue(BlockAbstractImpetus.ENERGIZED) ? 15 : 0)));
|
||||
public static final RegistryObject<BlockLookingImpetus> IMPETUS_LOOK = blockItem(
|
||||
"impetus_look",
|
||||
() -> new BlockLookingImpetus(slateish()
|
||||
.lightLevel(bs -> bs.getValue(BlockAbstractImpetus.ENERGIZED) ? 15 : 0)));
|
||||
|
||||
// Decoration?!
|
||||
public static final RegistryObject<Block> SLATE_BLOCK = blockItem("slate_block",
|
||||
|
@ -92,6 +101,9 @@ public class HexBlocks {
|
|||
public static final RegistryObject<BlockEntityType<BlockEntityRightClickImpetus>> IMPETUS_RIGHTCLICK_TILE =
|
||||
BLOCK_ENTITIES.register("impetus_rightclick_tile",
|
||||
() -> BlockEntityType.Builder.of(BlockEntityRightClickImpetus::new, IMPETUS_RIGHTCLICK.get()).build(null));
|
||||
public static final RegistryObject<BlockEntityType<BlockEntityLookingImpetus>> IMPETUS_LOOK_TILE =
|
||||
BLOCK_ENTITIES.register("impetus_look_tile",
|
||||
() -> BlockEntityType.Builder.of(BlockEntityLookingImpetus::new, IMPETUS_LOOK.get()).build(null));
|
||||
|
||||
|
||||
private static boolean never(Object... args) {
|
||||
|
@ -99,8 +111,13 @@ public class HexBlocks {
|
|||
}
|
||||
|
||||
private static <T extends Block> RegistryObject<T> blockItem(String name, Supplier<T> block) {
|
||||
return blockItem(name, block, HexItems.props());
|
||||
}
|
||||
|
||||
private static <T extends Block> RegistryObject<T> blockItem(String name, Supplier<T> block,
|
||||
Item.Properties props) {
|
||||
var out = BLOCKS.register(name, block);
|
||||
HexItems.ITEMS.register(name, () -> new BlockItem(out.get(), HexItems.props()));
|
||||
HexItems.ITEMS.register(name, () -> new BlockItem(out.get(), props));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
package at.petrak.hexcasting.common.blocks.circles.impetuses;
|
||||
|
||||
import at.petrak.hexcasting.api.circle.BlockCircleComponent;
|
||||
import at.petrak.hexcasting.api.circle.BlockEntityAbstractImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlocks;
|
||||
import at.petrak.hexcasting.common.lib.HexSounds;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
|
||||
public class BlockEntityLookingImpetus extends BlockEntityAbstractImpetus {
|
||||
public BlockEntityLookingImpetus(BlockPos pWorldPosition, BlockState pBlockState) {
|
||||
super(HexBlocks.IMPETUS_LOOK_TILE.get(), pWorldPosition, pBlockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activatorAlwaysInRange() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://github.com/VazkiiMods/Botania/blob/2607bcd31c4eaeb617f7d1b3ec1c1db08f59add4/Common/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java#L27
|
||||
public static void serverTick(Level level, BlockPos pos, BlockState bs, BlockEntityLookingImpetus self) {
|
||||
if (bs.getValue(BlockCircleComponent.ENERGIZED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int prevLookAmt = bs.getValue(BlockLookingImpetus.LOOK_AMOUNT);
|
||||
int range = 20;
|
||||
var players = level.getEntitiesOfClass(ServerPlayer.class,
|
||||
new AABB(pos.offset(-range, -range, -range), pos.offset(range, range, range)));
|
||||
|
||||
ServerPlayer looker = null;
|
||||
for (var player : players) {
|
||||
// might as well impl this heh
|
||||
var hat = player.getItemBySlot(EquipmentSlot.HEAD);
|
||||
// sadly `isEnderMask` requires the enderman
|
||||
if (!hat.isEmpty() && hat.is(Blocks.CARVED_PUMPKIN.asItem())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var lookEnd = player.getLookAngle().scale(range / 1.5f); // add some slop
|
||||
var hit = level.clip(new ClipContext(
|
||||
player.getEyePosition(),
|
||||
player.getEyePosition().add(lookEnd),
|
||||
ClipContext.Block.VISUAL,
|
||||
ClipContext.Fluid.NONE,
|
||||
player
|
||||
));
|
||||
if (hit.getType() == HitResult.Type.BLOCK && hit.getBlockPos().equals(pos)) {
|
||||
looker = player;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var newLook = Mth.clamp(
|
||||
prevLookAmt + (looker == null ? -1 : 1),
|
||||
0,
|
||||
BlockLookingImpetus.MAX_LOOK_AMOUNT
|
||||
);
|
||||
if (newLook != prevLookAmt) {
|
||||
if (newLook == BlockLookingImpetus.MAX_LOOK_AMOUNT) {
|
||||
level.setBlockAndUpdate(pos, bs.setValue(BlockLookingImpetus.LOOK_AMOUNT, 0));
|
||||
self.activateSpellCircle(looker);
|
||||
} else {
|
||||
if (newLook % 5 == 1) {
|
||||
var t = (float) newLook / BlockLookingImpetus.MAX_LOOK_AMOUNT;
|
||||
var pitch = Mth.lerp(t, 0.5f, 1.2f);
|
||||
var volume = Mth.lerp(t, 0.2f, 1.2f);
|
||||
level.playSound(null, pos, HexSounds.IMPETUS_LOOK_TICK.get(), SoundSource.BLOCKS, volume, pitch);
|
||||
}
|
||||
level.setBlockAndUpdate(pos, bs.setValue(BlockLookingImpetus.LOOK_AMOUNT, newLook));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package at.petrak.hexcasting.common.blocks.circles.impetuses;
|
||||
|
||||
import at.petrak.hexcasting.api.circle.BlockAbstractImpetus;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlocks;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BlockLookingImpetus extends BlockAbstractImpetus {
|
||||
public static final int MAX_LOOK_AMOUNT = 30;
|
||||
public static final IntegerProperty LOOK_AMOUNT = IntegerProperty.create("look_amount", 0, MAX_LOOK_AMOUNT);
|
||||
|
||||
public BlockLookingImpetus(Properties p_49795_) {
|
||||
super(p_49795_);
|
||||
this.registerDefaultState(this.stateDefinition.any()
|
||||
.setValue(ENERGIZED, false)
|
||||
.setValue(FACING, Direction.NORTH)
|
||||
.setValue(LOOK_AMOUNT, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder);
|
||||
builder.add(LOOK_AMOUNT);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
|
||||
return new BlockEntityLookingImpetus(pPos, pState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level pLevel, BlockState pState,
|
||||
BlockEntityType<T> type) {
|
||||
if (!pLevel.isClientSide) {
|
||||
return createTickerHelper(type, HexBlocks.IMPETUS_LOOK_TILE.get(), BlockEntityLookingImpetus::serverTick);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// uegh
|
||||
@Nullable
|
||||
protected static <E extends BlockEntity, A extends BlockEntity> BlockEntityTicker<A> createTickerHelper(
|
||||
BlockEntityType<A> p_152133_, BlockEntityType<E> p_152134_, BlockEntityTicker<? super E> p_152135_) {
|
||||
return p_152134_ == p_152133_ ? (BlockEntityTicker<A>) p_152135_ : null;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,8 @@ public class HexSounds {
|
|||
|
||||
public static final RegistryObject<SoundEvent> DUST_SCROLL = sound("scroll.dust");
|
||||
|
||||
public static final RegistryObject<SoundEvent> IMPETUS_LOOK_TICK = sound("impetus.fletcher.tick");
|
||||
|
||||
private static RegistryObject<SoundEvent> sound(String name) {
|
||||
return SOUNDS.register(name, () -> new SoundEvent(prefix(name)));
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public class HexBlockStatesAndModels extends PaucalBlockStateAndModelProvider {
|
|||
});
|
||||
|
||||
impetus(HexBlocks.IMPETUS_RIGHTCLICK.get(), "impetus_rightclick", "rightclick");
|
||||
impetus(HexBlocks.IMPETUS_LOOK.get(), "impetus_look", "look");
|
||||
arrowCircleBlock(HexBlocks.EMPTY_IMPETUS.get(), "empty_impetus", modLoc("block/slate"),
|
||||
"impetus/front_empty",
|
||||
"impetus/back_empty",
|
||||
|
|
|
@ -229,6 +229,12 @@ public class HexRecipes extends PaucalRecipeProvider {
|
|||
.unlockedBy("enlightenment", enlightenment)
|
||||
.save(recipes, modLoc("brainsweep/impetus_rightclick"));
|
||||
|
||||
new BrainsweepRecipeBuilder(StateIngredientHelper.of(HexBlocks.EMPTY_IMPETUS.get()),
|
||||
new VillagerIngredient(new ResourceLocation("fletcher"), null, 1),
|
||||
HexBlocks.IMPETUS_LOOK.get().defaultBlockState())
|
||||
.unlockedBy("enlightenment", enlightenment)
|
||||
.save(recipes, modLoc("brainsweep/impetus_look"));
|
||||
|
||||
new BrainsweepRecipeBuilder(StateIngredientHelper.of(Blocks.AMETHYST_BLOCK),
|
||||
new VillagerIngredient(null, null, 2),
|
||||
Blocks.BUDDING_AMETHYST.defaultBlockState())
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
"block.hexcasting.slate.written": "Patterned Slate",
|
||||
"block.hexcasting.empty_impetus": "Empty Impetus",
|
||||
"block.hexcasting.impetus_rightclick": "Toolsmith Impetus",
|
||||
"block.hexcasting.impetus_look": "Fletcher Impetus",
|
||||
|
||||
"block.hexcasting.slate_block": "Block of Slate",
|
||||
"block.hexcasting.amethyst_dust_block": "Block of Amethyst Dust",
|
||||
|
@ -240,6 +241,7 @@
|
|||
"hexcasting.subtitles.spellcircle.fail": "Spell circle fizzles out",
|
||||
"hexcasting.subtitles.spellcircle.cast": "Spell circle casts",
|
||||
"hexcasting.subtitles.scroll.dust": "Scroll covers with dust",
|
||||
"hexcasting.subtitles.impetus.fletcher.tick": "Fletcher Impetus ticks",
|
||||
|
||||
"hexcasting.landing": "I seem to have discovered a new method of magical arts, in which one draws patterns strange and wild onto a hexagonal grid. It fascinates me. I've decided to start a journal of my thoughts and findings.$(br2)$(l:https://discord.gg/4xxHGYteWk)Discord Server Link/$",
|
||||
|
||||
|
@ -440,6 +442,7 @@
|
|||
"hexcasting.page.impetus.4": "The solution I aim for, then, is to specialize a mind. Remove it from the tyranny of nerves, clip all outputs but delicate splays of _media-manipulating apparati, cauterize all inputs but the signal to start its work.$(br2)The process of $(action)mindflaying/$ I am now familiar with will do excellently; the mind of a villager is complex enough to do the work, but not so complex as to resist its reformation.",
|
||||
"hexcasting.page.impetus.5": "First, the cradle. Although it does not work as an $(item)Impetus/$, the flow of _media in a circle will only exit out the side pointed to by the arrows. This allows me to change the plane in which the wave flows, for example.",
|
||||
"hexcasting.page.impetus.6": "Then, to transpose the mind. Villagers of different professions will lend different actuation conditions to the resulting $(item)Impetus/$. A Toolsmith's activates on a simple $(k:use).",
|
||||
"hexcasting.page.impetus.7": "A Fletcher's activates when looked at for a short time.",
|
||||
|
||||
"_comment": "Patterns",
|
||||
|
||||
|
|
|
@ -92,5 +92,12 @@
|
|||
"minecraft:dig/sand4"
|
||||
],
|
||||
"subtitle": "hexcasting.subtitles.scroll.dust"
|
||||
},
|
||||
|
||||
"impetus.fletcher.tick": {
|
||||
"sounds": [
|
||||
"minecraft:note/hat"
|
||||
],
|
||||
"subtitle": "hexcasting.subtitles.impetus.fletcher.tick"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 514 B |
Binary file not shown.
After Width: | Height: | Size: 518 B |
|
@ -31,6 +31,11 @@
|
|||
"type": "hexcasting:brainsweep",
|
||||
"recipe": "hexcasting:brainsweep/impetus_rightclick",
|
||||
"text": "hexcasting.page.impetus.6"
|
||||
},
|
||||
{
|
||||
"type": "hexcasting:brainsweep",
|
||||
"recipe": "hexcasting:brainsweep/impetus_look",
|
||||
"text": "hexcasting.page.impetus.7"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue