Everything posted by Erfurt
-
[1.12.2] [Solved] Changing max health based on armor set
As I said it was a derp from my side, why did you even have to comment on that... Most of the time your comments make you sound like a prick, sorry if you don't mean to. But maybe think about it in the future.
-
[1.12.2] [Solved] Changing max health based on armor set
Got it working now, turned out to be a a big derp from my part. The UUID I used I generated random by using UUID.randomUUID(). I didn't think about the fact that it would change everytime I opened Minecraft... Changed it to a fixed string, and now it works flawless. Thanks for your help guys. For others who have problem with this, mt new working code is in the spoiler.
-
[1.12.2] [Solved] Changing max health based on armor set
First of, I tried doing that, and it didn't change the outcome. Secondly I had hasHealthBoost In there to do some testing, and I forgot to remove it... As I said, it was getting late and I wasn't thinking completely straight. Still working on getting this working, will update this doing the week
-
[1.12.2] [Solved] Changing max health based on armor set
I got it working now, might not be the correct way, doesn't seem to be exactly as you guys suggested, but for now it works without any of the crashes and other issues I had before. Updated code for anyone who might find it useful. EDIT: Scratch that, still one problem... When I close the game completely and open it again, then for some reason I get double health again. Anyway it's late and I can't think straight anymore.
-
[1.12.2] [Solved] Changing max health based on armor set
I get what you are saying, but I don't really understand why they are not in the playersWithSet collection. As far as I can tell I add them to it if they are not in it already.
-
[1.12.2] [Solved] Changing max health based on armor set
I might be wrong, but what you are telling me to do, I believe I am already doing with this. public static List<String> playersWithSet = new ArrayList<String>(); public static String playerKey(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; }
-
[1.12.2] [Solved] Changing max health based on armor set
I have been working on this for like 6 hours now, and it semi works. I have made some changes from the original code. I changed the event to LivingEquipmentChangeEvent as the other one gave me a crash when I had the full set of armor equipped. The crash was Modifier is already applied on this attribute! I'm still getting that crash but as far as I can tell it's only when I have something in my main hand, while having the full set equipped. Also it doesn't seem to update the attribute if I take off one piece of armor and put in back on, it updates if I get something in my main hand. But then it crashes. All crashes is the same, and I'm not sure how to get ridt of it. My new code if It's needed public class AbilityHandler { protected static final UUID MAX_HEALTH_UUID = UUID.randomUUID(); public static List<String> playersWithSet = new ArrayList<String>(); public static String playerKey(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; } @SubscribeEvent public void updatePlayerAbilityStatus(LivingEquipmentChangeEvent event) { if(event.getEntityLiving() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)event.getEntityLiving(); String key = playerKey(player); Boolean hasMithrilSet = ArmorMithril.isFullSet(player); if(playersWithSet.contains(key)) { if(hasMithrilSet) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier(MAX_HEALTH_UUID, "MAX_HEALTH_UUID", 1, 2)); } else { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(new AttributeModifier(MAX_HEALTH_UUID, "MAX_HEALTH_UUID", 1, 2)); playersWithSet.remove(key); } } else if(hasMithrilSet) { playersWithSet.add(key); } } } }
-
[1.12.2] [Solved] Changing max health based on armor set
Hey guys, I'm currently working on doubling the players vanilla health pool, so give the player 10 extra hearts (20 HP), if the player has a full set of my custom armor equipped. The way I have it right now works, but I feel like it's a bad way to do it, maybe someone could help me out? I have a class that does the health boost. public class AbilityHandler { public static List<String> playersWithSet = new ArrayList<String>(); public static String playerKey(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; } @SubscribeEvent public void updatePlayerAbilityStatus(LivingUpdateEvent event) { if(event.getEntityLiving() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)event.getEntityLiving(); String key = playerKey(player); Boolean hasMithrilSet = ArmorMithril.isFullSet(player); if(playersWithSet.contains(key)) { if(hasMithrilSet) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(40); } else { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20); playersWithSet.remove(key); } } else if(hasMithrilSet) { playersWithSet.add(key); } } } } It's the .setBaseValue(x) I feel like is the "wrong/bad" way to doubling the vanilla health pool. But I can't figure out another way. The thing is if my mod is playing with another mod, that have a lower or higher starting health pool for the player, then my mod will change it back to the vanilla values. As I mentioned this works, but I strongly feel like it's a bad way to do it, so I would like to hear of a better way.
-
[1.13] Will sub-blocks still be a thing?
Hey guys, So as Mojang is currently removing metadata based sub-blocks from the game. I was wondering if forge would still support it in the 1.13 version and beyond, or if we should just begin to rewrite our mods now? Granted it's not a big rewrite, for basic sub-blocks.
-
[1.12.1] Few questions about biomes and dimensions
Alright, I understand now, I'll begin to do that then. If anyone knows the answer to my question about multiple biomes in my own dimension, I would still like to know
-
[1.12.1] Few questions about biomes and dimensions
Ahhh, but does that make a difference? I mean the way I have it now works
-
[1.12.1] Few questions about biomes and dimensions
Ah I see. Do you mean ForgeRegistries.BIOMES.register(biome), when you say Registry.register<Biome>? Or am I way off? I guess I could try and play around with it a bit more. It's my own biomes and my own dimension, so while I could do it that way, I would rather do it the 'right' way, if I can even say that
-
[1.12.1] Few questions about biomes and dimensions
Hey guys, I have a few questions regarding biomes and dimensions. Firstly, I have a couple methods I use to initialize and register the biome. I'm not sure if I actually need to do all this, so please correct me :). public static Biome initializeBiome(Biome biome, String name) { biome.setRegistryName(name); ForgeRegistries.BIOMES.register(biome); return biome; } public static void registerBiome(Biome biome, Type type, BiomeType biomeType) { BiomeDictionary.addTypes(biome, type); BiomeManager.addBiome(biomeType, new BiomeEntry(biome, 10)); BiomeManager.addSpawnBiome(biome); } I would like to know, if I don't want the biome to spawn in the overworld, but only in my own dimension, what line of code do I remove. I do believe that it is BiomeManager.addSpawnBiome(biome); Secondly I would like to know what the BiomeType is used for. I can see that there is 4 types, and by their naming I would think it has something to do with how the biomes spawn in the world ex BiomeType.ICY can't spawn next to BiomeType.DESERT. But I'm not sure at all, also whether or not it was any other uses. Lastly I would very much like to know how I would go about having multiple biomes in my own dimension. I have everything working right now, but only with one biome. I believe that I need to use new BiomeProvider(WorldInfo) instead of this.biomeProvider = new BiomeProviderSingle(BiomeRegistry.eadore_plains_biome); but I don't understand how I put the biomes into WorldInfo. (If you want/need to see my WorldProvider class, just ask for it) Again I could be completely wrong, and be needing to do something else, then as with the other questions feel free to correct me. I have been searching in the source code for answers to my questions, but haven't been able to find them. So I'm doing the next best thing asking you guys.
-
[1.12.1] [Solved] Particle effect
Never mind I have found out now. It was a rather big derp from my side. For people how wants to know, what I did was extend the ParticlePortal class and changed the stuff I needed to change. Then I had to make a new class that I have to call when ever I want to use my particle. This is what I ended up with.
-
[1.12.1] [Solved] Particle effect
This might sound stupid, but when you say new instance, do you mean if I create a new particle that either extends ParticlePortal, or is a copy of it. Or do you mean when I spawn in the particle? Also if it's the first thing, how do I get it to register? I'm a bit of a noob sorry
-
[1.12.1] [Solved] Particle effect
Hey guys, So I'm working on some portal stuff for a custom dimension, and I wanted to use portal particles, but with another color than the vanilla one. As I haven't been able to find any way of doing this, I thought that I would just remake the particle effect with the color values that I wanted. But after looking at the source code and forum posts about Minecraft particles, I have become doubtful if it will work. So basically I want to know if I can simply "copy" the code from the ParticlePortal class, and change the red, green and blue color values to match what I want. Or if I have to do some major changes to the class? Also how do I register a new particle effect, as I can't find anything in the GameRegistry or the ForgeRegistries for particles? Of Course if there's a way to change the color of an already existing particle effect, I would like to know it. But I would still like to know the other two things, as they would come in handy if I want to add more custom particle effects someday. I don't really have any code other than the vanilla ParticlePortal code, but as I have become somewhat confused, I hope you guys would still like to help me
-
[1.12.1] Potion Effects on items
This isn't really an option, because every time Health Boost gets reapplied, it starts with empty hearts. And as I mentioned I don't really want to have any healing factors, other than when it gets applied the first time, as it can otherwise mess up if the player is in combat or something like that. But maybe there's a way to alternate the max health of the player by other means? I have the means to apply stuff when the player equip the item, and remove stuff when the player unequip the item. So it's just a matter of finding the other way, as I have little to no clue But thanks for your input, might be useful for other effects
-
[1.12.1] Potion Effects on items
Hey guys, So I'm working on some Baubles rings and other stuff, that adds potion/beacon effects to the wearer. And my first testing was fine, no problems. But when I tried to use health boost, I noticed some 'weird' behavior, there was no regeneration on the extra hearts. I do understand why this is, and it's because I reapply the effect on every worn tick (I don't know any other way to do that). I can't see any easy fix to this, other than giving the wearer a short burst of regeneration or instant health, but that would mess up if the player is in combat, or is low on hunger. That would not be a good solution, in my mind. So that made me wonder if there is another way to add effects to players, and if I would be able to base the effects on what items that player is wearing? I would assume that I could use nbttags to do that, although I have not worked with that before, so I'm not sure how it works. Because I'm trying to find another way to do the effects, I don't have much code to show, but this is more of a question about what I'm able to do, and not as much a question of what is wrong with my code. I think that it's ok. I should also mention that at the moment I'm just doing some testing of the effects and what I'm able to do with them. But at some point I will be converting from having all the effects static on the items, to have some of the effects come from enchantments instead. And at this point I have no clue where to begin on the enchantments, however that's not what this is about (but if you guys know a good guide or place to learn this, that would be very much appreciated). So to recap, I need to find a way to add potion/beacon effects to the wearer of an item, with a specific effect and/or enchantment. If some of you can guide me towards a tutorial or some other guides on this, especial the health boost thing, as that was one of the main things I wanted to add with my mod. I would be very happy. Or just shoot me down if I'm being stupid
-
1.12.1 recipes shown incorrectly
I have been fooling around with the recipe stuff, and I noticed that when I use forge:ore_shaped, it will for some recipes show incorrectly in the crafting table, the recipe works as intended, it's just not showing the correct recipe. Example: When I have the pattern to be like this "pattern": [ "#", "#", "#" ] It will show up in the crafting table "###". When I use the vanilla method minecraft:crafting_shaped, it shows correctly. If I put a space before or after '#', in the pattern, it will show correctly in the crafting table. To be clear the recipe DOES work the way it should, but when you click on the item in the recipe book, it will show up incorrect and also pull the materiasl into the incorrect places in the crafting table. It's a minor thing, but something that I believe should be looked into at some point. I should also mention that I'm using the 1.12.1 - 14.22.1.2478 recommend build. For reference this is one of my recipe json files that shows incorrectly. Just in case that it's actually me, who have done something wrong. { "type": "forge:ore_shaped", "pattern": [ "X", "X", "#" ], "key": { "#": { "type": "forge:ore_dict", "ore": "stickWood" }, "X": { "item": "em:amethyst" } }, "result": { "item": "em:amethyst_sword" } } If it's me who have done something wrong, then I apologize for the inconvenience.
-
[1.12] Custom Crafting with OreDictionary?
Thanks
-
[1.12] Custom Crafting with OreDictionary?
Aha, hope that it will be fixed with the next recommended build Then I just want to know about the recipes not being added in the recipe book, is that also a bug, or something that isn't implemented yet? Or is there something I need to code?
-
[1.12] Custom Crafting with OreDictionary?
I'm using the 14.21.1.2387 build, have they been added in a later build? EDIT: This is how I have added my block to the ore dictionary. OreDictionary.registerOre("plankWood", block); This worked in 1.11.2
-
[1.12] Custom Crafting with OreDictionary?
Okay, that works, but for some reason it didn't work the last time I tried. Not sure what the problem was. Maybe it was because I had an issue with some of my other recipes at the time I tried, not sure if that has something to do with it. Anyway thanks. Now it's just the thing with the game not adding the recipes. EDIT: Doesn't actually seem to work. I had an recipe I had forgot about, with the item I just tested with.
-
[1.12] Custom Crafting with OreDictionary?
Just a couple small question more. If I have lets say a new type of wood planks, and I add it to the ore dictionary plankWood. Do I then have to make new recipes for all items that use wood planks in the recipes, like wooden axe, or is that still done automatically? Also I have noticed that my recipes is not being added to the recipe book when I obtain the items for that item/block, as you would do with a vanilla item/block. Example of this is when you obtain iron ingot, you get the recipes for iron armor. Is there something I need to code, or is it a bug?
-
[1.12] Custom Crafting with OreDictionary?
Cool, thanks
IPS spam blocked by CleanTalk.