Jump to content

ObsequiousNewt

Forge Modder
  • Posts

    751
  • Joined

  • Last visited

Posts posted by ObsequiousNewt

  1. download the forge SRC from files.minecraftforge.net once you have done that then just run the install.cmd and a MCP will be made for you! Once it has been made then put your code from your old MCP(YOURMCP/src/minecraft/YourPackage's) and paste them in the new MCP(YOURNEWMCP/src/minecraft/Pasteyourpackageshere). Check out my thread to fix the texture error's

     

     

    http://www.minecraftforge.net/forum/index.php/topic,9792.0.html

    True. And I know that Lex and cpw are all in a flurry updating Forge; I've seen the Github repo. But I don't want to get it until he's officially released for 1.6. Of course, that's just me.

  2. Well fishEntity is not a boolean so I can not set it to true nor false. I did try setting it  equal to null and != null but those did not work. I tried placing it in two different places

     

     

    4a0315a0c6f71d3ad0cdadd6838a0176.png

     

     

     

    Another thing though fishEntity is not the rod its self it's actually an instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different.

     

    Another idea please? I really need this working.

    Er, not "true". But in the constructor of EntityFishHook there is a line that says "this.angler.fishEntity = this;". Since you're missing that line, angler.fishEntity keeps showing up as null.

     

    However, EntityPlayer.fishEntity is type-protected to EntityFishHook. Which you don't extend. So you will need to alter your class to extend EntityFishHook, or else use IExtendedEntityProperties.

  3. I'm pretty sure that's about as non-rude as I could get..

    And I also gave you the link which would answer your questions I believe?

     

    If they didn't work, then why not mention what you tried and what failed, and since it's not within the scope of this board to do java basics why not use stackexchange or some other page which is made around dealing with basic/general java/programming questions? :)

     

    The method in one of the top links using writer works I have used it before in some of my programs.

    And this from another of the top hits also works fine:

    http://www.java-examples.com/write-int-file-using-dataoutputstream

     

    If you can't get them to work I suggest you open a new project and try to just get this function to work as you wish, then do the reading part as well, after that you should be able to open your modding project and do the same there :)

     

    Heres the code im trying to set up to save and get.

     

    package mods.cyphereion.cyphscape.levels;
    
    import java.io.FileWriter;
    import java.io.Writer;
    
    import org.lwjgl.input.Keyboard;
    
    import cpw.mods.fml.common.registry.GameRegistry;
    import mods.cyphereion.cyphscape.blocks.BlockCopper;
    import mods.cyphereion.cyphscape.core.Core;
    import mods.cyphereion.cyphscape.core.CyphScapeMaterials;
    import net.minecraft.block.Block;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.src.ModLoader;
    import net.minecraft.world.World;
    
    public class Levels {
    
    public static int MiningLevel;
    public static int MiningXp;
    
    public void levelCap(EntityPlayer par1EntityPlayer){
    	if(MiningLevel > 100){
    		MiningLevel = 100;
    	}
    }
    
    public void onUpdate(EntityPlayer par1EntityPlayer) {
    	for (int i = 0; i < 61; i++) {
    		if (MiningXp / 50 == i) {
    			MiningLevel = i;
    
    		}
    
    	}
    }
    
    public int getMiningLevel() {
    	for (int i = 0; i < 61; i++) {
    		if (MiningXp / 50 == i) {
    			return MiningLevel = i;
    		}
    	}
    	return 0;
    
    }
    }
    

    That's going to cause problems if you try to use it on a server. You don't want to save that in a Configuration; you want to use EntityPlayer.registerExtendedProperties().

  4. Title says it. I want to add mod support for some other popular mods, but I don't want them to have to add any code on their end.  How would I check if their mod exists then reference the mods items. I have tried to use methods where my code searches for the mod jar and if it exists then it refers to the items by the ids, but that is not always the most reliable method and will differ from person to person.

    If they're closed-source, you can't. If they're open-source, use reflection. What are the mods?

  5. I'm new to modding in Forge, and now that I have a working 1.5.2 mod I'd like to know how I'd go about updating it to work with Minecraft 1.6.

    So would a lot of us, I think. I didn't know that Forge had been updated yet (to a stable point.)

  6. Hmm, that sounds more like a coremod (or maybe just a mod; I'm not sure that needs to be a coremod) API, rather than a part of Forge. "I think this should be in forge as it would encourage it's use" seems to me to be a bad idea; if such a situation with competing APIs arises it would not be the responsibility of Forge to solve it.

  7. I tried using both 0 and 1, didn't make a difference =/

     

    I dunno then.  There might be a GL11 call you need to make inside the model class.

    Erm, glColor4*(r,g,b,alpha)?

     

    How exactly would I use this? Like I said, I'm a GL Noob completely :P

     

    Looks like that simply sets the colour directly, which is fine- but I need to know where to put it and how to define which part of the model it refers to. Can you help with that? :P

    I dunno. I can use GL, but I haven't tried combining glColor with textures. Try putting it either before or after your "bind texture" statement.

  8. I figured I'd poke this thread as it's the same issue.

     

    Instead of, I don't know, creating a duplicate.

    No, I meant did you have another thread *before* this one was started, so I could look at your code there. I don't know if you have the same problem; as it it I haven't the faintest idea what's wrong with his code. @OP: can you check if getClientGUIElement() is getting called?

  9. I finally got it to work! Here's the code for the whole class, I'm not quite sure how it was different but it works for some reason now:

    package redstone;
    
    import java.util.Random;
    
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.EnumToolMaterial;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.ItemSword;
    import net.minecraft.world.World;
    
    public class RedstoneSword extends ItemSword
    {
    public RedstoneSword(int par1, EnumToolMaterial par2EnumToolMaterial)
    {
    	super(par1, par2EnumToolMaterial);
    }
    
    @Override
    public void updateIcons(IconRegister par1IconRegister) {
    	this.iconIndex = par1IconRegister.registerIcon("quartzTextures:quartzSword");
    }
    
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
    	for(int countparticles = 0; countparticles <= 10; ++countparticles)
    	{
    		par2World.spawnParticle("reddust", par3EntityPlayer.posX + 1, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D);
    	}
    
    	par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
    	return par1ItemStack;
    }
    }
    

     

    But now I have a different problem. The particles only spawn in the same place, which is always 1 block east of the player, no matter where he is looking. I think having the same effect as the potions do would be appropriate. Does anyone know where that is?

    EntityLiving.updatePotionEffects();

  10. Thanks for the help your code worked great for my explosive bow i just had to change a few variables and it was great but i still am having a little trouble with my bows that are made out of the vanilla materials i had some troubles because i am using 4 different items defined in one class using the a custom Enum class just like whats used for swords and tools so im still trying to figure out how i can use your code to apply to this class.

    Ever heard of a period? It looks like this: "." USE IT. Got it? Good. Grammar nazi-ing aside...

     

    Is this a default survival behavior (re #2) that you're trying to remove? If not, I'd like to see how you're registering the entity (although survival/creative behaviour difference is just odd.)

  11. Any updates on this?

     

    I'm having a similar issue.  Things seem to be set up correctly, but the GUI never opens (no crash).  getClientGuiElement in the IGuiHandler never gets called.

    Hum, did you have a thread for it?

  12. Well, the errors are all listed above, but what i can't understand is that everything worked before i started working on this tree. Then while i was working on the tree and kept testing my world creation over and over again to see if i was doing it right, and when the tree was done it was all fine. The water worked once and then crashed i did something wrong there which i then noticed. So i removed it and didn't add any water at all (commented it out) but after that i made another world and it didn't seem to give any problems. Untill the day after when i started it up again suddenly it wouldn't let me create a new world or visit my existing once.

     

    If it is something that is being created a lot i have no idea what, cause i have tried removing this hole tree-file that i made that day. And yet it won't work, while i haven't changed a single other thing. I also tried refreshing my minecraft.jar file and making a new mcp folder + forge etc etc, then run without my mod, everything works fine. I put in my mod files and i get the error again, now i can't even run my minecraft (It just says java heap space error).

     

    Sorry if it is a lot to read. I was just confused when i woke up willing to continue working on that true while all of a sudden it wouldn't work anymore.

    That just sounds like you don't have enough memory on your computer. Or perhaps you have a virus. Either way, there's nothing I can do.

  13. Bump... Please, I don't understand what I have to do to make it work on SMP.

    Line 56 of Alloycraft is...?

     

    public final static Item bootsSteel = new SovSteelBoots(908, steelArmorMaterial2, RenderingRegistry.addNewArmourRendererPrefix("steel"), 3).setUnlocalizedName("steelBoots").setCreativeTab(CreativeTabs.tabCombat);

    This is the first armor line in my main class.

    Oh. Right. Erm, Decebal²? Where are you calling that? Because it's client-only.

  14. I tried to insert a spawnParticle on an item right click and I'm not quite sure what I'm doing wrong:

     

    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
    
    	par2World.spawnParticle("reddust", par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D);
    
    
    	par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
    	return par1ItemStack;
    }
    

     

    The last part with set Item in Use is just so the sword continues to block. It still does nothing, please help.

    Are you sure? It looks like the particles are being spawned inside the player, with no velocity, so it may be that they're being spawned but you can't see them.

  15. Which one of your machinces?!?! I'm looking at the mod files, and there are 3 different machines from what I can see.

    TEProcessor is a superclass of TESC and TEC. Both of them only use 1 input, but it can be easily configured for three.

    Alright, I've looked at the code, however I'm still in the process of learning java, so how would I configure your processor to my liking?

    It's really just a matter of passing multiple arguments into ProcessorRecipeManager.getRecipe(). Assuming you have only three slots, you want something like this:

     

    @Override
    protected boolean dryMergeOutputsAndFeed(){
    	for(int i = 0; i<3; i++){
    		if(this.inventory[i]==null){
    	            this.activeRecipe = null;
    	            this.waitingOutputs = null;
                                return false;
                            }
                    }
    			this.activeRecipe = mymod.prmCrusher.getRecipe(this.inventory);
    			this.waitingOutputs = this.activeRecipe.getOutputs(this);
    			boolean flag = true;
    			if(this.activeRecipe!=null){
    				flag = flag&&this.container.dryMerge(this.waitingOutputs[0],40,42,false)>=this.waitingOutputs[0].stackSize;
    				if(this.waitingOutputs.length==2){
    					flag = flag&&this.container.dryMerge(this.waitingOutputs[1],42,44,false)>=this.waitingOutputs[1].stackSize;
    				}
    				if(flag){
    					this.decrStackSize(i,this.activeRecipe.getInputs()[0].stackSize);
    					return true;
    				}
    			}
    		}
    	}
    	this.activeRecipe = null;
    	this.waitingOutputs = null;
    	return false;
    }
    

     

    The furnace itslef will have 5 slots, but 3 of them will be the items to be smelted. one will be fuel, and the other the output. Is that what this code will help with?

    Yep. Although you will have to put an extra check in there for the fuel. And decrease it as appropriate. Frankly, you might be better off writing your own class :P

  16. Isn't there a method (getBlockTexture) that takes IBlockAccess as a parameter and returns an icon to display?  I was under the impression that the method could be used to grab a block's TE and use data from that to choose a texture to display on a certain side.

    That is indeed true. Just make sure you sync your TE fields with Packets, the client version is usually dumb and holds no data.

    >.>

    Thanks for solving my problem. I thought that method had been removed as of 1.5.2.

×
×
  • Create New...

Important Information

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