mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-20 12:19:39 +00:00
Potatoes gonna potate. Also BELIEVE.
This commit is contained in:
1 parent
75376ea2a6
commit
72b260e758
2 files changed
+57
-20
No files matched your search
@@ -20,13 +20,13 @@ public class RenderTileInfinitato extends TileEntitySpecialRenderer {
|
||||
private static final ModelInfinitato model = new ModelInfinitato();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) {
|
||||
public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float partialTicks) {
|
||||
TileInfinitato potato = (TileInfinitato) var1;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glTranslated(d0, d1, d2);
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@@ -34,34 +34,25 @@ public class RenderTileInfinitato extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
int meta = potato.getWorldObj() == null ? 3 : potato.getBlockMetadata();
|
||||
float rotY = meta * 90F - 180F;
|
||||
GL11.glRotatef(rotY, 0F, 1F, 0F);
|
||||
|
||||
float jump = potato.jumpTicks*0.5f;
|
||||
if(jump > 0)
|
||||
jump += var8*0.5f;
|
||||
|
||||
float up = (float) -Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F;
|
||||
float rotZ = (float) Math.sin(jump / 10 * Math.PI) * 2;
|
||||
|
||||
|
||||
if (drawHalo){
|
||||
mc.renderEngine.bindTexture(halo);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
double xdiff = potato.xCoord + 0.5 - mc.thePlayer.posX;
|
||||
double ydiff = potato.yCoord + 0.4 - (mc.thePlayer.posY + mc.thePlayer.eyeHeight);
|
||||
double zdiff = potato.zCoord + 0.5 - mc.thePlayer.posZ;
|
||||
double xdiff = (potato.xCoord + 0.5) - RenderManager.instance.viewerPosX;//.renderPosX;
|
||||
double ydiff = (potato.yCoord + 0.4) - RenderManager.instance.viewerPosY;//.renderPosY;
|
||||
double zdiff = (potato.zCoord + 0.5) - RenderManager.instance.viewerPosZ;//.renderPosZ;
|
||||
|
||||
double len = Math.sqrt(xdiff*xdiff + ydiff*ydiff + zdiff*zdiff);
|
||||
|
||||
|
||||
xdiff /= len;
|
||||
ydiff /= len;
|
||||
zdiff /= len;
|
||||
|
||||
GL11.glTranslated(xdiff, ydiff, -zdiff);
|
||||
GL11.glTranslated(-xdiff, ydiff, zdiff);
|
||||
|
||||
GL11.glRotatef(-rotZ, 0F, 0F, 1F);
|
||||
GL11.glRotatef(-rotY, 0F, 1F, 0F);
|
||||
//GL11.glRotatef(-rotZ, 0F, 0F, 1F);
|
||||
//GL11.glRotatef(-rotY, 0F, 1F, 0F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
|
||||
GL11.glTranslatef(0F, -1.15F, 0F);
|
||||
@@ -98,6 +89,19 @@ public class RenderTileInfinitato extends TileEntitySpecialRenderer {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
float rotY = meta * 90F - 180F;
|
||||
GL11.glRotatef(rotY, 0F, 1F, 0F);
|
||||
|
||||
float jump = potato.jumpTicks*0.5f;
|
||||
if(jump > 0)
|
||||
jump += partialTicks*0.5f;
|
||||
|
||||
float up = (float) -Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F;
|
||||
float rotZ = (float) Math.sin(jump / 10 * Math.PI) * 2;
|
||||
|
||||
|
||||
|
||||
GL11.glTranslatef(0F, up, 0F);
|
||||
GL11.glRotatef(rotZ, 0F, 0F, 1F);
|
||||
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package fox.spiteful.avaritia.compat.botania;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import fox.spiteful.avaritia.Lumberjack;
|
||||
import fox.spiteful.avaritia.tile.TileLudicrous;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
|
||||
public class TileInfinitato extends TileLudicrous {
|
||||
@@ -12,12 +19,38 @@ public class TileInfinitato extends TileLudicrous {
|
||||
public String name = "";
|
||||
public int nextDoIt = 0;
|
||||
|
||||
public void interact() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void interact() {
|
||||
jump();
|
||||
if(name.equalsIgnoreCase("shia labeouf") && !worldObj.isRemote && nextDoIt == 0) {
|
||||
nextDoIt = 40;
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:doit", 2.5F, 0.7F);
|
||||
}
|
||||
|
||||
double radius = 10.5;
|
||||
int time = 3600;
|
||||
List<EntityLivingBase> inspired = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord-radius, yCoord-radius, zCoord-radius, xCoord+radius, yCoord+radius, zCoord+radius));
|
||||
|
||||
for (EntityLivingBase ent : inspired) {
|
||||
Lumberjack.info(ent);
|
||||
double dx = ent.posX - xCoord;
|
||||
double dy = ent.posY - yCoord;
|
||||
double dz = ent.posZ - zCoord;
|
||||
double dist = Math.sqrt(dx*dx + dy*dy + dz*dz);
|
||||
|
||||
if (dist <= radius) {
|
||||
ent.addPotionEffect(new PotionEffect(Potion.damageBoost.id, time, 1));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, time, 0));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.jump.id, time, 0));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.regeneration.id, time, 1));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.resistance.id, time, 1));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.digSpeed.id, time, 1));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.fireResistance.id, time, 0));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, time, 0));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.nightVision.id, time, 0));
|
||||
ent.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, time, 4)); // absorb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void jump() {
|
||||
|
||||
Reference in new issue
Block a user