jabelar
Members-
Posts
3266 -
Joined
-
Last visited
-
Days Won
39
Everything posted by jabelar
-
Yeah, in your method for addComponentParts() it is up to you how you place the blocks. It is your code, so you can do whatever you want there, either using loops to generate algorithmically, using arrays to generated based on a "map", using a file to load a structure, etc. What I usually do is create a command where I can "capture" an area of the world as an array of blocks and store that to file. Then I just copy that array directly into my code and loop through it. Here is an example of the command I use: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/commands/CommandStructureCapture.java.
-
I'm surprised the mobile tether would be that slow. But maybe just go to a coffee shop or school or public library where there is better free internet. As diesieben07 mentions, gradle is used for a couple reasons but the most important is because it is illegal to redistribute the deobfuscated Minecraft code libraries -- those must be downloaded and processed every time you set up your workspace.
-
Access Transformer. Basically, Java is kinda a funny language because it is possible to change the intended scope of the fields and methods. So Forge has provided a way to sort of open up accessibility in a bulk way with access transformer.
-
Yes, just create an array that contains the block positions. You can do this a couple ways. Simplest is to just have an array or List of block pos and loop through them. The block pos can be relative to the trunk base and just add it. With just some graph paper you can easily just sketch it out. Another array format would just have a 2d array of Boolean for each layer of the tree to indicate where the leaves are. However don't be adverse to simply coding it block by block. There is no shame in using brute force. It doesn't take that long to write out with cut and paste, and you just have to invest 10 minutes to code it. It gives full control and is less likely to be buggy than trying to be tricky.
-
Ah, yeah that makes sense. I was searching for reflection but since they use it on a wholesale basis an AT would be worth it to them. @ttocskcaj To get a similar effect I would use ReflectionHelper to create some reflection on those fields.
-
The fact that TF is accessing those private fields is definitely odd. I couldn't find them using any reflection and I'm quite confident that a subclass can't access a private instance field from the parent. Very weird. Regarding using events, technically events are intended for changing vanilla behavior. Since you're making your own BiomeProvider class it is not really clean to use events to intercept your own code. But it would technically work, and I guess might make sense in the context of the fact you have private fields you want to intercept. So yeah, maybe that is preferable.
-
There are several options for intercepting the tree generation, but you definitely need the sapling to call your tree generation. The vanilla sapling will not do that.
-
Did you properly create a custom sapling? And does it properly call your new generator? My tutorial covers this in detail.
-
You shouldn't have lost any of your classes, all you needed to do was to rebuild your workspace using gradlew setupDecompWorkspace and gradlew eclipse. It will re-download everything, fix up your classpath, and update your run configurations. Note that you should do this regularly anyway to update to latest Forge version. In that case you update your build.gradle file and then do the above. Lastly, you shouldn't worry about losing your code if you're using a proper code revision system like git. If you're not familiar with using git I have a tutorial here: - General tips for setting up for modding: http://jabelarminecraft.blogspot.com/p/quick-tips-eclipse.html - Specific tutorial for setting up git (using a free graphical interface called SourceTree): http://jabelarminecraft.blogspot.com/p/minecraft-forge-publishing-to-github.html
-
Regarding the private variables, they may simply be creating their own replacement copy. If the private field is only used within the class and all inherited references to the field are overridden then you can simply have your own local field which acts the same. The event listener should definitely work though. Did you make sure your handling method was static? And that the class was properly annotated as a subscriber? Here is link to my biomes class: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/init/ModBiomes.java
-
[Solved] Cascading chunk-load in IWorldGenerator
jabelar replied to Matryoshika's topic in Modder Support
To prevent cascading you need to ensure that you're only decorating at an +8, +8 offset from edge of the loaded world. Here is an article that explains it a bit more; I think your stillInChunk() method probably needs to be modified accordingly. But look at the vanilla generators and see where they have the +8 coded in. -
Well, the first parameter is the spawn "weight" meaning it affects the chance of spawning. You have it set very low so I think it will spawn all the time. Normally mobs like zombies have value of 95 there.
-
I have a tutorial on custom trees here: http://jabelarminecraft.blogspot.com/p/minecraft-modding-custom-tree-with.html What exactly is going wrong for you? The "pattern" can be made in any logical way, ultimately it is just a matter of placing blocks. If you want it to be regular you can have some loops, and if you want it to have some randomness you can add that. But it is just placing blocks so all you have to do is think through the logic of what you want.
-
If you look at the BiomeProvider class, and also look at the line where your log is showing the error, you'll see that it is failing when working with the genBiomes field which is a GenLayer type. I'm not entirely certain, but I think beyond adjusting the allowed biomes list you probably need to work through the other stuff that happens in the constructor to make sure it is all synced up particularly related to the genBiomes and the biomeIndexLayer. I'd probably copy stuff from the BiomeProvider constructor and work through it to understand what it does and what is important.
-
The proper way is to add some village structure pieces. In the StructureVillagePieces.Village class there is a chooseForgeProfession() method where you return the villager type you want to populate.
-
how to make a power that can control ice and fire
jabelar replied to timeking14's topic in Modder Support
You can't just say "control fire and ice". What does that even mean? In programming you need to list out EXACTLY what you are trying to do. For example, you didn't mention whether you need an item to get the control, or whether this is a power that has some sort of mana that needs to be stored. Do you want to shoot fireballs, do you want to be immune from fire, can you control BOTH fire and ice or only one at a time? I don't know how you expect to get help without even describing what you want. And then you need to tell us what you've tried to do so far, share your code, and THEN we can help. -
https://minecraft.gamepedia.com/Map_item_format
-
In my tutorial I said that the KeyInputEvent was fired on the FML event bus. You can see based on your import that it is from the FML packages. So you need to register your event handling class to that bus, not the main bus which you registered to.
-
I've got a tutorial here: http://jabelarminecraft.blogspot.com/p/minecraft-modding-custom-dimension.html
-
I have a tutorial on keybinding here: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-keybinding.html
-
This is your own code, so you create an int field and each time your world generator wants to generate you check if the field shows that enough have already been built and if not you build it and increment your counter. Note though that that wouldn't be saved so you should also make some world save data and store your int value there. There is are built in classes for saving data: WorldSavedData. How you do it depends if you want to store it per-dimension (different data for e.g. nether and overworld, these are two World instances in the code) or per save-file (same data for all dimensions). For the former use world.perWorldStorage, otherwise use world.mapStorage. Be sure to always call markDirty() on your data when you change a value, otherwise Minecraft will not save it. You can see diesieben07's simple example here: WorldSaveData example code
-
[1.12.2] Vanilla mobs with custom loot table [SOLVED]
jabelar replied to supreme marshal's topic in Modder Support
What he means is sometimes even though you only want to pass in one condition the method expects an array. So simply make an array with only one condition and pass that. In other words you need to match the type LoopCondition[] not LoopCondition. In other words, leave the new LootCondition[0] but initialize the first element to be new RandomChance(0.5F) -
[1.12.2] Vanilla mobs with custom loot table [SOLVED]
jabelar replied to supreme marshal's topic in Modder Support
Is your event properly subscribed to the event bus? You need to use the @EventSubscriber annotation on the class. Also, depending on how you register to the bus you now probably need to make your event handling method static. In any case, you should confirm that your loot table method is being called. I usually do this by putting some console print statements in the code to show that the event fired and you can also put it in other parts to make sure the event type matched and your if statements executed as expected. Alternatively you can set a breakpoint and use the debug mode of Eclipse to confirm the execution.