Jump to content

Mecblader

Members
  • Posts

    225
  • Joined

  • Last visited

Everything posted by Mecblader

  1. I'm not entirely sure, but you may be able to do all the calculation on the server and use a packet handler to send the data to the client and have the client render the model.
  2. Hello, I need to be able to detect a specific entity or an entity in a specific x, y, z, and if there are more than one entity in a specific location. All help is appreciated. Thank You!
  3. There are multiple places where the Furnace code is so here are the package names: net.minecraft.block net.minecraft.tileentity net.minecraft.client.gui.inventory I'm sure you could probably fine the classes from there. Good Luck
  4. I believe that you don't need to mess around with .ogg files because forge adds support for other audio file formats.
  5. Hello, I need to be able to edit player attribute, specifically generic.attackDamage. Is there a method that does this because I have tried searching, but I could not find it and I tried NBT data, but I do not really know how to use it well. All Help is appreciated. Thank You in Advance!!!
  6. I just tried to update to my mod from 1.6.4 to 1.7.4 and It was hit very hard. I don't know much about 1.7 yet and there are not many tutorials to follow, so I would appreciate it if people can help my fix my problems. I would like help with the following problems: (I know its a lot and not well organized & I apologize) - They changed the block id system, so for setting blocks and getting blocks, how does that and they whole block system work now and are items impacted? - What happened to @NetworkMod and How can I initialize my packet Handler, packetHandler channels, and other stuff - TickRegistry Class? - Icon Registry and Textures? - Registering things like Player Tracker - Language and Block Registry - Everything Else That You Think That Would Help Me!!!
  7. Hello, I have three mod that are currently in heavy development for 1.6.4. I am looking for advise on weather or not I should up date to 1.7. My mods are very in depth and I have been reluctant to update to 1.7 because I have heard that a lot of the methods have no been named so it would be difficult to update. All feedback is appreciated. Thank You in advance!!!
  8. Hello I am making a mod where i need to be able to detect when a mob spawns and then edit it by giving it a semi-random health and a custom NBT Lvl. Basically I need to be able to edit every mob that spawn via spawners and mob eggs. Also If any one knows how I can edit the name plate of named mobs to display this custom Lvl of mine. All help is appreciated. Thank You in advance!
  9. I need it for the player because I want to tp the player and adjust the rotation when he/she types in a command, but right now it is calculation too quick to see the player move.
  10. do you have your resource location linked up right in eclipse. Hint: If you have recently put in a texture into the folder for your mod, then you sometimes need to refresh eclipse in order for them to show up in eclipse Good Luck
  11. Note:This Works in 1.6.4, I don't know about 1.7.2 If you want to store NBT Data then you can try this: method(EntityPlayer player) { player.getEntityData().setInteger("IntegerName", 1); int i = player.getInteger("IntegerName"); if(player.getEntityData().hasKey("IntegerName")) { do stuff } You can then add anything you want after the getEntityData().
  12. Hello I am looking for simple, but efficient delay timers. I have tried to make some, but they often cause severe performance drops. I need it for a method that is called only once. i Have tried to make a timer with loop and using NBT data, but I can't seem to figure it out. Is there a way that I can select how fast is runs through the method.
  13. You may be able to do two things. One, you can make a block break listener, but might be a little long winded. Two, you can make the mining lvl required to mine the block a larger amount than the vanilla tools. Here is the code: MinecraftForge.setBlockHarvestLevel(Block, "tool", lvl); e.g. MinecraftForge.setBlockHarvestLevel(Mod.MySpecialBlock, "pickaxe", 1);
  14. As I said in the title I would like to know how to make a custom key binding. I would appreciate any help anyone one can give. Thank you in advance!
  15. Hello I am making a mod that has custom levels and those levels determine if the player is a high enough level to use a certain tool and if they are not it displays a chat message. My issue is that the check for that is in a method that is called very often so the chat message gets spammed. I was wondering if there is some sort of timer already built into forge or minecraft that could let me limit the number of times the chat message is displayed to a certain amount like a certain amount of ticks. Also I was wonder if someone could tell me how to add key binding that the player can customize in the controls menu or point me to somewhere I can find out. Thanks in advance!
  16. Thak You I did, but I misspelled the channel name. Sorry for the late response, my Internet went down for some reason.
  17. I changed the channel name and I still get no response, from what I know is calling the the send packet method, bit nothing comes out when I do the check in the Packet Handler
  18. Hello, I have added a packet handler to my mod and it doesn't work. I have never used or known much about them until today. I followed a tutorial and I get no errors, but I never receive the info in the packet. Since I don't really know much about Packet Handling, I don't really know whats wrong or what could be wrong with this. Sorry my code is messy. I have been trying a lot of stuff and am basically trying to get the code functional before I try to make it more organized. I would appreciate any help anyone can give. Tutorial: http://www.minecraftforge.net/wiki/Packet_Handling Packet Handler: package mod.xtronius.rc_mod.handlers; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; public class PacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { System.out.println("hello"); if (packet.channel.equals("RC_ModWoodCuttingLvl")) { handleWoodCutting(packet); } } private void handleWoodCutting(Packet250CustomPayload packet) { DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); float WoodCuttingLvl; try { WoodCuttingLvl = inputStream.readFloat(); } catch (IOException e) { e.printStackTrace(); return; } System.out.println("[Rune-Craft]" + " Client- " + WoodCuttingLvl); } } Method Were Packet is Sent: public float woodBreakSpeed(World world, EntityPlayer player, PlayerXPValue xpValue, Block block, int x, int y, int z) { Item tool = eventBlockReplace.getTool(player); int toolLvl = eventBlockReplace.getToolLevel(player); int meta = block.getDamageValue(world, x, y, z); float toolSpeed = eventBlockReplace.getToolSpeed(player); float Wood = 4.5F; float Yew = 0.75F; float Oak = 2.5F; float Teak = 1.5F; if(meta == 0) { if(toolLvl == 1 || toolLvl == 2 || toolLvl == 3 || toolLvl == 4 || toolLvl == 5) { if(!world.isRemote){ float WoodCuttingLvl = ((Wood*toolSpeed) * (lvlManager.getLvl(player, "WoodCuttingLvl")/10)); ByteArrayOutputStream bos = new ByteArrayOutputStream(4); DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeFloat(WoodCuttingLvl); } catch (Exception ex) { ex.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "RC_ModWoodCuttingLvl"; packet.data = bos.toByteArray(); packet.length = bos.size(); if (!world.isRemote) { System.out.println("Running - Server"); We are on the server side. EntityPlayerMP playerObj = (EntityPlayerMP) player; PacketDispatcher.sendPacketToPlayer(packet, (Player)player); } else if (world.isRemote) { // We are on the client side. //EntityClientPlayerMP playerObj = (EntityClientPlayerMP) player; // playerObj.sendQueue.addToSendQueue(packet); } else { // We are on the Bukkit server. } //System.out.println(((Wood*toolSpeed) * (lvlManager.getLvl(player, "WoodCuttingLvl")/10))); } return ((Wood*toolSpeed)); } } else if(meta == 1) { if(toolLvl == 5) { //eventBlockReplace.setWoodSpeed((Yew*toolSpeed)); return (Yew*toolSpeed); } } else if(meta == 2) { if(toolLvl == 1 || toolLvl == 2 || toolLvl == 3 || toolLvl == 4 || toolLvl == 5) { //eventBlockReplace.setWoodSpeed((Oak*toolSpeed)); return (Oak*toolSpeed); } } else if(meta == 3) { if(toolLvl == 4 || toolLvl == 5) { //eventBlockReplace.setWoodSpeed((Teak*toolSpeed)); return (Teak*toolSpeed); } } else System.out.println("[Rune-Craft] Error - WoodBreakSpeed Method"); return 0; }
  19. I just keep one just for the sake of having it. I have many of my projects setup this way and I am just too lazy to get rid of the Language Registry. Is there a benefit of getting rid of the Language Registry?
  20. Did you check the zip file are the images in there?
  21. I have separate classes for my Game Reg and Language Reg. Basically I have separate classes for alot of stuff because I don't like having alot of code in my main mod class. [Opinion] Pros: Every thing is cleaner and complected Item, Blocks, and Features are easier to program and easy to find stuff. Cons: It takes more time to make simple things like regular blocks and Items that have nothing special because you need to go to all these different classes to so different things. I have my mod setup like this (Note I am still in early development so it is not really clean yet): Main Mod Class: package mod.name.mod; /** * Mod * * Mod * * @author name * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) * */ @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class mod { @Instance(Reference.MOD_ID) public static mod instance; @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; public static IDHandler RCconfigidhandler; public static BlockInitializer RCblockinitializer; public static BlockRegistry BlockReg; public static LanguageRegistry LanguageReg; EventManager eventmanager = new EventManager(); /*** * This is code that is executed prior to your mod being initialized into of Minecraft * Examples of code that could be run here; * * Initializing your items/blocks (you must do this here) * Setting up your own custom logger for writing log data to * Loading your language translations for your mod (if your mod has translations for other languages) * Registering your mod's key bindings and sounds * * @param event The Forge ModLoader pre-initialization event */ @EventHandler public void preInit(FMLPreInitializationEvent event) { RCIDHandler.RegConfigIDs(event); new EnumModToolMaterial(); new BlockInitializer(); new ItemInitializer(); new EventInitializer(); } /*** * This is code that is executed when your mod is being initialized in Minecraft * Examples of code that could be run here; * * Registering your GUI Handler * Registering your different event listeners * Registering your different tile entities * Adding in any recipes you have * * @param event The Forge ModLoader initialization event */ @EventHandler public void init(FMLInitializationEvent event) { BlockRegistry.BlockReg(); LanguageRegistry.LanguageReg(); GameRegistry.registerWorldGenerator(eventmanager); GameRegistry.registerPlayerTracker(PlayerTrackerHandler.instance); NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler()); } /*** * This is code that is executed after all mods are initialized in Minecraft * This is a good place to execute code that interacts with other mods (ie, loads an addon module * of your mod if you find a particular mod). * * @param event The Forge ModLoader post-initialization event */ @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.registerRenderInformation(); proxy.initSounds(); } public Mod() {} } Block Registry: package mod.name.mod.handlers; import mod.name.mod.block.yourBlock; import cpw.mods.fml.common.registry.GameRegistry; public class BlockRegistry { public static void BlockReg() { } } Language Registry: package mod.name.mod.handlers; public class LanguageRegistry { public static void LanguageReg() { } } Message me if you want me to show how I setup some of my other classes, if you like my setup.
  22. I have never used packets or know much about them can you point me towards a tutorial or something that I can reference in order to help myself.
  23. The nbt data is stored in the server and I need to return the value to the client. For example, I have the wood cutting level stored in the server and I need to get that level and multiple it by a few numbers and return that value to the client so it can update the break block speed. Do know of a way to get the value from the server and return it to client because If I take the value from the client it returns 0.
  24. Hello, I am making a mod that has a level system, for example wood cutting level. I have the Level System working fine, but when I try to get the level in a method that is called very frequently, it is a method that listens to when a player starts to break a block and then adjusts the break block speed, using this PlayerEvent.BreakSpeed, It some times returns 0 and then other times the level of the player, for example 3. I'm not sure why this is occurring. Could someone please explain why this is happening and any possible ways that I could fix or get around this? Sample Return Values: 2014-02-09 09:47:23 [iNFO] [sTDOUT] 3 2014-02-09 09:47:23 [iNFO] [sTDOUT] 0 2014-02-09 09:47:23 [iNFO] [sTDOUT] 0 2014-02-09 09:47:23 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 0 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:25 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 0 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:28 [iNFO] [sTDOUT] 3 2014-02-09 09:47:29 [iNFO] [sTDOUT] 3 2014-02-09 09:47:29 [iNFO] [sTDOUT] 0 2014-02-09 09:47:29 [iNFO] [sTDOUT] 0 2014-02-09 09:47:29 [iNFO] [sTDOUT] 3 2014-02-09 09:47:29 [iNFO] [sTDOUT] 0 2014-02-09 09:47:29 [iNFO] [sTDOUT] 3 2014-02-09 09:47:29 [iNFO] [sTDOUT] 0 2014-02-09 09:47:29 [iNFO] [sTDOUT] 3 2014-02-09 09:47:29 [iNFO] [sTDOUT] 3 2014-02-09 09:47:29 [iNFO] [sTDOUT] 0 2014-02-09 09:47:29 [iNFO] [sTDOUT] 0 2014-02-09 09:47:29 [iNFO] [sTDOUT] 3 2014-02-09 09:47:30 [iNFO] [sTDOUT] 0 2014-02-09 09:47:30 [iNFO] [sTDOUT] 3 2014-02-09 09:47:30 [iNFO] [sTDOUT] 0 2014-02-09 09:47:30 [iNFO] [sTDOUT] 3 2014-02-09 09:47:30 [iNFO] [sTDOUT] 3 2014-02-09 09:47:30 [iNFO] [sTDOUT] 3
  25. Hello, I am making a mod that is going to have a custom level system. I was thinking about using an external file to store the data, but I don't know how to do or to set that up. I have a decent knowledge about java, but I just know how to do this. Also I would like to know how to set up key bindings that would show up in the controls game menu. I am basically looking for suggestions on what the best way to do this. I would appreciate if anyone can give me a reference or place to start because I have tried figuring it out using open source mods, but the really good open source mods like buildcraft are a bit confusing to understand and redo what they did in my mod. Basically I am just looking for suggestions and tips. Thanks in Advance for any help you all can give.
×
×
  • Create New...

Important Information

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