Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

sigurd4

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by sigurd4

  1. My item is a bauble, and i want to have full control over what properties it has and doesn't have. There are things that vanilla armor does that i may not want mine to do. Regardless, i figure this would be useful for a whole lot of other stuff where one might want an enchantment to be available for an item that doesn't extend any of the classes that are checked for. It would just be really nice to have control over this kind of thing. Also, i don't see how this would break anything. It should be perfectly capatible with earlier mods, and there are already plenty of similar hooks for other things to allow more control over otherwise unchangable vanilla functionalities.
  2. i could make my own algoritm for adding random enchantments, though the problem with that is that this algoritm would not be used when the item is enchanted trough an enchantment table, which is kinda what i want.
  3. well, it is possible already by using ItemStack.addEnchantment(), but the standard enchantment table can't do it as it will always check if wether or not the enchantment is valid. i don't think it's gonna be a massive problem at all! and if a modder makes some enchantments do some wierd funky stuff then that is on them, not forge. also i used to mess around with changing nbt tags in vanilla to stuff it shouldn't be and, for example, adding enchantments to an item that shouldn't work on it. adding, say, sharpness to a piece of armor will simply increase the damage dealt when you attack with the armor item (lol), nothing crashes or dies horribly in a fire or anything, so don't worry.
  4. here's a link to my modder support post that i made for asking if this was already a thing: http://www.minecraftforge.net/forum/index.php/topic,33398.0.html what i basically wanted to do was to allow vanilla, armor-specific enchantments to be applied to an item that doesn't extend ItemArmor. this is handled in net.minecraft.enchantment.EnumEnchantmentType.canEnchantItem() and there's nothing i can do about it because there are no hooks, events, interfaces or anything for it. so i suggest: a function in net.minecraft.item.Item kind of like this, that can be overridden and done whatever with (and would be called instead of EnumEnchantmentType.canEnchantItem()): public boolean isEnchantmentValid(Enchantment ench) { return ench.type.canEnchantItem(this); } [/Code] or an event that is called after EnumEnchantmentType.canEnchantItem() is, where one can change the value of it. the advantage of this would be that a mod could change the value for items that aren't a part of said mod (vanilla items or from other mods). or an interface that would basically work the same as the hook described in the first point, except it's an interface. EnumEnchantmentType.canEnchantItem() would now look like this: [Code] public boolean canEnchantItem(Item p_77557_1_) { if(p_77557_1_ instanceof IItemCustomEnchantsSomethingabob) { return ((IItemCustomEnchantsSomethingabob)p_77557_1_ ).isEnchantmentValid(this) //here the argument is an EnumEnchantmentType, not an Enchantment cuz why not } and then all the other stuff... [/Code] it would really make my life a whole lot easier.
  5. jeez really? i feel like i should suggest for the forge guys to add a hook or something like that for this. but thanks, though. i'll add one for every single vanilla enchantment for now. oh well. EDIT: just gonna put this here: http://www.minecraftforge.net/forum/index.php/topic,33408
  6. i have a bauble that i want to enchant with vanilla enchantments trough an enchantment table, but i do not want my item to extend ItemArmor. however the code for checking wether or not an enchantment is valid for in item checks if the item extends the classes ItemArmor, ItemSword, Item etc. and doesn't call an event or anything like that. the same thing would apply if i were to add a sword or or something that i don't want to extend ItemSword for some reason. is there a way to do this? i've been looking for an event or hook or such but i can't find one.
  7. You might be aware of the animation that happens when you switch to another item in the hotbar. The item bobs down, then up. Something that I find fairly annoying is that this animation also happens whenever any nbt data of the held itemstack is set. My item changes nbt data very frequently, so it gets somewhat frustrating. Therefore I would prefer if there was a way to prevent this animation. I found this other post (http://www.minecraftforge.net/forum/index.php?topic=28710.0) that asks about the same thing, but is without a proper answer, most likely due to the misunderstanding caused by his unclear language. I really didn't get the information I needed from it, and thus I made this post.
  8. like with stone, graphite, andesite etc. i found the code that does it in vanilla in net.minecraft.item.Item.registerItems(). it seems to be in the registration of the item of the block that you can choose to use a different unlocalized name based on itemstack, which again makes it possible to check for blockstate properties. registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() { private static final String __OBFID = "CL_00002178"; public String apply(ItemStack stack) { return BlockStone.EnumType.byMetadata(stack.getMetadata()).getUnlocalizedName(); } public Object apply(Object p_apply_1_) { return this.apply((ItemStack)p_apply_1_); } })).setUnlocalizedName("stone")); however, this is impossible to do this way since forge's block registration thing seemingly won't allow this (i've looked in net.minecraftforge.fml.common.registry.GameRegistry). i might just be bad at searching, but i seriously have no idea what to do. or is there a much simpler way that i've overlooked?
  9. well nvm... i wont bother with that just for such a little detail.
  10. that's not really helpful at all. doesn't shaders change the rendering stuff for everything? because i only want the steve in the bottom-right corner to be in greyscale. also, i have no idea on how to make a new shader, though i have altered the vanilla ones before (without quite understanding what i was doing). surely there's an easier way?
  11. i've made a gui where i render a texture, but i want it to automatically be in greyscale, or preferably in an amber-like colour. this is what it looks like currently: it uses the skin of the owner of the item, thus i cannot alter the texture. i'm not very familiar with openGL, but i know how to do some things, like render 2D textures, change brightness of the image, change renderpass, rotate and offset, but not how to do this. i've been trying out the GL11.glColor3f() function, but i don't quite inderstand it yet. (i thought the three different values were rgb, but doing a bit of testing it doesnt seem like this is the case.) how do i do this?
  12. thank you! i can't believe i didnt see that. fyi im spawning a redstone particle for a laserbeam that i made. it's pretty neat.
  13. currently, other than spawning them, i havent really been messing around with particles yet. how would i go about making my particle render from further away from the player? is that possible? there are two alternatives i can think of at the moment (i dont know much about this) 1: make a new particle extending the one i use, but set to be rendered from further away (i have no idea how to do that, though, and if there is an easier way i'd prefer that), 2: use something i've only heard about, called tesselator (or something like that), which allows me to do rendering-related stuff. is there another way? which is simplest? and how would i go about doing that?
  14. do you actually need to register it like that? i get the same messages in my log regardless. i thought that was just in the really early 1.8 builds
  15. i can't get it to work either, but from what i understand, for items you need a model file with the name of the string item id like this: (<modid> is the mod id of your mod, <itemid> is the string item id of your item, same with <blockid> but for your block, <texture> is the name of your texture file without ".png", <model> is the string entered into the blockstate file) /src/main/resources/assets/<modid>/models/item/<itemid>.json: { "parent": "builtin/generated", "textures": { "layer0": "<modid>:items/<texture>" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } and for blocks you need both a blockstate file which has the name of the string block id and a model file. /src/main/resources/assets/<modid>/blockstates/<blockid>.json: { "variants": { "normal": [ { "model": "<model>" }, { "model": "<model>", "y": 90 }, { "model": "<model>", "y": 180 }, { "model": "<model>", "y": 270 } ] } } /src/main/resources/assets/<modid>/models/block/<model>.json: { "parent": "block/cube_all", "textures": { "all": "blocks/<texture>" } } hope this helped. it's not working for me for some reason, but it might do for you. this is the way i've seen most other people do it. also the unlocalizedName doesnt affect the texture, the id does
  16. ok, so i cleaned my workspace and installed the most recent version of forge. i had no issues in the installation process and i am perfectly able to build my workspace. the problem is still the same... :,(
  17. what is that? EDIT: no. i'm using eclipse
  18. no. i did when i changed the name of the json file. if i changed the string in the texture registration thing it didnt change anything. fml? ok i moved my src folder into a new folder that i named fml and made it like you described, then added \fml\src\main\resources and \fml\src\main\java to the build path. didn't do any difference. will try this. i'll come back once i've done it. thanks. this update has been a lot of trouble for me. hopefully it'll work after i clean my workspace. done that for a long time ago.
  19. yes exactly. also, i notice that your unlocalizedName is the same as the item string id, so that makes sense. another thing: i /* */ed out the whole model registering stuff and it seemed to still look after the model. isn't that strange? do i actually need to register the item like that? the string i put in the register code does not seem to affect anything. then i tried changing the unlocalizedName to match the id, yet i have the same problem (yes, i tried making a new world).
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.