aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlueWeabo <ilia.iliev2005@gmail.com>2023-06-18 11:41:01 +0300
committerGitHub <noreply@github.com>2023-06-18 10:41:01 +0200
commit60f32c754885845d29b2e4556a85dc6fddcf6403 (patch)
treebd777aa0de34e5d78611d4cbde04d8a4c8d5a3e8 /src
parent3cc11ef606c95fc30b01bea66a6ce3b9813a7dad (diff)
downloadGT5-Unofficial-60f32c754885845d29b2e4556a85dc6fddcf6403.tar.gz
GT5-Unofficial-60f32c754885845d29b2e4556a85dc6fddcf6403.tar.bz2
GT5-Unofficial-60f32c754885845d29b2e4556a85dc6fddcf6403.zip
Make Placing cables and pipes easier by making them full blocks when the player sneaks and is holding one (#2088)
* update deps * cables/wire as full block * only when sneaking and allow it for fluid and item pipes * fix other items being able to bring it up
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/common/GT_Client.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java
index 38ed683523..92d3300ed2 100644
--- a/src/main/java/gregtech/common/GT_Client.java
+++ b/src/main/java/gregtech/common/GT_Client.java
@@ -59,9 +59,11 @@ import gregtech.api.enums.SoundResource;
import gregtech.api.gui.GT_GUIColorOverride;
import gregtech.api.gui.modularui.FallbackableSteamTexture;
import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.ITurnable;
import gregtech.api.items.GT_MetaGenerated_Item;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.multitileentity.multiblock.base.MultiBlockPart;
import gregtech.api.net.GT_Packet_ClientPreference;
import gregtech.api.objects.GT_ItemStack;
@@ -75,6 +77,7 @@ import gregtech.api.util.GT_PlayedSound;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
+import gregtech.common.blocks.GT_Item_Machines;
import gregtech.common.entities.GT_Entity_Arrow;
import gregtech.common.entities.GT_Entity_Arrow_Potion;
import gregtech.common.render.GT_CapeRenderer;
@@ -757,6 +760,14 @@ public class GT_Client extends GT_Proxy implements Runnable {
if (!(aTileEntity instanceof ICoverable)) return;
+ if (aEvent.player.isSneaking() && aTileEntity instanceof IGregTechTileEntity gtEntity
+ && gtEntity.getMetaTileEntity() instanceof MetaPipeEntity) {
+ if (aEvent.currentItem != null && aEvent.currentItem.getItem() instanceof GT_Item_Machines
+ && GregTech_API.METATILEENTITIES[aEvent.currentItem.getItemDamage()] instanceof MetaPipeEntity) {
+ drawGrid(aEvent, false, false, false);
+ }
+ }
+
if (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList)
|| GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList)
|| (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSoftHammerList)
@@ -994,7 +1005,10 @@ public class GT_Client extends GT_Proxy implements Runnable {
|| GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)
|| GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)
|| GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)
- || GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
+ || GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))
+ || (tCurrentItem.getItem() instanceof GT_Item_Machines
+ && GregTech_API.METATILEENTITIES[tCurrentItem.getItemDamage()] instanceof MetaPipeEntity
+ && player.isSneaking())) {
hide |= 0x2;
}
return hide;