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
Jack Hedges
committed
Apr 17, 2013
0 parents
commit 0937c70
Showing
7 changed files
with
810 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
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,22 @@ | ||
/bin/* | ||
/conf/* | ||
/docs/* | ||
/eclipse/* | ||
/forge/* | ||
/jars/* | ||
/lib/* | ||
/logs/* | ||
/modsrc/* | ||
/reobf/* | ||
/runtime/* | ||
/temp/* | ||
|
||
/src/minecraft/* | ||
/src/minecraft_server/* | ||
/src/common/* | ||
!/src/common/dries007/ | ||
!/src/common/mcmod.info | ||
!/src/common/SP.png | ||
|
||
*.bat | ||
*.sh |
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,11 @@ | ||
package co.uk.silvania.roads; | ||
|
||
public class CommonProxy { | ||
public static String ITEMS_PNG = "/silvania/roads/items.png"; | ||
public static String BLOCK_PNG = "/silvania/roads/blocks.png"; | ||
|
||
// Client stuff | ||
public void registerRenderers() { | ||
// Nothing here as the server doesn't render graphics! | ||
} | ||
} |
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,34 @@ | ||
package co.uk.silvania.roads; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.material.Material; | ||
|
||
public class RoadBlock extends Block { | ||
|
||
public RoadBlock (int id, int texture, Material material) { | ||
super(id, texture, material); | ||
} | ||
|
||
public int getBlockTextureFromSide(int side){ | ||
if(side == 0){ | ||
return blockIndexInTexture; | ||
}else{ | ||
return 1; | ||
|
||
} | ||
|
||
|
||
/*0 top | ||
1 bottom | ||
2 | ||
3 | ||
4 | ||
5*/ | ||
} | ||
|
||
@Override | ||
public String getTextureFile () { | ||
return CommonProxy.BLOCK_PNG; | ||
} | ||
|
||
} |
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,81 @@ | ||
package co.uk.silvania.roads; | ||
|
||
import net.minecraft.block.material.Material; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.common.Configuration; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.common.Property; | ||
import cpw.mods.fml.common.Mod; | ||
import cpw.mods.fml.common.Mod.Init; | ||
import cpw.mods.fml.common.Mod.Instance; | ||
import cpw.mods.fml.common.Mod.PostInit; | ||
import cpw.mods.fml.common.Mod.PreInit; | ||
import cpw.mods.fml.common.SidedProxy; | ||
import cpw.mods.fml.common.event.FMLInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPostInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
import cpw.mods.fml.common.network.NetworkMod; | ||
import cpw.mods.fml.common.registry.GameRegistry; | ||
import cpw.mods.fml.common.registry.LanguageRegistry; | ||
|
||
@Mod(modid="Roads", name="Roads", version="0.0.1") | ||
@NetworkMod(clientSideRequired=true, serverSideRequired=false) | ||
public class Roads { | ||
|
||
public static CreativeTabs tabRoads = new CreativeTabs("tabRoads") { | ||
public ItemStack getIconItemStack() { | ||
return new ItemStack(Item.eyeOfEnder, 1, 0); | ||
} | ||
}; | ||
|
||
public final static Block roadBlock = new RoadBlock(500, 0, Material.rock) | ||
.setHardness(1.0F).setStepSound(Block.soundStoneFootstep) | ||
.setBlockName("roadBlock").setCreativeTab(tabRoads); | ||
|
||
// The instance of your mod that Forge uses. | ||
@Instance("Roads") | ||
public static Roads instance; | ||
|
||
// Says where the client and server proxy code is loaded. | ||
@SidedProxy(clientSide="co.uk.silvania.roads.client.ClientProxy", serverSide="co.uk.silvania.roads.CommonProxy") | ||
public static CommonProxy proxy; | ||
|
||
@PreInit | ||
public void preInit(FMLPreInitializationEvent event) { | ||
//Does the file exist? If it doesn't this will create it. | ||
Configuration config = new Configuration(event.getSuggestedConfigurationFile()); | ||
|
||
//This will load the config file... | ||
config.load(); | ||
//...And this will save it. | ||
config.save(); | ||
|
||
//config.getBlock(NameOfProperty, defaultID).getInt(); | ||
int roadBlockID = config.getBlock("roadBlock", 200).getInt(); | ||
|
||
Property roadBlockProperty = config.get(Configuration.CATEGORY_GENERAL, "SomeConfigString", "nothing"); | ||
roadBlockProperty.comment = "This is a string. Change it, bitch!"; | ||
String roadBlockString = roadBlockProperty.value; | ||
} | ||
|
||
@Init | ||
public void load(FMLInitializationEvent event) { | ||
proxy.registerRenderers(); | ||
|
||
//Register the block's name | ||
LanguageRegistry.addName(roadBlock, "Tarmac (Unpainted)"); | ||
MinecraftForge.setBlockHarvestLevel(roadBlock, "pickaxe", 0); | ||
GameRegistry.registerBlock(roadBlock, "roadBlock"); | ||
//Set the name for the creative tab | ||
LanguageRegistry.instance().addStringLocalization("itemGroup.tabRoads", "en_US", "Roads"); | ||
|
||
} | ||
|
||
@PostInit | ||
public void postInit(FMLPostInitializationEvent event) { | ||
// Stub Method | ||
} | ||
}; |
Oops, something went wrong.