diff --git a/src/main/java/com/teammoeg/caupona/compat/top/TOPRegister.java b/src/main/java/com/teammoeg/caupona/compat/top/TOPRegister.java index a79ebfd8..93f907eb 100644 --- a/src/main/java/com/teammoeg/caupona/compat/top/TOPRegister.java +++ b/src/main/java/com/teammoeg/caupona/compat/top/TOPRegister.java @@ -39,6 +39,7 @@ public static Object register(ITheOneProbe top) { top.registerProvider(new GravyBoatProvider()); top.registerProvider(new LoafProvider()); top.registerProvider(new PotProvider()); + top.registerProvider(new PanProvider()); top.registerProvider(new StoveProvider()); top.registerProvider(new WolfProvider()); top.registerProvider(new InfProvider()); diff --git a/src/main/java/com/teammoeg/caupona/compat/top/providers/PanProvider.java b/src/main/java/com/teammoeg/caupona/compat/top/providers/PanProvider.java new file mode 100644 index 00000000..14ebac0a --- /dev/null +++ b/src/main/java/com/teammoeg/caupona/compat/top/providers/PanProvider.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2024 TeamMoeg + * + * This file is part of Caupona. + * + * Caupona is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * Caupona is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Specially, we allow this software to be used alongside with closed source software Minecraft(R) and Forge or other modloader. + * Any mods or plugins can also use apis provided by forge or com.teammoeg.caupona.api without using GPL or open source. + * + * You should have received a copy of the GNU General Public License + * along with Caupona. If not, see . + */ + +package com.teammoeg.caupona.compat.top.providers; + +import java.util.ArrayList; +import java.util.List; + +import com.teammoeg.caupona.blocks.pan.PanBlockEntity; +import com.teammoeg.caupona.blocks.pot.StewPotBlockEntity; +import com.teammoeg.caupona.compat.top.TOPRegister; +import mcjty.theoneprobe.api.IProbeHitData; +import mcjty.theoneprobe.api.IProbeInfo; +import mcjty.theoneprobe.api.IProbeInfoProvider; +import mcjty.theoneprobe.api.ProbeMode; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.items.ItemStackHandler; + +public class PanProvider implements IProbeInfoProvider { + + @Override + public void addProbeInfo(ProbeMode mode, IProbeInfo info, Player player, Level level, BlockState state, IProbeHitData hitResult) { + if(level.getBlockEntity(hitResult.getPos()) instanceof PanBlockEntity entity) { + if(player.isShiftKeyDown()) { + ItemStackHandler inventory=entity.getInv(); + List inputs=new ArrayList<>(); + for(int i=0;i0) { + if(player.isShiftKeyDown()){ + if(entity.preout!=null) { + info.item(entity.preout); + } + } + } + + } + } + + + @Override + public ResourceLocation getID() { + return TOPRegister.idForBlock("pan"); + } + +}