mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 19:29:31 +00:00
Remove more uses of patchouli internals
This commit is contained in:
1 parent
2fa5d6ebab
commit
5d26ea4486
3 files changed
+6
-11
No files matched your search
@@ -76,7 +76,6 @@ import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
import vazkii.patchouli.api.IMultiblock;
|
||||
import vazkii.patchouli.api.IStateMatcher;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
import vazkii.patchouli.common.multiblock.StateMatcher;
|
||||
|
||||
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
|
||||
|
||||
@@ -190,7 +189,7 @@ public class Botania {
|
||||
"_________",
|
||||
}
|
||||
};
|
||||
IStateMatcher sm = StateMatcher.fromPredicate(Blocks.IRON_BLOCK, state -> {
|
||||
IStateMatcher sm = PatchouliAPI.instance.predicateMatcher(Blocks.IRON_BLOCK, state -> {
|
||||
try {
|
||||
// No world to pass here, so just fall back to false if it errors
|
||||
return state.isBeaconBase(null, null, null);
|
||||
|
||||
@@ -56,7 +56,6 @@ import vazkii.botania.common.network.PacketBotaniaEffect;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
import vazkii.patchouli.api.IMultiblock;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
import vazkii.patchouli.common.multiblock.StateMatcher;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -115,7 +114,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
'L', Blocks.LAPIS_BLOCK,
|
||||
'B', Blocks.OBSIDIAN,
|
||||
'0', Blocks.OBSIDIAN,
|
||||
'F', StateMatcher.fromPredicate(ModBlocks.whiteFlower, state -> state.getBlock().isIn(ModTags.Blocks.MYSTICAL_FLOWERS))
|
||||
'F', PatchouliAPI.instance.predicateMatcher(ModBlocks.whiteFlower, state -> state.getBlock().isIn(ModTags.Blocks.MYSTICAL_FLOWERS))
|
||||
));
|
||||
|
||||
private static final LazyValue<IMultiblock> FORMED_MULTIBLOCK = new LazyValue<>(() -> PatchouliAPI.instance.makeMultiblock(
|
||||
@@ -124,7 +123,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
'L', ModBlocks.enchanter,
|
||||
'B', Blocks.OBSIDIAN,
|
||||
'0', Blocks.OBSIDIAN,
|
||||
'F', StateMatcher.fromPredicate(ModBlocks.whiteFlower, state -> state.getBlock().isIn(ModTags.Blocks.MYSTICAL_FLOWERS))
|
||||
'F', PatchouliAPI.instance.predicateMatcher(ModBlocks.whiteFlower, state -> state.getBlock().isIn(ModTags.Blocks.MYSTICAL_FLOWERS))
|
||||
));
|
||||
|
||||
public State stage = State.IDLE;
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -31,9 +30,9 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.common.advancements.UseItemSuccessTrigger;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
import vazkii.patchouli.common.base.PatchouliSounds;
|
||||
import vazkii.patchouli.common.book.Book;
|
||||
import vazkii.patchouli.common.book.BookRegistry;
|
||||
|
||||
@@ -87,14 +86,12 @@ public class ItemLexicon extends Item implements IElvenItem {
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
|
||||
ItemStack stack = playerIn.getHeldItem(handIn);
|
||||
Book book = getBook();
|
||||
|
||||
if (playerIn instanceof ServerPlayerEntity) {
|
||||
ServerPlayerEntity player = (ServerPlayerEntity) playerIn;
|
||||
UseItemSuccessTrigger.INSTANCE.trigger(player, stack, player.getServerWorld(), player.getX(), player.getY(), player.getZ());
|
||||
PatchouliAPI.instance.openBookGUI((ServerPlayerEntity) playerIn, book.id);
|
||||
SoundEvent sfx = PatchouliSounds.getSound(book.openSound, PatchouliSounds.book_open);
|
||||
playerIn.playSound(sfx, 1F, (float) (0.7 + Math.random() * 0.4));
|
||||
PatchouliAPI.instance.openBookGUI((ServerPlayerEntity) playerIn, getRegistryName());
|
||||
playerIn.playSound(ModSounds.lexiconOpen, 1F, (float) (0.7 + Math.random() * 0.4));
|
||||
}
|
||||
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
|
||||
Reference in new issue
Block a user