Jump to content

Recommended Posts

Posted

Post the code for crafttablethings.java

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

Here. Please Help me!

 

 

package de.Granator.craftablethings;




import akka.actor.SchedulerException;
import de.Granator.craftablethings.handler.eventhandler;
import de.Granator.craftablethings.items.creeperbakterie;
import de.Granator.craftablethings.items.creeperdna;
import de.Granator.craftablethings.items.endermanbakterie;
import de.Granator.craftablethings.items.endermandna;
import de.Granator.craftablethings.items.endermilbebakterie;
import de.Granator.craftablethings.items.endermilbedna;
import de.Granator.craftablethings.items.ghastbakterie;
import de.Granator.craftablethings.items.ghastdna;
import de.Granator.craftablethings.items.hasenbakterie;
import de.Granator.craftablethings.items.hasendna;
import de.Granator.craftablethings.items.hexenbakterie;
import de.Granator.craftablethings.items.hexendna;
import de.Granator.craftablethings.items.hoehlenspinnenbakterie;
import de.Granator.craftablethings.items.hoehlenspinnendna;
import de.Granator.craftablethings.items.huhnbakterie;
import de.Granator.craftablethings.items.huhndna;
import de.Granator.craftablethings.items.kuhbakterie;
import de.Granator.craftablethings.items.kuhdna;
import de.Granator.craftablethings.items.lohenbakterie;
import de.Granator.craftablethings.items.lohendna;
import de.Granator.craftablethings.items.magmaschleimbakterie;
import de.Granator.craftablethings.items.magmaschleimdna;
import de.Granator.craftablethings.items.ozelotbakterie;
import de.Granator.craftablethings.items.ozelotdna;
import de.Granator.craftablethings.items.pferdebakterie;
import de.Granator.craftablethings.items.pferdedna;
import de.Granator.craftablethings.items.pigmanbakterie;
import de.Granator.craftablethings.items.pigmandna;
import de.Granator.craftablethings.items.pilzkuhbakterie;
import de.Granator.craftablethings.items.pilzkuhdna;
import de.Granator.craftablethings.items.schaafbakterie;
import de.Granator.craftablethings.items.schaafdna;
import de.Granator.craftablethings.items.schweindna;
import de.Granator.craftablethings.items.schweinebakterie;
import de.Granator.craftablethings.items.silberfischbakterie;
import de.Granator.craftablethings.items.silberfischdna;
import de.Granator.craftablethings.items.skelletbakterie;
import de.Granator.craftablethings.items.skelletdna;
import de.Granator.craftablethings.items.slimebakterie;
import de.Granator.craftablethings.items.slimedna;
import de.Granator.craftablethings.items.spinnendna;
import de.Granator.craftablethings.items.tintenfischbakterie;
import de.Granator.craftablethings.items.tintenfischdna;
import de.Granator.craftablethings.items.villagerbakterie;
import de.Granator.craftablethings.items.villagerdna;
import de.Granator.craftablethings.items.wolfbakterie;
import de.Granator.craftablethings.items.wolfdna;
import de.Granator.craftablethings.items.waechterbakterie;
import de.Granator.craftablethings.items.waechterdna;
import de.Granator.craftablethings.items.zombiebakterie;
import de.Granator.craftablethings.items.zombiedna;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

@Mod(modid = craftablethings.MODID, version = craftablethings.VERSION)
public class craftablethings
{
    public static final String MODID = "craftablethings";
    public static final String VERSION = "1.0";
    
    
    
    
   
