More BlockRenderLayer, RenderSystem
This commit is contained in:
@@ -10,7 +10,6 @@ import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
@@ -157,9 +156,4 @@ public class CableBlock extends NetworkNodeBlock {
|
||||
|
||||
builder.add(NORTH, EAST, SOUTH, WEST, UP, DOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.raoulvdberge.refinedstorage.tile.NetworkReceiverTile;
|
||||
import com.raoulvdberge.refinedstorage.util.BlockUtils;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.render.tesr;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.block.StorageMonitorBlock;
|
||||
@@ -86,24 +87,24 @@ public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonito
|
||||
rotX = -1F;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translated(x + disX, y + disY, z + disZ);
|
||||
GlStateManager.rotated(180F, rotX, rotY, rotZ);
|
||||
GlStateManager.color4f(1F, 1F, 1F, 1F);
|
||||
GlStateManager.depthMask(false);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.scalef(0.4F, -0.4F, -0.015F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.translated(x + disX, y + disY, z + disZ);
|
||||
RenderSystem.rotatef(180F, rotX, rotY, rotZ);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
RenderSystem.depthMask(false);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
RenderSystem.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
RenderSystem.depthMask(true);
|
||||
RenderSystem.scalef(0.4F, -0.4F, -0.015F);
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
Minecraft.getInstance().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableAlphaTest();
|
||||
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color4f(1F, 1F, 1F, 1F);
|
||||
RenderSystem.enableRescaleNormal();
|
||||
RenderSystem.enableAlphaTest();
|
||||
RenderSystem.alphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
|
||||
if (tile.getItemStack() != null) {
|
||||
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);
|
||||
}
|
||||
|
||||
GlStateManager.disableAlphaTest();
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.disableLighting();
|
||||
RenderSystem.disableAlphaTest();
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.disableLighting();
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
Minecraft.getInstance().getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.color4f(1F, 1F, 1F, 1F);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
RenderSystem.pushMatrix();
|
||||
|
||||
GlStateManager.translated(x + disXText, y + disYText, z + disZText);
|
||||
GlStateManager.rotated(180F, rotX, rotY, rotZ);
|
||||
RenderSystem.translated(x + disXText, y + disYText, z + disZText);
|
||||
RenderSystem.rotatef(180F, rotX, rotY, rotZ);
|
||||
float size = 0.00450F;
|
||||
float factor = 2.0f;
|
||||
GlStateManager.scaled(size * factor, size * factor, size);
|
||||
RenderSystem.scaled(size * factor, size * factor, size);
|
||||
|
||||
if (tile.getItemStack() != null) {
|
||||
Minecraft.getInstance().fontRenderer.drawString(amount, 0, 0, 0xFFFFFF);
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
setLightmapDisabled(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user