mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
Coffee fixes.
Batbox stuff.
This commit is contained in:
parent
6263e819ab
commit
44effd2e7a
11 changed files with 42 additions and 32 deletions
8
port.MD
8
port.MD
|
@ -45,9 +45,9 @@
|
||||||
- [ ] Improve the coffee maker's ui by putting the water meter actually into the ui
|
- [ ] Improve the coffee maker's ui by putting the water meter actually into the ui
|
||||||
- [ ] Rename phantom boosters to range boosters (since they work for other stuff too)
|
- [ ] Rename phantom boosters to range boosters (since they work for other stuff too)
|
||||||
- [ ] Make worms use that new forge event/hook to keep the ground watered instead of trying to re-water it every few ticks
|
- [ ] Make worms use that new forge event/hook to keep the ground watered instead of trying to re-water it every few ticks
|
||||||
- [ ] Give ender star an enchantment glint
|
- [x] Give ender star an enchantment glint
|
||||||
- [ ] Make miner lens far more expensive to use, mmm power creep
|
- [ ] Make miner lens far more expensive to use, mmm power creep
|
||||||
- [ ] Make coffee beans and seeds be the same item or I might get killed by someone finally
|
- [x] Make coffee beans and seeds be the same item or I might get killed by someone finally
|
||||||
|
|
||||||
# Keep As Is
|
# Keep As Is
|
||||||
- [ ] Battery box
|
- [ ] Battery box
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
- [ ] Crusher and double crusher
|
- [ ] Crusher and double crusher
|
||||||
- [ ] Heat collectors
|
- [ ] Heat collectors
|
||||||
- [x] Precision dropper
|
- [x] Precision dropper
|
||||||
- [ ] Engineer's goggles
|
- [x] Engineer's goggles
|
||||||
- [ ] Laser relay modifiers and wrench
|
- [ ] Laser relay modifiers and wrench
|
||||||
- [ ] Handheld filler
|
- [ ] Handheld filler
|
||||||
- [ ] Sacks
|
- [ ] Sacks
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
- [ ] Drills and drill upgrades
|
- [ ] Drills and drill upgrades
|
||||||
- [ ] Batteries
|
- [ ] Batteries
|
||||||
- [x] Crafting table on a stick
|
- [x] Crafting table on a stick
|
||||||
- [ ] Leaf blowers
|
- [x] Leaf blowers
|
||||||
- [ ] The book
|
- [ ] The book
|
||||||
- [x] The Crystal Flux name and rainbow effect
|
- [x] The Crystal Flux name and rainbow effect
|
||||||
- [ ] Engineer's village house and engineer villager
|
- [ ] Engineer's village house and engineer villager
|
|
@ -260,7 +260,6 @@ bbf723238f6536295339f0b0b5b052cf89b92d5b assets/actuallyadditions/models/item/co
|
||||||
1d676d4abc4c67c3da2d15499ecb585f436f3893 assets/actuallyadditions/models/item/coffee_beans.json
|
1d676d4abc4c67c3da2d15499ecb585f436f3893 assets/actuallyadditions/models/item/coffee_beans.json
|
||||||
28fc61074cb1a60ef5904e4bba7f6ad3c42b55fd assets/actuallyadditions/models/item/coffee_cup.json
|
28fc61074cb1a60ef5904e4bba7f6ad3c42b55fd assets/actuallyadditions/models/item/coffee_cup.json
|
||||||
082ecd5232059fadaa447a99a623437e3adab3ef assets/actuallyadditions/models/item/coffee_machine.json
|
082ecd5232059fadaa447a99a623437e3adab3ef assets/actuallyadditions/models/item/coffee_machine.json
|
||||||
6765c06218d8940c06daeff92aeb44516ac6ff4a assets/actuallyadditions/models/item/coffee_seeds.json
|
|
||||||
7698ec0e672b1209e6a664dfee5c3bbaa1a612c7 assets/actuallyadditions/models/item/crafter_on_a_stick.json
|
7698ec0e672b1209e6a664dfee5c3bbaa1a612c7 assets/actuallyadditions/models/item/crafter_on_a_stick.json
|
||||||
1e7e61701473dbf3dfc18bb5b9fa7be91b443dd8 assets/actuallyadditions/models/item/crusher.json
|
1e7e61701473dbf3dfc18bb5b9fa7be91b443dd8 assets/actuallyadditions/models/item/crusher.json
|
||||||
aeacd7ca465c19d6cbcef25e61023397c4472ab3 assets/actuallyadditions/models/item/crusher_double.json
|
aeacd7ca465c19d6cbcef25e61023397c4472ab3 assets/actuallyadditions/models/item/crusher_double.json
|
||||||
|
@ -478,7 +477,7 @@ f3df22f203e8c00ee7ee004bb9b4edfd522f069a data/actuallyadditions/loot_tables/bloc
|
||||||
6df5538ba7cf057d19728f8e615862a84b9d4bb1 data/actuallyadditions/loot_tables/blocks/chiseled_black_quartz_stair.json
|
6df5538ba7cf057d19728f8e615862a84b9d4bb1 data/actuallyadditions/loot_tables/blocks/chiseled_black_quartz_stair.json
|
||||||
092e8773d46f16d80d0c489c4a2d2f8bd5a78799 data/actuallyadditions/loot_tables/blocks/chiseled_black_quartz_wall.json
|
092e8773d46f16d80d0c489c4a2d2f8bd5a78799 data/actuallyadditions/loot_tables/blocks/chiseled_black_quartz_wall.json
|
||||||
bf7743c27757cf5b0dbab9b3e15d1d5ca1ece818 data/actuallyadditions/loot_tables/blocks/coal_generator.json
|
bf7743c27757cf5b0dbab9b3e15d1d5ca1ece818 data/actuallyadditions/loot_tables/blocks/coal_generator.json
|
||||||
66ee33930c8392b29710ce2bc117f99907e336df data/actuallyadditions/loot_tables/blocks/coffee.json
|
01ed45d18335029de7725ae4490077c9280eedd1 data/actuallyadditions/loot_tables/blocks/coffee.json
|
||||||
3285202e3f840d091b8d85dc2c721199fcc96240 data/actuallyadditions/loot_tables/blocks/coffee_machine.json
|
3285202e3f840d091b8d85dc2c721199fcc96240 data/actuallyadditions/loot_tables/blocks/coffee_machine.json
|
||||||
317d0377327250f2fe15ff549a1ffa1b7bdade14 data/actuallyadditions/loot_tables/blocks/crusher.json
|
317d0377327250f2fe15ff549a1ffa1b7bdade14 data/actuallyadditions/loot_tables/blocks/crusher.json
|
||||||
b087c6f44cf0236f52471ec54c026ee30ba0d273 data/actuallyadditions/loot_tables/blocks/crusher_double.json
|
b087c6f44cf0236f52471ec54c026ee30ba0d273 data/actuallyadditions/loot_tables/blocks/crusher_double.json
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"parent": "minecraft:item/handheld",
|
|
||||||
"textures": {
|
|
||||||
"layer0": "actuallyadditions:item/coffee_seeds"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -22,7 +22,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "minecraft:item",
|
"type": "minecraft:item",
|
||||||
"name": "actuallyadditions:coffee_seeds"
|
"name": "actuallyadditions:coffee_beans"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "actuallyadditions:coffee_seeds"
|
"name": "actuallyadditions:coffee_beans"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"conditions": [
|
"conditions": [
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class LootTableGenerator extends LootTableProvider {
|
||||||
addCrop(ActuallyBlocks.CANOLA, ActuallyItems.CANOLA, ActuallyItems.CANOLA_SEEDS);
|
addCrop(ActuallyBlocks.CANOLA, ActuallyItems.CANOLA, ActuallyItems.CANOLA_SEEDS);
|
||||||
addCrop(ActuallyBlocks.RICE, ActuallyItems.RICE, ActuallyItems.RICE_SEEDS);
|
addCrop(ActuallyBlocks.RICE, ActuallyItems.RICE, ActuallyItems.RICE_SEEDS);
|
||||||
addCrop(ActuallyBlocks.FLAX, () -> Items.STRING, ActuallyItems.FLAX_SEEDS);
|
addCrop(ActuallyBlocks.FLAX, () -> Items.STRING, ActuallyItems.FLAX_SEEDS);
|
||||||
addCrop(ActuallyBlocks.COFFEE, ActuallyItems.COFFEE_BEANS, ActuallyItems.COFFEE_SEEDS);
|
addCrop(ActuallyBlocks.COFFEE, ActuallyItems.COFFEE_BEANS, ActuallyItems.COFFEE_BEANS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCrop(Supplier<Block> block, Supplier<Item> item, Supplier<Item> seed) {
|
private void addCrop(Supplier<Block> block, Supplier<Item> item, Supplier<Item> seed) {
|
||||||
|
|
|
@ -262,7 +262,7 @@ public final class ActuallyBlocks {
|
||||||
public static Supplier<Block> CANOLA = BLOCKS.register("canola", () -> new AACrops(defaultCropProps(), ActuallyItems.CANOLA_SEEDS));
|
public static Supplier<Block> CANOLA = BLOCKS.register("canola", () -> new AACrops(defaultCropProps(), ActuallyItems.CANOLA_SEEDS));
|
||||||
public static Supplier<Block> RICE = BLOCKS.register("rice", () -> new AACrops(defaultCropProps(), ActuallyItems.RICE_SEEDS));
|
public static Supplier<Block> RICE = BLOCKS.register("rice", () -> new AACrops(defaultCropProps(), ActuallyItems.RICE_SEEDS));
|
||||||
public static Supplier<Block> FLAX = BLOCKS.register("flax", () -> new AACrops(defaultCropProps(), ActuallyItems.FLAX_SEEDS));
|
public static Supplier<Block> FLAX = BLOCKS.register("flax", () -> new AACrops(defaultCropProps(), ActuallyItems.FLAX_SEEDS));
|
||||||
public static Supplier<Block> COFFEE = BLOCKS.register("coffee", () -> new AACrops(defaultCropProps(), ActuallyItems.COFFEE_SEEDS));
|
public static Supplier<Block> COFFEE = BLOCKS.register("coffee", () -> new AACrops(defaultCropProps(), ActuallyItems.COFFEE_BEANS));
|
||||||
|
|
||||||
public static final AABlockReg<BlockGreenhouseGlass, AABlockItem, ?> GREENHOUSE_GLASS = new AABlockReg<>("greenhouse_glass", BlockGreenhouseGlass::new,
|
public static final AABlockReg<BlockGreenhouseGlass, AABlockItem, ?> GREENHOUSE_GLASS = new AABlockReg<>("greenhouse_glass", BlockGreenhouseGlass::new,
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
|
|
|
@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.blocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
|
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -22,6 +23,8 @@ import net.minecraft.util.ActionResultType;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
import net.minecraft.util.math.BlockRayTraceResult;
|
||||||
|
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||||
|
import net.minecraft.util.math.shapes.VoxelShape;
|
||||||
import net.minecraft.world.IBlockReader;
|
import net.minecraft.world.IBlockReader;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -37,10 +40,19 @@ public class BlockBatteryBox extends BlockContainerBase {
|
||||||
// public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
// public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
||||||
// return BlockSlabs.AABB_BOTTOM_HALF;
|
// return BlockSlabs.AABB_BOTTOM_HALF;
|
||||||
// }
|
// }
|
||||||
|
@Override
|
||||||
|
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||||
|
return Shapes.BATBOX_SHAPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasTileEntity(BlockState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
//@Override
|
@Override
|
||||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||||
return new TileEntityBatteryBox();
|
return new TileEntityBatteryBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,15 +63,15 @@ public class BlockBatteryBox extends BlockContainerBase {
|
||||||
TileEntityBatteryBox box = (TileEntityBatteryBox) tile;
|
TileEntityBatteryBox box = (TileEntityBatteryBox) tile;
|
||||||
ItemStack stack = player.getItemInHand(hand);
|
ItemStack stack = player.getItemInHand(hand);
|
||||||
|
|
||||||
if (StackUtil.isValid(stack)) {
|
if (!stack.isEmpty()) {
|
||||||
if (stack.getItem() instanceof ItemBattery && !StackUtil.isValid(box.inv.getStackInSlot(0))) {
|
if (stack.getItem() instanceof ItemBattery && box.inv.getStackInSlot(0).isEmpty()) {
|
||||||
box.inv.setStackInSlot(0, stack.copy());
|
box.inv.setStackInSlot(0, stack.copy());
|
||||||
player.setItemInHand(hand, ItemStack.EMPTY);
|
player.setItemInHand(hand, ItemStack.EMPTY);
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ItemStack inSlot = box.inv.getStackInSlot(0);
|
ItemStack inSlot = box.inv.getStackInSlot(0);
|
||||||
if (StackUtil.isValid(inSlot)) {
|
if (!inSlot.isEmpty()) {
|
||||||
player.setItemInHand(hand, inSlot.copy());
|
player.setItemInHand(hand, inSlot.copy());
|
||||||
box.inv.setStackInSlot(0, ItemStack.EMPTY);
|
box.inv.setStackInSlot(0, ItemStack.EMPTY);
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
|
|
|
@ -12,6 +12,7 @@ public class Shapes {
|
||||||
static final VoxelShape CANOLA_PRESS_SHAPE = Stream.of(Block.box(13, 0, 1, 15, 15.5, 3), Block.box(2, 0, 2, 14, 6, 14), Block.box(2, 10, 2, 14, 15, 14), Block.box(3, 6, 3, 13, 10, 13), Block.box(1, 0, 1, 3, 15.5, 3), Block.box(1, 0, 13, 3, 15.5, 15), Block.box(13, 0, 13, 15, 15.5, 15), Block.box(0.9, 0, 0.9, 3.1, 0.5, 3.1), Block.box(0.9, 0, 12.9, 3.1, 0.5, 15.1), Block.box(0.9, 5, 12.9, 3.1, 6.5, 15.1), Block.box(0.9, 5, 0.9, 3.1, 6.5, 3.1), Block.box(12.9, 5, 12.9, 15.1, 6.5, 15.1), Block.box(12.9, 5, 0.9, 15.1, 6.5, 3.1), Block.box(0.9, 9.5, 12.9, 3.1, 11, 15.1), Block.box(0.9, 9.5, 0.9, 3.1, 11, 3.1), Block.box(12.9, 9.5, 12.9, 15.1, 11, 15.1), Block.box(12.9, 9.5, 0.9, 15.1, 11, 3.1), Block.box(12.9, 0, 0.9, 15.1, 0.5, 3.1), Block.box(12.9, 0, 12.9, 15.1, 0.5, 15.1), Block.box(12.9, 15.5, 0.9, 15.1, 16, 3.1), Block.box(12.9, 15.5, 12.9, 15.1, 16, 15.1), Block.box(0.9, 15.5, 0.9, 3.1, 16, 3.1), Block.box(0.9, 15.5, 12.9, 3.1, 16, 15.1)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
static final VoxelShape CANOLA_PRESS_SHAPE = Stream.of(Block.box(13, 0, 1, 15, 15.5, 3), Block.box(2, 0, 2, 14, 6, 14), Block.box(2, 10, 2, 14, 15, 14), Block.box(3, 6, 3, 13, 10, 13), Block.box(1, 0, 1, 3, 15.5, 3), Block.box(1, 0, 13, 3, 15.5, 15), Block.box(13, 0, 13, 15, 15.5, 15), Block.box(0.9, 0, 0.9, 3.1, 0.5, 3.1), Block.box(0.9, 0, 12.9, 3.1, 0.5, 15.1), Block.box(0.9, 5, 12.9, 3.1, 6.5, 15.1), Block.box(0.9, 5, 0.9, 3.1, 6.5, 3.1), Block.box(12.9, 5, 12.9, 15.1, 6.5, 15.1), Block.box(12.9, 5, 0.9, 15.1, 6.5, 3.1), Block.box(0.9, 9.5, 12.9, 3.1, 11, 15.1), Block.box(0.9, 9.5, 0.9, 3.1, 11, 3.1), Block.box(12.9, 9.5, 12.9, 15.1, 11, 15.1), Block.box(12.9, 9.5, 0.9, 15.1, 11, 3.1), Block.box(12.9, 0, 0.9, 15.1, 0.5, 3.1), Block.box(12.9, 0, 12.9, 15.1, 0.5, 15.1), Block.box(12.9, 15.5, 0.9, 15.1, 16, 3.1), Block.box(12.9, 15.5, 12.9, 15.1, 16, 15.1), Block.box(0.9, 15.5, 0.9, 3.1, 16, 3.1), Block.box(0.9, 15.5, 12.9, 3.1, 16, 15.1)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
||||||
static final VoxelShape CRYSTAL_CLUSTER_SHAPE = Stream.of(Block.box(5, 4, 5, 10, 19, 10), Block.box(4, 0, 4, 11, 5, 11), Block.box(3, 0, 3, 5, 4, 5), Block.box(10, 0, 3, 12, 2, 5), Block.box(12, 0, 4, 13, 1, 5), Block.box(11, 0, 5, 12, 1, 6), Block.box(10, 0, 10, 12, 3, 12), Block.box(3, 0, 10, 5, 1, 12), Block.box(9, 0, 3, 10, 3, 4), Block.box(8, 0, 2, 11, 1, 4), Block.box(4, 0, 2, 5, 2, 3), Block.box(5, 0, 3, 7, 1, 4), Block.box(2, 0, 4, 4, 1, 6), Block.box(3, 0, 5, 4, 3, 6.5), Block.box(3, 0, 9, 4, 2, 10), Block.box(2, 0, 8, 4, 1, 10), Block.box(5, 0, 11, 7, 2, 13), Block.box(7, 0, 11, 11, 1, 13), Block.box(10, 0, 9, 13, 1, 11), Block.box(11, 0, 7, 12, 3, 9)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
static final VoxelShape CRYSTAL_CLUSTER_SHAPE = Stream.of(Block.box(5, 4, 5, 10, 19, 10), Block.box(4, 0, 4, 11, 5, 11), Block.box(3, 0, 3, 5, 4, 5), Block.box(10, 0, 3, 12, 2, 5), Block.box(12, 0, 4, 13, 1, 5), Block.box(11, 0, 5, 12, 1, 6), Block.box(10, 0, 10, 12, 3, 12), Block.box(3, 0, 10, 5, 1, 12), Block.box(9, 0, 3, 10, 3, 4), Block.box(8, 0, 2, 11, 1, 4), Block.box(4, 0, 2, 5, 2, 3), Block.box(5, 0, 3, 7, 1, 4), Block.box(2, 0, 4, 4, 1, 6), Block.box(3, 0, 5, 4, 3, 6.5), Block.box(3, 0, 9, 4, 2, 10), Block.box(2, 0, 8, 4, 1, 10), Block.box(5, 0, 11, 7, 2, 13), Block.box(7, 0, 11, 11, 1, 13), Block.box(10, 0, 9, 13, 1, 11), Block.box(11, 0, 7, 12, 3, 9)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
||||||
static final VoxelShape DISPLAY_STAND_SHAPE = Stream.of(Block.box(1, 7, 0, 15, 8, 1), Block.box(0, 0, 0, 16, 1, 16), Block.box(1, 1, 1, 15, 7, 15), Block.box(6, 7, 6, 10, 9, 10), Block.box(0, 1, 0, 1, 7, 1), Block.box(15, 1, 0, 16, 7, 1), Block.box(15, 1, 15, 16, 7, 16), Block.box(0, 1, 15, 1, 7, 16), Block.box(0, 7, 0, 1, 8, 16), Block.box(15, 7, 0, 16, 8, 16), Block.box(1, 7, 15, 15, 8, 16), Block.box(5, 7, 5, 6, 9, 6), Block.box(5, 7, 10, 6, 9, 11), Block.box(10, 7, 10, 11, 9, 11), Block.box(10, 7, 5, 11, 9, 6)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
static final VoxelShape DISPLAY_STAND_SHAPE = Stream.of(Block.box(1, 7, 0, 15, 8, 1), Block.box(0, 0, 0, 16, 1, 16), Block.box(1, 1, 1, 15, 7, 15), Block.box(6, 7, 6, 10, 9, 10), Block.box(0, 1, 0, 1, 7, 1), Block.box(15, 1, 0, 16, 7, 1), Block.box(15, 1, 15, 16, 7, 16), Block.box(0, 1, 15, 1, 7, 16), Block.box(0, 7, 0, 1, 8, 16), Block.box(15, 7, 0, 16, 8, 16), Block.box(1, 7, 15, 15, 8, 16), Block.box(5, 7, 5, 6, 9, 6), Block.box(5, 7, 10, 6, 9, 11), Block.box(10, 7, 10, 11, 9, 11), Block.box(10, 7, 5, 11, 9, 6)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
||||||
|
static final VoxelShape BATBOX_SHAPE = Block.box(0,0,0, 16, 8, 16);
|
||||||
static final VoxelShape EMPOWERER_SHAPE = Stream.of(Block.box(0, 0, 0, 16, 1, 16), Block.box(1, 1, 1, 15, 6, 15), Block.box(1, 6, 1, 15, 7, 15), Block.box(0, 7, 0, 16, 8, 1), Block.box(0, 7, 15, 16, 8, 16), Block.box(0, 7, 1, 1, 8, 15), Block.box(15, 7, 1, 16, 8, 15), Block.box(4, 7, 4, 12, 9, 12), Block.box(0, 1, 0, 1, 7, 1), Block.box(15, 1, 0, 16, 7, 1), Block.box(15, 1, 15, 16, 7, 16), Block.box(0, 1, 15, 1, 7, 16), Block.box(3, 7, 4, 4, 8, 5), Block.box(3, 7, 11, 4, 8, 12), Block.box(4, 7, 12, 5, 8, 13), Block.box(11, 7, 12, 12, 8, 13), Block.box(12, 7, 11, 13, 8, 12), Block.box(12, 7, 4, 13, 8, 5), Block.box(11, 7, 3, 12, 8, 4), Block.box(4, 7, 3, 5, 8, 4)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
static final VoxelShape EMPOWERER_SHAPE = Stream.of(Block.box(0, 0, 0, 16, 1, 16), Block.box(1, 1, 1, 15, 6, 15), Block.box(1, 6, 1, 15, 7, 15), Block.box(0, 7, 0, 16, 8, 1), Block.box(0, 7, 15, 16, 8, 16), Block.box(0, 7, 1, 1, 8, 15), Block.box(15, 7, 1, 16, 8, 15), Block.box(4, 7, 4, 12, 9, 12), Block.box(0, 1, 0, 1, 7, 1), Block.box(15, 1, 0, 16, 7, 1), Block.box(15, 1, 15, 16, 7, 16), Block.box(0, 1, 15, 1, 7, 16), Block.box(3, 7, 4, 4, 8, 5), Block.box(3, 7, 11, 4, 8, 12), Block.box(4, 7, 12, 5, 8, 13), Block.box(11, 7, 12, 12, 8, 13), Block.box(12, 7, 11, 13, 8, 12), Block.box(12, 7, 4, 13, 8, 5), Block.box(11, 7, 3, 12, 8, 4), Block.box(4, 7, 3, 5, 8, 4)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
||||||
static final VoxelShape ENERGIZER_SHAPE = Stream.of(Block.box(0, 15, 0, 1, 16, 16), Block.box(15, 15, 0, 16, 16, 16), Block.box(1, 15, 0, 15, 16, 1), Block.box(1, 15, 15, 15, 16, 16), Block.box(1, 0, 15, 15, 1, 16), Block.box(1, 0, 0, 15, 1, 1), Block.box(15, 0, 0, 16, 1, 16), Block.box(0, 0, 0, 1, 1, 16), Block.box(0, 1, 15, 1, 15, 16), Block.box(15, 1, 15, 16, 15, 16), Block.box(15, 1, 0, 16, 15, 1), Block.box(0, 1, 0, 1, 15, 1), Block.box(1, 14, 1, 15, 15, 15), Block.box(1, 1, 1, 15, 2, 15), Block.box(14, 2, 1, 15, 14, 15), Block.box(1, 2, 1, 2, 14, 15), Block.box(2, 2, 14, 14, 14, 15), Block.box(2, 2, 1, 14, 14, 2), Block.box(9, 3, 0, 13, 4, 1), Block.box(3, 3, 15, 7, 4, 16), Block.box(9, 12, 0, 13, 13, 1), Block.box(3, 12, 15, 7, 13, 16), Block.box(10, 4, 0, 12, 12, 1), Block.box(4, 4, 15, 6, 12, 16), Block.box(0, 3, 3, 1, 4, 7), Block.box(15, 3, 9, 16, 4, 13), Block.box(0, 12, 3, 1, 13, 7), Block.box(15, 12, 9, 16, 13, 13), Block.box(0, 4, 4, 1, 12, 6), Block.box(15, 4, 10, 16, 12, 12)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
static final VoxelShape ENERGIZER_SHAPE = Stream.of(Block.box(0, 15, 0, 1, 16, 16), Block.box(15, 15, 0, 16, 16, 16), Block.box(1, 15, 0, 15, 16, 1), Block.box(1, 15, 15, 15, 16, 16), Block.box(1, 0, 15, 15, 1, 16), Block.box(1, 0, 0, 15, 1, 1), Block.box(15, 0, 0, 16, 1, 16), Block.box(0, 0, 0, 1, 1, 16), Block.box(0, 1, 15, 1, 15, 16), Block.box(15, 1, 15, 16, 15, 16), Block.box(15, 1, 0, 16, 15, 1), Block.box(0, 1, 0, 1, 15, 1), Block.box(1, 14, 1, 15, 15, 15), Block.box(1, 1, 1, 15, 2, 15), Block.box(14, 2, 1, 15, 14, 15), Block.box(1, 2, 1, 2, 14, 15), Block.box(2, 2, 14, 14, 14, 15), Block.box(2, 2, 1, 14, 14, 2), Block.box(9, 3, 0, 13, 4, 1), Block.box(3, 3, 15, 7, 4, 16), Block.box(9, 12, 0, 13, 13, 1), Block.box(3, 12, 15, 7, 13, 16), Block.box(10, 4, 0, 12, 12, 1), Block.box(4, 4, 15, 6, 12, 16), Block.box(0, 3, 3, 1, 4, 7), Block.box(15, 3, 9, 16, 4, 13), Block.box(0, 12, 3, 1, 13, 7), Block.box(15, 12, 9, 16, 13, 13), Block.box(0, 4, 4, 1, 12, 6), Block.box(15, 4, 10, 16, 12, 12)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
||||||
static final VoxelShape BARREL_SHAPE = Stream.of(Block.box(0, 12, 0, 16, 14, 1), Block.box(1, 0.5, 1, 15, 15, 15), Block.box(0, 2, 15, 16, 4, 16), Block.box(0, 7, 15, 16, 9, 16), Block.box(0, 12, 15, 16, 14, 16), Block.box(0, 2, 0, 16, 4, 1), Block.box(0, 7, 0, 16, 9, 1), Block.box(0, 2, 1, 1, 4, 15), Block.box(0, 7, 1, 1, 9, 15), Block.box(0, 12, 1, 1, 14, 15), Block.box(15, 12, 1, 16, 14, 15), Block.box(15, 7, 1, 16, 9, 15), Block.box(15, 2, 1, 16, 4, 15), Block.box(7, 0, 0.5, 9, 16, 1.5), Block.box(0.5, 0, 7, 1.5, 16, 9), Block.box(7, 0, 14.5, 9, 16, 15.5), Block.box(14.5, 0, 7, 15.5, 16, 9), Block.box(2, 0, 0.5, 5, 16, 1.5), Block.box(0.5, 0, 11, 1.5, 16, 14), Block.box(2, 0, 14.5, 5, 16, 15.5), Block.box(14.5, 0, 11, 15.5, 16, 14), Block.box(11, 0, 0.5, 14, 16, 1.5), Block.box(0.5, 0, 2, 1.5, 16, 5), Block.box(11, 0, 14.5, 14, 16, 15.5), Block.box(14.5, 0, 2, 15.5, 16, 5), Block.box(4, 15, 7, 6, 15.3, 9), Block.box(2, 15, 4, 3, 15.3, 12), Block.box(4, 15, 13, 12, 15.3, 14), Block.box(4, 15, 2, 12, 15.3, 3), Block.box(13, 15, 4, 14, 15.3, 12), Block.box(3, 15, 3, 4, 15.3, 4), Block.box(3, 15, 12, 4, 15.3, 13), Block.box(12, 15, 3, 13, 15.3, 4), Block.box(12, 15, 12, 13, 15.3, 13)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
static final VoxelShape BARREL_SHAPE = Stream.of(Block.box(0, 12, 0, 16, 14, 1), Block.box(1, 0.5, 1, 15, 15, 15), Block.box(0, 2, 15, 16, 4, 16), Block.box(0, 7, 15, 16, 9, 16), Block.box(0, 12, 15, 16, 14, 16), Block.box(0, 2, 0, 16, 4, 1), Block.box(0, 7, 0, 16, 9, 1), Block.box(0, 2, 1, 1, 4, 15), Block.box(0, 7, 1, 1, 9, 15), Block.box(0, 12, 1, 1, 14, 15), Block.box(15, 12, 1, 16, 14, 15), Block.box(15, 7, 1, 16, 9, 15), Block.box(15, 2, 1, 16, 4, 15), Block.box(7, 0, 0.5, 9, 16, 1.5), Block.box(0.5, 0, 7, 1.5, 16, 9), Block.box(7, 0, 14.5, 9, 16, 15.5), Block.box(14.5, 0, 7, 15.5, 16, 9), Block.box(2, 0, 0.5, 5, 16, 1.5), Block.box(0.5, 0, 11, 1.5, 16, 14), Block.box(2, 0, 14.5, 5, 16, 15.5), Block.box(14.5, 0, 11, 15.5, 16, 14), Block.box(11, 0, 0.5, 14, 16, 1.5), Block.box(0.5, 0, 2, 1.5, 16, 5), Block.box(11, 0, 14.5, 14, 16, 15.5), Block.box(14.5, 0, 2, 15.5, 16, 5), Block.box(4, 15, 7, 6, 15.3, 9), Block.box(2, 15, 4, 3, 15.3, 12), Block.box(4, 15, 13, 12, 15.3, 14), Block.box(4, 15, 2, 12, 15.3, 3), Block.box(13, 15, 4, 14, 15.3, 12), Block.box(3, 15, 3, 4, 15.3, 4), Block.box(3, 15, 12, 4, 15.3, 13), Block.box(12, 15, 3, 13, 15.3, 4), Block.box(12, 15, 12, 13, 15.3, 13)).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR)).get();
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
|
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.Lang;
|
import de.ellpeck.actuallyadditions.mod.util.Lang;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
@ -97,9 +98,7 @@ public class RenderBatteryBox extends TileEntityRenderer<TileEntityBatteryBox> {
|
||||||
matrices.scale(scale, scale, scale);
|
matrices.scale(scale, scale, scale);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Minecraft.getInstance().getItemRenderer().renderStatic(
|
AssetUtil.renderItemInWorld(stack, combinedLight, combinedOverlay, matrices, buffer);
|
||||||
stack, ItemCameraTransforms.TransformType.FIXED, combinedLight, combinedOverlay, matrices, buffer
|
|
||||||
);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ActuallyAdditions.LOGGER.error("Something went wrong trying to render an item in a battery box! The item is " + stack.getItem().getRegistryName() + "!", e);
|
ActuallyAdditions.LOGGER.error("Something went wrong trying to render an item in a battery box! The item is " + stack.getItem().getRegistryName() + "!", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import net.minecraftforge.fml.RegistryObject;
|
||||||
import net.minecraftforge.registries.DeferredRegister;
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
@ -58,7 +59,12 @@ public final class ActuallyItems {
|
||||||
public static final RegistryObject<Item> BATS_WING = ITEMS.register("bats_wing", ItemBase::new);
|
public static final RegistryObject<Item> BATS_WING = ITEMS.register("bats_wing", ItemBase::new);
|
||||||
public static final RegistryObject<Item> DRILL_CORE = ITEMS.register("drill_core", ItemBase::new);
|
public static final RegistryObject<Item> DRILL_CORE = ITEMS.register("drill_core", ItemBase::new);
|
||||||
public static final RegistryObject<Item> LENS = ITEMS.register("lens", ItemBase::new);
|
public static final RegistryObject<Item> LENS = ITEMS.register("lens", ItemBase::new);
|
||||||
public static final RegistryObject<Item> ENDER_STAR = ITEMS.register("ender_star", ItemBase::new);
|
public static final RegistryObject<Item> ENDER_STAR = ITEMS.register("ender_star", () -> new ItemBase() {
|
||||||
|
@Override
|
||||||
|
public boolean isFoil(@Nonnull ItemStack pStack) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
public static final RegistryObject<Item> CRYSTALLIZED_CANOLA_SEED = ITEMS.register("crystallized_canola_seed", () -> new CanolaSeed(false));
|
public static final RegistryObject<Item> CRYSTALLIZED_CANOLA_SEED = ITEMS.register("crystallized_canola_seed", () -> new CanolaSeed(false));
|
||||||
public static final RegistryObject<Item> EMPOWERED_CANOLA_SEED = ITEMS.register("empowered_canola_seed", () -> new CanolaSeed(true));
|
public static final RegistryObject<Item> EMPOWERED_CANOLA_SEED = ITEMS.register("empowered_canola_seed", () -> new CanolaSeed(true));
|
||||||
|
|
||||||
|
@ -156,12 +162,11 @@ public final class ActuallyItems {
|
||||||
public static final RegistryObject<Item> LEAF_BLOWER = ITEMS.register("leaf_blower", () -> new ItemLeafBlower(false));
|
public static final RegistryObject<Item> LEAF_BLOWER = ITEMS.register("leaf_blower", () -> new ItemLeafBlower(false));
|
||||||
public static final RegistryObject<Item> ADVANCED_LEAF_BLOWER = ITEMS.register("advanced_leaf_blower", () -> new ItemLeafBlower(true));
|
public static final RegistryObject<Item> ADVANCED_LEAF_BLOWER = ITEMS.register("advanced_leaf_blower", () -> new ItemLeafBlower(true));
|
||||||
|
|
||||||
public static final RegistryObject<Item> COFFEE_BEANS = ITEMS.register("coffee_beans", ItemCoffeeBean::new);
|
public static final RegistryObject<Item> COFFEE_BEANS = ITEMS.register("coffee_beans", () -> new AABlockItem.AASeedItem(ActuallyBlocks.COFFEE.get(), ActuallyItems.defaultProps()));
|
||||||
|
|
||||||
public static final RegistryObject<Item> RICE_SEEDS = ITEMS.register("rice_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.RICE.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedRice", ActuallyBlocks.RICE.get(), FOOD.get(), TheFoods.RICE.ordinal()));
|
public static final RegistryObject<Item> RICE_SEEDS = ITEMS.register("rice_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.RICE.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedRice", ActuallyBlocks.RICE.get(), FOOD.get(), TheFoods.RICE.ordinal()));
|
||||||
public static final RegistryObject<Item> CANOLA_SEEDS = ITEMS.register("canola_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.CANOLA.get(), ActuallyItems.defaultProps())); //() -> new ItemFoodSeed("seedCanola", ActuallyBlocks.CANOLA, itemMisc, 0, 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F));
|
public static final RegistryObject<Item> CANOLA_SEEDS = ITEMS.register("canola_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.CANOLA.get(), ActuallyItems.defaultProps())); //() -> new ItemFoodSeed("seedCanola", ActuallyBlocks.CANOLA, itemMisc, 0, 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F));
|
||||||
public static final RegistryObject<Item> FLAX_SEEDS = ITEMS.register("flax_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.FLAX.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedFlax", ActuallyBlocks.FLAX, Items.STRING, 0));
|
public static final RegistryObject<Item> FLAX_SEEDS = ITEMS.register("flax_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.FLAX.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedFlax", ActuallyBlocks.FLAX, Items.STRING, 0));
|
||||||
public static final RegistryObject<Item> COFFEE_SEEDS = ITEMS.register("coffee_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.COFFEE.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedCoffeeBeans", ActuallyBlocks.COFFEE, COFFEE_BEANS, 0));
|
|
||||||
|
|
||||||
// TOOLS & ARMOR
|
// TOOLS & ARMOR
|
||||||
public static final RegistryObject<Item> WOODEN_AIOT = ITEMS.register("wooden_aiot", () -> new AllInOneTool(ItemTier.WOOD));
|
public static final RegistryObject<Item> WOODEN_AIOT = ITEMS.register("wooden_aiot", () -> new AllInOneTool(ItemTier.WOOD));
|
||||||
|
@ -197,7 +202,7 @@ public final class ActuallyItems {
|
||||||
CRUSHED_QUARTZ, CRUSHED_COAL, CRUSHED_BLACK_QUARTZ, */
|
CRUSHED_QUARTZ, CRUSHED_COAL, CRUSHED_BLACK_QUARTZ, */
|
||||||
SOLIDIFIED_EXPERIENCE, LEAF_BLOWER, ADVANCED_LEAF_BLOWER,
|
SOLIDIFIED_EXPERIENCE, LEAF_BLOWER, ADVANCED_LEAF_BLOWER,
|
||||||
RING_OF_GROWTH, RING_OF_MAGNETIZING,
|
RING_OF_GROWTH, RING_OF_MAGNETIZING,
|
||||||
COFFEE_BEANS, RICE_SEEDS, CANOLA_SEEDS, FLAX_SEEDS, COFFEE_SEEDS
|
COFFEE_BEANS, RICE_SEEDS, CANOLA_SEEDS, FLAX_SEEDS
|
||||||
);
|
);
|
||||||
|
|
||||||
private static Supplier<Item> basicItem() {
|
private static Supplier<Item> basicItem() {
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh
|
||||||
@Override
|
@Override
|
||||||
public LazyOptional<IEnergyStorage> getEnergyStorage(Direction facing) {
|
public LazyOptional<IEnergyStorage> getEnergyStorage(Direction facing) {
|
||||||
ItemStack stack = this.inv.getStackInSlot(0);
|
ItemStack stack = this.inv.getStackInSlot(0);
|
||||||
if (StackUtil.isValid(stack) && stack.getItem() instanceof ItemBattery) {
|
if (stack.getItem() instanceof ItemBattery) {
|
||||||
return stack.getCapability(CapabilityEnergy.ENERGY, null);
|
return stack.getCapability(CapabilityEnergy.ENERGY, null);
|
||||||
}
|
}
|
||||||
return LazyOptional.empty();
|
return LazyOptional.empty();
|
||||||
|
@ -51,7 +51,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh
|
||||||
LazyOptional<IEnergyStorage> cap = this.getEnergyStorage(null);
|
LazyOptional<IEnergyStorage> cap = this.getEnergyStorage(null);
|
||||||
int currStorage = cap.map(storage -> {
|
int currStorage = cap.map(storage -> {
|
||||||
ItemStack stack = this.inv.getStackInSlot(0);
|
ItemStack stack = this.inv.getStackInSlot(0);
|
||||||
if (StackUtil.isValid(stack) && ItemUtil.isEnabled(stack)) {
|
if (!stack.isEmpty() && ItemUtil.isEnabled(stack)) {
|
||||||
if (storage.getEnergyStored() > 0) {
|
if (storage.getEnergyStored() > 0) {
|
||||||
List<TileEntityBatteryBox> tiles = new ArrayList<>();
|
List<TileEntityBatteryBox> tiles = new ArrayList<>();
|
||||||
this.energyPushOffLoop(this, tiles);
|
this.energyPushOffLoop(this, tiles);
|
||||||
|
@ -67,7 +67,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh
|
||||||
|
|
||||||
for (TileEntityBatteryBox tile : tiles) {
|
for (TileEntityBatteryBox tile : tiles) {
|
||||||
ItemStack battery = tile.inv.getStackInSlot(0);
|
ItemStack battery = tile.inv.getStackInSlot(0);
|
||||||
if (StackUtil.isValid(battery) && !ItemUtil.isEnabled(battery)) {
|
if (!battery.isEmpty() && !ItemUtil.isEnabled(battery)) {
|
||||||
int received = tile.getCapability(CapabilityEnergy.ENERGY, null).map(e -> e.receiveEnergy(maxPer, false)).orElse(0);
|
int received = tile.getCapability(CapabilityEnergy.ENERGY, null).map(e -> e.receiveEnergy(maxPer, false)).orElse(0);
|
||||||
storage.extractEnergy(received, false);
|
storage.extractEnergy(received, false);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh
|
||||||
@Override
|
@Override
|
||||||
public void activateOnPulse() {
|
public void activateOnPulse() {
|
||||||
ItemStack stack = this.inv.getStackInSlot(0);
|
ItemStack stack = this.inv.getStackInSlot(0);
|
||||||
if (StackUtil.isValid(stack)) {
|
if (!stack.isEmpty()) {
|
||||||
ItemUtil.changeEnabled(stack);
|
ItemUtil.changeEnabled(stack);
|
||||||
this.setChanged();
|
this.setChanged();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue