This commit is contained in:
parent
1dfa6c094f
commit
427963b40a
6 changed files with 62 additions and 30 deletions
|
@ -3,6 +3,7 @@ package techreborn.client;
|
|||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
|
@ -60,8 +61,8 @@ public class StackToolTipEvent
|
|||
try
|
||||
{
|
||||
Block block = Block.getBlockFromItem(event.getItemStack().getItem());
|
||||
if (block != null && block instanceof BlockContainer
|
||||
&& block.getClass().getCanonicalName().startsWith("techreborn."))
|
||||
if (block != null && (block instanceof BlockContainer || block instanceof ITileEntityProvider)
|
||||
&& Block.blockRegistry.getNameForObject(block).getResourceDomain().contains("techreborn"))
|
||||
{
|
||||
TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld,
|
||||
block.getDefaultState());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue