
Androm
Members-
Posts
58 -
Joined
-
Last visited
Everything posted by Androm
-
I have already .lang files but I don´t know how to make that for chat messages. I also need to know if the player´s language is german or whatever(I have .lang files for german and english). About this I looked in the Internet and found nothing. So can you explain how to get the player´s language and then send him the right translation (server side without minecraft code)?
-
Is this right? I change the 2 for-loops later to another method.
-
@diesieben07 I am trying to spawn lightnings in the world around the player who has bad karma. The spawnpoints of the lightnings are randomly setted by the class called BlitzGewitter near the player. On the event Tickevent.WorldTick it gets the list and checks if it isn´t empty. Then it spawns the last EntityLightningBolt in the ArrayList<EntityLightningBolt> in the world, deletes the entity from the list and adds him to another HashMap calles blitz_velocity. Next it checks if blitz_velocity is empty. If not it gets all the EntityLightningBolts in the Map and check if they are dead. If yes they will be removed from the list (I used iterator.remove() to prevent a java.util.ConcurrentModificationError). Else the velocity is setted to the EntityPlayer which is stored as value for the EntityLightningBolt (I want that the lightnings go straight to the player or near him). That´s all!
-
I updated all I now formatted the next by myself instant of the eclipse one. I also added if(!world.isRemote()) (I think that´s now right!). I now changed the Objects to other Objects. Before I thought that was a problem with the Hashmap and that it doesn´t can save EntityPlayer or EntityLightningBolts... You can hear the lightnings but you can´t see them and they do no damage! Thanks for your patience diesieben07! Today it isn´t my day... EDIT: I pasted the old code....
-
@brandon3055 I don´t want to that the position of the lightning to the player! I just want that the lightnings travel to the player with setting the velocity from the player to the lightnings. @diesieben07 Forgot what I said.. Now I updated the code. If there is something in blitz_velocity and world.isRemote return true (==singleplayer) the Hashmap will be cleared. Otherwise the code will be performed. But the problem still exists.
-
Updated code: I don´t need a test for the world for the method after if(!blitz_velocity.isEmpty()) because blitz_velocity will be always empty if the world isn´t remote.
-
Oh, forgot that the singleplayer has an integrated server too. Thanks for your help. But the problem I described above isn´t solved yet!
-
Why i have to test this? The method is performed in the world and if it´s on a server the method doesn´t change. Or did I unterstand world.isRemote() wrong?
-
I tested it and it had the same effect like world.joinjoinEntityInSurroundings(entity). You can hear the lightnings but they are still invisible and do no damage
-
Hello modders, I have a problem with spawning EnitityLightningBolts in the world. When they spawn you can hear them, but not see them.. They didn´t do any damage! Here is my class(The event is registered and the code gets executed in the right way)
-
It didn´t found the texture of 'blockTable' : You load .png in your blocks folder! Maybe you forgot to add the name and then '.png'. How will forge load a unknown texture without knowing the place? There is too a problem with your YoshiGrenade: You try to cast your YoshiGrenade to EntityLiving - so your grenade is a creatures who has the ability to live...
-
because minecraft is written in java it can support it if you handle it right! And for the information I readed the minecraft code about the gui. You can open a frame with minecraft I just tested it. But thanks for your answer.
-
Hello, because I don´t know anything about gui containers and screens I want to know if it´s possible to create a JFrame with JButtons.. in minecraft while minecraft has to be freezed? If it´s not possible can anyone explain me the gui Containers and Screens (I had read the tutorials on the wiki and I watched some tutorials on youtube, but I wan only a simple Gui for the player where no inventory will be displayed, only some text and 3 buttons) Thanks for help.
-
bump
-
Just found my problem, i forgot to add i++; at some times... My code : But now I have a problem : 1. Where is the start of a schematic ? Sometimes buildings spawn in air or above some trees or over the earth also with BlocksInGround setted... Thank you for help!
-
No help ? I think I have to explain my code: If I want to generate something i call the GeneralGenerateMethod. I need lots of parameters: 1. int chance = 1/chance = chance if it spawn in a chunk 2. String schemname : the name of the .schematic file 3. int where => if where = 0 it spawns on the ground ; if where = 1 it spawns in underground ; if where = 2 it spawns only over water ; if where = 3 it spawns only on the ground of a sea 4. int blockInUnderGround : there you tell the method if some blocks of a building have to be in the underground => that´s good for springs or buildings with cellars . 5. int structureHigh : it is only used for generating buildings under the earth : you put the high of your building there 6. boolean structureWithAir : If you want some buildings to spawn with air (usefull for underground buildings) you can set this to true otherwise set this to false. 7. int ChunkX : the Chunk X coodinates. 8. Random rand = useable to get a random coordinate in a chunk 9. int chunkZ : the Chunk Z coordinates. 10. World world = in which world it spawns (default : overworld) 11. ArrayList<Block> allowedBlocks = if it generate a structure it checks if the Block where it spawns is on the ArrayList : if true it will spawn otherwise it wont spawn 12. boolean SpawnerActive = if there is a spawner set it to true 13. ArrayList<Block> spawnerBlocks = the blocks in the .schematic which will be repleaced with a spawner 14.boolean ChestWithRandomLoot = if there are chest which have to have random loot set it to true 15. ArrayList<Block> chestBlocks = the blocks in the .schematic which will be repleaced with a chest 16. boolean randomSpinnwebs = if there are webs which have to be generated randomly = in every building the webs are on an other place 17. ArrayList<Block> spinnwebsBlocks = the blocks in the .schematic which will be repleaced with a web 18. ArrayList<Item> LootItems = which Items you can find in a chest 19. ArrayList<Integer> LootMaxStackSize = the max amount of an Item in a chest. I hope that can help you to explain me what I have done wrong
-
I solved this problems. But now I have some questions about my method to create a structure in the worl: My complet WorldGen.class : This happens after I made a world : 1. What is the problem with my chest system ? Also I want to know how I can add more loot items in a chest, because there is only one item in each chest. And there have to be more different items! But I don´t know what I had done wrong.. 2. And if a tower generate, the top is complet randomlly set ! But I want that only spinnwebs are generated randomly.. Thanks for your help!
-
I found a way: int chance = new Random().nextInt(100); if(int == 1) { do this } But how I can generate a spring half in the underground and half in the Overworld?
-
I found the error: I forgot to declare SchematicLoader: private Schematicloader sl = new SchematicLoader(); Now I get no error but my world doesn´t load fast (takes more than 1 minutes with only one structure) How can I set my spawnrate lower or make Worldgenerating faster ? My Class: Link to screenshot from world: http://prntscr.com/419ew9
-
Path : C:\Users\user\Desktop\forge 1.7.10\src\main\resources\assets\mhytrpg\schematics\spring.schematic
-
Trying to load assets\mhytrpg\schematics\spring.schematic and same error (After first error i changed MODID to MODID.toLowercase() but the error was the same) I think now he didn´t found the schematic but didn´t throw a FileNotFound exception ( i tested it) EDIT: Here has to be the mistake after i added some more Sytem.Out.Println´s:
-
I tested it, if it throws a FileNotFoundException before I post this. I tried to import this schematic in WorldEdit and there is no error. So something other is going wrong. Do you know other programs with export something in the world to schematic ? Maybe WorldEdit mad something other in schematic so only WorldEdit can place them into the world ?
-
Did I something wrong with the InputStream ?
-
I found a mistake, now there is an error : I can't load schematic because java.lang.NullPointerException with the same Errorcode.. My Schematic.java: package de.MhytRPG.www.structures; import net.minecraft.nbt.NBTTagList; public class Schematic{ public NBTTagList tileentities; public short width; public short height; public short length; public byte[] blocks; public byte[] data; public Schematic(NBTTagList tileentities, short width, short height, short length, byte[] blocks, byte[] data){ this.tileentities = tileentities; this.width = width; this.height = height; this.length = length; this.blocks = blocks; this.data = data; } } and my SchematicLoader.java : package de.MhytRPG.www.structures; import java.io.File; import java.io.InputStream; import de.MhytRPG.www.MhytRPG; import de.MhytRPG.www.structures.Schematic; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; public class SchematicLoader { public static Schematic get(String schemname){ try { InputStream is = Schematic.class.getClass().getClassLoader().getResourceAsStream("assets" + File.separator + MhytRPG.MODID + File.separator + "schematics" + File.separator + schemname +".schematic"); NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(is); short width = nbtdata.getShort("Width"); short height = nbtdata.getShort("Height"); short length = nbtdata.getShort("Length"); byte[] blocks = nbtdata.getByteArray("Blocks"); byte[] data = nbtdata.getByteArray("Data"); System.out.println("schem size:" + width + " x " + height + " x " + length); NBTTagList tileentities = nbtdata.getTagList("TileEntities", 10); is.close(); return new Schematic(tileentities, width, height, length, blocks, data); } catch (Exception e) { System.out.println("I can't load schematic, because " + e.toString()); return null; } } } I splitted them and write it to public static Schematic... and changed the this. to Schematic. because the method need to performed with the Schematic.class So what I have done wrong ? EDIT : My location of schematic files: forge 1.7.10\src\main\resources\assets\mhytrpg\schematics