Jump to content

HalestormXV

Forge Modder
  • Posts

    328
  • Joined

  • Last visited

Everything posted by HalestormXV

  1. For this particular purpose, no not really. I mean if explosions are going to be created the terrain around it is going to be destroyed anyway so doing it in a circle is not really necessary. However, I would still like to learn how to do this for the future, if for example I want to create rings of fire, replace blocks with lava in a circle around the player, etc. etc.
  2. That was a mistake, however even when I passed the vx and the vz into the createExplosion it still doesn't create a ring of explosions around the player, which is the ultimate goal.
  3. Alright so I have an item that you use and it is supposed to create explosions around the player in a certain radius. Good news is, it works. Bad news is that it also causes the explosions where the player is standing which is not supposed to happen because then you take damage and fall into the hole it creates and all that nonsense. When really all that is supposed to happen is explosions are supposed to occur around you. So my code works but two problems occur which I can't figure out the math I guess to fix it. First problem is the circle is a complete circle including the inside of it when it should only be the "outter ring" of the circle when the explosions occur. Second problem is i know this code is TERRIBLE and inefficient since when the item is used there is a huge amount of lag time so any tips on how to fix that would be great (even if it is just adding a simple wait, the explosions don't all HAVE to occur at once which is ultimately what is causing it, since the same code with lightning strikes works fine.) Here is the block of code that needs adjusting: (radius is defined up top) http://pastebin.com/7FRY2FsV EDIT: The above code is garbage yes. So I tried an alternative way using a vector (this is the first time using them so i could be using it totally wrong) but my problem is still the same. It blows up where I am standing also when I just want it to blow up in a ring around me. Here is the vector code piece. Any help on which method to use would be appreciated. The vector way seems more efficient but i could be using it totally wrong.
  4. Wow....I feel like a total idiot. Well sometimes you just need another pair of eyes to point out the obvious...that was kinda embarrassing lol, but you know what.....IT WORKS NOW AoE Shears are a go Thank you much. Obvious mistakes are sometimes the hardest ones to see.
  5. OUTSTANDING! Lol, I knew it was something silly. And looking back over the corrections it makes perfect sense lol (go figure ). Now there is one last problem. When shearing a group of sheep they don't all get sheared. And the sheep I am targeting is not the one that gets sheared, usually it is the one next to it. Then after the shearing of the one sheep occurs, I can no longer shear any of the other sheep in the group. So in summary, only one sheep gets sheared, not the one I am looking at, and the sheep in the group do not all "get sheared". This i believe is the last issue. UPDATED: http://pastebin.com/JDGEnKQm (I like retrieving the list directly like in your note post and may change it after this shearing issue gets resolved.)
  6. Very well. I have adjusted it accordingly. Here is the new code. http://pastebin.com/9WznDPrp We seem to crash though if other entities are nearby that are not shearable as indicated here: http://pastebin.com/aRLaHA6P Now I know why this is happening. We are collecting all entities around the player (as I have changed the center point) and we are picking up non-shearable entities and placing them in the list. My question is, how do we "skip" over the entity if it is not a shearable entity to avoid this crash or better yet, not pick it up at all? Is it simply because I do not have an else check to say what to do if a non-shearable entity is picked up....because if that's the case i feel like an idiot lol.
  7. Hey there, good to see you also. So I tried changing it up a little bit by using the getEntitiesExcludingPlayer function so as to avoid a player check let alone any possible mishaps. Here is the issue now. The item seems to do what it is supposed to do, which is shear the sheep. However it doesn't sheer all the sheep within the area, not to mention it doesn't sheer the sheep you use the item on (which I think has to do with the bounding box) So here is what the code looks like now: The for loop btw was a great thought, sometimes you just need someone to point out the obvious lol. I know I am probably close so any thoughts? http://pastebin.com/prNd4Dwt
  8. Hey there community. I have a rather simple request and honestly I think I am just overthinking it or maybe totally misunderstanding it. I am trying to make a pair of shears that do an AoE Shear. So very simply any sheep within a radius of X around the player get sheared all at the same time. I am trying to make a list like so: List<EntityLivingBase> shearList = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, entity.boundingBox.expand(6.0F, 6.0F, 6.0F)); I did this in the past with an entity that pulsed out an AoE Slow to all things around it so I figured that the process was basically the same. Perhaps maybe that is where I am wrong. Anyway, the code works fine, as it is standard Vanilla Shears code just slightly modified. I just can't get this AoE part to work. Here is the code: http://pastebin.com/hLapHE7a A shove in the right direction or an example is really all I need. I have done lists like this before and iterated through them and applied potion effects for example like in this piece of code: http://pastebin.com/fGjTNRnQ I assumed it would be the same concept? Buuuuttt apparently I am wrong and that is why I am here, for help and to learn.
  9. Thank You I will try and learn it. I can't imagine it would be too hard to check an int. I will mark this topic as solved. Thank you again for all the help. Everything seems to be working wonderfully.
  10. I am unfortunately not familiar enough with packets yet to figure out how to get that to work. But I will have to do some research. Perhaps you have some guidance I can look to? However thankfully my pack is distributed via FTB and Technic so my client and server files will always be in sync. But this is good practice to get into regardless. And with respect to the moon and sun. You are correct. Looks like removing the trailing / was all it took lol. Had to recompile the whole mod because of it lol but now it seems to work just fine both on the server and on the client with no issue. Custom sun and moon are showing wonderfully. THANK YOU! And thank you as well coolAlias. I will be happy to keep that in mind. Much appreciated.
  11. Ahh thank you, I didn't realize that. The more you know the better lol. As for where I am calling them I am calling them here: http://pastebin.com/XCTP31ej (in my main class) However in going back over my code perhaps it is because I did this: public WorldProviderForest() { setDimension(DimensionIDs.LIGHTFORESTDIMENSION); this.getSaveFolder(); } And I should be doing this: public WorldProviderForest() { setDimension(DimensionIDs.LIGHTFORESTDIMENSION); this.saveFolder = ("DIM" + DimensionIDs.LIGHTFORESTDIMENSION); } public String getSaveFolder() { return this.saveFolder; } that is just a guess and would semi-explain what is going on, maybe? EDIT: Even with the above updates the client still crashes, yet the server doesn't. Matter of fact the achv for entering that dimension still gets complete according to the server console. EDIT 2: Wow total noob move - my server dimID was different from the client dimID. Now my question becomes, is there a way to force sync between the server ID and the client ID and if so how? Forgive my ignorance. EDIT 3: Lastly when the mod has been compiled the custom texture for the sun and the moon in that dimension do not show, yet in the uncompiled testing state they show just fine. Specifically these are set in the SkyRenderer class: http://pastebin.com/mU2mkQ5Y at lines 116 (sun) and 129 (moon) once the issue in Edit 2 and Edit 3 are resolved that will basically conclude my custom dimension problems. And thank you for the help you have given me thus far.
  12. Okay that makes sense. Although I am probably too far into my mod to re-update all of my methods that have been rewritten. So I will probably have to just keep that in mind when doing future mods. Furthermore I am only using the ReflectionHelper.getPrivateValue in one spot in my entire mod so it is probably more efficient and timely to just change that piece of the code. Now that that has been resolved I seem to be running into another issue. When trying to enter my dimension on the server I get a crash report: http://pastebin.com/T8gsRgHN Now do note this crash report is from my mod, compiled, while installed in my modpack, which is why all those other mods are listed. However the issue seems to be with my dimension provider as it is clearly saying it is non-existent. I have once again utilized this in my test environment and it works fine as we can see by my screenshot. So I know the dimension seems to be working in the test environment. However the big difference is that my server runs on kCauldron/Cauldron/MCPC+ (whatever you want to refer to it as). Now I know my provider is being created as indicated in the worldProviderForest class specifically here: http://pastebin.com/JkJLgYYr (WorldProvider ClassS) /** Get Provider for Dimension **/ public static WorldProvider getProviderForDimension(int id) { return DimensionManager.createProviderFor(DimensionIDs.LIGHTFORESTDIMENSION); } This makes me wonder if this is an issue utilizing kCauldron? Or perhaps I am creating my provider wrong? I know it is something I have done because mods like Twilight Forest, Abyssal Craft, or any other mod that adds dimensions works fine on the server, so it clearly is something on my end.
  13. Well thank you for that. I had absolutely no idea about that. Am I able to add minecraft { mappings = 'stable_12' } to my build.gradle and will that resolve the issue for all future builds? Or will I still need to manually switch around the names? Pardon my ignorance but I found no documentation on this when I first started modding and this is only my first mod. EDIT: Apparently I can't do that as adding that to my gradle.build causes my project to fail to compile with a stupid amount of errors that don't even appear in eclipse. So i image that means I have to d it manually? EDIT 2: And just to make sure I am understanding you correctly I would need to change: RenderGlobal#starGLCallList to RenderGlobal#field_72772_v because that is obfuscated ID of it according to the csv file correct? As well as change any references to starGLCallList (which only appears in the SkyRender class to field_72772_v)
  14. Okay, so I have a custom dimension in my mod and it is really bugging me. When I test it in Eclipse it works just fine. I can enter it and exit it without any issue. However, people are reporting that they are crashing when entering the dimension in the released version of the mod. Here is what one crash report says: http://pastebin.com/VxqFEYJN This is incredibly hard to debug because like I said, on my test environment in eclipse the dimension works just fine. Here is the dimension code: ChunkProvider http://pastebin.com/SS0Zxya2 Dimension Class DimensionID Class WorldChunkManager for dimension http://pastebin.com/nenHN90C WorldProvider for dimension http://pastebin.com/JkJLgYYr Sky Rendere - Here is the SkyRenderer where it seems like the issue might be originating: http://pastebin.com/mU2mkQ5Y And here is a beautiful picture of my dimension so I can look at it on my screen and say "I know you are working for me" http://i.imgur.com/VfUXatv.png
  15. Well here is an update I wrote in some debugging lines and I can confirm (assuming I did it correctly) that both the client (who summoned) and the server are recognizing that there is an owner and are syncing properly. I simply wrote the debug line to output who the owner is and I wrote it in the onUpdate method. So naturally my logs got spammed to hell with message however I can confirm that when running eclipse's built in server everything loaded fine, then I started up the client and connected to my localhost. Upon summoning the entity both my client logs AND the server logs were outputting that the ower is EntityPlayerMP(Player556(or whatever name was as assigned at that time) as well as giving the X, Y, Z of the entity and it was accurately tracking the coords and was synced between both client and server. So I then proceeded to add two debug lines to my code where the entity is setDead() a point 1 elimination and a point 2 elimination. Neither of the lines got output until the specific conditions were met. Point 1 was only triggered if the player ran out of EXP levels which is intended. And point 2 was only triggered if the owner logged out and became null. So both of these triggered correctly and the messages output both the server logs and the client logs. So I don't know what both of your determinations might be on this as you guys are the experts lol (I am merely learning this as I go) but it seems to me they are synced properly. coolAlias - I will also try your method to check if it is dead on the server-side just to try it as right now after the above test I am grasping at straws here. Your method does make sense (if I understood it correctly) because if the other clients never summoned the entity the code is likely reading to them (the other clients), because there is no owner, it is "dead" hence a null is returned too them basically saying "Hey this entity in front of me has no owner therefore this is a dead entity." But to the server and to the client who did summon it, it is very much alive so they see it. As they are the owners. Now for the kicker (which could just be a fluke as it hasn't happened on my live server). I did about 8 tests of running the client and the server. 2 or 3 of those tests had an odd result. The summoned entity disappeared to me (the owner). HOWEVER, the server still recognized me as the owner and was synced correctly with the client and was functioning as it should, I just could no longer see it. However, my EXP levels were being diminished properly and the logs were spamming out that I was still the original owner and was still keeping the co-ords of the entity and the server in sync. So now it appears we may have come full circle and the issue is not that it is not syncing properly but perhaps it is not rendering properly OR more likely there is some disconnect with the rendering client side?
  16. Thank you Jabelar. I will for sure do some checking however atm, I dont not have access to my computer now as I am at work however this just occurred to me and I want to jot it down before I forget and collect some thoughts. Is it possible that because in my on-update function of the entity I check to see if the owner is null. And if the owner is null we kill the entity (as these creatures are not supposed to persist). Is it possible that the entity is being spawned server side however is not being set up with the owner on the server but only client side. Which would explain why the server is "killing the entity" but the client is not because as far as the client is concerned it has an owner so there is no reason to kill it. In other words the item is spawning the entity correctly in the server. However, because nothing in my entity class writes the owner of the entity to the NBT server side, as far as the server is concerned, there is no owner so it kills it. Yet on the client side of things we set the owner in the item class right here: ((EntityTameable) e).func_152115_b(player.getUniqueID().toString()); So the client thinks that there is an owner so it doesn't kill it hence why the client still sees it. So in other words perhaps I need to try and establish somewhere in the EntityClass using this.getOwner() that this should be written to NBT so the server knows there is an owner and not to kill it. Because on the server side the this.getOwner() check in the entity class means nothing. Once again I don't have access to editing my code atm as I am at work. This is all speculation. Granted I still have to do the debugging when I get home with the System.out.println() to be sure. But this just all occurred to me now and I wanted to present this theory. Is it plausible?
  17. Bumping this in hopes that someone may know what is going on.
  18. I'm going to take a guess and say you responded to the wrong post lol? There is no github here and nothing is broken or was broken. They work just fine. The problem is after a few seconds they disappear to other players but their owners can still see them. They never stop functioning. This is visual.
  19. bump? I hate to be persistent but this is quite literally my only bug with my release and I don't even have a remote shot with where to go
  20. Bumping this in hopes of a resolution. Perhaps it is packets?
  21. Sure here is the function I use to register my summonable entities: public static void registerSummon(Class entityClass, String name){ int entityId = EntityRegistry.findGlobalUniqueEntityId(); long x = name.hashCode(); Random random = new Random(x); int mainColor = random.nextInt() * 16777215; int subColor = random.nextInt() * 16777215; EntityRegistry.registerGlobalEntityID(entityClass, name, entityId); EntityRegistry.registerModEntity(entityClass, name, entityId, MainRegistry.modInstance, 64, 1, true); EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor)); } Full Handler: http://pastebin.com/KZQAZdRc They are all registered here: EntityHandler.registerSummon(EntityAries.class, "Aries"); EntityHandler.registerSummon(EntityAquarius.class, "Aquarius"); EntityHandler.registerSummon(EntityTaurus.class, "Taurus"); EntityHandler.registerSummon(EntityCapricorn.class, "Capricorn"); EntityHandler.registerSummon(EntityLeo.class, "Leo"); EntityHandler.registerSummon(EntityVirgo.class, "Virgo"); EntityHandler.registerSummon(EntityCancer.class, "Cancer"); EntityHandler.registerSummon(EntityLibra.class, "Libra"); EntityHandler.registerSummon(EntityGemini.class, "GeminiMaster"); EntityHandler.registerSummon(EntityGemini2.class, "GeminiMirror"); EntityHandler.registerSummon(EntityPisces.class, "PiscesMaster"); EntityHandler.registerSummon(EntityPisces2.class, "PiscesMirror"); EntityHandler.registerSummon(EntityScorpio.class, "Scorpio"); EntityHandler.registerSummon(EntitySagittarius.class, "Sagittarius"); Full Main: http://pastebin.com/jSue2jxb EDIT: In doing some thinking. Is it possible that I need some type of packet handler? I mean I really don't understand why I would since my normal hostile mobs don't need one and work just fine. But because the issue is not that the Tameable entites aren't working its simply that they disappear after about 5 seconds to other players. They still function, they still work, and the original summoner still sees them in action. It really is just they disappear to other players. To be quite honest I read a number of tutorials on packets (and all of them say they are really easy) and still am lost with them so try my best to stay away from them. But could it be possible that because this seems to be a visual glitch that only occurs on a server that it is a packet issue?
  22. Sure thing. And that is not a bad idea to have the generic rendering. Thanks for the tip on that. Here is the class that spawns the entity in the world: http://pastebin.com/6FnQs8G4 Specifically it is this. Line 95 - 185
  23. Bumping this, since I made the edit and did the testing and still had the same result. Any ideas from anyone? What makes this so difficult is it works great on Single Player. Not a single bug/glitch.
  24. SNIP No dice. Gave it a shot and enabled the override methods for writeNBT and readNBT and the exact same error is happening. The code is the same as this: http://pastebin.com/HKGndwnZ However now lines read: @Override public void writeEntityToNBT(NBTTagCompound p_70014_1_) { super.writeEntityToNBT(p_70014_1_); p_70014_1_.setBoolean("Hostile", this.isAngry()); //p_70014_1_.setByte("ColorCollar", (byte)this.getCollarColor()); } @Override public void readEntityFromNBT(NBTTagCompound p_70037_1_) { super.readEntityFromNBT(p_70037_1_); this.setAngry(p_70037_1_.getBoolean("Hostile")); //if (p_70037_1_.hasKey("ColorCollar", 99)) //{ // this.setCollarColor(p_70037_1_.getByte("ColorCollar")); //} } So they are no longer written to do nothing.
  25. Hey there. My mod summons out tamable entities for the player and the entities act as a companion much like a wolf. It works flawlessly on Single Player. However in trying it out on my server setting I am running into some issues. Well not issues, more like oddities. The entities get summoned just fine and they are "owned" by the player. Each entity is unqiue yadayada and it works great. However on a server another player can only see the entity for like a second or two and then it disappears to the other player. However to the original summoner it remains visible and functioning. And it does still function it is just that another player cannot see it. But the player who summoned it can see what it is doing and everything. I don't know why it is happening. Any ideas on how I can "fix" it so that once the player summons the entity another player will see it summoned and it will remain visible to them (the other player) and not just the owner/summoner of the entity? Here is an example class: EntityClass: http://pastebin.com/HKGndwnZ RenderClass: http://pastebin.com/Mc6zMeKc **Note I tried this with and without the commenting of the SideOnly(Side.CLIENT) same effect no matter which way I do it. Although if I recall the server doesn't do any rendering so proper function would be to have it uncommented. ClientProxy http://pastebin.com/PWAVer6u ServerProxy http://pastebin.com/LtxRrr7y I'm at a total loss because it works perfectly on Single Player and I am sure it is such a simple oversight on my part but any help is appreciated.
×
×
  • Create New...

Important Information

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