Skip to content

Commit

Permalink
Fix typo in project name, fix config, build 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Jul 22, 2017
1 parent d2506c3 commit 06b9f18
Show file tree
Hide file tree
Showing 102 changed files with 324 additions and 287 deletions.
4 changes: 2 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.tcompliment"
archivesBaseName = "TinkersCompliment"
group = "knightminer.tcomplement"
archivesBaseName = "TinkersComplement"

// External properties
ext.configFile = file "build.properties"
Expand Down
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.1
mod_version=0.1.2
minecraft_version=1.11.2
forge_version=13.20.0.2282
mappings=snapshot_20170401
Expand Down
86 changes: 86 additions & 0 deletions src/main/java/knightminer/tcomplement/TinkersComplement.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package knightminer.tcomplement;

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

import knightminer.tcomplement.common.Config;
import knightminer.tcomplement.common.TCompNetwork;
import knightminer.tcomplement.feature.ModuleFeature;
import knightminer.tcomplement.plugin.ceramics.CeramicsPlugin;
import knightminer.tcomplement.plugin.exnihilo.ExNihiloPlugin;
import knightminer.tcomplement.shared.ModuleCommons;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
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 = TinkersComplement.modID,
name = TinkersComplement.modName,
version = TinkersComplement.modVersion,
dependencies = "required-after:forge;"
+ "required-after:mantle;"
+ "required-after:tconstruct;"
+ "after:exnihiloadscensio",
acceptedMinecraftVersions = "[1.11.2, 1.12)")
public class TinkersComplement {
public static final String modID = "tcomplement";
public static final String modVersion = "${version}";
public static final String modName = "Tinkers' Complement";

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

@Mod.Instance(modID)
public static TinkersComplement instance;

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

static {
pulseManager.registerPulse(new ModuleCommons());
pulseManager.registerPulse(new ModuleFeature());
pulseManager.registerPulse(new ExNihiloPlugin());
pulseManager.registerPulse(new CeramicsPlugin());
}

@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
Config.load(event);
NetworkRegistry.INSTANCE.registerGuiHandler(instance, guiHandler);

TCompNetwork.instance.setup();
}

