mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-12 16:27:37 +00:00
Alfhomancy Rebalance: Part 2.
This commit is contained in:
1 parent
b7c02ec315
commit
4fe606301c
11 files changed
+155
No files matched your search
@@ -36,6 +36,7 @@ public final class ShaderHelper {
|
||||
public static int pylonGlow = 0;
|
||||
public static int enchanterRune = 0;
|
||||
public static int manaPool = 0;
|
||||
public static int doppleganger = 0;
|
||||
|
||||
public static void initShaders() {
|
||||
if(!useShaders())
|
||||
@@ -44,6 +45,7 @@ public final class ShaderHelper {
|
||||
pylonGlow = createProgram(null, LibResources.SHADER_PYLON_GLOW_FRAG);
|
||||
enchanterRune = createProgram(null, LibResources.SHADER_ENCHANTER_RUNE_FRAG);
|
||||
manaPool = createProgram(null, LibResources.SHADER_MANA_POOL_FRAG);
|
||||
doppleganger = createProgram(LibResources.SHADER_DOPLLEGANGER_VERT, LibResources.SHADER_DOPLLEGANGER_FRAG);
|
||||
}
|
||||
|
||||
public static void useShader(int shader) {
|
||||
|
||||
@@ -35,6 +35,7 @@ import vazkii.botania.client.render.block.RenderPool;
|
||||
import vazkii.botania.client.render.block.RenderPylon;
|
||||
import vazkii.botania.client.render.block.RenderSpecialFlower;
|
||||
import vazkii.botania.client.render.block.RenderSpreader;
|
||||
import vazkii.botania.client.render.entity.RenderDoppleganger;
|
||||
import vazkii.botania.client.render.entity.RenderPixie;
|
||||
import vazkii.botania.client.render.item.RenderLens;
|
||||
import vazkii.botania.client.render.item.RenderLexicon;
|
||||
@@ -58,6 +59,7 @@ import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.entity.EntityPixie;
|
||||
import vazkii.botania.common.entity.EntityVineBall;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -114,6 +116,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, new RenderPixie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, new RenderSnowball(ModItems.vineBall));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, new RenderDoppleganger());
|
||||
|
||||
ShaderHelper.initShaders();
|
||||
}
|
||||
|
||||
@@ -87,6 +87,8 @@ public final class LibResources {
|
||||
public static final String SHADER_PYLON_GLOW_FRAG = PREFIX_SHADER + "pylon_glow.frag";
|
||||
public static final String SHADER_ENCHANTER_RUNE_FRAG = PREFIX_SHADER + "enchanter_rune.frag";
|
||||
public static final String SHADER_MANA_POOL_FRAG = PREFIX_SHADER + "mana_pool.frag";
|
||||
public static final String SHADER_DOPLLEGANGER_VERT = PREFIX_SHADER + "doppleganger.vert";
|
||||
public static final String SHADER_DOPLLEGANGER_FRAG = PREFIX_SHADER + "doppleganger.frag";
|
||||
|
||||
public static final String[] LANGS = new String[] {
|
||||
"en_US", "de_DE", "ru_RU", "zh_CN"
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 12, 2014, 4:07:26 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.BossStatus;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
|
||||
public class RenderDoppleganger extends RenderBiped {
|
||||
|
||||
public RenderDoppleganger() {
|
||||
super(new ModelBiped(0.5F), 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
BossStatus.setBossStatus((EntityDoppleganger) par1Entity, true);
|
||||
|
||||
ShaderHelper.useShader(ShaderHelper.doppleganger);
|
||||
super.doRender(par1Entity, par2, par4, par6, par8, par9);
|
||||
ShaderHelper.releaseShader();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return Minecraft.getMinecraft().thePlayer.getLocationSkin();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 12, 2014, 3:47:45 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
|
||||
public class EntityDoppleganger extends EntityLiving implements IBossDisplayData {
|
||||
|
||||
public EntityDoppleganger(World par1World) {
|
||||
super(par1World);
|
||||
setSize(0.6F, 1.8F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D);
|
||||
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.4);
|
||||
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250.0);
|
||||
getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public final class ModEntities {
|
||||
EntityRegistry.registerModEntity(EntityPixie.class, LibEntityNames.PIXIE, id++, Botania.instance, 16, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityFlameRing.class, LibEntityNames.FLAME_RING, id++, Botania.instance, 32, 40, false);
|
||||
EntityRegistry.registerModEntity(EntityVineBall.class, LibEntityNames.VINE_BALL, id++, Botania.instance, 64, 10, true);
|
||||
EntityRegistry.registerModEntity(EntityDoppleganger.class, LibEntityNames.DOPPLEGANGER, id++, Botania.instance, 128, 3, true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,15 +13,20 @@ package vazkii.botania.common.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem {
|
||||
@@ -34,6 +39,21 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
setUnlocalizedName(LibItemNames.MANA_RESOURCE);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
if(par1ItemStack.getItemDamage() == 4) {
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
if(block == Blocks.beacon && !par3World.isRemote) {
|
||||
par1ItemStack.stackSize--;
|
||||
EntityDoppleganger e = new EntityDoppleganger(par3World);
|
||||
e.setPosition(par4 + 0.5, par5 + 2, par6 + 0.5);
|
||||
par3World.spawnEntityInWorld(e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
|
||||
@@ -20,5 +20,6 @@ public final class LibEntityNames {
|
||||
public static final String PIXIE = LibResources.PREFIX_MOD + "pixie";
|
||||
public static final String FLAME_RING = LibResources.PREFIX_MOD + "flameRing";
|
||||
public static final String VINE_BALL = LibResources.PREFIX_MOD + "vineBall";
|
||||
public static final String DOPPLEGANGER = LibResources.PREFIX_MOD + "doppleganger";
|
||||
|
||||
}
|
||||
@@ -159,6 +159,14 @@ botania.baubletype.ring=Equippable in the &aRing&7 slot
|
||||
botania.baubletype.belt=Equippable in the &aBelt&7 slot
|
||||
botania.baubletooltip=Press &b%key%&7 to open the Baubles menu
|
||||
|
||||
# ENTITY NAMES
|
||||
entity.Botania.botania:manaBurst.name=Mana Burst
|
||||
entity.Botania.botania:signalFlare.name=Signal Flare
|
||||
entity.Botania.botania:pixie.name=Pixie
|
||||
entity.Botania.botania:flameRing.name=Flame Ring
|
||||
entity.Botania.botania:vineBall.name=Vine Ball
|
||||
entity.Botania.botania:doppleganger.name=Gaia Guardian
|
||||
|
||||
# BLOCK NAMES
|
||||
tile.botania:flower0.name=Mystical White Flower
|
||||
tile.botania:flower1.name=Mystical Orange Flower
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
in vec2 texcoord;
|
||||
uniform sampler2D bgl_RenderedTexture;
|
||||
uniform int time; // Passed in, see ShaderHelper.java
|
||||
|
||||
float rand(vec2 co) {
|
||||
return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 color = texture2D(bgl_RenderedTexture, texcoord);
|
||||
|
||||
float gs = (color.r + color.g + color.b) / 50.0;
|
||||
|
||||
vec2 seed = texcoord.xy * time;
|
||||
float m = 0.05;
|
||||
|
||||
float r = gs + rand(texcoord) * m;
|
||||
float g = gs + rand(texcoord) * m;
|
||||
float b = gs + rand(texcoord) * m;
|
||||
|
||||
gl_FragColor = vec4(r, g, b, color.a);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
varying out vec2 texcoord;
|
||||
uniform int time; // Passed in, see ShaderHelper.java
|
||||
|
||||
float rand(vec2 co) {
|
||||
return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 vert = gl_Vertex;
|
||||
float seed = rand(vec2(time, time));
|
||||
float m = 0.025;
|
||||
vert.x = vert.x + rand(vec2(vert.y * seed, vert.z * seed)) * m;
|
||||
vert.y = vert.y + rand(vec2(vert.x * seed, vert.z * seed)) * m;
|
||||
vert.z = vert.z + rand(vec2(vert.x * seed, vert.y * seed)) * m;
|
||||
|
||||
gl_Position = gl_ModelViewProjectionMatrix * vert;
|
||||
texcoord = vec2(gl_MultiTexCoord0);
|
||||
}
|
||||
Reference in new issue
Block a user