Everything posted by OrangeVillager61
-
1.11 Overidding MC villages
Uh, okay. Am I supposed to have anything there? - Not edited (usually I remove stuff that don't have anything to do with the problem. public class ClientProxy extends CommonProxy{ @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); BlockRender.preInit(); } @Override public void init(FMLInitializationEvent e) { super.init(e); ItemRender.registerItemRenderer(); BlockRender.registerBlockRenderer(); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } }
-
1.11 Overidding MC villages
Alright, I've changed that but the event is still not firing. public class CommonProxy { @EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.TERRAIN_BUS.register(new ChangeVillageGeneration()); } @EventHandler public void init(FMLInitializationEvent e) { } @EventHandler public void postInit(FMLPostInitializationEvent e) { }
-
1.11 Overidding MC villages
Alright, so my code isn't being run at all, even the class the swaps the village gen. public class CommonProxy { @EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new ChangeVillageGeneration()); } @EventHandler public void init(FMLInitializationEvent e) { } @EventHandler public void postInit(FMLPostInitializationEvent e) { } public class ChangeVillageGeneration { @SubscribeEvent public void changeVillageGen (InitMapGenEvent event) { if (event.getType() != null && event.getType() == EventType.VILLAGE){ IvMapGenVillage newGen = (IvMapGenVillage) event.getNewGen(); System.out.print("Genning 2"); - I'm not getting this print event.setNewGen(newGen); } } }
-
1.11 Overidding MC villages
It is visible, it wants a list to be from the class I'm copying from not the class I'm using. I'll try a reflection, since the augment name types are different but are pretty much identical.
-
1.11 Overidding MC villages
What? I don't understand this...
-
Renamed: Figured out most of villagers, need help ironing out bugs
I've extended EntityVillager and made a class with a few things that I will use in my mod. How to use the EntityRegistry and I want these to override vanilla mc villagers but only the vanilla careers and professions. Also, do I need to put in EntityVillager AI and my custom made AI or is this not needed?
-
1.11 Overidding MC villages
So, do what else do I need to do to get rid of the error since it is still there after extending MapGnVillage?
-
1.11 Overidding MC villages
Aha, I thought one could just copy paste the file and import everything, also if I extend MapGenVillage it gives me the same errors.
-
1.11 Overidding MC villages
I just copy pasted the vanilla structure pieces file and then made edits in a different section than the bugged code. public class VillageStructures { public static List<VillageStructures.PieceWeight> getStructureVillageWeightedPieceList(Random random, int size) { List<VillageStructures.PieceWeight> list = Lists.<VillageStructures.PieceWeight>newArrayList(); list.add(new VillageStructures.PieceWeight(VillageStructures.House4Garden.class, 4, MathHelper.getInt(random, 2 + size, 4 + size * 2))); list.add(new VillageStructures.PieceWeight(VillageStructures.Church.class, 20, MathHelper.getInt(random, 0 + size, 1 + size))); list.add(new VillageStructures.PieceWeight(VillageStructures.House1.class, 20, MathHelper.getInt(random, 0 + size, 2 + size))); list.add(new VillageStructures.PieceWeight(VillageStructures.WoodHut.class, 3, MathHelper.getInt(random, 2 + size, 5 + size * 3))); list.add(new VillageStructures.PieceWeight(VillageStructures.Hall.class, 15, MathHelper.getInt(random, 0 + size, 2 + size))); list.add(new VillageStructures.PieceWeight(VillageStructures.Field1.class, 3, MathHelper.getInt(random, 1 + size, 4 + size))); list.add(new VillageStructures.PieceWeight(VillageStructures.Field2.class, 3, MathHelper.getInt(random, 2 + size, 4 + size * 2))); list.add(new VillageStructures.PieceWeight(VillageStructures.House2.class, 15, MathHelper.getInt(random, 0, 1 + size))); list.add(new VillageStructures.PieceWeight(VillageStructures.House3.class, 8, MathHelper.getInt(random, 0 + size, 3 + size * 2))); [u]net.minecraftforge.fml.common.registry.VillagerRegistry.addExtraVillageComponents(list, random, size);[/u] Erroring code. Iterator<VillageStructures.PieceWeight> iterator = list.iterator(); while (iterator.hasNext()) { if (((VillageStructures.PieceWeight)iterator.next()).villagePiecesLimit == 0) { iterator.remove(); } } return list; } private static VillageStructures.Village findAndCreateComponentFactory(VillageStructures.Start start, VillageStructures.PieceWeight weight, List<StructureComponent> structureComponents, Random rand, int structureMinX, int structureMinY, int structureMinZ, EnumFacing facing, int componentType) { Class <? extends VillageStructures.Village > oclass = weight.villagePieceClass; VillageStructures.Village structurevillagepieces$village = null; if (oclass == VillageStructures.House4Garden.class) { structurevillagepieces$village = VillageStructures.House4Garden.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.Church.class) { structurevillagepieces$village = VillageStructures.Church.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.House1.class) { structurevillagepieces$village = VillageStructures.House1.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.WoodHut.class) { structurevillagepieces$village = VillageStructures.WoodHut.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.Hall.class) { structurevillagepieces$village = VillageStructures.Hall.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.Field1.class) { structurevillagepieces$village = VillageStructures.Field1.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.Field2.class) { structurevillagepieces$village = VillageStructures.Field2.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.House2.class) { structurevillagepieces$village = VillageStructures.House2.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else if (oclass == VillageStructures.House3.class) { structurevillagepieces$village = VillageStructures.House3.createPiece(start, structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType); } else { [u]structurevillagepieces$village = net.minecraftforge.fml.common.registry.VillagerRegistry.getVillageComponent(weight, start , structureComponents, rand, structureMinX, structureMinY, structureMinZ, facing, componentType);[/u] Erroring code } return structurevillagepieces$village; } }
-
1.11 Overidding MC villages
Ah, so if I wanted to one building, then I would have to paste in the entire structure pieces file? Also, I've been getting this error as stated in an earlier post. "The method addExtraVillageComponents(List<StructureVillagePieces.PieceWeight>, Random, int) in the type VillagerRegistry is not applicable for the arguments (List<VillageStructures.PieceWeight>, Random, int)"
-
1.11 Overidding MC villages
What do you mean by that? Do you wish me to reword it?
-
1.11 Overidding MC villages
So if I just add a building, I use the same command as if I want to replace vanilla generation?
-
1.11 Overidding MC villages
Ah, okay that makes sense, but I'd like to clear the original generation since I made a different version of the vanilla generation.
-
1.11 Overidding MC villages
So this? I don't really understand the event. if (event.getType() != null && event.getType() == EventType.VILLAGE){ MapGenVillage oldGen = (MapGenVillage) event.getOriginalGen(); IvMapGenVillage newGen = (IvMapGenVillage) event.getNewGen(); event.setNewGen(newGen);
-
1.11 Overidding MC villages
Alright, so how to replace the village buildings? I've made an attempt on putting my code in the event but I'm not sure if this will work... public class ChangeVillageGeneration { @SubscribeEvent public void changeVillageGen (InitMapGenEvent event) { if (event.getType() != null && event.getType() == EventType.VILLAGE){ IvMapGenVillage newGen = (IvMapGenVillage) event.getNewGen(); event.setNewGen(newGen); } } }
-
1.11 Overidding MC villages
Also, the code I'm modifying has an error I can't seem to fix, two functions (addExtraVillageComponents and getVillageComponent) want a VillageStructures instead of StructureVillagePieces.
-
1.11 Overidding MC villages
Would village structures from other mods be able to spawn though? I'd prefer to have compatibility with other mods.
-
1.11 Overidding MC villages
Ah, okay thanks. So how do I override the vanilla structures with a modified file?
-
1.11 Overidding MC villages
Yep, I found that file, but the only torch and door code I could find was protected void createVillageDoor(World p_189927_1_, StructureBoundingBox p_189927_2_, Random p_189927_3_, int p_189927_4_, int p_189927_5_, int p_189927_6_, EnumFacing p_189927_7_) { if (!this.isZombieInfested) { this.generateDoor(p_189927_1_, p_189927_2_, p_189927_3_, p_189927_4_, p_189927_5_, p_189927_6_, EnumFacing.NORTH, this.biomeDoor()); } } protected void placeTorch(World p_189926_1_, EnumFacing p_189926_2_, int p_189926_3_, int p_189926_4_, int p_189926_5_, StructureBoundingBox p_189926_6_) { if (!this.isZombieInfested) { this.setBlockState(p_189926_1_, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, p_189926_2_), p_189926_3_, p_189926_4_, p_189926_5_, p_189926_6_); } } Along with the code that defines most of the functions and variables in there. I could not find anything that makes the small houses not generate doors or the library not generating torches.
-
1.11 Overidding MC villages
I can't find the code that shows where doors are placed, even looking in the village structure parts file.
-
1.11 Overidding MC villages
Hello! I would like to know how to override vanilla village structures with a modified version of my own. The only thing I'm changing is that I'm adding doors to the small houses. I would also know how to do that.
-
Where can I override village.class?
Yes but how do I get the private values for the villages?
-
Where can I override village.class?
Alright, how do I get the number of villagers and other stats of a village to use in the event?
-
Where can I override village.class?
Alright, thanks. How would I use events to modify needed doors and needed villagers to spawn an iron golem?
-
Where can I override village.class?
Alright, sure I could use an event however I would like to modify (using a modified copy) the village.class file so I could easily change a variable in it (as my current task takes two variables, the min doors required and nu villagers required).
IPS spam blocked by CleanTalk.