Skip to content
Merged
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
11 changes: 11 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# ChangeLog (更新履歴)
## v 1.2.7
**_EN_** <br>
**add**<br>
- Add config options for changing MetaTileEntityId.

**_JP_** <br>
**追加**<br>
- MetaTileEntityIdを変更するConfigを追加.
---------


## v 1.2.6
**_EN_** <br>
**fix**<br>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ You can include this mod in your modpack!
See [Here](https://github.com/MrKono/MaterialReplication/blob/master/Setting.md).
### Corresponding Version Information
See [Here](https://github.com/MrKono/MaterialReplication/blob/master/VersionInformation.md).
### WARNING
If you launched with [RosaTech](https://www.curseforge.com/minecraft/mc-mods/rosatech), minecraft crashes due to duplicate MetaTileEntityIDs. After crashing, change the MTEID used by MaterialReplication from cfg.
## Credits
I modified some textures from [GTCE unofficial](https://github.com/GregTechCEu/GregTech) under LGPL-3.0 License
<br>
Expand Down
2 changes: 2 additions & 0 deletions README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ modpackへ利用することができます.
[こちら](https://github.com/MrKono/MaterialReplication/blob/master/Setting_JP.md)をご覧ください.
### 対応情報
[こちら](https://github.com/MrKono/MaterialReplication/blob/master/VersionInformation.md)をご覧ください.
### 警告
[RosaTech](https://www.curseforge.com/minecraft/mc-mods/rosatech)が導入されている場合, MetaTileEntityIDの重複で必ずクラッシュします. クラッシュ後, cfgからMaterialReplicationが使うMTEIDを変更してください.

## クレジット
LGPL-3.0 Licenseの下, [GTCE unofficial](https://github.com/GregTechCEu/GregTech)のテクスチャを一部改変しています.
Expand Down
2 changes: 1 addition & 1 deletion VersionInformation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Corresponding Version Information / 対応バージョン情報
| MaterialReplication | GTCEu |
|---------------------|-------------|
| 1.2.6 <br> to <br> 1.2.4 | 2.8.10-beta |
| 1.2.7 - 1.2.4 | 2.8.10-beta |
| 1.2.3 | 2.8.8-beta |
| 1.2.2 | 2.8.6-beta |
| 1.2.1 <br> 1.2.0 | 2.8.1-bata |
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/kono/ceu/materialreplication/MRConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
@Config(modid = MRValues.MODID)
public class MRConfig {

@Config.Name("MetaTileEntityID Option")
@Config.RequiresMcRestart
public static IdOption id = new IdOption();

@Config.Comment("Config option of materials for Deconstruction/Replication")
@Config.Name("Material Options")
@Config.RequiresMcRestart
Expand Down Expand Up @@ -37,6 +41,16 @@ public class MRConfig {
@Config.RequiresMcRestart
public static StartTier tier = new StartTier();

public static class IdOption {

@Config.Comment({ "Change the starting ID of the MetaTileEntityID used by this add-on.",
"By Default, this add-on starts MetaTileEntityIDs of 20000.",
"Only change this if the crash is caused by a duplicate MTEIDs.",
"WARNING: If you change it, the one already created will disappear or be changed to another one." })
@Config.RangeInt(min = 11000, max = 32200)
public int startId = 20000;
}

public static class MaterialOption {

// TODO Make Blacklist from Config
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/kono/ceu/materialreplication/api/util/MRValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ public class MRValues {

public static final String MODNAME = "Material Replication";
public static final String MODID = "materialreplication";
public static int BaseTime_D = rangeTime(MRConfig.deconstruction.DeconstructionBaseTime) ?
MRConfig.deconstruction.DeconstructionBaseTime : 600,
public static int baseID = rangeUtil(MRConfig.id.startId, 11000, 32200, "MetaTileEntityID") ?
MRConfig.id.startId : 20000,
BaseTime_D = rangeTime(MRConfig.deconstruction.DeconstructionBaseTime) ?
MRConfig.deconstruction.DeconstructionBaseTime : 600,
BaseTime_R = rangeTime(MRConfig.replication.ReplicationBaseTime) ?
MRConfig.replication.ReplicationBaseTime : 1200,
BaseTime_S = rangeTime(MRConfig.replication.ScanTime) ?
Expand All @@ -30,11 +32,11 @@ public class MRValues {
MRConfig.scrap.AmplifierChance : 1,
AmplifierChanceBoost = rangeChance(MRConfig.scrap.AmplifierChanceBoost) ?
MRConfig.scrap.AmplifierChanceBoost : 0,
tierDeconstruct = rangeTier(MRConfig.tier.tierDeconstruct, 1, 8) ?
tierDeconstruct = rangeUtil(MRConfig.tier.tierDeconstruct, 1, 8, "tier") ?
MRConfig.tier.tierDeconstruct : 1,
tierReplicate = rangeTier(MRConfig.tier.tierReplicate, 1, 8) ?
tierReplicate = rangeUtil(MRConfig.tier.tierReplicate, 1, 8, "tier") ?
MRConfig.tier.tierReplicate : 1,
tierLargeDeconstruct = rangeTier(MRConfig.tier.tierLargeDeconstruct, 6, 8) ?
tierLargeDeconstruct = rangeUtil(MRConfig.tier.tierLargeDeconstruct, 6, 8, "tier") ?
MRConfig.tier.tierLargeDeconstruct : 6,
ChargedMatterAmount = MRConfig.recipe.matterRatio[0],
NeutralMatterAmount = MRConfig.recipe.matterRatio[1],
Expand Down Expand Up @@ -68,9 +70,9 @@ private static boolean rangeChance(int chance) {
return true;
}

private static boolean rangeTier(int tier, int min, int max) {
if (tier < min || max < tier) {
MaterialReplicationLog.logger.error("Start tier is over range! Set to default value.");
private static boolean rangeUtil(int val, int min, int max, String str) {
if (val < min || max < val) {
MaterialReplicationLog.logger.error("Start" + str + "is over range! Set to default value.");
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

public class MRMetaTileEntities {

// Single : 20000 - 200044
// Single Machine
// Default: 20000 - 200044
public static SimpleMachineMetaTileEntity[] DECONSTRUCTOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1];
public static SimpleMachineMetaTileEntity[] REPLICATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1];
public static MetaTileEntityScrapMaker[] SCRAPPER = new MetaTileEntityScrapMaker[GTValues.V.length - 1];

// Multi : 21000
// Multi Machine
// Default: 21000-
public static MetaTileEntityLargeDeconstructor LARGE_DECONSTRUCTOR;
public static MetaTileEntityLargeScrapper LARGE_SCRAPPER;

Expand All @@ -35,38 +37,44 @@ public static void init() {
}

public static void registerSingleMachine() {
// 20000 - 20014 : Material Deconstructor
// Material Deconstructor
// Default: 20000 - 20014
int id = baseID;
for (int i = 1; i < DECONSTRUCTOR.length; i++) {
String voltageName = GTValues.VN[i].toLowerCase();
if (!GregTechAPI.isHighTier() && i > GTValues.UV)
break;
if (tierDeconstruct <= i)
DECONSTRUCTOR[i] = registerMetaTileEntity(20000 + (i - 1),
DECONSTRUCTOR[i] = registerMetaTileEntity(id + (i - 1),
new SimpleMachineMetaTileEntity(
new ResourceLocation(MODID, (String.format("%s.%s", "deconstructor", voltageName))),
MRRecipeMaps.DECONSTRUCTION_RECIPES, MRTextures.DECONSTRUCTOR_OVERLAY, i, true,
GTUtility.hvCappedTankSizeFunction));
}

// 20015 - 20029 : Material Replicator
// Material Replicator
// Default: 20015 - 20029
id = id + 15;
for (int i = 1; i < REPLICATOR.length; i++) {
String voltageName = GTValues.VN[i].toLowerCase();
if (!GregTechAPI.isHighTier() && i > GTValues.UV)
break;
if (tierReplicate <= i)
REPLICATOR[i] = registerMetaTileEntity(20015 + (i - 1),
REPLICATOR[i] = registerMetaTileEntity(id + (i - 1),
new SimpleMachineMetaTileEntity(
new ResourceLocation(MODID, (String.format("%s.%s", "replicator", voltageName))),
MRRecipeMaps.REPLICATION_RECIPES, MRTextures.REPLICATOR_OVERLAY, i, true,
GTUtility.hvCappedTankSizeFunction));
}

// 20030 - 20044 Scrapper
// Scrapper
// Default: 20030 - 20044
id = id + 15;
for (int i = 0; i < SCRAPPER.length - 1; i++) {
String voltageName = GTValues.VN[i + 1].toLowerCase();
if (!GregTechAPI.isHighTier() && i > GTValues.UV)
break;
SCRAPPER[i] = registerMetaTileEntity(20030 + i,
SCRAPPER[i] = registerMetaTileEntity(id + i,
new MetaTileEntityScrapMaker(
new ResourceLocation(MODID, (String.format("%s.%s", "scrapmaker", voltageName))),
MRRecipeMaps.SCRAPMAKER_RECIPES, MRTextures.SCRAPPER_OVERLAY, i + 1,
Expand All @@ -76,12 +84,15 @@ public static void registerSingleMachine() {
}

public static void registerMultiMachine() {
// LargeDeconstructor 21000
LARGE_DECONSTRUCTOR = registerMetaTileEntity(21000,
int id = baseID + 1000;
// LargeDeconstructor
// Default: 21000
LARGE_DECONSTRUCTOR = registerMetaTileEntity(id,
new MetaTileEntityLargeDeconstructor(mrId("large_deconstructor")));

// LargeScrapper 21001
LARGE_SCRAPPER = registerMetaTileEntity(21001,
// LargeScrapper
// Default: 21001
LARGE_SCRAPPER = registerMetaTileEntity(id + 1,
new MetaTileEntityLargeScrapper(mrId("large_scrapper")));
}

Expand Down
Loading