SantacreeperLP
Members-
Posts
104 -
Joined
-
Last visited
Everything posted by SantacreeperLP
-
[1.7.10] Block with glowing parts in the darkness
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
First thank you Can you probably help me to downgrade it to 1.7 because I've problems with GLStateManager? I haven't focus on rendering before so I'm not good at working with GL. I would be happy if you help me Thank you a lot. ~Legend -
Hey forge community, I've a question : Can you help me ? I want to create a Block where parts of the texture are visible if its dark like the Infused Shard Ore in Thaumcraft. Can you help me? I would be happy Thank you very much ~Legend
-
[1.7.10] Why does the texture don't render?
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
thanks , I got it nice work -
Hey guys, I've created a tree with a normal worldgen like a oak. It works perfect, I've changed Blocks.leaves &log to my leaves& my log. But I want to generate a tree like net.minecraft.world.gen.feature.WorldGenBigTree; When I use my copy of that class as a worldgen, I can plant my sapling and get a huge oak tree. But I want my leaves and my log. Can you help me? Here's the source of the WorldGenBigTree package net.minecraft.world.gen.feature; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockSapling; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; public class WorldGenBigTree extends WorldGenAbstractTree { /** * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 * and 2 for 1, and 0 and 1 for 2. */ static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; /** random seed for GenBigTree */ Random rand = new Random(); /** Reference to the World object. */ World worldObj; int[] basePos = new int[] {0, 0, 0}; int heightLimit; int height; double heightAttenuation = 0.618D; double branchDensity = 1.0D; double branchSlope = 0.381D; double scaleWidth = 1.0D; double leafDensity = 1.0D; /** Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. */ int trunkSize = 1; /** Sets the limit of the random value used to initialize the height limit. */ int heightLimitLimit = 12; /** Sets the distance limit for how far away the generator will populate leaves from the base leaf node. */ int leafDistanceLimit = 4; /** Contains a list of a points at which to generate groups of leaves. */ int[][] leafNodes; private static final String __OBFID = "CL_00000400"; public WorldGenBigTree(boolean p_i2008_1_) { super(p_i2008_1_); } /** * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. */ void generateLeafNodeList() { this.height = (int)((double)this.heightLimit * this.heightAttenuation); if (this.height >= this.heightLimit) { this.height = this.heightLimit - 1; } int i = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); if (i < 1) { i = 1; } int[][] aint = new int[i * this.heightLimit][4]; int j = this.basePos[1] + this.heightLimit - this.leafDistanceLimit; int k = 1; int l = this.basePos[1] + this.height; int i1 = j - this.basePos[1]; aint[0][0] = this.basePos[0]; aint[0][1] = j; aint[0][2] = this.basePos[2]; aint[0][3] = l; --j; while (i1 >= 0) { int j1 = 0; float f = this.layerSize(i1); if (f < 0.0F) { --j; --i1; } else { for (double d0 = 0.5D; j1 < i; ++j1) { double d1 = this.scaleWidth * (double)f * ((double)this.rand.nextFloat() + 0.328D); double d2 = (double)this.rand.nextFloat() * 2.0D * Math.PI; int k1 = MathHelper.floor_double(d1 * Math.sin(d2) + (double)this.basePos[0] + d0); int l1 = MathHelper.floor_double(d1 * Math.cos(d2) + (double)this.basePos[2] + d0); int[] aint1 = new int[] {k1, j, l1}; int[] aint2 = new int[] {k1, j + this.leafDistanceLimit, l1}; if (this.checkBlockLine(aint1, aint2) == -1) { int[] aint3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; double d3 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - aint1[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - aint1[2]), 2.0D)); double d4 = d3 * this.branchSlope; if ((double)aint1[1] - d4 > (double)l) { aint3[1] = l; } else { aint3[1] = (int)((double)aint1[1] - d4); } if (this.checkBlockLine(aint3, aint1) == -1) { aint[k][0] = k1; aint[k][1] = j; aint[k][2] = l1; aint[k][3] = aint3[1]; ++k; } } } --j; --i1; } } this.leafNodes = new int[k][4]; System.arraycopy(aint, 0, this.leafNodes, 0, k); } void func_150529_a(int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, Block p_150529_6_) { int l = (int)((double)p_150529_4_ + 0.618D); byte b1 = otherCoordPairs[p_150529_5_]; byte b2 = otherCoordPairs[p_150529_5_ + 3]; int[] aint = new int[] {p_150529_1_, p_150529_2_, p_150529_3_}; int[] aint1 = new int[] {0, 0, 0}; int i1 = -l; int j1 = -l; for (aint1[p_150529_5_] = aint[p_150529_5_]; i1 <= l; ++i1) { aint1[b1] = aint[b1] + i1; j1 = -l; while (j1 <= l) { double d0 = Math.pow((double)Math.abs(i1) + 0.5D, 2.0D) + Math.pow((double)Math.abs(j1) + 0.5D, 2.0D); if (d0 > (double)(p_150529_4_ * p_150529_4_)) { ++j1; } else { aint1[b2] = aint[b2] + j1; Block block1 = this.worldObj.getBlock(aint1[0], aint1[1], aint1[2]); if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) { ++j1; } else { this.setBlockAndNotifyAdequately(this.worldObj, aint1[0], aint1[1], aint1[2], p_150529_6_, 0); ++j1; } } } } } /** * Gets the rough size of a layer of the tree. */ float layerSize(int p_76490_1_) { if ((double)p_76490_1_ < (double)((float)this.heightLimit) * 0.3D) { return -1.618F; } else { float f = (float)this.heightLimit / 2.0F; float f1 = (float)this.heightLimit / 2.0F - (float)p_76490_1_; float f2; if (f1 == 0.0F) { f2 = f; } else if (Math.abs(f1) >= f) { f2 = 0.0F; } else { f2 = (float)Math.sqrt(Math.pow((double)Math.abs(f), 2.0D) - Math.pow((double)Math.abs(f1), 2.0D)); } f2 *= 0.5F; return f2; } } float leafSize(int p_76495_1_) { return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; } /** * Generates the leaves surrounding an individual entry in the leafNodes list. */ void generateLeafNode(int p_76491_1_, int p_76491_2_, int p_76491_3_) { int l = p_76491_2_; for (int i1 = p_76491_2_ + this.leafDistanceLimit; l < i1; ++l) { float f = this.leafSize(l - p_76491_2_); this.func_150529_a(p_76491_1_, l, p_76491_3_, f, (byte)1, Blocks.leaves); } } void func_150530_a(int[] p_150530_1_, int[] p_150530_2_, Block p_150530_3_) { int[] aint2 = new int[] {0, 0, 0}; byte b0 = 0; byte b1; for (b1 = 0; b0 < 3; ++b0) { aint2[b0] = p_150530_2_[b0] - p_150530_1_[b0]; if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) { b1 = b0; } } if (aint2[b1] != 0) { byte b2 = otherCoordPairs[b1]; byte b3 = otherCoordPairs[b1 + 3]; byte b4; if (aint2[b1] > 0) { b4 = 1; } else { b4 = -1; } double d0 = (double)aint2[b2] / (double)aint2[b1]; double d1 = (double)aint2[b3] / (double)aint2[b1]; int[] aint3 = new int[] {0, 0, 0}; int i = 0; for (int j = aint2[b1] + b4; i != j; i += b4) { aint3[b1] = MathHelper.floor_double((double)(p_150530_1_[b1] + i) + 0.5D); aint3[b2] = MathHelper.floor_double((double)p_150530_1_[b2] + (double)i * d0 + 0.5D); aint3[b3] = MathHelper.floor_double((double)p_150530_1_[b3] + (double)i * d1 + 0.5D); byte b5 = 0; int k = Math.abs(aint3[0] - p_150530_1_[0]); int l = Math.abs(aint3[2] - p_150530_1_[2]); int i1 = Math.max(k, l); if (i1 > 0) { if (k == i1) { b5 = 4; } else if (l == i1) { b5 = 8; } } this.setBlockAndNotifyAdequately(this.worldObj, aint3[0], aint3[1], aint3[2], p_150530_3_, b5); } } } /** * Generates the leaf portion of the tree as specified by the leafNodes list. */ void generateLeaves() { int i = 0; for (int j = this.leafNodes.length; i < j; ++i) { int k = this.leafNodes[0]; int l = this.leafNodes[1]; int i1 = this.leafNodes[2]; this.generateLeafNode(k, l, i1); } } /** * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. */ boolean leafNodeNeedsBase(int p_76493_1_) { return (double)p_76493_1_ >= (double)this.heightLimit * 0.2D; } /** * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a * field that is always 1 to 2. */ void generateTrunk() { int i = this.basePos[0]; int j = this.basePos[1]; int k = this.basePos[1] + this.height; int l = this.basePos[2]; int[] aint = new int[] {i, j, l}; int[] aint1 = new int[] {i, k, l}; this.func_150530_a(aint, aint1, Blocks.log); if (this.trunkSize == 2) { ++aint[0]; ++aint1[0]; this.func_150530_a(aint, aint1, Blocks.log); ++aint[2]; ++aint1[2]; this.func_150530_a(aint, aint1, Blocks.log); aint[0] += -1; aint1[0] += -1; this.func_150530_a(aint, aint1, Blocks.log); } } /** * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. */ void generateLeafNodeBases() { int i = 0; int j = this.leafNodes.length; for (int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; i < j; ++i) { int[] aint1 = this.leafNodes; int[] aint2 = new int[] {aint1[0], aint1[1], aint1[2]}; aint[1] = aint1[3]; int k = aint[1] - this.basePos[1]; if (this.leafNodeNeedsBase(k)) { this.func_150530_a(aint, aint2, Blocks.log); } } } /** * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. */ int checkBlockLine(int[] p_76496_1_, int[] p_76496_2_) { int[] aint2 = new int[] {0, 0, 0}; byte b0 = 0; byte b1; for (b1 = 0; b0 < 3; ++b0) { aint2[b0] = p_76496_2_[b0] - p_76496_1_[b0]; if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) { b1 = b0; } } if (aint2[b1] == 0) { return -1; } else { byte b2 = otherCoordPairs[b1]; byte b3 = otherCoordPairs[b1 + 3]; byte b4; if (aint2[b1] > 0) { b4 = 1; } else { b4 = -1; } double d0 = (double)aint2[b2] / (double)aint2[b1]; double d1 = (double)aint2[b3] / (double)aint2[b1]; int[] aint3 = new int[] {0, 0, 0}; int i = 0; int j; for (j = aint2[b1] + b4; i != j; i += b4) { aint3[b1] = p_76496_1_[b1] + i; aint3[b2] = MathHelper.floor_double((double)p_76496_1_[b2] + (double)i * d0); aint3[b3] = MathHelper.floor_double((double)p_76496_1_[b3] + (double)i * d1); Block block = this.worldObj.getBlock(aint3[0], aint3[1], aint3[2]); if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2])) { break; } } return i == j ? -1 : Math.abs(i); } } /** * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height * limit, is valid. */ boolean validTreeLocation() { int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling)Blocks.sapling); if (!isSoil) { return false; } else { int i = this.checkBlockLine(aint, aint1); if (i == -1) { return true; } else if (i < 6) { return false; } else { this.heightLimit = i; return true; } } } /** * Rescales the generator settings, only used in WorldGenBigTree */ public void setScale(double p_76487_1_, double p_76487_3_, double p_76487_5_) { this.heightLimitLimit = (int)(p_76487_1_ * 12.0D); if (p_76487_1_ > 0.5D) { this.leafDistanceLimit = 5; } this.scaleWidth = p_76487_3_; this.leafDensity = p_76487_5_; } public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { this.worldObj = p_76484_1_; long l = p_76484_2_.nextLong(); this.rand.setSeed(l); this.basePos[0] = p_76484_3_; this.basePos[1] = p_76484_4_; this.basePos[2] = p_76484_5_; if (this.heightLimit == 0) { this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); } if (!this.validTreeLocation()) { this.worldObj = null; //Fix vanilla Mem leak, holds latest world return false; } else { this.generateLeafNodeList(); this.generateLeaves(); this.generateTrunk(); this.generateLeafNodeBases(); this.worldObj = null; //Fix vanilla Mem leak, holds latest world return true; } } }
-
[1.7.10] Why does the texture don't render?
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
more or less.. I don't really understand what you want to tell me :I -
[1.7.10] Why does the texture don't render?
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
can you send me the class please? I'm really testing since 3 hours and I don't get a solution. I would be happy -
[1.7.10] Why does the texture don't render?
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
yes , thats true, but the fancy leaves don't work too... No idea what's wrong -
[1.7.10] Why does the texture don't render?
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
You dont belive me? Look: https://www.dropbox.com/s/n5vv1yl9fndza9m/forgeproblem.PNG?dl=1 Can't you help me other? There must be something wrong. If a other block gets the texture, all works perfectly. -
[1.7.10] Why does the texture don't render?
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
[12:31:30] [Client thread/ERROR]: Using missing texture, unable to load alchemyexchange:textures/blocks/waterinvolved_leaves_opaue.png java.io.FileNotFoundException: alchemyexchange:textures/blocks/waterinvolved_leaves_opaue.png at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:126) [TextureMap.class:?] at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:91) [TextureMap.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTickableTexture(TextureManager.java:71) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTextureMap(TextureManager.java:58) [TextureManager.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:582) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11] at GradleStart.bounce(GradleStart.java:107) [start/:?] at GradleStart.startClient(GradleStart.java:100) [start/:?] at GradleStart.main(GradleStart.java:55) [start/:?] -
Hey guys, I've created a leaves block, but the texture don't render . Can you help me? package de.LegendPlayz.AlchemyExchange; import java.util.ArrayList; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockLeavesBase; import net.minecraft.block.material.Material; import net.minecraft.block.BlockLeaves; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import net.minecraft.block.Block; public class BlockWaterInvolvedLeaves extends BlockLeavesBase { public BlockWaterInvolvedLeaves(Material p_i45394_1_) { super(Material.leaves,false); this.setTickRandomly(true); this.setCreativeTab(CreativeTabs.tabDecorations); this.setHardness(0.2F); this.setLightOpacity(1); this.setStepSound(soundTypeGrass); String blockid = CurrentMainClass.MODID + ":" + this.getClass().getName(); this.setBlockName(blockid); this.setCreativeTab(CurrentMainClass.tabAlchemyExchange); } @Override public void updateTick (World world, int x, int y, int z, Random random) { if (!world.isRemote) { int meta = world.getBlockMetadata(x, y, z); if ((meta & 4) == 0) { boolean nearbyTree = false; byte range = 4; for (int posX = x - range; posX <= x + range; posX++) { for (int posY = y - range; posY <= y + range; posY++) { for (int posZ = z - range; posZ <= z + range; posZ++) { Block block = world.getBlock(posX, posY, posZ); if (block != null && block.canSustainLeaves(world, posX, posY, posZ)) nearbyTree = true; } } } if (!nearbyTree) this.removeLeaves(world, x, y, z); } } } public void removeLeaves (World world, int x, int y, int z) { this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlock(x, y, z, Blocks.air, 0, 7); } @Override public int quantityDropped (Random var1) { return var1.nextInt(20) == 0 ? 1 : 0; } @Override public Item getItemDropped (int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Item.getItemFromBlock(null); /*------------------------------------------------------------------------------------------------------------------*/ } @Override public void dropBlockAsItemWithChance (World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { if (!par1World.isRemote) { ArrayList<ItemStack> items = getDrops(par1World, par2, par3, par4, par5, par7); for (ItemStack item : items) { if (par1World.rand.nextFloat() <= par6) { this.dropBlockAsItem(par1World, par2, par3, par4, item); } } } } public IIcon fastIcon; public IIcon fancyIcon; @Override @SideOnly(Side.CLIENT) public IIcon getIcon (int side, int metadata) { if (Blocks.leaves.isOpaqueCube()) return fancyIcon; else return fastIcon; } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons (IIconRegister iconRegister) { fastIcon = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves_opaue"); fancyIcon = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves"); } /** * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given * coordinates. Args: blockAccess, x, y, z, side */ @Override public boolean shouldSideBeRendered (IBlockAccess var1, int var2, int var3, int var4, int var5) { return this.field_150121_P ? super.shouldSideBeRendered(var1, var2, var3, var4, var5) : true; } public int getDamageValue (World par1World, int par2, int par3, int par4) { return this.damageDropped(par1World.getBlockMetadata(par2, par3, par4)) % 3; } @Override public int getLightOpacity (IBlockAccess world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z) % 4; if (meta == 0) { return 255; } return super.getLightOpacity(world, x, y, z);//this.getLightOpacity(world, x, y, z);//lightOpacity[blockID]; } public String[] func_150125_e () { return null; } }
-
Hey guys, I've a problem with my mod: I've addet a leaves block to the game. If I place the block , I can see through it. If I place another block behind the leaves block, I can see him through the leaves block. But If I place a leaves block behind the leaves block, I can't see the leaves block through the leaves block. Can you help me? Here's my class : package de.LegendPlayz.AlchemyExchange; import java.util.ArrayList; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockLeavesBase; import net.minecraft.block.material.Material; import net.minecraft.block.BlockLeaves; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import net.minecraft.block.BlockLeaves; public class BlockWaterInvolvedLeaves extends BlockLeavesBase implements IShearable{ int[] field_150128_a; @SideOnly(Side.CLIENT) protected int field_150127_b; protected IIcon[][] field_150129_M = new IIcon[2][]; private boolean field_150121_P; private static final String __OBFID = "CL_00000263"; public BlockWaterInvolvedLeaves(Material p_i45394_1_) { super(Material.leaves, false); this.setTickRandomly(true); this.setCreativeTab(CreativeTabs.tabDecorations); this.setHardness(0.2F); this.setLightOpacity(1); this.setStepSound(soundTypeGrass); String blockid = CurrentMainClass.MODID + ":" + this.getClass().getName(); this.setBlockName(blockid); this.setBlockTextureName(CurrentMainClass.MODID + ":"+ "waterinvolved_planks"); this.setCreativeTab(CurrentMainClass.tabAlchemyExchange); } @Override public boolean isOpaqueCube() { //TODO: isOpaqueCube() return Blocks.leaves.isOpaqueCube(); //; } @Override public boolean renderAsNormalBlock() { return false; } @SideOnly(Side.CLIENT) public int aaA; @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int metadata) { for (int i = 0; i < 2; ++i) { aaA = i; } return field_150129_M[(!isOpaqueCube() ? 0 : 1)] [aaA]; } @SideOnly(Side.CLIENT) public void setGraphicsLevel(boolean p_150122_1_) { this.field_150121_P = p_150122_1_; this.field_150127_b = p_150122_1_ ? 0 : 1; } public void registerBlockIcons(IIconRegister iconRegister) { field_150129_M = new IIcon[2][2]; for (int i = 0; i < 2; ++i) { field_150129_M[0] = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves"); field_150129_M[1] = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves_opaque"); } } @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { // TODO Auto-generated method stub return false; } @Override public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { // TODO Auto-generated method stub return null; } public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { byte b0 = 1; int i1 = b0 + 1; if (p_149749_1_.checkChunksExist(p_149749_2_ - i1, p_149749_3_ - i1, p_149749_4_ - i1, p_149749_2_ + i1, p_149749_3_ + i1, p_149749_4_ + i1)) { for (int j1 = -b0; j1 <= b0; ++j1) { for (int k1 = -b0; k1 <= b0; ++k1) { for (int l1 = -b0; l1 <= b0; ++l1) { Block block = p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) { block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); } } } } } } public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { if (!p_149674_1_.isRemote) { int l = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); if ((l & != 0 && (l & 4) == 0) { byte b0 = 4; int i1 = b0 + 1; byte b1 = 32; int j1 = b1 * b1; int k1 = b1 / 2; if (this.field_150128_a == null) { this.field_150128_a = new int[b1 * b1 * b1]; } int l1; if (p_149674_1_.checkChunksExist(p_149674_2_ - i1, p_149674_3_ - i1, p_149674_4_ - i1, p_149674_2_ + i1, p_149674_3_ + i1, p_149674_4_ + i1)) { int i2; int j2; for (l1 = -b0; l1 <= b0; ++l1) { for (i2 = -b0; i2 <= b0; ++i2) { for (j2 = -b0; j2 <= b0; ++j2) { Block block = p_149674_1_.getBlock(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2); if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) { if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) { this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; } else { this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1; } } else { this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0; } } } } for (l1 = 1; l1 <= 4; ++l1) { for (i2 = -b0; i2 <= b0; ++i2) { for (j2 = -b0; j2 <= b0; ++j2) { for (int k2 = -b0; k2 <= b0; ++k2) { if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) { if (this.field_150128_a[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) { this.field_150128_a[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; } if (this.field_150128_a[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) { this.field_150128_a[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; } if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) { this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1; } if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) { this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1; } if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) { this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1; } if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) { this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1; } } } } } } } l1 = this.field_150128_a[k1 * j1 + k1 * b1 + k1]; if (l1 >= 0) { p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, l & -9, 4); } else { this.removeLeaves(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); } } } } @SideOnly(Side.CLIENT) public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { if (p_149734_1_.canLightningStrikeAt(p_149734_2_, p_149734_3_ + 1, p_149734_4_) && !World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && p_149734_5_.nextInt(15) == 1) { double d0 = (double)((float)p_149734_2_ + p_149734_5_.nextFloat()); double d1 = (double)p_149734_3_ - 0.05D; double d2 = (double)((float)p_149734_4_ + p_149734_5_.nextFloat()); p_149734_1_.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D); } } private void removeLeaves(World p_150126_1_, int p_150126_2_, int p_150126_3_, int p_150126_4_) { this.dropBlockAsItem(p_150126_1_, p_150126_2_, p_150126_3_, p_150126_4_, p_150126_1_.getBlockMetadata(p_150126_2_, p_150126_3_, p_150126_4_), 0); p_150126_1_.setBlockToAir(p_150126_2_, p_150126_3_, p_150126_4_); } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random p_149745_1_) { return p_149745_1_.nextInt(20) == 0 ? 1 : 0; } public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Item.getItemFromBlock(Blocks.sapling); } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_); } protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {} protected int func_150123_b(int p_150123_1_) { return 20; } public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { { super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } /** * Determines the damage on the item the block drops. Used in cloth and wood. */ public int damageDropped(int p_149692_1_) { return p_149692_1_ & 3; } /** * 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. */ protected ItemStack createStackedBlock(int p_149644_1_) { return new ItemStack(Item.getItemFromBlock(this), 1, p_149644_1_ & 3); } @Override public void beginLeavesDecay(World world, int x, int y, int z) { int i2 = world.getBlockMetadata(x, y, z); if ((i2 & == 0) { world.setBlockMetadataWithNotify(x, y, z, i2 | 8, 4); } world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4); } @Override public boolean isLeaves(IBlockAccess world, int x, int y, int z) { return true; } @Override public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) { ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); int chance = this.func_150123_b(metadata); if (fortune > 0) { chance -= 2 << fortune; if (chance < 10) chance = 10; } if (world.rand.nextInt(chance) == 0) ret.add(new ItemStack(this.getItemDropped(metadata, world.rand, fortune), 1, this.damageDropped(metadata))); chance = 200; if (fortune > 0) { chance -= 10 << fortune; if (chance < 40) chance = 40; } this.captureDrops(true); this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang ret.addAll(this.captureDrops(false)); return ret; } /* { ; }*/ }
-
Hey Guys, please help me. My forge crashs while debugging and I don't know why. ~Santa CRASH REPORT #[18:56:51] [main/INFO] [GradleStart]: No arguments specified, assuming client. [18:56:51] [main/INFO] [GradleStart]: Extra: [] Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Lorenz\.gradle\caches\minecraft\assets\indexes\{ASSET_INDEX}.json (Das System kann die angegebene Datei nicht finden) at com.google.common.base.Throwables.propagate(Throwables.java:160) at GradleStart.setupAssets(GradleStart.java:260) at GradleStart.startClient(GradleStart.java:82) at GradleStart.main(GradleStart.java:56) Caused by: java.io.FileNotFoundException: C:\Users\Lorenz\.gradle\caches\minecraft\assets\indexes\{ASSET_INDEX}.json (Das System kann die angegebene Datei nicht finden) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileReader.<init>(Unknown Source) at GradleStart.loadAssetsIndex(GradleStart.java:266) at GradleStart.setupAssets(GradleStart.java:204) ... 2 more Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
-
Hello, i want to make a splash potion, but i dont know how to make it Can somebody tell me how I can make a splash potion and how can I make that a lightning strikes on the place where the splash potion is landing? Sorry for my bad english and thanks PS: Wenn ihr aus Deutschland seit könnt ihr mir in Deutsch antworten ^^
-
Hey , how can I make a crop that can be planted with a special item on farmland and that grows like wheat? Please help me ~Santa
-
Hey guys, I've downloaded forge-1.7.10-src and I've done the following things: gradlew setupDecompWorkspace gradlew eclipse The project don't work in eclipse and is empty. Whats the matter? Please help me ~Santa
-
Hey guys, I want to know how to make a GUI like this: Can somebody halp me ? ~Santa
-
[1.7.2] How to code a forge mod in scala
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
No , It doesn't work. While I create the source folder, eclipse thinks the scala code was java code. How can I fix this? -
[1.7.2] How to code a forge mod in scala
SantacreeperLP replied to SantacreeperLP's topic in Modder Support
thank you very much, it works . And yes, ForgeMultipart is the reason why I've installed scala -
Hey guys, I've a problem: I want to write my minecraft forge modification in scala, I've installed Scala IDE for Eclipse and Its done. But I can't add a scala nature to the Minecraft project. If I click on 'add scala nature', It don't do something. Please help me, ~Santa
-
It works thank you
-
Ok , here is it: for (int j = 0; j < MinecraftServer.getServer().worldServers.length; ++j) { WorldServer worldserver = MinecraftServer.getServer().worldServers[j]; worldserver.setWorldTime(worldserver.getWorldTime() + (long)par2); } but what exactly I've to do? Please help me ~Santa
-
Hey guys, how can I set the time ( for example day) with onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) ? Please answer me I would be happy ~Santa
-
Hey guys, I want to make an Item that changes a Block when right Click on it. Can somebody help me? ~Santa
-
Forge 1.7.2 [SOLVED] Items taking damage when used in crafting
SantacreeperLP replied to VikkeHD's topic in Modder Support
And in the crafting recipe like this: GameRegistry.addShapelessRecipe(new ItemStack(Blocks.tallgrass, 1 , 0), new ItemStack(Blocks.tallgrass, 1 , 3), new ItemStack(ITEMNAMEOFTHEITEMTHATTAKESDAMAGE, 1, OreDictionary.WILDCARD_VALUE)); Hope that helps