Jump to content

Terrails

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Terrails

  1. I've made a custom .json model with water texture inside it, its like some kind of cage with bars and glass but for some reason if I make the Block#getBlockLayer return TRANSLUCENT it makes the rendering weird: the left one is how it looks in the game and right is how it should actually look like.... and if I make it return CUTOUT the glass in the model isn't transparent anymore and I can't see the water. How should I fix this?
  2. I guess I'll better work on a custom bed because everyone knows to beds explode in nether, don't want to go through trouble of changing default nether biome, Thanks! If I need some help with the bed I'll probably reply to this topic, but I just need to make my own onBlockActivated
  3. I'm trying to make the bed in the nether not explode when you right click it but I just can't do it, I tried to cancel the right click with PlayerInteractEvent.RightClickBlock event and it still exploded, I read somewhere to it depends on the WorldProvider (if canRespawnHere returns true), and I already got a custom WorldProviderHell which I load by unregistering the dimension and then registering it with that WorldProvider, I overriden WorldProviderHell#canRespawnHere in the custom world provider and made it return true but the bed still explodes.
  4. I first move a player to some coordinates in nether and then use this code world.setSpawnPoint(player.getPosition()); System.out.println("Player Position is: " + player.getPosition() + ", and the world spawn is: " + world.getSpawnPoint()); and the player position outputs different BlockPos then world spawn point
  5. bump
  6. I'm trying to get the world spawn point with World#getSpawnPoint method but it always returns the first ever spawn point, not the updated one set with /setworldspawn command, maybe the problem is to I'm respawning in the nether but I don't think thats it because when I use /spawnpoint command the EntityPlayer#getBedLocation gets updated. I think that this is a bug in forge but not sure. I tried to use EntityPlayerMP#getEntityWorld, EntityPlayer#getEntityWorld and EntityPlayerMP#getServerWorld to get the world and then use the World#getSpawnPoint method.
  7. I there a way to disable events from other mods (especially the TickEvent.ServerTickEvent), I'm trying to set max health on respawn but ToughAsNails mod keeps setting the health on every server tick to its defined health and I don't want it to do that.
  8. I'm setting players health with attributes and I've been using attributes to set the max health: @SubscribeEvent public void setMaxHealthOnRespawn(PlayerEvent.PlayerRespawnEvent event) { IAttributeInstance health = event.player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH); health.setBaseValue(4); } But I'm having problems with ToughAsNails mod. I tried this without ToughAsNails (by building my mod and not installing ToughAsNails because its optional for my mod) it worked fine I was at 2 hearts when I respawned but when I install ToughAsNails I get stuck in reboot loop without any errors and it only printed one killed by message in chat. Github
  9. I have an mod which keeps experience on death and I want to make the player not drop experience orbs when he dies because he would get more and more by dying because it keeps his levels and there's still experience orbs on the ground.
  10. there is an CUSTOM type in that event, so I should just check if CUSTOM equals BlockThatIsGenerating and than cancel the event? What do you mean it has to be manually fired by mods adding ores? So mod creators can add their ores to CUSTOM event?
  11. I'm making an customizable mod with ore generation, people enter name of an ore and than define the settings they want, I'm wondering if I could somehow disable generation of that ore and than generate it in my generator.
  12. I was researching and found an question on Stack Overflow, looks like I needed to implement Runnable in my ConfigWatch class and use the run() method, than run the class in preInit with a Thread: Path myDir = Paths.get(event.getModConfigurationDirectory() + File.separator + Constants.MODID); new Thread(new ConfigWatch(myDir)).start(); And I just added Configuration#load() for each config file when its modified, looks like its working.
  13. I don't know what could be wrong, its printing to file has been changed/deleted/added but the game is just frozen (loads really slow, I wouldn't wait that much for it to load). Could you maybe test it in your own workspace to see if it does the same?
  14. I'll compile the mod and run it out of development, to see if that does something
  15. Could it be something with forge?
  16. I'm on windows 10, so I used getModConfigurationDirectory but still the same thing happens, the directory I entered before is correct too, it watches it correctly and notifies me of any changes in folder with print. The problem is to the game slows down, its almost frozen whenever WatchService starts to run. This is the github repository: Main mod class The WatchService class Config class if you need it
  17. I already tried the same code I have in postInit inside of preInit but the game still slows down. EDIT: I changed getting of directory from Path myDir = Paths.get(System.getProperty("user.dir") + File.separator + "config" + File.separator + Constants.MODID + File.separator + "world"); to (configCustomOreGenDir is a File which I use to make a directory and a file for my config) Path myDir = Paths.get(configCustomOreGenDir.toString()); But still slows down the loading.
  18. so I just made an WatchService class which I start in my postInit because I think I don't need to start it earlier (I tried earlier but the same thing happens), the game just drastically slows down, its almost frozen when the WatchService is running. When I edit the config file it notifies me because I made it print on each config change, delete or making of new file in the directory. But the game really slows down, I cannot wait until it loads because its impossible, the ram usage is going up by 1 every 2-3 seconds and the Loading bar is not even moving, so it takes time for it to load. This is the ConfigWatch class, it works because whenever I make an file, edit one or delete it it notifies me (I'll add config.save after I fix this problem): This is in my postInit of my mod class
  19. I have an in game GUI config and when I change something in game it automatically syncs it to the config file, but when I'm in game and I change something in config file, I can't see any changes in game until I reopen the game. I know there is the OnConfigChangedEvent but that only works for GUI, is there some kind of event that tracks changes in the config file itself?
  20. I knew that, somehow it wasn't removing the minecraft:iron_ore= from the String but I made it work now String#substring and String#indexOf. The problem now is how should I disable the ores that are not generated with my config/generator? (I want to disable the generation of ores that are specified in my config and than use my own generation so there aren't 2 generators doing the same thing)
  21. Also another question. I'm having problems with getting int from String[] because I want it in this format ModID:OreName=NUMBER (in the config file), so I just use Integer.parseInt to get an Integer from String but also in the parseInt I use string.replace(oreName+"=", ""); like this: @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { for (String oreName : ConfigCustomOreGen.oreToReplace){Block ore = Block.getBlockFromName(oreName); for(String yMin : ConfigCustomOreGen.minY){int minY = Integer.parseInt(yMin.replace(oreName+"=", "")); for(String yMax : ConfigCustomOreGen.maxY){int maxY = Integer.parseInt(yMax.replace(oreName+"=", "")); for(String veinMin : ConfigCustomOreGen.minVein){int minVein = Integer.parseInt(veinMin.replace(oreName+"=", "")); for(String veinMax : ConfigCustomOreGen.maxVein){int maxVein = Integer.parseInt(veinMax.replace(oreName+"=", "")); for(String chanceVein : ConfigCustomOreGen.veinChance){int veinChance = Integer.parseInt(chanceVein.replace(oreName+"=", "")); generateOre(ore, world, random, chunkX, chunkZ, minY, maxY, minVein, maxVein, veinChance); }}}}}} } Its still null: java.lang.NumberFormatException: For input string: "minecraft:iron_ore=10" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_121] at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_121] at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_121] at terrails.ingotter.worldgen.ore.CustomOreGen.generate(CustomOreGen.java:50) ~[CustomOreGen.class:?] at net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:122) ~[GameRegistry.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1078) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1058) ~[Chunk.class:?] at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:165) ~[ChunkProviderServer.class:?] at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:341) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:107) ~[IntegratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:124) ~[IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121] Like you see theres still "minecraft:iron_ore=10" Ore Gen Class Config Class This is how my config is setup in game: Also is there a way to sort those config variables? For example I want the ore max y level after ore min y level
  22. Looks like I actually did it, I needed an foreach loop in my ore generation so it always changes each line from the config. I'm facing another problem now... how should I disable the old ore generation so it uses only the generator with config values?
  23. null: generateOre(ore, world, random, chunkX, chunkZ, 20, 180, 8, 24, 8); I'm certain to its the ore variable because when I tried "minecraft:iron_ore" in Block#getBlockFromName it worked fine so somethings with that, I'm not sure how I should read the String[] properly for it to not be null.
  24. I'm having problems reading the String List, I never worked with configs that have lists in them. Crash: [17:09:13] [Server thread/ERROR]: Encountered an unexpected exception java.lang.NullPointerException at terrails.ingotter.worldgen.generator.WorldGenIngotterMinable.<init>(WorldGenIngotterMinable.java:23) ~[WorldGenIngotterMinable.class:?] at terrails.ingotter.worldgen.ore.CustomOreGen.generateOre(CustomOreGen.java:59) ~[CustomOreGen.class:?] at terrails.ingotter.worldgen.ore.CustomOreGen.generate(CustomOreGen.java:50) ~[CustomOreGen.class:?] at net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:122) ~[GameRegistry.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1078) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1058) ~[Chunk.class:?] at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:165) ~[ChunkProviderServer.class:?] at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:341) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:107) ~[IntegratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:124) ~[IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121] This is the config class: Ore Generation: By people I meant modpack creators and people using my mod so not mod creators
  25. I was making my ore generation when all of the sudden my ores started to spawn in every possible block even though I'm using isReplaceableOreGen for my custom generator and Predicate in WorldGenMinable. I define Blocks.STONE to be replaced but it still replaces air, dirt... Custom WorldGenMinable and the line where I say to it replaces it with Blocks.STONE EDIT: I did something wrong in my IF statement not sure what but its fixed now!
×
×
  • Create New...

Important Information

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