forked from TAIGA/TAIGA
added some stuff
This commit is contained in:
@@ -2,9 +2,15 @@ package com.sosnitzka.ztic_addon.generic;
|
|||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
public class BasicBlock extends Block {
|
public class BasicBlock extends Block {
|
||||||
|
public static final PropertyBool ISSUN = PropertyBool.create("issun");
|
||||||
private String oreDictPrefix;
|
private String oreDictPrefix;
|
||||||
|
private int lVal;
|
||||||
|
|
||||||
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float lightLevel, String oreDictPrefix) {
|
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float lightLevel, String oreDictPrefix) {
|
||||||
super(material);
|
super(material);
|
||||||
@@ -16,7 +22,11 @@ public class BasicBlock extends Block {
|
|||||||
setLightLevel(lightLevel);
|
setLightLevel(lightLevel);
|
||||||
this.oreDictPrefix = oreDictPrefix;
|
this.oreDictPrefix = oreDictPrefix;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float lightLevel, String oreDictPrefix, int activatedLL) {
|
||||||
|
this(name, material, hardness, resistance, harvest, lightLevel, oreDictPrefix);
|
||||||
|
this.lVal = activatedLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest) {
|
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest) {
|
||||||
@@ -40,4 +50,12 @@ public class BasicBlock extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||||
|
if (state.getValue(ISSUN)) {
|
||||||
|
return lVal;
|
||||||
|
} else {
|
||||||
|
return this.lightValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user