Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VertexBuffer buf = Tessellator.getInstance().getBuffer();
- buf.setTranslation(-px, -py, -pz);
- buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
- IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state);
- for (BlockPos pos : mode.getCandidates(event.getPlayer(), event.getTarget().getBlockPos(), event.getTarget().sideHit)) {
- if (player.world.getBlockState(pos) == state) {
- for (EnumFacing facing : EnumFacing.VALUES) {
- if (state.shouldSideBeRendered(Minecraft.getMinecraft().world, pos, facing)) {
- List<Quad> quads = model.getQuads(state, facing, 0).stream().map(Quad::from).collect(Collectors.toList());
- for (Quad q : quads) {
- for (int i = 0; i < 4; i++) {
- Vector3f v = q.getVert(i);
- buf.pos(pos.getX() + v.x, pos.getY() + v.y, pos.getZ() + v.z).color(1, 1, 1, 0.2f).endVertex();
- }
- }
- }
- }
- }
- }
- Tessellator.getInstance().draw();
- buf.setTranslation(0, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement