Created
June 29, 2014 12:27
-
-
Save MoriTanosuke/51e97155ffa33762c85e to your computer and use it in GitHub Desktop.
Minecraft Mod Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.kaldarin.compilation; | |
import cpw.mods.fml.relauncher.Side; | |
import cpw.mods.fml.relauncher.SideOnly; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.BlockFence; | |
import net.minecraft.block.BlockWall; | |
import net.minecraft.util.IIcon; | |
import net.minecraft.world.IBlockAccess; | |
public class StoneWall extends BlockWall { | |
public Block textureBlock; | |
public int metaBlock; | |
public StoneWall(Block varblock, int meta) { | |
super(varblock); | |
textureBlock = varblock; | |
metaBlock = meta; | |
} | |
@SideOnly(Side.CLIENT) | |
public IIcon getIcon(int side, int meta) { | |
meta = metaBlock; | |
return textureBlock.getIcon(side, meta); | |
} | |
public boolean canConnectWallTo(IBlockAccess p_150091_1_, int p_150091_2_, int p_150091_3_, int p_150091_4_) { | |
Block block = p_150091_1_.getBlock(p_150091_2_, p_150091_3_, p_150091_4_); | |
return block instanceof BlockWall || block instanceof BlockFence; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.kaldarin.compilation; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.BlockFence; | |
import net.minecraft.block.BlockWall; | |
import net.minecraft.block.material.Material; | |
import net.minecraft.world.IBlockAccess; | |
public class WoodFence extends BlockFence { | |
public WoodFence(String textur, Material mat) { | |
super(textur, mat); | |
} | |
@Override | |
public boolean isOpaqueCube() { | |
return false; | |
} | |
public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) { | |
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_); | |
return block instanceof BlockWall || block instanceof BlockFence; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment