mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-23 21:39:47 +00:00
Added unfinished wisp renderer
This commit is contained in:
1 parent
ebad7b7bd8
commit
7108449069
3 files changed
+67
-6
No files matched your search
@@ -1,17 +1,25 @@
|
||||
package makeo.gadomancy.client.util;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import makeo.gadomancy.common.network.packets.PacketFamiliar;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import makeo.gadomancy.common.utils.FakeWorld;
|
||||
import makeo.gadomancy.common.utils.NBTHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.client.renderers.entity.RenderPrimalOrb;
|
||||
import thaumcraft.client.renderers.entity.RenderWisp;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.monster.EntityWisp;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
@@ -28,8 +36,9 @@ import java.util.Map;
|
||||
* Created by HellFirePvP @ 31.10.2015 12:13
|
||||
*/
|
||||
public class FamiliarHandlerClient {
|
||||
private static final EntityWisp ENTITY_WISP = new EntityWisp(new FakeWorld());
|
||||
|
||||
private static RenderPrimalOrb fallbackRenderer;
|
||||
private static RenderWisp fallbackRenderer;
|
||||
|
||||
private static Map<String, PartialEntityFamiliar> clientFamiliars = new HashMap<String, PartialEntityFamiliar>();
|
||||
private static List<String> familiarPlayers = new ArrayList<String>();
|
||||
@@ -74,7 +83,16 @@ public class FamiliarHandlerClient {
|
||||
|
||||
//Info: "Thanks" to RenderPlayerEvent, GL11 offset is moved to the player already.
|
||||
//GL11 coordinates: Player.posX, Player.posY + Player.eyeHeight (1.62 client side..), Player.posZ, rotation: 0
|
||||
fallbackRenderer.renderEntityAt(fam.dummyEntity, fam.renderX, fam.renderY, fam.renderZ, 0, partialTicks);
|
||||
|
||||
ItemStack stack = BaublesApi.getBaubles(player).getStackInSlot(0);
|
||||
if(stack != null && stack.getItem() == RegisteredItems.itemFamiliar
|
||||
&& stack.hasTagCompound() && stack.getTagCompound().hasKey("aspect")) {
|
||||
//ENTITY_WISP.setType(stack.getTagCompound().getString("aspect"));
|
||||
//ENTITY_WISP.setType(Aspect.AIR.getName());
|
||||
ENTITY_WISP.getDataWatcher().getWatchedObject(22).setObject(Aspect.AIR.getName());
|
||||
ENTITY_WISP.ticksExisted = fam.dummyEntity.ticksExisted;
|
||||
fallbackRenderer.renderEntityAt(ENTITY_WISP, fam.renderX, fam.renderY, fam.renderZ, 0, partialTicks);
|
||||
}
|
||||
//Render at abs positions: ram.posX, fam.posY, fam.posZ
|
||||
}
|
||||
}
|
||||
@@ -87,7 +105,7 @@ public class FamiliarHandlerClient {
|
||||
}
|
||||
|
||||
static {
|
||||
fallbackRenderer = new RenderPrimalOrb();
|
||||
fallbackRenderer = new RenderWisp();
|
||||
fallbackRenderer.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,15 @@ import baubles.api.IBauble;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import makeo.gadomancy.common.utils.NBTHelper;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
@@ -30,7 +33,14 @@ public class ItemFamiliar extends Item implements IBauble {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
NBTHelper.getData(stack).setString("aspect", Aspect.MAGIC.getName());
|
||||
list.add(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack) {
|
||||
return RegisteredItems.raritySacred;
|
||||
}
|
||||
|
||||
@@ -106,5 +116,4 @@ public class ItemFamiliar extends Item implements IBauble {
|
||||
}
|
||||
return attack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package makeo.gadomancy.common.potions;
|
||||
|
||||
import makeo.gadomancy.common.utils.ColorHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
import thaumcraft.common.entities.golems.EntityGolemBase;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
* <p/>
|
||||
* Created by makeo @ 31.10.2015 23:01
|
||||
*/
|
||||
public class PotionInactiveGolem extends Potion {
|
||||
public PotionInactiveGolem(int id) {
|
||||
super(id, false, ColorHelper.toHex(Color.WHITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entity, int par2) {
|
||||
if(entity instanceof EntityGolemBase) {
|
||||
((EntityGolemBase) entity).inactive = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady(int p_76397_1_, int p_76397_2_) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user