Added Gems, their ores, descriptions and world gen. Textures aren't final.

This commit is contained in:
Ellpeck 2014-11-10 16:47:04 +01:00
parent 10c07bd5d3
commit 931d6f53c3
11 changed files with 416 additions and 19 deletions

View file

@ -17,9 +17,9 @@ buildscript {
apply plugin: 'forge' apply plugin: 'forge'
version = "1.0" version = "1.7.10-1.0"
group= "ellpeck.thingycraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = "ellpeck.thingycraft"
archivesBaseName = "thingycraft" archivesBaseName = "ThingyCraft"
minecraft { minecraft {
version = "1.7.10-10.13.2.1230" version = "1.7.10-10.13.2.1230"
@ -27,36 +27,20 @@ minecraft {
} }
dependencies { dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
} }
processResources processResources
{ {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version expand 'version':project.version, 'mcversion':project.minecraft.version
} }
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info' exclude 'mcmod.info'
} }

View file

@ -0,0 +1,51 @@
package ellpeck.thingycraft;
import cpw.mods.fml.common.IWorldGenerator;
import ellpeck.thingycraft.blocks.InitBlocks;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import java.util.Random;
public class OreGen implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
switch (world.provider.dimensionId){
case -1:
generateNether(world, random, chunkX * 16, chunkZ * 16);
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
}
}
@SuppressWarnings("unused")
private void generateEnd(World world, Random random, int x, int z){
}
private void generateSurface(World world, Random random, int x, int z){
for(int i = 0; i < Util.gemTypes.length; i++) {
this.addOreSpawn(InitBlocks.oreGem, i, Blocks.stone, world, random, x, z, 4 + random.nextInt(3), 12, 1, 70);
}
}
@SuppressWarnings("unused")
private void generateNether(World world, Random random, int x, int z){
}
public void addOreSpawn(Block block, int meta, Block blockIn, World world, Random random, int blockXPos, int blockZPos, int maxVeinSize, int chancesToSpawn, int minY, int maxY){
int yDiff = maxY - minY;
for(int i = 0; i < chancesToSpawn; i++){
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(yDiff);
int posZ = blockZPos + random.nextInt(16);
(new WorldGenMinable(block, meta, maxVeinSize, blockIn)).generate(world, random, posX, posY, posZ);
}
}
}

View file

@ -0,0 +1,38 @@
package ellpeck.thingycraft;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.Mod.*;
import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.thingycraft.blocks.InitBlocks;
import ellpeck.thingycraft.items.InitItems;
@Mod(modid = ThingyCraft.MOD_ID, name = ThingyCraft.NAME, version = ThingyCraft.VERSION)
public class ThingyCraft {
@Instance(ThingyCraft.MOD_ID)
public static ThingyCraft instance;
public static final String MOD_ID = "thingycraft";
public static final String NAME = "ThingyCraft";
public static final String VERSION = "1.7.10-1.0";
@SuppressWarnings("unused")
@EventHandler()
public void preInit(FMLPreInitializationEvent event){
InitBlocks.init();
InitItems.init();
}
@SuppressWarnings("unused")
@EventHandler()
public void init(FMLInitializationEvent event){
GameRegistry.registerWorldGenerator(new OreGen(), 0);
}
@SuppressWarnings("unused")
@EventHandler()
public void postInit(FMLPostInitializationEvent event){
}
}

View file

@ -0,0 +1,19 @@
package ellpeck.thingycraft;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
public class Util {
public static final String[] gemTypes = {"Malachite", "Agate", "MaliGarnet", "MawSitSit", "Melanite", "Moldavite", "Amazonite", "Amber", "Amethyst", "Nuummite", "Apatite", "Onyx", "Orthoclase", "Bloodstone", "Peridot", "ChromeDiopside"};
public static boolean isShiftPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}
public static String shiftForInfo(){
return (EnumChatFormatting.ITALIC + StatCollector.translateToLocal("tooltip.shiftForInfo.desc"));
}
}

View file

@ -0,0 +1,18 @@
package ellpeck.thingycraft.blocks;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
public class InitBlocks{
public static Block oreGem;
public static void init(){
oreGem = new OreGem();
GameRegistry.registerBlock(oreGem, ItemBlockOreGem.class, oreGem.getUnlocalizedName().substring(5));
}
}

View file

@ -0,0 +1,43 @@
package ellpeck.thingycraft.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.thingycraft.Util;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import java.util.List;
public class ItemBlockOreGem extends ItemBlock {
public ItemBlockOreGem(Block block){
super(block);
setHasSubtypes(true);
}
public String getUnlocalizedName(ItemStack stack) {
return this.getUnlocalizedName() + Util.gemTypes[stack.getItemDamage()];
}
public int getMetadata(int i) {
return i;
}
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()){
for(int i = 0; i < Util.gemTypes.length; i++){
if(this.getDamage(stack) == i) list.add(StatCollector.translateToLocal("tooltip.gem" + Util.gemTypes[i] + ".desc"));
}
list.add(EnumChatFormatting.BOLD + StatCollector.translateToLocal("tooltip.gemIsOre.desc"));
}
else{
list.add(Util.shiftForInfo());
}
}
}

View file

@ -0,0 +1,61 @@
package ellpeck.thingycraft.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.thingycraft.ThingyCraft;
import ellpeck.thingycraft.Util;
import ellpeck.thingycraft.items.InitItems;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import java.util.List;
import java.util.Random;
public class OreGem extends Block{
public static final IIcon[] textures = new IIcon[Util.gemTypes.length];
public OreGem() {
super(Material.rock);
this.setHardness(3.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeStone);
this.setCreativeTab(CreativeTabs.tabBrewing);
this.setBlockName("oreGem");
this.setHarvestLevel("pickaxe", 2);
}
@SuppressWarnings("unchecked")
public void getSubBlocks(Item stack, CreativeTabs tab, List list) {
for (int i = 0; i < Util.gemTypes.length; i++) {
list.add(new ItemStack(stack, 1, i));
}
}
public Item getItemDropped(int par1, Random rand, int par3){
return InitItems.itemGem;
}
public int damageDropped(int i){
return i;
}
public int quantityDropped(Random rand){
return 1 + rand.nextInt(5);
}
public IIcon getIcon(int side, int meta) {
return textures[meta];
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg) {
for (int i = 0; i < Util.gemTypes.length; i++) {
textures[i] = iconReg.registerIcon(ThingyCraft.MOD_ID + ":" + this.getUnlocalizedName().substring(5) + Util.gemTypes[i]);
}
}
}

View file

@ -0,0 +1,17 @@
package ellpeck.thingycraft.items;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
public class InitItems {
public static Item itemGem;
public static void init(){
itemGem = new ItemGem();
GameRegistry.registerItem(itemGem, itemGem.getUnlocalizedName().substring(5));
}
}

View file

@ -0,0 +1,64 @@
package ellpeck.thingycraft.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.thingycraft.ThingyCraft;
import ellpeck.thingycraft.Util;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import java.util.List;
public class ItemGem extends Item {
public static final IIcon[] textures = new IIcon[Util.gemTypes.length];
public ItemGem(){
this.setHasSubtypes(true);
this.setCreativeTab(CreativeTabs.tabBrewing);
this.setUnlocalizedName("itemGem");
}
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()){
for(int i = 0; i < Util.gemTypes.length; i++){
if(this.getDamage(stack) == i) list.add(StatCollector.translateToLocal("tooltip.gem" + Util.gemTypes[i] + ".desc"));
}
}
else{
list.add(Util.shiftForInfo());
}
}
public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName() + Util.gemTypes[stack.getItemDamage()];
}
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list){
for (int i = 0; i < Util.gemTypes.length; i++) {
list.add(new ItemStack(item, 1, i));
}
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1){
return textures[par1];
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){
for (int i = 0; i < Util.gemTypes.length; i++) {
textures[i] = iconReg.registerIcon(ThingyCraft.MOD_ID + ":" + this.getUnlocalizedName().substring(5) + Util.gemTypes[i]);
}
}
}

View file

@ -0,0 +1,51 @@
item.itemGemMalachite.name=Malachit
item.itemGemAgate.name=Achat
item.itemGemMaliGarnet.name=Mali-Granat
item.itemGemMawSitSit.name=Maw-Sit-Sit
item.itemGemMelanite.name=Melanit
item.itemGemMoldavite.name=Moldavit
item.itemGemAmazonite.name=Amazonit
item.itemGemAmber.name=Bernstein
item.itemGemAmethyst.name=Amethyst
item.itemGemNuummite.name=Nuummit
item.itemGemApatite.name=Apatit
item.itemGemOnyx.name=Onyx
item.itemGemOrthoclase.name=Alkalifeldspat
item.itemGemBloodstone.name=Roter Hämatit
item.itemGemPeridot.name=Peridot
item.itemGemChromeDiopside.name=Chromdiopsid
tile.oreGemMalachite.name=Malachiterz
tile.oreGemAgate.name=Achaterz
tile.oreGemMaliGarnet.name=Mali-Granat-Erz
tile.oreGemMawSitSit.name=Maw-Sit-Sit-Erz
tile.oreGemMelanite.name=Melaniterz
tile.oreGemMoldavite.name=Moldaviterz
tile.oreGemAmazonite.name=Amazoniterz
tile.oreGemAmber.name=Bernsteinerz
tile.oreGemAmethyst.name=Amethysterz
tile.oreGemNuummite.name=Nuummiterz
tile.oreGemApatite.name=Apatiterz
tile.oreGemOnyx.name=Onyxerz
tile.oreGemOrthoclase.name=Alkalifeldspaterz
tile.oreGemBloodstone.name=Roter Hämatit-Erz
tile.oreGemPeridot.name=Peridoterz
tile.oreGemChromeDiopside.name=Chromdiopsiderz
tooltip.gemIsOre.desc=Erzform, muss für Edelsteinform abgebaut werden
tooltip.gemMalachite.desc=Weicher Stein, kann sehr gut poliert werden
tooltip.gemAgate.desc=Form des Quartz, existiert in verschiedenen Formen und Farben
tooltip.gemMaliGarnet.desc=Gemisch aus glossularen und andraditen Granaten
tooltip.gemMawSitSit.desc=Ungewöhnlicher Edelstein, nach Stadt in Barma benannt
tooltip.gemMelanite.desc=Manchmal auch Titanian-Andradit genannt
tooltip.gemMoldavite.desc=Tektit, entsteht nach Meteroiteneinschlag
tooltip.gemAmazonite.desc=Wurde nach einem Fluss benannt, an dem es aber nicht gefunden wurde
tooltip.gemAmber.desc=Gehärtetes Pinienharz, vor 50 Millionen Jahren entstanden
tooltip.gemAmethyst.desc=Wertvoller Edelstein aus der Quartzgruppe
tooltip.gemNuummite.desc=Metamorphischer Stein mit atemberaubenden Farben
tooltip.gemApatite.desc=Hat viele verschiedene Farben und Formen
tooltip.gemOnyx.desc=Schwarze Form des Chalcedony, Form des Quartz
tooltip.gemOrthoclase.desc=Transparenter, gelber Feldspat aus Madagaskar
tooltip.gemBloodstone.desc=Auch bekannt als Heliotrop, hat Punkte aus Eisenoxid
tooltip.gemPeridot.desc=Idiochromatischer Edelstein aus der Forsterit-Fayalit-Mineralserie
tooltip.gemChromeDiopside.desc=Mit Chrom gefärbt, hat Ähnlichkeit zu Chromtourlamin

View file

@ -0,0 +1,51 @@
item.itemGemMalachite.name=Malachite
item.itemGemAgate.name=Agate
item.itemGemMaliGarnet.name=Mali Garnet
item.itemGemMawSitSit.name=Maw-Sit-Sit
item.itemGemMelanite.name=Melanite
item.itemGemMoldavite.name=Moldavite
item.itemGemAmazonite.name=Amazonite
item.itemGemAmber.name=Amber
item.itemGemAmethyst.name=Amethyst
item.itemGemNuummite.name=Nuummite
item.itemGemApatite.name=Apatite
item.itemGemOnyx.name=Onyx
item.itemGemOrthoclase.name=Orthoclase
item.itemGemBloodstone.name=Bloodstone
item.itemGemPeridot.name=Peridot
item.itemGemChromeDiopside.name=Chrome Diopside
tile.oreGemMalachite.name=Malachite Ore
tile.oreGemAgate.name=Agate Ore
tile.oreGemMaliGarnet.name=Mali Garnet Ore
tile.oreGemMawSitSit.name=Maw-Sit-Sit Ore
tile.oreGemMelanite.name=Melanite Ore
tile.oreGemMoldavite.name=Moldavite Ore
tile.oreGemAmazonite.name=Amazonite Ore
tile.oreGemAmber.name=Amber Ore
tile.oreGemAmethyst.name=Amethyst Ore
tile.oreGemNuummite.name=Nuummite Ore
tile.oreGemApatite.name=Apatite Ore
tile.oreGemOnyx.name=Onyx Ore
tile.oreGemOrthoclase.name=Orthoclase Ore
tile.oreGemBloodstone.name=Bloodstone Ore
tile.oreGemPeridot.name=Peridot Ore
tile.oreGemChromeDiopside.name=Chrome Diopside Ore
tooltip.gemIsOre.desc=Ore Form, needs to get broken down into Gems
tooltip.gemMalachite.desc=Not a hard stone, takes an excellent polish
tooltip.gemAgate.desc=Form of Quartz, forms in a variety of colors and textures
tooltip.gemMaliGarnet.desc=Mixture of glossular and andradite garnets
tooltip.gemMawSitSit.desc=Unusual Gem, Named after Village in Burma
tooltip.gemMelanite.desc=Sometimes known as titanian andradite
tooltip.gemMoldavite.desc=Tektite, formed after meteorite impact
tooltip.gemAmazonite.desc=Named after a river where it hasn't been found
tooltip.gemAmber.desc=Hardened Resin of pine trees, formed 50mio years ago
tooltip.gemAmethyst.desc=Precious Gem within the quartz group
tooltip.gemNuummite.desc=Metamorphic rock with an iridescent play of color
tooltip.gemApatite.desc=Has many different colors and forms
tooltip.gemOnyx.desc=Black form of chalcedony, which is a form of quartz
tooltip.gemOrthoclase.desc=Transparent yellow feldspar found in Madagascar
tooltip.gemBloodstone.desc=Also known as Heliotrope, has spots of Iron Oxide
tooltip.gemPeridot.desc=Idiochromatic gem from the forsterite-fayalite mineral series
tooltip.gemChromeDiopside.desc=Colored by chromium, has similarities to chrome tourmaline