Skip to content

Instantly share code, notes, and snippets.

View AlphaModder's full-sized avatar

AlphaModder

View GitHub Profile
@Override
public void render(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer){
renderer.setRenderMinMax(Constants.ONE_PIXEL * 7, 0.0D, 0.0D, Constants.ONE_PIXEL * 9, Constants.ONE_PIXEL * 10, 0.0D);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderMinMax(Constants.ONE_PIXEL * 7, 0.0D, Constants.MAX_BLOCK_BOUNDS, Constants.ONE_PIXEL * 9, Constants.ONE_PIXEL * 10, Constants.MAX_BLOCK_BOUNDS);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderMinMax(Constants.ONE_PIXEL * 7, Constants.ONE_PIXEL * 10, Constants.ONE_PIXEL, Constants.ONE_PIXEL * 9, Constants.ONE_PIXEL * 11, Constants.MAX_BLOCK_BOUNDS - Constants.ONE_PIXEL);
renderer.renderStandardBlock(block, x, y, z);
renderer.setOverrideBlockTexture(79);
renderer.setRenderMinMax(Constants.ONE_PIXEL * 6, Constants.ONE_PIXEL * 10, Constants.ONE_PIXEL * 6, Constants.ONE_PIXEL * 10, Constants.ONE_PIXEL * 10, Constants.ONE_PIXEL * 10);
package net.alphamodder.quantumtech.machine.assembly;
import net.alphamodder.api.Constants;
import net.alphamodder.quantumtech.machine.block.tileentity.AssemblyMachine;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
public class AssemblyMachineCarver extends AssemblyMachine {
@Override
@AlphaModder
AlphaModder / gist:5691467
Created June 1, 2013 19:29
Decompiled Render Code
public void renderBeam(EntityWaypoint par1EntityWaypoint, double baseX, double baseY, double baseZ, float par8)
{
bgd tesselator = bgd.a;
GL11.glDisable(3553);
GL11.glDisable(2896);
GL11.glDisable(2912);
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
int height = 256;
@AlphaModder
AlphaModder / gist:9773151
Created March 25, 2014 22:46
Weird code...
package net.minecraft.client.gui.inventory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
package net.minecraft.world.chunk;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
private void addFaviconToStatusResponse(ServerStatusResponse response)
{
File var2 = this.getFile("server-icon.png");
if (var2.isFile())
{
ByteBuf var3 = Unpooled.buffer();
try
{
public class SomethingGeneric<T> : SomethingNonGeneric
{
public void DoSomething(T parameter);
}
public interface SomethingNonGeneric { }
public class SomethingStorage
{
use futures::prelude::*;
use futures::task::{Context, Waker};
use futures::channel::mpsc;
use std::ops::{Deref, DerefMut};
use std::sync::{Mutex, MutexGuard, PoisonError, TryLockError};
pub struct AsyncMutex<T> {
inner: Mutex<(T, mpsc::UnboundedReceiver<Waker>)>,
send: mpsc::UnboundedSender<Waker>,
use std::ops::{Deref, DerefMut};
use std::sync::atomic::{AtomicUsize, Ordering};
const EMPTY: usize = 0;
const FULL: usize = 1;
const IN_USE: usize = 2;
pub struct ResourceCell<T: Send> {
status: AtomicUsize,
resource: UnsafeCell<Option<T>>,
Updating git repository `https://github.com/gfx-rs/wgpu`
Checking wgpu v0.5.0 (C:\Users\****\Projects\Rust\wgpu-rs)
error[E0432]: unresolved import `wgt::TextureDataLayout`
--> src\lib.rs:26:80
|
26 | SwapChainDescriptor, SwapChainStatus, TextureAspect, TextureComponentType, TextureDataLayout,
| ^^^^^^^^^^^^^^^^^ no `TextureDataLayout` in the root
error[E0412]: cannot find type `TextureDataLayout` in crate `wgt`
--> src\backend\direct.rs:885:27