Jump to content

_Bedrockbreaker_

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by _Bedrockbreaker_

  1. I don't understand the context of the first bullet point. Anyways, ModBlocks.registerItems was me copy/pasting code before actually seeing if it worked. I am also assuming bullet points 2 and 3 are given for almost every thread as they can fix 90% of the problems asked here. The only thing I see that I should do from those links is to add @Override to anything overridden. However, as far as I can tell, I am not overriding anything when creating an item. I am just registering an item to a list. As to fixing my problem, I am thinking I should wrap with public class RegistererOfItems { ... } and put MinecraftForge.EVENT_BUS.register(ModItems.RegistererOfItems.class) in the preInit phase of my main class. EDIT: After doing that, my game no longer crashes, but no items are registered. Don't even appear in jei and I can't /give them to me. I should probably read even more on events
  2. I was updating my mod from 1.12 to 1.12.2, not thinking that anything would break. As it turns out, GameRegistry.register() doesn't seem to work anymore. I was reading up on how to actually register the items/blocks, and I just got incredibly confused and lost (I got really used to the old way, and I don't entirely understand the newer one). The method I am now trying to use is My full mod is on Github: https://github.com/Bedrockbreaker/rtap/tree/master Relevant files in src/main/java/com/bedrockbreaker/rtap/ and src/main/java/com/bedrockbreaker/rtap/init
  3. So, I am trying to access the forge registry for all potions, specifically to apply a random one when a food is eaten. But, I am unclear on what the difference between ForgeRegistries.POTIONS.getValues() and .getEntries is. And when I copy the list from either and try to get the ID from that potion, by getIdFromPotion(potions.get(0)) (I'm am still unfamiliar with lists in java in case I am not even using list methods right, they are a little different from other languages' lists), it gives me an error The method getIdFromPotion(Potion) is undefined for the type *insert my class here, it's not relevant I think* But, the method DOES use Potion, if I am not mistaken here? Why would it give me that error? And is there an easier way to do what I am doing?
  4. Did you copy the bow code? If so, just remove the motionX/Y/Z (whatever one you find) and you *should* be good. Otherwise, just don't include any thing that messes with the motion of the passes in entity.
  5. How can I get ANY potion registered from "vanilla" minecraft and other mods? I have a food, that applies all the normal ones by generating a random integer from 1 to 28, but if I want it to do the ones from mods, how can I get those? side question: how can I install other mods in my development? like jei, any other mod... side-side question: how could I get any item/block/whatever I want registered to use for diabolical uses?
  6. Okay, from you say, It seems the capability seems to look fine (really, you didn't say anything about the capability itself, besides implementing it, so I assume nothing wrong there.) It looks like I did forget to put the CapabilityManager in a method, but it still gives me an error of register cannot be resolved or is not a field. I looked through the examples you provided Choonster, and tried to look at what you are doing, but it doesn't seem you have anything for the "factory" part of register and I don't quite know what to put there.
  7. Am I really such an idiot? I completely forgot that I had subscribed to the interaction event I could cancel it. Anyways, thanks for enduring through stupidity, I got it working.
  8. Sorry for small bump, but I can't for the life of me figure out how to use capabilities. I have looked through the documentation several times and searched up others' tutorials and I am at a loss.. any help? Relevant capability files: https://github.com/Bedrockbreaker/rtap/tree/master/java/com/bedrock/rtap/capabilities https://github.com/Bedrockbreaker/rtap/blob/master/java/com/bedrock/rtap/init/ModCapabilities.java
  9. No, I don't have a custom entity, and I don't think creating a new one and replacing all the old ones with mine is the the solution I generally want to do (more like compatibility, than "force to use my cat"). But yes, for any ocelot that I can click on with shears, (which should be every ocelot) I want to disable it from standing/sitting in that right click only. If the player can't harvest more hair, or is not holding shears, the player can normally interact with the ocelot. Is that clear enough? or is more information needed? I just created a github here if you still are confused -> https://github.com/Bedrockbreaker/rtap
  10. ok, got it. But I can't exactly override a method inside a different method. (subscribed to interact(EntityInteract), and trying to handle everything in there. And I can't exactly get a reference to the entity before the player even clicks on it ) *Currently in eclipse at this point forward* So, it seems just putting entityCat.processInteract(player, event.getHand()); { } doesn't give me any errors, but I am going to assume it does somehow because of the ; before the two {}... And I am also going to assume if that is the way to do it, that I need to put something in the braces?
  11. How would I override that? If i try to set it to null, it gives a must be variable error. Putting the @Override annotation also gives an error.
  12. wait wait wait wait........ I only want to disable it from sitting/standing when I right-click on it. And behave normally all other times.
  13. No, I want the ocelot to stay in its sitting/standing position when clicked. So, just removing that line would make the cat stay?
  14. Wouldn't overriding isSitting to false always make the cat stand?
  15. I have a cat, that I can shear for cat hair. (don't question my sanity). But I want a custom death message for the cat when it dies due to over-shearing. How could I override the original message? Also, as a bonus question: how can I disable the cat from sitting/standing. Any method from getAISit doesn't seem to work. resetTask partially works, but not on the first two clicks after summoning the tamed ocelot.
  16. Okay! Thanks for helping!
  17. I am thinking (which means I may be totally wrong) that you want to override the onBlockBroken method and call something that has a reference to a custom loot table which would allow to do almost anything with the blocks drops.
  18. (This is just to check to see if I have the right idea) Okay, So when looking at the files, you have gold_helmet_from_iron_helmet.json that actually specifies the recipe. The type tag on the json specifies the class that _factories.json uses to modify that recipe. (What does the data tag do on the iron helmet?) Then, the ShapedArmorUpgradeRecipe which iterates over the crafting slots until it finds an armor piece. Then, it takes the damage of the iron helmet, and copies it onto the golden helmet. (doesn't the iron helmet have more durability, which wouldn't effect the golden helmet until the iron helmet's durability got low enough? Or does it take any damage on the iron helmet on apply it to the golden helmet, meaning that a barely broken iron helmet could result in a completely broken golden helmet? Or is it a ratio, which I see none of in the class, that as the iron helmet takes more damage, the golden takes less, but both meet at 0.)
  19. Okay... It just seems the vanilla classes to register the armor dying (or it seems anything that uses dying/cloning items/tipped arrows) don't use jsons... Will try to move my class to json though...
  20. Yes, most of my recipes are registered through json, but I don't think that json allows you to do advanced recipes that give nbt-specific items based on certain inputs. (armor dying)
  21. Okay, so I think I managed to copy create a class that behaves like RecipesArmorDyes, but how would I register that? GameRegistry.addRecipe give me a resource location, but that would be for an external file. And I can't seem to find any other registry method to do this anymore that isn't deprecated in 1.12.
  22. Ahhhhh! Thank you for helping! I had actually never seen the two colon notation before, but your explanation was extremely helpful.
  23. so if assign player by EntityPlayer player = (EntityPlayer) entityIn; //entityIn could be any entity, but its checked beforehand that it is a player And then use if (player::capabilites.isFlying) { //stuff } It should theoretically work?
  24. I am sorry, but I can't seem to find anything on EntityPlayer::capabilities at all. Nothing is showing up if I hit ctrl+space and if I manually type it out, it says "The target type of this expression must be a functional interface". Would you care to enlighten me on what and how to use the two colons, and why capabilities is not showing up?
  25. Yes, just realized that, zombie crashed the game. hehe. Now if I could check if the player is actually flying would be nice.
×
×
  • Create New...

Important Information

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