-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ash trays. finally fix nutritive basin renderer. half fruit leaf drop…
… rate. other fixes and testing
- Loading branch information
1 parent
556abdd
commit 1727251
Showing
57 changed files
with
625 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
...main/java/com/eerussianguy/firmalife/client/render/NutritiveBasinBlockEntityRenderer.java
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
src/main/java/com/eerussianguy/firmalife/common/blockentities/AshTrayBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.eerussianguy.firmalife.common.blockentities; | ||
|
||
import com.eerussianguy.firmalife.common.FLHelpers; | ||
import com.eerussianguy.firmalife.common.blocks.AshtrayBlock; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.util.Mth; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraftforge.items.ItemStackHandler; | ||
|
||
import net.dries007.tfc.common.blockentities.InventoryBlockEntity; | ||
import net.dries007.tfc.common.capabilities.PartialItemHandler; | ||
import net.dries007.tfc.common.items.Powder; | ||
import net.dries007.tfc.common.items.TFCItems; | ||
import net.dries007.tfc.util.Helpers; | ||
|
||
public class AshTrayBlockEntity extends InventoryBlockEntity<ItemStackHandler> | ||
{ | ||
public AshTrayBlockEntity(BlockPos pos, BlockState state) | ||
{ | ||
super(FLBlockEntities.ASHTRAY.get(), pos, state, defaultInventory(1), FLHelpers.blockEntityName("ashtray")); | ||
|
||
sidedInventory.on(new PartialItemHandler(inventory).extract(0), d -> d != Direction.UP); | ||
} | ||
|
||
@Override | ||
public boolean isItemValid(int slot, ItemStack stack) | ||
{ | ||
return Helpers.isItem(stack, TFCItems.POWDERS.get(Powder.WOOD_ASH).get()); | ||
} | ||
|
||
@Override | ||
public int getSlotStackLimit(int slot) | ||
{ | ||
return 16; | ||
} | ||
|
||
@Override | ||
public void setAndUpdateSlots(int slot) | ||
{ | ||
super.setAndUpdateSlots(slot); | ||
updateBlockState(); | ||
} | ||
|
||
public void updateBlockState() | ||
{ | ||
assert level != null; | ||
final BlockState current = level.getBlockState(getBlockPos()); | ||
final int stage = Mth.clamp(Mth.ceil(inventory.getStackInSlot(0).getCount() * 10f / 16f), 0, 5); | ||
if (current.hasProperty(AshtrayBlock.STAGE) && current.getValue(AshtrayBlock.STAGE) != stage) | ||
{ | ||
level.setBlockAndUpdate(getBlockPos(), current.setValue(AshtrayBlock.STAGE, stage)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/main/java/com/eerussianguy/firmalife/common/blockentities/NutritiveBasinBlockEntity.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.