McJtyMods / ModTutorials

Companion code for the modding tutorials at https://www.mcjty.eu/
MIT License
136 stars 31 forks source link

Crash when implementing TOP support #2

Closed Deckee closed 8 years ago

Deckee commented 8 years ago

I am trying to add support for your The One Probe using the info from this guide and keep getting this error, I'm not sure if this is bug with top or my code. error.txt

`public class TOPCompatibility {

private static boolean registered;

public static void registered() {
    if (registered)
        return;
    LogHelper.info("LogRegistered");
    registered = true;
    FMLInterModComms.sendFunctionMessage("theoneprobe", "getTheOneProbe", "Deckee.ChestMaker.utility.Compat.top.TOPCompatibility$GetTheOneProbe");
}

public static class GetTheOneProbe implements com.google.common.base.Function<ITheOneProbe, Void> {

    public static ITheOneProbe probe;

    @Nullable
    @Override
    public Void apply(ITheOneProbe theOneProbe) {

        probe = theOneProbe;

        LogHelper.info("theoneprobe is active");

        probe.registerProvider(new IProbeInfoProvider() {

            @Override
            public String getID() {
                return "chestmaker:default";
            }

            @Override
            public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
                if (blockState.getBlock() instanceof TOPInfoProvider) {
                    TOPInfoProvider provider = (TOPInfoProvider) blockState.getBlock();
                    provider.addProbeInfo(mode, probeInfo, player, world, blockState, data);

                }

            }

        });
        return null;
    }

}

}`

McJty commented 8 years ago

So what is the error? NM. Missed that link

McJty commented 8 years ago

Are you sure Deckee.ChestMaker.utility.Compat.top.TOPCompatibility$GetTheOneProbe is the correct package name?

Deckee commented 8 years ago

I fixed it its was it need to go com.Deckee.ChestMaker.utility.top.TOPCompatibility$GetTheOneProbe git hub derp and didnt send a notification.