SHARE
TWEET

Untitled

a guest Jan 18th, 2019 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.tictim.railreborn.client.tesr;
  2.  
  3. import com.tictim.railreborn.tileentity.TEEngine;
  4. import net.minecraft.block.state.IBlockState;
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.renderer.BlockRendererDispatcher;
  7. import net.minecraft.client.renderer.BufferBuilder;
  8. import net.minecraft.client.renderer.GlStateManager;
  9. import net.minecraft.client.renderer.block.model.IBakedModel;
  10. import net.minecraft.client.renderer.texture.TextureMap;
  11. import net.minecraft.util.math.BlockPos;
  12. import net.minecraft.util.math.Vec3i;
  13. import net.minecraftforge.client.model.animation.FastTESR;
  14.  
  15. public class TESREngine extends FastTESR<TEEngine> {
  16.  
  17.     @Override
  18.     public void renderTileEntityFast(TEEngine te, double x, double y, double z, float partialTicks, int destroyStage, float partial, BufferBuilder buffer) {
  19.         this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
  20.         GlStateManager.pushMatrix();
  21.         {
  22.             GlStateManager.enableCull();
  23.             BlockPos pos = te.getPos();
  24.             IBlockState state = te.getWorld().getBlockState(pos);
  25.             BlockRendererDispatcher rendererDispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
  26.             IBakedModel model = rendererDispatcher.getBlockModelShapes().getModelForState(state);
  27.                 //double slideProgress = te.getSlideProgress(partialTicks);
  28.                 //Vec3i vec = state.getValue(BlockModernSlidingDoor.FACING).rotateYCCW().getDirectionVec();
  29.                // buffer.setTranslation(x - pos.getX() + slideProgress * vec.getX(), y - pos.getY(), z - pos.getZ() + slideProgress * vec.getZ());
  30.             buffer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
  31.             rendererDispatcher.getBlockModelRenderer().renderModel(te.getWorld(), model, state, pos, buffer, true);
  32.         }GlStateManager.popMatrix();
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top