Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
updated mod code, wake up message
Browse files Browse the repository at this point in the history
  • Loading branch information
roryclaasen committed Jul 28, 2017
1 parent b075117 commit c1a6670
Show file tree
Hide file tree
Showing 31 changed files with 1,782 additions and 97 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ minecraft {


replace '@version@', project.version
replaceIn "RorysMod.java"
replaceIn "RorysGlobal.java"
}

processResources {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

mod_version=1.3.5
mod_version=1.3.6

# Minecraft
mc_version=1.7.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import me.roryclaasen.rorysmod.block.base.BlockBaseContainer;
import me.roryclaasen.rorysmod.block.tile.TileEntityRenamer;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
Expand Down Expand Up @@ -79,9 +80,9 @@ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metad

@Override
public void registerBlockIcons(IIconRegister reg) {
this.icons[0] = reg.registerIcon(RorysMod.MODID + ":machineTop");
this.icons[1] = reg.registerIcon(RorysMod.MODID + ":machineRenamer");
this.icons[2] = reg.registerIcon(RorysMod.MODID + ":machineBottom");
this.icons[0] = reg.registerIcon(RorysGlobal.MODID + ":machineTop");
this.icons[1] = reg.registerIcon(RorysGlobal.MODID + ":machineRenamer");
this.icons[2] = reg.registerIcon(RorysGlobal.MODID + ":machineBottom");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
*/
package me.roryclaasen.rorysmod.block.base;

import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import me.roryclaasen.rorysmod.core.RorysMod;

public class BlockBase extends Block {

public BlockBase(Material material, String unlocalizedName) {
super(material);
this.setBlockName(RorysMod.MODID + "_" + unlocalizedName);
this.setBlockTextureName(RorysMod.MODID + ":" + unlocalizedName);
this.setCreativeTab(RorysMod.tab);
this.setBlockName(RorysGlobal.MODID + "_" + unlocalizedName);
this.setBlockTextureName(RorysGlobal.MODID + ":" + unlocalizedName);
this.setCreativeTab(RorysMod.creativeTab);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package me.roryclaasen.rorysmod.block.base;

import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
Expand All @@ -22,9 +23,9 @@ public class BlockBaseContainer extends BlockContainer {

public BlockBaseContainer(Material material, String unlocalizedName) {
super(material);
this.setBlockName(RorysMod.MODID + "_" + unlocalizedName);
this.setBlockTextureName(RorysMod.MODID + ":" + unlocalizedName);
this.setCreativeTab(RorysMod.tab);
this.setBlockName(RorysGlobal.MODID + "_" + unlocalizedName);
this.setBlockTextureName(RorysGlobal.MODID + ":" + unlocalizedName);
this.setCreativeTab(RorysMod.creativeTab);
}

@Override
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/me/roryclaasen/rorysmod/core/RorysGlobal.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public class RorysGlobal {

private RorysGlobal() {}

public static final ArmorMaterial SOLDER_ARMOR = EnumHelper.addArmorMaterial("solder", 12, new int[] { 2, 5, 3, 1 }, 15);
public static final String MODID = "rorysmod";
public static final String NAME = "Rory's Mod";
public static final String VERSION = "@version@";

public static final ArmorMaterial SOLDER_ARMOR = EnumHelper.addArmorMaterial("solder", 12, new int[] { 1, 4, 2, 1 }, 10);

/**
* Beds can be used at this point.
*/
public static final long BED_TICK_SLEEP = 12516L;

public static final long BED_TICK_WAKEUP = 24000L;
}
26 changes: 11 additions & 15 deletions src/main/java/me/roryclaasen/rorysmod/core/RorysMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import me.roryclaasen.rorysmod.core.network.PacketDispatcher;
import me.roryclaasen.rorysmod.core.network.proxy.CommonProxy;
import me.roryclaasen.rorysmod.core.recipe.RoryChargedShapedRecipe;
import me.roryclaasen.rorysmod.core.recipe.RoryShapedRecipe;
import me.roryclaasen.rorysmod.core.recipe.RoryChargedShapelessRecipe;
import me.roryclaasen.rorysmod.core.recipe.RoryShapedRecipe;
import me.roryclaasen.rorysmod.core.recipe.RoryShapelessRecipe;
import me.roryclaasen.rorysmod.core.register.Register;
import me.roryclaasen.rorysmod.entity.EntityLaser;
Expand All @@ -44,19 +44,15 @@
import net.minecraft.item.Item;
import net.minecraftforge.oredict.RecipeSorter;

@Mod(modid = RorysMod.MODID, name = RorysMod.NAME, version = RorysMod.VERSION, dependencies = "after:CoFHCore;after:IC2;")
@Mod(modid = RorysGlobal.MODID, name = RorysGlobal.NAME, version = RorysGlobal.VERSION, dependencies = "after:CoFHCore;after:IC2;")
public class RorysMod {

@SidedProxy(clientSide = "me.roryclaasen.rorysmod.core.network.proxy.ClientProxy", serverSide = "me.roryclaasen.rorysmod.core.network.proxy.CommonProxy")
public static CommonProxy proxy;

public static final String MODID = "rorysmod";
public static final String NAME = "Rory's Mod";
public static final String VERSION = "@version@";

public static Random random;

@Instance(MODID)
@Instance(RorysGlobal.MODID)
public static RorysMod instance;

public static enum GUIS {
Expand All @@ -82,7 +78,7 @@ public String getName() {
public static ModBlocks blocks;
public static ModItems items;

public static CreativeTabs tab;
public static CreativeTabs creativeTab;

public Version versionCheker;

Expand All @@ -97,12 +93,12 @@ public String getName() {
public void preInit(FMLPreInitializationEvent event) {
instance = this;

versionCheker = new Version(RorysMod.VERSION);
versionCheker = new Version(RorysGlobal.VERSION);

settings = new Settings(event);
settings.load(event);

tab = new CreativeTabs("rorysMobTab") {
creativeTab = new CreativeTabs("rorysMobTab") {
@Override
public Item getTabIconItem() {
return RorysMod.items.rifle1;
Expand Down Expand Up @@ -152,10 +148,10 @@ private void registerEventHandlers() {
}

private void registerRecipieSorter() {
RecipeSorter.register(RorysMod.MODID + ":shaped", RoryShapedRecipe.class, RecipeSorter.Category.SHAPED, "");
RecipeSorter.register(RorysMod.MODID + ":shapeless", RoryShapelessRecipe.class, RecipeSorter.Category.SHAPELESS, "after:" + RorysMod.MODID + ":shaped");
RecipeSorter.register(RorysMod.MODID + ":shapedCharge", RoryChargedShapedRecipe.class, RecipeSorter.Category.SHAPED, "after:" + RorysMod.MODID + ":shapeless");
RecipeSorter.register(RorysMod.MODID + ":shapelessCharge", RoryChargedShapelessRecipe.class, RecipeSorter.Category.SHAPELESS, "after:" + RorysMod.MODID + ":shapedCharge");
RecipeSorter.register(RorysGlobal.MODID + ":shaped", RoryShapedRecipe.class, RecipeSorter.Category.SHAPED, "");
RecipeSorter.register(RorysGlobal.MODID + ":shapeless", RoryShapelessRecipe.class, RecipeSorter.Category.SHAPELESS, "after:" + RorysGlobal.MODID + ":shaped");
RecipeSorter.register(RorysGlobal.MODID + ":shapedCharge", RoryChargedShapedRecipe.class, RecipeSorter.Category.SHAPED, "after:" + RorysGlobal.MODID + ":shapeless");
RecipeSorter.register(RorysGlobal.MODID + ":shapelessCharge", RoryChargedShapelessRecipe.class, RecipeSorter.Category.SHAPELESS, "after:" + RorysGlobal.MODID + ":shapedCharge");
}

@EventHandler
Expand All @@ -175,7 +171,7 @@ public void postinit(FMLPostInitializationEvent event) {
RMLog.info("Registered " + Register.getRegisteredEvents() + " event(s)");
RMLog.info("Registered " + PacketDispatcher.getPacketId() + " packet(s)");

Thread check = new Thread(versionCheker, RorysMod.MODID + " Version Check");
Thread check = new Thread(versionCheker, RorysGlobal.MODID + " Version Check");
check.start();
}
}
4 changes: 2 additions & 2 deletions src/main/java/me/roryclaasen/rorysmod/core/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public void updateSettings() {

@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
if (RorysMod.MODID.equals(event.modID)) updateSettings();
if ((RorysMod.MODID + "core").equals(event.modID)) updateSettings();
if (RorysGlobal.MODID.equals(event.modID)) updateSettings();
if ((RorysGlobal.MODID + "core").equals(event.modID)) updateSettings();
}

public static Configuration getConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
package me.roryclaasen.rorysmod.core.intergrations;

import cpw.mods.fml.common.Loader;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.util.RMLog;
import mekanism.api.infuse.InfuseObject;
import mekanism.api.infuse.InfuseRegistry;
import mekanism.api.infuse.InfuseType;
import mekanism.api.recipe.RecipeHelper;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;

@SuppressWarnings("deprecation")
public class MekanismPlugin {
Expand All @@ -32,12 +34,15 @@ public static void load() {
}

private static void intergrate() {
InfuseType solderInfuse = new InfuseType("SOLDER", RorysMod.MODID + ":infuse/solder").setUnlocalizedName("solder");
InfuseType solderInfuse = new InfuseType("SOLDER", RorysGlobal.MODID + ":infuse/solder").setUnlocalizedName("solder");
InfuseRegistry.registerInfuseType(solderInfuse);
InfuseRegistry.registerInfuseObject(new ItemStack(RorysMod.items.solderWire), new InfuseObject(solderInfuse, 1));
InfuseRegistry.registerInfuseObject(new ItemStack(RorysMod.items.solderCoil), new InfuseObject(solderInfuse, 8));
InfuseRegistry.registerInfuseObject(new ItemStack(RorysMod.items.solderWire), new InfuseObject(solderInfuse, 10));
InfuseRegistry.registerInfuseObject(new ItemStack(RorysMod.items.solderCoil), new InfuseObject(solderInfuse, 80));

RecipeHelper.addMetallurgicInfuserRecipe(solderInfuse, 1, new ItemStack(RorysMod.items.blankCircuit), new ItemStack(RorysMod.items.circuit));
RecipeHelper.addMetallurgicInfuserRecipe(solderInfuse, 1, new ItemStack(RorysMod.items.blankAdvancedCircuit), new ItemStack(RorysMod.items.advancedCircuit));
for (ItemStack ironDust : OreDictionary.getOres("dustIron")) {
RecipeHelper.addMetallurgicInfuserRecipe(InfuseRegistry.get("CARBON"), 100, ironDust, new ItemStack(RorysMod.items.steelDust));
}
RecipeHelper.addMetallurgicInfuserRecipe(solderInfuse, 10, new ItemStack(RorysMod.items.blankCircuit), new ItemStack(RorysMod.items.circuit));
RecipeHelper.addMetallurgicInfuserRecipe(solderInfuse, 10, new ItemStack(RorysMod.items.blankAdvancedCircuit), new ItemStack(RorysMod.items.advancedCircuit));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import codechicken.nei.api.IConfigureNEI;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.intergrations.nei.RoryShapedRecipeHandler;
import me.roryclaasen.rorysmod.core.intergrations.nei.RoryShapelessRecipeHandler;
Expand All @@ -26,7 +27,7 @@
public class NEIRorysModConfig implements IConfigureNEI {
@Override
public void loadConfig() {
RMLog.info("Loading NEI for " + RorysMod.NAME);
RMLog.info("Loading NEI for " + RorysGlobal.NAME);
API.hideItem(new ItemStack(RorysMod.items.laserBolt));

API.registerRecipeHandler(new RoryShapelessRecipeHandler());
Expand All @@ -38,11 +39,11 @@ public void loadConfig() {

@Override
public String getName() {
return RorysMod.NAME + " NEI Plugin";
return RorysGlobal.NAME + " NEI Plugin";
}

@Override
public String getVersion() {
return RorysMod.VERSION;
return RorysGlobal.VERSION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.ShapedRecipeHandler;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.recipe.RoryShapedRecipe;
import me.roryclaasen.rorysmod.util.RecipeUtils;
import net.minecraft.item.ItemStack;
Expand All @@ -29,7 +29,7 @@
public class RoryShapedRecipeHandler extends ShapedRecipeHandler {
@Override
public String getRecipeName() {
return RorysMod.NAME + " " + StatCollector.translateToLocal("recipie.rorysmod.shaped");
return RorysGlobal.NAME + " " + StatCollector.translateToLocal("recipie.rorysmod.shaped");
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.ShapelessRecipeHandler;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.recipe.RoryShapelessRecipe;
import me.roryclaasen.rorysmod.util.RecipeUtils;
import net.minecraft.item.ItemStack;
Expand All @@ -29,7 +29,7 @@ public class RoryShapelessRecipeHandler extends ShapelessRecipeHandler {

@Override
public String getRecipeName() {
return RorysMod.NAME + " " + StatCollector.translateToLocal("recipie.rorysmod.shapeless");
return RorysGlobal.NAME + " " + StatCollector.translateToLocal("recipie.rorysmod.shapeless");
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.network.message.SyncEntityLaserData;
import me.roryclaasen.rorysmod.core.network.message.SyncRenamerInfo;
import me.roryclaasen.rorysmod.core.network.message.SyncTileEntityData;
Expand All @@ -27,7 +27,7 @@
public class PacketDispatcher {
private static byte packetId = 0;

private static final SimpleNetworkWrapper dispatcher = NetworkRegistry.INSTANCE.newSimpleChannel(RorysMod.MODID);
private static final SimpleNetworkWrapper dispatcher = NetworkRegistry.INSTANCE.newSimpleChannel(RorysGlobal.MODID);

public static final void registerPackets() {
registerMessage(SyncTileEntityData.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public void onPlayerSleepInBedEvent(PlayerSleepInBedEvent event) throws IllegalA
if (!worldObj.isRemote) {
worldObj.updateAllPlayersSleepingFlag();
if (worldObj.isDaytime()) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.rorysmod.sleeping.daytime")));
else {
// TODO msg x amount of player are sleeping
}
}
event.result = EntityPlayer.EnumStatus.OK;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package me.roryclaasen.rorysmod.event;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.Version;
import me.roryclaasen.rorysmod.util.UsefulFunctions;
Expand All @@ -34,9 +35,9 @@ public void onPlayerJoinWorld(EntityJoinWorldEvent event) {
if (!version.haveWarnedVersionOutOfDate && !version.isLatestVersion()) {
ChatComponentText localChatComponentText = new ChatComponentText("");
ChatStyle localChatStyle;
IChatComponent modVersion = new ChatComponentText(EnumChatFormatting.AQUA + StatCollector.translateToLocal("message.rorysmod.version.current") + ": " + RorysMod.VERSION);
IChatComponent modVersion = new ChatComponentText(EnumChatFormatting.AQUA + StatCollector.translateToLocal("message.rorysmod.version.current") + ": " + RorysGlobal.VERSION);

IChatComponent modName = new ChatComponentText(EnumChatFormatting.GOLD + "[" + RorysMod.NAME + "]" + EnumChatFormatting.WHITE);
IChatComponent modName = new ChatComponentText(EnumChatFormatting.GOLD + "[" + RorysGlobal.NAME + "]" + EnumChatFormatting.WHITE);
localChatStyle = modName.getChatStyle();
localChatStyle.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, modVersion));
localChatStyle.setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "http://rorysmod.rtfd.io"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import cofh.lib.gui.element.ElementTextField;
import me.roryclaasen.rorysmod.block.tile.TileEntityRenamer;
import me.roryclaasen.rorysmod.container.ContainerMachineRenamer;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;

public class GuiMachineRenamer extends GuiBase {

private static final ResourceLocation TEXTURE = new ResourceLocation(RorysMod.MODID, "textures/gui/renamer.png");
private static final ResourceLocation TEXTURE = new ResourceLocation(RorysGlobal.MODID, "textures/gui/renamer.png");

private TileEntityRenamer tileEntity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import cofh.lib.gui.GuiBase;
import me.roryclaasen.rorysmod.block.tile.TileEntityPoweredChest;
import me.roryclaasen.rorysmod.container.ContainerPoweredChest;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
Expand All @@ -23,7 +24,7 @@
public class GuiPoweredChest extends GuiBase {

public GuiPoweredChest(TileEntityPoweredChest te, EntityPlayer player) {
super(new ContainerPoweredChest(te, player), new ResourceLocation(RorysMod.MODID, "textures/gui/chest.png"));
super(new ContainerPoweredChest(te, player), new ResourceLocation(RorysGlobal.MODID, "textures/gui/chest.png"));
}

@Override
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/me/roryclaasen/rorysmod/gui/GuiRifleTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import cpw.mods.fml.client.config.GuiSlider;
import me.roryclaasen.rorysmod.block.tile.TileEntityRifleTable;
import me.roryclaasen.rorysmod.container.ContainerRifleTable;
import me.roryclaasen.rorysmod.core.RorysGlobal;
import me.roryclaasen.rorysmod.core.RorysMod;
import me.roryclaasen.rorysmod.core.Settings;
import me.roryclaasen.rorysmod.item.tools.ItemRifle;
Expand All @@ -35,8 +36,8 @@ public class GuiRifleTable extends GuiBase {

private TileEntityRifleTable tileEntity;

private static ResourceLocation empty = new ResourceLocation(RorysMod.MODID, "textures/gui/table-empty.png");
private static ResourceLocation table = new ResourceLocation(RorysMod.MODID, "textures/gui/table.png");
private static ResourceLocation empty = new ResourceLocation(RorysGlobal.MODID, "textures/gui/table-empty.png");
private static ResourceLocation table = new ResourceLocation(RorysGlobal.MODID, "textures/gui/table.png");

private GuiSlider colorR, colorG, colorB;
private GuiButton save;
Expand Down

0 comments on commit c1a6670

Please sign in to comment.