Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for creative block disassembly without OP. #57

Open
wants to merge 1 commit into
base: 1.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/cofh/thermalexpansion/block/BlockTEBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import cofh.core.util.helpers.ServerHelper;
import cofh.core.util.helpers.WrenchHelper;
import cofh.thermalexpansion.ThermalExpansion;
import cofh.thermalexpansion.init.TEProps;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
Expand Down Expand Up @@ -183,7 +184,7 @@ public boolean canDismantle(World world, BlockPos pos, IBlockState state, Entity

TileNameable tile = (TileNameable) world.getTileEntity(pos);

if (tile instanceof TileAugmentableSecure && ((TileAugmentableSecure) tile).isCreative && !CoreUtils.isOp(player)) {
if (tile instanceof TileAugmentableSecure && (!TEProps.allowNonOPDisassembly && ((TileAugmentableSecure) tile).isCreative && !CoreUtils.isOp(player))) {
return false;
}
return super.canDismantle(world, pos, state, player);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/cofh/thermalexpansion/init/TEProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ private static void configCommon() {

comment = "This sets the minimum upgradeable block tier for Redstone Control functionality.";
levelRedstoneControl = ThermalExpansion.CONFIG.getConfiguration().getInt("LevelRedstoneControl", category, levelRedstoneControl, CoreProps.LEVEL_MIN, CoreProps.LEVEL_MAX, comment);

category = "Device";

comment = "If TRUE, Creative versions of Blocks can be disassembled without server operator permissions.";
allowNonOPDisassembly = ThermalExpansion.CONFIG.getConfiguration().getBoolean("AllowNonOPDisassembly", category, allowNonOPDisassembly, comment);
}

private static void configClient() {
Expand Down Expand Up @@ -277,6 +282,8 @@ public static void handleConfigSync(PacketBase payload) {

public static boolean enableSounds = true;

public static boolean allowNonOPDisassembly = false;

/* UPGRADE */
public static int levelAutoInput = 0;
public static int levelAutoOutput = 0;
Expand Down