Jump to content

mjhotdog

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by mjhotdog

  1. Thank you. I was poking around there and hadn't yet looked at the contract. I am not at my terminal right now, but i don't remember getting a warning about possible loss of precision going from 'int' to 'short'.
  2. Thank you. The TileEntity is here: https://github.com/Justmakinmusic/Diamerald/blob/1.7/src/main/java/jmm/mods/Diamerald/tileentity/TileEntityGrinder.java The other pieces are under jmm/mods/Diamerald.
  3. If it is a packet problem, where would that code be? (I have not written any "packet" code.) What do you need to see? My TileEntity, my GuiContainer, my Container, my Machine class? Does it have anything to do with Nbt-related code?
  4. I have a machine patterned after a minecraft furnace in which I display the remaining burnTime in the Gui. I have changed all related 'short' in my code to 'int' (even in Nbt code). When I run it on Single Player the Gui works as desired, displaying the progression of values 20000, 40000, and 60000. When I make a Server and run Multiplayer, my machine's Gui displays 20000, -25536, -5536. Why would the server make it behave differently? int myBurnTime = 60000; I was using Integer.toString(myBurnTime) when I display the value (worked fine on client, not on server). I tried String.valueOf((long)myBurnTime)--it had the same problem. Does anyone know if there is some reason the server-side values would act like 'short' while the client-side values continue to act 'int'?
  5. The src/main/java he's talking about is the one at the top. If you want multiple mods in one project, declare them in packages and put them under the src/main/java at the top as stated above, (if you're only doing one, follow the same pattern), e.g., package com.darkfangs.darkfangsmod goes in path src/main/java/com/darkfangs/darkfangsmod, and package com.darkfangs.lightfangsmod goes in path src/main/java/com/darkfangs/lightfangsmod. Texture assets would go in src/main/resources/assets/darkfangsmod/textures and src/main/resources/assets/lightfangsmod/textures. They won't build as separate mod jars, but both mods will appear as separate mods in Minecraft when you load it.
  6. Is your hasUpgrade() function (at the bottom of your TileEntityCarbonWeaver code) working? Or is that where you need the help comparing?
  7. Does it make a difference if you put the ItemStack in an Object[]? GameRegistry.addShapelessRecipe( new ItemStack(ItemStore.itemY), new Object[]{ new ItemStack(ItemStore.itemX, 3)});
  8. You're right! Sorry! Maybe we can apply the same idea to cookTime to get to the end faster. if (this.hasPower() && this.canFragment()) { this.cookTime+=this.cookRate; // this.cookTime++; You may need to change your if statement like this: if (this.cookTime >= Speed)
  9. It should be in the forge project folder /src/resources/assets/yourmod/...
  10. From your code, it looks like you are consuming all available fuel into a power bar that you decrement as the fuel is used. One way you can make the bar move faster: decrement this.power by more than 1, e.g., in updateEntity() // test with this.power -= 2; this.power -= this.itemBurnRate; // instead of this.power-- in updateEntity() You would set itemBurnRate according to the kind of fuel you are adding to power. This would have to be done around here: this.power += getPower(this.slots[1]); You could make a function to return the itemBurnRate depending on the fuel type. It looks like you might have to add some kind of way to keep track of the fuel types you have added if you want to distinguish which fuel added what amount to the total 'power' available. I hope this helps a little! Your idea looks cool!
  11. Do you remember if you messed with if (!this.worldObj.isRemote) in your TileEntitySteelifer class? As I understand it, the (!this.worldObj.isRemote) is needed to keep the client and server objects in the right places; if that is not in the right place, objects won't be available where they are needed. I had a tough time getting my mod elements all to behave well between client and server if that was not used appropriately. (I still don't yet completely understand it.) I would have suggested your getBlock() function, but if it worked in single player, your FreshPower.getBlock("fp_steelifierActive") should be working correctly. What does your getBlock() function look like?
  12. Was the recipe issue that you were missing a space in the first string?
  13. BTW Re: double creation of items. I have put some thought into this as well. If you do not create your item because some other mod creates a similar item, then someone else's mod that depends on YOUR mod might break because of the combination of mods. I, too, hate the duplicate items when running multiple mods, but I am not sure what the ultimate solution should be. Cheers!
  14. Does someone know whether sndHandler.playSound() is more or less efficient for repeating a short sound file for a long period of time compared to worldObj.playSoundEffect()? (Or would it be better to have a single long sound file repeating the sound?) I have tried each way of producing sound, and they sound fine, but I would like to move on to other parts of my mod, and if someone has already determined this, I would like to avoid having to do extensive testing of this myself. Thanks!
  15. If the mod is using the GameRegistry, you are supposed to be able to get elements by using functions like: GameRegistry.findItem("modname", "registeredItemName") GameRegistry.findBlock("modname", "registeredBlockName") Sometimes the modname is not obvious. You might have to ask around for particular mods. I use findItem in my own mod recipes just to make sure GameRegistry is working correctly: GameRegistry.addSmelting(GameRegistry.findItem("MJHotdog", "RawFrank"), new ItemStack(MJHotdog.CookedFrank, 1), 300.0f); I wish I could get GameRegistry to work with Thermal Expansion...
  16. Where is the code for PacketRefreshExp? I keep seeing the code for PacketRequestChangeExp.
  17. Which is the best way to play sounds that will be sustained for a machine for a long time, e.g., a sawmill sound? sndHandler.playSound(ISound) lets me turn the sound on (for as long as I want with automatic repeat) and off when I desire. Very cool, but takes _a lot_ of other code. worldObj.playSoundEffect(x,y,z,"soundname",volume,pitch) is super-easy, but it has to keep being called over and over to play the sound in a sustained way, and yet turn off when I desire. Which way is most likely to lag the system if I have a dozen machines running in close proximity to one another? Is either one significantly more efficient than the other for playing sustained effects that need to be turned off at will?
×
×
  • Create New...

Important Information

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