Fix default block properties.
This commit is contained in:
@@ -43,7 +43,7 @@ public class BlockCellWorkbench extends AEBaseTileBlock<TileCellWorkbench>
|
||||
|
||||
public BlockCellWorkbench()
|
||||
{
|
||||
super( Properties.create(Material.IRON) );
|
||||
super( defaultProps(Material.IRON) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,46 +19,44 @@
|
||||
package appeng.block.misc;
|
||||
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEAxisAlignedBB;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.effects.LightningFX;
|
||||
import appeng.client.render.renderable.ItemRenderable;
|
||||
import appeng.client.render.tesr.ModularTESR;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.misc.TileCharger;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEAxisAlignedBB;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.renderable.ItemRenderable;
|
||||
import appeng.client.render.tesr.ModularTESR;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileCharger;
|
||||
import appeng.util.Platform;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
||||
@@ -66,7 +64,7 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
||||
|
||||
public BlockCharger()
|
||||
{
|
||||
super( Properties.create(Material.IRON).notSolid() );
|
||||
super( defaultProps(Material.IRON).notSolid() );
|
||||
|
||||
this.setFullSize( this.setOpaque( false ) );
|
||||
}
|
||||
@@ -110,12 +108,10 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
||||
return;
|
||||
}
|
||||
|
||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
if( tile instanceof TileCharger )
|
||||
final TileCharger tile = this.getTileEntity( w, pos );
|
||||
if(tile != null)
|
||||
{
|
||||
final TileCharger tc = (TileCharger) tile;
|
||||
|
||||
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getInternalInventory().getStackInSlot( 0 ) ) )
|
||||
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tile.getInternalInventory().getStackInSlot( 0 ) ) )
|
||||
{
|
||||
final double xOff = 0.0;
|
||||
final double yOff = 0.0;
|
||||
@@ -125,9 +121,9 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
||||
{
|
||||
if( AppEng.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
// FIXME final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
|
||||
// FIXME .getZ(), 0.0D, 0.0D, 0.0D );
|
||||
// FIXME Minecraft.getInstance().effectRenderer.addEffect( fx );
|
||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
|
||||
.getZ(), 0.0, 0.0, 0.0 );
|
||||
Minecraft.getInstance().particles.addEffect( fx );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,10 +198,9 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
||||
}
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
private static Pair<ItemStack, Matrix4f> getRenderedItem( TileCharger tile )
|
||||
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(TileCharger tile )
|
||||
{
|
||||
Matrix4f transform = new Matrix4f();
|
||||
transform.translate( new Vector3f( 0.5f, 0.4f, 0.5f ) );
|
||||
TransformationMatrix transform = new TransformationMatrix(new Vector3f( 0.5f, 0.375f, 0.5f ), null, null, null);
|
||||
return new ImmutablePair<>( tile.getInternalInventory().getStackInSlot( 0 ), transform );
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class BlockCondenser extends AEBaseTileBlock<TileCondenser>
|
||||
|
||||
public BlockCondenser()
|
||||
{
|
||||
super( Properties.create(Material.IRON) );
|
||||
super( defaultProps(Material.IRON) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockInterface extends AEBaseTileBlock<TileInterface>
|
||||
|
||||
public BlockInterface()
|
||||
{
|
||||
super( Properties.create(Material.IRON) );
|
||||
super( defaultProps(Material.IRON) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockLightDetector extends AEBaseTileBlock<TileLightDetector> imple
|
||||
|
||||
public BlockLightDetector()
|
||||
{
|
||||
super( Properties.create(Material.MISCELLANEOUS).notSolid() );
|
||||
super( defaultProps(Material.MISCELLANEOUS).notSolid() );
|
||||
|
||||
this.setDefaultState( this.getDefaultState().with(BlockStateProperties.FACING, Direction.UP ).with( ODD, false ) );
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock
|
||||
|
||||
public BlockQuartzFixture()
|
||||
{
|
||||
super(Block.Properties.create(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0, 0).lightValue(14).sound(SoundType.GLASS));
|
||||
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0).lightValue(14).sound(SoundType.GLASS));
|
||||
|
||||
this.setDefaultState( getDefaultState().with( FACING, Direction.UP ).with( ODD, false ) );
|
||||
this.setFullSize( false );
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock<TileQuartzGrow
|
||||
|
||||
public BlockQuartzGrowthAccelerator()
|
||||
{
|
||||
super( Properties.create(Material.ROCK).sound(SoundType.METAL) );
|
||||
super( defaultProps(Material.ROCK).sound(SoundType.METAL) );
|
||||
this.setDefaultState( this.getDefaultState().with( POWERED, false ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class BlockSecurityStation extends AEBaseTileBlock<TileSecurityStation>
|
||||
|
||||
public BlockSecurityStation()
|
||||
{
|
||||
super( Properties.create(Material.IRON) );
|
||||
super( defaultProps(Material.IRON) );
|
||||
|
||||
this.setDefaultState( this.getDefaultState().with( POWERED, false ) );
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ public class BlockTinyTNT extends AEBaseBlock
|
||||
|
||||
private static final VoxelShape SHAPE = VoxelShapes.create(new AxisAlignedBB( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ));
|
||||
|
||||
public BlockTinyTNT()
|
||||
public BlockTinyTNT(Block.Properties props)
|
||||
{
|
||||
super( Properties.create(Material.TNT).hardnessAndResistance(0).sound(SoundType.GROUND).notSolid() );
|
||||
super(props);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,7 +56,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock<TileVibrationCh
|
||||
|
||||
public BlockVibrationChamber()
|
||||
{
|
||||
super( Properties.create(Material.IRON).hardnessAndResistance(4.2F) );
|
||||
super( defaultProps(Material.IRON).hardnessAndResistance(4.2F) );
|
||||
this.setDefaultState( this.getDefaultState().with( ACTIVE, false ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user