mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-19 20:00:00 +00:00
Copy fluid registry name instead of the display item id (#1122)
This commit is contained in:
1 parent
ab1e8153f5
commit
6b7e465306
1 file changed
+20
-3
@@ -10,6 +10,8 @@ import java.util.Map;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -205,9 +207,24 @@ public abstract class ShortcutInputHandler {
|
||||
|
||||
private static boolean copyItemStackID(ItemStack stackover) {
|
||||
if (stackover == null || stackover.getItem() == null) return false;
|
||||
GuiScreen.setClipboardString(
|
||||
stackover.getItem().delegate.name()
|
||||
+ (stackover.getItemDamage() != 0 ? "/" + stackover.getItemDamage() : ""));
|
||||
|
||||
String clipboard;
|
||||
|
||||
if (StackInfo.isFluidDisplayItem(stackover)) {
|
||||
final FluidStack fluid = StackInfo.getFluid(stackover);
|
||||
|
||||
if (fluid == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
clipboard = FluidRegistry.getDefaultFluidName(fluid.getFluid());
|
||||
} else {
|
||||
clipboard = stackover.getItem().delegate.name()
|
||||
+ (stackover.getItemDamage() != 0 ? "/" + stackover.getItemDamage() : "");
|
||||
}
|
||||
|
||||
GuiScreen.setClipboardString(clipboard);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user