Dev stuff is complete

This commit is contained in:
Cricket committed 2015-02-19 17:13:16 -05:00
1 parent 496ac181da
commit 530239fd72
9 files changed
+259 -530

No files matched your search

@@ -7,7 +7,10 @@ import com.cricketcraft.chisel.block.BlockSnakestoneObsidian;
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.config.Configurations;
import com.cricketcraft.chisel.entity.fx.*;
import com.cricketcraft.chisel.entity.fx.EntityBallOMossFX;
import com.cricketcraft.chisel.entity.fx.EntityGrimstoneFX;
import com.cricketcraft.chisel.entity.fx.EntityHolystoneFX;
import com.cricketcraft.chisel.entity.fx.EntitySnakestoneObsidianFX;
import com.cricketcraft.chisel.utils.GeneralClient;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
@@ -167,11 +170,6 @@ public class GeneralChiselClient {
}
}
public static void spawnCricketFX(World world, double x, double y, double z) {
EntityCricketFX cricket = new EntityCricketFX(world, x, y, z);
Minecraft.getMinecraft().effectRenderer.addEffect(cricket);
}
public static void spawnBallOMossFX(World world, double x, double y, double z) {
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0) {
EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z);
@@ -260,7 +258,8 @@ public class GeneralChiselClient {
public static void spawnAutoChiselFX(TileEntityAutoChisel te, ItemStack base) {
if (base != null) {
for (int i = 0; i < 10; i++) {
EntityDiggingFX particle = new EntityDiggingFX(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.95, te.zCoord + 0.5, 0, 0, 0, Block.getBlockFromItem(base.getItem()), base.getItemDamage());
EntityDiggingFX particle = new EntityDiggingFX(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.95, te.zCoord + 0.5, 0, 0, 0, Block.getBlockFromItem(base.getItem()),
base.getItemDamage());
particle.setVelocity((te.getWorldObj().rand.nextDouble() / 4) - 0.125, te.getWorldObj().rand.nextDouble() / 8, (te.getWorldObj().rand.nextDouble() / 4) - 0.125);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
@@ -1,38 +1,84 @@
package com.cricketcraft.chisel.client.player;
import com.cricketcraft.chisel.client.GeneralChiselClient;
import cpw.mods.fml.common.FMLCommonHandler;
import com.cricketcraft.chisel.init.ChiselItems;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.List;
@SideOnly(Side.CLIENT)
public class PlayerSpecials {
private List<String> names = new ArrayList<String>();
private boolean resetRender;
public PlayerSpecials() {
FMLCommonHandler.instance().bus().register(this);
names.add("Cricket");
names.add("Drullkus");
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void renderCricket(RenderPlayerEvent event) {
if (!"TheCricket26".equals(event.entityPlayer.getDisplayName())) {
return;
public void renderItem(RenderPlayerEvent.Specials.Post event) {
EntityPlayer player = event.entityPlayer;
for (int x = 0; x < names.size(); x++) {
if (player.getCommandSenderName().equals(names.get(x))) {
GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
if (player.isSneaking()) {
GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
}
boolean armor = player.getCurrentArmor(1) != null;
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.25F, -0.85F, armor ? 0.2F : 0.28F);
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
int light = 15728880;
int lightmapX = light % 65536;
int lightmapY = light / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
IIcon icon = ChiselItems.obsidianChisel.getIcon(new ItemStack(ChiselItems.obsidianChisel, 1, 0), 1);
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 1.0F / 16.0F);
GL11.glPopMatrix();
}
}
if (event.entityPlayer.isInvisible()) {
return;
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void renderDev(RenderLivingEvent.Pre event) {
for (int x = 0; x < names.size(); x++) {
if (EnumChatFormatting.getTextWithoutFormattingCodes(event.entity.getCommandSenderName()).equals(names.get(x))) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
resetRender = true;
}
}
}
ModelRenderer body = null;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix();
GeneralChiselClient.spawnCricketFX(event.entityPlayer.getEntityWorld(), event.entityPlayer.posX, event.entityPlayer.posY, event.entityPlayer.posZ);
GL11.glPopMatrix();
@SubscribeEvent
public void entityColorRender(RenderLivingEvent.Post event) {
if (this.resetRender) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(3042);
resetRender = false;
}
}
}