Jump to content

Trinitygamer

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Trinitygamer's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ok, last question before i say yes, why exactly do i need to use Teamviewer? My entire (or at least what effects slabs) code is post up there ^. (I've already downloaded and installed it (after googling it), i'm just making sure that it's either unnecessary or you have a reason for it. i know, i'm paranoid, but still)
  2. um... As far as i know, blocks in minecraft aren't actually 3d models, they are all just 2d plains that the minecraft engine potions on a 3d field (each side of a 6-sided block is actually it's own plain. The plains are all simply rendered together to make them appear as though they are 1 object). I could be wrong about that, but i don't think i am. Basically, you can't import a block from blender into minecraft, at least as far as i know. you can, however, create a custom block shape using minecraft code.
  3. And we can't tell you what the problem is, or how to fix it, without the code... (also, minecraft froge should have given you an error log, if you don't want to put up the code, then at least put up the WHOLE error log, instead of just the last part...)
  4. Edit (11/23/2012): I fixed the texture issue, but i'm still having the placement issue. The issue i'm having is that if I have a half block in one spot, and i try to place another on the area above it (not in the 'double slab' area', but a full block above) the block places a square below where it is Here's the screenshot so that you know what i am talking about. the blocks on the right are the vinilla minecraft ones, and show what SHOULD be happening, while the ones on the left are obviously mine: Anyway, here's my code: This is the 'Ore class file', I AM still learning java and minecraft scripting, so i'm not entirely sure WHY it is needed (because none of the tutorials i've read, and i have read a lot, have bothered to go into detail about why it has to be here). Anyway, i know that it's probably wrong, but again, i'm not sure. Anyway, here it is: package mod_tgplanks; import net.minecraft.src.Block; import net.minecraft.src.ItemBlock; import net.minecraft.src.ItemStack; public class PlanksOre extends ItemBlock{ public PlanksOre(int ID, Block block){ super(ID); setHasSubtypes(true); } public String getItemNameIS(ItemStack is){ String name = ""; switch(is.getItemDamage()){ case 0: {name= "one"; break;} case 1: {name= "two"; break;} case 2: {name= "three"; break;} case 3: {name= "four"; break;} case 4: {name= "five"; break;} case 5: {name= "six"; break;} case 6: {name= "seven"; break;} case 7: {name= "eight"; break;} case 8: {name= "nine"; break;} case 9: {name= "ten"; break;} case 10: {name= "eleven"; break;} case 11: {name= "twelve"; break;} case 12: {name= "thirteen"; break;} case 13: {name= "fourteen"; break;} case 14: {name= "fifteen"; break;} case 15: {name= "sixteen"; break;}} return getItemName()+"."+name; } public int getMetadata(int meta){ return meta; } } Second code, the main class, or the package class file, whatever you want to call it. I have no idea if this is where everything is acting up, it might be, it might not be. If you know, please tell me. package mod_tgplanks; import net.minecraft.src.Block; import net.minecraft.src.FurnaceRecipes; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraftforge.common.Configuration; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; 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.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="TGPlanks", name="TrinityGamer Planks basic", version="0.5.0") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class TGplanks { //initialize HalfSlabs public static Block PlanksSlabs; //initialize Double Slabs public static Block DPlanksSlabs; //initialize Half slab and Double slab IDS public int PlanksSlabsID; public int DPlanksSlabsID; @PreInit public void PreLoad(FMLPreInitializationEvent event){ Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); //initialize Half slab IDS PlanksSlabsID = config.getBlock(Configuration.CATEGORY_BLOCK, "PlanksSlabs1 ID", 1093).getInt(); //initialize Double Slab IDS DPlanksSlabsID = config.getBlock(Configuration.CATEGORY_BLOCK, "DPlanksSlabs1 ID", 1113).getInt(); config.save(); } @SidedProxy(clientSide = "mod_tgplanks.client.ClientProxyPlanks", serverSide = "mod_tgplanks.CommonProxyPlanks") public static CommonProxyPlanks proxy; @Init public void load(FMLInitializationEvent event){ //declare mew Half Slabs PlanksSlabs = new PlanksSlabs(PlanksSlabsID, false).setStepSound(Block.soundWoodFootstep).setHardness(3F).setResistance(1.0F).setBlockName("single"); //declare new Double Slabs DPlanksSlabs = new PlanksSlabs(DPlanksSlabsID, true).setStepSound(Block.soundWoodFootstep).setHardness(3F).setResistance(1.0F).setBlockName("double"); //register PlankSlabs item IDs Item.itemsList[PlanksSlabsID] = new PlanksOre(PlanksSlabsID-256, PlanksSlabs).setItemName("PlanksItem"); Item.itemsList[DPlanksSlabsID] = new PlanksOre(DPlanksSlabsID-256, DPlanksSlabs).setItemName("DPlanksItem"); //register game block names (planks) LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.one.name", "Dingy Pink Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.two.name", "Dingy Red Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.three.name", "Dingy Burnt Red Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.four.name", "Dingy Dark Red Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.five.name", "Dingy Peach Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.six.name", "Dingy Orange Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.seven.name", "Dingy Burny Orange Planks"); LanguageRegistry.instance().addStringLocalization("tile.PlanksSlabs.eight.name", "Dingy Orange-Brown Planks"); //register Texture proxy.registerRenderThings(); } I've been told that my Slab Class file SHOULD actually work right, but just in case the were wrong, here it is anyway: package mod_tgplanks; import java.util.List; import java.util.Random; import net.minecraft.src.CreativeTabs; import net.minecraft.src.ItemStack; import net.minecraft.src.Material; import net.minecraft.src.BlockHalfSlab; import net.minecraft.src.EntityLiving; import net.minecraft.src.World; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; public class PlanksSlabs extends BlockHalfSlab{ public PlanksSlabs(int par1, boolean par2){ super(par1, par2, Material.wood); this.setCreativeTab(CreativeTabs.tabBlock); this.setRequiresSelfNotify(); this.setLightOpacity(0); } //tells game what single slab drops on destruction public int idDropped(int par1, Random par2Random, int par3) { return TGplanks.PlanksSlabs.blockID; } public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving){ if(par1World.getBlockId(par2, par3 - 1, par4) == TGplanks.PlanksSlabs.blockID){ int metadata = par1World.getBlockMetadata(par2, par3, par4) & 7; if(par1World.getBlockMetadata(par2, par3 - 1, par4) == metadata ){ par1World.setBlockWithNotify(par2, par3, par4, 0); par1World.setBlockAndMetadataWithNotify(par2, par3 - 1, par4, TGplanks.DPlanksSlabs.blockID, metadata); } } } //makes the double slab drop 2 single slabs protected ItemStack createStackedBlock(int par1){ return new ItemStack(TGplanks.PlanksSlabs.blockID, 2, par1 & 7); } public String getFullSlabName(int var1){ return null; } public int getBlockTextureFromSideAndMetadata(int side, int metadata) { return 0 + (metadata & 7); } //gets texture file public String getTextureFile() { return "/tgplanks.png"; } @Override public int damageDropped(int par2){ return par2; } @SideOnly(Side.CLIENT) private static boolean isBlockSingleSlab(int par0){ return par0 == TGplanks.PlanksSlabs.blockID; } @SideOnly(Side.CLIENT) public void getSubBlocks(int par1, CreativeTabs tab, List list){ if (par1 != TGplanks.PlanksSlabs.blockID){ for(int NumOfMets=0; NumOfMets<8; NumOfMets++){ list.add(new ItemStack(par1, 1, NumOfMets)); } } } } If you can help, please do. I've tried, and tried, and tried, and i've searched, but i just can't fix the stupid things T_T.
×
×
  • Create New...

Important Information

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