mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 15:33:08 +00:00
Apply the fix from 2494a5 to bifrost blocks, and minor cleanup
This commit is contained in:
1 parent
b62ae8a2cb
commit
0cc9950b0c
3 files changed
+11
-46
No files matched your search
@@ -10,39 +10,26 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.tile.TileBifrost;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBifrost extends BlockMod implements ILexiconable {
|
||||
public class BlockBifrost extends BlockBifrostPerm implements ILexiconable {
|
||||
|
||||
public BlockBifrost() {
|
||||
super(Material.GLASS, LibBlockNames.BIFROST);
|
||||
setLightOpacity(0);
|
||||
setLightLevel(1F);
|
||||
super(LibBlockNames.BIFROST);
|
||||
setBlockUnbreakable();
|
||||
setSoundType(SoundType.GLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,30 +37,12 @@ public class BlockBifrost extends BlockMod implements ILexiconable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(ModItems.rainbowRod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) {
|
||||
Block block = world.getBlockState(pos.offset(side)).getBlock();
|
||||
return block != this && super.shouldSideBeRendered(state, world, pos, side);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(IBlockState state, int fortune, @Nonnull Random random) {
|
||||
return 0;
|
||||
@@ -89,10 +58,4 @@ public class BlockBifrost extends BlockMod implements ILexiconable {
|
||||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
|
||||
return new TileBifrost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.rainbowRod;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,12 +34,15 @@ import java.util.Random;
|
||||
public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockBifrostPerm() {
|
||||
super(Material.GLASS, LibBlockNames.BIFROST_PERM);
|
||||
setLightOpacity(0);
|
||||
this(LibBlockNames.BIFROST_PERM);
|
||||
setHardness(0.3F);
|
||||
}
|
||||
|
||||
public BlockBifrostPerm(String name) {
|
||||
super(Material.GLASS, name);
|
||||
setLightOpacity(0);
|
||||
setLightLevel(1F);
|
||||
setSoundType(SoundType.GLASS);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,8 +51,8 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullBlock(IBlockState state) {
|
||||
return true;
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,8 +27,7 @@ public class TileBifrost extends TileMod {
|
||||
if(ticks <= 0) {
|
||||
world.setBlockToAir(pos);
|
||||
} else ticks--;
|
||||
} else if(Math.random() < 0.1)
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
Reference in new issue
Block a user