Jump to content

happyPenguin

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by happyPenguin

  1. Feel bit noobish I couldn't work out this problem out and thought best to ask for help Im trying to run multiple delays but one after the other. Example of what i want the block to do when activated: *Block runs first delay *creates one layer of blocks *runs second delay *creates second layer of blocks and so on. The code I've written so far: Am i missing something obvious or is their an easier way to run delays? When I test this code It runs the first delay, doesn't spawn the blocks i want, runs second delay then spawns all the blocks at once. public void delayInGame() throws InterruptedException { Thread.sleep(200); } @Override public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) { if(world.isRemote) { return true; } try { /**Add Blocks lvl 1*/ world.setBlock*spawn block code here* world.setBlock*spawn block code here* this.delayInGame(); } catch (InterruptedException e) {} try { /**Add Blocks lvl 2*/ world.setBlock*spawn block code here* world.setBlock*spawn block code here* this.delayInGame(); } catch (InterruptedException e) {}
  2. my mistake was using if (entity instanceof EntityLiving) thank you for the help
  3. hey I'm having a small problem in 1.6 when given a player the poison potion effect when they stand on my block. This did work before the 1.6 update. The EntityCollidedWithBlock method code: /** * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity */ public void onEntityCollidedWithBlock(World world, int var2, int var3, int var4, Entity entity) { entity.attackEntityFrom(DamageSource.generic, 100); ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.poison.id, 160, 0)); } The error: java.lang.ClassCastException: net.minecraft.client.particle.EntitySpellParticleFX cannot be cast to net.minecraft.entity.EntityLivingBase
  4. Hi im wondering if anyone knew of a forge hook or a way to add slots to the player inventory without editing classes or using other api's? my idea was to add a neckless slot for example and a neckless model so the player is wearing a neckless when a item neckless is placed inside the slot. ~HappyPenguin
  5. Hi im just wondering if it's possible to add my own in-game gui without editing the ingamegui.class, My plan is similar to the pumpkin how it adds a pumpkin gui shadow when added the helmet slot. or has anyone got a different idea of doing this but with the same output?
  6. Hi I've just finished porting my mod to ssp/smp 1.4.2 and just got left to port the configuration code to 1.4.2. I've managed to get the config to work with forge universal but I've noticed the config only gets created on the server side and I'm wondering if their was a way to create the config file on the client? so if people were not using this mod for server they can edit block ids still. My plan was to create two versions of my mod one for client and server which would create the config on the server using this code: /**For server version*/ static Configuration configuration = new Configuration(new File("config/CampCraftEditor.cfg")); And the other version would be for client only using this code: /**For Single Player version*/ static Configuration configuration = new Configuration(new File(Minecraft.getMinecraftDir(), "config/CampCraftEditor.cfg")); Or am i going about this the wrong way and the server version reads the config file thats in the server folder
  7. Hi Im just wondering how do I make my code for the server side as I'm tiny bit confused how the new forge universal works Ive decompiled my minecraft single/server using forge and when it gets to the decompiling of server says skipping this is normal I'm just wondering is this normal if I want to make an smp mod? Also when i recompile my mod and add it to servers I get this error "Caused by: java.lang.ClassNotFoundException: bbz" which it can't find the TileEntitySpecialRender as this file is on the client just wondering do i need to do something to stop certain class files running on the server?
  8. Hi im wondering if theirs a way to add damage to an item thats in the fuel slot after every cycle. I know this can be done on a normal furnace using the crafting handler but I was wondering if the handler would work on a custom furnace. Does anyone have a idea/solution to adding damage to my fuel item in my custom furnace?
  9. Hi im trying to change this method to true/false every time the player clicks on the block. This is what I've got so far, just can't seem to get the block to change the boolean method to false, wondering if anyone had an idea how I could do this. public boolean setOpen() { return true; } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { if(this.setOpen() == true) { this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); } else return null; } public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } if(this.setOpen() == true) { return this.setOpen() == false; } else return this.setOpen() == true; }
  10. Thank you for the idea i'll try this out and see what I can do
  11. Im just wondering if it was possible to create a block with meta data then have different models for each meta data block So one block id will have 16 blocks all with different models. If it is possible how would the best way go for doing this?
  12. Hey guys I'm just wondering if it was possible to set two block ids for one block or make the block indestructible once the block has been activated. For example when my block is placed on the ground I want it to be able to be broken but once its been activated the block generates a structure and is placed at the top of the structure and made indestructible so the player can't cheat and make multiple structures using one block.
  13. Im an idiot, didn't notice i added that in copied the returns from modloaderMp I didn't want to make another topic but I'm not sure why Im randomly getting a checksum has no scope error at the moment. Both version of my mods are bringing this error up when the config is loaded but was working fine few days ago when I write the config using forge I can post the code if it helps but the codes matches the tutorial code part from the extra hundreds of blocks and items
  14. As guis for servers have changed so many times I'm getting very confused to how I can get my stove to work again on smp and wondering if anyone is kind enough to give a brother a hand On the server Im guessing i need to return the cooker container but Im tiny bit lost to how i would do this Client Mod_Cooker public class mod_Cooker extends NetworkMod implements IGuiHandler { public void load() { MinecraftForge.setGuiHandler(this, this); } public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { System.out.println("Test Gui1"); if (ID == 1)//Cooker 1 { ModLoader.getMinecraftInstance().displayGuiScreen(new GuiCooker(player.inventory, (TileEntityCooker)player.worldObj.getBlockTileEntity(x, y, z))); } return null; } } Server BlockCooker public static mod_Cooker instance; public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { if(world.isRemote) { return true; } else { entityplayer.openGui(instance, 1, world,i, j, k ); return true; } }
  15. How come you don't add this code saves you importing every class file you need though I would post and try and be a tiny bit helpful import net.minecraft.src.*;
  16. Hi I've created a new bed which extends the normal bed and edited the EntityPlayer.class so I could sleep in this bed. As i use forge I wanted to use the ISleepHandler but having few problems getting this to work Mod_Bed.java public void load() { MinecraftForge.registerSleepHandler(new SuperBedSleepHandler()); } SuperBedSleepHandler package net.minecraft.src; import net.minecraft.src.forge.*; public class SuperBedSleepHandler implements ISleepHandler { public EnumStatus sleepInBedAt(EntityPlayer player, int X, int Y, int Z) { return EnumStatus.OK; } }
×
×
  • Create New...

Important Information

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