Jump to content

SuperKael

Forge Modder
  • Posts

    66
  • Joined

  • Last visited

Everything posted by SuperKael

  1. Exactly what the title says. My mod, called BottleOBlood runs fine, everything seems normal, but after a compile, I have to go into the created jar and deleted the folders named "enviromine" and "cofh" because they have been packaged into my jar. There are no errors or anything in the compile, and it runs fine in the dev environment. I noticed that in the build/classes/main folder, the cofh and enviromine folders are being put there during the compile. My file structure is as follows: Mod Root/ asm/ (random stuff) assets/ (heavily obfuscated stuff) bin/ 1.7.10/ (CodeChickenLib jar, copied by the dev environment from my mods folder) assets/ bottleoblood/ (My Mod's assets) cofh/ (CoFHCore's assets) enviromine/ (Enviromine's assets) bottleoblood/ (My Mod's libraries) cofh/ (CoFHCore's libraries) enviromine/ (Enviromine's libraries) Changelog.txt mcmod.info (All the jars within my mods folder) build/ classes/ main/ bottleoblood/ (My Mod's libraries) cofh/ (CoFHCore's libraries) enviromine/ (Enviromine's libraries) dependency-cache/ (Empty) libs/ (The mod jars for the different versions- I am keeping old versions here) natives/ (Various .dll's that I am guessing are core libraries of some sort) resources/ (all the stuff from my resources folder in src- no reference to CoFHCore or Enviromine here) sources/ java/ bottleoblood/ (The source files for my mod) tmp/ (Various random stuff used during compile, nothing relevant here) config/ (The mod config files for running my mod in the dev environment) crash-reports/ (Crash reports produced during testing in my dev enviroment) eclipse/ (Empty folder- can't figure out what it's for. Created during dev environment setup) gradle/ wrapper/ gradle-wrapper.jar gradle-wrapper.properties libs/ (This folder is added to the Build Path for my mod) assets/ cofh/ (CoFHCore's assets) enviromine/ (Enviromine's assets) cofh/ (CoFHCore's libraries) enviromine/ (Enviromine's libraries) CoFHCore.jar Enviromine.jar (The two above jars contained the source for their referenced mods, used in the build.gradle) logs/ (The log files produced during testing within the dev environment) mod resources/ (Various mods that I have additional compatability for, but only if they are present. when not in use, I store them here, to reduce how long it takes to start up the dev environment) mods/ (Mods actively used in the dev environment) resourcepacks/ (Empty folder- would hold resourcepacks for the dev environement) saves/ (Saves created while testing in the dev environment) src/ main/ java/ bottleoblood/ (My Mod's source files) resources/ assets/ bottleoblood/ (My Mod's assets) Changelog.txt mcmod.info And my build.gradle: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.7.10-1.4-Stable" group = "bottleoblood" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "BottleOBlood" minecraft { version = "1.7.10-10.13.2.1230" runDir = "eclipse" } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html compile files("libs/CoFHCore.jar") compile files("libs/EnviroMine.jar") } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion // expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Sorry for all this info, this is probably a bit more than you need, but I have no clue what the issue is, so I thought I would just put everything. please help any way you can.
  2. One of three things. 1: You don't have internet. 2: You have extremely slow internet. 3: A Firewall or some such program is blocking the download.
  3. Ok, thanks so much. sad to hear that there is no universal method for IRecipe. then again, if there was, I bet NEI would be quite a bit more versitile . anyways, thanks for your help. as for custom recipes with IC2 and such, I can use Swing and good old JD-GUI to figure that out.
  4. Well, I looked through your code. the only relevant references to world.isRemote was in your setRotatedMetadata methods. said methods are only called from onBlockAdded. onBlockAdded is only called on serverside, so in your relevant situation, world.isRemote should ALWAYS be false. are you sure you are getting otherwise? if so, then something is very wrong.
  5. What I am attempting to do, is calculate a global "value" for every item in the game, including mods items. now I am aware that this will not be possible, but my goal is to specify the value of various "raw materials" and have my mod dynamically calculate the value of items that are crafted from said raw materials. My problem is, I can't for the life of me determine how to get the regents used in a crafting recipe. I have tried looking at the source code for NEI, but that wasn't very helpful too me. Since I don't even have a clue where to start, I don't have any code to show. In case anybody is wondering, I am making a mod that allows you to create tools from anything, and although I FINALLY got the dynamic tool rendering worked out, this is my next big obstacle. but if I can get this worked out, then there really won't be anything preventing me from completing my mod!
  6. well no, because not only does the above code not work, but even so, it was set up to work entirely read-only. Although, I did finally make working code! (this time I did proper testing ) sadly, this version actually accesses the texture files from the file system, which is not what I wanted... but it will do. public int getAverageColor(ItemStack item){ InputStream is; BufferedImage image; try { UniqueIdentifier UID = GameRegistry.findUniqueIdentifierFor(item.getItem()); String itemID; if(Block.getBlockFromItem(item.getItem()).equals(Blocks.air)){ itemID = UID.modId + ":textures/items/" + UID.name + ".png"; }else{ itemID = UID.modId + ":textures/blocks/" + UID.name + ".png"; } is = Minecraft.getMinecraft().getResourceManager().getResource((new ResourceLocation(itemID))).getInputStream(); image = ImageIO.read(is); }catch(IOException e){e.printStackTrace();return 0;} int[] texture = new int[image.getWidth() * image.getHeight() * 4]; texture = image.getRaster().getPixels(image.getRaster().getMinX(), image.getRaster().getMinY(), image.getRaster().getWidth(), image.getRaster().getHeight(), texture); int r = 0,g = 0,b = 0; int rloops = 0,gloops = 0,bloops = 0; for (int i = 0; i < texture.length; i++) { try{ if(((float)i / 4) * 4 == i && texture[i + 3] >= 255){ r += texture[i]; rloops++; } if(((float)(i - 1) / 4) * 4 == i - 1 && texture[i + 2] >= 255){ g += texture[i]; gloops++; } if(((float)(i - 2) / 4) * 4 == i - 2 && texture[i + 1] >= 255){ b += texture[i]; bloops++; } }catch(Exception e){} } try{ r /= rloops; g /= gloops; b /= bloops; }catch(Exception e){} return new Color(r,g,b).getRGB(); } As for you plan, you could technically change the pixel data as it's looping, although you would need to add some way to do that dynamically. and yes, if you ever made such a change, you would have to make sure you re-call the method in order to get the result.
  7. Ok, turns out it doesn't QUITE work... for some reason it's referencing the lightmap instead of the texturemap, resulting in an item that is flashing various different colors... but yes, it would need to be re-called whenever the pixel data where to change.
  8. Ignore what that other guy said about the MaxPermSize, you're doing that fine. I am pretty sure that the issue is that you are either missing some server libraries, or you are trying to run client side mods on the server.
  9. A Quick followup on how it went. I got it working! I didn't use FrameBufferObject or any of what you guys where suggesting, but you DID get me looking into LWJGL and OpenGL, and in the process I found my solution. public int getAverageColor(ItemStack item){ TextureAtlasSprite tas = (TextureAtlasSprite)item.getIconIndex(); ByteBuffer pixels = BufferUtils.createByteBuffer(Math.max(tas.getIconWidth() * tas.getIconHeight(),1024)); //if(Block.getBlockFromItem(item.getItem()) == Blocks.air){ GL11.glReadPixels(tas.getOriginX(), tas.getOriginY(), tas.getIconWidth(), tas.getIconHeight(), GL11.GL_RGBA, GL11.GL_BYTE, pixels); //} byte[] texture = new byte[pixels.remaining()]; pixels.get(texture); //BufferedImage bufimage = new BufferedImage(texture.length, texture.length, BufferedImage.TYPE_INT_ARGB); int r = 0,g = 0,b = 0; for (int i = 0; i < Math.sqrt(texture.length); i++) { for (int j = 0; j < Math.sqrt(texture.length); j++) { byte pixel = texture[(i + (j * tas.getIconWidth()))]; Color color = new Color(pixel); r += color.getRed(); g += color.getGreen(); b += color.getBlue(); } } r /= texture.length; g /= texture.length; b /= texture.length; return new Color(r,g,b).getRGB(); } Thanks for all your help!
  10. I don't know how I could utilize that link to set it myself.
  11. Oh O_O Kden, this is beyond my expertise then. have fun!
  12. There are various different ways of accomplishing that, but if you can convert the ResourceLocation to an IIcon, you can use IIcon.getItemHeight() and IIcon.getItemWidth() EDIT: If you can retrieve an instance of the IIconRegister, you can use: IIcon icon = (IIcon)IIconRegister.getAtlasSprite(ResourceLocation.toString());
  13. I know this. I think he was asking how to get his item to change texture without triggering that animation. that is what I was attempting to help him with.
  14. I would like the forge modder status. I am working on a few different mods, including a few addons for other mods. only one of them is publicly available: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2379950-aether-ii-addon-aetheric-expansion Two of my other mods are privately used in a modpack on the Feed the beast launcher called "CrinkleCraft: A World Of Horror"
  15. Initialize your items in the init() method of your main file . that's the answer to the first two questions.
  16. Although, I, Myself don't know how to do this, looking around in the source code of other mods can be surprisingly helpful. try checking out the source for EnderIO, there are a few items in that which accomplish this. Specifically I am thinking of the yeta wrench.
  17. I don't know myself, but If you just dig around in the code a bit you should be able to find how vanilla does it.
  18. I can't tell most of what you are saying, but one thing I can say is, the way the vanilla bow works is with a custom animation. whenever an item's ID changes, it triggers the animation, but the bow doesn't change ID at all while it is being pulled back, it's just an internal variable that saves the pulled-back-ness of it, and triggers certain frames in the animation.
  19. just replace natives-linux with natives-windows
  20. Just create a seperate method and call it in the order you want the items to show in the creative inventory.
  21. if(FMLCommonHandler.instance().getSide().equals(Side.CLIENT)){ //do client side stuff here } Be wary though, although I have never had problems with it, I have heard of people having issues where it returns true on an integrated server.
  22. Um, you shouldn't be using your server proxy, you should be registering your gui handler instead .-. Also, you shouldn't be putting MainRegistry as your instance, you should be putting the instance of your main mod class.
  23. I think he is trying to use events to prevent the player from selecting a different item in the hotbar. Like adding custom scroll functionality to an item or something.
  24. Most events are referenced on both sides, but since the server can't pick up on a specific player's key presses, it should never technically get called on the server. It would probably be a good idea to insert a check just to be safe though.
×
×
  • Create New...

Important Information

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