mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
New Compost Rendering
This commit is contained in:
parent
967d180cca
commit
d729f55832
6 changed files with 63 additions and 106 deletions
|
@ -50,14 +50,14 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity){
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
float f = 0.125F, y = 0.7F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, y, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, y, f);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, y, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, 1.0F, 1.0F);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, y, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBoundsForItemRender();
|
||||
}
|
||||
|
@ -67,6 +67,12 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){
|
||||
if(!world.isRemote){
|
||||
|
@ -104,7 +110,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, 1.0F, 1.0F-f);
|
||||
this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11 * f, 1.0F-f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* This file ("GuiBooklet.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;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
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) {
|
||||
if(te instanceof TileEntityCompost){
|
||||
TileEntityCompost compost = (TileEntityCompost) te;
|
||||
if(compost.getStackInSlot(0) != null){
|
||||
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.scale(1.5F, i, 1.5F);
|
||||
int meta = compost.getStackInSlot(0).getItem() == InitItems.itemFertilizer ? 1 : 0;
|
||||
AssetUtil.renderBlockInWorld(Blocks.dirt, meta);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* This file ("ModelCompost.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.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
|
||||
//TODO Fix compost rendering
|
||||
public class ModelCompost extends ModelBase{
|
||||
|
||||
/*public ModelRenderer floor;
|
||||
public ModelRenderer wallOne;
|
||||
public ModelRenderer wallTwo;
|
||||
public ModelRenderer wallThree;
|
||||
public ModelRenderer wallFour;
|
||||
public ModelRenderer[] innerRawList = new ModelRenderer[13];
|
||||
public ModelRenderer innerDone;
|
||||
|
||||
public ModelCompost(){
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 128;
|
||||
this.wallThree = new ModelRenderer(this, 0, 0);
|
||||
this.wallThree.setRotationPoint(-6.0F, 8.0F, 6.0F);
|
||||
this.wallThree.addBox(0.0F, 0.0F, 0.0F, 12, 15, 1, 0.0F);
|
||||
this.wallFour = new ModelRenderer(this, 0, 0);
|
||||
this.wallFour.setRotationPoint(-6.0F, 8.0F, -7.0F);
|
||||
this.wallFour.addBox(0.0F, 0.0F, 0.0F, 12, 15, 1, 0.0F);
|
||||
this.wallOne = new ModelRenderer(this, 0, 0);
|
||||
this.wallOne.setRotationPoint(-7.0F, 8.0F, -7.0F);
|
||||
this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 15, 14, 0.0F);
|
||||
this.wallTwo = new ModelRenderer(this, 0, 0);
|
||||
this.wallTwo.setRotationPoint(6.0F, 8.0F, -7.0F);
|
||||
this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 15, 14, 0.0F);
|
||||
this.floor = new ModelRenderer(this, 0, 0);
|
||||
this.floor.setRotationPoint(-7.0F, 23.0F, -7.0F);
|
||||
this.floor.addBox(0.0F, 0.0F, 0.0F, 14, 1, 14, 0.0F);
|
||||
|
||||
for(int i = 0; i < this.innerRawList.length; i++){
|
||||
this.innerRawList[i] = new ModelRenderer(this, 0, 29);
|
||||
this.innerRawList[i].setRotationPoint(-6.0F, 10.0F, -6.0F);
|
||||
this.innerRawList[i].addBox(0.0F, 12-i, 0.0F, 12, i+1, 12, 0.0F);
|
||||
}
|
||||
|
||||
this.innerDone = new ModelRenderer(this, 0, 54);
|
||||
this.innerDone.setRotationPoint(-6.0F, 10.0F, -6.0F);
|
||||
this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(float f){
|
||||
this.wallThree.render(f);
|
||||
this.wallFour.render(f);
|
||||
this.wallOne.render(f);
|
||||
this.wallTwo.render(f);
|
||||
this.floor.render(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderExtra(float f, TileEntity tile){
|
||||
//Hehe
|
||||
if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){
|
||||
GlStateManager.translate(0F, 1F, 0F);
|
||||
}
|
||||
|
||||
if(tile instanceof TileEntityCompost){
|
||||
ItemStack stack = ((TileEntityCompost)tile).getStackInSlot(0);
|
||||
if(stack != null){
|
||||
if(stack.getItem() == InitItems.itemFertilizer){
|
||||
this.innerDone.render(f);
|
||||
}
|
||||
else{
|
||||
int heightToDisplay = stack.stackSize*13/TileEntityCompost.AMOUNT;
|
||||
if(heightToDisplay > 13){
|
||||
heightToDisplay = 13;
|
||||
}
|
||||
|
||||
this.innerRawList[heightToDisplay-1].render(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -59,7 +59,7 @@ public class InitBooklet{
|
|||
//Getting Started
|
||||
chapterIntro = new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3));
|
||||
new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeBook));
|
||||
new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setPageStacksWildcard(), new PageCrafting(7, MiscCrafting.recipesCrystals).setNoText(), new PageCrafting(8, MiscCrafting.recipesCrystalBlocks).setNoText(), new PageReconstructor(9, LensNoneRecipeHandler.mainPageRecipes).setNoText()).setSpecial().setIncomplete();
|
||||
new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setPageStacksWildcard(), new PageCrafting(7, MiscCrafting.recipesCrystals).setNoText(), new PageCrafting(8, MiscCrafting.recipesCrystalBlocks).setNoText(), new PageReconstructor(9, LensNoneRecipeHandler.mainPageRecipes).setNoText()).setSpecial();
|
||||
new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageCrafting(1, BlockCrafting.recipeCoalGen).addTextReplacement("<rf>", TileEntityCoalGenerator.PRODUCE).setPageStacksWildcard());
|
||||
new BookletChapter("craftingIngs", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(7, ItemCrafting.recipeRing).setNoText(), new PageCrafting(8, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(11, ItemCrafting.recipeDough).setNoText(), new PageCrafting(12, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(13, BlockCrafting.recipeIronCase).setNoText()).setImportant();
|
||||
new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.redstone), new PageTextOnly(1));
|
||||
|
@ -68,7 +68,7 @@ public class InitBooklet{
|
|||
new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeColorLens), new PageReconstructor(4, LensNoneRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensNoneRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensNoneRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensNoneRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(8, LensNoneRecipeHandler.recipeNetherWart).setNoText()).setImportant();
|
||||
new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensNoneRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeGreenWall).setNoText());
|
||||
new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("<lowest>", OreGen.QUARTZ_MIN).addTextReplacement("<highest>", OreGen.QUARTZ_MAX), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText());
|
||||
new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText().setPageStacksWildcard()).setSpecial().setIncomplete();
|
||||
new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText().setPageStacksWildcard()).setSpecial();
|
||||
new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText());
|
||||
ArrayList<BookletPage> lampPages = new ArrayList<BookletPage>();
|
||||
lampPages.add(new PageTextOnly(lampPages.size()+1));
|
||||
|
@ -92,7 +92,7 @@ public class InitBooklet{
|
|||
new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass));
|
||||
new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText());
|
||||
new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText());
|
||||
new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemFertilizer)).addTextReplacement("<num>", TileEntityCompost.AMOUNT), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.recipesMashedFood)).setIncomplete();
|
||||
new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemFertilizer)).addTextReplacement("<num>", TileEntityCompost.AMOUNT), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.recipesMashedFood));
|
||||
new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, ItemCrafting.recipeCrateKeeper), new PageCrafting(3, ItemCrafting.recipeChestToCrateUpgrade));
|
||||
new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("<range>", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText());
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
|||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
|
||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderCompost;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderReconstructorLens;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderSmileyCloud;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
|
@ -22,6 +23,7 @@ import de.ellpeck.actuallyadditions.mod.event.InitEvents;
|
|||
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;
|
||||
|
@ -127,23 +129,18 @@ public class ClientProxy implements IProxy{
|
|||
ModelLoader.setCustomStateMapper(block, mapper);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event){
|
||||
ModUtil.LOGGER.info("Initializing ClientProxy...");
|
||||
|
||||
InitEvents.initClient();
|
||||
|
||||
//TODO Fix Tile rendering
|
||||
/*ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderTileEntity(new ModelCompost()));
|
||||
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());*/
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderCompost());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud());
|
||||
|
||||
//TODO Fix villager
|
||||
//TODO Fix villager, doesn't work in this Version of Forge
|
||||
//VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png"));
|
||||
|
||||
for(Map.Entry<ItemStack, ResourceLocation> entry : modelLocationsForRegistering.entrySet()){
|
||||
|
|
|
@ -33,6 +33,10 @@ public class TileEntityCompost extends TileEntityInventoryBase{
|
|||
compound.setInteger("ConversionTime", this.conversionTime);
|
||||
}
|
||||
|
||||
public float getAmount(){
|
||||
return this.getStackInSlot(0) != null ? this.getStackInSlot(0).stackSize : 0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSyncSlots(){
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue