jredfox
Members-
Posts
660 -
Joined
-
Last visited
Everything posted by jredfox
-
[Solved]PopulateChunkEvent.Populate Never Fires In Overworld
jredfox replied to jredfox's topic in Modder Support
What happens when you switched to terrain bus did it work? -
[Solved]PopulateChunkEvent.Populate Never Fires In Overworld
jredfox replied to jredfox's topic in Modder Support
Then why does this method never fire the chunks fired several dozen dungeons If I revert to just pupulate it works but, populate populate what I actually need it's never firing is it in the wrong bus or is this a bug? -
@SubscribeEvent public void populate(PopulateChunkEvent.Populate event){ System.out.println("hie"); } @Mod.EventHandler public void init(FMLInitializationEvent e) { MinecraftForge.EVENT_BUS.register(this); } What am I doing wrong I read the code in the chunk provider it occurs 100 times but, I do not see any output if I remove the .populate it then works but, I need it to only fire for the populate for spawners there is a dungeon right next to my spawn with the seed of 2 and it's not printing. Ok this was solved by changeing the event buss to terrain
-
took everything out but, the printline event is still not firing because it's not printing regardless of an actual dungeon that spawned in
-
What is wrong with this code main class preinit MinecraftForge.EVENT_BUS.register(new ReplaceGen() ); Replace Gen Class isn't printing: package com.EvilNotch.dungeontweeks.main.EventHandlers; import java.util.Iterator; import java.util.Map; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ReplaceGen { @SubscribeEvent public void replaceDungeon(PopulateChunkEvent.Populate e) { System.out.println("here"); if(e.getType() != EventType.ANIMALS) return; World w = e.getWorld(); if(w.isRemote) return; Chunk chunk = w.getChunkFromChunkCoords(e.getChunkX(), e.getChunkZ() ); Map<BlockPos, TileEntity> map = chunk.getTileEntityMap(); if(map == null) return; Iterator<Map.Entry<BlockPos, TileEntity>> it = map.entrySet().iterator(); while(it.hasNext() ) { Map.Entry<BlockPos, TileEntity> pair = it.next(); BlockPos pos = pair.getKey(); TileEntity tile = pair.getValue(); if(tile instanceof TileEntityMobSpawner) { IBlockState old = w.getBlockState(pos); NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound data = new NBTTagCompound(); data.setString("id", "minecraft:wither_skeleton"); compound.setTag("SpawnData", data); tile.readFromNBT(compound); tile.markDirty(); w.notifyBlockUpdate(pos, old, w.getBlockState(pos), 3); } } } }
-
The main issue without replacing the world gen is how do I know what is what, sure I could hardcode if spawner has cobblestone/mossy under it it is dungeon type. Also what am I suppose to be getting in this event a chunk one of the ichunkprovider things? Anyways going to use this for the dynamic edition of arraylists regardless so I would like to know thanks
-
Choonster said this on my older forum I think it's possible just not sure if it's the right thing to do. For example how would I know if this A: fires on chunk load rather then new chunk creation B: what type of the spawner is it going to be everything but, I have separate lists for each structure. I like this idea better though Maybe I could flag some booleans on other events to say what the type is and if it's any type meaning modded then use the any list if size != 0 what if gamerule says not to spawn that type will never fire I need a more precise type. I was thinking something like that to but, would that type event work for say nether fortress because, the start of the structure is almost never in the same chunk as the spawner or does that event fire every chunk? I am trying to be compatible by not replacing vanilla world gen.
-
I am saying vanilla doesn't keep track of where the blockposes are for their worldgen objects out of frustration that's all. I might decide to later when I am free
-
So the other classes don't even store the blockpos for tile entities seems kind of stupid. Seems like something forge would fix. Ok well I guess I will be replacing all vanilla worldgen just to change a tile entity data
-
So your saying I have to replace the worldgen with my own for the regular dungeon? Is this the same with the other event because I don't know what classes the others are generated in?
-
I need to edit to change nbt of a spawner from vanilla world gen for a mod I plan on making. No sending in a resource location of an entity isn't good enough I want jockie spawners and pink sheep spawners abilities along with custom delays from configurations. I can figure out the config stuff I just need to know do I have to replace the world gen and if so what event, if not how do I get the spawner from the dungeon and what event would I use. Dungeons I am looking to modify: dungeon, mineshaft, stronghold, nether fortress Mod Support: father toasts dangerous world dungeon(main), and battle towers Event doesn't fire Literally I call register this with my event handler and nothing happens I have @ subsribe event and everything please help code below MinecraftForge.EVENT_BUS.register(new ReplaceGen() );
-
fixed backport your java to java 8u51 for computers with computers that are older
-
I am using latest java 8 , my ram is default which is 1g
-
Yes I disabled the enabled setting in splash.properties but, it didn't even create them I had to grab it and nothing still crashes. I have default mod code for forge's skeleton I have latest graphics card for my pc Forge when compiled works on my pc Forge in dev right after it sets the user crashes on the pc Java version and JDK Build: 1.8.0_162 Fore Build: Recommended on mc 1.12.2 Issues was solved by backporting java to: Java 8u51 don't know why this was only happening in the mdk but, it's solved Crash: https://pastebin.com/JvuHCdHr splash.properties https://pastebin.com/YpzX27YR
-
figured it out it was stupid public void addGameRule(GameRules g,String pos, boolean init, ValueType type) { if(!g.hasRule(pos)) g.addGameRule(pos, "" + init, type); else g.addGameRule(pos, "" + g.getBoolean(pos), type); }
-
the only way to output jsons is overwrite the jar file every single time you launch the game or to output to a custom resource pack either solution isn't good I am going to try and make this a suggestion
-
you can't do that without taking files to the resource pack folder or the jar itself will eventually become corrupt not a good method I would much rather have a static model in code and set them in code.
-
if it's not your items or you want to make a mass amount of blocks/items then this is the only way to go
-
same reason I am saying no to lang files I want to be able to do things in code through an array list
-
ItemStack charcoal = new ItemStack(Items.COAL, 0, 1); GameRegistry.addShapedRecipe(new ResourceLocation("cbm:tst"), new ResourceLocation("recipes"), new ItemStack(MainJava.golden_charcoal), new Object[]{"ggg","gcg","ggg",'g', Items.GOLD_INGOT, 'c', charcoal}); As you can see there this use to be a thing were it would scan for meta and item if you put an item stack into the argument well now it's not working anymore it only accepts the gold_ingot. I did this under pre-init. Also tried this in init. Why are there only shaped recipes that means if I make a sword recipe I have to make 3 recipes? Also what is the first argument suppose to be?
-
@SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { // for(Item item : items) // event.getRegistry().register(item); for(Block b : blocks) { ItemBlock block = new ItemBlock(b); block.setRegistryName(b.getRegistryName()); block.setUnlocalizedName(b.getUnlocalizedName()); event.getRegistry().register(block); } System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); } Ok I just have to fix my models. It would be alot easier if forge just allowed for models to be registered with a default static model then you can change that model at all levels block item item block block state then also have the ability to change the texture
-
what this will confuse so many people now I have to do that to? I understood why the manual register didn't work but, this seems a bit unlike forge ok I will try it
-
Code: https://gist.github.com/jredfox/43807a76bf6af69206e4331c1d926567 I mean I debuged by registering it before the event and it said registered twice during so I know they are being registered. Does forge now not automatically register itemblock for your block even when you use their proper event thing?
-
Say I want to change the texture of a vanilla item but, I don't want to change the entire model. How do I get the model and from the model change it's resource location and or image? This use to be simple as block/item.setTextureName("");
-
Is it a bug that calling ModelLoader.setCustomModelResourceLocation() in pre-init sometimes glitches out and only does the last call that you made during a for loop. I was using that before the register model event in pre-init. How do you change the static models resource location for the texture in code?