Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Looke81.BioWarfare.Potion;
- import java.util.Random;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.shader.Shader;
- import net.minecraft.client.shader.ShaderGroup;
- import net.minecraft.client.util.JsonException;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.World;
- public class ShaderChange {
- public static void flip(Random random, EntityPlayer player) {
- if (player.worldObj.isRemote) {
- setCurrentShader(new ResourceLocation("minecraft:shaders/post/flip.json"), null);
- }
- }
- public static void noShader(Random random, EntityPlayer player) {
- if (player.worldObj.isRemote) {
- Minecraft mc = Minecraft.getMinecraft();
- mc.entityRenderer.theShaderGroup = null;
- }
- }
- public static void setCurrentShader(ResourceLocation resourcelocation,World world){
- if(world.isRemote){
- Minecraft mc = Minecraft.getMinecraft();
- try{
- mc.entityRenderer.theShaderGroup = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), resourcelocation);
- }catch(JsonException e){
- e.printStackTrace();
- }
- mc.entityRenderer.theShaderGroup.createBindFramebuffers(mc.displayWidth, mc.displayHeight);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement