Update walia support
This commit is contained in:
parent
cb0303d82f
commit
2292741443
3 changed files with 9 additions and 37 deletions
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue