Jump to content

Recommended Posts

Posted

I am not very good at these things, but i need to know.

 

I have been following a YouTube tutorial on Custom Trees and got stuck at the en_US.lang part and now it doesn't register the new names. It keeps coming up as tile.logs.name instead of Ash Log and Teak Log.

 

Any help is helpful.

 

thanks

v_megalo_v

Posted

src/main/resources/assets/'modid'/lang/en_US.lang

 

and inside:

tile.<unloc name>.name=<ingame name>

tile.ore_copper.name=Copper Ore

1.7.10 is no longer supported by forge, you are on your own.

Posted

Well to start off with, I was following Neale Gaming's tutorial for 1.7.2 and then the stuff started to play up for me.

 

here is the code

 

TestTreeLog:

 

package mod.megalosmod.core.biome.features;

 

import java.util.List;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import mod.megalosmod.core.MM_Main;

import net.minecraft.block.BlockLog;

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;

 

public class testTreeLog extends BlockLog{

public static final String[] logs = new String[]{"ash","teak"};

 

public testTreeLog(){

super();

setBlockName("logs");

setCreativeTab(MM_Main.tabMT_Dendrology);

 

}

 

@SideOnly(Side.CLIENT)

@Override

public void getSubBlocks(Item item, CreativeTabs tabs, List list){

for (int i = 0; i < logs.length; i++){

list.add(new ItemStack(item, 1, i));

}

}

@SideOnly(Side.CLIENT)

@Override

public void registerBlockIcons(IIconRegister iconRegister){

this.field_150167_a = new IIcon[logs.length];

this.field_150166_b = new IIcon[logs.length];

 

for(int i = 0; i < this.field_150167_a.length; i++){

this.field_150167_a = iconRegister.registerIcon(this.getTextureName() + logs);

this.field_150166_b = iconRegister.registerIcon(this.getTextureName() + logs + "Top");

 

}

}

}

 

 

 

Test Tree Item Block:

 

package mod.megalosmod.core.item.itemblock;

 

import mod.megalosmod.core.MM_Main;

import net.minecraft.block.Block;

import net.minecraft.item.ItemBlock;

import net.minecraft.item.ItemStack;

 

public class ItemBlock_TestTree extends ItemBlock{

 

public static final String[] logs = new String[] {"ash", "teak"};

 

public ItemBlock_TestTree(Block block){

super(block);

this.setHasSubtypes(true);

}

 

public String getUnlocalizedName(ItemStack itemstack){

int i = itemstack.getItemDamage();

if (i < 0 || i>= logs.length){

i = 0;

}

 

return super.getUnlocalizedName() + "." + logs;

}

 

public int getMetadata(int meta){

return meta;

}

 

}

 

 

 

and the en_US:

 

tile.logs.ash.name=Ash Log

tile.logs.teak.name=Teak Log

 

 

 

I cannot use full code as it will take years to read

Posted

and this is the main file and gameregistry

 

package mod.megalosmod.core;

 

import mod.megalosmod.core.block.block.BlockAluminiumBlock;

import mod.megalosmod.core.block.block.BlockAntimonyBlock;

import mod.megalosmod.core.block.block.BlockAquariteBlock;

import mod.megalosmod.core.block.block.BlockBismuthBlock;

import mod.megalosmod.core.block.block.BlockCadiumBlock;

import mod.megalosmod.core.block.block.BlockChromiumBlock;

import mod.megalosmod.core.block.block.BlockCinnabarBlock;

import mod.megalosmod.core.block.block.BlockCobaltBlock;

import mod.megalosmod.core.block.block.BlockCopperBlock;

import mod.megalosmod.core.block.block.BlockDirtriumBlock;

import mod.megalosmod.core.block.block.BlockGalliumBlock;

import mod.megalosmod.core.block.block.BlockGustriumBlock;

import mod.megalosmod.core.block.block.BlockHafniumBlock;

import mod.megalosmod.core.block.block.BlockIndiumBlock;

import mod.megalosmod.core.block.block.BlockIridiumBlock;

import mod.megalosmod.core.block.block.BlockLavariteBlock;

import mod.megalosmod.core.block.block.BlockLeadBlock;

import mod.megalosmod.core.block.block.BlockMagnesiumBlock;

import mod.megalosmod.core.block.block.BlockManganeseBlock;

import mod.megalosmod.core.block.block.BlockMolybdeumBlock;

import mod.megalosmod.core.block.block.BlockNickelBlock;

import mod.megalosmod.core.block.block.BlockNiobiumBlock;

import mod.megalosmod.core.block.block.BlockOsmiumBlock;

import mod.megalosmod.core.block.block.BlockPalladiumBlock;

import mod.megalosmod.core.block.block.BlockPlatinumBlock;

import mod.megalosmod.core.block.block.BlockRheniumBlock;

import mod.megalosmod.core.block.block.BlockRhodiumBlock;

import mod.megalosmod.core.block.block.BlockRutheniumBlock;

import mod.megalosmod.core.block.block.BlockScandiumBlock;

import mod.megalosmod.core.block.block.BlockSilverBlock;

import mod.megalosmod.core.block.block.BlockTantalumBlock;

import mod.megalosmod.core.block.block.BlockThalliumBlock;

import mod.megalosmod.core.block.block.BlockTinBlock;

import mod.megalosmod.core.block.block.BlockTitaniumBlock;

import mod.megalosmod.core.block.block.BlockTungstenBlock;

import mod.megalosmod.core.block.block.BlockUraniumBlock;

import mod.megalosmod.core.block.block.BlockVanadiumBlock;

import mod.megalosmod.core.block.block.BlockYttriumBlock;

import mod.megalosmod.core.block.block.BlockZincBlock;

import mod.megalosmod.core.block.block.BlockZirconiumBlock;

import mod.megalosmod.core.block.brick.BlockAluminiumBrick;

import mod.megalosmod.core.block.brick.BlockAntimonyBrick;

import mod.megalosmod.core.block.brick.BlockAquariteBrick;

import mod.megalosmod.core.block.brick.BlockBismuthBrick;

import mod.megalosmod.core.block.brick.BlockCadiumBrick;

import mod.megalosmod.core.block.brick.BlockChromiumBrick;

import mod.megalosmod.core.block.brick.BlockCinnabarBrick;

import mod.megalosmod.core.block.brick.BlockCobaltBrick;

import mod.megalosmod.core.block.brick.BlockCopperBrick;

import mod.megalosmod.core.block.brick.BlockDirtriumBrick;

import mod.megalosmod.core.block.brick.BlockGalliumBrick;

import mod.megalosmod.core.block.brick.BlockGustriumBrick;

import mod.megalosmod.core.block.brick.BlockHafniumBrick;

import mod.megalosmod.core.block.brick.BlockIndiumBrick;

import mod.megalosmod.core.block.brick.BlockIridiumBrick;

import mod.megalosmod.core.block.brick.BlockLavariteBrick;

import mod.megalosmod.core.block.brick.BlockLeadBrick;

import mod.megalosmod.core.block.brick.BlockMagnesiumBrick;

import mod.megalosmod.core.block.brick.BlockManganeseBrick;

import mod.megalosmod.core.block.brick.BlockMolybdeumBrick;

import mod.megalosmod.core.block.brick.BlockNickelBrick;

import mod.megalosmod.core.block.brick.BlockNiobiumBrick;

import mod.megalosmod.core.block.brick.BlockOsmiumBrick;

import mod.megalosmod.core.block.brick.BlockPalladiumBrick;

import mod.megalosmod.core.block.brick.BlockPlatinumBrick;

import mod.megalosmod.core.block.brick.BlockRheniumBrick;

import mod.megalosmod.core.block.brick.BlockRhodiumBrick;

import mod.megalosmod.core.block.brick.BlockRutheniumBrick;

import mod.megalosmod.core.block.brick.BlockScandiumBrick;

import mod.megalosmod.core.block.brick.BlockSilverBrick;

import mod.megalosmod.core.block.brick.BlockTantalumBrick;

import mod.megalosmod.core.block.brick.BlockThalliumBrick;

import mod.megalosmod.core.block.brick.BlockTinBrick;

import mod.megalosmod.core.block.brick.BlockTitaniumBrick;

import mod.megalosmod.core.block.brick.BlockTungstenBrick;

import mod.megalosmod.core.block.brick.BlockUraniumBrick;

import mod.megalosmod.core.block.brick.BlockVanadiumBrick;

import mod.megalosmod.core.block.brick.BlockYttriumBrick;

import mod.megalosmod.core.block.brick.BlockZincBrick;

import mod.megalosmod.core.block.brick.BlockZirconiumBrick;

import mod.megalosmod.core.biome.features.testTreeLog;

import mod.megalosmod.core.biome.features.testTreeLeaves;

import mod.megalosmod.core.block.ore.BlockAluminiumOre;

import mod.megalosmod.core.block.ore.BlockAntimonyOre;

import mod.megalosmod.core.block.ore.BlockAquariteOre;

import mod.megalosmod.core.block.ore.BlockBismuthOre;

import mod.megalosmod.core.block.ore.BlockCadiumOre;

import mod.megalosmod.core.block.ore.BlockChromiumOre;

import mod.megalosmod.core.block.ore.BlockCinnabarOre;

import mod.megalosmod.core.block.ore.BlockCobaltOre;

import mod.megalosmod.core.block.ore.BlockCopperOre;

import mod.megalosmod.core.block.ore.BlockDirtriumOre;

import mod.megalosmod.core.block.ore.BlockGalliumOre;

import mod.megalosmod.core.block.ore.BlockGustriumOre;

import mod.megalosmod.core.block.ore.BlockHafniumOre;

import mod.megalosmod.core.block.ore.BlockIndiumOre;

import mod.megalosmod.core.block.ore.BlockIridiumOre;

import mod.megalosmod.core.block.ore.BlockLavariteOre;

import mod.megalosmod.core.block.ore.BlockLeadOre;

import mod.megalosmod.core.block.ore.BlockMagnesiumOre;

import mod.megalosmod.core.block.ore.BlockManganeseOre;

import mod.megalosmod.core.block.ore.BlockMolybdeumOre;

import mod.megalosmod.core.block.ore.BlockNickelOre;

import mod.megalosmod.core.block.ore.BlockNiobiumOre;

import mod.megalosmod.core.block.ore.BlockOsmiumOre;

import mod.megalosmod.core.block.ore.BlockPalladiumOre;

import mod.megalosmod.core.block.ore.BlockPlatinumOre;

import mod.megalosmod.core.block.ore.BlockRheniumOre;

import mod.megalosmod.core.block.ore.BlockRhodiumOre;

import mod.megalosmod.core.block.ore.BlockRutheniumOre;

import mod.megalosmod.core.block.ore.BlockScandiumOre;

import mod.megalosmod.core.block.ore.BlockSilverOre;

import mod.megalosmod.core.block.ore.BlockTantalumOre;

import mod.megalosmod.core.block.ore.BlockThalliumOre;

import mod.megalosmod.core.block.ore.BlockTinOre;

import mod.megalosmod.core.block.ore.BlockTitaniumOre;

import mod.megalosmod.core.block.ore.BlockTungstenOre;

import mod.megalosmod.core.block.ore.BlockUraniumOre;

import mod.megalosmod.core.block.ore.BlockVanadiumOre;

import mod.megalosmod.core.block.ore.BlockYttriumOre;

import mod.megalosmod.core.block.ore.BlockZincOre;

import mod.megalosmod.core.block.ore.BlockZirconiumOre;

import mod.megalosmod.core.item.armor.AluminArmor;

import mod.megalosmod.core.item.armor.AquaArmor;

import mod.megalosmod.core.item.armor.DirtArmor;

import mod.megalosmod.core.item.armor.GustArmor;

import mod.megalosmod.core.item.armor.LavaArmor;

import mod.megalosmod.core.item.armor.TitanArmor;

import mod.megalosmod.core.item.dust.ItemAntimonyDust;

import mod.megalosmod.core.item.dust.ItemAquariteDust;

import mod.megalosmod.core.item.dust.ItemCinnabarDust;

import mod.megalosmod.core.item.dust.ItemDirtriumDust;

import mod.megalosmod.core.item.dust.ItemGustriumDust;

import mod.megalosmod.core.item.dust.ItemLavariteDust;

import mod.megalosmod.core.item.dust.ItemMagnesiumDust;

import mod.megalosmod.core.item.dust.ItemThalliumDust;

import mod.megalosmod.core.item.dust.ItemTinDust;

import mod.megalosmod.core.item.dust.ItemTitaniumDust;

import mod.megalosmod.core.item.dust.ItemTungstenDust;

import mod.megalosmod.core.item.dust.ItemUraniumDust;

import mod.megalosmod.core.item.dust.ItemVanadiumDust;

import mod.megalosmod.core.item.dust.ItemYttriumDust;

import mod.megalosmod.core.item.dust.ItemZincDust;

import mod.megalosmod.core.item.dust.ItemZirconiumDust;

import mod.megalosmod.core.item.dust.ItemRutheniumDust;

import mod.megalosmod.core.item.dust.ItemScandiumDust;

import mod.megalosmod.core.item.dust.ItemAluminiumDust;

import mod.megalosmod.core.item.dust.ItemBismuthDust;

import mod.megalosmod.core.item.dust.ItemCadiumDust;

import mod.megalosmod.core.item.dust.ItemChromiumDust;

import mod.megalosmod.core.item.dust.ItemCobaltDust;

import mod.megalosmod.core.item.dust.ItemCopperDust;

import mod.megalosmod.core.item.dust.ItemGalliumDust;

import mod.megalosmod.core.item.dust.ItemHafniumDust;

import mod.megalosmod.core.item.dust.ItemIndiumDust;

import mod.megalosmod.core.item.dust.ItemIridiumDust;

import mod.megalosmod.core.item.dust.ItemLeadDust;

import mod.megalosmod.core.item.dust.ItemManganeseDust;

import mod.megalosmod.core.item.dust.ItemMolybdeumDust;

import mod.megalosmod.core.item.dust.ItemNickelDust;

import mod.megalosmod.core.item.dust.ItemNiobiumDust;

import mod.megalosmod.core.item.dust.ItemOsmiumDust;

import mod.megalosmod.core.item.dust.ItemPalladiumDust;

import mod.megalosmod.core.item.dust.ItemPlatinumDust;

import mod.megalosmod.core.item.dust.ItemRheniumDust;

import mod.megalosmod.core.item.dust.ItemRhodiumDust;

import mod.megalosmod.core.item.dust.ItemSilverDust;

import mod.megalosmod.core.item.dust.ItemTantalumDust;

import mod.megalosmod.core.item.ingots.ItemAntimonyIngot;

import mod.megalosmod.core.item.ingots.ItemAquariteIngot;

import mod.megalosmod.core.item.ingots.ItemCinnabarIngot;

import mod.megalosmod.core.item.ingots.ItemDirtriumIngot;

import mod.megalosmod.core.item.ingots.ItemGustriumIngot;

import mod.megalosmod.core.item.ingots.ItemLavariteIngot;

import mod.megalosmod.core.item.ingots.ItemMagnesiumIngot;

import mod.megalosmod.core.item.ingots.ItemRutheniumIngot;

import mod.megalosmod.core.item.ingots.ItemScandiumIngot;

import mod.megalosmod.core.item.ingots.ItemSilverIngot;

import mod.megalosmod.core.item.ingots.ItemTantalumIngot;

import mod.megalosmod.core.item.ingots.ItemThalliumIngot;

import mod.megalosmod.core.item.ingots.ItemTinIngot;

import mod.megalosmod.core.item.ingots.ItemTitaniumIngot;

import mod.megalosmod.core.item.ingots.ItemTungstenIngot;

import mod.megalosmod.core.item.ingots.ItemUraniumIngot;

import mod.megalosmod.core.item.ingots.ItemVanadiumIngot;

import mod.megalosmod.core.item.ingots.ItemYttriumIngot;

import mod.megalosmod.core.item.ingots.ItemZincIngot;

import mod.megalosmod.core.item.ingots.ItemZirconiumIngot;

import mod.megalosmod.core.item.ingots.ItemAluminiumIngot;

import mod.megalosmod.core.item.ingots.ItemBismuthIngot;

import mod.megalosmod.core.item.ingots.ItemCadiumIngot;

import mod.megalosmod.core.item.ingots.ItemChromiumIngot;

import mod.megalosmod.core.item.ingots.ItemCobaltIngot;

import mod.megalosmod.core.item.ingots.ItemCopperIngot;

import mod.megalosmod.core.item.ingots.ItemGalliumIngot;

import mod.megalosmod.core.item.ingots.ItemHafniumIngot;

import mod.megalosmod.core.item.ingots.ItemIndiumIngot;

import mod.megalosmod.core.item.ingots.ItemIridiumIngot;

import mod.megalosmod.core.item.ingots.ItemLeadIngot;

import mod.megalosmod.core.item.ingots.ItemManganeseIngot;

import mod.megalosmod.core.item.ingots.ItemMolybdeumIngot;

import mod.megalosmod.core.item.ingots.ItemNickelIngot;

import mod.megalosmod.core.item.ingots.ItemNiobiumIngot;

import mod.megalosmod.core.item.ingots.ItemOsmiumIngot;

import mod.megalosmod.core.item.ingots.ItemPalladiumIngot;

import mod.megalosmod.core.item.ingots.ItemPlatinumIngot;

import mod.megalosmod.core.item.ingots.ItemRheniumIngot;

import mod.megalosmod.core.item.ingots.ItemRhodiumIngot;

import mod.megalosmod.core.item.tool.AluminAxe;

import mod.megalosmod.core.item.tool.AluminHoe;

import mod.megalosmod.core.item.tool.AluminPickaxe;

import mod.megalosmod.core.item.tool.AluminShovel;

import mod.megalosmod.core.item.tool.AluminSword;

import mod.megalosmod.core.item.tool.AquaAxe;

import mod.megalosmod.core.item.tool.AquaHoe;

import mod.megalosmod.core.item.tool.AquaPickaxe;

import mod.megalosmod.core.item.tool.AquaShovel;

import mod.megalosmod.core.item.tool.AquaSword;

import mod.megalosmod.core.item.tool.DirtAxe;

import mod.megalosmod.core.item.tool.DirtHoe;

import mod.megalosmod.core.item.tool.DirtPickaxe;

import mod.megalosmod.core.item.tool.DirtShovel;

import mod.megalosmod.core.item.tool.DirtSword;

import mod.megalosmod.core.item.tool.GustAxe;

import mod.megalosmod.core.item.tool.GustHoe;

import mod.megalosmod.core.item.tool.GustPickaxe;

import mod.megalosmod.core.item.tool.GustShovel;

import mod.megalosmod.core.item.tool.GustSword;

import mod.megalosmod.core.item.tool.ItemAluminParts;

import mod.megalosmod.core.item.tool.ItemAquaParts;

import mod.megalosmod.core.item.tool.ItemDirtParts;

import mod.megalosmod.core.item.tool.ItemGustParts;

import mod.megalosmod.core.item.tool.ItemLavaParts;

import mod.megalosmod.core.item.tool.ItemTitanParts;

import mod.megalosmod.core.item.tool.ItemTool1;

import mod.megalosmod.core.item.tool.LavaAxe;

import mod.megalosmod.core.item.tool.LavaHoe;

import mod.megalosmod.core.item.tool.LavaPickaxe;

import mod.megalosmod.core.item.tool.LavaShovel;

import mod.megalosmod.core.item.tool.LavaSword;

import mod.megalosmod.core.item.tool.TitanAxe;

import mod.megalosmod.core.item.tool.TitanHoe;

import mod.megalosmod.core.item.tool.TitanPickaxe;

import mod.megalosmod.core.item.tool.TitanShovel;

import mod.megalosmod.core.item.tool.TitanSword;

import mod.megalosmod.core.world.MM_Generation;

import net.minecraft.block.Block;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.ItemArmor.ArmorMaterial;

import net.minecraftforge.common.util.EnumHelper;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.ModMetadata;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.registry.GameRegistry;

 

@Mod(modid = MM_Main.modid, name = "Megalos Mod", version = "1.3.5")

public class MM_Main {

public static final String modid = "megalosmod";

 

// Metallurgy Ore

public static Block aluminiumOre;

public static Block bismuthOre;

public static Block cadiumOre;

public static Block chromiumOre;

 

public static Block cobaltOre;

public static Block copperOre;

public static Block galliumOre;

public static Block hafniumOre;

 

public static Block indiumOre;

public static Block iridiumOre;

public static Block leadOre;

public static Block manganeseOre;

 

public static Block molybdeumOre;

public static Block nickelOre;

public static Block niobiumOre;

public static Block osmiumOre;

 

public static Block palladiumOre;

public static Block platinumOre;

public static Block rheniumOre;

public static Block rhodiumOre;

 

public static Block rutheniumOre;

public static Block scandiumOre;

public static Block silverOre;

public static Block tantalumOre;

 

public static Block thalliumOre;

public static Block tinOre;

public static Block titaniumOre;

public static Block tungstenOre;

 

public static Block vanadiumOre;

public static Block zincOre;

public static Block zirconiumOre;

public static Block cinnabarOre;

 

public static Block antimonyOre;

public static Block magnesiumOre;

public static Block yttriumOre;

public static Block uraniumOre;

 

public static Block aquariteOre;

public static Block lavariteOre;

public static Block gustriumOre;

public static Block dirtriumOre;

 

//Metallurgy Blocks

public static Block aluminiumBlock;

public static Block bismuthBlock;

public static Block cadiumBlock;

public static Block chromiumBlock;

 

public static Block cobaltBlock;

public static Block copperBlock;

public static Block galliumBlock;

public static Block hafniumBlock;

 

public static Block indiumBlock;

public static Block iridiumBlock;

public static Block leadBlock;

public static Block manganeseBlock;

 

public static Block molybdeumBlock;

public static Block nickelBlock;

public static Block niobiumBlock;

public static Block osmiumBlock;

 

public static Block palladiumBlock;

public static Block platinumBlock;

public static Block rheniumBlock;

public static Block rhodiumBlock;

 

public static Block rutheniumBlock;

public static Block scandiumBlock;

public static Block silverBlock;

public static Block tantalumBlock;

 

public static Block thalliumBlock;

public static Block tinBlock;

public static Block titaniumBlock;

public static Block tungstenBlock;

 

public static Block vanadiumBlock;

public static Block zincBlock;

public static Block zirconiumBlock;

public static Block cinnabarBlock;

 

public static Block antimonyBlock;

public static Block magnesiumBlock;

public static Block yttriumBlock;

public static Block uraniumBlock;

 

public static Block aquariteBlock;

public static Block lavariteBlock;

public static Block gustriumBlock;

public static Block dirtriumBlock;

 

//Metallurgy Bricks

public static Block aluminiumBrick;

public static Block bismuthBrick;

public static Block cadiumBrick;

public static Block chromiumBrick;

 

public static Block cobaltBrick;

public static Block copperBrick;

public static Block galliumBrick;

public static Block hafniumBrick;

 

public static Block indiumBrick;

public static Block iridiumBrick;

public static Block leadBrick;

public static Block manganeseBrick;

 

public static Block molybdeumBrick;

public static Block nickelBrick;

public static Block niobiumBrick;

public static Block osmiumBrick;

 

public static Block palladiumBrick;

public static Block platinumBrick;

public static Block rheniumBrick;

public static Block rhodiumBrick;

 

public static Block rutheniumBrick;

public static Block scandiumBrick;

public static Block silverBrick;

public static Block tantalumBrick;

 

public static Block thalliumBrick;

public static Block tinBrick;

public static Block titaniumBrick;

public static Block tungstenBrick;

 

public static Block vanadiumBrick;

public static Block zincBrick;

public static Block zirconiumBrick;

public static Block cinnabarBrick;

 

public static Block antimonyBrick;

public static Block magnesiumBrick;

public static Block yttriumBrick;

public static Block uraniumBrick;

 

public static Block aquariteBrick;

public static Block lavariteBrick;

public static Block gustriumBrick;

public static Block dirtriumBrick;

 

//Trees

public static Block testTreeLog;

public static testTreeLeaves testTreeLeaves;

 

// Metallurgy Items

public static Item aluminiumIngot;

public static Item bismuthIngot;

public static Item cadiumIngot;

public static Item chromiumIngot;

 

public static Item cobaltIngot;

public static Item copperIngot;

public static Item galliumIngot;

public static Item hafniumIngot;

 

public static Item indiumIngot;

public static Item iridiumIngot;

public static Item leadIngot;

public static Item manganeseIngot;

 

public static Item molybdeumIngot;

public static Item nickelIngot;

public static Item niobiumIngot;

public static Item osmiumIngot;

 

public static Item palladiumIngot;

public static Item platinumIngot;

public static Item rheniumIngot;

public static Item rhodiumIngot;

 

public static Item rutheniumIngot;

public static Item scandiumIngot;

public static Item silverIngot;

public static Item tantalumIngot;

 

public static Item thalliumIngot;

public static Item tinIngot;

public static Item titaniumIngot;

public static Item tungstenIngot;

 

public static Item vanadiumIngot;

public static Item zincIngot;

public static Item zirconiumIngot;

public static Item cinnabarIngot;

 

public static Item antimonyIngot;

public static Item magnesiumIngot;

public static Item yttriumIngot;

public static Item uraniumIngot;

 

public static Item aquariteIngot;

public static Item lavariteIngot;

public static Item gustriumIngot;

public static Item dirtriumIngot;

 

//Dust

public static Item aluminiumDust;

public static Item bismuthDust;

public static Item cadiumDust;

public static Item chromiumDust;

 

public static Item cobaltDust;

public static Item copperDust;

public static Item galliumDust;

public static Item hafniumDust;

 

public static Item indiumDust;

public static Item iridiumDust;

public static Item leadDust;

public static Item manganeseDust;

 

public static Item molybdeumDust;

public static Item nickelDust;

public static Item niobiumDust;

public static Item osmiumDust;

 

public static Item palladiumDust;

public static Item platinumDust;

public static Item rheniumDust;

public static Item rhodiumDust;

 

public static Item rutheniumDust;

public static Item scandiumDust;

public static Item silverDust;

public static Item tantalumDust;

 

public static Item thalliumDust;

public static Item tinDust;

public static Item titaniumDust;

public static Item tungstenDust;

 

public static Item vanadiumDust;

public static Item zincDust;

public static Item zirconiumDust;

public static Item cinnabarDust;

 

public static Item antimonyDust;

public static Item magnesiumDust;

public static Item yttriumDust;

public static Item uraniumDust;

 

public static Item aquariteDust;

public static Item lavariteDust;

public static Item gustriumDust;

public static Item dirtriumDust;

 

//Tools

public static Item tool1Item;

 

// Weapons

public static Item aluminParts;

public static Item aquaParts;

public static Item lavaParts;

public static Item titanParts;

public static Item gustParts;

public static Item dirtParts;

 

public static Item aluminAxe;

public static Item aluminShovel;

public static Item aluminPickaxe;

public static Item aluminHoe;

public static Item aluminSword;

 

public static Item aquaAxe;

public static Item aquaShovel;

public static Item aquaPickaxe;

public static Item aquaHoe;

public static Item aquaSword;

 

public static Item lavaAxe;

public static Item lavaShovel;

public static Item lavaPickaxe;

public static Item lavaHoe;

public static Item lavaSword;

 

public static Item titanAxe;

public static Item titanShovel;

public static Item titanPickaxe;

public static Item titanHoe;

public static Item titanSword;

 

public static Item gustAxe;

public static Item gustShovel;

public static Item gustPickaxe;

public static Item gustHoe;

public static Item gustSword;

 

public static Item dirtAxe;

public static Item dirtShovel;

public static Item dirtPickaxe;

public static Item dirtHoe;

public static Item dirtSword;

 

// Metallurgy Armour

public static Item aluminHelm;

public static Item aluminChestplate;

public static Item aluminLeggings;

public static Item aluminBoots;

 

public static Item aquaHelm;

public static Item aquaChestplate;

public static Item aquaLeggings;

public static Item aquaBoots;

 

public static Item lavaHelm;

public static Item lavaChestplate;

public static Item lavaLeggings;

public static Item lavaBoots;

 

public static Item titanHelm;

public static Item titanChestplate;

public static Item titanLeggings;

public static Item titanBoots;

 

public static Item gustHelm;

public static Item gustChestplate;

public static Item gustLeggings;

public static Item gustBoots;

 

public static Item dirtHelm;

public static Item dirtChestplate;

public static Item dirtLeggings;

public static Item dirtBoots;

 

// Normal Tools

public static final Item.ToolMaterial AluminTool = EnumHelper

.addToolMaterial("AluminTool", 1, 150, 5.0F, 1.5F, 10);

public static final Item.ToolMaterial TitanTool = EnumHelper

.addToolMaterial("TitanTool", 3, 1000, 9.0F, 3.5F, 20);

 

// Enchanted Metal Tools

public static final Item.ToolMaterial AquaTool = EnumHelper

.addToolMaterial("AquaTool", 2, 300, 7.0F, 2.5F, 15);

public static final Item.ToolMaterial LavaTool = EnumHelper

.addToolMaterial("LavaTool", 4, 2000, 10.0F, 4.5F, 25);

public static final Item.ToolMaterial GustTool = EnumHelper

.addToolMaterial("GustTool", 3, 1500, 8.0F, 3F, 30);

public static final Item.ToolMaterial DirtTool = EnumHelper

.addToolMaterial("DirtTool", 2, 750, 6.0F, 2F, 35);

 

// Armour

public static ArmorMaterial AluminArmor = EnumHelper.addArmorMaterial(

"AluminArmor", 8, new int[] { 2, 6, 4, 2 }, 30);

public static ArmorMaterial AquaArmor = EnumHelper.addArmorMaterial(

"AquaArmor", 8, new int[] { 2, 7, 6, 2 }, 30);

public static ArmorMaterial LavaArmor = EnumHelper.addArmorMaterial(

"LavaArmor", 8, new int[] { 6, 14, 12, 6 }, 30);

public static ArmorMaterial TitanArmor = EnumHelper.addArmorMaterial(

"TitanArmor", 8, new int[] { 3, 6, 5, 3 }, 30);

public static ArmorMaterial GustArmor = EnumHelper.addArmorMaterial(

"GustArmor", 8, new int[] { 4, 10, 10, 4 }, 30);

public static ArmorMaterial DirtArmor = EnumHelper.addArmorMaterial(

"DirtArmor", 8, new int[] { 5, 5, 4, 2 }, 30);

 

// Generation

public static MM_Generation MM_WorldGen = new MM_Generation();

 

// Creative Tabs

public static CreativeTabs tabMT_Metal = new MM_MetalTab(

CreativeTabs.getNextID(), "Megalo's Mod - Metallurgy");

public static CreativeTabs tabMT_Weapon = new MM_WarfareTab(

CreativeTabs.getNextID(), "Megalo's Mod - Hoplology");

public static CreativeTabs tabMT_Dendrology = new MM_DendrologyTab(

CreativeTabs.getNextID(),"Megalo's Mod - Dendrology");

 

// EventManager

MM_EventManager eventmanager = new MM_EventManager();

 

@EventHandler

public void randomName(FMLPreInitializationEvent event) {

ModMetadata m = event.getModMetadata();

m.autogenerated = false;

m.modId = "MM_Metallurgy_Main";

m.name = "Megalo's Mod [mc1.7.10]";

m.description = " Once known around the globe as Megalo's Metallurgy, now it has grown into something more.";

m.version = "1.3.5";

m.credits = "Created by v_megalo_v";

m.logoFile = "assets/textures/logo.png";

m.url = "http://www.planetminecraft.com/member/v_megalo_v/";

m.authorList.add("v_megalo_v");

m.parent = "";

}

 

@EventHandler

public void preInit(FMLPreInitializationEvent event) {

// Block - Ores

aluminiumOre = new BlockAluminiumOre();

bismuthOre = new BlockBismuthOre();

cadiumOre = new BlockCadiumOre();

chromiumOre = new BlockChromiumOre();

 

cobaltOre = new BlockCobaltOre();

copperOre = new BlockCopperOre();

galliumOre = new BlockGalliumOre();

hafniumOre = new BlockHafniumOre();

 

indiumOre = new BlockIndiumOre();

iridiumOre = new BlockIridiumOre();

leadOre = new BlockLeadOre();

manganeseOre = new BlockManganeseOre();

 

molybdeumOre = new BlockMolybdeumOre();

nickelOre = new BlockNickelOre();

niobiumOre = new BlockNiobiumOre();

osmiumOre = new BlockOsmiumOre();

 

palladiumOre = new BlockPalladiumOre();

platinumOre = new BlockPlatinumOre();

rheniumOre = new BlockRheniumOre();

rhodiumOre = new BlockRhodiumOre();

 

rutheniumOre = new BlockRutheniumOre();

scandiumOre = new BlockScandiumOre();

silverOre = new BlockSilverOre();

tantalumOre = new BlockTantalumOre();

 

thalliumOre = new BlockThalliumOre();

tinOre = new BlockTinOre();

titaniumOre = new BlockTitaniumOre();

tungstenOre = new BlockTungstenOre();

 

vanadiumOre = new BlockVanadiumOre();

zincOre = new BlockZincOre();

zirconiumOre = new BlockZirconiumOre();

cinnabarOre = new BlockCinnabarOre();

 

antimonyOre = new BlockAntimonyOre();

magnesiumOre = new BlockMagnesiumOre();

yttriumOre = new BlockYttriumOre();

uraniumOre = new BlockUraniumOre();

 

aquariteOre = new BlockAquariteOre();

lavariteOre = new BlockLavariteOre();

gustriumOre = new BlockGustriumOre();

dirtriumOre = new BlockDirtriumOre();

 

//Block - Block

aluminiumBlock = new BlockAluminiumBlock();

bismuthBlock = new BlockBismuthBlock();

cadiumBlock = new BlockCadiumBlock();

chromiumBlock = new BlockChromiumBlock();

 

cobaltBlock = new BlockCobaltBlock();

copperBlock = new BlockCopperBlock();

galliumBlock = new BlockGalliumBlock();

hafniumBlock = new BlockHafniumBlock();

 

indiumBlock = new BlockIndiumBlock();

iridiumBlock = new BlockIridiumBlock();

leadBlock = new BlockLeadBlock();

manganeseBlock = new BlockManganeseBlock();

 

molybdeumBlock = new BlockMolybdeumBlock();

nickelBlock = new BlockNickelBlock();

niobiumBlock = new BlockNiobiumBlock();

osmiumBlock = new BlockOsmiumBlock();

 

palladiumBlock = new BlockPalladiumBlock();

platinumBlock = new BlockPlatinumBlock();

rheniumBlock = new BlockRheniumBlock();

rhodiumBlock = new BlockRhodiumBlock();

 

rutheniumBlock = new BlockRutheniumBlock();

scandiumBlock = new BlockScandiumBlock();

silverBlock = new BlockSilverBlock();

tantalumBlock = new BlockTantalumBlock();

 

thalliumBlock = new BlockThalliumBlock();

tinBlock = new BlockTinBlock();

titaniumBlock = new BlockTitaniumBlock();

tungstenBlock = new BlockTungstenBlock();

 

vanadiumBlock = new BlockVanadiumBlock();

zincBlock = new BlockZincBlock();

zirconiumBlock = new BlockZirconiumBlock();

cinnabarBlock = new BlockCinnabarBlock();

 

antimonyBlock = new BlockAntimonyBlock();

magnesiumBlock = new BlockMagnesiumBlock();

yttriumBlock = new BlockYttriumBlock();

uraniumBlock = new BlockUraniumBlock();

 

aquariteBlock = new BlockAquariteBlock();

lavariteBlock = new BlockLavariteBlock();

gustriumBlock = new BlockGustriumBlock();

dirtriumBlock = new BlockDirtriumBlock();

 

//Block - Brick

aluminiumBrick = new BlockAluminiumBrick();

bismuthBrick = new BlockBismuthBrick();

cadiumBrick = new BlockCadiumBrick();

chromiumBrick = new BlockChromiumBrick();

 

cobaltBrick = new BlockCobaltBrick();

copperBrick = new BlockCopperBrick();

galliumBrick = new BlockGalliumBrick();

hafniumBrick = new BlockHafniumBrick();

 

indiumBrick = new BlockIndiumBrick();

iridiumBrick = new BlockIridiumBrick();

leadBrick = new BlockLeadBrick();

manganeseBrick = new BlockManganeseBrick();

 

molybdeumBrick = new BlockMolybdeumBrick();

nickelBrick = new BlockNickelBrick();

niobiumBrick = new BlockNiobiumBrick();

osmiumBrick = new BlockOsmiumBrick();

 

palladiumBrick = new BlockPalladiumBrick();

platinumBrick = new BlockPlatinumBrick();

rheniumBrick = new BlockRheniumBrick();

rhodiumBrick = new BlockRhodiumBrick();

 

rutheniumBrick = new BlockRutheniumBrick();

scandiumBrick = new BlockScandiumBrick();

silverBrick = new BlockSilverBrick();

tantalumBrick = new BlockTantalumBrick();

 

thalliumBrick = new BlockThalliumBrick();

tinBrick = new BlockTinBrick();

titaniumBrick = new BlockTitaniumBrick();

tungstenBrick = new BlockTungstenBrick();

 

vanadiumBrick = new BlockVanadiumBrick();

zincBrick = new BlockZincBrick();

zirconiumBrick = new BlockZirconiumBrick();

cinnabarBrick = new BlockCinnabarBrick();

 

antimonyBrick = new BlockAntimonyBrick();

magnesiumBrick = new BlockMagnesiumBrick();

yttriumBrick = new BlockYttriumBrick();

uraniumBrick = new BlockUraniumBrick();

 

aquariteBrick = new BlockAquariteBrick();

lavariteBrick = new BlockLavariteBrick();

gustriumBrick = new BlockGustriumBrick();

dirtriumBrick = new BlockDirtriumBrick();

 

//Trees

testTreeLog = new testTreeLog();

testTreeLeaves = new testTreeLeaves();

 

 

// Item - Ingots

aluminiumIngot = new ItemAluminiumIngot();

bismuthIngot = new ItemBismuthIngot();

cadiumIngot = new ItemCadiumIngot();

chromiumIngot = new ItemChromiumIngot();

 

cobaltIngot = new ItemCobaltIngot();

copperIngot = new ItemCopperIngot();

galliumIngot = new ItemGalliumIngot();

hafniumIngot = new ItemHafniumIngot();

 

indiumIngot = new ItemIndiumIngot();

iridiumIngot = new ItemIridiumIngot();

leadIngot = new ItemLeadIngot();

manganeseIngot = new ItemManganeseIngot();

 

molybdeumIngot = new ItemMolybdeumIngot();

nickelIngot = new ItemNickelIngot();

niobiumIngot = new ItemNiobiumIngot();

osmiumIngot = new ItemOsmiumIngot();

 

palladiumIngot = new ItemPalladiumIngot();

platinumIngot = new ItemPlatinumIngot();

rheniumIngot = new ItemRheniumIngot();

rhodiumIngot = new ItemRhodiumIngot();

 

rutheniumIngot = new ItemRutheniumIngot();

scandiumIngot = new ItemScandiumIngot();

silverIngot = new ItemSilverIngot();

tantalumIngot = new ItemTantalumIngot();

 

thalliumIngot = new ItemThalliumIngot();

tinIngot = new ItemTinIngot();

titaniumIngot = new ItemTitaniumIngot();

tungstenIngot = new ItemTungstenIngot();

 

vanadiumIngot = new ItemVanadiumIngot();

zincIngot = new ItemZincIngot();

zirconiumIngot = new ItemZirconiumIngot();

cinnabarIngot = new ItemCinnabarIngot();

 

antimonyIngot = new ItemAntimonyIngot();

magnesiumIngot = new ItemMagnesiumIngot();

yttriumIngot = new ItemYttriumIngot();

uraniumIngot = new ItemUraniumIngot();

 

aquariteIngot = new ItemAquariteIngot();

lavariteIngot = new ItemLavariteIngot();

gustriumIngot = new ItemGustriumIngot();

dirtriumIngot = new ItemDirtriumIngot();

 

//Item - Dusts

aluminiumDust = new ItemAluminiumDust();

bismuthDust = new ItemBismuthDust();

cadiumDust = new ItemCadiumDust();

chromiumDust = new ItemChromiumDust();

 

cobaltDust = new ItemCobaltDust();

copperDust = new ItemCopperDust();

galliumDust = new ItemGalliumDust();

hafniumDust = new ItemHafniumDust();

 

indiumDust = new ItemIndiumDust();

iridiumDust = new ItemIridiumDust();

leadDust = new ItemLeadDust();

manganeseDust = new ItemManganeseDust();

 

molybdeumDust = new ItemMolybdeumDust();

nickelDust = new ItemNickelDust();

niobiumDust = new ItemNiobiumDust();

osmiumDust = new ItemOsmiumDust();

 

palladiumDust = new ItemPalladiumDust();

platinumDust = new ItemPlatinumDust();

rheniumDust = new ItemRheniumDust();

rhodiumDust = new ItemRhodiumDust();

 

rutheniumDust = new ItemRutheniumDust();

scandiumDust = new ItemScandiumDust();

silverDust = new ItemSilverDust();

tantalumDust = new ItemTantalumDust();

 

thalliumDust = new ItemThalliumDust();

tinDust = new ItemTinDust();

titaniumDust = new ItemTitaniumDust();

tungstenDust = new ItemTungstenDust();

 

vanadiumDust = new ItemVanadiumDust();

zincDust = new ItemZincDust();

zirconiumDust = new ItemZirconiumDust();

cinnabarDust = new ItemCinnabarDust();

 

antimonyDust = new ItemAntimonyDust();

magnesiumDust = new ItemMagnesiumDust();

yttriumDust = new ItemYttriumDust();

uraniumDust = new ItemUraniumDust();

 

aquariteDust = new ItemAquariteDust();

lavariteDust = new ItemLavariteDust();

gustriumDust = new ItemGustriumDust();

dirtriumDust = new ItemDirtriumDust();

 

//Item - Tools

tool1Item = new ItemTool1();

 

aluminParts = new ItemAluminParts();

aquaParts = new ItemAquaParts();

lavaParts = new ItemLavaParts();

titanParts = new ItemTitanParts();

gustParts = new ItemGustParts();

dirtParts = new ItemDirtParts();

 

// Tools

aluminAxe = new AluminAxe(AluminTool);

aluminShovel = new AluminShovel(AluminTool);

aluminPickaxe = new AluminPickaxe(AluminTool);

aluminHoe = new AluminHoe(AluminTool);

aluminSword = new AluminSword(AluminTool);

 

aquaAxe = new AquaAxe(AquaTool);

aquaShovel = new AquaShovel(AquaTool);

aquaPickaxe = new AquaPickaxe(AquaTool);

aquaHoe = new AquaHoe(AquaTool);

aquaSword = new AquaSword(AquaTool);

 

lavaAxe = new LavaAxe(LavaTool);

lavaShovel = new LavaShovel(LavaTool);

lavaPickaxe = new LavaPickaxe(LavaTool);

lavaHoe = new LavaHoe(LavaTool);

lavaSword = new LavaSword(LavaTool);

 

titanAxe = new TitanAxe(TitanTool);

titanShovel = new TitanShovel(TitanTool);

titanPickaxe = new TitanPickaxe(TitanTool);

titanHoe = new TitanHoe(TitanTool);

titanSword = new TitanSword(TitanTool);

 

gustAxe = new GustAxe(GustTool);

gustShovel = new GustShovel(GustTool);

gustPickaxe = new GustPickaxe(GustTool);

gustHoe = new GustHoe(GustTool);

gustSword = new GustSword(GustTool);

 

dirtAxe = new DirtAxe(DirtTool);

dirtShovel = new DirtShovel(DirtTool);

dirtPickaxe = new DirtPickaxe(DirtTool);

dirtHoe = new DirtHoe(DirtTool);

dirtSword = new DirtSword(DirtTool);

 

// Armour

aluminHelm = new AluminArmor(AluminArmor, 5, 0)

.setUnlocalizedName("aluminHelm");

aluminChestplate = new AluminArmor(AluminArmor, 5, 1)

.setUnlocalizedName("aluminChestplate");

aluminLeggings = new AluminArmor(AluminArmor, 5, 2)

.setUnlocalizedName("aluminLeggings");

aluminBoots = new AluminArmor(AluminArmor, 5, 3)

.setUnlocalizedName("aluminBoots");

 

aquaHelm = new AquaArmor(AquaArmor, 6, 0)

.setUnlocalizedName("aquaHelm");

aquaChestplate = new AquaArmor(AquaArmor, 6, 1)

.setUnlocalizedName("aquaChestplate");

aquaLeggings = new AquaArmor(AluminArmor, 6, 2)

.setUnlocalizedName("aquaLeggings");

aquaBoots = new AquaArmor(AluminArmor, 6, 3)

.setUnlocalizedName("aquaBoots");

 

lavaHelm = new LavaArmor(LavaArmor, 7, 0)

.setUnlocalizedName("lavaHelm");

lavaChestplate = new LavaArmor(LavaArmor, 7, 1)

.setUnlocalizedName("lavaChestplate");

lavaLeggings = new LavaArmor(LavaArmor, 7, 2)

.setUnlocalizedName("lavaLeggings");

lavaBoots = new LavaArmor(LavaArmor, 7, 3)

.setUnlocalizedName("lavaBoots");

 

titanHelm = new TitanArmor(TitanArmor, 8, 0)

.setUnlocalizedName("titanHelm");

titanChestplate = new TitanArmor(TitanArmor, 8, 1)

.setUnlocalizedName("titanChestplate");

titanLeggings = new TitanArmor(TitanArmor, 8, 2)

.setUnlocalizedName("titanLeggings");

titanBoots = new TitanArmor(TitanArmor, 8, 3)

.setUnlocalizedName("titanBoots");

 

gustHelm = new GustArmor(GustArmor, 9, 0)

.setUnlocalizedName("gustHelm");

gustChestplate = new GustArmor(GustArmor, 9, 1)

.setUnlocalizedName("gustChestplate");

gustLeggings = new GustArmor(GustArmor, 9, 2)

.setUnlocalizedName("gustLeggings");

gustBoots = new GustArmor(GustArmor, 9, 3)

.setUnlocalizedName("gustBoots");

 

dirtHelm = new DirtArmor(DirtArmor, 10, 0)

.setUnlocalizedName("dirtHelm");

dirtChestplate = new DirtArmor(DirtArmor, 10, 1)

.setUnlocalizedName("dirtChestplate");

dirtLeggings = new DirtArmor(DirtArmor, 10, 2)

.setUnlocalizedName("dirtLeggings");

dirtBoots = new DirtArmor(DirtArmor, 10, 3)

.setUnlocalizedName("dirtBoots");

 

// Register World Gen

GameRegistry.registerWorldGenerator(MM_WorldGen, 0);

 

}

 

@EventHandler

public void load(FMLInitializationEvent event) {

 

MM_Crafting.loadRecipes();

MM_GameRegistry_Block.registerBlock();

MM_GameRegistry_Item.registerItem();

MM_RenderingRegistry.addNewArmourRendererPrefix();

}

}

 

 

 

GR

 

package mod.megalosmod.core;

 

import cpw.mods.fml.common.registry.GameRegistry;

 

public class MM_GameRegistry_Block {

 

public static void registerBlock() {

 

//Metallurgy Ore

GameRegistry.registerBlock(MM_Main.aluminiumOre, MM_Main.modid + (MM_Main.aluminiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.bismuthOre, MM_Main.modid + (MM_Main.bismuthOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.cadiumOre, MM_Main.modid + (MM_Main.cadiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.chromiumOre, MM_Main.modid + (MM_Main.chromiumOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.cobaltOre, MM_Main.modid + (MM_Main.cobaltOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.copperOre, MM_Main.modid + (MM_Main.copperOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.galliumOre, MM_Main.modid + (MM_Main.galliumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.hafniumOre, MM_Main.modid + (MM_Main.hafniumOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.indiumOre, MM_Main.modid + (MM_Main.indiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.iridiumOre, MM_Main.modid + (MM_Main.iridiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.leadOre, MM_Main.modid + (MM_Main.leadOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.manganeseOre, MM_Main.modid + (MM_Main.manganeseOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.molybdeumOre, MM_Main.modid + (MM_Main.molybdeumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.nickelOre, MM_Main.modid + (MM_Main.nickelOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.niobiumOre, MM_Main.modid + (MM_Main.niobiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.osmiumOre, MM_Main.modid + (MM_Main.osmiumOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.palladiumOre, MM_Main.modid + (MM_Main.palladiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.platinumOre, MM_Main.modid + (MM_Main.platinumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.rheniumOre, MM_Main.modid + (MM_Main.rheniumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.rhodiumOre, MM_Main.modid + (MM_Main.rhodiumOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.rutheniumOre, MM_Main.modid + (MM_Main.rutheniumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.scandiumOre, MM_Main.modid + (MM_Main.scandiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.silverOre, MM_Main.modid + (MM_Main.silverOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tantalumOre, MM_Main.modid + (MM_Main.tantalumOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.thalliumOre, MM_Main.modid + (MM_Main.thalliumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tinOre, MM_Main.modid + (MM_Main.tinOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.titaniumOre, MM_Main.modid + (MM_Main.titaniumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tungstenOre, MM_Main.modid + (MM_Main.tungstenOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.vanadiumOre, MM_Main.modid + (MM_Main.vanadiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.zincOre, MM_Main.modid + (MM_Main.zincOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.zirconiumOre, MM_Main.modid + (MM_Main.zirconiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.cinnabarOre, MM_Main.modid + (MM_Main.cinnabarOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.antimonyOre, MM_Main.modid + (MM_Main.antimonyOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.magnesiumOre, MM_Main.modid + (MM_Main.magnesiumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.yttriumOre, MM_Main.modid + (MM_Main.yttriumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.uraniumOre, MM_Main.modid + (MM_Main.uraniumOre.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.aquariteOre, MM_Main.modid + (MM_Main.aquariteOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.lavariteOre, MM_Main.modid + (MM_Main.lavariteOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.gustriumOre, MM_Main.modid + (MM_Main.gustriumOre.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.dirtriumOre, MM_Main.modid + (MM_Main.dirtriumOre.getUnlocalizedName().substring(5)));

 

//Metallurgy Block

GameRegistry.registerBlock(MM_Main.aluminiumBlock, MM_Main.modid + (MM_Main.aluminiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.bismuthBlock, MM_Main.modid + (MM_Main.bismuthBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.cadiumBlock, MM_Main.modid + (MM_Main.cadiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.chromiumBlock, MM_Main.modid + (MM_Main.chromiumBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.cobaltBlock, MM_Main.modid + (MM_Main.cobaltBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.copperBlock, MM_Main.modid + (MM_Main.copperBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.galliumBlock, MM_Main.modid + (MM_Main.galliumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.hafniumBlock, MM_Main.modid + (MM_Main.hafniumBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.indiumBlock, MM_Main.modid + (MM_Main.indiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.iridiumBlock, MM_Main.modid + (MM_Main.iridiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.leadBlock, MM_Main.modid + (MM_Main.leadBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.manganeseBlock, MM_Main.modid + (MM_Main.manganeseBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.molybdeumBlock, MM_Main.modid + (MM_Main.molybdeumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.nickelBlock, MM_Main.modid + (MM_Main.nickelBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.niobiumBlock, MM_Main.modid + (MM_Main.niobiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.osmiumBlock, MM_Main.modid + (MM_Main.osmiumBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.palladiumBlock, MM_Main.modid + (MM_Main.palladiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.platinumBlock, MM_Main.modid + (MM_Main.platinumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.rheniumBlock, MM_Main.modid + (MM_Main.rheniumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.rhodiumBlock, MM_Main.modid + (MM_Main.rhodiumBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.rutheniumBlock, MM_Main.modid + (MM_Main.rutheniumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.scandiumBlock, MM_Main.modid + (MM_Main.scandiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.silverBlock, MM_Main.modid + (MM_Main.silverBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tantalumBlock, MM_Main.modid + (MM_Main.tantalumBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.thalliumBlock, MM_Main.modid + (MM_Main.thalliumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tinBlock, MM_Main.modid + (MM_Main.tinBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.titaniumBlock, MM_Main.modid + (MM_Main.titaniumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tungstenBlock, MM_Main.modid + (MM_Main.tungstenBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.vanadiumBlock, MM_Main.modid + (MM_Main.vanadiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.zincBlock, MM_Main.modid + (MM_Main.zincBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.zirconiumBlock, MM_Main.modid + (MM_Main.zirconiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.cinnabarBlock, MM_Main.modid + (MM_Main.cinnabarBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.antimonyBlock, MM_Main.modid + (MM_Main.antimonyBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.magnesiumBlock, MM_Main.modid + (MM_Main.magnesiumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.yttriumBlock, MM_Main.modid + (MM_Main.yttriumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.uraniumBlock, MM_Main.modid + (MM_Main.uraniumBlock.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.aquariteBlock, MM_Main.modid + (MM_Main.aquariteBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.lavariteBlock, MM_Main.modid + (MM_Main.lavariteBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.gustriumBlock, MM_Main.modid + (MM_Main.gustriumBlock.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.dirtriumBlock, MM_Main.modid + (MM_Main.dirtriumBlock.getUnlocalizedName().substring(5)));

 

//Metallurgy Brick

GameRegistry.registerBlock(MM_Main.aluminiumBrick, MM_Main.modid + (MM_Main.aluminiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.bismuthBrick, MM_Main.modid + (MM_Main.bismuthBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.cadiumBrick, MM_Main.modid + (MM_Main.cadiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.chromiumBrick, MM_Main.modid + (MM_Main.chromiumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.cobaltBrick, MM_Main.modid + (MM_Main.cobaltBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.copperBrick, MM_Main.modid + (MM_Main.copperBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.galliumBrick, MM_Main.modid + (MM_Main.galliumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.hafniumBrick, MM_Main.modid + (MM_Main.hafniumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.indiumBrick, MM_Main.modid + (MM_Main.indiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.iridiumBrick, MM_Main.modid + (MM_Main.iridiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.leadBrick, MM_Main.modid + (MM_Main.leadBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.manganeseBrick, MM_Main.modid + (MM_Main.manganeseBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.molybdeumBrick, MM_Main.modid + (MM_Main.molybdeumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.nickelBrick, MM_Main.modid + (MM_Main.nickelBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.niobiumBrick, MM_Main.modid + (MM_Main.niobiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.osmiumBrick, MM_Main.modid + (MM_Main.osmiumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.palladiumBrick, MM_Main.modid + (MM_Main.palladiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.platinumBrick, MM_Main.modid + (MM_Main.platinumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.rheniumBrick, MM_Main.modid + (MM_Main.rheniumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.rhodiumBrick, MM_Main.modid + (MM_Main.rhodiumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.rutheniumBrick, MM_Main.modid + (MM_Main.rutheniumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.scandiumBrick, MM_Main.modid + (MM_Main.scandiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.silverBrick, MM_Main.modid + (MM_Main.silverBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tantalumBrick, MM_Main.modid + (MM_Main.tantalumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.thalliumBrick, MM_Main.modid + (MM_Main.thalliumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tinBrick, MM_Main.modid + (MM_Main.tinBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.titaniumBrick, MM_Main.modid + (MM_Main.titaniumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.tungstenBrick, MM_Main.modid + (MM_Main.tungstenBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.vanadiumBrick, MM_Main.modid + (MM_Main.vanadiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.zincBrick, MM_Main.modid + (MM_Main.zincBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.zirconiumBrick, MM_Main.modid + (MM_Main.zirconiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.cinnabarBrick, MM_Main.modid + (MM_Main.cinnabarBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.antimonyBrick, MM_Main.modid + (MM_Main.antimonyBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.magnesiumBrick, MM_Main.modid + (MM_Main.magnesiumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.yttriumBrick, MM_Main.modid + (MM_Main.yttriumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.uraniumBrick, MM_Main.modid + (MM_Main.uraniumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.aquariteBrick, MM_Main.modid + (MM_Main.aquariteBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.lavariteBrick, MM_Main.modid + (MM_Main.lavariteBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.gustriumBrick, MM_Main.modid + (MM_Main.gustriumBrick.getUnlocalizedName().substring(5)));

GameRegistry.registerBlock(MM_Main.dirtriumBrick, MM_Main.modid + (MM_Main.dirtriumBrick.getUnlocalizedName().substring(5)));

 

GameRegistry.registerBlock(MM_Main.testTreeLog, MM_Main.modid + (MM_Main.testTreeLog.getUnlocalizedName().substring(5)));

 

//Non_MetaData

GameRegistry.registerWorldGenerator(new MM_EventManager(), 0);

}

 

 

}

 

Posted

Your getUnlocalizedName() method in your test tree item block doesn't seem right to me.  You have:

public String getUnlocalizedName(ItemStack itemstack){
      int i = itemstack.getItemDamage();
      if (i < 0 || i>= logs.length){
         i = 0;
      }
      
      return super.getUnlocalizedName() + "." + logs;
   }

 

Since logs is an array, don't you want logs?

 

Also, for these sort of issues it is best to add some debug console statements.  Like print out the return value to console to see if it is really what you expect.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Your getUnlocalizedName() method in your test tree item block doesn't seem right to me.  You have:

public String getUnlocalizedName(ItemStack itemstack){
      int i = itemstack.getItemDamage();
      if (i < 0 || i>= logs.length){
         i = 0;
      }
      
      return super.getUnlocalizedName() + "." + logs;
   }

 

Since logs is an array, don't you want logs[nobbc][/nobbc]?

 

Also, for these sort of issues it is best to add some debug console statements.  Like print out the return value to console to see if it is really what you expect.

 

FTFY

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Weird.  I definitely put in logs when typing

 

[nobbc][/nobbc] causes italics.  You need to wrap it in [nobbc][nobbc][/nobbc] ;)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Right, I have tried trees before and failed. I either need help with code or to hire someone to do it for me, as my mod Megalo's Mod is big. I has over 40 metals added and I want to add trees, plants, food, mobs, stone, gems, biomes, dimensions and machines to it.

 

So as long as there is a tutorial on it for 1.7.10/1.8, if anyone wants to do a tutorial for me please help!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It is 1.12.2 - I have no idea if there is a 1.12 pack
    • Okay, but does the modpack works with 1.12 or just with 1.12.2, because I need the Forge client specifically for Minecraft 1.12, not 1.12.2
    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.