Skip to content

Commit

Permalink
Rename to Tinkers Compliment and fix config for release
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Jul 21, 2017
1 parent 5638346 commit d2506c3
Show file tree
Hide file tree
Showing 103 changed files with 413 additions and 313 deletions.
Binary file added Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Knights' Construct
# Tinkers' Compliment

Knights' Construct is an addon for the Minecraft mod Tinkers' Construct which adds various compatibility features and features which otherwise did not fit in Tinkers' Construct itself.
Tinkers' Compliment is an addon for the Minecraft mod Tinkers' Construct which adds various compatibility features and features which otherwise did not fit in Tinkers' Construct itself.
14 changes: 12 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ apply plugin: 'net.minecraftforge.gradle.forge'

//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.

group = "knightminer.knightsconstruct"
archivesBaseName = "KnightsConstruct"
group = "knightminer.tcompliment"
archivesBaseName = "TinkersCompliment"

// External properties
ext.configFile = file "build.properties"
Expand Down Expand Up @@ -80,3 +80,13 @@ processResources {
exclude 'mcmod.info'
}
}

// Create deobf dev jars
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}

artifacts {
archives deobfJar
}
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod_version=0.1.0
mod_version=0.1.1
minecraft_version=1.11.2
forge_version=13.20.0.2282
mappings=snapshot_20170401
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/knightminer/knightsconstruct/common/Config.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
package knightminer.knightsconstruct;
package knightminer.tcompliment;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import knightminer.knightsconstruct.common.Config;
import knightminer.knightsconstruct.common.KnightsNetwork;
import knightminer.knightsconstruct.feature.KnightsFeature;
import knightminer.knightsconstruct.plugin.ceramics.CeramicsPlugin;
import knightminer.knightsconstruct.plugin.exnihilo.ExNihiloPlugin;
import knightminer.knightsconstruct.shared.KnightsCommons;
import knightminer.tcompliment.common.Config;
import knightminer.tcompliment.common.TCompNetwork;
import knightminer.tcompliment.feature.ModuleFeature;
import knightminer.tcompliment.plugin.ceramics.CeramicsPlugin;
import knightminer.tcompliment.plugin.exnihilo.ExNihiloPlugin;
import knightminer.tcompliment.shared.ModuleCommons;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import slimeknights.mantle.common.GuiHandler;
import slimeknights.mantle.pulsar.control.PulseManager;

