
UberAffe
Forge Modder-
Posts
316 -
Joined
-
Last visited
Everything posted by UberAffe
-
[1.7.10]hotswapping armor sets to gain multiple effects
UberAffe replied to UberAffe's topic in Modder Support
If you are not sure why "I" want to do this it is, one example is thaumcrafts goggles of revealing, being able to see nodes and still have a decent helmet for protection. Do you know of any decent tutorials for using extendedproperties? I haven't touched those yet. -
Ah, didn't know about that. Guess that's what happens when an inexperienced person(myself) try's to help. I probably should have pointed him here from the start.
-
I am making a mod that in effect lets a player wear multiple armor sets, Ideally I want this to work "out of the box" with other mods. Right now I have it so on each armor tick of my mod's armor it loops through the armor sets swaping them out on the player and calling their armor tick methods, and eventually putting my mod armor back on. This works fine for tick based things but a lot of armor sets do stuff based on forge events not just ticks. So my idea for how to handle this: copy of original health and armor damage values for each event that fires for the player put a copy of one of the sets on the player do the necessary steps to create this event for the player with the alternate set if player is wearing the first set copy player health and all armor damages if player health is more than copy copy player health and all damage value set player health and all armor damages to original put the original armor set back on. set player health and damage values to copy theoretically this results in the best outcome among the armor sets I should mention that there is a fairly large energy cost required for any of this to run and the cost grows exponentially for each additional armor set, a single user will likely not use more than 2 or 3. I will be working on implementing this but it would be nice to know if this idea is even plausible or if I need to stop and figure out a different way. Edit1:an example of necessary steps to fire an event for LivingHurtEvent attack the target(player) from damage source(source) which would set off a new chain of events but wouldn't create a loop because my event catch wouldn't trigger because the player isn't wearing my mod armor Edit2: slight update to idea
-
Metadata, it gets passed as a parameter to the getIIcon method(assuming you are in 1.7.10). You can control the metadata value anywhere you have access to the ItemStack (onItemRightClick) and in you getIIcon method you would return a different thing based on the metaData. You might have to override a lot of other methods like damaging an item, so that damage values are held in NBT instead of metadata.
-
I haven't looked at 1.8 yet, are the render classes more or less handled the same? Do I set up the environment the same way as 7 just with the new forge version? And I'll take a look at that and see if I can make sense of it. Still questioning the GhostPlayer setup, if someone has a better one they can suggest I welcome it. Also edited in a link to the mod description if anyone is curious what extra functionality means.
-
getItemStackDisplayName equivalent for blocks?
UberAffe replied to nano1000's topic in Modder Support
Depending on why your want to do this there may be a far simpler way ... are you just doing this so that it doesn't display as modid.ble.ble.item.name? if so look up how to make a lang file. -
I am working on a mod that add's some armor stands and some special functionality with them. I know there are other mods that add armor stands and have figured out how to render the armor on top of the stands, and I have asked some of them if they would share their method for rendering the armor but I haven't gotten a response yet. So my question is this: Can someone point me to an example that I could look at the code for, explain how to if you know? How I am currently trying to get this to work: I have a blockcontainer with a TE that has its own renderer. The stand renders properly. To render the armor I am working on creating a "Ghost player" that is invisible but would "wear" the armor and be in the same position as the stand, so the armor gets rendered in that position. ^this doesn't seem like an even moderately decent way of implementing it but I haven't found any useful information yet and this is my solution until I do. mod description for those curious: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/requests-ideas-for-mods/2498910-armerger
-
Will this be able to rotate on a non-standard axis or is that up to the renderer? For instance seeing the block rotate on a point so you can see all faces(top and bottom)
-
Alright, I'll switch it up for the one I'll be maintaining, but I'm still going to work through it as an enum on the side so I can try and get an understanding of exactly how reflection works. Thanks for the responses.
-
I agree that it is probably a better solution and far easier to implement but I am not doing this for simplicity. I am doing this to learn more about java and how certain things are handled in Forge.
-
I know there are easier ways to accomplish this but I want to continue trying it this way to learn a bit about how java works deep down and for general experience/knowledge. My current Enum: public static enum SWORDTYPES { COAL("coalsword", 1, 131, 4.0F, 1.0F, 5, Blocks.coal_ore, new CoalEffect()),//oreswords_coalsword DIAMOND("diamondsword", 3, 1200, 8.0F, 3.0F, 30, Blocks.diamond_ore, null),//oreswords_diamondsword EMERALD("emeraldsword", 3, 2300, 8.0F, 4.0F, 10, Blocks.emerald_ore, null),//oreswords_emeraldsword GOLD("goldsword", 0, 25, 10.0F, 1.0F, 12, Blocks.gold_ore, null),//oreswords_goldsword IRON("ironsword", 2, 131, 6.0F, 2.0F, 14, Blocks.iron_ore, null),//oreswords_ironsword LAPIS("lapissword", 1, 131, 4.0F, 1.0F, 44, Blocks.lapis_ore, null),//oreswords_lapissword QUARTZ("quartzsword", 3, 131, 8.0F, 3.0F, 10, Blocks.quartz_ore, null),//oreswords_quartzsword REDSTONE("redstonesword", 2, 131, 6.0F, 2.0F, 14, Blocks.redstone_ore, null);//oreswords_redstonesword private String name; private ToolMaterial mat; private Block cType; private OreSword sword; private SwordEffect effect; SWORDTYPES(String name, int hLevel, int mUse, float effic, float damage, int ench, Block cType, SwordEffect effect) { this.name = name; this.cType = cType; this.mat = EnumHelper.addToolMaterial(name, hLevel, mUse, effic, damage, ench); this.effect = effect; } public String getName(){return name;} public ToolMaterial getMaterial(){return mat;} public Block getCraftingMaterial(){return cType;} public void doEffect(ItemStack sword, EntityLivingBase target, EntityLivingBase self){effect.doEffect(sword, target, self);} public void setSword(OreSword sword) { this.sword = sword; swordMap.put(sword.getUnlocalizedName(), this); } public OreSword getSword(){return sword;} } I implement my swords this way because it made it very easy to add new swords and it made the registry look very clean! in preInit() for(SWORDTYPES sword : SWORDTYPES.values()) GameRegistry.registerItem(new OreSword(sword), References.MODID + "_" + sword.getName()); in init() for(SWORDTYPES sword : SWORDTYPES.values()) GameRegistry.addRecipe(new ItemStack(sword.getSword()), " C ", " C ", " H ", 'C', sword.getCraftingMaterial(), 'H', hilt); I am now running into a lot of confusion though. I want to make an api that allows people to make swords out of modded ores. What I am trying to do to accomplish this is to let them add new enum values and my code would take care of the rest. Looking through the EnumHelper class, it seems like I could use it if I had a way to add my enum to the commonTypes variable. Is there a way to do this without setting up my own reflectionhelper just to add a variable or do I need to make my own SwordEnumHelper? If this isn't currently possible, will there be support for mod enums later on?
-
I hope you found it before this, it was the first link I found when googleing the title of your question. But if you didn't minecraft forum: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1282349-mrcrayfishs-furniture-mod-v3-4-8-the-kitchen personal site: http://www.mrcrayfish.com/mods.php?id=cfm
-
Will it be able to render items that have models? like the crossbows from some mods? And I like the rotating, it looks nice!
-
Yea, it is pretty easy to get set up there and it makes for a convenient repository of releases. I am following your project on curse so when you get an update out I can take a look at it. Side Note: the mod I am working on won't be done for quite a while but I'll make sure to send you link it and any others I make that use this.
-
I am working on a mod that will allow the user to create a model in game, I know how to do the registration to allow this but I haven't worked out a good interface to allow it. Does the render entity work for any model (sword/machine/mob)?Does the model have to be registered to work, or can I just pass it a model as a param? Also I recommend adding this to curse forge, it will give it more visibility, unless you have an ad.fly link for the download.
-
According to your log there is a problem with your BlockRenderRegister at captainash123.betamod.client.render.blocks.BlockRenderRegister.reg(BlockRenderRegister.java:49) at captainash123.betamod.client.render.blocks.BlockRenderRegister.registerBlockRenderer(BlockRenderRegister.java:23) I haven't worked much with rendering but it seems like that is the problem, even if eclipse doesn't put red lines under it. Things to check: If that code reference any files(.json or otherwise) make sure that it is in the correct folder and that all folders are named properly Make sure that you are not accidentally referencing a null variable(check the functions that call on this class) Possible trouble shooting methods: put a breakpoint in your BlockRenderRegister class and your BetaMod class That should help you narrow down exactly where it is breaking In the Expressions tab, watch some variables to see check that they are the value you expect them to be.
-
I may disagree with how diesieben07 comes across, but he is right. It is fine to access information from outside of this class but just as a rule of thumb, never use public variables. It is ALWAYS better to use a private variable with getters and setters. The only "variables" that should ever be public are const, and static final. If you read through the link that ernio gave earlier you can see that he uses a private variable and later on he goes through how to use it. SideNote: if you want help fixing up your github let me know.
-
1.7.10 Confusion with DamageSource and LivingAttackEvent
UberAffe replied to UberAffe's topic in Modder Support
Just found this post http://www.minecraftforge.net/forum/index.php?topic=10794.0 Which if the LivingHurtEvent still works the same way, I can avoid having to cancel and send new information. I'll have to test when I get home but I should just be able to alter the damage amount parameter and let everything continue. BTW, this is what I had been doing: read event information, create altered parameters, cancel the event, post new event with altered parameters. -
1.7.10 Confusion with DamageSource and LivingAttackEvent
UberAffe replied to UberAffe's topic in Modder Support
I hadn't meant to post that yet, it was edited while you posted this, and I did find those implementations, but thanks for the quick response! And looking at the edited response I have an additional question. -
1.7.10 Confusion with DamageSource and LivingAttackEvent
UberAffe replied to UberAffe's topic in Modder Support
I guess I was just up too late working on this. I made a stupid mistake and forgot to switch something. For Anyone that looks at this thread, using event.source.getSourceOfDamage(), does work! So new addition for this post: Is this the correct way to "restart" an event? DamageSource newSource = new EntityDamageSource(event.source.damageType, attackSource); LivingAttackEvent remade = new LivingAttackEvent(event.entityLiving, newSource, event.ammount + (float)damage); event.setCanceled(true); MinecraftForge.EVENT_BUS.post(remade); When I put a breakpoint in my code it does make it back with the altered values but it doesn't apply damage to the event.entity. Is there another event I need to post first? -
What I am trying to do: Add an effect that gets stored in nbttagcompound to any item that extends ItemSword. This effect adds additional damage based on the tier of effect when that sword is used to attack. How I am trying to do this: I am trying to hook into the LivingAttackEvent Read the event.source.getSourceOfDamage(). if it is a player/using an extended class of sword/sword has the effect then cancel this event and create a new event with additional damage. there is an nbt flag that gets updated to stop this from looping. I can add the effect to any sword, checking output has shown that this part works properly. But I crash when calling event.source.getSourceOfDamage() So I looked into the method and found that it simply returns null. Is there another event that I can hook into that would let me do a similar thing, or is there a different way I should go about getting the (player/damageSource entity) while still using LivingAttackEvent? If you want the logs I can post them, but it seems irrelevant to do so, since I know the source of the problem.
-
Thats some rapid releasing! And thanks for doing this, I'll likely be using it for the mod I am working on.
-
Yes, I am only familiar with 1.7.10 mods but here are the ones I know: Extra Utilities - Angel Rings - gives creative style flight - free to use - walking speed Clockwork phase - Hourglass of Air - toggled directional flight - costs time sand - Fastest Flight speed Blood Magic - Air Sigil - hold for directional flight - costs lp to use - second fastest flight speed Botania - Flügel Tiara - I believe it uses creative style flight - costs mana to use - I believe it is walking speed Edit: I forgot to mention this one Flaxbeard's Steam power - steam powered jetpack -I think it is hold space to use - cost steam to run - I believe it is walking speed
-
Are the locations tied to the device or the player? If I set a location can I give this device to someone else and they can go there? Also this:
-
If you are familiar with the Lightbringer series by Brent Weeks, this mod is an attempt to emulate the magic used in that world with the biggest feature being that it only adds a single item/block to the game, yet it can do everything from letting you fly to making a trampoline, or even a catapult or gun! Let me explain: This mod makes the player a "Prism" (a mage who absorbs light and uses it create items and blocks in the world from the broken down colors). The single item/block is a design table that the player will use to design their tools/armor/machines or import designs if they are lazy) All items are drafted(created) into either your hotbar or armor slots while blocks are drafted directly into the world(including multi-block). The point of creating the mod this way is that I do not and cannot know every item that a user could possibly make or even its use, I am giving them a base with which to create their ideas. I decided that I want to implement it this way after seeing someone make a working calculator with vanilla minecraft. I am looking for help with modeling, for both in-game use and in the design gui. I am also just looking for some more general help with organizing the underlying framework and some of the implementation. This is my first mod but I am determined to see it finished. This is a more detailed description of how the mod would ideally work: https://github.com/UberAffe/Light-Drafter/blob/master/README.md This is a mock up of what the gui for the design table might look like: https://drive.google.com/open?id=0B_8hByLHUVnzNUZVN2lzUl95dUk Feedback on the concept itself is also appreciated!