Jump to content

mrkarp

Members
  • Posts

    24
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

mrkarp's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. mrkarp

    TextureFX

    Wow was i tryin to hard! But im still struggling, almost!!!! almost! Here is my FX class: package karbide.FX; import java.io.IOException; import net.minecraft.client.renderer.RenderEngine; import net.minecraft.src.ModTextureAnimation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.TextureFXManager; public class KbrickFX extends ModTextureAnimation { public KbrickFX(String texture, int index) throws IOException { super(index, 1, texture, TextureFXManager.instance().loadImageFromTexturePack(FMLClientHandler.instance().getClient().renderEngine, texture), 5); } @Override public void bindImage(RenderEngine renderengine) { //Binds texture with GL11 to use specific icon index. GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderengine.getTexture("/gfx/tools.png")); } } and here is the block that im tryin to animated: package karbide.blocks; import java.util.Random; import karbide.client.ClientProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.world.World; public class Block_KBrick extends Block{ public Block_KBrick(int id, int texture, Material mat){ super(id, texture, mat); this.setCreativeTab(CreativeTabs.tabBlock); } public String getTextureFile(){ return "/gfx/block_block.png"; } @Override @SideOnly(Side.CLIENT) public int getRenderType() { return ClientProxy.RENDER_ID; } public boolean renderAsNormalBlock() { return false; } public boolean isOpaqueCube() { return false; } } I also noticed that I need TextureFXManager.instance().addAnimation(new KbrickFX("/gfx/tools.png", KarbideCore.ANIMATED_TEXTURE_INDEX+1)); } catch (IOException e) { e.printStackTrace(); } And public static int RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); In my client proxy. I know im close becuase its no longer the original texture, its clear, see through, but thats a start. Im catching on, just need some help in what is causing it to not read the png file. Appreciate all the help.
  2. mrkarp

    TextureFX

    Well after reading more and more, It looks like instead of tryin the advanced way, making a byte array, Looks like i should use the .gif method: public void onTick() { Object imageData; switch (frame) { case 0: imageData = frame1; break; case 1: imageData = frame2; break; case 2: imageData = frame3; break; case 3: imageData = frame4; break; default: break; } } But, what does the frame 1-4 mean, I think I replace them with the texture slot I want right?
  3. So to my understanding, this is how you get a block to look animated right, such as: http://xycraft.wikispaces.com/Xychoridite+Bricks They look all wavey and liquid like. Ive seen multiple listings on how to accomplish this, but I am still unable to even get the code right. Here is the example code I have been following. private byte bg[] = new byte[1024]; public TextureSomethingFX() { super(myIconIndex); try { loadBG(ImageIO.read(this.getClass().getResource("textures/background.png"))); } catch (IOException e) { e.printStackTrace(); } } private void loadBG(BufferedImage bi) { for (int row=0;row<16;row++) for (int col=0;col<16;col++) { int pixel = bi.getRGB(col, row); bg [((col+(row*16))*4)+0] = (byte)((pixel>>16)&0xFF); //Red bg[((col+(row*16))*4)+1] = (byte)((pixel>>&0xFF); //Green bg [((col+(row*16))*4)+2] = (byte)((pixel)&0xFF); //Blue bg [((col+(row*16))*4)+3] = (byte)((pixel>>24)&0xFF); //Alpha } } Now, I know to replace the loadBG(ImageIO.read(this.getClass().getResource("textures/background.png"))); With the png I have, but do I put this code in my block code, or my core mod file? And also, this will have 16 diffrent cycles right? Appreciate it.
  4. Hmm, so thats what the par1 == 7 is about, the metadata! oh, so at its last instance before it breaks it decieds if it drops a ore or a gem? And love the Star Trek Skin.
  5. Ya I can kinda understand the code of the tileEntty, but I just cant manage to get it down enough to make my own furnace for instance, Ive gotten it written out and placeable and working, but boy did I not understand anything about the code I was following. I love learning it though, and my Java programming class is helping, Il get there! I appreciate all this input. Thanks Gentlemen.
  6. Ok, well still havent got tile entities working, or the understanding of them enough to try one yet. I appreciate the help!
  7. Ok so I guess : FurnaceRecipes.smelting().addSmelting(ITEM OR BLOCK, int, new ItemStack(ITEM OR BLOCK, int, int), float); is used for smelting things with metadata like wool or something. So not what I am looking for.
  8. Is this possible? Ive been poking around on the net, and didnt find anything conclusive yet, so far this has interested me, FurnaceRecipes.smelting().addSmelting(ITEM OR BLOCK, int, new ItemStack(ITEM OR BLOCK, int, int), float); is this used for what I am seeking? or can I add code to the ussual: GameRegistry.addSmelting(item or block), new ItemStack(item or block, int), float);
  9. Hello, I am stuck on having an ore that is generated in the world drop and item, and another item. Ive looked at the crops block to see how wheat did that with seeds and wheat, but I cannot figure it out. protected int getGemItem() { return KarbideCore.tungstenite.itemID; } protected int getOreItem() { return KarbideCore.karbide.itemID; } public int idDropped(int par1, Random par2Random, int par3) { return par1 == 7 ? this.getOreItem() : this.getGemItem(); } public int quantityDropped(int meta, int fortune, Random random){ return 1 + random.nextInt(2); }
  10. Question, what is the bbv? Im tryin to see what I should be looking for.
  11. Well shoot, So my rendering is tryin to fetch a client side only class. Thank you sir, Lets see if I can fix it.
  12. So Im tryin to start up my server after updating my mod, and now im getting this. [iNFO] Starting minecraft server version 1.4.7 [WARNING] To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar" [sEVERE] Encountered an unexpected exception NoClassDefFoundError java.lang.NoClassDefFoundError: bbv at karbide.common.KarbideCore.<clinit>(KarbideCore.java:60) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:418) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83) at cpw.mods.fml.common.Loader.loadMods(Loader.java:479) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:86) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at ho.c(DedicatedServer.java:64) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458) at fy.run(SourceFile:849) Caused by: java.lang.ClassNotFoundException: bbv at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:185) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 29 more Caused by: java.lang.NullPointerException at org.objectweb.asm.ClassReader.<init>(Unknown Source) at codechicken.core.asm.ClassHeirachyManager.transform(ClassHeirachyManager.java:80) at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:228) at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:173) ... 31 more [sEVERE] This crash report has been saved to:\crash-reports\crash-2013-02-19_02.30.13-server.txt at karbide.common.KarbideCore.<clinit>(KarbideCore.java:60) Thats mine, wth library am I missing? and or Ive recently created my own mob, and was unclear on how to use my own sounds, so I poked around and got it to work, would that cause this? But, like always its probally right in fron of my face.
  13. Aw, well sorry for not seein that in the ItemFood, but i really appreciate the info! thank you guys so much.
  14. Eat some food, mostly a custom food when your hunger bar is full. I know its possible, i saw it somewhere on teh webs, but for the past 3 hours of searching i cannot, someone shed some light on this?
  15. well anyone having this issue, here was my fix public static ClientProxy proxy = new ClientProxy(); should been public static CommonProxy proxy = new ClientProxy(); yay! learning!
×
×
  • Create New...

Important Information

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