Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Manslaughter777

  1. So i made a living entity event class but one of the methods i need is not public in the EntityLivingBase class,what can i do? LivingEvent class The method i need to somehow make public which i have no clue how to do: any help would be great
  2. Actually nvm looks like its done in the entity classes
  3. Where can I find where minecraft makes it so Material.water makes the player swim and lose oxygen? I've been trying to figure this out for so long and still cannot find it. I know there is a method isLiquid() but where does it say anything about the player swimming and losing oxygen???
  4. So my custom furnace (mineral extractor) has its own slot where if you place a piece of "powerstone" in it it will change the output amounts to 3 instead of 2. Now here is where it gets stuffed... If you put the powerstone in the slot it wont give out 3, but still 2... BUT if you restart the game it will start giving out 3 like it should. Im almost 100% sure this is because the recipe class isnt getting updated, but dont know how i would. anyway here r the classes: The int that is giving out the amount is "outputAmount" in the TIleEntity class. TileEntity class: (youll find the more important stuff in the updateEntity method) MineralExtractorRecipes class: (this is the class which likely isnt getting updated to match the int in the tileentity class) Ive made the console print out the value of outputAmount in both classes and they r in sync. So it is mostly probably because the Recipe class isnt getting updated. Can anyone help me out somehow updated it so it works in game and not only when the game is restarted. Thnx!
  5. I've tried making the player jump higher without the potion effect but failed doing so... I can never find where potion effects are actually coded to add speed, jump, fire resistance etc. So if anyone knows where I can find it or an alternate way to give the player a jump boost it would helpful
  6. You last parameter should be an int like "int side". Then you run an if statement checking if thats the side you want and THEN return 15. Eg: if(side == 3) { //this makes side 3 emit redstone return 15; } else { return 0; } But seriously u need to learn how methods work...
  7. I wanna make it so when the player enters my dimension it would switch it from EntityPlayer to EntityPlayerDimension (which extends EntityPlayer). Anyone know How i would go about doing so?
  8. So I'm making a moon mod and right now I'm trying to make it so when the player is on the moon it acts just like they r in water. So their air decreases and then they start dieing. I have managed to do all that but the problem is when the player,s air is decreasing it doesn't show the "air bubbles", anyone know how to make it show the air bubbles just like it does in water?
  9. Problem 1: Whenever the chestplate is fully damaged it just repairs itself back too full health. Problem 2: Whenever i take off the chestplate it repairs itself to full helth. ArmorHandler class: Armor class (the chestplate is the gravityJacket) Any help is appreciated
  10. so what i wanna do is: when my custom chestplate is on, its health depleats 1 per second. I know how to do it with Random.nextInt and stuff but thats random and i dont want it random. Do i make a for loop or something? Sorry, this may be a very noobish post
  11. The code is the class I posted. So what happens is i right click the bed. I then sleep for a split second and wake back up but nothing happens. It's very weird
  12. I click on the bed and i sleep for about half a second, then get back up and its still night. Copied from BlockBed, am is missing something? package com.manslaughter777.crystaldimension.block; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.Iterator; import java.util.Random; import com.manslaughter777.crystaldimension.Main; import net.minecraft.block.Block; import net.minecraft.block.BlockBed; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.Direction; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; public class BlockMattress extends BlockDirectional { public static final int[][] field_149981_a = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}}; @SideOnly(Side.CLIENT) private IIcon[] endIcon; @SideOnly(Side.CLIENT) private IIcon[] sideIcon; @SideOnly(Side.CLIENT) private IIcon[] topIcon; public BlockMattress() { super(Material.cloth); this.func_149978_e(); } /** * Called upon block activation (right click on the block.) */ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p6, float p7, float p8, float p9) { if (world.isRemote) { return true; } else { int i1 = world.getBlockMetadata(x, y, z); if (!isBlockHeadOfBed(i1)) { int j1 = getDirection(i1); x += field_149981_a[j1][0]; z += field_149981_a[j1][1]; if (world.getBlock(x, y, z) != this) { return true; } i1 = world.getBlockMetadata(x, y, z); } if (world.provider.canRespawnHere() && world.getBiomeGenForCoords(x, z) == Main.crystalBiome) { if (func_149976_c(i1)) { EntityPlayer entityplayer1 = null; Iterator iterator = world.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer entityplayer2 = (EntityPlayer)iterator.next(); if (entityplayer2.isPlayerSleeping()) { ChunkCoordinates chunkcoordinates = entityplayer2.playerLocation; if (chunkcoordinates.posX == x && chunkcoordinates.posY == y && chunkcoordinates.posZ == z) { entityplayer1 = entityplayer2; } } } if (entityplayer1 != null) { player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0])); return true; } func_149979_a(world, x, y, z, false); } EntityPlayer.EnumStatus enumstatus = player.sleepInBedAt(x, y, z); if (enumstatus == EntityPlayer.EnumStatus.OK) { func_149979_a(world, x, y, z, true); return true; } else { if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) { player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0])); } else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) { player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0])); } return true; } } else { double d2 = (double)x + 0.5D; double d0 = (double)y + 0.5D; double d1 = (double)z + 0.5D; world.setBlockToAir(x, y, z); int k1 = getDirection(i1); x += field_149981_a[k1][0]; z += field_149981_a[k1][1]; if (world.getBlock(x, y, z) == this) { world.setBlockToAir(x, y, z); d2 = (d2 + (double)x + 0.5D) / 2.0D; d0 = (d0 + (double)y + 0.5D) / 2.0D; d1 = (d1 + (double)z + 0.5D) / 2.0D; } player.addChatMessage(new ChatComponentTranslation("tile.bed.noUse")); return true; } } } /** * Gets the block's texture. Args: side, meta */ @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { if (side == 0) { return Blocks.planks.getBlockTextureFromSide(side); } else { int k = getDirection(meta); int l = Direction.bedDirection[k][side]; int i1 = isBlockHeadOfBed(meta) ? 1 : 0; return (i1 != 1 || l != 2) && (i1 != 0 || l != 3) ? (l != 5 && l != 4 ? this.topIcon[i1] : this.sideIcon[i1]) : this.endIcon[i1]; } } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegistry) { this.topIcon = new IIcon[] {iconRegistry.registerIcon(this.getTextureName() + "_feet_top"), iconRegistry.registerIcon(this.getTextureName() + "_head_top")}; this.endIcon = new IIcon[] {iconRegistry.registerIcon(this.getTextureName() + "_feet_end"), iconRegistry.registerIcon(this.getTextureName() + "_head_end")}; this.sideIcon = new IIcon[] {iconRegistry.registerIcon(this.getTextureName() + "_feet_side"), iconRegistry.registerIcon(this.getTextureName() + "_head_side")}; } /** * The type of render function that is called for this block */ public int getRenderType() { return 14; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } /** * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ public boolean isOpaqueCube() { return false; } /** * Updates the blocks bounds based on its current state. Args: world, x, y, z */ public void setBlockBoundsBasedOnState(IBlockAccess worldBlock, int x, int y, int z) { this.func_149978_e(); } /** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor Block */ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { int l = world.getBlockMetadata(x, y, z); int i1 = getDirection(l); if (isBlockHeadOfBed(l)) { if (world.getBlock(x - field_149981_a[i1][0], y, z - field_149981_a[i1][1]) != this) { world.setBlockToAir(x, y, z); } } else if (world.getBlock(x + field_149981_a[i1][0], y, z + field_149981_a[i1][1]) != this) { world.setBlockToAir(x, y, z); if (!world.isRemote) { this.dropBlockAsItem(world, x, y, z, l, 0); } } } public Item getItemDropped(int direction, Random random, int unused) { /** * Returns whether or not this bed block is the head of the bed. */ return isBlockHeadOfBed(direction) ? Item.getItemById(0) : Main.mattress; } private void func_149978_e() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); } /** * Returns whether or not this bed block is the head of the bed. */ public static boolean isBlockHeadOfBed(int direction) { return (direction & != 0; } public static boolean func_149976_c(int direction) { return (direction & 4) != 0; } public static void func_149979_a(World world, int x, int y, int z, boolean isOccupied) { int l = world.getBlockMetadata(x, y, z); if (isOccupied) { l |= 4; } else { l &= -5; } world.setBlockMetadataWithNotify(x, y, z, l, 4); } public static ChunkCoordinates func_149977_a(World world, int x, int y, int z, int p5) { int i1 = world.getBlockMetadata(x, y, z); int j1 = BlockDirectional.getDirection(i1); for (int k1 = 0; k1 <= 1; ++k1) { int l1 = x - field_149981_a[j1][0] * k1 - 1; int i2 = z - field_149981_a[j1][1] * k1 - 1; int j2 = l1 + 2; int k2 = i2 + 2; for (int l2 = l1; l2 <= j2; ++l2) { for (int i3 = i2; i3 <= k2; ++i3) { if (World.doesBlockHaveSolidTopSurface(world, l2, y - 1, i3) && !world.getBlock(l2, y, i3).getMaterial().isOpaque() && !world.getBlock(l2, y + 1, i3).getMaterial().isOpaque()) { if (p5 <= 0) { return new ChunkCoordinates(l2, y, i3); } --p5; } } } } return null; } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World world, int x, int y, int z, int direction, float p6, int p7) { if (!isBlockHeadOfBed(direction)) { super.dropBlockAsItemWithChance(world, x, y, z, direction, p6, 0); } } /** * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility * and stop pistons */ public int getMobilityFlag() { return 1; } /** * Gets an item for the block being called on. Args: world, x, y, z */ @SideOnly(Side.CLIENT) public Item getItem(World world, int x, int y, int z) { return Main.mattress; } /** * Called when the block is attempted to be harvested */ public void onBlockHarvested(World world, int x, int y, int z, int direction, EntityPlayer player) { if (player.capabilities.isCreativeMode && isBlockHeadOfBed(direction)) { int i1 = getDirection(direction); x -= field_149981_a[i1][0]; z -= field_149981_a[i1][1]; if (world.getBlock(x, y, z) == this) { world.setBlockToAir(x, y, z); } } } }
  13. Don't worry fixed. I just added it through the biome decorator
  14. The dimension Id is there cause if I want to change the id I don't need to write 7 everywhere and I've used IWorldGenerator for trees and ores so idk why melons arnt working.... Anyway ill check it out and see what happens
  15. make sure that your modid is LOWERCASE and also make sure that in the resources/assets/MODID < is lowercase! I had this problem to and the modid had to be lowercase
  16. I cant get my custom melon like block (Sweet berry bush) to generate in my dimension. Ive copied and changed what was in the WorldGenMelon class but still doesnt work. WorldGenBerryBush class PlantGenerator class Any help is much appreciated
  17. Im having the weidest problem generated 2 different types of trees in my dimension (metadata). I crash every time i make a new world for some reason. Now for some reason when i only generate 1 of the trees in works perfectly, but both, gives an error. TreeGen WorldGenCrystalTrees ERROR CODE (Seems to be line 81 of WorldGenCrystalTrees --- Minecraft Crash Report ---- // Why did you do that? Time: 9/11/14 6:53 PM Description: Exception getting block type in world java.lang.StackOverflowError: Exception getting block type in world at java.security.AccessController.doPrivileged(Native Method) at java.lang.ClassLoader.checkPackageAccess(Unknown Source) at net.minecraft.world.World.getBlock(World.java:389) at com.manslaughter777.crystaldimension.world.gen.feature.WorldGenCrystalTrees.generate(WorldGenCrystalTrees.java:81) at com.manslaughter777.crystaldimension.world.gen.TreeGenerator.addTreeSpawn(TreeGenerator.java:70) at com.manslaughter777.crystaldimension.world.gen.TreeGenerator.generateCrystal(TreeGenerator.java:52) at com.manslaughter777.crystaldimension.world.gen.TreeGenerator.generate(TreeGenerator.java:29) at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:106) at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:314) at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1134) at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:208) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:119) at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:221) at net.minecraft.world.World.getChunkFromChunkCoords(World.java:479) at net.minecraft.world.World.getBlock(World.java:384) btw it repeats these lines about 100 times
  • Create New...

Important Information

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