Jump to content

sequituri

Forge Modder
  • Posts

    669
  • Joined

  • Last visited

Posts posted by sequituri

  1. Normally I don't just post free code for people, I think they should learn the proper code themselves and become better modders. But, this one time I excuse myself and do it anyways.

    
    public static final EnumCreatureType ENeola = EnumHelper.addCreatureType("Neola", WhateverYourCreatureClassIs.class, 40, Material.air, true);
    
    

    The true at the end means peaceful. But, you have to provide the exact class to spawn where is says above. Whatever...is.class requires the name of your CLASS, NOT EntityCreature or EntityLiving, or EntityTameable..

  2. EntityLiving#tasks.removeTask(EntityAIBase base)

    does indeed use == for the comparison when seeking the object to remove and new Object() is always a different instance, so you probably won't find it as easy as you noted. But, EntityAnimal and EntityTameable (as well as EntityAgeable) do not suffer from preassigned tasks, so you could override EntityAnimal and assign your own AI tasks.

    Others may know more or do it differently, so don't take this a gospel. Just trying to help.

  3. There is some recent precedent for stopping mod maliciousness here and a couple other topics:

    http://www.minecraftforum.net/topic/2323043-to-mod-creators-copyrights-and-malicious-code/

     

    This perhaps being a key point,

    I've gotten a few reports of this mod possibly acting maliciously if installed without "permission". Per the Minecraft terms of use: "Please think carefully before you make any content available, because it will be made public and might even be used by other people in a way you don‘t like."

     

    There will also be a future update to the terms that will address malicious code, which is to say anything that intentionally prevents someone from playing the game, or purposefully negatively affects the game experience.

     

    Modders receive permission to play the game and distribute mods from Mojang, just like other players, through the terms of use. They do not get to dictate their own terms of use for content that is created for Minecraft.

  4.  

    public void OnItemPickup(EntityItemPickupEvent e) { ...
         if(e.entity.equals(RangerMain.plantFibers)){ 
    ...
    

    The event you're using contain a single property:

    EntityItem item;

    (the EntityItem picked up)

    It inherits from event PlayerEvent:

    EntityPlayer entityPlayer;

    (the player picking it up)

    and from event LivingEvent:

    EntityLivingBase entityLiving;

    (which is not set for this event)

    and from event EntityEvent:

    Entity entity;

    (also not used for this event)

     

    So, what you should be looking at is e.item /* the EntityItem */ .getEntityItem() /* the ItemStack */ .getItem() /* the Item */;

    (Comments may added for informational purposes and should be removed)

    Check for nulls at appropriate places.

  5.  package darpg.armor;
    public CopperBoots(int par1, EnumArmorMaterial par2EnumArmorMaterial,
    		int par3, int par4) {
    	super(par4, par2EnumArmorMaterial, par4, par4);
    

    I don't know about you, but to me it looks like you are using par4 twice and ignoring par3 in your super() call here. That might change some important information when the class is constructed. An ID perhaps?

  6. If you could figure out a way to let modders do the deobfuscation / renaming using their IDE and just upload to the server instead of relying on chatbot, with some sort of quality control / voting / reputation etc to prevent sabotage, it would take a huge load off the MCP guys and probably speed things up enormously.  MCPbot is better than nothing but it's pretty cumbersome.

     

    -TGG

    This part I so agree with. While the names in large part have made sense, there are a few cases of method names that have me pulling out my hair - because the don't really represent the purpose of the method (or field in some cases.) But, overall, I'd like to see peer-reviewed changes to the srg names automatically used.

  7. The Furnace uses metadata to determine it's placed direction (even when rendering on the hotbar.) The facing when in inventory is due to a trick in RenderBlocks where renderBlockAsItem(Block, meta, color) changes the metadata of the furnace used to lookup icon to 2. So, it forces the furnace to face the proper way to render the item in the hotbar.

    You might have to set your own block renderer to overcome that limitation.

    A possible workaround I haven't tried is to always create your ItemStack with a furnace with metadata = 2. When it is actually placed it will change accordingly, of course.

  8. Ok cool thanks I've copied the code, it all works smoothly, except for one thing, the furnace faces always a set direction; it never changes. I checked the furnace code and well i have been unsuccessful...

    ------------------------------------------------------------------------------------------------------------------------------

    So, what you want the face to change sides dynamically when you walk around it?

  9. I was moving in some of my .xcf files from GIMP to sit with the assets, and I didn't want them in the end user jar so I tried to exclude the xcfs folder I have under resources. However, regardless of how I do it, it ends up in the jar anyways.

     

    gradle does not use your IDE's exclude setting when it builds. If they are in the assets folder they get included in the jar when you gradle build.

  10. Arguments are passed by reference in java (unless the argument an expression). You are passing the same reference every time in your loop, then altering where it points (not passing a new reference each time).

     

    Try this for the LanguageRegistry:

    LanguageRegistry.addName(new ItemStack(redstoneClock, 1, ix), subNames[ix]+"stone Cloth");
    

    You can do something similar for the recipe.

    Sorry... but he is already creating a new instance of the ItemStack in each iteration of the loop, that is not the answer (it would be if he wasn't).

     

    @OP: Can you post your Block or Item code? I'm guessing your issue is you forgot to designate an ItemBlockWithMetadata or return appropriately distinct unlocalized names for each stack. Check here for an example of a block with subtypes. Using that your language registry will work just fine as it is.

     

    You are more likely correct. I am missing something. Sorry.

  11. EntityLiving and EntityPlayer are both subclasses of EntityLivingBase, but you cannot cast one to the other unless it is an X instanceof Y (you can cast both to EntityLivingBase, if that's what you need, though.) SO, put an 'if' in there to catch that and use logic.

    That has nothing to do with the topic, he is trying to use a method in EntityLiving, not EntityLivingBase, so he needs to check if the entity in question is an instanceof EntityLiving before casting. Stop confusing people with random comments.

    I don't find your attitude helpful. Perhaps you could keep your snide comments out of the fora.

    How is clarifying a statement that confuses the issue at hand being snide or unhelpful? I've seen you give people some excellent advice on challenging questions in other threads, but there have been several cases where you've been either plain wrong or providing extraneous information that diverts from the main point; in the latter cases, I feel it is indeed helpful to point it out and provide either clarification or correction as needed. When I say "stop confusing people with random statements", I'm referring to the latter; for the former, it is helpful to fact-check before posting replies to make sure the information you provide is accurate. If you consider that snide, well, that's your call.

    Your remarks were and continue to be out of band for these fora. Your tutorials are nice, but all you do is self-advertise your ability to learn from tutorials. So, when all you have to add is "hey, look at my totorial," you really don't have any place suggesting I change my posting habits to suit you.

    Now, please grow the hell up and stop this quibbling. It gains nothing and bores me.

×
×
  • Create New...

Important Information

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