Fix gregtech tileentities showing up as unnamed or draconium lens
This commit is contained in:
@@ -86,6 +86,7 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "com.jaquadro.minecraft.storagedrawers:StorageDrawers:1.12.2-5.4.2:api"
|
deobfCompile "com.jaquadro.minecraft.storagedrawers:StorageDrawers:1.12.2-5.4.2:api"
|
||||||
|
deobfCompile "gregtechce:gregtech:1.12.2:1.12.0.662"
|
||||||
|
|
||||||
// installable runtime dependencies
|
// installable runtime dependencies
|
||||||
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ import appeng.integration.modules.gregtech.GTCEInventoryAdaptor;
|
|||||||
import appeng.util.*;
|
import appeng.util.*;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
|
import gregtech.api.block.machines.BlockMachine;
|
||||||
|
import gregtech.api.metatileentity.MetaTileEntity;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
@@ -48,6 +50,7 @@ import net.minecraft.util.math.RayTraceResult;
|
|||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraftforge.items.wrapper.RangedWrapper;
|
import net.minecraftforge.items.wrapper.RangedWrapper;
|
||||||
@@ -109,6 +112,8 @@ import appeng.util.inv.IInventoryDestination;
|
|||||||
import appeng.util.inv.InvOperation;
|
import appeng.util.inv.InvOperation;
|
||||||
import appeng.util.item.AEItemStack;
|
import appeng.util.item.AEItemStack;
|
||||||
|
|
||||||
|
import static gregtech.api.block.machines.BlockMachine.getMetaTileEntity;
|
||||||
|
|
||||||
|
|
||||||
public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, IConfigManagerHost, ICraftingProvider, IUpgradeableHost
|
public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, IConfigManagerHost, ICraftingProvider, IUpgradeableHost
|
||||||
{
|
{
|
||||||
@@ -1235,6 +1240,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
|||||||
final IBlockState directedBlockState = hostWorld.getBlockState( targ );
|
final IBlockState directedBlockState = hostWorld.getBlockState( targ );
|
||||||
final Block directedBlock = directedBlockState.getBlock();
|
final Block directedBlock = directedBlockState.getBlock();
|
||||||
ItemStack what = new ItemStack( directedBlock, 1, directedBlock.getMetaFromState( directedBlockState ) );
|
ItemStack what = new ItemStack( directedBlock, 1, directedBlock.getMetaFromState( directedBlockState ) );
|
||||||
|
|
||||||
|
if ( Loader.isModLoaded("gregtech") && directedBlock instanceof BlockMachine )
|
||||||
|
{
|
||||||
|
MetaTileEntity metaTileEntity = getMetaTileEntity(hostWorld, targ);
|
||||||
|
return metaTileEntity.getMetaFullName();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Vec3d from = new Vec3d( hostTile.getPos().getX() + 0.5, hostTile.getPos().getY() + 0.5, hostTile.getPos().getZ() + 0.5 );
|
Vec3d from = new Vec3d( hostTile.getPos().getX() + 0.5, hostTile.getPos().getY() + 0.5, hostTile.getPos().getZ() + 0.5 );
|
||||||
|
|||||||
Reference in New Issue
Block a user