Re added waila support for blocks
This commit is contained in:
parent
1acdc13e2d
commit
32027f948c
5 changed files with 19 additions and 30 deletions
|
@ -1,6 +1,5 @@
|
|||
package techreborn.parts.walia;
|
||||
|
||||
import mcmultipart.block.TileMultipart;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
@ -35,7 +34,6 @@ public class WailaMcMultiPartCompact implements ICompatModule {
|
|||
}
|
||||
|
||||
public static void callbackRegister(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new WaliaPartProvider(),
|
||||
TileMultipart.class);
|
||||
registrar.registerBodyProvider(new WaliaPartProvider(), TileMultipart.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package techreborn.parts.walia;
|
||||
|
||||
import mcmultipart.block.TileMultipart;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mcmultipart.raytrace.PartMOP;
|
||||
import mcmultipart.raytrace.RayTraceUtils;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
|
@ -11,15 +13,12 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.parts.CableMultipart;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 07/03/2016.
|
||||
*/
|
||||
|
@ -64,8 +63,8 @@ public class WaliaPartProvider implements IWailaDataProvider {
|
|||
|
||||
//Stolen from https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java
|
||||
private PartMOP reTrace(World world, BlockPos pos, EntityPlayer player) {
|
||||
Vec3 start = RayTraceUtils.getStart(player);
|
||||
Vec3 end = RayTraceUtils.getEnd(player);
|
||||
Vec3d start = RayTraceUtils.getStart(player);
|
||||
Vec3d end = RayTraceUtils.getEnd(player);
|
||||
RayTraceUtils.RayTraceResultPart result = getMultipartTile(world, pos).getPartContainer().collisionRayTrace(start, end);
|
||||
return result == null ? null : result.hit;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
|
|||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import techreborn.client.render.parts.ClientPartLoader;
|
||||
import techreborn.compat.waila.CompatModuleWaila;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.parts.StandalonePartCompact;
|
||||
import techreborn.parts.TechRebornParts;
|
||||
|
@ -33,7 +34,7 @@ public class CompatManager {
|
|||
if (Loader.isModLoaded("gregtech")) {
|
||||
isGregTechLoaded = true;
|
||||
}
|
||||
// registerCompact(CompatModuleWaila.class, "Waila");
|
||||
registerCompact(CompatModuleWaila.class, "Waila");
|
||||
// registerCompact(MinetweakerCompat.class, "MineTweaker3");
|
||||
// registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty");
|
||||
// registerCompact(RecipesBuildcraft.class, "BuildCraft|Builders");
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.compat.waila;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
@ -7,20 +10,16 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
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) {
|
||||
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (accessor.getTileEntity() instanceof IListInfoProvider) {
|
||||
((IListInfoProvider) accessor.getTileEntity()).addInfo(info, true);
|
||||
}
|
||||
|
@ -31,30 +30,22 @@ public class WailaProviderMachines implements IWailaDataProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack item, List<String> tip,
|
||||
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
public List<String> getWailaHead(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack item, List<String> tip,
|
||||
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
public List<String> getWailaTail(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te,
|
||||
NBTTagCompound tag, World w, BlockPos pos) {
|
||||
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, BlockPos pos) {
|
||||
return tag;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue