it isn't syncing but *something* is happening
This commit is contained in:
parent
433391c8d0
commit
3e6a086ef0
19 changed files with 319 additions and 54 deletions
|
@ -1,3 +1,5 @@
|
|||
2ec8ecee328c180a01e3fec14cd9c6b9ed098dcc assets/hexcasting/blockstates/akashic_bookshelf.json
|
||||
f6ea08e250f08c55e9346727f469e0695837256f assets/hexcasting/blockstates/akashic_record.json
|
||||
6467be85f85137aa17be8b03ee96c224839a9e25 assets/hexcasting/blockstates/amethyst_dust_block.json
|
||||
1d17548d44b3169d43663d1cbc7699d75ccc8a54 assets/hexcasting/blockstates/amethyst_sconce.json
|
||||
aed50918bad8a7b00cd26e45d67eb509a04c9f6c assets/hexcasting/blockstates/amethyst_tiles.json
|
||||
|
@ -13,6 +15,7 @@ aed50918bad8a7b00cd26e45d67eb509a04c9f6c assets/hexcasting/blockstates/amethyst_
|
|||
77e723163f415795437b810fe87c348c96a989be assets/hexcasting/blockstates/scroll_paper_lantern.json
|
||||
5cb63493ae07f5ab5d8f686e3553c97a85105931 assets/hexcasting/blockstates/slate.json
|
||||
043abd5bbfd1186415049d24d185d4e4395320f9 assets/hexcasting/blockstates/slate_block.json
|
||||
ab3bcb79ddb08a99da77ebc8f30653b2513051a7 assets/hexcasting/models/block/akashic_bookshelf.json
|
||||
de50477d8d34bbd69db98249cc6c878be8bc80f3 assets/hexcasting/models/block/amethyst_dust_block.json
|
||||
df994438c20d9dec9009c9c56de74860a847681b assets/hexcasting/models/block/amethyst_tiles.json
|
||||
4e65ad75eeee22fa1d2c899fc86ac8b7b9a43701 assets/hexcasting/models/block/ancient_scroll_paper.json
|
||||
|
@ -99,6 +102,8 @@ a752ca73fe255f4cb2d062cba4447190985a795c assets/hexcasting/models/block/redstone
|
|||
9327633bd23735970a1ffe9811593a668e05947d assets/hexcasting/models/block/scroll_paper_lantern.json
|
||||
d51541b464840530f4e734db1f67ed20e811ad14 assets/hexcasting/models/block/slate_block.json
|
||||
60c0f39882d22c2634cf738b0fe4e956eaa2adbe assets/hexcasting/models/item/abacus.json
|
||||
49077535463c1abea4ac62435a81e43cf11cd99f assets/hexcasting/models/item/akashic_bookshelf.json
|
||||
73493fd27f4dca49bde35890dc3d7a5ad8f2b0e6 assets/hexcasting/models/item/akashic_record.json
|
||||
eb78f6a2b68dd772a5016fc5a3db10488a65abfa assets/hexcasting/models/item/amethyst_dust.json
|
||||
6a60e6e92414f63e7e045f2893e5cd7b503d08dd assets/hexcasting/models/item/amethyst_dust_block.json
|
||||
0d0695c9a96cadec55d905a42d0ba966f8697c41 assets/hexcasting/models/item/amethyst_sconce.json
|
||||
|
@ -348,6 +353,8 @@ d14cf2f8f0895a5b6dc09b7582c0abf1c2514adf data/hexcasting/recipes/sub_sandwich.js
|
|||
67b16cdb26f40234a7d4e49357724f24c197580a data/hexcasting/recipes/trinket.json
|
||||
14d6be5d47b54676a349564ea32c045c76c39b45 data/hexcasting/recipes/uuid_colorizer.json
|
||||
0521d57838cb3e9795fc02ce47aa58db3b0188f9 data/hexcasting/recipes/wand.json
|
||||
e51e42f8b7b8c249dbe0bcbe424f77b1f9cce68f data/hexcasting/tags/blocks/akashic_floodfiller.json
|
||||
f930dbc5b41d42150d388e39b29b940229658809 data/minecraft/tags/blocks/crystal_sound_blocks.json
|
||||
f7c3d1e53b74b696a13abcd51acd8032e803195c data/minecraft/tags/blocks/mineable/hoe.json
|
||||
eb4bfbd7fc7632a5c16aa1d50d6090a1f466069b data/minecraft/tags/blocks/mineable/pickaxe.json
|
||||
f55afc2c05d93b5a44bc9fd73c5e81e71b183965 data/minecraft/tags/blocks/mineable/shovel.json
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "hexcasting:block/akashic_bookshelf"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "minecraft:block/cartography_table"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"side": "minecraft:block/oak_planks",
|
||||
"front": "minecraft:block/bookshelf",
|
||||
"top": "minecraft:block/oak_planks"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "hexcasting:block/akashic_bookshelf"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "minecraft:block/cartography_table"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"hexcasting:akashic_bookshelf"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"hexcasting:akashic_record",
|
||||
"hexcasting:akashic_bookshelf"
|
||||
]
|
||||
}
|
|
@ -9,6 +9,7 @@ import at.petrak.hexcasting.client.entity.WallScrollRenderer;
|
|||
import at.petrak.hexcasting.client.particles.ConjureParticle;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlocks;
|
||||
import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf;
|
||||
import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicRecord;
|
||||
import at.petrak.hexcasting.common.blocks.circles.BlockEntitySlate;
|
||||
import at.petrak.hexcasting.common.entities.HexEntities;
|
||||
import at.petrak.hexcasting.common.items.HexItems;
|
||||
|
@ -25,7 +26,9 @@ import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
|||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderers;
|
||||
import net.minecraft.client.renderer.item.ItemProperties;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
@ -40,6 +43,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
|
@ -122,6 +126,41 @@ public class RegisterClientStuff {
|
|||
return List.of();
|
||||
}
|
||||
});
|
||||
|
||||
ScryingLensOverlayRegistry.addDisplayer(HexBlocks.AKASHIC_BOOKSHELF.get(),
|
||||
(state, pos, observer, world, lensHand) -> {
|
||||
if (!(world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile)) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
var out = new ArrayList<Pair<ItemStack, Component>>();
|
||||
|
||||
if (tile.recordPos != null) {
|
||||
out.add(new Pair<>(new ItemStack(HexBlocks.AKASHIC_RECORD.get()), new TranslatableComponent(
|
||||
"hexcasting.tooltip.lens.akashic.bookshelf.location",
|
||||
tile.recordPos.toShortString()
|
||||
)));
|
||||
if (tile.pattern != null) {
|
||||
if (world.getBlockEntity(tile.recordPos) instanceof BlockEntityAkashicRecord record) {
|
||||
out.add(new Pair<>(new ItemStack(Items.BOOK), record.getDisplayAt(tile.pattern)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
});
|
||||
ScryingLensOverlayRegistry.addDisplayer(HexBlocks.AKASHIC_RECORD.get(),
|
||||
((state, pos, observer, world, lensHand) -> {
|
||||
if (!(world.getBlockEntity(pos) instanceof BlockEntityAkashicRecord tile)) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
return List.of(new Pair<>(new ItemStack(HexBlocks.AKASHIC_BOOKSHELF.get()), new TranslatableComponent(
|
||||
"hexcasting.tooltip.lens.akashic.record.count",
|
||||
tile.getCount()
|
||||
)));
|
||||
}));
|
||||
|
||||
ScryingLensOverlayRegistry.addDisplayer(Blocks.REDSTONE_WIRE,
|
||||
(state, pos, observer, world, lensHand) -> List.of(
|
||||
new Pair<>(
|
||||
|
|
|
@ -3,13 +3,21 @@ package at.petrak.hexcasting.common.blocks.akashic;
|
|||
import at.petrak.hexcasting.common.blocks.HexBlockTags;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlocks;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.EntityBlock;
|
||||
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BlockAkashicBookshelf extends Block {
|
||||
public class BlockAkashicBookshelf extends HorizontalDirectionalBlock implements EntityBlock {
|
||||
public BlockAkashicBookshelf(Properties p_49795_) {
|
||||
super(p_49795_);
|
||||
this.registerDefaultState(this.getStateDefinition().any().setValue(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,4 +42,20 @@ public class BlockAkashicBookshelf extends Block {
|
|||
|
||||
super.onRemove(pState, pLevel, pPos, pNewState, pIsMoving);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
builder.add(FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
return this.defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
|
||||
return new BlockEntityAkashicBookshelf(pPos, pState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,29 @@
|
|||
package at.petrak.hexcasting.common.blocks.akashic;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.EntityBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BlockAkashicRecord extends Block {
|
||||
public class BlockAkashicRecord extends Block implements EntityBlock {
|
||||
public BlockAkashicRecord(Properties p_49795_) {
|
||||
super(p_49795_);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
|
||||
return new BlockEntityAkashicRecord(pPos, pState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) {
|
||||
if (pLevel.getBlockEntity(pPos) instanceof BlockEntityAkashicRecord record) {
|
||||
record.reifyLookupsPerSide();
|
||||
record.setChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package at.petrak.hexcasting.common.blocks.akashic;
|
|||
|
||||
import at.petrak.hexcasting.client.RenderLib;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlocks;
|
||||
import at.petrak.hexcasting.common.blocks.circles.BlockSlate;
|
||||
import at.petrak.hexcasting.hexmath.HexPattern;
|
||||
import at.petrak.paucal.api.PaucalBlockEntity;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
@ -72,54 +71,48 @@ public class BlockEntityAkashicBookshelf extends PaucalBlockEntity {
|
|||
ps.pushPose();
|
||||
|
||||
ps.translate(0.5, 0.5, 0.5);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
ps.pushPose();
|
||||
var quarters = (-bs.getValue(BlockAkashicBookshelf.FACING).get2DDataValue()) % 4;
|
||||
ps.mulPose(new Quaternion(Vector3f.YP, Mth.HALF_PI * quarters, false));
|
||||
ps.mulPose(new Quaternion(Vector3f.ZP, Mth.PI, false));
|
||||
|
||||
ps.mulPose(new Quaternion(Vector3f.YP, Mth.HALF_PI * i, false));
|
||||
ps.mulPose(new Quaternion(Vector3f.ZP, Mth.PI, false));
|
||||
// and now Z is out?
|
||||
ps.translate(0, 0, 0.5);
|
||||
ps.scale(1 / 16f, 1 / 16f, 1 / 16f);
|
||||
ps.translate(0, 0, 0.01);
|
||||
|
||||
// and now Z is out?
|
||||
ps.translate(0, 0, 0.5);
|
||||
ps.scale(1 / 16f, 1 / 16f, 1 / 16f);
|
||||
ps.translate(0, 0, 0.01);
|
||||
// yoink code from the pattern greeble
|
||||
// Do two passes: one with a random size to find a good COM and one with the real calculation
|
||||
var com1 = tile.pattern.getCenter(1);
|
||||
var lines1 = tile.pattern.toLines(1, Vec2.ZERO);
|
||||
|
||||
// yoink code from the pattern greeble
|
||||
// Do two passes: one with a random size to find a good COM and one with the real calculation
|
||||
var com1 = tile.pattern.getCenter(1);
|
||||
var lines1 = tile.pattern.toLines(1, Vec2.ZERO);
|
||||
|
||||
var maxDx = -1f;
|
||||
var maxDy = -1f;
|
||||
for (var dot : lines1) {
|
||||
var dx = Mth.abs(dot.x - com1.x);
|
||||
if (dx > maxDx) {
|
||||
maxDx = dx;
|
||||
}
|
||||
var dy = Mth.abs(dot.y - com1.y);
|
||||
if (dy > maxDy) {
|
||||
maxDy = dy;
|
||||
}
|
||||
var maxDx = -1f;
|
||||
var maxDy = -1f;
|
||||
for (var dot : lines1) {
|
||||
var dx = Mth.abs(dot.x - com1.x);
|
||||
if (dx > maxDx) {
|
||||
maxDx = dx;
|
||||
}
|
||||
var scale = Math.min(3.8f, Math.min(16 / 2.5f / maxDx, 16 / 2.5f / maxDy));
|
||||
|
||||
var com2 = tile.pattern.getCenter(scale);
|
||||
var lines2 = tile.pattern.toLines(scale, com2.negated());
|
||||
// For some reason it is mirrored left to right and i can't seem to posestack-fu it into shape
|
||||
for (int j = 0; j < lines2.size(); j++) {
|
||||
var v = lines2.get(j);
|
||||
lines2.set(i, new Vec2(-v.x, v.y));
|
||||
var dy = Mth.abs(dot.y - com1.y);
|
||||
if (dy > maxDy) {
|
||||
maxDy = dy;
|
||||
}
|
||||
|
||||
var isLit = bs.getValue(BlockSlate.ENERGIZED);
|
||||
var zappy = RenderLib.makeZappy(lines2, 10f, isLit ? 2.5f : 0.5f, isLit ? 0.1f : 0f);
|
||||
|
||||
int outer = isLit ? 0xff_64c8ff : 0xff_d2c8c8;
|
||||
int inner = isLit ? RenderLib.screenCol(outer) : 0xc8_322b33;
|
||||
RenderLib.drawLineSeq(ps.last().pose(), zappy, 1f, 0f, outer, outer);
|
||||
RenderLib.drawLineSeq(ps.last().pose(), zappy, 0.4f, 0.01f, inner, inner);
|
||||
|
||||
ps.popPose();
|
||||
}
|
||||
var scale = Math.min(3.8f, Math.min(16 / 2.5f / maxDx, 16 / 2.5f / maxDy));
|
||||
|
||||
var com2 = tile.pattern.getCenter(scale);
|
||||
var lines2 = tile.pattern.toLines(scale, com2.negated());
|
||||
// For some reason it is mirrored left to right and i can't seem to posestack-fu it into shape
|
||||
for (int j = 0; j < lines2.size(); j++) {
|
||||
var v = lines2.get(j);
|
||||
lines2.set(j, new Vec2(-v.x, v.y));
|
||||
}
|
||||
|
||||
var zappy = RenderLib.makeZappy(lines2, 10f, 0.5f, 0f);
|
||||
|
||||
int outer = 0xff_d2c8c8;
|
||||
int inner = 0xc8_322b33;
|
||||
RenderLib.drawLineSeq(ps.last().pose(), zappy, 1f, 0f, outer, outer);
|
||||
RenderLib.drawLineSeq(ps.last().pose(), zappy, 0.4f, 0.01f, inner, inner);
|
||||
|
||||
ps.popPose();
|
||||
RenderSystem.setShader(() -> oldShader);
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
package at.petrak.hexcasting.common.blocks.akashic;
|
||||
|
||||
import at.petrak.hexcasting.HexMod;
|
||||
import at.petrak.hexcasting.api.spell.SpellDatum;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlockTags;
|
||||
import at.petrak.hexcasting.common.blocks.HexBlocks;
|
||||
import at.petrak.hexcasting.hexmath.HexDir;
|
||||
import at.petrak.hexcasting.hexmath.HexPattern;
|
||||
import at.petrak.paucal.api.PaucalBlockEntity;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
@ -53,7 +57,8 @@ public class BlockEntityAkashicRecord extends PaucalBlockEntity {
|
|||
*/
|
||||
public @Nullable BlockPos addNewDatum(HexPattern key, SpellDatum<?> datum) {
|
||||
if (this.serverEntries == null) {
|
||||
throw new IllegalCallerException("should only have SpellDatums on the server");
|
||||
HexMod.getLogger().warn("should only call addNewDatum on the server");
|
||||
return null;
|
||||
}
|
||||
if (this.serverEntries.containsKey(key.anglesSignature())) {
|
||||
return null; // would clobber
|
||||
|
@ -79,7 +84,8 @@ public class BlockEntityAkashicRecord extends PaucalBlockEntity {
|
|||
|
||||
public @Nullable SpellDatum<?> lookupPattern(HexPattern key) {
|
||||
if (this.serverEntries == null) {
|
||||
throw new IllegalCallerException("should only have SpellDatums on the server");
|
||||
HexMod.getLogger().warn("should only call lookupPattern on the server");
|
||||
return null;
|
||||
}
|
||||
|
||||
var entry = this.serverEntries.get(key.anglesSignature());
|
||||
|
@ -90,14 +96,38 @@ public class BlockEntityAkashicRecord extends PaucalBlockEntity {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the entry was actually removed.
|
||||
*/
|
||||
public boolean clearKey(HexPattern key) {
|
||||
if (this.serverEntries == null) {
|
||||
throw new IllegalCallerException("should only have SpellDatums on the server");
|
||||
public Component getDisplayAt(HexPattern key) {
|
||||
if (this.clientEntries == null) {
|
||||
HexMod.getLogger().warn("should only call getDisplayAt on the client");
|
||||
return new TextComponent("");
|
||||
}
|
||||
return this.serverEntries.remove(key.anglesSignature()) != null;
|
||||
|
||||
var entry = this.clientEntries.get(key.anglesSignature());
|
||||
if (entry != null) {
|
||||
return entry.display;
|
||||
} else {
|
||||
return new TranslatableComponent("hexcasting.spelldata.akashic.nopos").withStyle(ChatFormatting.RED);
|
||||
}
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
var lookup = this.getLookup();
|
||||
return lookup.size();
|
||||
}
|
||||
|
||||
public void reifyLookupsPerSide() {
|
||||
if (this.level.isClientSide) {
|
||||
if (this.clientEntries == null) {
|
||||
this.clientEntries = new HashMap<>();
|
||||
this.setChanged();
|
||||
}
|
||||
} else {
|
||||
if (this.serverEntries == null) {
|
||||
this.serverEntries = new HashMap<>();
|
||||
this.setChanged();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void revalidateAllBookshelves() {
|
||||
|
@ -130,6 +160,8 @@ public class BlockEntityAkashicRecord extends PaucalBlockEntity {
|
|||
lookup.remove(sig);
|
||||
}
|
||||
}
|
||||
|
||||
this.setChanged();
|
||||
}
|
||||
|
||||
private Map<String, ? extends PosAndDirHaver> getLookup() {
|
||||
|
|
|
@ -5,6 +5,8 @@ import at.petrak.hexcasting.api.PatternRegistry;
|
|||
import at.petrak.hexcasting.api.spell.Operator;
|
||||
import at.petrak.hexcasting.api.spell.SpellDatum;
|
||||
import at.petrak.hexcasting.common.casting.operators.*;
|
||||
import at.petrak.hexcasting.common.casting.operators.akashic.OpAkashicRead;
|
||||
import at.petrak.hexcasting.common.casting.operators.akashic.OpAkashicWrite;
|
||||
import at.petrak.hexcasting.common.casting.operators.circles.OpCircleBounds;
|
||||
import at.petrak.hexcasting.common.casting.operators.circles.OpImpetusDir;
|
||||
import at.petrak.hexcasting.common.casting.operators.circles.OpImpetusPos;
|
||||
|
@ -121,6 +123,11 @@ public class RegisterPatterns {
|
|||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("aw", HexDir.NORTH_EAST), prefix("identity"),
|
||||
OpIdentityKindOf.INSTANCE);
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqwqqqqqaq", HexDir.WEST), prefix("akashic/read"),
|
||||
OpAkashicRead.INSTANCE);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("eeeweeeeede", HexDir.EAST), prefix("akashic/write"),
|
||||
OpAkashicWrite.INSTANCE);
|
||||
|
||||
// == Spells ==
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("de", HexDir.NORTH_EAST), prefix("print"),
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package at.petrak.hexcasting.common.casting.mishaps
|
||||
|
||||
import at.petrak.hexcasting.api.spell.SpellDatum
|
||||
import at.petrak.hexcasting.common.casting.CastingContext
|
||||
import at.petrak.hexcasting.common.casting.colors.FrozenColorizer
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.world.item.DyeColor
|
||||
|
||||
class MishapNoAkashicRecord(val pos: BlockPos) : Mishap() {
|
||||
override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer =
|
||||
dyeColor(DyeColor.PURPLE)
|
||||
|
||||
override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList<SpellDatum<*>>) {
|
||||
ctx.caster.giveExperiencePoints(-100)
|
||||
}
|
||||
|
||||
override fun errorMessage(ctx: CastingContext, errorCtx: Context): Component =
|
||||
error("no_akashic_record", pos.toShortString())
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package at.petrak.hexcasting.common.casting.operators.akashic
|
||||
|
||||
import at.petrak.hexcasting.api.spell.ConstManaOperator
|
||||
import at.petrak.hexcasting.api.spell.Operator.Companion.getChecked
|
||||
import at.petrak.hexcasting.api.spell.SpellDatum
|
||||
import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicRecord
|
||||
import at.petrak.hexcasting.common.casting.CastingContext
|
||||
import at.petrak.hexcasting.common.casting.Widget
|
||||
import at.petrak.hexcasting.common.casting.mishaps.MishapNoAkashicRecord
|
||||
import at.petrak.hexcasting.hexmath.HexPattern
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
object OpAkashicRead : ConstManaOperator {
|
||||
override val argc = 2
|
||||
override val manaCost = 10_000
|
||||
|
||||
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): List<SpellDatum<*>> {
|
||||
val pos = args.getChecked<Vec3>(0)
|
||||
val key = args.getChecked<HexPattern>(1)
|
||||
|
||||
val bpos = BlockPos(pos)
|
||||
val tile = ctx.world.getBlockEntity(bpos)
|
||||
if (tile !is BlockEntityAkashicRecord) {
|
||||
throw MishapNoAkashicRecord(bpos)
|
||||
}
|
||||
|
||||
val datum = tile.lookupPattern(key)
|
||||
return listOf(datum ?: SpellDatum.make(Widget.NULL))
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package at.petrak.hexcasting.common.casting.operators.akashic
|
||||
|
||||
import at.petrak.hexcasting.api.spell.ConstManaOperator
|
||||
import at.petrak.hexcasting.api.spell.Operator.Companion.getChecked
|
||||
import at.petrak.hexcasting.api.spell.Operator.Companion.spellListOf
|
||||
import at.petrak.hexcasting.api.spell.SpellDatum
|
||||
import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicRecord
|
||||
import at.petrak.hexcasting.common.casting.CastingContext
|
||||
import at.petrak.hexcasting.common.casting.Widget
|
||||
import at.petrak.hexcasting.common.casting.mishaps.MishapNoAkashicRecord
|
||||
import at.petrak.hexcasting.hexmath.HexPattern
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
object OpAkashicWrite : ConstManaOperator {
|
||||
override val argc = 3
|
||||
override val manaCost = 10_000
|
||||
|
||||
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): List<SpellDatum<*>> {
|
||||
val pos = args.getChecked<Vec3>(0)
|
||||
val key = args.getChecked<HexPattern>(1)
|
||||
val datum = args[2]
|
||||
|
||||
val bpos = BlockPos(pos)
|
||||
val tile = ctx.world.getBlockEntity(bpos)
|
||||
if (tile !is BlockEntityAkashicRecord) {
|
||||
throw MishapNoAkashicRecord(bpos)
|
||||
}
|
||||
|
||||
val newPos = tile.addNewDatum(key, datum)
|
||||
return spellListOf(
|
||||
if (newPos == null)
|
||||
Widget.NULL
|
||||
else
|
||||
Vec3.atCenterOf(newPos)
|
||||
)
|
||||
}
|
||||
}
|
|
@ -129,6 +129,15 @@ public class HexBlockStatesAndModels extends PaucalBlockStateAndModelProvider {
|
|||
var sconceModel = models().getExistingFile(modLoc("amethyst_sconce"));
|
||||
simpleBlock(HexBlocks.SCONCE.get(), sconceModel);
|
||||
simpleBlockItem(HexBlocks.SCONCE.get(), sconceModel);
|
||||
|
||||
// temp
|
||||
var cartoModel = models().getExistingFile(new ResourceLocation("cartography_table"));
|
||||
simpleBlock(HexBlocks.AKASHIC_RECORD.get(), cartoModel);
|
||||
simpleBlockItem(HexBlocks.AKASHIC_RECORD.get(), cartoModel);
|
||||
|
||||
blockAndItem(HexBlocks.AKASHIC_BOOKSHELF.get(), models().orientable("akashic_bookshelf",
|
||||
new ResourceLocation("block/oak_planks"), new ResourceLocation("block/bookshelf"),
|
||||
new ResourceLocation("block/oak_planks")));
|
||||
}
|
||||
|
||||
private void impetus(Block block, String name, String stub) {
|
||||
|
|
|
@ -77,6 +77,8 @@
|
|||
"hexcasting.tooltip.lens.impetus.storedplayer": "Bound to %s",
|
||||
"hexcasting.tooltip.lens.impetus.storedplayer.none": "Unbound",
|
||||
"hexcasting.tooltip.lens.pattern.invalid": "Invalid Pattern",
|
||||
"hexcasting.tooltip.lens.akashic.bookshelf.location": "Owning record at %s",
|
||||
"hexcasting.tooltip.lens.akashic.record.count": "%s iotas stored",
|
||||
"hexcasting.tooltip.brainsweep.profession": "Profession: %s",
|
||||
"hexcasting.tooltip.brainsweep.profession.any": "Any Profession",
|
||||
"hexcasting.tooltip.brainsweep.biome": "Biome: %s",
|
||||
|
@ -84,6 +86,7 @@
|
|||
"hexcasting.tooltip.brainsweep.min_level": "Level %d or higher",
|
||||
"hexcasting.spelldata.onitem": "§7Contains: §r%s",
|
||||
"hexcasting.spelldata.entity.whoknows": "An Entity (this should only show up if this was stored before the 0.5.0 update, use Scribe's Reflection, Scribe's Gambit to fix)",
|
||||
"hexcasting.spelldata.akashic.nopos": "The owning record does not know of any iota here (this is a bug)",
|
||||
|
||||
"advancement.hexcasting:root": "Hexcasting Research",
|
||||
"advancement.hexcasting:root.desc": "Enter an amethyst geode deep underground, a concentrated source of media.",
|
||||
|
@ -287,6 +290,7 @@
|
|||
"hexcasting.mishap.already_brainswept": "The villager has already been used",
|
||||
"hexcasting.mishap.no_spell_circle": "%s requires a spell circle",
|
||||
"hexcasting.mishap.others_name": "Tried to invade %s's privacy",
|
||||
"hexcasting.mishap.no_akashic_record": "No akashic record at %s",
|
||||
|
||||
"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/$",
|
||||
|
||||
|
|
Loading…
Reference in a new issue