• 1

    posted a message on Cancel vanilla world gen

    For that, you should make your own WorldProvider or BiomeDecorator or whatever. I don't think events will be enough to cancel biomes.


    You can cancel some world gen -- look at DecorateBiomeEvent.Decorate.EventType to see what is cancelable. That includes grass, flowers, etc. but not biomes. Also it will be nearly impossible to cancel structures added by other mods because they rarely use events.

    Posted in: Modification Development
  • 1

    posted a message on [SOLVED] Get Block In Slot

    This is most likely the culprit (in getBlockInSlot) :


    if (index < 0 || index >= this.getSizeInventory())
    return null;

    Wherever getBlockInSlot is called from, you may have forgotten to check for null before using the return. On line 59, to be exact.


    Honestly, why complicate things? Use the getStackInSlot to get an ItemStack. Use the ItemStack to get an item. Use the item to get the block with Block.getBlockByItem(Item in). Then check if there is no block associated with that item and make sure not to continue unless you have an actual block.


    Where is getBlockInSlot called from? Also show us getSizeInventory.

    Posted in: Modification Development
  • 1

    posted a message on Need help with a custom AI entity
    Quote from thvardhan»

    ok thanks now i have fixed the rendering issue please guide me on setNameAlwaysVisible and this lag i am having. in console it just says (skipping X ticks) is it natural for me to see these skipping in IDE? (will they be automatically removed when i compile mod? my pc is only a quad core with ok gfxcard).


    I get that "skipping X ticks" message a lot when I am loading new chunks or entering a new dimension in my testing environment. Users will not see it unless they have a console, like when using the FTB launcher.

    Are you sure it's the entity causing the lag? Like if you kill the entity, does the game immediately speed up again? Does summoning / spawning it immediately cause the game to slow down?
    Posted in: Modification Development
  • 1

    posted a message on Need help with a custom AI entity
    Quote from thvardhan»

    this is my whole class


    https://gist.github.com/thvardhan/50f1f214e7e38dc77c7ac281b637d83d


    and this is my constructer



    public EntityLogDotZip(World worldIn) {
    super(worldIn);
    ((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.applyEntityAI();
    this.setSize(0.6F, 1.95F);
    this.setCurrentItemOrArmor(0,new ItemStack(Items.golden_sword));
    this.setAlwaysRenderNameTag(true);

    }


    and yes this is what comment on setcurrentItemorarmor method says (Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor.)


    P.S. i moved them to constructor but no luck. and it seems i am having a new problem. this entity is making the game lag. do i have to setup any server sync methods?


    Move the this.setCustomNameTag(name); to the constructor, before setting alwaysRenderNameTag to true.

    Posted in: Modification Development
  • 2

    posted a message on Need help with custom entity
    Quote from Nexwerx»

    Oh no that is NOT a good tutorial to follow. 90% of the code has changed, and the code he does use over implements a gillion things that you will never need. And to boot the code is awful, uncommented, and formatted to his screen size with breaks.


    That being said, it's also the only one remotely giving you any thing to do with custom entities, but at least he took the Furnace code are renamed all the variables for you.


    It is true that many of the Forge methods he calls have been renamed or slightly changed, but he purposely does not share copy-paste-able code. The "comments" are in the form of the descriptions before and after example code, and he adds a lot of random unusual things in case someone out there has a question about that specific thing.

    I suggested Jabelar's tutorial because this person said they had no experience with entity coding.

    I would recommend that you look for tutorials for 1.8 and 1.8.9. If you want examples, see my GitHub for Extra Golems. The entity classes seem very complicated at first, but it may be helpful to see how I register the renders in my ClientProxy, as that has changed from 1.7.10 to 1.8+
    Posted in: Modification Development
  • 1

    posted a message on Item that will switch the weather
    Quote from bluelionalex»

    Ok so I have half of it working. I have it so that when you right click the item you get the ability to fly. Now I want it to be so that if you right click again while you have the ability to fly you will lose the ability to fly. Below I've left a link to my code. If you could check it out and see if what I have is wrong or if you could tell me how to add the ability to turn it off I would be greatly appreciative.


    http://pastebin.com/kj0WqsPG


    /\
    |
    my code

    Change the part inside onItemRightClick to an if-else statement like so:

    if (allowFlying)
    {
        set flying to false
    }
    else
    {
        set flying to true
    }
    Posted in: Modification Development
  • 1

    posted a message on Need help with a custom AI entity
    Quote from coolAlias»

    Well... what does the error say? My guess is it has to do with the damage attribute, as I don't think EntityCreature inherits from a class that adds that attribute. If that's the case, getEntityAttribute for attack damage returns null and you need to add the attribute instead of getting it. See any of the super classes for how to add an attribute.


    This is correct. For some reason, the entity attribute of attack damage is not initialized for most classes. It is recommended to override attackEntityAsMob to actually apply damage instead of relying on the attribute system.
    Posted in: Modification Development
  • 1

    posted a message on How to get custom texture icon for your custom entity spawn egg?
    Quote from CHAMCH1»

    I made a custom entity (mob) but I don't know how to add a custom texture icon-like thing for the spawn egg. Like the alien vs predator mod, the spawn of the aliens had a custom icon on it.

    I also wanted to know how to add a description to the custom entity spawn egg, I'm a beginner to modding.


    Yep, like coolAlias said.

    Then to add a custom description, override addInformation in your Item class.
    See this GitHub for an example of an item that adds a custom description. This specific one supports language translation, but you do not have to do that right away.
    Posted in: Modification Development
  • 1

    posted a message on Making a New Dimension. Would it be hard?
    Quote from AdityaSF»

    I've been thinking of adding a new dimension to my mod. I haven't looked into how to make a new dimension or even generate blocks. Would it be quite difficult? And are there any tutorials/guides you could guide me to?



    Adding a dimension is very involved.

    You will need:
    - biomes
    - world provider
    - chunk provider
    - gen layer
    - gen layer provider
    - world chunk manager
    - teleporter

    I followed techgeek1019's video tutorial when I made my first dimension for 1.7.10.


    There are other tutorials to guide you through it, but mainly you should take it step by step.

    If it helps to look at example code, here is a link to my 1.7.10 Dinosaur Dimensions GitHub. It's not the best; I took a few shortcuts and don't even use the BiomeDecorator I made because it kept crashing. The only dimension I've done in another version is an empty, void dimension here: Nomadic Tents GitHub. It may help to cross-reference the two to see what is essential and what is not.

    The part that kept crashing the most until I figured it out was getInts in GenLayerBiomes.

    Posted in: Modification Development
  • 1

    posted a message on Tile Entity get item back from using fuel

    Have you overriden getContainerItem and hasContainerItem in your propane tank item class? That might help -- it won't solve your problem automatically, but it's the only step I'm familiar with...

    Posted in: Modification Development
  • To post a comment, please .