-
Posts
444 -
Joined
-
Last visited
Everything posted by brandon3055
-
I just discovered a problem with my packet system and im hoping someone here can help figure out how to fix it. First off what exactly dose this mean? [06:46:21] [server thread/ERROR] [FML]: Detected ongoing potential memory leak. 100 packets have leaked. Top offenders [06:46:21] [server thread/ERROR] [FML]: DraconicEvolution : 100 [06:47:33] [server thread/ERROR] [FML]: Detected ongoing potential memory leak. 200 packets have leaked. Top offenders [06:47:33] [server thread/ERROR] [FML]: DraconicEvolution : 200 [06:47:49] [server thread/ERROR] [FML]: Detected ongoing potential memory leak. 300 packets have leaked. Top offenders [06:47:49] [server thread/ERROR] [FML]: DraconicEvolution : 300 [06:48:03] [server thread/ERROR] [FML]: Detected ongoing potential memory leak. 400 packets have leaked. Top offenders [06:48:03] [server thread/ERROR] [FML]: DraconicEvolution : 400 [06:48:43] [server thread/ERROR] [FML]: Detected ongoing potential memory leak. 500 packets have leaked. Top offenders [06:48:43] [server thread/ERROR] [FML]: DraconicEvolution : 500 It pops up whenever i click a button in one of my guis 100 times (so for every 100 packets sent) I am using SanAndreasP's packet handling system (it was suggested by SanAndreasP not sure who came up with it)
-
I cant see where the problem is but you can simplify the code a bit. 1. You dont need to extract energy. Anything that generated or stores energy will automatically output it to your tile. 2.For the same reason it dosnt matter if you try to output energy to the tile you are receiving it from because it shouldn't accept it.
-
He is asking how to read lore not how to add it. Why do you want to be able to read item lore? it dosnt exist in the game unless it is added by a mod or added to an item using an nbt editor. To read it you need to first find out what nbt tag item lore uses the just check if that tag exists on the item and if so read its value. I recommend you make an item nbt helper class to make this easier. my item nbt helper class. to use it you would do something like String loreLine1 = ItemNBTHelper.getString(itemstack, "tag", "");
-
The problem is when the tile is unloaded and reloaded the nbt is only loaded on the server to fix this add the following methods to your tile. @Override public Packet getDescriptionPacket() { NBTTagCompound tagCompound = new NBTTagCompound(); writeToNBT(tagCompound); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tagCompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); } they will read the nbt from the server and send it to the client. they are called every time the tile is loaded or the block is updated.
-
Draconic Evolution version 0.9.5-beta is now public! Change log: -Added safety matches -Recipe Handler now uses the ore dictionary -Added charged versions of all the tools to the creative menu -Added Ender Comets -Added Chaos Islands (WIP) -Added Chaos Guardian (OP Enderdragon) -Adjusted the ender arrow range -Added Admin spawn egg (a spawn egg that can be set to any custom entity) -Ender arrow damage is now based on the distance travelled (100 blocks is fatal without fall protection of some sort) -Draconic helm clears negative potion effects -Added Draconic Evolution info guide (An in game information gui similar to those used by other mods) -Added Diss-Enchanter -Added Pigmen Blood Rage -Moved camouflage slot in advanced player detector gui. -Advanced player detector now shows that block it is camouflaged as in its mouse over text (e.g. WAILA) -Placed items are now solid. -All mobs killed by the mob grinder now drop loot and player only loot. http://minecraft.curseforge.com/mc-mods/223565-draconic-evolution/files/2217411
-
It sounds like you are doing something wrong. I have only been modding for a little while (since 1.7.2) but i have found it really easy even with my very limited java knowledge (i am learning java at the same time i am learning to mod) Most of the minecraft src files should be de-obfuscated for you if you have setup your workspace properly. When you say you have to re-develop for every release do you mean every release of minecraft? or forge? If you just started yesterday i dont see how there could have been a lot of updates to ether...
-
Pahimar has a great tutorial on keybindings he hasnt discussed packet handling yet but Diesieben07's tutorial should be able to help you with that.
-
I dont want to spent any time debugging your code for you but i will tell you that the client and server handle things differently especially when it comes to rendering so some of the variables you were using probably have slightly different values in the client and server. But that is just an guess.
-
Yes the answer is simple. Update to 1.7.10 then come back if you have any more trouble. If you are doing 1.7 then you are doing things very wrong you should not be using id,s in 1.7+
-
This should also help you figure out how it works. Its exactly the same code just spread out a bit to make it easier to read. if ((storage.getEnergyStored() > 0)) { for (int i = 0; i < 6; i++){ //ForgeDirection is a useful helper class for handling directions. int targetX = xCoord + ForgeDirection.getOrientation(i).offsetX; int targetY = yCoord + ForgeDirection.getOrientation(i).offsetY; int targetZ = zCoord + ForgeDirection.getOrientation(i).offsetZ; TileEntity tile = worldObj.getTileEntity(targetX, targetY, targetZ); if (tile instanceof IEnergyHandler) { int maxExtract = storage.getMaxExtract(); //Gets the maximum amount of energy that can be extracted from this tile in one tick. int maxAvailable = storage.extractEnergy(maxExtract, true); //Simulates removing "maxExtract" to find out how much energy is actually available. int energyTransferred = ((IEnergyHandler) tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), maxAvailable, false); //Sends "maxAvailable" to the target tile and records how much energy was accepted. storage.extractEnergy(energyTransferred, false);//Extract the energy transferred from the internal storage. } } } @SanAndreasP Thanks for letting me know about the redundant null check.
-
Pipes wont extract energy from your tile your tile needs to send the energy to the pipes. Here is the code i use to output energy from my tiles. @Override public void updateEntity() { if ((storage.getEnergyStored() > 0)) { for (int i = 0; i < 6; i++){ TileEntity tile = worldObj.getTileEntity(xCoord + ForgeDirection.getOrientation(i).offsetX, yCoord + ForgeDirection.getOrientation(i).offsetY, zCoord + ForgeDirection.getOrientation(i).offsetZ); if (tile != null && tile instanceof IEnergyHandler) { storage.extractEnergy(((IEnergyHandler)tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), storage.extractEnergy(storage.getMaxExtract(), true), false), false); } } } } Hope this helps.
-
RedPower is a few versions behind the current forge version... Unless he means project red.
-
your best bet is probably to use LivingDeathEvent to detect when your mob dyes and you should also be able to get the player that killed it.
-
You have an infinite loop where the condition in the for loop is always true this cocks the came at that line. If you are still able to move around in the world it must be server side. I havent had a good look at your code but is shouldnt be to hard to find. Pro tip i like to avoid while loops for this reason if there is another way to do it but in a case like yours i always at a break condition to exit the loop if it gets stuck. Usually i have an int that increments each loop and if it exceeds a certain value it breaks the loop.
-
I have never used reflection and from what i have read is is best to avoid it unless absolutely necessary but if there is no other option i will look into it. Edit: I got it to work thanks for your help.
-
An item frame is both an item and an entity. Its an item that places an entity when right clicked. You should be able to just copy the item and entity classes without changing much you will just have to make some adjustments to the entity renderer to get it to look the way you want.
-
I believe you need to use @Mod.Instance(References.MODID) (many both work) and it needs to be assigned to an instance variable e.g. @Mod.Instance(References.MODID) public static DraconicEvolution instance;
-
I decided to create a new thread for this because its a different problem. I am making a mob grinder that uses a fake player to do the killing and for the most part it works fine but but i am having problems when other mods try to do certain things to it (in this case the other mod is Infernal Mobs). At first i had a problem when an infernal mob tried to affect the fake player with a potion effect but i have since fixed that now i am having trouble when a mob tries sent a data packet to the fake player. I have tracked the problem to playerNetServerHandler in my fake player is null which is giving a null pointer exception in FMLOutboundHandler. Crash log Unfortunately finding the problem was the easy part i have been working on this for over a day and havent even come close to finding a solution yet. Im hoping someone more experienced can help me with this problem.
-
do you mean you are trying to set the item texture? if so you are doing it very wrong. Or are you using a custom item renderer?
-
If you use that code to teleport to a location that has not yet been generated it places you in the world before the world is actually generated so it is possible to fall out of the world. Look at the vanilla Teleporter class and you should be able to figure out how to fix that (that is one of the reasons for the nether portal)
-
Really? i was having that problem in 1.7.2 whenever i teleported from the end but it seemed to be fixed in 1.7.10... if it is happening when you teleport from the end i fixed it by running thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, dim, new CustomTeleporter(thePlayer.mcServer.worldServerForDimension(dim), x, y, z, yaw, pitch)); twice if the player was in the end.
-
that should only consume 1 item please show your code.
-
forge fake player problem [Partially Solved]
brandon3055 replied to brandon3055's topic in Modder Support
I just encountered another crash but i think this may be a bug with Infernal Mobs but im not sure... It seems to be a network problem but im not sure exactly. Edit: I just got a slightly different one that seems to be related to the same thing. I would really like to know if these crashes are something i can fix or a bug with Infernal Mobs... Edit 2: Iv tracked it down to "playerNetServerHandler" in my fake player class being null but so far i havent figured out how to fix it. -
forge fake player problem [Partially Solved]
brandon3055 replied to brandon3055's topic in Modder Support
Thanks i was originally using (WorldServer) worldObj (it is used in a tile entity) but i wasnt sure if there would be any problems with that.