// Old version compatibility
@Mod.EventHandler
public void onMissingMapping(FMLMissingMappingsEvent event) {
// TODO: safe to remove when I update to 1.12
// thanks to /u/Thiakil on reddit for this code
for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){
if (mapping.resourceLocation.getResourceDomain().equals( "tcompliment" )){
ResourceLocation newLoc = new ResourceLocation( modID, mapping.resourceLocation.getResourcePath() );
switch( mapping.type ){
case ITEM:
Item newItem = Item.REGISTRY.getObject( newLoc );
if (newItem != null)
mapping.remap( newItem );
else
mapping.warn();
break;
case BLOCK:
Block newBlock = Block.REGISTRY.getObject( newLoc );
if (newBlock != null && newBlock != Blocks.AIR)
mapping.remap( newBlock );
else
mapping.warn();
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package knightminer.tcompliment.common;
package knightminer.tcomplement.common;

import javax.annotation.Nonnull;

import knightminer.tcompliment.library.Util;
import knightminer.tcomplement.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.tcompliment.common;
package knightminer.tcomplement.common;

public class CommonProxy {
public void preInit() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package knightminer.tcompliment.common;
package knightminer.tcomplement.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 ForgeCFG pulseConfig = new ForgeCFG("TComplementModules", "Modules");

public static float oreToIngotRatio = 1.0f;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package knightminer.tcompliment.common;
package knightminer.tcomplement.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.tcompliment.common;
package knightminer.tcomplement.common;

import knightminer.tcompliment.TinkersCompliment;
import knightminer.tcompliment.feature.ModuleFeature;
import knightminer.tcompliment.library.Util;
import knightminer.tcompliment.plugin.ceramics.CeramicsPlugin;
import knightminer.tcomplement.TinkersComplement;
import knightminer.tcomplement.feature.ModuleFeature;
import knightminer.tcomplement.library.Util;
import knightminer.tcomplement.plugin.ceramics.CeramicsPlugin;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -38,11 +38,11 @@ protected boolean isSmelteryLoaded() {
}

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

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

/* Blocks */
Expand Down Expand Up @@ -145,6 +145,10 @@ protected static void registerTE(Class<? extends TileEntity> teClazz, String nam
GameRegistry.registerTileEntity(teClazz, Util.resource(name));
}

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

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

import knightminer.tcompliment.TinkersCompliment;
import knightminer.tcompliment.feature.network.FluidUpdatePacket;
import knightminer.tcomplement.TinkersComplement;
import knightminer.tcomplement.feature.network.FluidUpdatePacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.math.BlockPos;
Expand All @@ -16,7 +16,7 @@ public class TCompNetwork extends NetworkWrapper {
public static TCompNetwork instance = new TCompNetwork();

public TCompNetwork() {
super(TinkersCompliment.modID);
super(TinkersComplement.modID);
}

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

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

import knightminer.tcompliment.common.ClientProxy;
import knightminer.tcompliment.feature.client.MelterRenderer;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcomplement.common.ClientProxy;
import knightminer.tcomplement.feature.client.MelterRenderer;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package knightminer.tcompliment.feature;
package knightminer.tcomplement.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.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 knightminer.tcomplement.common.CommonProxy;
import knightminer.tcomplement.common.Config;
import knightminer.tcomplement.common.ModIds;
import knightminer.tcomplement.common.PulseBase;
import knightminer.tcomplement.feature.blocks.BlockMelter;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import knightminer.tcomplement.library.TCompRegistry;
import knightminer.tcomplement.shared.ModuleCommons;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
Expand Down Expand Up @@ -44,9 +44,9 @@

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

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

public static Block melter;
Expand All @@ -67,7 +67,7 @@ public void preInit(FMLPreInitializationEvent event) {

}

registerTE(TileMelter.class, "melter");
registerTE(TileMelter.class, "melter", "tcompliment:melter");

proxy.preInit();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package knightminer.tcompliment.feature;
package knightminer.tcomplement.feature;

import knightminer.tcompliment.library.IBlacklist;
import knightminer.tcomplement.library.IBlacklist;
import net.minecraft.item.ItemStack;
import slimeknights.tconstruct.library.materials.Material;
import slimeknights.tconstruct.library.tools.IToolPart;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package knightminer.tcompliment.feature.blocks;
package knightminer.tcomplement.feature.blocks;

import java.util.Random;

import knightminer.tcompliment.TinkersCompliment;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcompliment.library.TCompRegistry;
import knightminer.tcomplement.TinkersComplement;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import knightminer.tcomplement.library.TCompRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
Expand Down Expand Up @@ -76,7 +76,7 @@ protected boolean openGui(EntityPlayer player, World world, BlockPos pos) {
return false;
}

player.openGui(TinkersCompliment.instance, 0, world, pos.getX(), pos.getY(), pos.getZ());
player.openGui(TinkersComplement.instance, 0, world, pos.getX(), pos.getY(), pos.getZ());
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package knightminer.tcompliment.feature.client;
package knightminer.tcomplement.feature.client;

import java.util.List;
import java.util.function.Consumer;

import com.google.common.collect.Lists;

import knightminer.tcompliment.feature.inventory.ContainerMelter;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcompliment.library.Util;
import knightminer.tcomplement.feature.inventory.ContainerMelter;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import knightminer.tcomplement.library.Util;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
Expand Down Expand Up @@ -85,12 +85,12 @@ else if((progress > 1f && progress < 2f) || progress == Float.POSITIVE_INFINITY)
else if(progress >= 2f && progress < 3f) {
bar = uberHeatBar;
progress = 1f;
tooltip = "gui.melter.progress.no_space";
tooltip = "gui.tcomplement.melter.progress.no_space";
}
else if(progress >= 3f) {
bar = uberHeatBar;
progress = 1f;
tooltip = "gui.melter.progress.wrong_fluid";
tooltip = "gui.tcomplement.melter.progress.wrong_fluid";
}

int height = 1 + Math.round(progress * (bar.h - 1));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package knightminer.tcompliment.feature.client;
package knightminer.tcomplement.feature.client;

import javax.annotation.Nonnull;

import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraftforge.fluids.FluidStack;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package knightminer.tcompliment.feature.inventory;
package knightminer.tcomplement.feature.inventory;

import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package knightminer.tcompliment.feature.multiblock;
package knightminer.tcomplement.feature.multiblock;

import com.google.common.collect.ImmutableList;

import knightminer.tcompliment.feature.blocks.BlockMelter;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcomplement.feature.blocks.BlockMelter;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package knightminer.tcompliment.feature.network;
package knightminer.tcomplement.feature.network;

import io.netty.buffer.ByteBuf;
import knightminer.tcompliment.feature.tileentity.TileMelter;
import knightminer.tcomplement.feature.tileentity.TileMelter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.nbt.NBTTagCompound;
Expand Down
Loading

0 comments on commit 06b9f18

Please sign in to comment.