More BlockRenderLayer, RenderSystem

This commit is contained in:
raoulvdberge
2019-12-19 22:21:46 +01:00
parent 1a2052adaa
commit 9c1ec8339c
13 changed files with 28 additions and 46 deletions

View File

@@ -10,7 +10,6 @@ import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.ISelectionContext;
@@ -157,9 +156,4 @@ public class CableBlock extends NetworkNodeBlock {
builder.add(NORTH, EAST, SOUTH, WEST, UP, DOWN); builder.add(NORTH, EAST, SOUTH, WEST, UP, DOWN);
} }
@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
} }

View File

@@ -13,7 +13,6 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -13,7 +13,6 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;

View File

@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -5,7 +5,6 @@ import com.raoulvdberge.refinedstorage.tile.NetworkReceiverTile;
import com.raoulvdberge.refinedstorage.util.BlockUtils; import com.raoulvdberge.refinedstorage.util.BlockUtils;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import javax.annotation.Nullable; import javax.annotation.Nullable;

View File

@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;

View File

@@ -12,7 +12,6 @@ import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@@ -66,8 +65,6 @@ public class WirelessTransmitterBlock extends NetworkNodeBlock {
return facing == Direction.DOWN && !this.isValidPosition(state, world, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); return facing == Direction.DOWN && !this.isValidPosition(state, world, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos);
} }
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {

View File

@@ -1,6 +1,7 @@
package com.raoulvdberge.refinedstorage.render.tesr; package com.raoulvdberge.refinedstorage.render.tesr;
import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.raoulvdberge.refinedstorage.RSBlocks; import com.raoulvdberge.refinedstorage.RSBlocks;
import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.block.StorageMonitorBlock; import com.raoulvdberge.refinedstorage.block.StorageMonitorBlock;
@@ -86,24 +87,24 @@ public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonito
rotX = -1F; rotX = -1F;
} }
GlStateManager.pushMatrix(); RenderSystem.pushMatrix();
GlStateManager.translated(x + disX, y + disY, z + disZ); RenderSystem.translated(x + disX, y + disY, z + disZ);
GlStateManager.rotated(180F, rotX, rotY, rotZ); RenderSystem.rotatef(180F, rotX, rotY, rotZ);
GlStateManager.color4f(1F, 1F, 1F, 1F); RenderSystem.color4f(1F, 1F, 1F, 1F);
GlStateManager.depthMask(false); RenderSystem.depthMask(false);
GlStateManager.enableBlend(); RenderSystem.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); RenderSystem.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.depthMask(true); RenderSystem.depthMask(true);
GlStateManager.scalef(0.4F, -0.4F, -0.015F); RenderSystem.scalef(0.4F, -0.4F, -0.015F);
Minecraft.getInstance().getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); Minecraft.getInstance().getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
Minecraft.getInstance().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false); Minecraft.getInstance().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
GlStateManager.enableRescaleNormal(); RenderSystem.enableRescaleNormal();
GlStateManager.enableAlphaTest(); RenderSystem.enableAlphaTest();
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); RenderSystem.alphaFunc(GL11.GL_GREATER, 0.1F);
GlStateManager.enableBlend(); RenderSystem.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color4f(1F, 1F, 1F, 1F); RenderSystem.color4f(1F, 1F, 1F, 1F);
if (tile.getItemStack() != null) { if (tile.getItemStack() != null) {
IBakedModel bakedModel = Minecraft.getInstance().getItemRenderer().getItemModelWithOverrides(tile.getItemStack(), null, Minecraft.getInstance().player); IBakedModel bakedModel = Minecraft.getInstance().getItemRenderer().getItemModelWithOverrides(tile.getItemStack(), null, Minecraft.getInstance().player);
@@ -111,29 +112,29 @@ public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonito
Minecraft.getInstance().getItemRenderer().renderItem(tile.getItemStack(), bakedModel); Minecraft.getInstance().getItemRenderer().renderItem(tile.getItemStack(), bakedModel);
} }
GlStateManager.disableAlphaTest(); RenderSystem.disableAlphaTest();
GlStateManager.disableRescaleNormal(); RenderSystem.disableRescaleNormal();
GlStateManager.disableLighting(); RenderSystem.disableLighting();
Minecraft.getInstance().getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); Minecraft.getInstance().getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
Minecraft.getInstance().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); Minecraft.getInstance().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
GlStateManager.disableBlend(); RenderSystem.disableBlend();
GlStateManager.color4f(1F, 1F, 1F, 1F); RenderSystem.color4f(1F, 1F, 1F, 1F);
GlStateManager.popMatrix(); RenderSystem.popMatrix();
GlStateManager.pushMatrix(); RenderSystem.pushMatrix();
GlStateManager.translated(x + disXText, y + disYText, z + disZText); RenderSystem.translated(x + disXText, y + disYText, z + disZText);
GlStateManager.rotated(180F, rotX, rotY, rotZ); RenderSystem.rotatef(180F, rotX, rotY, rotZ);
float size = 0.00450F; float size = 0.00450F;
float factor = 2.0f; float factor = 2.0f;
GlStateManager.scaled(size * factor, size * factor, size); RenderSystem.scaled(size * factor, size * factor, size);
if (tile.getItemStack() != null) { if (tile.getItemStack() != null) {
Minecraft.getInstance().fontRenderer.drawString(amount, 0, 0, 0xFFFFFF); Minecraft.getInstance().fontRenderer.drawString(amount, 0, 0, 0xFFFFFF);
} }
GlStateManager.popMatrix(); RenderSystem.popMatrix();
setLightmapDisabled(false); setLightmapDisabled(false);
} }