-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
112 additions
and
40 deletions.
There are no files selected for viewing
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,50 @@ | ||
package com.github.kill05; | ||
|
||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class MixinConfigPlugin implements IMixinConfigPlugin { | ||
|
||
@Override | ||
public void onLoad(String mixinPackage) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
//if (mixinClassName.equals("com.github.kill05.mixins.ItemToolMixin")) { | ||
// return ArchitectConfig.getDisableVanillaTools(); | ||
//} | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
} |
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
47 changes: 47 additions & 0 deletions
47
src/main/java/com/github/kill05/config/ArchitectConfig.java
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,47 @@ | ||
package com.github.kill05.config; | ||
|
||
import com.github.kill05.ArchitectTools; | ||
import turniplabs.halplibe.util.TomlConfigHandler; | ||
import turniplabs.halplibe.util.toml.Toml; | ||
|
||
public final class ArchitectConfig { | ||
|
||
public static final TomlConfigHandler CONFIG; | ||
|
||
public static int PART_ID; | ||
public static int TOOL_ID; | ||
public static int ITEM_ID; | ||
|
||
public static int BLOCK_ID; | ||
|
||
static { | ||
Toml toml = new Toml(); | ||
|
||
// Id | ||
toml.addCategory("Set from which ID each category of blocks/items should start registering.", "IDs"); | ||
toml.addEntry("IDs.Parts", 23000); | ||
toml.addEntry("IDs.Tools", 23100); | ||
toml.addEntry("IDs.Items", 23200); | ||
toml.addEntry("IDs.Blocks", 1500); | ||
|
||
// Gameplay | ||
toml.addCategory("Change how the game and the mod are played.", "Gameplay"); | ||
toml.addEntry("Gameplay.DisableVanillaTools", "Set to true to disable vanilla tools so players can only use tools from Architect's Tools.", false); | ||
|
||
CONFIG = new TomlConfigHandler(ArchitectTools.MOD_ID, toml); | ||
|
||
PART_ID = toml.get("IDs.Parts", Integer.class); | ||
TOOL_ID = toml.get("IDs.Tools", Integer.class); | ||
ITEM_ID = toml.get("IDs.Items", Integer.class); | ||
BLOCK_ID = toml.get("IDs.Blocks", Integer.class); | ||
} | ||
|
||
private ArchitectConfig() { | ||
|
||
} | ||
|
||
public static boolean getDisableVanillaTools() { | ||
return CONFIG.getBoolean("Gameplay.DisableVanillaTools"); | ||
} | ||
|
||
} |
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
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