    //Creative Tabs
    public static CreativeTabs craftabletab; 
    
    
    
    
    //Items
    public static Item creeperbakterie;
    public static Item zombiebakterie;
    public static Item skelletbakterie;
    public static Item spinnenbakterie;
    public static Item spinnendna;
    public static Item creeperdna;
    public static Item zombiedna;
    public static Item skelletdna;
    public static Item villagerbakterie;
    public static Item villagerdna;
    public static Item wolfdna;
    public static Item wolfbakterie;
    public static Item hexenbakterie;
    public static Item hexendna;
    public static Item endermanbakterie;
    public static Item endermandna;
    public static Item schweinedna;
    public static Item schweinebakterie;
    public static Item kuhbakterie;
    public static Item kuhdna;
    public static Item schaafdna;
    public static Item schaafbakterie;
    public static Item ozelotdna;
    public static Item ozelotbakterie;
    public static Item slimedna;
    public static Item slimebakterie;
    public static Item silberfischdna;
    public static Item silberfischbakterie;
    public static Item huhndna;
    public static Item huhnbakterie;
    public static Item tintenfischdna;
    public static Item tintenfischbakterie;
    public static Item hoehlenspinnenbakterie;
    public static Item hoehlenspinnendna;
    public static Item hasenbakterie;
    public static Item hasendna;
    public static Item pferdebakterie;
    public static Item pferdedna;
    public static Item waechterbakterie;
    public static Item waechterdna;
    public static Item pilzkuhbakterie;
    public static Item pilzkuhdna;
    public static Item pigmanbakterie;
    public static Item pigmandna;
    public static Item ghastbakterie;
    public static Item ghastdna;
    public static Item lohenbakterie;
    public static Item lohendna;
    public static Item endermilbedna;
    public static Item endermilbebakterie;
    public static Item magmaschleimbakterie;
    public static Item magmaschleimdna;

    
        
       
        
