Jump to content

American2050

Members
  • Posts

    553
  • Joined

Everything posted by American2050

  1. FlansMod has open source code. Maybe you can ask the authors some help for your mod.
  2. Uh huh. That would be the case. Thanks, I think I have never done that, gonna investigate how it should be done.
  3. I know for Mobs Entities, would this be the same? I forgot I also have this on my RenderEntities. I think the problem is that I'm not "attaching" any texture/model/render to that EntityBlockCake
  4. I'm not sure how to describe the problem I'm having as I'm lost and not sure exactly what I'm missing here. I have a Cake block with custom texture, so for that block I have the CustomCake that extends BlockContainer and when added to world it creates the TileEntity for it. I register all that like this TileEntitySpecialRenderer renderCake = new RenderBlockCake(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlockCake.class, renderCake); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.blockCake), new ItemRenderBlockCake(renderCake, new TileEntityBlockCake())); All that works perfectly. Now the problem comes when I need to render the other entity that is created when I activate the cake (Right click) it basically should be like TNT it should spawn the cake "fused" and explode. I get the explosion, but I'm missing how should I register my EntityBlockCake and attach this to a Render I have this happening when the block cake is right clicked EntityBlockCake entityBlockCake = new EntityBlockCake(world, (double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), entityPlayer); entityBlockCake.fuse = world.rand.nextInt(entityBlockCake.fuse / 4) + entityBlockCake.fuse / 8; world.spawnEntityInWorld(entityBlockCake); And finally and here for sure is my error/missing stuff I'm registering that EntityBlockCake like this EntityRegistry.registerModEntity(EntityBlockCake.class, "Cake", 3501, this, 64, 10, true); I forgot I also have this on my RenderEntities. Any help/idea of what I'm missing will help. Thanks a lot.
  5. At this point, I would call me happy just by removing the End Portal Frames on the Strongholds Portal Rooms. Reading around I found this post http://www.minecraftforge.net/forum/index.php/topic,21625.0.html Where I implement that and register it on the PopulateChunkEvent.Pre @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(PopulateChunkEvent.Pre event) { Chunk chunk = event.world.getChunkFromChunkCoords(event.chunkX, event.chunkZ); Block fromBlock = Blocks.end_portal_frame; // change this to suit your need Block toBlock = Blocks.air; // change this to suit your need for (ExtendedBlockStorage storage : chunk.getBlockStorageArray()) { if (storage != null) { for (int x = 0; x < 16; ++x) { for (int y = 0; y < 16; ++y) { for (int z = 0; z < 16; ++z) { if (storage.getBlockByExtId(x, y, z) == fromBlock) { storage.func_150818_a(x, y, z, toBlock); } } } } } } chunk.isModified = true; // this is important as it marks it to be saved } Problem is that it doesn't work correctly, it does replace the End Portal Frames with air, but not all of them I did several tests and it replaced 9 in one seed leaving a row of 3 and in another test with different seed it replaced only 7. I think the example they provide here was to replace "Ores" and maybe to replace End Portal Frames I have to run this in another event? Back to your question. Yes I was to modify Overworld. I have this Event registered on main mod class @EventHandler public void init(FMLInitializationEvent event) { //EVENTS MinecraftForge.EVENT_BUS.register(new WGMEventHandler()); } WGMEventHandler (I think my error is here on that if statement) @SubscribeEvent public void initMapGenEvent(InitMapGenEvent event) { if(event.type == EventType.STRONGHOLD ) { event.newGen = new CustomMapGenStronghold(); } } And on CustomMapGenStronghold public class CustomMapGenStronghold extends MapGenStronghold { @Override public boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { return false; } } Thanks for the links, gonna take a lok at those
  6. Thanks Choonster, yes I finally found something, and I kinda made what you saying, what I'm not sure about is how to make the Event thing. I'm gonna do some tests and see how it goes, but I already made a custom ChunkProvider and also made my own MapGenStronghold and StructureStrongholdPieces I'll play around with my EventHandler and see what to do there
  7. Does anyone know of some Tutorial on how to Override Vanilla World Generation, like to disable stuff, like for example Mineshaft or Strongholds and things like that? Thanks a lot.
  8. Ohh ok, thanks for the tip. I'm not good with NBT but when I learn that I can give this a try. Thanks once again.
  9. Really it's just for the LULZ (For fun) on some items in my mod I needed a number higher than 64. I thought it was something easy (well, not easy, but I saw it I believe on Tinkers Constructs Arrows I believe) I will stick to 64 I guess, don't want to make things more complicate in my code, lol. Thanks for the answer
  10. Would it be possible to set a stack size for an item above 64 and make it work without problems? As for now I can actually pick over 64 of my custom item (Middle click in creative mode) but when I place them in my inventory the stack created is only 64 and the remaining ones are still in my hand... (In survival the stack in inventory stops at 64 and it starts a new one. I guess I have to overwrite something else that I'm missing, but not sure. private static int maxStack = 80; public ItemOre() { super(); this.setMaxStackSize(maxStack); this.setCreativeTab(ModCreativeTab.BD_Misc); } @Override public Item setMaxStackSize(int stackSize) { this.maxStack = stackSize; return this; } /** * Returns the maximum size of the stack for a specific item. */ @Override @Deprecated public int getItemStackLimit() { return this.maxStack; } Most likely I'm also including the getItemStackLimit but I guess that's actually not needed.
  11. Thanks Major Squirrel great explanation What I wasn't sure about is what would happen if I forget to indicate that I'm overriding another method.
  12. I always wonder.... What happens if I forget the @Override on some method... For example in a Block that extends Block, what would happen if I forget the @Override? @Override public MapColor getMapColor(int p_149728_1_) { return MapColor.stoneColor; } If I just have: public MapColor getMapColor(int p_149728_1_) { return MapColor.stoneColor; } Would it be a problem? Is @Override really important?
  13. Thanks going to read it Hopefully that clarifies my confusion
  14. Thanks diesieben07. Yes I guess I could do that and make my mod to print something on console each time a player dies, and if someone gets this dead again I can ask them to send me that. The problem will be that most likely they wont have a save of that log and not even a crash report. But I like your idea to see what caused the dead. This would be easier if I could reproduce it, but I have tested inside the pack, and only with my mod and nothing I can't get this dead to happen to me. Thanks for the answer and the idea on how to see whats going on, gonna see how I can implement it.
  15. The "github.com/leSamo/TotalAutomation" is not working, leads to 404 page
  16. I can't remember where but I think I read that @SideOnly(Side.CLIENT) shouldn't be used anymore. My question is, wherever I have things like this: @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1)); } I should modify them like if(!world.isRemote) { itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1)); } But what happens when I don't have "world" available to use, like in this case?
  17. The VOD with what happened is here http://www.twitch.tv/jonbams/v/12546026 2:44 Hs into the Stream when the effects run out. I most likely sure it's not related with the apple, but I can't reproduce the error to see what the issue is. 16 minutes earlier on the VOD is when he eats the apple.
  18. Hello guys, this isn't an easy one as I can't reproduce the error. So I'm not sure if it's something I'm doing wrong, or maybe other mod in the pack my Mod is on causing this issues. I have an apple that apply many Vanilla Potions effects, and we heard already a few times people die when the effect runs out, or it says they die (Not sure what this mean) apparently they are like stuck in the "Die animation" and when they relog they didn't really die. (I'm downloading a Twitch VOD to see hoe exactly this happened) So, for a start, this is the apple code. I think, but not sure, that maybe Health Boost maybe the issue. I have seen that when you change dimensions the extra hearts don't show anymore (Same for absorption) protected void onFoodEaten(ItemStack itemStack, World world, EntityPlayer player) { if (!world.isRemote) { player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 19200, 0)); player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 4800, 4)); //Absorption player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 19200, 1)); player.addPotionEffect(new PotionEffect(Potion.resistance.id, 19200, 0)); player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 19200, 0)); player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 19200, 1)); player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 19200, 4)); //healthBoost player.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 19200, 0)); //saturation player.addPotionEffect(new PotionEffect(Potion.heal.id, 200, 0)); } }
  19. Thanks Delpi I will take a look around doing something of what you mention. The truth is that I'm working over the code that someone else did, so figuring this things out aren't easy for me And yes, when I log out and log in the world renders again with no problem. Thanks again for the answer, if I find a fix I will post again to let you know how it did
  20. Are there any restrictions when teleporting a player out of the End and back to the Overworld? Whenever I try that, the player gets teleported to the Overworld, but the world itself wont render. I guess this is related with the "Credits" that are suppose to run when someone leaves the end maybe? Because I have not problem with player comings from the Nether for example.
  21. Ohhh nvm I guess I forgot to declare the List I was creating. List<EntityPlayer> playersConnected = new ArrayList<EntityPlayer>(); playersConnected= world.playerEntities; for (EntityPlayer player : playersConnected) { Gonna give this a try
  22. I get that Object can't be converted to EntityPlayer on the for statement. I must be missing something there to make it work, can't clearly see what.
  23. I have a problem, I'm making some modifications on a code a friend sent me and I need to update/change the way he gives a certain items to the players connected on game. The actual code is like: try { for (Iterator iterator = new ArrayList(world.playerEntities).iterator(); iterator.hasNext() { ((EntityPlayer) iterator.next()).inventory.addItemStackToInventory(new ItemStack(ItemManager.medal)); } } catch (Exception ex) { Log.logError("Failed to distribute medal!"); } The problem is that, that method will only work, if the player actually has an empty slot on his inventory. What I want to do is to spawn the item at the player position, but I can't figure out how to get them. I have tried: double positionX = ((EntityPlayer) iterator.next()).posX; System.out.println(positionX) And also: EntityPlayer thePlayer = ((EntityPlayer) iterator.next()); But it also crashes. What am I doing wrong here?
  24. Thanks for the help guys Sounds complicate, gonna do some testing and see how I can handle it.
×
×
  • Create New...

Important Information

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