@Mod(
modid = KnightsConstruct.modID,
name = KnightsConstruct.modName,
version = KnightsConstruct.modVersion,
modid = TinkersCompliment.modID,
name = TinkersCompliment.modName,
version = TinkersCompliment.modVersion,
dependencies = "required-after:forge;"
+ "required-after:mantle;"
+ "required-after:tconstruct;"
+ "after:exnihiloadscensio",
acceptedMinecraftVersions = "[1.11.2, 1.12)")
public class KnightsConstruct {
public static final String modID = "kconstruct";
public class TinkersCompliment {
public static final String modID = "tcompliment";
public static final String modVersion = "${version}";
public static final String modName = "Knights' Construct";
public static final String modName = "Tinkers' Compliment";

public static final Logger log = LogManager.getLogger(modID);

@Mod.Instance(modID)
public static KnightsConstruct instance;
public static TinkersCompliment instance;

public static PulseManager pulseManager = new PulseManager(Config.pulseConfig);
public static GuiHandler guiHandler = new GuiHandler();

static {
pulseManager.registerPulse(new KnightsCommons());
pulseManager.registerPulse(new KnightsFeature());
pulseManager.registerPulse(new ModuleCommons());
pulseManager.registerPulse(new ModuleFeature());
pulseManager.registerPulse(new ExNihiloPlugin());
pulseManager.registerPulse(new CeramicsPlugin());
}
Expand All @@ -48,6 +48,6 @@ public class KnightsConstruct {
public void preInit(FMLPreInitializationEvent event) {
NetworkRegistry.INSTANCE.registerGuiHandler(instance, guiHandler);

KnightsNetwork.instance.setup();
TCompNetwork.instance.setup();
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package knightminer.knightsconstruct.common;
package knightminer.tcompliment.common;

import javax.annotation.Nonnull;

import knightminer.knightsconstruct.library.Util;
import knightminer.tcompliment.library.Util;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.ItemMeshDefinition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package knightminer.knightsconstruct.common;
package knightminer.tcompliment.common;

public class CommonProxy {
public void preInit() {}
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/knightminer/tcompliment/common/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package knightminer.tcompliment.common;

import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import slimeknights.mantle.pulsar.config.ForgeCFG;

public class Config {

public static ForgeCFG pulseConfig = new ForgeCFG("TinkersComplimentModules", "Modules");

public static float oreToIngotRatio = 1.0f;

public static boolean blacklistMelterStone = false;

static Configuration configFile;

public static void load(FMLPreInitializationEvent event) {
configFile = new Configuration(event.getSuggestedConfigurationFile(), "0.1", false);

blacklistMelterStone = configFile.getBoolean("blacklistStone", "melter", true,
"Disallows creating seared stone in the melter using cobblestone or tool parts");

oreToIngotRatio = configFile.getFloat("oreToIngotRatio", "melter", 1.0f, 0f, 16.0f,
"Ratio of ore to material produced in the melter.");

if(configFile.hasChanged()) {
configFile.save();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package knightminer.knightsconstruct.common;
package knightminer.tcompliment.common;

public interface ModIds {
public interface Ceramics {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package knightminer.knightsconstruct.common;
package knightminer.tcompliment.common;

import knightminer.knightsconstruct.KnightsConstruct;
import knightminer.knightsconstruct.feature.KnightsFeature;
import knightminer.knightsconstruct.library.Util;
import knightminer.knightsconstruct.plugin.ceramics.CeramicsPlugin;
import knightminer.tcompliment.TinkersCompliment;
import knightminer.tcompliment.feature.ModuleFeature;
import knightminer.tcompliment.library.Util;
import knightminer.tcompliment.plugin.ceramics.CeramicsPlugin;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.item.Item;
Expand All @@ -27,7 +27,7 @@
import slimeknights.tconstruct.smeltery.block.BlockMolten;
import slimeknights.tconstruct.tools.TinkerTools;

public class KnightsPulse {
public class PulseBase {

protected boolean isToolsLoaded() {
return TConstruct.pulseManager.isPulseLoaded(TinkerTools.PulseId);
Expand All @@ -38,11 +38,11 @@ protected boolean isSmelteryLoaded() {
}

protected boolean isFeaturesLoaded() {
return KnightsConstruct.pulseManager.isPulseLoaded(KnightsFeature.pulseID);
return TinkersCompliment.pulseManager.isPulseLoaded(ModuleFeature.pulseID);
}

protected boolean isCeramicsPluginLoaded() {
return KnightsConstruct.pulseManager.isPulseLoaded(CeramicsPlugin.pulseID);
return TinkersCompliment.pulseManager.isPulseLoaded(CeramicsPlugin.pulseID);
}

/* Blocks */
Expand Down Expand Up @@ -142,7 +142,7 @@ protected static <T extends Fluid> T registerFluid(T fluid) {
}

protected static void registerTE(Class<? extends TileEntity> teClazz, String name) {
GameRegistry.registerTileEntity(teClazz, Util.prefix(name));
GameRegistry.registerTileEntity(teClazz, Util.resource(name));
}

protected static <T extends IForgeRegistryEntry<?>> T register(T thing, String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package knightminer.knightsconstruct.common;
package knightminer.tcompliment.common;

import knightminer.knightsconstruct.KnightsConstruct;
import knightminer.knightsconstruct.feature.network.FluidUpdatePacket;
import knightminer.tcompliment.TinkersCompliment;
import knightminer.tcompliment.feature.network.FluidUpdatePacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.math.BlockPos;
Expand All @@ -11,12 +11,12 @@
import slimeknights.mantle.network.NetworkWrapper;
import slimeknights.tconstruct.common.TinkerNetwork;

public class KnightsNetwork extends NetworkWrapper {
public class TCompNetwork extends NetworkWrapper {

public static KnightsNetwork instance = new KnightsNetwork();
public static TCompNetwork instance = new TCompNetwork();

public KnightsNetwork() {
super(KnightsConstruct.modID);
public TCompNetwork() {
super(TinkersCompliment.modID);
}

public void setup() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package knightminer.knightsconstruct.feature;
package knightminer.tcompliment.feature;

import static slimeknights.tconstruct.common.ModelRegisterUtil.registerItemModel;

import knightminer.knightsconstruct.common.ClientProxy;
import knightminer.knightsconstruct.feature.client.MelterRenderer;
import knightminer.knightsconstruct.feature.tileentity.TileMelter;
import knightminer.tcompliment.common.ClientProxy;
import knightminer.tcompliment.feature.client.MelterRenderer;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
Expand All @@ -14,11 +14,11 @@
public class FeatureClientProxy extends ClientProxy {
@Override
public void registerModels() {
registerItemModel(KnightsFeature.melter);
registerItemModel(KnightsFeature.porcelainMelter);
registerItemModel(ModuleFeature.melter);
registerItemModel(ModuleFeature.porcelainMelter);

// porcelain tank items
Item tank = Item.getItemFromBlock(KnightsFeature.porcelainTank);
Item tank = Item.getItemFromBlock(ModuleFeature.porcelainTank);
for(BlockTank.TankType type : BlockTank.TankType.values()) {
String variant = String.format("%s=%s,%s=%s",
BlockTank.KNOB.getName(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package knightminer.knightsconstruct.feature;
package knightminer.tcompliment.feature;

import java.util.List;
import java.util.Set;
Expand All @@ -8,14 +8,14 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.eventbus.Subscribe;

import knightminer.knightsconstruct.common.CommonProxy;
import knightminer.knightsconstruct.common.Config;
import knightminer.knightsconstruct.common.KnightsPulse;
import knightminer.knightsconstruct.common.ModIds;
import knightminer.knightsconstruct.feature.blocks.BlockMelter;
import knightminer.knightsconstruct.feature.tileentity.TileMelter;
import knightminer.knightsconstruct.library.KnightsRegistry;
import knightminer.knightsconstruct.shared.KnightsCommons;
import knightminer.tcompliment.common.CommonProxy;
import knightminer.tcompliment.common.Config;
import knightminer.tcompliment.common.ModIds;
import knightminer.tcompliment.common.PulseBase;
import knightminer.tcompliment.feature.blocks.BlockMelter;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcompliment.library.TCompRegistry;
import knightminer.tcompliment.shared.ModuleCommons;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
Expand All @@ -40,12 +40,13 @@
import slimeknights.tconstruct.shared.TinkerFluids;
import slimeknights.tconstruct.smeltery.TinkerSmeltery;
import slimeknights.tconstruct.smeltery.block.BlockTank;
import slimeknights.tconstruct.tools.TinkerMaterials;

@Pulse(id = KnightsFeature.pulseID, description = "Adds standalone Knights' Construct features")
public class KnightsFeature extends KnightsPulse {
@Pulse(id = ModuleFeature.pulseID, description = "Adds standalone Knights' Construct features")
public class ModuleFeature extends PulseBase {
public static final String pulseID = "KnightsFeature";

@SidedProxy(clientSide = "knightminer.knightsconstruct.feature.FeatureClientProxy", serverSide = "knightminer.knightsconstruct.common.CommonProxy")
@SidedProxy(clientSide = "knightminer.tcompliment.feature.FeatureClientProxy", serverSide = "knightminer.tcompliment.common.CommonProxy")
public static CommonProxy proxy;

public static Block melter;
Expand All @@ -57,10 +58,13 @@ public void preInit(FMLPreInitializationEvent event) {

// functional blocks
melter = registerBlock(new BlockMelter(TinkerSmeltery.searedTank), "melter");
TCompRegistry.tabGeneral.setDisplayIcon(new ItemStack(melter));

if(isCeramicsPluginLoaded()) {
porcelainTank = registerEnumBlock(new BlockTank(), "porcelain_tank");
porcelainTank.setCreativeTab(TCompRegistry.tabGeneral);
porcelainMelter = registerBlock(new BlockMelter(porcelainTank), "porcelain_melter");

}

registerTE(TileMelter.class, "melter");
Expand Down Expand Up @@ -111,15 +115,15 @@ public void postInit(FMLPostInitializationEvent event) {

// add cast recipes for bucket cast
for(FluidStack fs : TinkerSmeltery.castCreationFluids) {
TinkerRegistry.registerTableCasting(new CastingRecipe(KnightsCommons.castBucket, new RecipeMatch.Item(new ItemStack(Items.BUCKET), 1), fs, true, true));
TinkerRegistry.registerTableCasting(new CastingRecipe(ModuleCommons.castBucket, new RecipeMatch.Item(new ItemStack(Items.BUCKET), 1), fs, true, true));
}

proxy.postInit();
}

private void registerMeltingCasting() {
// cast iron buckets, because it sounds cool and opens an option for bucket gating with Ceramics
TinkerRegistry.registerTableCasting(new ItemStack(Items.BUCKET), KnightsCommons.castBucket, TinkerFluids.iron, Material.VALUE_Ingot * 3);
TinkerRegistry.registerTableCasting(new ItemStack(Items.BUCKET), ModuleCommons.castBucket, TinkerFluids.iron, Material.VALUE_Ingot * 3);

// override ore recipes to prevent ore doubling
for(MaterialIntegration integration : TinkerRegistry.getMaterialIntegrations()) {
Expand All @@ -129,8 +133,11 @@ private void registerMeltingCasting() {
}

// don't allow seared stone from cobblestone or stone
KnightsRegistry.registerMelterBlacklist(RecipeMatch.of("cobblestone"));
KnightsRegistry.registerMelterBlacklist(RecipeMatch.of("stone"));
if(Config.blacklistMelterStone) {
TCompRegistry.registerMelterBlacklist(RecipeMatch.of("cobblestone"));
TCompRegistry.registerMelterBlacklist(RecipeMatch.of("stone"));
TCompRegistry.registerMelterBlacklist(new PartMaterialBlacklist(TinkerMaterials.stone));
}
}

private static void registerOredictMeltingCasting(Fluid fluid, String ore) {
Expand All @@ -145,7 +152,7 @@ private static void registerOredictMeltingCasting(Fluid fluid, String ore) {

// register oredicts
for(Pair<List<ItemStack>, Integer> pair : knownOres) {
KnightsRegistry.registerMelterOverride(new MeltingRecipe(RecipeMatch.of(pair.getLeft(), pair.getRight()), fluid));
TCompRegistry.registerMelterOverride(new MeltingRecipe(RecipeMatch.of(pair.getLeft(), pair.getRight()), fluid));
}
}
}
Loading

0 comments on commit d2506c3

Please sign in to comment.