Fixed Wooden Drawers not being able to be configured when locked, closes #42

This commit is contained in:
Buuz135 2022-06-06 15:46:08 +02:00
parent 97aa3cd4c0
commit 27259e04d4
4 changed files with 20 additions and 5 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ eclipse
run run
classes classes
/includedMods/

View File

@ -91,15 +91,17 @@ repositories {
dependencies { dependencies {
minecraft 'net.minecraftforge:forge:1.18.2-40.1.0' minecraft 'net.minecraftforge:forge:1.18.2-40.1.18'
implementation fg.deobf (project.dependencies.create('com.hrznstudio:titanium:1.18.2-3.5.0-32')) implementation fg.deobf (project.dependencies.create('com.hrznstudio:titanium:1.18.2-3.5.0-32'))
compileOnly fg.deobf("mezz.jei:jei-1.18.2:9.5.3.143:api") compileOnly fg.deobf("mezz.jei:jei-1.18.2:9.7.0.180:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.18.2:9.5.3.143") runtimeOnly fg.deobf("mezz.jei:jei-1.18.2:9.7.0.180")
runtimeOnly fg.deobf("curse.maven:refined-storage-243076:3712882") runtimeOnly fg.deobf("curse.maven:refined-storage-243076:3712882")
implementation fg.deobf("curse.maven:the-one-probe-245211:3671753") implementation fg.deobf("curse.maven:the-one-probe-245211:3671753")
//implementation fg.deobf("curse.maven:allthecompressed-514045:3723881") //implementation fg.deobf("curse.maven:allthecompressed-514045:3723881")
//runtimeOnly fg.deobf("curse.maven:create-328085:3600402") //runtimeOnly fg.deobf("curse.maven:create-328085:3600402")
//runtimeOnly fg.deobf("curse.maven:flywheel-486392:3600401") //runtimeOnly fg.deobf("curse.maven:flywheel-486392:3600401")
runtimeOnly fg.deobf("curse.maven:mekanism-268560:3810540")
runtimeOnly fg.deobf("curse.maven:refined-pipes-370696:3816785")
annotationProcessor "org.spongepowered:mixin:0.8.5:processor" annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
} }

View File

@ -87,8 +87,7 @@ public class CompactingDrawerTile extends ControllableDrawerTile<CompactingDrawe
} }
} }
} }
super.onSlotActivated(playerIn, hand, facing, hitX, hitY, hitZ, slot); return super.onSlotActivated(playerIn, hand, facing, hitX, hitY, hitZ, slot);
return InteractionResult.SUCCESS;
} }
@Override @Override

View File

@ -2,6 +2,7 @@ package com.buuz135.functionalstorage.block.tile;
import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.FunctionalStorage;
import com.buuz135.functionalstorage.inventory.BigInventoryHandler; import com.buuz135.functionalstorage.inventory.BigInventoryHandler;
import com.buuz135.functionalstorage.util.CompactingUtil;
import com.hrznstudio.titanium.annotation.Save; import com.hrznstudio.titanium.annotation.Save;
import com.hrznstudio.titanium.block.BasicTileBlock; import com.hrznstudio.titanium.block.BasicTileBlock;
import com.hrznstudio.titanium.block.tile.ActiveTile; import com.hrznstudio.titanium.block.tile.ActiveTile;
@ -81,6 +82,18 @@ public class DrawerTile extends ControllableDrawerTile<DrawerTile> {
return super.getCapability(cap, side); return super.getCapability(cap, side);
} }
public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, Direction facing, double hitX, double hitY, double hitZ, int slot) {
ItemStack stack = playerIn.getItemInHand(hand);
if (stack.getItem().equals(FunctionalStorage.CONFIGURATION_TOOL.get()) || stack.getItem().equals(FunctionalStorage.LINKING_TOOL.get())) return InteractionResult.PASS;
if (slot != -1 && isLocked() && !playerIn.getItemInHand(hand).isEmpty()){
BigInventoryHandler.BigStack bigStack = getHandler().getStoredStacks().get(slot);
if (bigStack.getStack().isEmpty()){
bigStack.setStack(playerIn.getItemInHand(hand));
}
}
return super.onSlotActivated(playerIn, hand, facing, hitX, hitY, hitZ, slot);
}
@NotNull @NotNull
@Override @Override
public DrawerTile getSelf() { public DrawerTile getSelf() {