Jump to content

sequituri

Forge Modder
  • Posts

    669
  • Joined

  • Last visited

Posts posted by sequituri

  1. Ok, I just added that but it gives me a error unless I create the "public void registerRenderThing(){" in my CommonProxy, but whe nI do the game crashes when I load up my world only when the entity is not set dead in my world.

    Your proxy does need this method declared, but only as abstract -- (No {...} used). In other words, in the common proxy only: public abstract void registerRenderThing();

     

    -- also add @Override to your client proxy version of the method with the actual code {...}.

     

    Alternatively, if you do not want an abstract base class, declare the method with empty braces "{}" instead.

  2. Check your renderer with @Overrides on every method you expect to get called by Minecraft.

    I suspect that since you changed the method signature, your renderItem method is not called at all.

    Or, you could call it yourself from the Overridden renderItem method.

     

    Another question... Why does your method have two (2) ItemStack parameters? You can always get metadata from the original parameter.

  3. I looked And I do have it registered in my ClientProxy class already

     

     

    package com.hurleyboarder.Main;
    
    import cpw.mods.fml.client.registry.RenderingRegistry;
    
    public class ClientProxy extends TutorialCommonProxy{
    
    public void registerRenderThing(){
    	RenderingRegistry.registerEntityRenderingHandler(EntityEArrow.class, new RenderEArrow());
    }
    
    
    }
    

    Where do you call this method? I cannot find it in your posted code.

    It should look like this: proxy.registerRenderThing();

    Did you forget it?

  4. @bcwadsworth, I have given you the code to get a tag containing all of the TE's NBTData. Saving it in your entity is basic java. Read the inline comments.

     

    Also, beware that you will have no way of knowing how to recreate a tile entity just by its NBT data. You need its class, as well as the associated Block's class. So, if the TE is deleted as Hugo said, your item is no longer associated with anything.

     

    @Whov, if you understood the question, the answer is not "Go the <someperson> way." State what you think the problem is and offer a suggestion.

     

    @bcwadsworth, you could get more focussed help here by explaining what you are trying to accomplish with this method you seek.

  5.  

    On top of that, it also displays the opaque version in the creative tab.

     

    Oh yeah, the leaves don't change to the opaque texture when set to fast graphics.

    Don't override 'isOpaqueCube()' that handles the opacity based on graphics level for you in the BlockLeaves base class.

     

    ALso, the only statements you need in the constructor is the setCreativeTab one. Everything else is, again, in the base class you used.

  6. Here is an example of subclassing and overriding TNT blast sizes:

     

     

     

    public class EntityBigTNTPrimed extends EntityTNTPrimed 
    {
    public EntityBigTNTPrimed(World w, double x, double y, double z, EntityLivingBase placer)
    {
    	super(w, x, y, z, placer);
    	// alter 'fuse' here if different delay is wanted
    }
    
    @Override
    public void onUpdate()
    {
    	this.prevPosX = this.posX;
    	this.prevPosY = this.posY;
    	this.prevPosZ = this.posZ;
    	this.motionY -= 0.03999999910593033D;
    	this.moveEntity(this.motionX, this.motionY, this.motionZ);
    	this.motionX *= 0.9800000190734863D;
    	this.motionY *= 0.9800000190734863D;
    	this.motionZ *= 0.9800000190734863D;
    
    	if (this.onGround)
    	{
    		this.motionX *= 0.699999988079071D;
    		this.motionZ *= 0.699999988079071D;
    		this.motionY *= -0.5D;
    	}
    
    	if (this.fuse-- <= 0)
    	{
    		this.setDead();
    
    		if (!this.worldObj.isRemote)
    		{
    			this.majorlyExplode(size);
    		}
    	}
    	else
    	{
    		this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
    	}
    }
    private void majorlyExplode()
    {
    	float f = YOUR_BLAST_RADIUS; // this is a float normally 4.0f
    	this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);
    }
    }
    

     

     

     

    CAVEAT: It has not been syntax checked or tested. Use at your own risk.

  7. You're missing what I'm telling you (important parts of it, anyways.)

     

    Try this:

     

    @Mod(modid = "modcompat", name="Mod Compatibility Patch", version="1.0.0", acceptedMinecraftVersions = "1.7.2,1.7.10", guiFactory = "the_fireplace.modcompat.config.ModCompatGuiFactory")
    public class ModCompatBase {
    @Instance(value = "modcompat")
            public static ModCompatBase instance;
    public static Configuration config;
            public static Property FIRSTTIME_PROPERTY;
    
    public static void syncConfig() {
    FIRSTTIME_PROPERTY = config.get(Configuration.CATEGORY_GENERAL, ModCompatConfigValues.FIRSTTIME_NAME, ModCompatConfigValues.FIRSTTIME_DEFAULT);
    ModCompatConfigValues.FIRSTTIME = FIRSTTIME_PROPERTY.getBoolean();
    // get other properties here
    if(ModCompatConfigValues.FIRSTTIME) {
    	System.out.println("[ModCompat]Doing one-time scan...");
    	FIRSTTIME_PROPERTY.set(false);
    }
    if (config.hasChanged()) {
                    config.save();
    }
    }
    @EventHandler
    public void PreInit(FMLPreInitializationEvent event){
    //Config code
    config = new Configuration(event.getSuggestedConfigurationFile());
            config.load();
    syncConfig();
    }
    
    @SubscribeEvent
    public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
         if(eventArgs.modID.equals("modcompat"))
            syncConfig();
    }
    }
    

     

     

    mkay?

  8.     public static int ironmanMk1helmID;  // <==== This is zero by default
        public static int ironmanMk1chestID; 
        public static int ironmanMk1pantsID;
        public static int ironmanMk1bootsID;
    
    //Define Iron Man Armor       ***   This is the renderID (see above) ---v
        public static Item ironmanMk1Helmet = new IronManMk1(IronManMk1Mat, ironmanMk1helmID, 0).setUnlocalizedName("IronManMk1Helmet");
        public static Item ironmanMk1Chest = new IronManMk1(IronManMk1Mat, ironmanMk1helmID, 1).setUnlocalizedName("IronManMk1Chest");
        public static Item ironmanMk1Pants = new IronManMk1(IronManMk1Mat, ironmanMk1helmID, 2).setUnlocalizedName("IronManMk1Pants");
        public static Item ironmanMk1Boots = new IronManMk1(IronManMk1Mat, ironmanMk1helmID, 3).setUnlocalizedName("IronManMk1Boots");
    

    With this code, you are setting the renderID to be cloth (0). I don't do much rendering stuff at all, but that doesn't seem correct to me. I'd help you more, but my konwledge of rendering issues is pretty slim.

  9. I suspect your syncConfig is reloading the configuration before it is first saved... thereby erasing your firsttime update.

    Please repost your main class as it is now.  It is unnecessary to config.load() in syncConfig as the configuration should already be loaded and updated, it only needs to be read into variables and saved. In fact, you FIRSTTIME property check & set should be part of syncConfig anyways.

×
×
  • Create New...

Important Information

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