diff --git a/src/main/java/kubatech/api/enums/ItemList.java b/src/main/java/kubatech/api/enums/ItemList.java index 00334d84..b92dead1 100644 --- a/src/main/java/kubatech/api/enums/ItemList.java +++ b/src/main/java/kubatech/api/enums/ItemList.java @@ -53,7 +53,8 @@ public enum ItemList implements IItemContainer { BruisedTeaLeaf, PartiallyOxidizedTeaLeaf, TeaAcceptorResearchNote, - TeaAcceptor; + TeaAcceptor, + Beeeeee; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java b/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java new file mode 100644 index 00000000..a99929c3 --- /dev/null +++ b/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java @@ -0,0 +1,100 @@ +package kubatech.client.effect; + +import static net.minecraft.client.renderer.entity.RenderManager.*; + +import kubatech.api.enums.ItemList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class MegaApiaryBeesRenderer extends EntityFX { + public MegaApiaryBeesRenderer(World world, double x, double y, double z, int age) { + super(world, x, y + 2, z); + this.particleMaxAge = age; + } + + @Override + public void onUpdate() { + if (this.particleAge++ == this.particleMaxAge) this.setDead(); + if (this.particleAge % 4 == 0) + if (this.particleAge % 8 == 0) this.posY += 0.1; + else this.posY -= 0.1; + } + + @Override + public boolean shouldRenderInPass(int pass) { + return pass == 3; + } + + @Override + public int getFXLayer() { + return 3; + } + + @Override + public void renderParticle( + Tessellator p_70539_1_, + float p_70539_2_, + float p_70539_3_, + float p_70539_4_, + float p_70539_5_, + float p_70539_6_, + float p_70539_7_) { + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + + GL11.glPushMatrix(); + GL11.glTranslatef( + (float) (this.posX - renderPosX), (float) (this.posY - renderPosY), (float) (this.posZ - renderPosZ)); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glRotatef(180f, 1f, 0f, 0f); + + Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationItemsTexture); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + + GL11.glColor4f(1f, 1f, 1f, 1F); + + IIcon icon = ItemList.Beeeeee.get(1).getIconIndex(); + + GL11.glPushMatrix(); + GL11.glTranslatef(0f, 0f, -4f); + GL11.glScalef(0.1f, 0.1f, 0.1f); + RenderItem.getInstance().renderIcon(0, 0, icon, 16, 16); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslatef(1f, 0f, 3f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glScalef(0.1f, 0.1f, 0.1f); + RenderItem.getInstance().renderIcon(0, 0, icon, 16, 16); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslatef(4f, 0f, -1f); + GL11.glRotatef(-90f, 0f, 1f, 0f); + GL11.glScalef(0.1f, 0.1f, 0.1f); + RenderItem.getInstance().renderIcon(0, 0, icon, 16, 16); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslatef(-3f, 0f, 1f); + GL11.glRotatef(90f, 0f, 1f, 0f); + GL11.glScalef(0.1f, 0.1f, 0.1f); + RenderItem.getInstance().renderIcon(0, 0, icon, 16, 16); + GL11.glPopMatrix(); + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/kubatech/loaders/ItemLoader.java b/src/main/java/kubatech/loaders/ItemLoader.java index 8db9c9f1..a0b2cced 100644 --- a/src/main/java/kubatech/loaders/ItemLoader.java +++ b/src/main/java/kubatech/loaders/ItemLoader.java @@ -24,10 +24,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import kubatech.loaders.item.ItemProxy; import kubatech.loaders.item.KubaItems; -import kubatech.loaders.item.items.Tea; -import kubatech.loaders.item.items.TeaCollection; -import kubatech.loaders.item.items.TeaIngredient; -import kubatech.loaders.item.items.TeaUltimate; +import kubatech.loaders.item.items.*; public class ItemLoader { public static final KubaItems kubaitems = new KubaItems(); @@ -79,5 +76,6 @@ public static void registerItems() { TeaAcceptorResearchNote.set( kubaitems.registerProxyItem(new ItemProxy("tea_acceptor_research_note", "research_note"))); + Beeeeee.set(kubaitems.registerProxyItem(new ItemProxy("beeeeee", "beeeeee"))); } } diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java index 066a3405..7f0dde26 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java @@ -42,6 +42,8 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import forestry.api.apiculture.*; import forestry.apiculture.blocks.BlockAlveary; import forestry.apiculture.blocks.BlockApicultureType; @@ -69,6 +71,8 @@ import kubatech.api.helpers.GTHelper; import kubatech.api.network.CustomTileEntityPacket; import kubatech.api.tileentity.CustomTileEntityPacketHandler; +import kubatech.client.effect.MegaApiaryBeesRenderer; +import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; @@ -339,8 +343,23 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { packet.resetHelperData(); packet.addData(mMaxSlots); packet.sendToAllAround(20); + } else { + if (aBaseMetaTileEntity.isActive() && aTick % 100 == 0) { + int[] abc = new int[] {0, -2, 7}; + int[] xyz = new int[] {0, 0, 0}; + this.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += aBaseMetaTileEntity.getXCoord(); + xyz[1] += aBaseMetaTileEntity.getYCoord(); + xyz[2] += aBaseMetaTileEntity.getZCoord(); + showBees(aBaseMetaTileEntity.getWorld(), xyz[0], xyz[1], xyz[2], 100); + } } - // Beeeee rendering inside ? + } + + @SideOnly(Side.CLIENT) + private void showBees(World world, int x, int y, int z, int age) { + MegaApiaryBeesRenderer bee = new MegaApiaryBeesRenderer(world, x, y, z, age); + Minecraft.getMinecraft().effectRenderer.addEffect(bee); } @Override diff --git a/src/main/resources/assets/kubatech/textures/items/beeeeee.png b/src/main/resources/assets/kubatech/textures/items/beeeeee.png new file mode 100644 index 00000000..790a321a Binary files /dev/null and b/src/main/resources/assets/kubatech/textures/items/beeeeee.png differ