Jump to content

Drop set not working


com.raze.mods

Recommended Posts

this is the main block

package com.raze.blocks;

import java.util.Random;

import com.raze.item.*;
import com.raze.main.*;
import com.raze.lib.*;

import net.minecraft.block.Block;
import net.minecraft.src.*;
import net.minecraft.world.World;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.functions.*;

public class Mods_CarbonOre {
public static void mainRegistry(){
	initializeBlock();
	registerItem();
}

public static Block CarOre;

public static void initializeBlock(){
	CarOre = new CarOre(Material.rock)
	.setBlockName("CarOre")
	.setCreativeTab(CreativeTabs.tabBlock)
	.setBlockTextureName(RefStrings.MODID + ":CarOre")
	.setHardness(4.0F)
	.setResistance(15F)
	.setStepSound(Block.soundTypeStone);
	}
public static void registerItem(){
	GameRegistry.registerBlock(CarOre, CarOre.getUnlocalizedName());
    }
}

 

 

 

 

This is the chain for it

package com.raze.blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

import com.raze.item.*;
import com.raze.blocks.*;
import com.raze.main.*;
import com.raze.lib.*;

import net.minecraft.item.*;

public class CarOre extends Block{

protected CarOre(Material p_i45394_1_) {
	super(p_i45394_1_);
	// TODO Auto-generated constructor stub
	setHarvestLevel("pickaxe", 2);
}
    @Override
    public Item getItemDropped(int metadata, Random random, int fortune) {
        return raze.Raze_carbondrop;
    }
}

Link to comment
Share on other sites

package com.raze.main;

 

import com.raze.blocks.*;

import com.raze.item.*;

import com.raze.lib.RefStrings;

 

import cpw.mods.fml.common.Mod;

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

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.event.FMLPostInitializationEvent;

 

@Mod(modid = RefStrings.MODID , name = RefStrings.NAME , version = RefStrings.VERSION)

public class MainReg {

 

@SidedProxy(clientSide =RefStrings.CLIENTSIDE , serverSide =RefStrings.SERVRERSIDE )

public static ServerProxy proxy;

 

@EventHandler

public static void PreLoad(FMLPreInitializationEvent PreEvent){

Raze_carbondrop.mainRegistry();

Mods_CarbonOre.mainRegistry();

proxy.registerRenderInfo();

}

@EventHandler

public static void load(FMLInitializationEvent event){

 

}

@EventHandler

public static void PostLoad(FMLPostInitializationEvent PostEvent){

}

}

 

Link to comment
Share on other sites

Well that was useless, post Raze_carbondrop and Mods_CarbonOre

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.

Link to comment
Share on other sites

package com.raze.item;

 

import com.raze.lib.*;

import com.raze.blocks.*;

import com.raze.item.*;

import com.raze.main.*;

 

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

 

public class Raze_carbondrop {

 

public static void mainRegistry(){

initializeItem();

registerItem();

}

 

public static Item CDrop;

 

public static void initializeItem(){

CDrop = new Item().setUnlocalizedName("CDrop")

.setCreativeTab(CreativeTabs.tabMaterials)

.setTextureName(RefStrings.MODID + ":CDrop");

}

 

public static void registerItem(){

GameRegistry.registerItem(CDrop, CDrop.getUnlocalizedName());

}

}

 

 

 

 

 

package com.raze.blocks;

 

import java.util.Random;

 

import com.raze.item.*;

import com.raze.main.*;

import com.raze.lib.*;

 

import net.minecraft.block.Block;

import net.minecraft.src.*;

import net.minecraft.world.World;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.MinecraftForge;

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

import cpw.mods.fml.common.functions.*;

 

public class Mods_CarbonOre {

public static void mainRegistry(){

initializeBlock();

registerItem();

}

 

public static Block CarOre;

 

public static void initializeBlock(){

CarOre = new CarOre(Material.rock)

.setBlockName("CarOre")

.setCreativeTab(CreativeTabs.tabBlock)

.setBlockTextureName(RefStrings.MODID + ":CarOre")

.setHardness(4.0F)

.setResistance(15F)

.setStepSound(Block.soundTypeStone);

}

public static void registerItem(){

GameRegistry.registerBlock(CarOre, CarOre.getUnlocalizedName());

    }

}

 

Link to comment
Share on other sites

Well this shouldn't even compile:

 

    @Override
    public Item getItemDropped(int metadata, Random random, int fortune) {
        return raze.Raze_carbondrop;
    }

 

Because Raze_carbondrop is not of type Item.

In fact, I'm not even sure it points to a class that exists ("com.raze.item.Raze_carbondrop" != "raze.Raze_carbondrop")

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.

Link to comment
Share on other sites

"Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop

If i do this it still drops its self

 

Negative.  CDrop is of type Item and Items don't drop Items, Blocks drop Items (or Blocks, but Blocks are also Items).

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.

Link to comment
Share on other sites

CarOre is of type Block and he is trying to get it to drop CDrop. By "It still drops itself" i think he means the blocks still drops its itemblock and not CDrop

(@OP FIX YOUR NAMES!)

 

Try adding the following to your block it should make your block drop an apple when harvested. If that works you can rule out the block as the problem.

@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Items.apple;
}

I am the author of Draconic Evolution

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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