From a664a52bbe63c907e3c7e23b0bdbd117c47a7596 Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 21 Sep 2022 22:58:29 +0200 Subject: [PATCH] Anyone can read the spellbook now --- .../client/gui/spellbook/SpellbookProfilePageContent.java | 4 ++-- .../unicopia/container/SpellbookScreenHandler.java | 3 +-- .../com/minelittlepony/unicopia/entity/SpellbookEntity.java | 2 +- .../java/com/minelittlepony/unicopia/item/SpellbookItem.java | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookProfilePageContent.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookProfilePageContent.java index a1372462..c56407a2 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookProfilePageContent.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookProfilePageContent.java @@ -30,8 +30,8 @@ public class SpellbookProfilePageContent extends DrawableHelper implements Spell public void init(SpellbookScreen screen, Identifier pageId) { Bounds bounds = screen.getFrameBounds(); int size = 32; - int x = screen.getX() + bounds.left + bounds.width / 4 - size + 10; - int y = screen.getY() + bounds.top + bounds.height / 2; + int x = screen.getX() + bounds.left + bounds.width / 4 - size + 5; + int y = screen.getY() + bounds.top + bounds.height / 2 + 3; screen.addDrawable(new SpellbookScreen.ImageButton(x, y, size, size)) diff --git a/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java b/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java index 4fe64214..af24c961 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java +++ b/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreenHandler.java @@ -5,7 +5,6 @@ import java.util.function.Predicate; import org.jetbrains.annotations.Nullable; -import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellbookRecipe; import com.minelittlepony.unicopia.container.inventory.*; import com.minelittlepony.unicopia.item.UItems; @@ -153,7 +152,7 @@ public class SpellbookScreenHandler extends ScreenHandler { @Override public boolean canUse(PlayerEntity player) { - return EquinePredicates.IS_CASTER.test(player); + return player.isAlive(); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java index 11f13e5a..77d93cf3 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java @@ -222,7 +222,7 @@ public class SpellbookEntity extends MobEntity { return ActionResult.SUCCESS; } - if (isOpen() && EquinePredicates.PLAYER_UNICORN.test(player)) { + if (isOpen()) { setBored(false); player.openHandledScreen(new ExtendedScreenHandlerFactory() { @Override diff --git a/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java b/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java index 2bbbd644..4a53fbe0 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java @@ -2,7 +2,6 @@ package com.minelittlepony.unicopia.item; import org.jetbrains.annotations.Nullable; -import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.entity.SpellbookEntity; import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.util.Dispensable; @@ -44,7 +43,7 @@ public class SpellbookItem extends BookItem implements Dispensable { @Nullable PlayerEntity player = context.getPlayer(); - if (!context.getWorld().isClient && EquinePredicates.PLAYER_UNICORN.test(player)) { + if (!context.getWorld().isClient) { BlockPos pos = context.getBlockPos().offset(context.getSide()); placeBook(context.getStack(), context.getWorld(), pos.getX(), pos.getY(), pos.getZ(), context.getPlayerYaw() + 180);