        @EventHandler
    public void Preinit(FMLPreInitializationEvent event)
    {
    	//Beschreibung
    	ModMetadata data = event.getModMetadata();
    	data.autogenerated = false;
    	data.name = EnumChatFormatting.BLUE + "Craftable Things";
    	data.credits = EnumChatFormatting.BOLD + "Granator: https://goo.gl/uGyZlr ";
    	data.description = "In this Mod I will try to add for the most things in Minecraft a Craftin-Reciepe";   
    	data.version = "1.8.8";
    	data.logoFile = "";
    	data.updateUrl = "https://goo.gl/CU5KcT";
    	
    	
    	//Creative-Tabs
    	craftabletab = new CreativeTabs("craftabletab") {			
    		@Override
		public Item getTabIconItem() {
			return creeperbakterie;

    		}
    		};
    		
    	
        	//Items-Eigenschaften
        	creeperbakterie = new creeperbakterie().setUnlocalizedName("creeperbakterie").setCreativeTab(craftabletab);
        	zombiebakterie = new zombiebakterie().setUnlocalizedName("zombiebakterie").setCreativeTab(craftabletab);
        	skelletbakterie = new skelletbakterie().setUnlocalizedName("skelletbakterie").setCreativeTab(craftabletab);
        	creeperdna = new creeperdna().setUnlocalizedName("creeperdna").setCreativeTab(craftabletab);
        	skelletdna = new skelletdna().setUnlocalizedName("skelletdna").setCreativeTab(craftabletab);
        	zombiedna = new zombiedna().setUnlocalizedName("zombiedna").setCreativeTab(craftabletab);
        	villagerbakterie = new villagerbakterie().setUnlocalizedName("villagerbakterie").setCreativeTab(craftabletab);
        	villagerdna = new villagerdna().setUnlocalizedName("villagerdna").setCreativeTab(craftabletab);
        	wolfdna = new wolfdna().setUnlocalizedName("wolfdna").setCreativeTab(craftabletab);
        	wolfbakterie = new wolfbakterie().setUnlocalizedName("wolfbakterie").setCreativeTab(craftabletab);
        	hexenbakterie = new hexenbakterie().setUnlocalizedName("hexenbakterie").setCreativeTab(craftabletab);
        	hexendna = new hexendna().setUnlocalizedName("hexendna").setCreativeTab(craftabletab);
        	endermanbakterie = new endermanbakterie().setUnlocalizedName("endermanbakterie").setCreativeTab(craftabletab);
        	endermandna = new endermandna().setUnlocalizedName("endermandna").setCreativeTab(craftabletab);
        	schweinedna = new schweindna().setUnlocalizedName("schweinedna").setCreativeTab(craftabletab);
        	schweinebakterie = new schweinebakterie().setUnlocalizedName("schweinebakterie").setCreativeTab(craftabletab);
        	spinnenbakterie = new de.Granator.craftablethings.items.spinnenbakterie().setUnlocalizedName("spinnenbakterie").setCreativeTab(craftabletab);
        	spinnendna = new spinnendna().setUnlocalizedName("spinnendna").setCreativeTab(craftabletab);
        	kuhbakterie = new kuhbakterie().setUnlocalizedName("kuhbakterie").setCreativeTab(craftabletab);
        	kuhdna = new kuhdna().setUnlocalizedName("kuhdna").setCreativeTab(craftabletab);
    		schaafdna = new schaafdna().setUnlocalizedName("schaafdna").setCreativeTab(craftabletab);
    		schaafbakterie = new schaafbakterie().setUnlocalizedName("schaafbakterie").setCreativeTab(craftabletab);
    		ozelotbakterie = new ozelotbakterie().setUnlocalizedName("ozelotbaktiere").setCreativeTab(craftabletab);
    		ozelotdna = new ozelotdna().setUnlocalizedName("ozelotdna").setCreativeTab(craftabletab);
        	slimebakterie = new slimebakterie().setUnlocalizedName("slimebakterie").setCreativeTab(craftabletab);
    	    slimedna = new slimedna().setUnlocalizedName("slimedna").setCreativeTab(craftabletab);   	
        	silberfischbakterie = new silberfischbakterie().setUnlocalizedName("silberfischbakterie").setCreativeTab(craftabletab);
        	silberfischdna = new silberfischdna().setUnlocalizedName("silberfischdna").setCreativeTab(craftabletab);
        	huhnbakterie = new huhnbakterie().setUnlocalizedName("huhnbakterie").setCreativeTab(craftabletab);
        	huhndna = new huhndna().setUnlocalizedName("huhndna").setCreativeTab(craftabletab);
    	    tintenfischbakterie = new tintenfischbakterie().setUnlocalizedName("tintenfischbakterie").setCreativeTab(craftabletab);
    	    tintenfischdna = new tintenfischdna().setUnlocalizedName("tintenfischdna").setCreativeTab(craftabletab);
        	hoehlenspinnenbakterie = new hoehlenspinnenbakterie().setUnlocalizedName("hoehlenspinnendna").setCreativeTab(craftabletab);
    	    hoehlenspinnendna = new hoehlenspinnendna().setUnlocalizedName("hoehlenspinnendna");
    	    hasenbakterie = new hasenbakterie().setUnlocalizedName("hasenbakterie").setCreativeTab(craftabletab);
        	hasendna = new hasendna().setUnlocalizedName("hasendna").setCreativeTab(craftabletab);		
        	pferdebakterie = new pferdebakterie().setUnlocalizedName("pferdebakterie").setCreativeTab(craftabletab);
        	pferdedna = new pferdedna().setUnlocalizedName("pferdedna").setCreativeTab(craftabletab);
        	waechterbakterie = new waechterbakterie().setUnlocalizedName("waechterbakterie").setCreativeTab(craftabletab);
        	waechterdna = new waechterdna().setUnlocalizedName("waechterdna").setCreativeTab(craftabletab);
        	pilzkuhbakterie = new pilzkuhbakterie().setUnlocalizedName("pilzkuhbakterie").setCreativeTab(craftabletab);
        	pilzkuhdna = new pilzkuhdna().setUnlocalizedName("pilzkuhdna").setCreativeTab(craftabletab);
        	ghastbakterie = new ghastbakterie().setUnlocalizedName("ghastbakterie").setCreativeTab(craftabletab);
        	ghastdna= new ghastdna().setUnlocalizedName("ghastdna").setCreativeTab(craftabletab);
        	pigmanbakterie = new pigmanbakterie().setUnlocalizedName("pigmanbakterie").setCreativeTab(craftabletab);
        	pigmandna = new pigmandna().setUnlocalizedName("pigmandna").setCreativeTab(craftabletab);
        	lohendna = new lohendna().setUnlocalizedName("lohendna").setCreativeTab(craftabletab);
        	lohenbakterie = new lohenbakterie().setUnlocalizedName("lohenbakterie").setCreativeTab(craftabletab);
        	endermilbebakterie = new endermilbebakterie().setUnlocalizedName("endermilbebakterie").setCreativeTab(craftabletab);
        	endermilbedna = new endermilbedna().setUnlocalizedName("endermilbedna").setCreativeTab(craftabletab);
        	magmaschleimdna = new magmaschleimdna().setUnlocalizedName("magmaschleimdna").setCreativeTab(craftabletab);
        	magmaschleimbakterie = new magmaschleimbakterie().setUnlocalizedName("magmaschleimbakterie").setCreativeTab(craftabletab);
        	
        	
        	
        	
        	
    	    
    }

    
    
    
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {

    	

    	
    	//EVENTHANDLER
    	FMLCommonHandler.instance().bus().register(new eventhandler());
    			
    	
    

    //Crafting-Rezepte
    	
    	//DNA-Creeper Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 50), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), creeperdna
    			
	});
    	

    	
    	//Bakterie-Creeper Crafting
    	GameRegistry.addRecipe(new ItemStack(creeperdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), creeperbakterie
    			
	});
    	
    	

    	//DNA-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 51), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), skelletdna
    			
	});
    	

    	
    	//Bakterie-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(skelletdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), skelletbakterie
    			
	});
    	

    	
    	//DNA-Zombie Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 54), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), zombiedna
    			
	});
    	

    	
    	//Bakterie-Zombie Crafting
    	GameRegistry.addRecipe(new ItemStack(zombiedna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), zombiebakterie
    			
	});
    	
    	
    	
    	//DNA-Kuh Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 92), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), kuhbakterie
    			
	});
    	

    	
    	//Bakterie-Kuh Crafting
    	GameRegistry.addRecipe(new ItemStack(kuhbakterie), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), kuhbakterie
    			
	});
    	
    	
    	
    	//DNA-Huhn Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 93), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), huhndna
    			
	});
    	

    	
    	//Bakterie-Huhn Crafting
    	GameRegistry.addRecipe(new ItemStack(huhnbakterie), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), huhnbakterie
    			
	});
    	
    	
    	
    	//DNA-Tintenfisch Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 94), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), tintenfischdna
    			
	});
    	

    	
    	//Bakterie-Tintenfisch Crafting
    	GameRegistry.addRecipe(new ItemStack(tintenfischdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), tintenfischbakterie
    			
	});
    	
    	
    	
    	
    	//DNA-Schwein Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 90), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), schweinedna
    			
	});
    	

    	
    	//Bakterie-Schwein Crafting
    	GameRegistry.addRecipe(new ItemStack(schweinedna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), schweinebakterie
    			
	});
    	
    	
    	
    	//DNA-Spinne Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 52), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), spinnendna
    			
	});
    	

    	
    	//Bakterie-Spinne Crafting
    	GameRegistry.addRecipe(new ItemStack(spinnendna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), spinnenbakterie
    			
	});
    	
    	
    	
    	//DNA-Schleim Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 55), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), slimedna
    			
	});
    	

    	
    	//Bakterie-Schleim Crafting
    	GameRegistry.addRecipe(new ItemStack(slimedna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), slimebakterie
    			
	});
    	
    	
    	
    	//DNA-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 66), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), hexendna
    			
	});
    	

    	
    	//Bakterie-Hexe Crafting
    	GameRegistry.addRecipe(new ItemStack(hexendna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), hexenbakterie
    			
	});
    	
    	
    	
    	//DNA-Silberfisch Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 60), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), silberfischdna
    			
	});
    	

    	
    	//Bakterie-Silberfisch Crafting
    	GameRegistry.addRecipe(new ItemStack(silberfischdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), silberfischbakterie
    			
	});
    	
    	
    	
    	//DNA-Höhlenspinne Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 59), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), hoehlenspinnendna
    			
	});
    	

    	
    	//Bakterie-Höhlenspinne Crafting
    	GameRegistry.addRecipe(new ItemStack(hoehlenspinnendna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), hoehlenspinnenbakterie
    			
	});
    	
    	
    	//DNA-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 51), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), skelletdna
    			
	});
    	

    	
    	//Bakterie-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(skelletdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), skelletbakterie
    			
	});
    	
    	
    	
    	//DNA-Enderman Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 58), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), endermandna
    			
	});
    	

    	
    	//Bakterie-Enderman Crafting
    	GameRegistry.addRecipe(new ItemStack(endermandna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), endermanbakterie
    			
	});
    	
    	
    	
    	//DNA-Schaf Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 91), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), schaafdna
    			
	});
    	

    	
    	//Bakterie-Schaf Crafting
    	GameRegistry.addRecipe(new ItemStack(schaafdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), schaafbakterie
    			
	});
    	
    	
    	
    	//DNA-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 95), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), wolfdna
    			
	});
    	

    	
    	//Bakterie-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(wolfdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), wolfdna
    			
	});
    	
    	
    	
    	
    	//DNA-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 98), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), ozelotdna
    			
	});
    	

    	
    	//Bakterie-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(ozelotdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), ozelotbakterie
    			
	});
    	
    	
    	
    	
    	//DNA-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 120), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), villagerdna
    			
	});
    	

    	
    	//Bakterie-Skellet Crafting
    	GameRegistry.addRecipe(new ItemStack(villagerdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), villagerbakterie
    			
	});
    	
    	
    	//DNA-Hasen Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 101), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), hasendna
    			
	});
    	

    	
    	//Bakterie-Hasen Crafting
    	GameRegistry.addRecipe(new ItemStack(hasendna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), hasenbakterie
    			
	});
    	
    	
    	
    	//DNA-Pferde Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 100), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), pferdedna
    			
	});
    	

    	
    	//Bakterie-Pferde Crafting
    	GameRegistry.addRecipe(new ItemStack(pferdedna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), pferdebakterie
    			
	});
    	
    	
    	

    	//DNA-Wächter Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 68), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), waechterdna
    			
	});
    	

    	
    	//Bakterie-Wächter Crafting
    	GameRegistry.addRecipe(new ItemStack(waechterdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), waechterbakterie
    			
	});
    	
    	
    	
    	//DNA-Pilzkuh Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 96), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), pilzkuhdna
    			
	});
    	

    	
    	//Bakterie-Pilzkuh Crafting
    	GameRegistry.addRecipe(new ItemStack(pilzkuhdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), ghastbakterie
    			
	});
    	
    	
    	//DNA-Ghast Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 56), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), ghastdna
    			
	});
    	

    	
    	//Bakterie-Ghast Crafting
    	GameRegistry.addRecipe(new ItemStack(ghastdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), ghastbakterie
    			
	});
    	
    	
    	
    	
    	//DNA-Pigman Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 57), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), pigmandna
    			
	});
    	

    	
    	//Bakterie-Pigman Crafting
    	GameRegistry.addRecipe(new ItemStack(pigmandna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), pigmanbakterie
    			
	});
    	
    	
    	
    	//DNA-Lohe Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 61), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), lohendna
    			
	});
    	

    	
    	//Bakterie-Lohe Crafting
    	GameRegistry.addRecipe(new ItemStack(lohendna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), lohenbakterie
    			
	});
    	
    	
    
    	//DNA-Endermilbe Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 67 ), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), endermilbebakterie
    			
	});
    	

    	
    	//Bakterie-Endermilbe Crafting
    	GameRegistry.addRecipe(new ItemStack(endermilbedna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), endermilbebakterie
    			
	});
    	
    	
    	
    	//DNA-Lohe Crafting
    	GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 62), new Object [] {
    				
    	"DDD",
    	"DED",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), magmaschleimdna
    			
	});
    	

    	
    	//Bakterie-Magmaschleim Crafting
    	GameRegistry.addRecipe(new ItemStack(magmaschleimdna), new Object [] {
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	Character.valueOf('E'), Items.egg,
    	Character.valueOf('D'), magmaschleimbakterie
    			
	});
    	
    	
    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(creeperbakterie, "creeperbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(creeperbakterie, 0, new ModelResourceLocation(MODID + ":creeperbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(creeperdna, "creeperdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(creeperdna, 0, new ModelResourceLocation(MODID + ":creeperdna", "inventory"));

    	
    	//Itemregistrierung
    	GameRegistry.registerItem(endermilbebakterie, "endermilbebakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(endermilbebakterie, 0, new ModelResourceLocation(MODID + ":endermilbebakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(endermilbedna, "endermilbedna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(endermilbedna, 0, new ModelResourceLocation(MODID + ":endermilbedna", "inventory"));

    	
    	

    	//Itemregistrierung
    	GameRegistry.registerItem(magmaschleimdna, "magmaschleimdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(magmaschleimdna, 0, new ModelResourceLocation(MODID + ":magmaschleimdna", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(magmaschleimbakterie, "magmaschleimbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(magmaschleimbakterie, 0, new ModelResourceLocation(MODID + ":magmaschleimbakterie", "inventory"));

    	
    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(lohenbakterie, "lohenbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(lohenbakterie, 0, new ModelResourceLocation(MODID + ":lohenbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(lohendna, "lohendna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(lohendna, 0, new ModelResourceLocation(MODID + ":lohendna", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(pigmanbakterie, "pigmanbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pigmanbakterie, 0, new ModelResourceLocation(MODID + ":pigmanbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(pigmandna, "pigmandna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pigmandna, 0, new ModelResourceLocation(MODID + ":pigmandna", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(ghastbakterie, "ghastbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ghastbakterie, 0, new ModelResourceLocation(MODID + ":ghastbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(ghastdna, "ghastdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ghastdna, 0, new ModelResourceLocation(MODID + ":ghastdna", "inventory"));

    	
    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(pilzkuhbakterie, "pilzkuhbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pilzkuhbakterie, 0, new ModelResourceLocation(MODID + ":pilzkuhbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(pilzkuhdna, "pilzkuhdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pilzkuhdna, 0, new ModelResourceLocation(MODID + ":pilzkuhdna", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(waechterbakterie, "waechterbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(waechterbakterie, 0, new ModelResourceLocation(MODID + ":waechterbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(waechterdna, "waechterdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(waechterdna, 0, new ModelResourceLocation(MODID + ":waechterdna", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(pferdebakterie, "pferdebakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pferdebakterie, 0, new ModelResourceLocation(MODID + ":pferdebakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(pferdedna, "pferdedna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pferdedna, 0, new ModelResourceLocation(MODID + ":pferdedna", "inventory"));

    	
    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(hasenbakterie, "hasenbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(hasenbakterie, 0, new ModelResourceLocation(MODID + ":hasenbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(hasendna, "hasendna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(hasendna, 0, new ModelResourceLocation(MODID + ":hasendna", "inventory"));

    	

    	//Itemregistrierung
    	GameRegistry.registerItem(tintenfischdna, "tintenfischdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(tintenfischdna, 0, new ModelResourceLocation(MODID + ":tintenfischdna", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(tintenfischbakterie, "tintenfischbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(tintenfischbakterie, 0, new ModelResourceLocation(MODID + ":tintenfischbakterie", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(huhnbakterie, "huhnbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(huhnbakterie, 0, new ModelResourceLocation(MODID + ":huhnbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(huhndna, "huhndna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(huhndna, 0, new ModelResourceLocation(MODID + ":huhndna", "inventory"));

    	

    	//Itemregistrierung
    	GameRegistry.registerItem(silberfischbakterie, "silberfischbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(silberfischbakterie, 0, new ModelResourceLocation(MODID + ":silberfischbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(silberfischdna, "silberfischdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(silberfischdna, 0, new ModelResourceLocation(MODID + ":silberfischdna", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(slimedna, "slimedna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(slimedna, 0, new ModelResourceLocation(MODID + ":slimedna", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(slimebakterie, "slimebakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(slimebakterie, 0, new ModelResourceLocation(MODID + ":slimebakterie", "inventory"));

    	
    	
    	//Itemregistrierung
    	GameRegistry.registerItem(ozelotbakterie, "ozelotbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ozelotbakterie, 0, new ModelResourceLocation(MODID + ":ozelotbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(ozelotdna, "ozelotdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ozelotdna, 0, new ModelResourceLocation(MODID + ":ozelotdna", "inventory"));

    	

    	//Itemregistrierung
    	GameRegistry.registerItem(schaafbakterie, "schaafbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(schaafbakterie, 0, new ModelResourceLocation(MODID + ":schaafbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(schaafdna, "schaafdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(schaafdna, 0, new ModelResourceLocation(MODID + ":schaafdna", "inventory"));

    	
    	

    	//Itemregistrierung
    	GameRegistry.registerItem(endermandna, "endermandna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(endermandna, 0, new ModelResourceLocation(MODID + ":endermandna", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(endermanbakterie, "endermanbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(endermanbakterie, 0, new ModelResourceLocation(MODID + ":endermanbakterie", "inventory"));





    	//Itemregistrierung
    	GameRegistry.registerItem(hexendna, "hexendna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(hexendna, 0, new ModelResourceLocation(MODID + ":hexendna", "inventory"));

    	//Itemregistrierung
    	GameRegistry.registerItem(hexenbakterie, "hexenbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(hexenbakterie, 0, new ModelResourceLocation(MODID + ":hexenbakterie", "inventory"));	 	
    		


    	//Itemregistrierung
    	GameRegistry.registerItem(wolfbakterie, "wolfbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(wolfbakterie, 0, new ModelResourceLocation(MODID + ":wolfbakterie", "inventory"));

    	//Itemregistrierung
    	GameRegistry.registerItem(wolfdna, "wolfdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(wolfdna, 0, new ModelResourceLocation(MODID + ":wolfdna", "inventory"));




    	//Itemregistrierung
    	GameRegistry.registerItem(villagerbakterie, "villagerbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(villagerbakterie, 0, new ModelResourceLocation(MODID + ":villagerbakterie", "inventory"));

    	//Itemregistrierung
    	GameRegistry.registerItem(villagerdna, "villagerdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(villagerdna, 0, new ModelResourceLocation(MODID + ":villagerdna", "inventory"));




    	//Itemregistrierung
    	GameRegistry.registerItem(schweinebakterie, "schweinebakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(schweinebakterie, 0, new ModelResourceLocation(MODID + ":schweinebakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(schweinedna, "schweinedna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(schweinedna, 0, new ModelResourceLocation(MODID + ":schweinedna", "inventory"));



    	//Itemregistrierung
    	GameRegistry.registerItem(zombiebakterie, "zombiebakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(zombiebakterie, 0, new ModelResourceLocation(MODID + ":zombiebakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(zombiedna, "zombiedna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(zombiedna, 0, new ModelResourceLocation(MODID + ":zombiedna", "inventory"));



    	//Itemregistrierung
    	GameRegistry.registerItem(skelletbakterie, "skelletbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(skelletbakterie, 0, new ModelResourceLocation(MODID + ":skelletbakterie", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(skelletdna, "skelletdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(skelletdna, 0, new ModelResourceLocation(MODID + ":skelletdna", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(kuhdna, "kuhdna");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(kuhdna, 0, new ModelResourceLocation(MODID + ":kuhdna", "inventory"));


    	//Itemregistrierung
    	GameRegistry.registerItem(kuhbakterie, "kuhbakterie");
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(kuhbakterie, 0, new ModelResourceLocation(MODID + ":kuhbakterie", "inventory"));

    	    
    	
    	
    	    	
    	
    }


    
    @EventHandler
    public void Postinit(FMLPostInitializationEvent event)
    {
    		


    }






    	
    
}

 

Posted

I don't see anything obviously wrong, but there's two things you don't need to do:

 

1) You don't need

new Object[]{}

2) You don't need

Character.valueOf('E')

 

You can do it just like this instead:

 

    	GameRegistry.addRecipe(new ItemStack(hasendna), 
    				
    	"DDD",
    	"DDD",
    	"DDD",
    				
    	'E', Items.egg,
    	'D', hasenbakterie
    			
	);

 

Java has a feature called "varargs" which looks like this on a function:

 

public static void addRecipe(ItemStack result, varargs...)

 

Which wraps all of the other parameters in a new Object[]{} tag for you.  Secondly, ' already denotes a character-literal, no need to wrap it in a ValueOf().

 

Third, with this particular recipe, you have made a recipe which uses only hasenbakterie, but have told the crafting manager that there's an egg in it somewhere (in fact, every other recipe you have does this).  I don't know if this is what you intended or not.

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

Hi,

 

it's nothing about your problem, but I would recommend you to write package names small and class names capitalized.

in German: Es hat zwar nichts mit deinem Problem zu tun, aber ich würde dir empfehlen deine Klassenamen groß zu schreiben und Packetnamen klein. (siehe Java Code Conventions)

http://www.oracle.com/technetwork/java/codeconventions-135099.html

http://docstore.mik.ua/orelly/java-ent/jnut/ch07_01.htm

 

Second thing: You can change:

[...]
import de.Granator.craftablethings.items.silberfischbakterie;
[...]

 

to this:

import de.Granator.craftablethings.items.*;

Then you don't have a few hundred lines of imports, instead you have just this one line and everything in this package gets imported. But be carefull when using this, could get you in trouble for example when having two classes with the same name from different packages and both are imported. ;)

(in German: Dann hast du statt einige hundert Zeilen an Imports nur noch eine einzige, welche alle Klassen des einen Packages importiert. Rest siehe Englischer Text. ;) )

 

To your problem, I wasn't able to find anything which is obviously wrong.

Developer of Primeval Forest.

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

    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • 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.