-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Crafting Terminal Added the ability to paint some of the blocks Added Inventory Cable & Connector Added Inventory Proxy Added Wireless Terminal Added config to change Inventory Connector range.
- Loading branch information
Showing
115 changed files
with
6,181 additions
and
511 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.tom.storagemod; | ||
|
||
import org.apache.commons.lang3.tuple.Pair; | ||
|
||
import net.minecraftforge.common.ForgeConfigSpec; | ||
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; | ||
import net.minecraftforge.common.ForgeConfigSpec.IntValue; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.config.ModConfig; | ||
|
||
public class Config { | ||
public static boolean onlyTrims; | ||
public static int invRange; | ||
public static int invConnectorMax = 0; | ||
public static int wirelessRange; | ||
|
||
public static class Server { | ||
public IntValue inventoryConnectorRange; | ||
public IntValue inventoryCableConnectorMaxCables; | ||
public IntValue wirelessRange; | ||
public BooleanValue onlyTrimsConnect; | ||
|
||
private Server(ForgeConfigSpec.Builder builder) { | ||
inventoryConnectorRange = builder.comment("Inventory Connector Range"). | ||
translation("tomsstorage.config.inventory_connector_range"). | ||
defineInRange("inventoryConnectorRange", 16, 4, 256); | ||
|
||
onlyTrimsConnect = builder.comment("Only Allow Trims to Connect Inventories"). | ||
translation("tomsstorage.config.only_trims_connect"). | ||
define("onlyTrimsConnect", false); | ||
|
||
inventoryCableConnectorMaxCables = builder.comment("Inventory Cable Connector Maximum number of cables"). | ||
translation("tomsstorage.config.inv_cable_connector_max_scan"). | ||
defineInRange("invCableConnectorMaxScanSize", 2048, 16, Integer.MAX_VALUE); | ||
|
||
wirelessRange = builder.comment("Wireless terminal reach"). | ||
translation("tomsstorage.config.wireless_reach"). | ||
defineInRange("wirelessReach", 16, 4, 64); | ||
} | ||
} | ||
|
||
static final ForgeConfigSpec serverSpec; | ||
public static final Server SERVER; | ||
static { | ||
final Pair<Server, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(Server::new); | ||
serverSpec = specPair.getRight(); | ||
SERVER = specPair.getLeft(); | ||
} | ||
|
||
private static void load() { | ||
onlyTrims = SERVER.onlyTrimsConnect.get(); | ||
invRange = SERVER.inventoryConnectorRange.get() * SERVER.inventoryConnectorRange.get(); | ||
invConnectorMax = SERVER.inventoryCableConnectorMaxCables.get(); | ||
wirelessRange = SERVER.wirelessRange.get(); | ||
} | ||
|
||
@SubscribeEvent | ||
public static void onLoad(final ModConfig.Loading configEvent) { | ||
StorageMod.LOGGER.info("Loaded Tom's Simple Storage config file {}", configEvent.getConfig().getFileName()); | ||
load(); | ||
} | ||
|
||
@SubscribeEvent | ||
public static void onFileChange(final ModConfig.Reloading configEvent) { | ||
StorageMod.LOGGER.info("Tom's Simple Storage config just got changed on the file system!"); | ||
load(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.tom.storagemod; | ||
|
||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.text.ITextComponent; | ||
import net.minecraft.util.text.TranslationTextComponent; | ||
|
||
public class ItemBlockConnector extends BlockItem { | ||
|
||
public ItemBlockConnector() { | ||
super(StorageMod.invCableConnector, new Properties()); | ||
setRegistryName(StorageMod.invCableConnector.getRegistryName()); | ||
} | ||
|
||
@Override | ||
public ITextComponent getDisplayName(ItemStack is) { | ||
ITextComponent tc = super.getDisplayName(is); | ||
tc.appendText(" ("); | ||
if(is.hasTag() && is.getTag().getCompound("BlockStateTag").contains("color")) { | ||
String color = is.getTag().getCompound("BlockStateTag").getString("color"); | ||
tc.appendSibling(new TranslationTextComponent("color.minecraft." + color)); | ||
} else { | ||
tc.appendSibling(new TranslationTextComponent("color.minecraft.white")); | ||
} | ||
tc.appendText(")"); | ||
return tc; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.tom.storagemod; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.tags.BlockTags; | ||
import net.minecraft.tags.Tag; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class StorageTags { | ||
public static final Tag<Block> REMOTE_ACTIVATE = new BlockTags.Wrapper(new ResourceLocation("toms_storage", "remote_activate")); | ||
} |
Oops, something went wrong.