
jordan30001
Members-
Posts
157 -
Joined
-
Last visited
Everything posted by jordan30001
-
When the onItemUse() is called from my item I have noticed that it runs twice within the same tick. so if my method is taking 1/20th of a tick to run its actually taking 2-20th of a tick now this may seem redundant as its only 2/20th of a tick but if its running on a server that has 50 people on it and they all use the item at once then it takes 100/20th of a tick to run the method where as if its only running the method once its running 50/20th of a tick which is better because obviously its not needlessly doing things it doesn't need to do twice. How can I detect if the current item has run this method the previous tick or current tick and then not do it without setting the global itemstacks of the same item to do the same I am not 100% sure about this but the onItemRightClick() method sounds like it would do what I want it to do but its missing most of the params that I need to use.
-
read whole topic. there are described two possible solutions (one easy to implement but a bit more damanding by diesieben07, second more optimized approach by me). all data you want to pass you have to wrap into the event object. this is not totally trivial stuff, some programming experience is required... Ok so read it so basically I need to create a new object containing a tick number to know when it must fire this object and then x,y,z,itemStack ect into the object then put that into a list of objects into the tick handler class once the tick counter has hit 0 I then doSomeMethodInMyItem(object)
-
If I used a tick handler and used the onGameTick() method to do some code its parsed no parameters so how would I know what item to execute the code on or what itemstack ect? also items dont have a scheduleUpdate()
-
Please take the time to read what I said so I can help. I am NOT a mind reader, all I can see in your code is blocks with meta data just like most other blocks have
-
you still haven't explained how you are working out what direction the block will be facing with the meta data. are you doing the same as vanilla? meta data n = face up, n + 4 = face north/south n + 8 = face west/east?
-
How would I go about for example with an item on right click they are probably similar so i would only need one explanation but if they are both diffrent can you point me in both directions please. ItemPseudoCodeItem onRightClick doMethod(1); wait 20 ticks doAnotherMethod(""); wait 90 ticks doSomeOtherMethod(true); ItemPseudoCodeBlock onPlace doMethod(1); wait 20 ticks doAnotherMethod(""); wait 90 ticks doSomeOtherMethod(true);
-
if you realy wish to to minimise the amount of item ids your using (that use damage values like pickaxes ect) then you just need to either add nbt data to the item to tell which item it is and let minecraft do the items damage value or make your own damage value and inventory render for the damage value and store that in nbt and use damage value for item switching
-
you would need to make your own player light render because notch hasnt added that due to it causing mass amounts off lag from constant updates on both server/client
-
seeing someone else's code isn't helpful in diagnosing a problem with your code for all we know you misspelled your ore name or you are generating a null block or you are....9000000 different possible errors later. we cant help unless you show us what your code is even if its exactly the same as the tutorial it could still have a slight error in it such as a typo
-
How are you storing your logs meta data for rotations for example the vanilla oak log facing straight up is meta 0 its rotated north/south is meta 4 and rotated east/west is meta 8
-
This goes in your block class public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { int rotation = MathHelper .floor_double((double) ((entityliving.rotationYaw * 4F) / 360F) + 2.5D) & 3; world.setBlockMetadata(i, j, k, rotation - 1); } you may have to toy with the world.setBlockMetaData(i,j, rotation *1*); but it might work straight off haven't tested this.
-
Rendering custom block render in inventory?
jordan30001 replied to jordan30001's topic in Modder Support
Found an answer after lots and lots of googling Here is the link if your also stuck on this and can't find an answer easily http://www.minecraftforum.net/topic/1154044-147forge19213-duckys-modding-tutorials-make-your-blocks-nice/ -
I have a Custom block render model and I am wondering how I would Render the same model in the inventory rather than a "flat" texture I also have the ModelSmith/RenderSmith/TileEntitySmith if needed just ask BlockSmith
-
Spawning a ThowableEntity memory overburdened
jordan30001 replied to jordan30001's topic in Modder Support
I have read it but still don't completely understand what's happening. if only things were not named par1,par2,par3.....par999999999 I could probably read it more easily and understand what its doing -
As long as the mods are put into the folder before FML and forge load it should work due to the mods only loading after FML and forge have loaded I think this would need to be a jar mod in the minecraft Main() Method that first boots up minecraft when the jar is run. for downloading the mod this could be extremly easily (Just downloading the zip/jar file from a website) Here is the major problem you would have headaches with (Adfy.ly links) now the adfy.ly links can be bypassed straight to the download link but if you did that the mod authors would be extremely angry at you. (I am not sure if this is classed as a modpack? and if the mod authors would allow it if its downloading and viewing the adfy.ly advert. for that answer you would have to ask them yourself)
-
I have a new ItemThrowable but when I spawn it and it hits the ground it doest destroy itself and for some reason forge spews out Memory Overburdened messages. sword onUse() w.spawnEntityInWorld(New EntityEnergySpell(w, p)) Main @init InitMod() { EntityRegistry.registerModEntity(EntityEnergySpell.class, "Lightning Bolt", 1, this, 250, 5, false); } public void AddRenderer(Map map) { map.put(EntityEnergySpell.class, new RenderEnergySpell(Item.snowball.getIconFromDamage(0))); } EntityEnerySpell
-
Now that both client and server are servers (world.isRemote()) how can we detect if we are running from server?
-
so if i wanted to bind grass i would use String className = Blockgrass.getClass().getCanonicalName(); but I cannot access it because of the static modifier
-
Ok I tried this and it works perfectly for most mods (major mods) but some of the other major mods (not naming any names) are registering their block names as Null how would I work past this? is there any other name I can grab from somewhere
-
how would i figure out from the blockList what the block is? Reflecting would be de-obfuscating the mod with something like BON (beared octo nemesis) getting rid of everything except the item/block definitions then on post init check to see if the class exists if it doesn't it skips those blocks/items? or is there an easier way?
-
[1.4.7][updated OP] special effects on items
jordan30001 replied to jordan30001's topic in Modder Support
a switch on damage to do what -
[1.4.7][updated OP] special effects on items
jordan30001 replied to jordan30001's topic in Modder Support
So how can I do what I wish to do? -
[1.4.7][updated OP] special effects on items
jordan30001 replied to jordan30001's topic in Modder Support
now on right click I want it to set the 4 variables textureIconIndex selectEffect isOn isInUse and then save them to nbt (only for this one specific item not for every item of the same id) and when the game loads up ect and the variables are reset I want it to read the saved nbt and load it for this specific item public class ItemSword extends Item { private int weaponDamage; private final EnumToolMaterial toolMaterial; private int textureIconIndex = 0; private int selectEffect = 0; private boolean isOn = false; private boolean isInUse = false; public ItemSword(int ID, EnumToolMaterial m, int tex, String name) { super(ID); // The super constructor this.toolMaterial = m; // The material to be used this.maxStackSize = 1; // The max size of the itemstack this.setMaxDamage(m.getMaxUses()); // The durability this.setCreativeTab(Main.tabGems); this.weaponDamage = 4 + toolMaterial.getDamageVsEntity(); // How strong it is on enemies setTextureFile("/testModGFX/Items.png"); this.setIconIndex(tex); // Sets the texture setItemName(name); this.textureIconIndex = tex; } // What must happen when you hit an entity public boolean hitEntity(ItemStack item, EntityLiving e, EntityLiving p) { if (isOn) switch (selectEffect) { case 0: break; case 2: break; default: break; } return true; } // Called on right clicking anywhere public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (isInUse == false) { isInUse = true; if (par1ItemStack.itemID == Main.getSword(0)) this.selectEffect = 1; else if (par1ItemStack.itemID == Main.getSword(1)) this.selectEffect = 2; else if (par1ItemStack.itemID == Main.getSword(2)) this.selectEffect = 3; else if (par1ItemStack.itemID == Main.getSword(3)) this.selectEffect = 4; else this.selectEffect = 0; if (isOn) { this.setIconIndex(textureIconIndex); this.isOn = false; } else switch (selectEffect) { case 0: break; case 2: this.setIconIndex(textureIconIndex + 6); this.isOn = true; break; default: break; } } else { isInUse = false; } writeEffectsToNBT(par1ItemStack); return par1ItemStack; } public ItemStack writeEffectsToNBT(ItemStack item) { NBTTagCompound tag = item.getTagCompound(); if (tag == null) { tag = new NBTTagCompound(); item.setTagCompound(tag); } tag.setBoolean("isOn", isOn); tag.setBoolean("isInUse", isInUse); tag.setInteger("EffectIconIndex", textureIconIndex); tag.setInteger("selectEffect", selectEffect); item.writeToNBT(tag); return item; } } -
[1.4.7][updated OP] special effects on items
jordan30001 replied to jordan30001's topic in Modder Support
so i can read the values when the server restarts ect Ok so I am left with code below but I still get the same nbt stack overload as above public ItemStack writeEffectsToNBT(ItemStack item) { NBTTagCompound tag = item.getTagCompound(); if (tag == null) { tag = new NBTTagCompound(); item.setTagCompound(tag); } tag.setBoolean("isOn", isOn); tag.setBoolean("isInUse", isInUse); tag.setInteger("EffectIconIndex", textureIconIndex); tag.setInteger("selectEffect", selectEffect); item.writeToNBT(tag); return item; } -
[1.4.7][updated OP] special effects on items
jordan30001 replied to jordan30001's topic in Modder Support
How can I read it then?