Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Blackout

  1. Hi I try to put a chunk into a box. It's working well when I watch a face but other face doesn't work well. (Sorry for my bad english) These picture should help you to understand my problem : here it's work : http://www.aht.li/2574678/2015-01-31_021445.png[/img] And when I move to other face, I have : http://www.aht.li/2574679/2015-01-31_021517.png[/img] http://www.aht.li/2574680/2015-01-31_021505.png[/img] http://www.aht.li/2574681/2015-01-31_021511.png[/img] Here is the code : ​ private void highligthChunk(ForgeFactionChunk c) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; int xPos = c.xPosition<<4; int zPos = c.zPosition<<4; drawChunkFaceY(player, xPos, zPos); drawChunkFaceX(player, xPos, zPos); drawChunkFaceX(player, xPos+16, zPos); drawChunkFaceZ(player, xPos, zPos); drawChunkFaceZ(player, xPos, zPos+16); } private void drawChunkFaceX(EntityPlayer player, int xPos, int zPos) { if(player.posX < xPos) { GL11.glVertex3f(xPos,player.worldObj.getActualHeight(),zPos); GL11.glVertex3f(xPos,0,zPos); GL11.glVertex3f(xPos,0,zPos+16); GL11.glVertex3f(xPos,player.worldObj.getActualHeight(),zPos+16); }else { GL11.glVertex3f(xPos,player.worldObj.getActualHeight(),zPos+16); GL11.glVertex3f(xPos,0,zPos+16); GL11.glVertex3f(xPos,0,zPos); GL11.glVertex3f(xPos,player.worldObj.getActualHeight(),zPos); } } private void drawChunkFaceY(EntityPlayer player, int xPos, int zPos) { int y = player.worldObj.getActualHeight(); if(player.posY < y) { GL11.glVertex3f(xPos+16,y,zPos+16); GL11.glVertex3f(xPos,y,zPos+16); GL11.glVertex3f(xPos,y,zPos); GL11.glVertex3f(xPos+16,y,zPos); }else { GL11.glVertex3f(xPos+16,y,zPos); GL11.glVertex3f(xPos,y,zPos); GL11.glVertex3f(xPos,y,zPos+16); GL11.glVertex3f(xPos+16,y,zPos+16); } } private void drawChunkFaceZ(EntityPlayer player, int xPos, int zPos) { if(player.posZ < zPos) { GL11.glVertex3f(xPos+16,player.worldObj.getActualHeight(),zPos); GL11.glVertex3f(xPos+16,0,zPos); GL11.glVertex3f(xPos,0,zPos); GL11.glVertex3f(xPos,player.worldObj.getActualHeight(),zPos); }else { GL11.glVertex3f(xPos,player.worldObj.getActualHeight(),zPos); GL11.glVertex3f(xPos,0,zPos); GL11.glVertex3f(xPos+16,0,zPos); GL11.glVertex3f(xPos+16,player.worldObj.getActualHeight(),zPos); } } Thanks for your help
  2. See here : http://www.minecraftforum.net/forums/support/modded-client-support/2240652-biomes-o-plenty-mod-1-7-10-crash Maybe answer is given
  3. Hi I'm trying to highlight a chunk with a client side mod but I don't understand how can I do I know NEI already done something similar when you press F7, it show where mob can spawn but I don't understand its code. Could you help me ? What event should I use ? Thanks
  4. Okay I didn't understand it like that You have definitely solutions to solve all my issues Thanks a lot Doctor Diesieben07
  5. Hi, I have an Object A which contains a List of object B which each have a List of Object C. So this is : -A --B1 ----C1 ----C2 ----C3 --B2 ----C4 ----C5 etc.. I want to save it into my save. So as Diesieben07 tell me, I search about how works WorldSavedData and MapStorage. I have understand if you have only 1 field. For example an Id, when it's changed, you call markDirty() and it will be save. But in my case, if I make a WorldSavedData for object A, when I want to save the modification of C2, if I mark A as dirty, all my sub-object will be saved right ? How can I do to keep the same structure on my file with A is a NBTTagCompound, B a List, and C a List in B ? And in order that only C2 will be saved when I change it and not all the tree ? I hope it's understandable
  6. I have already done a Map like this. It's only on server-side, I use packet to edit and get value from my map I will use ChunkEvent But I need to know how to save NBT on a custom file. I don't want save it in world files or player files. All tutorial I find about NBT is about how to create a custom TileEntity
  7. I don't find any tutorial which explain how to save on a custom file NBT tags
  8. The problem is how to save/load it from disk. In fact, my mod will be a Millenaire-like mod (So I don't have only one entity ) but with a different gameplay and without dependencies from Minecraft chunck loading system. For instance, I want live continues more than 512 blocks far the player. I doubt about what system I can use, is NBT more performant than JSON ? If I use NBT, how to serialize it into a custom file ? Is chunk need to be loaded to use world.getTileEntity(x,y,z) or world.getBlock ?
  9. Hi, In fact, I have an AI wich must for example eat to survive. This AI is a passive entity, ally with players. Player can decide wich chest he wants share with the AI. And when AI is hungry, it take food in one of the player shared chest. So I need to know if a chest is shared or not in addition of it contents. Chest will have more option in the future, for example a filter system to know what kind of block AI can store. And I need to know the chest shared list, in order to my AI can easily get the coordinate to the chest. Currently I use a Map<World, BiMap<TileEntity, ExtendedTileEntity (Class created by myself)>> named SHARED_CHESTS. It's work fine but I don't save it on disk. So all is reset everytime. I thought use these events to have persistant data : @SubscribeEvent public void onLoad(WorldEvent.Load event) { if(!event.world.isRemote) { BiMap<TileEntity,ExtendedTileEntity> worldSharedChests = HashBiMap.create(); //Load tileEntities ... synchronized (SHARED_CHESTS) { SHARED_CHESTS.put(event.world, worldSharedChests); } } } @SubscribeEvent public void onUnload(WorldEvent.Unload event) { if(!event.world.isRemote) { synchronized (SHARED_CHESTS) { SHARED_CHESTS.remove(event.world); } } } @SubscribeEvent public void onSave(WorldEvent.Save event) { if(!event.world.isRemote) { synchronized (SHARED_CHESTS) { BiMap<TileEntity, ExtendedTileEntity> worldSharedChests = SHARED_CHESTS.get(event.world); if(worldSharedChests == null) return; //Save on disk ... } } } But I don't think all TileEntity is loaded when a world in loading. So I probably couldn't refer it to my ExtendedTileEntity
  10. Hi, I want to know if an "Extended Entity Properties"-like system exists for TileEntities. I don't find it Or if I must implement myself this functionnality. If I must implement it, do you know which events are fired when a TileEntity is created and when it's removed ? Is all TileEntities are loaded when the world load or are there chunk-loaded ? I don't use custom block, I want extend an existing TileEntity. Thanks a lot
  11. Hi, I currently search how to do something when a player close a vanilla GUI. Is there an event like GuiOpenEvent ? Thanks
  12. Nice explanations For French people, translation is available here : http://www.minecraftforgefrance.fr/showthread.php?tid=1118
  13. Thanks for your replies Indeed, It's not a custom block
  14. Hi I'm currently search how to get the placed TileEntityChest when a player place Chest. To do it, I use PlayerInteractEvent, but I think the TileEntityChest is created after PlayerInteractEvent. I see a very helpfull event list here : https://dl.dropboxusercontent.com/s/h777x7ugherqs0w/forgeevents.html when I search about similar problem in this forum, but I don't find how to solve my problem Currently I calculate the placed block with event.x/y/z and event.face. Coordinates are good, but I have always a null TileEntity and a Air block. Have you got any ideas about how could I solve my problem ? Thanks a lot
  15. Thanks for your replies Sorry for my bad english, yes I would say " the shortest" Currently it's an ArrayList of chest, I think about what kind of data structure will be the best effective. I know I can use vector but as Jabelar say, I need the path distance, not the distance beetween 2 coordinates I don't understand, I was speaking about this : http://en.wikipedia.org/wiki/Reflection_(computer_programming)
  16. Hi I have a chest list and one entity. I currently try to know how find the nearest chest to my entity. I have thought to choose the shortest path beetween all chest from my list and my entity. But I don't think we can calculate the total path distance. Have you got an idea to do that ? Must I use reflection ? Thanks edit reason : correct somes english language mistakes
  17. Thanks for your reply, I didn't know the GuiOpenEvent it's very usefull I have an other problem, my button doesn't' appear now This is my code, it's short : @SubscribeEvent public void onGuiOpen(net.minecraftforge.client.event.GuiOpenEvent event) { System.out.println("A gui is open !"); if(event.gui instanceof GuiContainer) { System.out.println("This is a GuiContainer"); handleGuiContainerLayout((GuiContainer) event.gui); } } private void handleGuiContainerLayout(GuiContainer gui) { GuiSettlementsButton settlementButton = new GuiSettlementsButton(gui); List<Object> buttonList = GuiReflect.getInstance().getButtonList(gui); if(buttonList != null) { System.out.println("We will add our button !"); buttonList.add(settlementButton); System.out.println(buttonList); } } This is the button code : public class GuiSettlementsButton extends GuiButtonExt { public GuiSettlementsButton(GuiContainer gui) { super(-1, GuiReflect.getInstance().getGuiLeft(gui), GuiReflect.getInstance().getGuiTop(gui)+gui.height+1,150,20, StatCollector.translateToLocal("tile.SettlementsGuiButton.name")); } @Override public String toString() { return "GuiSettlementsButton :\n" + "\tx : "+xPosition+"\n" + "\ty : "+yPosition+"\n" + "\twidth : "+width+"\n" + "\theight : "+height+"\n" + "\ttext : "+this.displayString; } } I try with GuiButton instead of GuiButtonExt but, it's the same And this is my log when I open a chest: A gui is open ! This is a GuiContainer We will add our button ! [GuiSettlementsButton : x : 0 y : 1 width : 150 height : 20 text : Settlements] I don't understand why this is write 2 times and why my button is not visible. Could you help me ? Thanks EDIT : It's work fine now, I just don't understand what mean height, I think this was ySize. So problem resolved
  18. Hi I'm trying to execute some code when a gui chest is open. To do that I do : public void playerInteractEvent(PlayerInteractEvent event) { if(event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { //Player right click on a block if(!event.entityPlayer.isSneaking()) { //Player is not sneaking TileEntity t = event.world.getTileEntity(event.x, event.y, event.z); if(t instanceof TileEntityChest) { FMLClientHandler.instance().displayGuiScreen(event.entityPlayer, new GuiChest(event.entityPlayer.inventory, (IInventory) t)); event.setCanceled(true); // DO SOMETHING } } } } It's work, chest gui appears. But when I select an Item, I have a IndexOfBoundException. I suppose I don't give the good IIventory to this function but where can I find the good IIventory ? Thanks a lot
  19. Up from the abbyss, I need this event too I don't find a event which is called when a block is destroy.
  20. Hi, I already post here my problems and no solutions have convinced me. http://www.minecraftforge.net/forum/index.php/topic,18864.0.html Solution 1 : Because with the current method, externals librairies were include into the jar mod file. So if I create 500 mods and each mod require a librairie, this librairie will be duplicate 500 times ? It will be too heavy ! http://www.minecraftforge.net/forum/index.php/topic,19265.0.html Here, he says if I put librairies into mods folder it will work but no, it doesn't. And mods isn't the same that librairies *_* So why put it into the mods folder ? So if you have a good and easy solution which can satisfied me, I'll take it immediately
  21. No it doesn't work, I have a NoClassDefFound error.
  22. Hi, I created mod wich load all external librairies needed for your mods. I illustrated this by a video but my english is very bad, so if anyone want to make a better video, he can Some information in the description, and here : https://github.com/EyZox/MFF-LibsLoader https://www.youtube.com/watch?v=j1Kqfy-WcCI
  23. Hi, My mod need external jar files to work, I added it, to my mod folder. Console say : [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file commons-codec-1.6.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file commons-logging-1.1.3.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file fluent-hc-4.3.3.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file httpclient-4.3.3.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file httpclient-cache-4.3.3.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file httpcore-4.3.2.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [23:57:51 INFO]: Client> [23:57:51] [Client thread/INFO] [FML]: FML has found a non-mod file httpmime-4.3.3.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. But next, when I print the classpath, I get this : /C:/Users/***/AppData/Roaming/.minecraft/libraries/net/minecraftforge/forge/1.7.2- /C:/Users/***/AppData/Roaming/.minecraft/libraries/net/minecraft/launchwrapper/1.9/launchwrapper-1.9.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/ow2/asm/asm-all/4.1/asm-all-4.1.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/scala-lang/scala-compiler/2.10.2/scala-compiler-2.10.2.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/java3d/vecmath/1.3.1/vecmath-1.3.1.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/lzma/lzma/0.0.1/lzma-0.0.1.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/io/netty/netty-all/4.0.10.Final/netty-all-4.0.10.Final.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/google/guava/guava/15.0/guava-15.0.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/commons-io/commons-io/2.4/commons-io-2.4.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/com/mojang/authlib/1.3/authlib-1.3.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar /C:/Users/***/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar /C:/Users/***/AppData/Roaming/.minecraft/versions/1.7.2-Forge10.12.0.1024/1.7.2-Forge10.12.0.1024.jar /C:/Users/***/AppData/Roaming/.minecraft/mods/OptiFine_1.7.2_HD_U_C2.jar /C:/Users/***/AppData/Roaming/.minecraft/mods/ShadersModCore-v2.3.4-mc1.7.2-f1019.jar So they aren't into the classpath ! *_* Is this a bug ? Anyone can help me ? Thanks
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.