Skip to content

Commit

Permalink
Option to turn the bit drawer controller off
Browse files Browse the repository at this point in the history
  • Loading branch information
Belgabor committed Aug 20, 2016
1 parent 7bb51f6 commit 1f06f61
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Version 0.31
* [NEW] Config option to turn the bit drawer controller off

## Version 0.3
* [NEW] Bit Drawer Controller
* [FIXED] Compatibility with Storage Drawers 3.2.4
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
minecraft_version = 1.10.2
forge_version = 12.18.1.2049
mod_version = 0.3
mod_version = 0.31
release_type = alpha
2 changes: 1 addition & 1 deletion src/main/java/mods/belgabor/bitdrawers/BitDrawers.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class BitDrawers implements IChiselsAndBitsAddon
{
public static final String MODNAME = "Drawers & Bits";
public static final String MODID = "bitdrawers";
public static final String VERSION = "0.3";
public static final String VERSION = "0.31";

@SidedProxy(
clientSide = "mods.belgabor.bitdrawers.client.ClientProxy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class ConfigManager {
public boolean allowBagMultiInsertion = true;
public boolean allowChiseledBlockMultiInsertion = false;
public boolean chatty = true;
public boolean enableBitController = true;

public ConfigManager(File config) {
this.config = new Configuration(config);
Expand Down Expand Up @@ -44,6 +45,10 @@ public void sync() {
"If set the player will be informed in chat if something didn't work (if possible).")
.setLanguageKey(LANG_PREFIX + "prop.chatty").getBoolean();

enableBitController = config.get(Configuration.CATEGORY_GENERAL, "enableBitController", enableBitController,
"Enable the bit drawer controller.")
.setLanguageKey(LANG_PREFIX + "prop.enableBitController").getBoolean();

if (config.hasChanged())
config.save();
}
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/mods/belgabor/bitdrawers/core/BlockRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.jaquadro.minecraft.chameleon.Chameleon;
import com.jaquadro.minecraft.chameleon.resources.ModelRegistry;
import com.jaquadro.minecraft.storagedrawers.client.renderer.TileEntityDrawersRenderer;
import mods.belgabor.bitdrawers.BitDrawers;
import mods.belgabor.bitdrawers.block.BlockBitController;
import mods.belgabor.bitdrawers.block.BlockBitDrawers;
import mods.belgabor.bitdrawers.block.tile.TileBitController;
Expand All @@ -28,9 +29,11 @@ public void init() {
GameRegistry.register((new ItemBitDrawer(bitDrawer)).setRegistryName(bitDrawer.getRegistryName()));
GameRegistry.registerTileEntity(TileBitDrawers.class, bitDrawer.getRegistryName().toString());
bitController = new BlockBitController("bitcontroller");
GameRegistry.register(bitController);
GameRegistry.register((new ItemBitController(bitController)).setRegistryName(bitController.getRegistryName()));
GameRegistry.registerTileEntity(TileBitController.class, bitController.getRegistryName().toString());
if (BitDrawers.config.enableBitController) {
GameRegistry.register(bitController);
GameRegistry.register((new ItemBitController(bitController)).setRegistryName(bitController.getRegistryName()));
GameRegistry.registerTileEntity(TileBitController.class, bitController.getRegistryName().toString());
}
}

@SideOnly(Side.CLIENT)
Expand All @@ -40,6 +43,8 @@ public void initClient() {
ModelRegistry modelRegistry = Chameleon.instance.modelRegistry;

modelRegistry.registerModel(new BitDrawerModel.Register());
modelRegistry.registerItemVariants(bitController);
if (BitDrawers.config.enableBitController) {
modelRegistry.registerItemVariants(bitController);
}
}
}
10 changes: 7 additions & 3 deletions src/main/java/mods/belgabor/bitdrawers/core/RecipeRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import mod.chiselsandbits.core.ChiselsAndBits;
import mods.belgabor.bitdrawers.BitDrawers;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
Expand All @@ -18,8 +19,11 @@ public void init() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockRegistry.bitDrawer, 1), "xxx", "zwz", "xyx",
'x', new ItemStack(Blocks.STONE), 'y', new ItemStack(ChiselsAndBits.getItems().itemChiselIron), 'z', new ItemStack(Blocks.PISTON), 'w', "drawerBasic"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockRegistry.bitDrawer, 1), new ItemStack(StorageDrawers.blocks.compDrawers, 1), new ItemStack(ChiselsAndBits.getItems().itemBlockBit, 1, OreDictionary.WILDCARD_VALUE)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockRegistry.bitController, 1), "xxx", "zwz", "xyx",
'x', new ItemStack(Blocks.STONE), 'y', new ItemStack(ChiselsAndBits.getItems().itemChiselDiamond), 'z', new ItemStack(Items.COMPARATOR), 'w', "drawerBasic"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockRegistry.bitController, 1), new ItemStack(StorageDrawers.blocks.controller, 1), new ItemStack(ChiselsAndBits.getItems().itemBlockBit, 1, OreDictionary.WILDCARD_VALUE)));

if (BitDrawers.config.enableBitController) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockRegistry.bitController, 1), "xxx", "zwz", "xyx",
'x', new ItemStack(Blocks.STONE), 'y', new ItemStack(ChiselsAndBits.getItems().itemChiselDiamond), 'z', new ItemStack(Items.COMPARATOR), 'w', "drawerBasic"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockRegistry.bitController, 1), new ItemStack(StorageDrawers.blocks.controller, 1), new ItemStack(ChiselsAndBits.getItems().itemBlockBit, 1, OreDictionary.WILDCARD_VALUE)));
}
}
}

0 comments on commit 1f06f61

Please sign in to comment.