mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-27 23:46:10 +00:00
Fixes #30
This commit is contained in:
1 parent
cdbe10b7d9
commit
0f263f84f8
9 files changed
+110
-173
No files matched your search
@@ -17,87 +17,68 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarvable extends Block implements ICarvable
|
||||
{
|
||||
public class BlockCarvable extends Block implements ICarvable {
|
||||
public CarvableHelper carverHelper;
|
||||
private boolean isAlpha, isOpaque;
|
||||
private boolean isAlpha;
|
||||
|
||||
public BlockCarvable()
|
||||
{
|
||||
this(Material.rock, true);
|
||||
public BlockCarvable() {
|
||||
this(Material.rock);
|
||||
}
|
||||
|
||||
public BlockCarvable(Material m, boolean isOpaque)
|
||||
{
|
||||
public BlockCarvable(Material m) {
|
||||
super(m);
|
||||
this.isOpaque = isOpaque;
|
||||
carverHelper = new CarvableHelper();
|
||||
setCreativeTab(ModTabs.tabChiselBlocks);
|
||||
}
|
||||
|
||||
public BlockCarvable setStained(boolean a)
|
||||
{
|
||||
public BlockCarvable setStained(boolean a) {
|
||||
this.isAlpha = a;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
public int getRenderBlockPass() {
|
||||
return isAlpha ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return carverHelper.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
public int damageDropped(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return this.isOpaque;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
public int getRenderType() {
|
||||
return Chisel.RenderCTMId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
public CarvableVariation getVariation(int metadata) {
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
|
||||
|
||||
public static class SoundType extends Block.SoundType
|
||||
{
|
||||
public static class SoundType extends Block.SoundType {
|
||||
public final String soundNameStep;
|
||||
public final String soundNameBreak;
|
||||
public final String soundNamePlace;
|
||||
@@ -107,16 +88,12 @@ public class BlockCarvable extends Block implements ICarvable
|
||||
* Sound names dig.soundName and step.soundName must be specified in the
|
||||
* sounds.json
|
||||
*
|
||||
* @param soundName
|
||||
* block of the sound. Will automatically be expanded to
|
||||
* "mod:dig.soundName" and "mod:step.soundName" respectively)
|
||||
* @param volume
|
||||
* default 1.0f
|
||||
* @param frequency
|
||||
* default 1.0f
|
||||
* @param soundName block of the sound. Will automatically be expanded to
|
||||
* "mod:dig.soundName" and "mod:step.soundName" respectively)
|
||||
* @param volume default 1.0f
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundName, float volume, float frequency)
|
||||
{
|
||||
public SoundType(String soundName, float volume, float frequency) {
|
||||
super(soundName, volume, frequency);
|
||||
this.soundNameStep = null;
|
||||
this.soundNameBreak = null;
|
||||
@@ -127,17 +104,12 @@ public class BlockCarvable extends Block implements ICarvable
|
||||
* Creates a SoundType with manual names for step and break sounds.
|
||||
* Sound names must be specified in the sounds.json
|
||||
*
|
||||
* @param soundNameBreak
|
||||
* block break sound
|
||||
* @param soundNameStep
|
||||
* block step sound
|
||||
* @param volume
|
||||
* default 1.0f
|
||||
* @param frequency
|
||||
* default 1.0f
|
||||
* @param soundNameBreak block break sound
|
||||
* @param soundNameStep block step sound
|
||||
* @param volume default 1.0f
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency)
|
||||
{
|
||||
public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) {
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
@@ -148,19 +120,13 @@ public class BlockCarvable extends Block implements ICarvable
|
||||
* Creates a SoundType with manual names for step, break and place
|
||||
* sounds. Sound names must be specified in the sounds.json
|
||||
*
|
||||
* @param soundNameBreak
|
||||
* block break sound
|
||||
* @param soundNameStep
|
||||
* block step sound
|
||||
* @param soundNamePlace
|
||||
* block place sound
|
||||
* @param volume
|
||||
* default 1.0f
|
||||
* @param frequency
|
||||
* default 1.0f
|
||||
* @param soundNameBreak block break sound
|
||||
* @param soundNameStep block step sound
|
||||
* @param soundNamePlace block place sound
|
||||
* @param volume default 1.0f
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency)
|
||||
{
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency) {
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
@@ -168,27 +134,24 @@ public class BlockCarvable extends Block implements ICarvable
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBreakSound()
|
||||
{
|
||||
if(soundNameBreak == null)
|
||||
public String getBreakSound() {
|
||||
if (soundNameBreak == null)
|
||||
return Chisel.MOD_ID + ":dig." + this.soundName;
|
||||
else
|
||||
return this.soundNameBreak;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStepResourcePath()
|
||||
{
|
||||
if(soundNameStep == null)
|
||||
public String getStepResourcePath() {
|
||||
if (soundNameStep == null)
|
||||
return Chisel.MOD_ID + ":step." + this.soundName;
|
||||
else
|
||||
return this.soundNameStep;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150496_b()
|
||||
{
|
||||
if(soundNamePlace == null)
|
||||
public String func_150496_b() {
|
||||
if (soundNamePlace == null)
|
||||
return getBreakSound();
|
||||
else
|
||||
return this.soundNamePlace;
|
||||
|
||||
Reference in new issue
Block a user