More work on the cloud

This commit is contained in:
Ellpeck 2015-08-25 17:59:50 +02:00
parent 2cfc9e83f1
commit 5f918591ed
6 changed files with 84 additions and 18 deletions

View file

@ -40,16 +40,16 @@ public class BlockSmileyCloud extends BlockContainerBase implements INameableIte
float f = 0.0625F;
if(meta == 0){
this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*4F, 1F-f*3F);
this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F-f*3F);
}
if(meta == 1){
this.setBlockBounds(0F, 0F, 0F, 1F-f*3F, 1F-f*4F, 1F);
this.setBlockBounds(0F, 0F, 0F, 1F-f*3F, 1F, 1F);
}
if(meta == 2){
this.setBlockBounds(0F, 0F, f*3F, 1F, 1F-f*4F, 1F);
this.setBlockBounds(0F, 0F, f*3F, 1F, 1F, 1F);
}
if(meta == 3){
this.setBlockBounds(f*3F, 0F, 0F, 1F, 1F-f*4F, 1F);
this.setBlockBounds(f*3F, 0F, 0F, 1F, 1F, 1F);
}
}

View file

@ -11,6 +11,8 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import java.util.Random;
public class RenderSmileyCloud extends RenderTileEntity{
public RenderSmileyCloud(ModelBaseAA model){
@ -24,9 +26,25 @@ public class RenderSmileyCloud extends RenderTileEntity{
GL11.glPushMatrix();
{
if(theCloud.flyHeight == 0) theCloud.flyHeight = new Random().nextInt(30)+30;
int bobHeight = theCloud.flyHeight;
long theTime = Minecraft.getSystemTime();
long time = theTime/50;
if(time-bobHeight >= theCloud.lastFlyHeight){
theCloud.lastFlyHeight = time;
}
if(time-(bobHeight/2) >= theCloud.lastFlyHeight){
GL11.glTranslated(0, ((double)time-theCloud.lastFlyHeight)/300, 0);
}
else{
GL11.glTranslated(0, -((double)time-theCloud.lastFlyHeight)/300+(double)bobHeight/300, 0);
}
GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -2.0F, 0.0F);
GL11.glTranslatef(0.0F, -2F, 0.0F);
GL11.glPushMatrix();
{

View file

@ -27,6 +27,8 @@ public class CreativeTab extends CreativeTabs{
public void displayAllReleventItems(List list){
this.list = list;
add(InitBlocks.blockSmileyCloud);
add(InitBlocks.blockPhantomface);
add(InitBlocks.blockPhantomEnergyface);
add(InitBlocks.blockPhantomLiquiface);

View file

@ -22,30 +22,21 @@ public class RenderPlayerEventAA{
//Ellpeck
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){
ellpeckRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
return;
}
//Paktosan
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
paktoRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
return;
}
//TwoOfEight
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
glenRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
return;
}
//dqmhose
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
return;
}
//Lordi
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){
else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){
lordiRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
}
}

View file

@ -138,6 +138,54 @@ public class SmileyCloudEasterEggs{
renderHeadBlock(Blocks.wool, 14, 18F);
}
});
//Bande
register(new ISmileyCloudEasterEgg(){
@Override
public String[] getTriggerNames(){
return new String[]{"bande", "bandelenth"};
}
@Override
public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.diamond_pickaxe));
renderHeadBlock(Blocks.wool, 4, 18F);
}
});
//Wolle
register(new ISmileyCloudEasterEgg(){
@Override
public String[] getTriggerNames(){
return new String[]{"wolle", "wuitoi"};
}
@Override
public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.string));
renderHeadBlock(Blocks.wool, 0, 18F);
}
});
//Pakto
register(new ISmileyCloudEasterEgg(){
@Override
public String[] getTriggerNames(){
return new String[]{"pakto", "paktosan", "paktosanlp"};
}
@Override
public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.dye, 1, 9));
renderHeadBlock(InitBlocks.blockColoredLampOn, 6, 18F);
}
});
//Honka
register(new ISmileyCloudEasterEgg(){
@Override
public String[] getTriggerNames(){
return new String[]{"honka", "honkalonka", "lonka", "lonki"};
}
@Override
public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9));
renderHeadBlock(Blocks.hay_block, 0, 74F);
}
});
}
private static void register(ISmileyCloudEasterEgg egg){

View file

@ -1,5 +1,7 @@
package ellpeck.actuallyadditions.tile;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.network.gui.IStringReactor;
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
@ -13,6 +15,11 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IPacketSync
public String name;
private String nameBefore;
@SideOnly(Side.CLIENT)
public double lastFlyHeight;
@SideOnly(Side.CLIENT)
public int flyHeight;
@Override
public void updateEntity(){
if(!worldObj.isRemote){