Jump to content

NovaViper

Forge Modder
  • Posts

    1061
  • Joined

  • Last visited

Everything posted by NovaViper

  1. I'm not sure why, but whenver I run the command ./gradlew setDecompWorkspace, I get this error: ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_191\bin Please set the JAVA_HOME variable in your environment to match the location of your Java installation. I've added the JAVA_HOME variable under my System Environment Variables as this: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_191\, my system path contains this: C:\Program Files\Java\jdk1.8.0_191\bin;C:\Program Files\Java\jdk1.8.0_191
  2. --Edit-- Oh nvm, I forgot to change a number in the json file. The flag made it all work. Thanks!
  3. Hey, I'm trying to figure out how to add a recipe for an item that has subitems (throw stick and throw bone). Each item have its own state, dry and drooled on. The issue I'm running into is that whenever I place either item into the crafting table, I end up getting a different one instead (i.e. if I placed the drool bone, I end up getting a dry stick instead of a dry bone). The damage ids are 0 (throw bone dry), 1 (throw bone wet), 2 (throw stick wet), 3 (throw stick wet). Just to warn, I did not make the code myself, I'm merely contributing to the current project. The issue: https://github.com/percivalalb/DoggyTalents/issues/114 The recipes: From wet stick to dry stick: https://github.com/percivalalb/DoggyTalents/blob/master/src-mc-1.12.2/assets/doggytalents/recipes/throw_stick_dry.json create throw stick: https://github.com/percivalalb/DoggyTalents/blob/master/src-mc-1.12.2/assets/doggytalents/recipes/throw_stick.json from wet bone to dry bone: https://github.com/percivalalb/DoggyTalents/blob/master/src-mc-1.12.2/assets/doggytalents/recipes/throw_bone_dry.json create throw bone: https://github.com/percivalalb/DoggyTalents/blob/master/src-mc-1.12.2/assets/doggytalents/recipes/throw_bone.json Item Registery: https://github.com/percivalalb/DoggyTalents/blob/master/src-mc-1.12.2/doggytalents/ModItems.java
  4. Good news! The primary developer came on earlier today and spotted the issue. It turns out that out the updateBoundingBox() method was at fault. It had the code that was really meant for the setDogSize() method, and because that was constantly being executed, it caused the bounding box of the dog to change, which caused the dog to move unintentionally. He has prompted fixed the bug and everything is working like it was before. More detail on the change is here
  5. Alrighty, I just messaged him on Discord, however he's not on right now. Hopefully he responds back to it
  6. I know, that's what we're trying to work on (but haven't figured out what part of the code is causing the issue)
  7. I'm not sure if this is a good place to ask this, but here goes. So for about a year now, there has been this big bug that me and another developer haven't been able (nor had to time) to tackle. I've done some digging around the code to at least figure out when the bug started occurring. The latest version of the mod (Doggy Talents) is 1.14.2.321 for 1.12.2; the version that didn't have the bug was 1.14.1.240 for 1.12.2. Every succeeding version (all the way up until the latest) since 1.14.1.240 has had the bug. I made a Git Compare in order to show the various changes that occured since that release all the way up to now. If anyone can give any sort of input as to why this happening, it would be highly appreciated.
  8. Hi, I'm trying to figure out how I can check for a player holding a certain item either in the main hand or in the offhand; and if that player has that item, the method will return a number to execute a certain task for the entity im making this for. So far I have only checked for the active hand, but not the offhand. My original code is this: public int masterOrder() { int order = 0; EntityPlayer player = (EntityPlayer)this.getOwner(); if(player != null) { float distanceAway = player.getDistance(this); ItemStack itemstack = player.inventory.getCurrentItem(); if(itemstack != null && (itemstack.getItem() instanceof ItemTool) && distanceAway <= 20F) order = 1; if(itemstack != null && ((itemstack.getItem() instanceof ItemSword) || (itemstack.getItem() instanceof ItemBow))) order = 2; if(itemstack != null && itemstack.getItem() == Items.WHEAT) //Round up Talent order = 3; if(itemstack != null && itemstack.getItem() == Items.BONE) //Roar Talent order = 4; } return order; }
  9. I feel the best way to store the data per-dimension basis.
  10. I'm trying to figure out how to get a player's Doggy Talents dogs and have all of their information saved on a separate file on the machine; and finally, when the player use the whistle item to call their dogs, it should (basically) recreate the dog using the data that was saved previously and have the 'new' dog spawn around the either the dog's owner or whoever used the whistle. However, there is some issues i need addressed, which are the following below: What would be the best and most reasonable way of doing this How can I actually save what is inside the dog's inventory, as the dogs do possess the ability to carry things (if they have the talent of course), in the same manner as the vanilla Donkey/Horse does. How often this should save, as to avoid data lost in case a player accidentally calls the dog before the data was saved or if the dog despawns How should this method deal with non-owner players (those whom do not own the dog, but the owner has allowed the dog to be manipulated by others. I did in a previous attempt make a way to call the dogs, but it did not account for despawning due to the chunk where the dog is located at being despawned. Here is the repo in 1.12.2: https://github.com/ProPercivalalb/DoggyTalents/tree/master/src-mc-universal
  11. The title itself sounds a bit confusion but here's a more explained version of it. Basically, I added in code that would give the dogs in the DoggyTalents mod genders. I have all of that working however, I want to have it togglable, in case some people do not like having genders in the game, so I added a configuration to it aswell. I have the configurations and checking system working.. but when I switch off the setting, the dogs that have a gender do not "lose" their gender, they still maintain it, as well as if I go and turn the switch on, the dogs that didn't have a gender at all does not get a gender at all. So far, what I have done to get the gender randomization system going was a simple if statement that would check to see if configuration for allowing genders was set to true, then check if datatracker had any gender names in. If it was empty (it's empty when the entity first spawns in), it will randomly pick between male and female. It looks like this: private void randomizeGender() { if(Constants.DOG_GENDER == true) { if (this.getGender() == "") { if (rand.nextInt(2) == 0) { this.setGender("male"); } else { this.setGender("female"); } } }else{ this.setGender(""); } } The entirety of the class right now looks like this
  12. I added the enablePersistence() in the entityInt() since obtaining the dog is acutally done when you feed a tamed wolf dog treats, it automatically spawns a tamed dog with data from the wolf. I do have one other question relating to this actually, but it relates to another piece of code I'm adding in (not relating to the topic). I'm going to create another topic about it to avoid confusion
  13. Enabling that method seemed to do to the trick! Hm.. how can I make that as soon as it is spawned? There are multiple ways the dogs can be spawned in the world and tamed (via giving a wolf a treat, spawning them directly with an item, retaming them after untaming them and so on). Would I put that within the entityInt() method to accomplish the same thing?
  14. That seems to be the case.. and since that's an issue. How would I add the dogs to a "database" to keep track of them?
  15. When I get too far away, they seem to not appear in the list. Seems that going outside of the 102.50 z range seems to cause it to no longer show up in the list [19:35:02] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-259.50, y=66.00, z=83.50]] [19:35:06] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:12] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:13] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:13] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:14] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:14] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:14] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:14] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:14] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:15] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:15] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:15] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:15] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:16] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:16] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:35:17] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/61, l='New World', x=-439.50, y=81.00, z=-102.50]] [19:44:03] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [] [19:44:04] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [] [19:44:04] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [] [19:46:10] [Server thread/INFO] [STDOUT]: [doggytalents.item.ItemWhistle:onItemRightClick:36]: [EntityDog['Dog'/11235, l='New World', x=-439.50, y=81.00, z=-102.50]]
  16. That's actually the same method I was using before; but I burrowed some code from an experimental 1.12.2 branch of DragonMounts, it seemed to do the job but it would stop working if the dogs got unloaded. I made a few changes to the code, but I haven't given it a test (yet) -- Gave it a test, still the same results as before List<EntityDog> dogsList = world.getLoadedEntityList().stream().filter(dog -> dog instanceof EntityDog).map(dog -> (EntityDog) dog).collect(Collectors.toList()); for(EntityDog dog : dogsList) { int xPos = MathHelper.floor(player.posX); int zPos = MathHelper.floor(player.posZ); int yPos = MathHelper.floor(player.getEntityBoundingBox().minY); if (dog.isTamed() && dog.isOwner(player) && (!dog.isSitting() || player.isSneaking())) { for (int x = -2; x <= 2; x++) { for (int z = -2; z <= 2; z++) { if(DogUtil.isTeleportFriendlyBlock(dog, world, xPos, zPos, yPos, x, z)) { dog.setSitting(false); dog.getAISit().setSitting(false); dog.setLocationAndAngles(xPos + x + 0.5, yPos, zPos + z + 0.5, dog.rotationYaw, dog.rotationPitch); dog.getNavigator().clearPath(); dog.setAttackTarget(null); } } } } }
  17. Well, which ever method is easiest is the one I want to go with.. However.. I've haven't done this sort before (as in actually put in code). I don't want a direct copy-paste of code, rather I want to learn it so next time I would be able to apply this skill in any other part of the code with no problem.
  18. Oh.. that would make a whole lot of sense. I haven't experimented with chunks (really, this is my first time actually dealing with that sector of Minecraft)
×
×
  • Create New...

Important Information

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