Skip to content

Commit

Permalink
Cleaner fix for shift right-clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickMG committed Jan 30, 2025
1 parent 0f7dbe3 commit 72f5057
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main/java/gregtech/api/gui/modularui/GTUIInfos.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.api.net.GTPacketSendCoverData;
import gregtech.api.objects.GTCoverNone;
import gregtech.api.util.CoverBehaviorBase;

public class GTUIInfos {
Expand Down Expand Up @@ -85,7 +84,6 @@ public static void init() {}
final TileEntity te = world.getTileEntity(x, y, z);
if (!(te instanceof ICoverable gtTileEntity)) return null;
final CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side);
if (cover instanceof GTCoverNone) return null;
return createCoverGuiContainer(
player,
cover::createWindow,
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/gregtech/api/objects/GTCoverNone.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;

import com.gtnewhorizons.modularui.api.screen.ModularWindow;

import gregtech.api.gui.modularui.CoverUIBuildContext;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.util.CoverBehavior;
import gregtech.api.util.ISerializableObject;
Expand Down Expand Up @@ -234,4 +237,10 @@ protected ItemStack getDropImpl(ForgeDirection side, int aCoverID,
ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
return null;
}

@Override
public ModularWindow createWindow(CoverUIBuildContext buildContext) {
// Cancel opening the UI.
return null;
}
}

0 comments on commit 72f5057

Please sign in to comment.