Jump to content

minisantur

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by minisantur

  1. I think you guys might be overestimating the IRenderHandler class: public abstract class IRenderHandler { @SideOnly(Side.CLIENT) public abstract void render(float partialTicks, WorldClient world, Minecraft mc); } What I need is to override the renderSky() function in RenderGlobal: public void renderSky(float partialTicks, int pass) { net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer(); if (renderer != null) { renderer.render(partialTicks, theWorld, mc); return; } if (this.mc.theWorld.provider.getDimensionType().getId() == 1) { this.renderSkyEnd(); } [...] } That being said, I could create an extension of RenderGlobal, and override this function so that it's called instead of the vanilla one. EDIT: Or maybe I should override the renderEndSky? Is that correct?
  2. You have a IRenderHandler field in your WorldProvider. You set that equal to your IRenderHandler. In your IRenderHandler there should be a required method called render() (Or something similar). Then with the method I told you to override if "blank" return your IRenderField. RenderGlobal calls the method i provided earlier and renders from there if there is one. Alright. Thank you! Do you have any prior coding experience, Java or otherwise? All coding I learnt was at home on the internet, with countless trials and errors. I'm using Minecraft as an excuse to learn more Java and have some fun along the way. On a scale of 1 to 10 of how much Java I know, I guess it would be a solid 5. I know how to read most of the code and get general ideas of what I'm reading to reproduce it, but in this case I had no clue how the day/night cylce worked, and sometimes I have a hard time figuring out where to write code, as dumb as that may sound.
  3. Go to RenderGlobal.class In Eclipse press ctrl + f and search for if (this.mc.theWorld.provider.isSurfaceWorld()) Look at that code as that handles all sky rendering if it is in the method renderSky(). You will find all of the variables it uses in there and how it does the sun and moon logic. For fog just search for fog in WorldProvider and WorldProvider... and see how they handle that. Final question: where do I write down my own code for the renderSky()? Do I make an extension of RenderGlobal overriding that function? Do I make a new class and call it from the WorldProvider? These might be dumb questions, but they're probably my biggest problem when it comes to Java. (Where to actually write stuff) Thanks for everything so far.
  4. ...Forge why did you name a class "I"RenderHandler...Anyways you do want to extend it, since it was prefixed with I I assumed it was an interface that needed to be implemented. Alright, that got rid of the static-ish sky. Next things are: - Sun, Moon and stars - Getting rid of the fog that doesn't let me see squat. (Looks like the Nether's red fog which limits your view distance)
  5. Okay, I see how to make the Sun rise after using the item, but we have a problem: I can't make a new class that implements IRenderHandler. It's an abstract class. I can only make my new class extend it, which I don't think will yield the results we're looking for here. Or am I misunderstanding something?
  6. I found that in RenderGlobal, but I still don't know what to put instead of null. I can see how the renderSky() function works. It has a variable net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer();. I can't use this since it's accessing the world provider to asign this variable, and here I am configuring the world provider. Or am I wrong? Sorry. Still rough around the edges.
  7. Well, skyRenderer in WorldProvider is private, so I can't access it. I made one for my WorldProviderTTE named skyRenderer as well and set it to be equal to null (same as the WorldProvider's) and also added the function: @SideOnly(Side.CLIENT) public void setSkyRenderer(net.minecraftforge.client.IRenderHandler skyRenderer) { this.skyRenderer = skyRenderer; } and nothing happens.
  8. This changes light levels, as far as I noticed. The End got waaay brighter, but the sky is still static.
  9. Greeting everyone, for the third time. Brief explanation of my mod My mod focuses on expanding the End in the least overpowered way possible with the goal of offering an enjoyable experience past vanilla Minecraft. It adds ores, decorative blocks, mobs and some more lore on the End. I've created an item that is dropped by the Ender Dragon which will "release" the End from darkness upon its destruction, turning the End into what it originally was planned to be: skylands. Current goal Upon the consumption(right click) of this item, I need to initiate the vanilla day/night cycle in the End dimension. This means, I need to get the Sun and the Moon, and a sky color, to be visible in the End. For now, I'm just trying to get it done before the Ender Dragon is killed, and not when a UseItemEvent is fired. For testing purposes. Current progress I've managed to get the sunset/sunrise colors on the fog(It looks orange during these two times), meaning I've gotten the CelestialAngle working as well, since the fog uses this if I'm not mistaken. However, the still sky looks like static, and there is no rendering of the Sun and Moon or stars(since I don't know how). TL;DR I need the Sun, Moon and stars to be rendered in the End, and give the sky color. How? Thanks for your time!
  10. You mean making a new class that extends EntityDragon with an @Override replacing the data on the EntityDragon's main body? It's that simple? No i meant the WorldProvider, but you could do the dragon files... That did it. Thank you very much.
  11. You mean making a new class that extends EntityDragon with an @Override replacing the data on the EntityDragon's main body? It's that simple?
  12. Hello everyone. I'm having a bit of an issue here and I'm afraid I don't know how to solve it. I've created a new WorldProvider and ChunkProvider (and other files) for my mod which mainly takes place in the End. I created these files to affect World Generation, but when I tried to kill the EnderDragon for testing purposes via commands (/kill @e[type=EnderDragon]) it didn't die. It didn't lose health. It simply disappeared for 15-30 seconds and reappeared. Just to be sure, I generated a new world and tried killing him traditionally, but he didn't lose health to hits either. I looked into my files and none of them tapped into the DragonFightManager, but when I looked into EntityDragon, I found out that, in order to initialize the FightManager, it does a check-up to see if the current WorldProvider is an instanceof WorldProviderEnd (original vanilla class not being used in my mod): public EntityDragon(World worldIn) { super(worldIn); this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead, this.dragonPartNeck, this.dragonPartBody, this.dragonPartTail1, this.dragonPartTail2, this.dragonPartTail3, this.dragonPartWing1, this.dragonPartWing2}; this.setHealth(this.getMaxHealth()); this.setSize(16.0F, 8.0F); this.noClip = true; this.isImmuneToFire = true; this.growlTime = 100; this.ignoreFrustumCheck = true; if (!worldIn.isRemote && worldIn.provider instanceof WorldProviderEnd) { this.fightManager = ((WorldProviderEnd)worldIn.provider).getDragonFightManager(); } else { this.fightManager = null; } this.phaseManager = new PhaseManager(this); } As you can see, if it doesn't find the WorldProvider it wants, then the fightManager = null. Is there a way I can cast or override this? Other than recreating half of vanilla files to make it work?
  13. DimensionManager.unregisterDimension(id); Thank you!! I'll update this post with the solution and a proper title. Many thanks to everyone who pitched in!
  14. This could also be the easiest way to do it, and probably the most compatible like you said, but I'm probably going to further "edit" and add more content than just dirt to the End, so using my own World and Chunk providers would, I think, prove to be more effective this way. I'll definitely keep it in mind though. Thanks!
  15. Aaaah! That was what I missed. I completely forgot about the ChunkProvider files. I've been reading and understanding all the rest but I somehow completely missed these. Thanks for pointing me in the right direction. And for remining me the web page was Github. Adding to Animefan, you should look at ChunkProviderEnd, specifically ChunkProviderEnd#buildSurfaces(ChunkPrimer), when considering what to override Exactly what I needed. If I manage to do this, I'll update the topic with my solution for people to see. Thank you!
  16. Good day everyone. First of all, thank you for opening this topic and taking the time to assist me in my coding experience. That being said, I do ask for patience and for you to be ready for possibly low IQ questions. Moving on to the matter at hand: My goal is to make my new block, End Dirt (or Endirt) generate on End Islands, ranging from a Y thickness of 1 to 3 blocks. The block is made and is ready for generating. However, I have no idea how to override the world generation to make the top block of the islands endirt. I started frying my brain and I'm stuck. I've tried all types of searches and YouTube video tutorials to get a general idea, but I failed to find anything that's not related to ore generation. I can't possibly figure out how to do this other than overriding the End's biome decoration, which I also have failed to do. Maybe I should have a clear understanding on how World Generation works entirely. So, rounding up: how do I make the top 1-3 layers of the End Islands' blocks be my blocks? I only have one file related to WorldGeneration, but it's for my ores and I doubt it will come into play here. I will post it if asked for, though. (If you do need me to post a file, remind me which internet domain was the most comfourtable to do so and I'll gladly upload it) Thank you very much for your time and I hope you have a fantastic day. UPDATE #1 at 19:42, 25/08/16: I've created all the files necessary to override the End's world generation: the WorldProvider, the ChunkProvider, the MapGenEndCity (vanilla one requires the original ChunkProvider), and the WorldGenEndIsland(I believe the Obsidian Pillars and things related to the Dragon fight are handled by the DragonFightManager files). The thing is, I registered the WorldProvider and the dimension with the vanilla End dimension's ID (1) using DimensionType.register(name, suffix, id, provider, keepLoaded); but my version of the End isn't generating. I think I have to unregister the original End dimension before registering my new End dimension, but I have no idea how. Any ideas? SOLUTION To modify an existing dimension, since you cannot edit base files, you need to create equal files to override them: - WorldProvider class - ChunkProvider class - Extra classes used by these two classes. Note: the ChunkProvider class is the one that handles the actual generation. So if you want to add or stuff, they should be handled there. In my case, I just wanted to generate dirt in the End, so I just copied the vanilla files (ChunkProviderEnd & WorldProviderEnd), renamed them and modified them slightly. Once you have these done, you need to unregister the the vanilla dimension, and register your new version of the dimension in its place. In your main mod file, where you have your initialization events, you add some lines of code in the preInit: DimensionType.register(name, suffix, id, provider, keepLoaded); DimensionManager.unregisterDimension(id); DimensionManager.registerDimension(id, type); And that's it! There might be some more depth to this, but this is working for me. Thanks everyone!
×
×
  • Create New...

Important Information

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