Jump to content

BaconRocks77

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by BaconRocks77

  1. I was just wondering if wether or not you could right click and swap the texture of the item, or if you have to create a totally different item and just replace it.
  2. I seem to be having a similar problem [[19:10:06] [main/INFO]: Setting user: Player825 [19:10:11] [Client thread/INFO]: LWJGL Version: 2.9.1 [19:10:27] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:MoreHorror [19:10:29] [sound Library Loader/INFO]: Sound engine started [19:10:36] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [19:10:37] [Client thread/INFO]: Created: 512x256 textures/items-atlas [19:10:37] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:MoreHorror [19:10:38] [Client thread/INFO]: Created: 512x256 textures/items-atlas [19:10:38] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [19:10:39] [sound Library Loader/INFO]: Sound engine started [19:10:48] [Client thread/INFO]: Deleting level New World [19:10:48] [Client thread/INFO]: Attempt 1... [19:10:49] [Client thread/INFO]: Deleting level JOSH [19:10:49] [Client thread/INFO]: Attempt 1... [19:10:55] [server thread/INFO]: Starting integrated minecraft server version 1.7.10 [19:10:55] [server thread/INFO]: Generating keypair [19:10:56] [server thread/INFO]: Converting map! [19:10:56] [server thread/INFO]: Scanning folders... [19:10:56] [server thread/INFO]: Total conversion count is 0 [19:10:58] [server thread/INFO]: Preparing start region for level 0 [19:10:59] [server thread/INFO]: Preparing spawn area: 3% [19:11:00] [server thread/ERROR]: Encountered an unexpected exception java.lang.NullPointerException at net.minecraft.world.chunk.storage.ExtendedBlockStorage.func_150818_a(ExtendedBlockStorage.java:96) ~[ExtendedBlockStorage.class:?] at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:667) ~[Chunk.class:?] at net.minecraft.world.World.setBlock(World.java:515) ~[World.class:?] at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:79) ~[WorldGenMinable.class:?] at net.morehorror.mod.world.MoreHorrorWorldGen.addOreSpawn(MoreHorrorWorldGen.java:58) ~[MoreHorrorWorldGen.class:?] at net.morehorror.mod.world.MoreHorrorWorldGen.generateOverworld(MoreHorrorWorldGen.java:33) ~[MoreHorrorWorldGen.class:?] at net.morehorror.mod.world.MoreHorrorWorldGen.generate(MoreHorrorWorldGen.java:19) ~[MoreHorrorWorldGen.class:?] at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:106) ~[GameRegistry.class:?] at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:316) ~[ChunkProviderServer.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1163) ~[Chunk.class:?] at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:210) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:151) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121) ~[ChunkProviderServer.class:?] at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:315) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:79) ~[integratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96) ~[integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:455) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762) [MinecraftServer$2.class:?] [19:11:00] [server thread/ERROR]: This crash report has been saved to: C:\Documents and Settings\Administrator\Desktop\Modding\MoreHorror 1.7.10\eclipse\.\crash-reports\crash-2014-10-14_19.11.00-server.txt ///////////////////////////////////////////////////////////////////////////////////////////////////// WorldGenClass: [code][package net.morehorror.mod.world; import java.util.Random; import net.morehorror.mod.MoreHorror; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class MoreHorrorWorldGen implements IWorldGenerator{ //cases for the ore generation in the other dimensions @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.dimensionId) { case 0: generateOverworld(random, chunkX * 16, chunkZ * 16, world); break; case 1: generateEnd(random, chunkX * 16, chunkZ * 16, world); break; case -1: generateNether(random, chunkX * 16, chunkZ * 16, world); break; } } private void generateOverworld(Random random, int x, int z, World world) { //Adds to ore spawning algorithm //i = x block pos. x = block z pos, max x, max z , max vein, chance to spawn, minimum y, max y //this.addOreSpawn(MoreHorror.oreBloodOre, world, random, x, z, 16, 16, 2+random.nextInt(5)/*spawns randomly in veins 3 to 5*/, 25/* 25% chance*/, 0, 40/*No lower than 0 but no higher than 50*/); //this.addOreSpawn(MoreHorror.oreEvilOre, world, random, x, z, 16, 16, 3+random.nextInt(5), 35, 0, 60); //this.addOreSpawn(MoreHorror.blockBloodCrystal, world, random, x, z, 16, 16, 1+random.nextInt(1), 20, 0, 50); //this.addOreSpawn(MoreHorror.oreIntrawnOre, world, random, x, z, 16, 16, 1+random.nextInt(, 50, 0, 80); this.addOreSpawn(MoreHorror.oreBloodOre, world, random, x, z, 10, 15, 5, 0, 128); //BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z); //WAIT ON THIS TILL FURTHER THINGS //if((biome == BiomeGenBase.plains)){ //for(int a = 0;a < 1; a++){ //int i = x + random.nextInt(256); //int k = z + random.nextInt(256); //int j = world.getHeightValue(i, k); //new StructureHelpMe().generate(world, random, i, j, k); //} //} } public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVeinSize, int maxVeinSize, int chancesToSpawn, int minY, int maxY ) { WorldGenMinable minable = new WorldGenMinable(block, (minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), Blocks.stone); for(int i = 0; i < chancesToSpawn; i++) { int posX = blockXPos + random.nextInt(16); int posY = minY + random.nextInt(maxY - minY); int posZ = blockZPos + random.nextInt(16); minable.generate(world, random, posX, posY, posZ); } } ////////////////////////////////////////////////////////////////////////////// private void generateEnd(Random random, int i, int x, World world) { // TODO Auto-generated method stub } ///////////////////////////////////////////////////////////////////////////// private void generateNether(Random random, int i, int x, World world) { // TODO Auto-generated method stub } } ]
  3. Alright so now i am able to set the boxes for each orientation but every time I set a new one it alters the rest... I can assume It is the metadata not saving or something so Fix mahbe . [package net.morehorror.mod.blocks; import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.morehorror.mod.MoreHorror; import net.morehorror.mod.tileentity.TileEntityCorpse; import net.morehorror.mod.tileentity.TileEntityCreatureTable; import net.morehorror.mod.tileentity.TileEntityPlank; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class Plank1 extends BlockContainer{ public Plank1(Material m) { super(m); this.setHardness(2.0F); this.setResistance(5.0F); this.setBlockBounds(0F, 0.3125F,0.935F, 1.0F, 0.875F, 1.0F); this.setCreativeTab(MoreHorror.MoreHorrorTab); } public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); this.setDefaultDirection(world, x, y, z); } public int getRenderType() { return -3; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityPlank(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(MoreHorror.modid + ":" + this.getUnlocalizedName().substring(5)); } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { int l = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.F) + 0.5D) & 3; if (l == 0){ this.setBlockBounds(0F, 0.3125F,0.935F, 1.0F, 0.875F, 1.0F); world.setBlockMetadataWithNotify(x, y, z, 2, 2); } if (l == 1){ this.setBlockBounds(0F, 0.3125F,0.935F, 1.0F, 0.875F, 1.0F); world.setBlockMetadataWithNotify(x, y, z, 5, 2); } if (l == 2){ this.setBlockBounds(0F, 0.3125F,0.0F, 1.0F, 0.875F, 0.065F); world.setBlockMetadataWithNotify(x, y, z, 3, 2); } if (l == 3){ this.setBlockBounds(0F, 0.3125F,0.935F, 1.0F, 0.875F, 1.0F); world.setBlockMetadataWithNotify(x, y, z, 4, 2); } TileEntityPlank tile = (TileEntityPlank) world.getTileEntity(x, y, z); tile.direction = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; } private void setDefaultDirection(World world, int x, int y, int z) { if(!world.isRemote) { Block b1 = world.getBlock(x, y, z - 1); Block b2 = world.getBlock(x, y, z + 1); Block b3 = world.getBlock(x - 1, y, z); Block b4 = world.getBlock(x + 1, y, z); byte b0 = 3; if(b1.func_149730_j() && !b2.func_149730_j()) { b0 = 3; } if(b2.func_149730_j() && !b1.func_149730_j()) { b0 = 2; } if(b3.func_149730_j() && !b4.func_149730_j()) { b0 = 5; } if(b4.func_149730_j() && !b3.func_149730_j()) { b0 = 4; } world.setBlockMetadataWithNotify(x, y, x, b0, 2); } } } ]
  4. So basically I need a way to set a box for each orientation and as an added bonus possibly a better box. block: [package net.mymod.mod.blocks; import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.mymod.mod.mymod; import net.mymod.mod.tileentity.TileEntityPlank; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class Plank1 extends BlockContainer{ public Plank1(Material m) { super(m); this.setHardness(2.0F); this.setResistance(5.0F); this.setBlockBounds(0F, 0.3125F,0.935F, 1.0F, 0.875F, 1.0F); this.setCreativeTab(mymodtab.mymodtab); } public int getRenderType() { return -3; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityPlank(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(MoreHorror.modid + ":" + this.getUnlocalizedName().substring(5)); } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { if (entity == null) { return; } TileEntityPlank tile = (TileEntityPlank) world.getTileEntity(x, y, z); tile.direction = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; }} ] Render: [/package net.mymod.mod.rederer; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.mymod.mod.mymod; import net.morehorror.mod.model.ModelPlank1; import net.morehorror.mod.tileentity.TileEntityPlank; import org.lwjgl.opengl.GL11; public class RenderPlank extends TileEntitySpecialRenderer{ private static final ResourceLocation texture = new ResourceLocation(MoreHorror.modid + ":" + "textures/model/ModelPlank1.png"); private ModelPlank1 model; public RenderPlank(){ this.model = new ModelPlank1(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y,double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); TileEntityPlank myTile = (TileEntityPlank) tileentity; int direction = myTile.direction; GL11.glRotatef(direction * 90, 0.0F, 1.0F, 0.0F); this.bindTexture(texture); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } ]
  5. Alright so I have a block that can have multiple orientations but uses the same collision box for each. can you help me have a different collision box for each orientation.
  6. Hey I was wondering how to code in something that when the player walks on something or basically touches the block in any way it executes code. I am not talking about anything portal like i want it to be solid.
  7. Haha Thanks very much i was able to solve the problem looking into some of the dispenser code! So thanks!
  8. Help Please: Okay so whenever i try to activate my block directly my sound doubles up. but if i do it from another block touching one side it will play the sound normally. my theory is that when i put a lever or button on it is it accounts for the direct and indirect power. how do i fix this? Also id like to mention it is a stream sound. [ package ---; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockNote; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.modId.mod; public class SoundBlock1 extends Block{ public SoundBlock1(Material Material) { super(Material); this.setResistance(4); this.setCreativeTab(---.---); } public void onBlockAdded(World world, int x, int y, int z){ if(!world.isRemote){ if(!world.isBlockIndirectlyGettingPowered(x, y, z)){ }else if(world.isBlockIndirectlyGettingPowered(x, y, z)){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "Sound Goes Here", 1.0F, 0.0F + 1.0F); } } } public void onNeighborBlockChange(World world, int x, int y, int z, Block block){ if(!world.isRemote){ if(!world.isBlockIndirectlyGettingPowered(x, y, z)){ }else if(world.isBlockIndirectlyGettingPowered(x, y, z)){ world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "Sound", 1.0F, 0.0F + 1.0F); } } } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon(net.modid + ":" + this.getUnlocalizedName().substring(5)); } }]
×
×
  • Create New...

Important Information

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