Some more texture work, fixed Special Render for items

This commit is contained in:
Ellpeck 2016-01-09 00:04:30 +01:00
parent 6db479f94e
commit 2babb6cf0b
10 changed files with 48 additions and 81 deletions

View file

@ -1,48 +0,0 @@
/*
* This file ("RenderInventory.java") is part of the Actually Additions Mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense/
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.blocks.render;
//TODO Fix the rendering handler
public class RenderInventory{
private RenderTileEntity tileRender;
private int renderID;
public RenderInventory(RenderTileEntity tileRender, int renderID){
this.tileRender = tileRender;
this.renderID = renderID;
}
/*@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer){
GlStateManager.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(this.tileRender.resLoc);
GlStateManager.glTranslatef(0F, 1F, 0F);
GlStateManager.glRotatef(180F, 1F, 0F, 0F);
this.tileRender.theModel.render(0.0625F);
GlStateManager.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer){
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId){
return true;
}
@Override
public int getRenderId(){
return this.renderID;
}*/
}

View file

@ -38,16 +38,14 @@ public class RenderSpecial{
return;
}
boolean isBlock = this.theThingToRender.getItem() instanceof ItemBlock;
float size = isBlock ? 0.5F : 0.6F;
double offsetUp = isBlock ? 0F : 0.2F;
if(ClientProxy.pumpkinBlurPumpkinBlur){
this.theThingToRender = new ItemStack(Calendar.getInstance().get(Calendar.DAY_OF_MONTH)%2 == 0 ? Blocks.lit_pumpkin : Blocks.pumpkin);
size = 0.5F;
offsetUp = 0;
}
boolean isBlock = this.theThingToRender.getItem() instanceof ItemBlock;
float size = isBlock ? 0.5F : 0.4F;
double offsetUp = isBlock ? 0D : 0.1875D;
double bobHeight = 70;
double theTime = Minecraft.getSystemTime();
double time = theTime/50;
@ -81,8 +79,11 @@ public class RenderSpecial{
AssetUtil.renderBlockInWorld(Block.getBlockFromItem(this.theThingToRender.getItem()), this.theThingToRender.getItemDamage());
}
else{
GlStateManager.translate(-0.5D, 0D, 0D);
GlStateManager.pushMatrix();
GlStateManager.translate(0D, 0.5D, 0D);
GlStateManager.rotate(180F, 1F, 0F, 0F);
AssetUtil.renderItemInWorld(this.theThingToRender);
GlStateManager.popMatrix();
}
}
GlStateManager.enableLighting();

View file

@ -62,6 +62,7 @@ public class SpecialRenderInit{
//Add a new Special Renderer to the list
if(stack != null){
specialList.put(key, new RenderSpecial(stack));
System.out.println(stack.toString());
}
}
}

View file

@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.event.InitEvents;
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import de.ellpeck.actuallyadditions.mod.tile.*;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData;
import net.minecraft.client.Minecraft;
@ -28,7 +27,6 @@ import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
@ -77,14 +75,14 @@ public class ClientProxy implements IProxy{
InitEvents.initClient();
registerRenderer(TileEntityCompost.class, new RenderTileEntity(new ModelCompost()), AssetUtil.compostRenderId);
registerRenderer(TileEntityFishingNet.class, new RenderTileEntity(new ModelFishingNet()), AssetUtil.fishingNetRenderId);
registerRenderer(TileEntityFurnaceSolar.class, new RenderTileEntity(new ModelFurnaceSolar()), AssetUtil.furnaceSolarRenderId);
registerRenderer(TileEntityCoffeeMachine.class, new RenderTileEntity(new ModelCoffeeMachine()), AssetUtil.coffeeMachineRenderId);
registerRenderer(TileEntityPhantomBooster.class, new RenderTileEntity(new ModelPhantomBooster()), AssetUtil.phantomBoosterRenderId);
registerRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud(new ModelSmileyCloud()), AssetUtil.smileyCloudRenderId);
registerRenderer(TileEntityLaserRelay.class, new RenderLaserRelay(new ModelLaserRelay()), AssetUtil.laserRelayRenderId);
registerRenderer(TileEntityBookletStand.class, new RenderTileEntity(new ModelBookletStand()), AssetUtil.bookletStandRenderId);
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderTileEntity(new ModelCompost()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFishingNet.class, new RenderTileEntity(new ModelFishingNet()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFurnaceSolar.class, new RenderTileEntity(new ModelFurnaceSolar()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoffeeMachine.class, new RenderTileEntity(new ModelCoffeeMachine()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPhantomBooster.class, new RenderTileEntity(new ModelPhantomBooster()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud(new ModelSmileyCloud()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelay.class, new RenderLaserRelay(new ModelLaserRelay()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBookletStand.class, new RenderTileEntity(new ModelBookletStand()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens());
//TODO Fix villager
@ -111,10 +109,4 @@ public class ClientProxy implements IProxy{
public void addRenderVariant(Item item, ResourceLocation[] location){
modelVariantsForRegistering.put(item, location);
}
private static void registerRenderer(Class<? extends TileEntity> tileClass, RenderTileEntity tileRender, int renderID){
ClientRegistry.bindTileEntitySpecialRenderer(tileClass, tileRender);
//TODO Fix inventory rendering
//RenderingRegistry.registerBlockHandler(new RenderInventory(tileRender, renderID));
}
}

View file

@ -95,6 +95,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
}
}
//TODO Fix XP System to fit points needed in 1.8 (OpenBlocks?)
/**
* Gets the Player's XP
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!)

View file

@ -31,15 +31,6 @@ public class AssetUtil{
public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory");
public static final int TESR_RENDER_ID = 2;
public static int compostRenderId;
public static int fishingNetRenderId;
public static int furnaceSolarRenderId;
public static int coffeeMachineRenderId;
public static int phantomBoosterRenderId;
public static int smileyCloudRenderId;
public static int laserRelayRenderId;
public static int bookletStandRenderId;
public static ResourceLocation getGuiLocation(String file){
return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/"+file+".png");
}

View file

@ -398,7 +398,6 @@ public class WorldUtil{
}
else{
//Check the Server if a Block that changed on the Client really changed, if not, revert the change
//TODO Check if this is the right action
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, Minecraft.getMinecraft().objectMouseOver.sideHit));
}
return removed;

View file

@ -0,0 +1,8 @@
{
"variants": {
"meta=0": { "model": "actuallyadditions:blockXPSolidifier", "y": 0 },
"meta=1": { "model": "actuallyadditions:blockXPSolidifier", "y": 180 },
"meta=2": { "model": "actuallyadditions:blockXPSolidifier", "y": -90 },
"meta=3": { "model": "actuallyadditions:blockXPSolidifier", "y": 90 }
}
}

View file

@ -0,0 +1,12 @@
{
"parent": "block/cube",
"textures": {
"particle": "actuallyadditions:blocks/blockXPSolidifier",
"down": "actuallyadditions:blocks/blockXPSolidifierTop",
"up": "actuallyadditions:blocks/blockXPSolidifierTop",
"north": "actuallyadditions:blocks/blockXPSolidifierFront",
"east": "actuallyadditions:blocks/blockXPSolidifier",
"south": "actuallyadditions:blocks/blockXPSolidifier",
"west": "actuallyadditions:blocks/blockXPSolidifier"
}
}

View file

@ -0,0 +1,10 @@
{
"parent": "actuallyadditions:block/blockXPSolidifier",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}