Jump to content

pelep

Members
  • Posts

    107
  • Joined

Everything posted by pelep

  1. you don't need to create two blocks for this; i'm pretty sure this would work already: public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { return world.isBlockProvidingPowerTo(x, y + 1, z, whateverthecorrectvalueforthesideis) || world.isBlockProvidingPowerTo(x, y - 1, z, whateverthecorrectvalueforthesideis) || checkanotherside || checkanotherside || blablablab; } regarding the not shutting off thing, your poles are powering each other up most likely. and i don't think what gotolink suggested will work. not sure, but give it a try though. if it doesn't, then you're probably gonna need more checks like "is this pole getting powered?" then "if it is, is it getting powered by something that isn't being powered by this pole?"
  2. well, the new launcher has a dev console and there's an option in the profile editor to stop it from auto closing. that way you won't need to look for the log file every time, but you'd still need to do all the other stuff..
  3. well, i know of one way, but i don't use it. forge injects the data through injectData(Map) in your IFMLLoadingPlugin class, but the last time i tried using it, it was called after the transformers started running. so, if the class you want to modify was "modified" before the data's injected, you miss your chance for that class. i got too lazy too keep digging around after that, so the way i do it now is i have a boolean in the constructor of my transformer which i manually change every time before i recompile. if you find out another way to do it, feel free to tell me hahah EDIT: i just looked into it now, and it might have changed. it seems to be called before the transformers are ran now. gonna have to look around the stuff first to see if it really is. if it is... <3
  4. haha no worries. and just a heads-up: once you get your asm stuff running in your dev environment, compiling it is gonna be a bitch. you're gonna have to get the obfuscated names of the classes that you used in the lines you injected. nothing difficult, but soooo f*cking tedious .___.
  5. copy paste? wait. what? i'm lost. who said anything about copy-pasting? lol.
  6. sure, though i think you'd be able to get the info you need in his source already. if you need more help, you can pm me, but just so you know, even though i've used asm, i'm in no way an expert in it. so... nothing too huge please. lol
  7. well, you can actually do what mazetar said. should be easy enough with the eclipse plugin. you can also check out dynamic light's source (atomic stryker). he does some modifications to the World.class to get his mod working. if you still need help after that, i can help if all you're all you're doing is what you listed above and nothing else too extravagant
  8. Well, in case you didn't know, once you rotate the object, the axes rotate along with it. So if you rotate the model along the x-axis, you change the y and z axes. I suggest you start out with only one line of glrotate and then add more of them if you need to rotate it again in a different axis
  9. regarding the angle thing, you can figure out which one it is by yourself really. just play around with the GL11.glRotatef(angle, x, y, z) parts until you figure out which axis is which. regarding the texture, make sure the location of the texture that you put is correct and that your texture is actually there. if that doesn't work, maybe try RenderBlocks renderBlocks = (RenderBlocks) data[0]; renderBlocks.minecraftRB.renderEngine.func_110577_a(ResourceLocation); instead of Minecraft.getMinecraft().renderEngine.func_110577_a(ResourceLocation);
  10. *facepalm* you don't even need to know java to solve that. all you need is common sense. if you seriously can't figure out what you did wrong.. here..
  11. because you're telling it not to render it in 3d @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED: return true; default: return false; } } include EQUIPPED_FIRST_PERSON in there
  12. woops. didn't see that "while(!blabla.isDone)" part at first. anyway, i was just clarifying
  13. sorry for hijacking this thread (no pun intended), but @hydroflame, wouldn't there be two threads running if you create a new thread (the main mc thread and the new one you created)? correct me if i'm wrong, but wouldn't the main mc thread continue running whether or not the new one's finished (it's a new separate thread after all)?
  14. i doubt that has any direct involvement in it. that just sets the attack target. check the other tasks you added (if you added anything else) or just try to find anything that sets the movement speed of your mob
  15. i'm too lazy to check what class it is, but yes, it's the obfuscated name of some class, and yes, you need to change it. you need to find out the obfuscated name of World.class and use that. so, for example: if World.class's obfuscated name is "asdfasdf.class" (Lnet/minecraft/world/World;Ljava/util/Random;II)V will turn into (Lasdfasdf;Ljava/util/Random;II)V that goes for all classes that get obfuscated. EDIT: if i remember right, "arg1" in public byte[] transform(String arg0, String arg1, byte[] arg2) is already the unobfuscated name. if it is, that would make things much easier. normally, i use the obfuscated names whenever i recompile and run my coremods in mc. i don't remember why i opted not to use that second argument. i'll have to look into again and do some testing to see if it is and if it's safe. i'll get back here if i find anything useful
  16. dude....... you're returning null in @Override public byte[] transform(String arg0, String arg1, byte[] arg2) { if (arg0.equals("acv")) { System.out.println("******** INSIDE OBFUSCATED BIOMEGENDESERT TRANSFORMER ABOUT TO PATCH: " + arg0); try { return patch("a", arg2, "(Lue;)V", "/net/sep87x/desertwells/ASMMethods.class", "decorate"); } catch (IOException e) { e.printStackTrace(); } } if (arg0.equals("net.minecraft.world.biome.BiomeGenDesert")) { System.out.println("******** INSIDE BIOMEGENDESERT TRANSFORMER ABOUT TO PATCH: " + arg0); try { return patch("decorate", arg2, "(Lnet/minecraft/world/World;Ljava/util/Random;II)V", "/net/sep87x/desertwells/ASMMethods.class", "decorate"); } catch (IOException e) { e.printStackTrace(); } } return null; } change that "return null" to "return arg2"
  17. Means you're not registering your tile entity. I forget what class it's in, but the method is something like registerTileEntity(Class). I don't remember exactly what, but it should be easy to find Edit: it's in GameRegistry
  18. My mod does the same thing the damage values. solved the animation thing by making it a coremod and editing updateEquipedItem() ("Equipped" was spelled wrong, if i remember correctly) in ItemRenderer.class (not sure if it was in that class, i don't have my laptop with me right now so i can't check). if you find a better way of keeping track of the damage, let me know!
  19. ...you completely missed the point, so forget it. anyway, i never said crafting handlers wouldn't work. i just said they were unnecessary in his case
  20. well, to be honest, i didn't test it all the way until the item went past the max damage.. kinda got too lazy. lol. anyway, just checked it now and you're right. @OP just take this part out if (ist.getItemDamage() > ist.getMaxDamage()) { ist = null; }
  21. @deadrecon98, did you even read his post? you posted exactly the same code he was already using @OP just do a combination of what guff and moritz said. don't use a crafting handler since you don't need one. use hasContainerItem and getContainerItemStack like guff said. and like moritz said, you don't need the for loop when registering the recipe. but, you don't need to register the item in the way moritz suggested since you're already overriding getContainerItemStack(ItemStack). anyway, wrote the following to make absolutely sure it works and it does. just replace the stuff there with what you need. if you want it to stay in the crafting grid, use doesContainerItemLeaveCraftingGrid(ItemStack) package pelep.zzzzz; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "ZZZZZ", name = "ZZZZZ", version = "ZZZZZ") public class ZZZZZ { @Instance("ZZZZZ") public static ZZZZZ instance; @EventHandler public void init(FMLInitializationEvent e) { GameRegistry.registerItem(new ItemDamageable(ID), "itemDamageable"); GameRegistry.addRecipe(new ItemStack(1, 1, 0), new Object[] {"d", 'd', new ItemStack(IDSHIFTEDINDEX, 1, OreDictionary.WILDCARD_VALUE)}); } } package pelep.zzzzz; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class ItemDamageable extends Item { public ItemDamageable(int id) { super(id); this.setMaxDamage(64); } @Override public boolean hasContainerItem() { return true; } @Override public ItemStack getContainerItemStack(ItemStack ist) { ist.setItemDamage(ist.getItemDamage() + 1); if (ist.getItemDamage() > ist.getMaxDamage()) { ist = null; } return ist; } }
  22. if you actually read and understood the code, you'd know it's for blocks. almost all the vanilla blocks use that class. if you wanna make sure what you made is clean and if you wanna understand better how vanilla mc places its blocks down, here are some things you can do: if you're patient and thorough enough, start at clickMouse(int par1) in Minecraft.class. follow and understand the code until you reach the point where it tries to use an item (or place a block down). it might take a while, but you'd get a pretty good understanding of how blocks are placed after you do that. or you can try making a new block for testing. just a plain basic one and then create your own item for it that extends ItemBlock (doesn't have to be a subclass of ItemBlock if you know what you're doing). then play around with both your item class and your block class to see how they work together. canPlaceItemBlockAt is probably not working for you because you're probably already doing something else that's messing it up. which is why i suggest making a new block for testing (something clean). of course you can just stick with what you have since you say it's working already, but then i doubt you really understand why it's working. it could help loads in the future if you really understand what's happening
×
×
  • Create New...

Important Information

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