mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Fixed Canitz' mess.
Cleanup~
This commit is contained in:
parent
d729f55832
commit
33e231d265
10 changed files with 29 additions and 35 deletions
|
@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
|||
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
@ -68,8 +68,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
{
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -110,7 +109,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
@Override
|
||||
public void setBlockBoundsForItemRender(){
|
||||
float f = 1.0F/16.0F;
|
||||
this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11 * f, 1.0F-f);
|
||||
this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11*f, 1.0F-f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
|||
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
@ -21,13 +21,13 @@ import net.minecraft.tileentity.TileEntity;
|
|||
public class RenderCompost extends TileEntitySpecialRenderer{
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage){
|
||||
if(te instanceof TileEntityCompost){
|
||||
TileEntityCompost compost = (TileEntityCompost) te;
|
||||
TileEntityCompost compost = (TileEntityCompost)te;
|
||||
if(compost.getStackInSlot(0) != null){
|
||||
float i = compost.getAmount() / TileEntityCompost.AMOUNT;
|
||||
float i = compost.getAmount()/TileEntityCompost.AMOUNT;
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float) x + 0.5F, (float) y + (i / 3F) + 0.01F, (float) z + 0.5F);
|
||||
GlStateManager.translate((float)x+0.5F, (float)y+(i/3F)+0.01F, (float)z+0.5F);
|
||||
GlStateManager.scale(1.5F, i, 1.5F);
|
||||
int meta = compost.getStackInSlot(0).getItem() == InitItems.itemFertilizer ? 1 : 0;
|
||||
AssetUtil.renderBlockInWorld(Blocks.dirt, meta);
|
||||
|
|
|
@ -54,7 +54,8 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{
|
|||
|
||||
if(ClientProxy.bulletForMyValentine || (theCloud.name != null && !theCloud.name.isEmpty() && theCloud.name.equals("Pink Fluffy Unicloud"))){
|
||||
theCloud.setPinkAndFluffy();
|
||||
} else {
|
||||
}
|
||||
else{
|
||||
theCloud.setNormalCloud();
|
||||
}
|
||||
|
||||
|
@ -64,16 +65,16 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{
|
|||
for(String triggerName : cloud.getTriggerNames()){
|
||||
if(StringUtil.equalsToLowerCase(triggerName, theCloud.name)){
|
||||
GlStateManager.pushMatrix();
|
||||
switch (PosUtil.getMetadata(theCloud.getPos(), theCloud.getWorld())){
|
||||
case 1: {
|
||||
switch(PosUtil.getMetadata(theCloud.getPos(), theCloud.getWorld())){
|
||||
case 1:{
|
||||
GlStateManager.rotate(180, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
case 2:{
|
||||
GlStateManager.rotate(270, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
case 3:{
|
||||
GlStateManager.rotate(90, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -91,8 +92,8 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{
|
|||
}
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI) {
|
||||
AssetUtil.renderNameTag(theCloud.name, x + 0.5F, y + 1.3F, z + 0.66);
|
||||
if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI){
|
||||
AssetUtil.renderNameTag(theCloud.name, x+0.5F, y+1.3F, z+0.66);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
|||
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.biome.BiomeGenOcean;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.misc.cloud;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockSmileyCloud;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
|
||||
|
|
|
@ -24,7 +24,6 @@ import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
|||
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud;
|
||||
import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
|
@ -32,7 +31,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|||
import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
|
@ -47,7 +45,6 @@ import net.minecraftforge.fml.client.registry.ClientRegistry;
|
|||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockSmileyCloud;
|
||||
import de.ellpeck.actuallyadditions.mod.network.gui.IStringReactor;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -60,13 +59,15 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac
|
|||
}
|
||||
|
||||
public void setPinkAndFluffy(){
|
||||
if(PosUtil.getMetadata(this.pos, this.worldObj) <= 3)
|
||||
PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj) + 4, 2);
|
||||
if(PosUtil.getMetadata(this.pos, this.worldObj) <= 3){
|
||||
PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj)+4, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public void setNormalCloud(){
|
||||
if(PosUtil.getMetadata(this.pos, this.worldObj) >= 4)
|
||||
PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj) - 4, 2);
|
||||
if(PosUtil.getMetadata(this.pos, this.worldObj) >= 4){
|
||||
PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj)-4, 2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ public class AssetUtil{
|
|||
public static void renderNameTag(String tag, float x, float y, float z){
|
||||
FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj;
|
||||
float f = 1.6F;
|
||||
float f1 = 0.016666668F * f;
|
||||
float f1 = 0.016666668F*f;
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x, y, z);
|
||||
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
|
||||
|
@ -133,19 +133,19 @@ public class AssetUtil{
|
|||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
int i = 0;
|
||||
int j = fontrenderer.getStringWidth(tag) / 2;
|
||||
int j = fontrenderer.getStringWidth(tag)/2;
|
||||
GlStateManager.disableTexture2D();
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
worldrenderer.pos((double) (-j - 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double) (-j - 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double) (j + 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double) (j + 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double)(-j-1), (double)(-1+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double)(-j-1), (double)(8+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double)(j+1), (double)(8+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos((double)(j+1), (double)(-1+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.enableTexture2D();
|
||||
fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag) / 2, i, 553648127);
|
||||
fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag)/2, i, 553648127);
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.depthMask(true);
|
||||
fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag) / 2, i, -1);
|
||||
fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag)/2, i, -1);
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
@ -153,6 +153,6 @@ public class AssetUtil{
|
|||
}
|
||||
|
||||
public static void renderNameTag(String tag, double x, double y, double z){
|
||||
renderNameTag(tag, (float) x, (float) y, (float) z);
|
||||
renderNameTag(tag, (float)x, (float)y, (float)z);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue