More Rendering Fixes

This commit is contained in:
Sebastian Hartte
2020-06-07 15:56:48 +02:00
parent 2dc2f90d5b
commit 1c7a28c606
29 changed files with 300 additions and 217 deletions
@@ -66,7 +66,7 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
public BlockCharger()
{
super( Properties.create(Material.IRON) );
super( Properties.create(Material.IRON).notSolid() );
this.setFullSize( this.setOpaque( false ) );
}
@@ -26,10 +26,12 @@ import appeng.container.implementations.ContainerWireless;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileWireless;
import appeng.util.Platform;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
@@ -65,36 +67,30 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless>
public BlockWireless()
{
super( Properties.create(AEGlassMaterial.INSTANCE) );
super( Properties.create(AEGlassMaterial.INSTANCE).notSolid() );
this.setFullSize( false );
this.setOpaque( false );
this.setDefaultState( this.getDefaultState().with( STATE, State.OFF ) );
}
// FIXME This has to be triggered by the tile entity's state changing directly
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld world, BlockPos pos, BlockPos facingPos) {
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileWireless te) {
State teState = State.OFF;
TileWireless te = this.getTileEntity( world, pos );
if( te != null )
if( te.isActive() )
{
if( te.isActive() )
{
teState = State.HAS_CHANNEL;
}
else if( te.isPowered() )
{
teState = State.ON;
}
teState = State.HAS_CHANNEL;
}
else if( te.isPowered() )
{
teState = State.ON;
}
return super.updatePostPlacement(stateIn, facing, facingState, world, pos, facingPos)
.with( STATE, teState );
return currentState.with(STATE, teState);
}
@Override
protected void fillStateContainer(StateContainer.Builder builder) {
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
super.fillStateContainer(builder);
builder.add(STATE);
}
@@ -173,7 +169,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless>
return VoxelShapes.create( new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ ) );
}
return VoxelShapes.fullCube();
return VoxelShapes.empty();
}
@Override
@@ -237,7 +233,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless>
}
else
{
return VoxelShapes.fullCube();
return VoxelShapes.empty();
}
}
@@ -19,7 +19,6 @@ public class PaintRendering extends BlockRenderingCustomizer
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.renderType(RenderType.getCutout());
// FIXME rendering.builtInModel( "models/block/paint", new PaintModel() );
// Disable auto rotation
rendering.modelCustomizer( ( location, model ) -> model );
}
@@ -40,9 +40,9 @@ import net.minecraftforge.client.model.data.IModelData;
class PaintSplotchesBakedModel implements IDynamicBakedModel
{
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "blocks/paint1" ));
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/paint2" ));
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/paint3" ));
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "block/paint1" ));
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/paint2" ));
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/paint3" ));
private final TextureAtlasSprite[] textures;
@@ -27,10 +27,10 @@ import java.util.function.Function;
class QnbFormedBakedModel implements IDynamicBakedModel
{
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "blocks/quantum_link" ));
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/quantum_ring" ));
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/quantum_ring_light" ));
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/quantum_ring_light_corner" ));
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "block/quantum_link" ));
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/quantum_ring" ));
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/quantum_ring_light" ));
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/quantum_ring_light_corner" ));
private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "parts/cable/glass/transparent" ));
private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "parts/cable/covered/transparent" ));
@@ -27,6 +27,7 @@ import appeng.container.implementations.ContainerQNB;
import appeng.core.localization.PlayerMessages;
import appeng.tile.storage.TileChest;
import appeng.util.Platform;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
@@ -56,7 +57,7 @@ public class BlockChest extends AEBaseTileBlock<TileChest>
}
@Override
protected void fillStateContainer(StateContainer.Builder builder) {
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
super.fillStateContainer(builder);
builder.add(SLOT_STATE);
}