Jump to content

SanAndreaP

Forge Modder
  • Posts

    1689
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SanAndreaP

  1. To get a players' game profile instance, use world#getPlayerEntityByName(the_name_you_want_to_use_as_a_string)#getGameProfile()
  2. You have 2 choices: 1 Your resource is clientside-only, then you can directly use the resource managers' getResource method and from the returning IResource, you can use the InputStream returned by getInputStream(). You can get the resource manager field in the Minecraft instance. 2 Your resource should be available to both, client and server. This one is tricky, since you don't have a resource manager on the server side. On the client, you can use the first approach On the server, you could either read the file from the classpath directly or you need to read the mods' archive directly and read your file from there. You can probably get the mods' archive as a file instance within the FMLPreInit event with getSourceFile() Problem is, IDK if this will work on a dev environment, since there is no actual packed mod archive, but you can read the file from the classpath there if it's in a dev environment.
  3. Seems like your minecraft.jar is corrupt, since it fails to transform a class. redownload Minecraft in your launcher and re-install forge and see if that helps.
  4. In your editor must be an option to set the encoding of that file.
  5. Well, then please edit your post and remove the EntitySquid and EntityWaterMob code.
  6. rerun gradlew setupDecompWorkspace and your problem will be gone.
  7. You can use world.setTileEntity() to set the tile entity manually.
  8. Yes, because it already started drawing. What you need to do is stop drawing and then start drawing again for your rendering. When done, and you stopped your drawing, start drawing again for the renderers internal "draw-stop"
  9. 1. Don't post Mojang code! It's illegal and also we can just look that up ourselves. 2. Add @Override to all your methods you intend to override, it helps you see if you really override the method and not just declared a new version of it which never gets called. 3. return true in isInWater() and see if it still dies. 4. A bump after 4 hours, really?
  10. You need to make a stem block for it, too and place that instead of your cantaloupe block.
  11. Nothing to do with any entity ID, something in your entity code is wrong, I can't tell what, though. Maybe see what the EntitySqid class looks like?
  12. registerGlobalEntityId registers your entity to the vanilla ID list, which is limited (max. 255 entities) That's where registerModEntity exists, the ID you provide there is mod-specific, beginning with 0 and counting up for each entity. If you want to make a mob spawn egg, make your own and mimic the function of the vanilla one. EntityRegistry.registerGlobalEntityID(EntityFishMob.class, "Fish", EntityRegistry.findGlobalUniqueEntityId()); Again: you shouldn't use this, use registerModEntity EntityRegistry.findGlobalUniqueEntityId(); This line is completely useless and just wastes one of the limited entity IDs registerEntityEgg(EntityFishMob.class, 0x0033FF, 0x003399); As stated previously, make your own spawner egg, it's not that hard.
  13. You can (and should) omit the line with the global entity ID. Even if you want to register your mobs to the spawn eggs, you should make your own, mimicing the vanilla ones; there are ca. 32000 item IDs available.
  14. No: https://github.com/SanAndreasP/ClaySoldiersMod/blob/master/java/de/sanandrew/mods/claysoldiers/util/ModEntities.java#L36-L45 Also I register them inside init.
  15. 1. wrong forum 2. Shaders Mod causes the crash [23:03:49] [main/WARN] [FML/]: The coremod shadersmodcore.loading.SMCFMLLoadingPlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [23:03:49] [main/ERROR] [FML/]: An error occurred trying to configure the minecraft home at C:\Users\jcook_000\AppData\Roaming\.minecraft for Forge Mod Loader java.lang.AbstractMethodError at cpw.mods.fml.relauncher.CoreModManager.loadCoreMod(CoreModManager.java:425) ~[forge-1.7.2-10.12.2.1147.jar:?]
  16. Look at my registry, it is kinda like what you want to do. There's no GUI involved, but the same strategy can be applied: https://github.com/SanAndreasP/ClaySoldiersMod/blob/master/java/de/sanandrew/mods/claysoldiers/util/soldier/ClaymanTeam.java
  17. You need to specify the source java version (and probably the target one as well) in your build.gradle like this: https://github.com/SanAndreasP/ClaySoldiersMod/blob/master/build.gradle#L58-L61
  18. 1. check if entity is an instance of the EntityLivingBase class 2. if true, make a new variable which holds an EntityLivingBase instance and give it the entity (you must cast it to the EntityLivingBase class) 3. kill the entity
  19. What you could also do is to create your custom EntityItem class which extends the vanilla one, use the EntityJoinWorldEvent, check if it's an EntityItem (and not your class!) and if it holds an ender pearl, If yes, copy the item stack, kill the original one and spawn your own EntityItem. I have example code of mine here: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/registry/event/EntityJoinWorldEventInst.java https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/entity/item/EntityItemTantal.java
  20. Do I understand it correctly? You want to basically colorize your item? Why not use getColorFromItemStack ? What does getColorFromItemStack? I looked up the code in the Item class, but it only return a Number. What does it? The number returned is a hexadecimal color code. For example the number 0xFF00FF The 0x denotes a hexadecimal number the first FF denotes the amount of red the 00 denotes the amount of green and the last FF denotes the blue color: 0xFF00FF The range of those sections go from 00 to FF, translated into decimal values from 0 to 255 Here is a link for an online color picker, which will give you the hexadecimal value for the selected color: http://www.colorpicker.com/
  21. Do I understand it correctly? You want to basically colorize your item? Why not use getColorFromItemStack ?
  22. 1. This goes to Modder Support, especially the ForgeGradle subforum 2. What Forge version are you using? ~Derp, it's in the first lines of the log (1189) Try to run gradlew clean gradlew cleanCache gradlew setupDecompWorkspace --refresh-dependencies
  23. If you're interested in not using the SimpleNetworkWrapper and not having any memory leaks, use the event-driven packet system: https://github.com/SanAndreasP/ClaySoldiersMod/tree/master/java/de/sanandrew/mods/claysoldiers/network Doesn't cause any problems for me.
×
×
  • Create New...

Important Information

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