Update walia support

This commit is contained in:
modmuss50 2017-06-13 20:37:17 +01:00
parent cb0303d82f
commit 2292741443
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
3 changed files with 9 additions and 37 deletions

View file

@ -33,7 +33,6 @@ import techreborn.compat.crafttweaker.CraftTweakerCompat;
import techreborn.compat.ic2.RecipesIC2;
import techreborn.compat.theoneprobe.TheOneProbeCompat;
import techreborn.compat.tinkers.CompatModuleTinkers;
import techreborn.compat.waila.CompatModuleWaila;
import java.util.ArrayList;
@ -48,7 +47,6 @@ public class CompatManager {
isIC2Loaded = Loader.isModLoaded("ic2");
isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage");
register(CraftTweakerCompat.class, "crafttweaker");
register(CompatModuleWaila.class, "Waila");
register(CompatModuleTinkers.class, "tconstruct");
register(TheOneProbeCompat.class, "theoneprobe");
//register(CompatModulePsi.class, "Psi");

View file

@ -24,36 +24,16 @@
package techreborn.compat.waila;
import mcp.mobius.waila.api.IWailaPlugin;
import mcp.mobius.waila.api.IWailaRegistrar;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import reborncore.common.tile.TileMachineBase;
import techreborn.compat.ICompatModule;
import mcp.mobius.waila.api.WailaPlugin;
import reborncore.common.BaseTileBlock;
public class CompatModuleWaila implements ICompatModule {
public static void callbackRegister(IWailaRegistrar registrar) {
registrar.registerBodyProvider(new WailaProviderMachines(), TileMachineBase.class);
}
@WailaPlugin
public class CompatModuleWaila implements IWailaPlugin {
@Override
public void preInit(FMLPreInitializationEvent event) {
}
public void init(FMLInitializationEvent event) {
// FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister");
}
@Override
public void postInit(FMLPostInitializationEvent event) {
}
@Override
public void serverStarting(FMLServerStartingEvent event) {
public void register(IWailaRegistrar registrar) {
registrar.registerBodyProvider(new WailaProviderMachines(), BaseTileBlock.class);
}
}

View file

@ -35,22 +35,16 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.IListInfoProvider;
import java.util.ArrayList;
import java.util.List;
public class WailaProviderMachines implements IWailaDataProvider {
private List<String> info = new ArrayList<String>();
@Override
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
if (accessor.getTileEntity() instanceof IListInfoProvider) {
((IListInfoProvider) accessor.getTileEntity()).addInfo(info, true);
((IListInfoProvider) accessor.getTileEntity()).addInfo(tip, true);
}
tip.addAll(info);
info.clear();
return tip;
}
@ -68,7 +62,7 @@ public class WailaProviderMachines implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
return ItemStack.EMPTY;
}
@Override