diff --git a/README.md b/README.md index a5ba1dc..05a0d97 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ allows you to summon any entity to its location. ### blocks: * summoning table! the centerpiece of any summoning ritual. used by.. throwing in a true name and building a couple rings of enchanted candles. - * crafted like an enchanting table, with a true name instead of a book and copper instead of diamonds + * crafted like an enchanting table, with a true name instead of a book and an amethyst shard and copper ingot instead of diamonds * using a flint and steel on the summoning table while focusing will attempt to activate the summoning * using a flint and steel on the summoning table without focusing will burn the true name you placed within (assuming you did put one in - you should give it a try!) diff --git a/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableMenu.java b/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableMenu.java index 194dee4..6d56273 100644 --- a/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableMenu.java +++ b/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableMenu.java @@ -45,7 +45,7 @@ public SummoningTableMenu(int containerId, Inventory playerInventory, IItemHandl } // table inv - this.trueNameSlot = new MoodySlotItemHandler(tableInventory, 0, 44, 41) { + this.trueNameSlot = new MoodySlotItemHandler(tableInventory, 0, 44, 45) { @Override public boolean mayPlace(ItemStack itemStack) { return itemStack.is(FamiliarItems.TRUE_NAME_ITEM); @@ -65,18 +65,18 @@ public int getMaxStackSize() { this.addSlot(this.trueNameSlot); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { - this.addSlot(new MoodySlotItemHandler(tableInventory, j + i * 2 + 1, 116 + j * 18, 32 + i * 18)); + this.addSlot(new MoodySlotItemHandler(tableInventory, j + i * 2 + 1, 116 + j * 18, 36 + i * 18)); } } // player inv for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - this.addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 98 + i * 18)); + this.addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 105 + i * 18)); } } for (int k = 0; k < 9; k++) { - this.addSlot(new Slot(playerInventory, k, 8 + k * 18, 156)); + this.addSlot(new Slot(playerInventory, k, 8 + k * 18, 163)); } // table data diff --git a/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableScreen.java b/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableScreen.java index 667de1d..db478b7 100644 --- a/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableScreen.java +++ b/src/main/java/io/github/afamiliarquiet/familiar_magic/client/gooey/SummoningTableScreen.java @@ -1,5 +1,6 @@ package io.github.afamiliarquiet.familiar_magic.client.gooey; +import com.mojang.datafixers.util.Pair; import io.github.afamiliarquiet.familiar_magic.FamiliarTricks; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.client.gui.GuiGraphics; @@ -9,6 +10,8 @@ import net.minecraft.world.entity.player.Inventory; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; +import java.util.Optional; import static io.github.afamiliarquiet.familiar_magic.FamiliarMagic.MOD_ID; @@ -18,12 +21,30 @@ public class SummoningTableScreen extends AbstractContainerScreen BAD_HEIGHT = Pair.of( + "gui.familiar_magic.candle_helper.bad_height", + ResourceLocation.fromNamespaceAndPath(MOD_ID, "container/bad_height") + ); + private static final Pair BAD_QUANTITY = Pair.of( + "gui.familiar_magic.candle_helper.bad_quantity", + ResourceLocation.fromNamespaceAndPath(MOD_ID, "container/bad_quantity") + ); + private static final Pair MATCHED_CANDLE = Pair.of( + "gui.familiar_magic.candle_helper.matched_candle", + ResourceLocation.fromNamespaceAndPath(MOD_ID, "container/matched_candle") + ); + private static final Pair NO_CANDLE = Pair.of( + "gui.familiar_magic.candle_helper.no_candle", + ResourceLocation.fromNamespaceAndPath(MOD_ID, "container/no_candle") + ); + private static final Pair UNLIT_CANDLE = Pair.of( + "gui.familiar_magic.candle_helper.unlit_candle", + ResourceLocation.fromNamespaceAndPath(MOD_ID, "container/unlit_candle") + ); + private static final Pair UNMATCHED_CANDLE = Pair.of( + "gui.familiar_magic.candle_helper.unmatched_candle", + ResourceLocation.fromNamespaceAndPath(MOD_ID, "container/unmatched_candle") + ); private static final int[] CANDLE_CENTER_SCREEN_OFFSETS = { -30,-30, -18,-30, -6,-30, 6,-30, 18,-30, 30,-30, @@ -37,8 +58,8 @@ public class SummoningTableScreen extends AbstractContainerScreen candleInfo = getCandleSprite(itemNybbles[i], worldNybbles[i], badItem); renderCandleTile( graphics, centerX + CANDLE_CENTER_SCREEN_OFFSETS[i * 2], centerY + CANDLE_CENTER_SCREEN_OFFSETS[i * 2 + 1], - getCandleSprite(itemNybbles[i], worldNybbles[i], badItem) + mouseX, mouseY, + candleInfo.getFirst(), candleInfo.getSecond() ); } } - private void renderCandleTile(GuiGraphics graphics, int centerX, int centerY, ResourceLocation candleSprite) { - graphics.blitSprite(candleSprite, centerX - 4, centerY - 4, 8, 8); + private void renderCandleTile(GuiGraphics graphics, int centerX, int centerY, int mouseX, int mouseY, String translationKey, ResourceLocation candleSprite) { + int x = centerX - 4; + int y = centerY - 4; + graphics.blitSprite(candleSprite, x, y, 8, 8); + if (this.isHovering(x - this.leftPos, y - this.topPos, 8, 8, mouseX, mouseY)) { + graphics.renderTooltip(this.font, List.of(Component.translatable(translationKey)), Optional.empty(), mouseX, mouseY); + } } - private ResourceLocation getCandleSprite(byte item, byte world, boolean badItem) { + private Pair getCandleSprite(byte item, byte world, boolean badItem) { if ((FamiliarTricks.NO_CANDLE & world) != 0) { // no candle in world for nybble return NO_CANDLE; } else if ((item & 0b1100) != (world & 0b1100)) { // wrong height @@ -99,23 +127,4 @@ private ResourceLocation getCandleSprite(byte item, byte world, boolean badItem) return MATCHED_CANDLE; } } - - @Override - protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) { - super.renderLabels(guiGraphics, mouseX, mouseY); - -// guiGraphics.drawString( -// this.font, -// Component.literal(FamiliarTricks.uuidToTrueName(UUIDUtil.uuidFromIntArray(new int[]{ -// menu.tableData.get(0), -// menu.tableData.get(1), -// menu.tableData.get(2), -// menu.tableData.get(3) -// }))), -// 52, -// 31, -// 0x404040, -// false -// ); - } } diff --git a/src/main/java/io/github/afamiliarquiet/familiar_magic/item/TrueNameItem.java b/src/main/java/io/github/afamiliarquiet/familiar_magic/item/TrueNameItem.java index 85d7677..ede64f6 100644 --- a/src/main/java/io/github/afamiliarquiet/familiar_magic/item/TrueNameItem.java +++ b/src/main/java/io/github/afamiliarquiet/familiar_magic/item/TrueNameItem.java @@ -1,6 +1,5 @@ package io.github.afamiliarquiet.familiar_magic.item; -import io.github.afamiliarquiet.familiar_magic.FamiliarMagic; import io.github.afamiliarquiet.familiar_magic.FamiliarTricks; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.core.component.DataComponents; @@ -12,7 +11,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemUtils; -import org.jetbrains.annotations.Nullable; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/resources/assets/familiar_magic/lang/en_us.json b/src/main/resources/assets/familiar_magic/lang/en_us.json index 956055a..7a3db21 100644 --- a/src/main/resources/assets/familiar_magic/lang/en_us.json +++ b/src/main/resources/assets/familiar_magic/lang/en_us.json @@ -6,6 +6,12 @@ "block.familiar_magic.summoning_table": "Summoning Table", "block.familiar_magic.smoke_wisp": "Wisp of Smoke", "container.familiar_magic.summon": "Summon", + "gui.familiar_magic.candle_helper.bad_height": "Misplaced Candle", + "gui.familiar_magic.candle_helper.bad_quantity": "Miscounted Candle", + "gui.familiar_magic.candle_helper.matched_candle": "Perfect Candle", + "gui.familiar_magic.candle_helper.no_candle": "Absent Candle", + "gui.familiar_magic.candle_helper.unlit_candle": "Dim Candle", + "gui.familiar_magic.candle_helper.unmatched_candle": "Pleasant Candle", "gui.familiar_magic.summoning_request.name": "A Summoner Calls!", "gui.familiar_magic.summoning_request.blurb": "Focus [%s] your mind and and Jump to their location or Sneak away from their call.", "gui.familiar_magic.summoning_request.position": "%s / %s / %s", diff --git a/src/main/resources/assets/familiar_magic/models/block/summoning_table.json b/src/main/resources/assets/familiar_magic/models/block/summoning_table.json index 0e723ab..f4798b2 100644 --- a/src/main/resources/assets/familiar_magic/models/block/summoning_table.json +++ b/src/main/resources/assets/familiar_magic/models/block/summoning_table.json @@ -4,7 +4,9 @@ "particle": "familiar_magic:block/summoning_table_bottom", "bottom": "familiar_magic:block/summoning_table_bottom", "top": "familiar_magic:block/summoning_table_top", - "side": "familiar_magic:block/summoning_table_side" + "side": "familiar_magic:block/summoning_table_side", + "side_north": "familiar_magic:block/summoning_table_side_north", + "side_west": "familiar_magic:block/summoning_table_side_west" }, "elements": [ { "from": [ 0, 0, 0 ], @@ -12,9 +14,9 @@ "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, - "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "north" }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#side_north", "cullface": "north" }, "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "west" }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#side_west", "cullface": "west" }, "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "east" } } } diff --git a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_side_north.png b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_side_north.png new file mode 100644 index 0000000..d5cf9fe Binary files /dev/null and b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_side_north.png differ diff --git a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_side_west.png b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_side_west.png new file mode 100644 index 0000000..5b9010e Binary files /dev/null and b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_side_west.png differ diff --git a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top.png b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top.png index 8018b53..4f6bcd5 100644 Binary files a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top.png and b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top.png differ diff --git a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_burning.png b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_burning.png index f744188..8ac70d2 100644 Binary files a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_burning.png and b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_burning.png differ diff --git a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_summoning.png b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_summoning.png index 719c31d..b23cf08 100644 Binary files a/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_summoning.png and b/src/main/resources/assets/familiar_magic/textures/block/summoning_table_top_summoning.png differ diff --git a/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table.png b/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table.png index eb579ad..8339c98 100644 Binary files a/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table.png and b/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table.png differ diff --git a/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table_blocked.png b/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table_blocked.png index 949f29b..6e48a76 100644 Binary files a/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table_blocked.png and b/src/main/resources/assets/familiar_magic/textures/gui/container/summoning_table_blocked.png differ diff --git a/src/main/resources/data/familiar_magic/recipe/summoning_table.json b/src/main/resources/data/familiar_magic/recipe/summoning_table.json index a9375d0..1cd1c24 100644 --- a/src/main/resources/data/familiar_magic/recipe/summoning_table.json +++ b/src/main/resources/data/familiar_magic/recipe/summoning_table.json @@ -8,13 +8,16 @@ "N": { "item": "familiar_magic:true_name" }, + "A": { + "item": "minecraft:amethyst_shard" + }, "C": { "item": "minecraft:copper_ingot" } }, "pattern": [ " N ", - "C#C", + "A#C", "###" ], "result": {