Jump to content

Xcox123

Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by Xcox123

  1. My intentions for my code is that when I right click a block, an arrow appears over it(not the final version of course ). I followed a tutorial and the code is this: However, this code renders the item in the players head. I know why(entItem is calling .thePlayer) but what do I change this to, to make it render on top of the block?
  2. Okay guys, I fixed it! Apperantly Eclipse didn't want to accept my string, deleting the whole line and retyping it fixed the problem!
  3. No, like I have said, it comes up with an error as it's not allowed to be there(this is 1.6.4 btw, if you're getting confused with 1.7) My NOT working code(based on what has been said): @Mod(modid = "TinkersTweaks", name = "Tinkers Tweaks", version = "1.1.1") public class tinkerstweaks { @NetworkMod(clientSideRequired = true, serverSideRequired = false) } My WORKING code(with NetworkMod not in the class): @Mod(modid = morefoodmod.modid, name = "More Food Mod", version = "1.1.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) So NetworkMod should be outside my class(it works for me on my other mod)
  4. Nope. "The annotation @NetworkMod is disallowed for this location". And the one that I have working is set out like the one I posted in my original post. Fyi, here is the working code(uses a declared string rather than a straight up string, doesn't work with either): @Mod(modid = morefoodmod.modid, name = "More Food Mod", version = "1.1.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class morefoodmod { public static final String modid = "morefoodmod"; }
  5. Firstly, before you tell me to go and look up a tutorial, I have a working code next to me(I'm starting work on my second mod). The problem is when I'm originaly doing @Mod, It doesn't "work". By that, I mean theres no errors, but things don't "click". I don't know how to describe this very well, but if you're working in eclipse you'll understand this - the @Mod doesn't go gray. Heres the thing: @Mod(modid = "TinkersTweaks", name = "Tinkers Tweaks", version = "1.1.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) Again, I have a working example next to me here, but this doesn't work for some reason, can someone help?
  6. Thanks for the help So should I put the render code into the TileEntity class that I have? I have moved my code into the only class that extends TileEntitySpecialRenderer, which is my Render class for my custom model. I am currently calling it in onBlockActivated, with a if(!world.isRemote)to open the gui and then a if(player.getCurrentEquippedItem() != null) to detect if theres an item in hand. If there is, it runs the render code. So where should I call my render code if onBlockActivated is bad?
  7. Not sure if this has anything to do with it, but are you defining a spawn biome? Because just before the crash the console says "[14:27:46] [server thread/WARN]: Unable to find spawn biome" Again, this may be totally unrealated, but just checking
  8. I am using this code in the onBlockActivated method, but whenever I right click the block, it gives the following crash error: java.lang.RuntimeException: No OpenGL context found in the current thread. I have no experience at all with OpenGL, anyone got a suggestion?
  9. ItemFood: package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemFood extends Item { /** Number of ticks to run while 'EnumAction'ing until result. */ public final int itemUseDuration; /** The amount this food item heals the player. */ private final int healAmount; private final float saturationModifier; /** Whether wolves like this food (true for raw and cooked porkchop). */ private final boolean isWolfsFavoriteMeat; /** * If this field is true, the food can be consumed even if the player don't need to eat. */ private boolean alwaysEdible; /** * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect */ private int potionId; /** set by setPotionEffect */ private int potionDuration; /** set by setPotionEffect */ private int potionAmplifier; /** probably of the set potion effect occurring */ private float potionEffectProbability; public ItemFood(int par1, int par2, float par3, boolean par4) { super(par1); this.itemUseDuration = 32; this.healAmount = par2; this.isWolfsFavoriteMeat = par4; this.saturationModifier = par3; this.setCreativeTab(CreativeTabs.tabFood); } public ItemFood(int par1, int par2, boolean par3) { this(par1, par2, 0.6F, par3); } public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { --par1ItemStack.stackSize; par3EntityPlayer.getFoodStats().addStats(this); par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); this.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); return par1ItemStack; } protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); } } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 32; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.eat; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (par3EntityPlayer.canEat(this.alwaysEdible)) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); } return par1ItemStack; } public int getHealAmount() { return this.healAmount; } /** * gets the saturationModifier of the ItemFood */ public float getSaturationModifier() { return this.saturationModifier; } /** * Whether wolves like this food (true for raw and cooked porkchop). */ public boolean isWolfsFavoriteMeat() { return this.isWolfsFavoriteMeat; } /** * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, * float probability of effect happening */ public ItemFood setPotionEffect(int par1, int par2, int par3, float par4) { this.potionId = par1; this.potionDuration = par2; this.potionAmplifier = par3; this.potionEffectProbability = par4; return this; } /** * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. */ public ItemFood setAlwaysEdible() { this.alwaysEdible = true; return this; } }
  10. Thanks!!! I know this is prob a noob question(sorry) but what is "is" ("while (renderPass < is.getItem().getRenderPasses(is.getItemDamage()));")
  11. First, sorry for the bad title, couldn't think of how to word it Basically, what I want is, that when I right click a block with any item, the item renders (maybe spinning if thats possible) on top of the block. An example of this is in Thaumcraft's infusion alter. When you right click an item onto it, to renders on top of it, but isn't a pickupable entity. Anyone got a suggestion for how I should go about doing this?
  12. @sequituri, In what way is it worthless? He asked for a tutorial. Admitidly, I didn't explain everything, but it's not too hard to figure out. I did specificly say that the code was 1.6.4, and that there was going to be errors. But I'm the only person here who bothered to help. However, with a bit of modifying on their side, it can work. So, my post was in no way "worthless and incorrect", it showed him/her the basic way to add a recipie for a special GUI, and thats what I did. He/her didn't ask for any big explanations on anything.
  13. What do you mean by Custom Rendered Item? Is that a Custom Rendered Block but rendering in hand, or what?
  14. Also, that code is made for 1.6.4 - so there is gonna be some errors most likely. Can you just google em, don't know any 1.7 fixes
  15. Okay, this may or may not be a long post This took me hours of figuring out, so I hope this helps Now, in your TileEntity class(I hope you have one ) you should have a line something like this(if you don't make one, say if you want the full method code : ItemStack itemstack = BlenderRecipies.getSmeltingResult(ITEMSTACKNAME[0].getItem().itemID, ITEMSTACKNAME[1].getItem().itemID); Now, change the varibles to your coresponding varibles. Now, you have to fiddle around with that line of code. Pretty self-explanatory, but add ITEMSTACKNAME[0].getItem().itemID as many times as slots you have in your gui(input), but change the array. For instance, your third one would be ITEMSTACKNAME[2].getItem().itemID , and so on. Bear in mind the code I pasted is for a two slot input. You don't want the BlenderRecipies part, so make your own class called whatever you like(I'd recommend something like BLOCKNAMERecipies) And paste this code inside the class: public CLASSNAME() { } public static ItemStack getSmeltingResult(int i, int j, int k, int l, int m) { return getOutput(i, j, k, l, m); } private static ItemStack getOutput(int i, int j, int k, int l, int m) { } Now inside getOutput, you'll want a bunch of if statments(I guess you could do a for loop, but if statments are a lot easier) for your Recipies. I'm not going to explain how it works, it's extremely easy to see what it does just by looking at it. Here is an example: if(i == MainModdingFile.ITEMNAME.itemID && j == MainModdingFile.ITEMNAME.itemID && k == MainModdingFile.ITEMNAME.itemID && l == MainModdingFile.ITEMNAME.itemID && m == MainModdingFile.ITEMNAME.itemID{ return new ItemStack(MainModdingFile.ITEMNAME); } Bear in mind, that this only works if the items are in a particular order, if you want a "shapeless recipie" as it could be called, you can use || (OR in boolean) to do that. Here are two examples, one of a basic recipe, and one for a shapeless recipe. BASIC: if(i == morefoodmod.ItemBanana.itemID && j == morefoodmod.ItemStrawberry.itemID){ return new ItemStack(morefoodmod.ItemStrawberryBananaSmoothie); } SHAPELESS: if(i == morefoodmod.ItemBanana.itemID && j == morefoodmod.ItemStrawberry.itemID || i == morefoodmod.ItemStrawberry.itemID && j == morefoodmod.ItemBanana.itemID){ return new ItemStack(morefoodmod.ItemStrawberryBananaSmoothie); } I hope this helps a bit
  16. Thanks for the help I made a really nooby mistake, I was checking if the block I'm placing is block id 30(x + 0, y + 0, z + 0) *facepalms*
  17. Sorry for bumping, but been stuck with this for an hour now, still no luck
  18. Then report this to the mod maker. We can't fix this at all.
  19. did you make the mod thats causing the error? if so, find where you placed an enchantment id, and if there's 2 of them, remove one. simple
  20. Yeah. To be honest though, the tutorial that I followed ( ) used his own multiblock maker program. It's the only one that I can find that works, only the program doesn't work! The code I got is based of pausing the video and finding a pattern in the code, so I can understand why he didn't explain it. However, can someone explain how to solve it?
  21. Hey, I'm making a multiblock with the .getBlockId method. It all compiles beautifully, however, how do I set where my "main" block is(the one I right click). I understand how the method works okay, but the tutorial I followed didn't explain how to set the "main" block. I understand how this is probally basic java, however I don't understand. I want my main block to be as showed - where S is the other blocks, and M is the "main" block: SSS SSS SSS /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ SSS SSS SMS /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ SSS SSS SSS /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ in 3D layered order. My code is like so: http://paste.ofcode.org/a6Cj9u63iQWkQ9yqDyAHxS
  22. I have been following a tutorial and in their recipie class, they use the import import bcblocks.twoinputfurnace.InputFurnace; When I do this however, it says that bcblocks doesn't exist, has this import changed it's name, or did it get removed, or did the person making the tutorial make bcblocks and didn't say? This is the tutorial: http://www.minecraftforum.net/topic/1924178-forge-164-micros-furnace-tutorials-will-update-all-parts-to-164/ The tutorial is 1.6.2, did it change in 1.6.4 maybe? No results for it show on Google.
×
×
  • Create New...

Important Information

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