1.15/1.14/1.12: E-Furnace auto-feed added. Labeled Crate slot inventory wrapping to prevent sorting mods from altering the label slot. 1.12: Manual back-ported (issue #93). Steel-Mesh-Fence back-ported.
This commit is contained in:
parent
45925ef81f
commit
76384d1126
245 changed files with 3665 additions and 710 deletions
|
@ -2,7 +2,7 @@
|
|||
org.gradle.daemon=false
|
||||
org.gradle.jvmargs=-Xmx8G
|
||||
version_minecraft=1.15.2
|
||||
version_forge_minecraft=1.15.2-31.1.35
|
||||
version_forge_minecraft=1.15.2-31.1.44
|
||||
version_fml_mappings=20200225-1.15.1
|
||||
version_jei=1.15.2:6.0.0.2
|
||||
version_engineersdecor=1.0.20-b4
|
||||
version_engineersdecor=1.0.20-b5
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
|
||||
"1.15.2": {
|
||||
"1.0.20-b5": "[A] Electrical Furnace can draw in smelting input items from an adjacent inventory when a Hopper is placed in the auxiliary slot.\n[M] Wrapped Labeled Crate label slot to prevent sorting mods from altering the label.",
|
||||
"1.0.20-b4": "[F] Fixed Mineral Smelter fluid voiding on external draining (issue #92, thx papaworld, pupnewfster).",
|
||||
"1.0.20-b3": "[M] Labeled Crate: GUI quick-move-all (ctrl-shift click) smart move tweaked, Manual page added.\n[F] Fixed IE ingredients based default recipes for Factory Dropper and Small Electrical Furnace.\n[M] Factory Hopper: GUI quick-move-all added.\n[M] Code structure, simplifications, cap invalidation fixes.\n[M] Valves: Removed performance caching for testing purposes.",
|
||||
"1.0.20-b2": "[A] Added Labeled Crate (storage crate with built-in item frame).",
|
||||
|
@ -18,6 +19,6 @@
|
|||
},
|
||||
"promos": {
|
||||
"1.15.2-recommended": "",
|
||||
"1.15.2-latest": "1.0.20-b4"
|
||||
"1.15.2-latest": "1.0.20-b5"
|
||||
}
|
||||
}
|
|
@ -11,6 +11,10 @@ Mod sources for Minecraft version 1.15.1.
|
|||
|
||||
## Version history
|
||||
|
||||
- v1.0.20-b5 [A] Electrical Furnace can draw in smelting input items from an adjacent inventory when a
|
||||
Hopper is placed in the auxiliary slot.
|
||||
[M] Wrapped Labeled Crate label slot to prevent sorting mods from altering the label.
|
||||
|
||||
- v1.0.20-b4 [F] Fixed Mineral Smelter fluid voiding on external draining (issue #92, thx papaworld, pupnewfster).
|
||||
|
||||
- v1.0.20-b3 [M] Labeled Crate: GUI quick-move-all (ctrl-shift click) smart move tweaked, Manual page added.
|
||||
|
|
|
@ -393,7 +393,7 @@ public class ModContent
|
|||
}
|
||||
)).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "treated_wood_crafting_table"));
|
||||
|
||||
public static final BlockDecorFurnace SMALL_LAB_FURNACE = (BlockDecorFurnace)(new BlockDecorFurnace(
|
||||
public static final BlockDecorFurnace.DecorFurnaceBlock SMALL_LAB_FURNACE = (BlockDecorFurnace.DecorFurnaceBlock)(new BlockDecorFurnace.DecorFurnaceBlock(
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT,
|
||||
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(1f, 15f).sound(SoundType.METAL).notSolid(),
|
||||
new AxisAlignedBB[]{
|
||||
|
@ -402,7 +402,7 @@ public class ModContent
|
|||
}
|
||||
)).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "small_lab_furnace"));
|
||||
|
||||
public static final BlockDecorFurnaceElectrical SMALL_ELECTRICAL_FURNACE = (BlockDecorFurnaceElectrical)(new BlockDecorFurnaceElectrical(
|
||||
public static final BlockDecorFurnaceElectrical.DecorFurnaceElectricalBlock SMALL_ELECTRICAL_FURNACE = (BlockDecorFurnaceElectrical.DecorFurnaceElectricalBlock)(new BlockDecorFurnaceElectrical.DecorFurnaceElectricalBlock(
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT,
|
||||
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).notSolid(),
|
||||
new AxisAlignedBB[]{
|
||||
|
@ -766,12 +766,12 @@ public class ModContent
|
|||
.setRegistryName(ModEngineersDecor.MODID, "te_labeled_crate");
|
||||
|
||||
public static final TileEntityType<?> TET_SMALL_LAB_FURNACE = TileEntityType.Builder
|
||||
.create(BlockDecorFurnace.BTileEntity::new, SMALL_LAB_FURNACE)
|
||||
.create(BlockDecorFurnace.DecorFurnaceTileEntity::new, SMALL_LAB_FURNACE)
|
||||
.build(null)
|
||||
.setRegistryName(ModEngineersDecor.MODID, "te_small_lab_furnace");
|
||||
|
||||
public static final TileEntityType<?> TET_SMALL_ELECTRICAL_FURNACE = TileEntityType.Builder
|
||||
.create(BlockDecorFurnaceElectrical.BTileEntity::new, SMALL_ELECTRICAL_FURNACE)
|
||||
.create(BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity::new, SMALL_ELECTRICAL_FURNACE)
|
||||
.build(null)
|
||||
.setRegistryName(ModEngineersDecor.MODID, "te_small_electrical_furnace");
|
||||
|
||||
|
@ -887,8 +887,8 @@ public class ModContent
|
|||
public static final ContainerType<BlockDecorDropper.BContainer> CT_FACTORY_DROPPER;
|
||||
public static final ContainerType<BlockDecorPlacer.BContainer> CT_FACTORY_PLACER;
|
||||
public static final ContainerType<BlockDecorHopper.DecorHopperContainer> CT_FACTORY_HOPPER;
|
||||
public static final ContainerType<BlockDecorFurnace.BContainer> CT_SMALL_LAB_FURNACE;
|
||||
public static final ContainerType<BlockDecorFurnaceElectrical.BContainer> CT_SMALL_ELECTRICAL_FURNACE;
|
||||
public static final ContainerType<BlockDecorFurnace.DecorFurnaceContainer> CT_SMALL_LAB_FURNACE;
|
||||
public static final ContainerType<BlockDecorFurnaceElectrical.DecorFurnaceElectricalContainer> CT_SMALL_ELECTRICAL_FURNACE;
|
||||
public static final ContainerType<BlockDecorWasteIncinerator.BContainer> CT_WASTE_INCINERATOR;
|
||||
public static final ContainerType<BlockDecorLabeledCrate.LabeledCrateContainer> CT_LABELED_CRATE;
|
||||
|
||||
|
@ -901,9 +901,9 @@ public class ModContent
|
|||
CT_FACTORY_PLACER.setRegistryName(ModEngineersDecor.MODID,"ct_factory_placer");
|
||||
CT_FACTORY_HOPPER = (new ContainerType<BlockDecorHopper.DecorHopperContainer>(BlockDecorHopper.DecorHopperContainer::new));
|
||||
CT_FACTORY_HOPPER.setRegistryName(ModEngineersDecor.MODID,"ct_factory_hopper");
|
||||
CT_SMALL_LAB_FURNACE = (new ContainerType<BlockDecorFurnace.BContainer>(BlockDecorFurnace.BContainer::new));
|
||||
CT_SMALL_LAB_FURNACE = (new ContainerType<BlockDecorFurnace.DecorFurnaceContainer>(BlockDecorFurnace.DecorFurnaceContainer::new));
|
||||
CT_SMALL_LAB_FURNACE.setRegistryName(ModEngineersDecor.MODID,"ct_small_lab_furnace");
|
||||
CT_SMALL_ELECTRICAL_FURNACE = (new ContainerType<BlockDecorFurnaceElectrical.BContainer>(BlockDecorFurnaceElectrical.BContainer::new));
|
||||
CT_SMALL_ELECTRICAL_FURNACE = (new ContainerType<BlockDecorFurnaceElectrical.DecorFurnaceElectricalContainer>(BlockDecorFurnaceElectrical.DecorFurnaceElectricalContainer::new));
|
||||
CT_SMALL_ELECTRICAL_FURNACE.setRegistryName(ModEngineersDecor.MODID,"ct_small_electrical_furnace");
|
||||
CT_WASTE_INCINERATOR = (new ContainerType<BlockDecorWasteIncinerator.BContainer>(BlockDecorWasteIncinerator.BContainer::new));
|
||||
CT_WASTE_INCINERATOR.setRegistryName(ModEngineersDecor.MODID,"ct_small_waste_incinerator");
|
||||
|
@ -1002,8 +1002,8 @@ public class ModContent
|
|||
ScreenManager.registerFactory(CT_FACTORY_DROPPER, BlockDecorDropper.BGui::new);
|
||||
ScreenManager.registerFactory(CT_FACTORY_PLACER, BlockDecorPlacer.BGui::new);
|
||||
ScreenManager.registerFactory(CT_FACTORY_HOPPER, BlockDecorHopper.DecorHopperGui::new);
|
||||
ScreenManager.registerFactory(CT_SMALL_LAB_FURNACE, BlockDecorFurnace.BGui::new);
|
||||
ScreenManager.registerFactory(CT_SMALL_ELECTRICAL_FURNACE, BlockDecorFurnaceElectrical.BGui::new);
|
||||
ScreenManager.registerFactory(CT_SMALL_LAB_FURNACE, BlockDecorFurnace.DecorFurnaceGui::new);
|
||||
ScreenManager.registerFactory(CT_SMALL_ELECTRICAL_FURNACE, BlockDecorFurnaceElectrical.DecorFurnaceElectrical::new);
|
||||
ScreenManager.registerFactory(CT_WASTE_INCINERATOR, BlockDecorWasteIncinerator.BGui::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,126 +63,134 @@ import javax.annotation.Nullable;
|
|||
import java.util.*;
|
||||
|
||||
|
||||
public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBlock
|
||||
public class BlockDecorFurnace
|
||||
{
|
||||
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Block
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public BlockDecorFurnace(long config, Block.Properties properties, final AxisAlignedBB[] unrotatedAABB)
|
||||
{ super(config, properties, unrotatedAABB); setDefaultState(super.getDefaultState().with(LIT, false)); }
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
|
||||
{ super.fillStateContainer(builder); builder.add(LIT); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getLightValue(BlockState state)
|
||||
{ return state.get(LIT) ? super.getLightValue(state) : 0; }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context)
|
||||
{ return super.getStateForPlacement(context).with(LIT, false); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean hasComparatorInputOverride(BlockState state)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getComparatorInputOverride(BlockState blockState, World world, BlockPos pos)
|
||||
public static class DecorFurnaceBlock extends BlockDecor.Horizontal implements IDecorBlock
|
||||
{
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
return (te instanceof BTileEntity) ? ((BTileEntity)te).getComparatorOutput() : 0;
|
||||
}
|
||||
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state)
|
||||
{ return true; }
|
||||
public DecorFurnaceBlock(long config, Block.Properties properties, final AxisAlignedBB[] unrotatedAABB)
|
||||
{ super(config, properties, unrotatedAABB); setDefaultState(super.getDefaultState().with(LIT, false)); }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world)
|
||||
{ return new BlockDecorFurnace.BTileEntity(); }
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
|
||||
{ super.fillStateContainer(builder); builder.add(LIT); }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack)
|
||||
{
|
||||
world.setBlockState(pos, state.with(LIT, false));
|
||||
if(world.isRemote) return;
|
||||
if((!stack.hasTag()) || (!stack.getTag().contains("inventory"))) return;
|
||||
CompoundNBT inventory_nbt = stack.getTag().getCompound("inventory");
|
||||
if(inventory_nbt.isEmpty()) return;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnace.BTileEntity)) return;
|
||||
final BlockDecorFurnace.BTileEntity bte = ((BlockDecorFurnace.BTileEntity)te);
|
||||
bte.readnbt(inventory_nbt);
|
||||
bte.markDirty();
|
||||
world.setBlockState(pos, state.with(LIT, bte.burning()));
|
||||
}
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getLightValue(BlockState state)
|
||||
{ return state.get(LIT) ? super.getLightValue(state) : 0; }
|
||||
|
||||
@Override
|
||||
public boolean hasDynamicDropList()
|
||||
{ return true; }
|
||||
@Override
|
||||
@Nullable
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context)
|
||||
{ return super.getStateForPlacement(context).with(LIT, false); }
|
||||
|
||||
@Override
|
||||
public List<ItemStack> dropList(BlockState state, World world, BlockPos pos, boolean explosion) {
|
||||
final List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
if(world.isRemote) return stacks;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BTileEntity)) return stacks;
|
||||
if(!explosion) {
|
||||
ItemStack stack = new ItemStack(this, 1);
|
||||
CompoundNBT inventory_nbt = ((BTileEntity)te).reset_getnbt();
|
||||
if(!inventory_nbt.isEmpty()) {
|
||||
CompoundNBT nbt = new CompoundNBT();
|
||||
nbt.put("inventory", inventory_nbt);
|
||||
stack.setTag(nbt);
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean hasComparatorInputOverride(BlockState state)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getComparatorInputOverride(BlockState blockState, World world, BlockPos pos)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
return (te instanceof DecorFurnaceTileEntity) ? ((DecorFurnaceTileEntity)te).getComparatorOutput() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world)
|
||||
{ return new BlockDecorFurnace.DecorFurnaceTileEntity(); }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack)
|
||||
{
|
||||
world.setBlockState(pos, state.with(LIT, false));
|
||||
if(world.isRemote) return;
|
||||
if((!stack.hasTag()) || (!stack.getTag().contains("inventory"))) return;
|
||||
CompoundNBT inventory_nbt = stack.getTag().getCompound("inventory");
|
||||
if(inventory_nbt.isEmpty()) return;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnace.DecorFurnaceTileEntity)) return;
|
||||
final BlockDecorFurnace.DecorFurnaceTileEntity bte = ((BlockDecorFurnace.DecorFurnaceTileEntity)te);
|
||||
bte.readnbt(inventory_nbt);
|
||||
bte.markDirty();
|
||||
world.setBlockState(pos, state.with(LIT, bte.burning()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDynamicDropList()
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
public List<ItemStack> dropList(BlockState state, World world, BlockPos pos, boolean explosion) {
|
||||
final List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
if(world.isRemote) return stacks;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof DecorFurnaceTileEntity)) return stacks;
|
||||
if(!explosion) {
|
||||
ItemStack stack = new ItemStack(this, 1);
|
||||
CompoundNBT inventory_nbt = ((DecorFurnaceTileEntity)te).reset_getnbt();
|
||||
if(!inventory_nbt.isEmpty()) {
|
||||
CompoundNBT nbt = new CompoundNBT();
|
||||
nbt.put("inventory", inventory_nbt);
|
||||
stack.setTag(nbt);
|
||||
}
|
||||
stacks.add(stack);
|
||||
} else {
|
||||
for(ItemStack stack: ((DecorFurnaceTileEntity)te).stacks_) stacks.add(stack);
|
||||
((DecorFurnaceTileEntity)te).reset();
|
||||
}
|
||||
stacks.add(stack);
|
||||
} else {
|
||||
for(ItemStack stack: ((BTileEntity)te).stacks_) stacks.add(stack);
|
||||
((BTileEntity)te).reset();
|
||||
return stacks;
|
||||
}
|
||||
return stacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult)
|
||||
{
|
||||
if(world.isRemote) return ActionResultType.SUCCESS;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnace.BTileEntity)) return ActionResultType.FAIL;
|
||||
if((!(player instanceof ServerPlayerEntity) && (!(player instanceof FakePlayer)))) return ActionResultType.FAIL;
|
||||
NetworkHooks.openGui((ServerPlayerEntity)player,(INamedContainerProvider)te);
|
||||
player.addStat(Stats.INTERACT_WITH_FURNACE);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void animateTick(BlockState state, World world, BlockPos pos, Random rnd)
|
||||
{
|
||||
if((state.getBlock()!=this) || (!state.get(LIT))) return;
|
||||
final double rv = rnd.nextDouble();
|
||||
if(rv > 0.5) return;
|
||||
final double x=0.5+pos.getX(), y=0.5+pos.getY(), z=0.5+pos.getZ();
|
||||
final double xc=0.52, xr=rnd.nextDouble()*0.4-0.2, yr=(y-0.3+rnd.nextDouble()*0.2);
|
||||
if(rv < 0.1d) world.playSound(x, y, z, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 0.4f, 0.5f, false);
|
||||
switch(state.get(HORIZONTAL_FACING)) {
|
||||
case WEST: world.addParticle(ParticleTypes.SMOKE, x-xc, yr, z+xr, 0.0, 0.0, 0.0); break;
|
||||
case EAST: world.addParticle(ParticleTypes.SMOKE, x+xc, yr, z+xr, 0.0, 0.0, 0.0); break;
|
||||
case NORTH: world.addParticle(ParticleTypes.SMOKE, x+xr, yr, z-xc, 0.0, 0.0, 0.0); break;
|
||||
default: world.addParticle(ParticleTypes.SMOKE, x+xr, yr, z+xc, 0.0, 0.0, 0.0); break;
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult)
|
||||
{
|
||||
if(world.isRemote) return ActionResultType.SUCCESS;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnace.DecorFurnaceTileEntity)) return ActionResultType.FAIL;
|
||||
if((!(player instanceof ServerPlayerEntity) && (!(player instanceof FakePlayer)))) return ActionResultType.FAIL;
|
||||
NetworkHooks.openGui((ServerPlayerEntity)player,(INamedContainerProvider)te);
|
||||
player.addStat(Stats.INTERACT_WITH_FURNACE);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void animateTick(BlockState state, World world, BlockPos pos, Random rnd)
|
||||
{
|
||||
if((state.getBlock()!=this) || (!state.get(LIT))) return;
|
||||
final double rv = rnd.nextDouble();
|
||||
if(rv > 0.5) return;
|
||||
final double x=0.5+pos.getX(), y=0.5+pos.getY(), z=0.5+pos.getZ();
|
||||
final double xc=0.52, xr=rnd.nextDouble()*0.4-0.2, yr=(y-0.3+rnd.nextDouble()*0.2);
|
||||
if(rv < 0.1d) world.playSound(x, y, z, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 0.4f, 0.5f, false);
|
||||
switch(state.get(HORIZONTAL_FACING)) {
|
||||
case WEST: world.addParticle(ParticleTypes.SMOKE, x-xc, yr, z+xr, 0.0, 0.0, 0.0); break;
|
||||
case EAST: world.addParticle(ParticleTypes.SMOKE, x+xc, yr, z+xr, 0.0, 0.0, 0.0); break;
|
||||
case NORTH: world.addParticle(ParticleTypes.SMOKE, x+xr, yr, z-xc, 0.0, 0.0, 0.0); break;
|
||||
default: world.addParticle(ParticleTypes.SMOKE, x+xr, yr, z+xc, 0.0, 0.0, 0.0); break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Tile entity
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BTileEntity extends TileEntity implements ITickableTileEntity, INameable, IInventory, INamedContainerProvider, ISidedInventory, IEnergyStorage
|
||||
public static class DecorFurnaceTileEntity extends TileEntity implements ITickableTileEntity, INameable, IInventory, INamedContainerProvider, ISidedInventory, IEnergyStorage
|
||||
{
|
||||
public static final IRecipeType<FurnaceRecipe> RECIPE_TYPE = IRecipeType.SMELTING;
|
||||
public static final int NUM_OF_FIELDS = 5;
|
||||
|
@ -218,7 +226,7 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
ModEngineersDecor.logger().info("Config lab furnace speed:" + (proc_speed_*100) + "%, efficiency:" + (proc_fuel_efficiency_*100) + "%");
|
||||
}
|
||||
|
||||
// BTileEntity -----------------------------------------------------------------------------
|
||||
// DecorFurnaceTileEntity -----------------------------------------------------------------------------
|
||||
|
||||
private int tick_timer_;
|
||||
private int fifo_timer_;
|
||||
|
@ -235,10 +243,10 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
protected @Nullable IRecipe current_recipe_ = null;
|
||||
private final List<String> recent_recipes_ = new ArrayList<>();
|
||||
|
||||
public BTileEntity()
|
||||
public DecorFurnaceTileEntity()
|
||||
{ this(ModContent.TET_SMALL_LAB_FURNACE); }
|
||||
|
||||
public BTileEntity(TileEntityType<?> te_type)
|
||||
public DecorFurnaceTileEntity(TileEntityType<?> te_type)
|
||||
{ super(te_type); reset(); }
|
||||
|
||||
public CompoundNBT reset_getnbt()
|
||||
|
@ -342,7 +350,7 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
|
||||
@Override
|
||||
public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player )
|
||||
{ return new BlockDecorFurnace.BContainer(id, inventory, this, IWorldPosCallable.of(world, pos), fields); }
|
||||
{ return new BlockDecorFurnace.DecorFurnaceContainer(id, inventory, this, IWorldPosCallable.of(world, pos), fields); }
|
||||
|
||||
// IInventory ------------------------------------------------------------------------------
|
||||
|
||||
|
@ -428,17 +436,17 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
|
||||
// Fields -----------------------------------------------------------------------------------------------
|
||||
|
||||
protected final IIntArray fields = new IntArray(BTileEntity.NUM_OF_FIELDS)
|
||||
protected final IIntArray fields = new IntArray(DecorFurnaceTileEntity.NUM_OF_FIELDS)
|
||||
{
|
||||
@Override
|
||||
public int get(int id)
|
||||
{
|
||||
switch(id) {
|
||||
case 0: return BTileEntity.this.burntime_left_;
|
||||
case 1: return BTileEntity.this.fuel_burntime_;
|
||||
case 2: return (int)BTileEntity.this.field_proc_time_elapsed_;
|
||||
case 3: return BTileEntity.this.proc_time_needed_;
|
||||
case 4: return BTileEntity.this.field_is_burning_;
|
||||
case 0: return DecorFurnaceTileEntity.this.burntime_left_;
|
||||
case 1: return DecorFurnaceTileEntity.this.fuel_burntime_;
|
||||
case 2: return (int)DecorFurnaceTileEntity.this.field_proc_time_elapsed_;
|
||||
case 3: return DecorFurnaceTileEntity.this.proc_time_needed_;
|
||||
case 4: return DecorFurnaceTileEntity.this.field_is_burning_;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
@ -446,11 +454,11 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
public void set(int id, int value)
|
||||
{
|
||||
switch(id) {
|
||||
case 0: BTileEntity.this.burntime_left_ = value; break;
|
||||
case 1: BTileEntity.this.fuel_burntime_ = value; break;
|
||||
case 2: BTileEntity.this.field_proc_time_elapsed_ = value; break;
|
||||
case 3: BTileEntity.this.proc_time_needed_ = value; break;
|
||||
case 4: BTileEntity.this.field_is_burning_ = value;
|
||||
case 0: DecorFurnaceTileEntity.this.burntime_left_ = value; break;
|
||||
case 1: DecorFurnaceTileEntity.this.fuel_burntime_ = value; break;
|
||||
case 2: DecorFurnaceTileEntity.this.field_proc_time_elapsed_ = value; break;
|
||||
case 3: DecorFurnaceTileEntity.this.proc_time_needed_ = value; break;
|
||||
case 4: DecorFurnaceTileEntity.this.field_is_burning_ = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -592,8 +600,8 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
if(was_burning != burning()) {
|
||||
dirty = true;
|
||||
final BlockState state = world.getBlockState(pos);
|
||||
if(state.getBlock() instanceof BlockDecorFurnace) {
|
||||
world.setBlockState(pos, state.with(LIT, burning()));
|
||||
if(state.getBlock() instanceof DecorFurnaceBlock) {
|
||||
world.setBlockState(pos, state.with(DecorFurnaceBlock.LIT, burning()));
|
||||
}
|
||||
}
|
||||
if(dirty) {
|
||||
|
@ -745,7 +753,7 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
// container slots
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BContainer extends Container implements Networking.INetworkSynchronisableContainer
|
||||
public static class DecorFurnaceContainer extends Container implements Networking.INetworkSynchronisableContainer
|
||||
{
|
||||
// Slots --------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -796,8 +804,8 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
protected void onCrafting(ItemStack stack)
|
||||
{
|
||||
stack.onCrafting(player_.world, player_, removeCount);
|
||||
if((!player_.world.isRemote) && (inventory_ instanceof BTileEntity)) {
|
||||
BTileEntity te = (BTileEntity)inventory_;
|
||||
if((!player_.world.isRemote) && (inventory_ instanceof DecorFurnaceTileEntity)) {
|
||||
DecorFurnaceTileEntity te = (DecorFurnaceTileEntity)inventory_;
|
||||
int xp = removeCount;
|
||||
float sxp = te.getSmeltingExperience(stack);
|
||||
if(sxp == 0) {
|
||||
|
@ -818,14 +826,14 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
|
||||
public static class BFuelSlot extends Slot
|
||||
{
|
||||
private final BContainer container_;
|
||||
private final DecorFurnaceContainer container_;
|
||||
|
||||
public BFuelSlot(IInventory inventory, int index, int xpos, int ypos, BContainer container)
|
||||
public BFuelSlot(IInventory inventory, int index, int xpos, int ypos, DecorFurnaceContainer container)
|
||||
{ super(inventory, index, xpos, ypos); container_=container; }
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack)
|
||||
{ return isBucket(stack) || (BTileEntity.isFuel(container_.world(), stack)); }
|
||||
{ return isBucket(stack) || (DecorFurnaceTileEntity.isFuel(container_.world(), stack)); }
|
||||
|
||||
@Override
|
||||
public int getItemStackLimit(ItemStack stack)
|
||||
|
@ -849,17 +857,17 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
public IInventory inventory() { return inventory_ ; }
|
||||
public World world() { return player_.world; }
|
||||
|
||||
public BContainer(int cid, PlayerInventory player_inventory)
|
||||
{ this(cid, player_inventory, new Inventory(BTileEntity.NUM_OF_SLOTS), IWorldPosCallable.DUMMY, new IntArray(BTileEntity.NUM_OF_FIELDS)); }
|
||||
public DecorFurnaceContainer(int cid, PlayerInventory player_inventory)
|
||||
{ this(cid, player_inventory, new Inventory(DecorFurnaceTileEntity.NUM_OF_SLOTS), IWorldPosCallable.DUMMY, new IntArray(DecorFurnaceTileEntity.NUM_OF_FIELDS)); }
|
||||
|
||||
private BContainer(int cid, PlayerInventory player_inventory, IInventory block_inventory, IWorldPosCallable wpc, IIntArray fields)
|
||||
private DecorFurnaceContainer(int cid, PlayerInventory player_inventory, IInventory block_inventory, IWorldPosCallable wpc, IIntArray fields)
|
||||
{
|
||||
super(ModContent.CT_SMALL_LAB_FURNACE, cid);
|
||||
player_ = player_inventory.player;
|
||||
inventory_ = block_inventory;
|
||||
wpc_ = wpc;
|
||||
fields_ = fields;
|
||||
recipe_type_ = BTileEntity.RECIPE_TYPE;
|
||||
recipe_type_ = DecorFurnaceTileEntity.RECIPE_TYPE;
|
||||
addSlot(new Slot(inventory_, 0, 59, 17)); // smelting input
|
||||
addSlot(new BFuelSlot(inventory_, 1, 59, 53, this)); // fuel
|
||||
addSlot(new BSlotResult(player_, inventory_, 2, 101, 35)); // smelting result
|
||||
|
@ -907,13 +915,13 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
if(!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO, PLAYER_INV_START_SLOTNO+36, false)) return ItemStack.EMPTY;
|
||||
} else if((index >= PLAYER_INV_START_SLOTNO) && (index <= PLAYER_INV_START_SLOTNO+36)) {
|
||||
// Player inventory
|
||||
if(BTileEntity.canSmelt(world(), slot_stack)) {
|
||||
if(DecorFurnaceTileEntity.canSmelt(world(), slot_stack)) {
|
||||
if(
|
||||
(!mergeItemStack(slot_stack, 0, 1, false)) && // smelting input
|
||||
(!mergeItemStack(slot_stack, 3, 4, false)) && // fifo0
|
||||
(!mergeItemStack(slot_stack, 4, 5, false)) // fifo1
|
||||
) return ItemStack.EMPTY;
|
||||
} else if(BTileEntity.isFuel(player_.world, slot_stack)) {
|
||||
} else if(DecorFurnaceTileEntity.isFuel(player_.world, slot_stack)) {
|
||||
if(
|
||||
(!mergeItemStack(slot_stack, 1, 2, false)) && // fuel input
|
||||
(!mergeItemStack(slot_stack, 5, 6, false)) && // fuel fifo0
|
||||
|
@ -970,11 +978,11 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static class BGui extends ContainerScreen<BContainer>
|
||||
public static class DecorFurnaceGui extends ContainerScreen<DecorFurnaceContainer>
|
||||
{
|
||||
protected final PlayerEntity player_;
|
||||
|
||||
public BGui(BContainer container, PlayerInventory player_inventory, ITextComponent title)
|
||||
public DecorFurnaceGui(DecorFurnaceContainer container, PlayerInventory player_inventory, ITextComponent title)
|
||||
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
|
||||
|
||||
@Override
|
||||
|
@ -1009,7 +1017,7 @@ public class BlockDecorFurnace extends BlockDecor.Horizontal implements IDecorBl
|
|||
{ final int tc=getContainer().field(2), T=getContainer().field(3); return ((T>0) && (tc>0)) ? (tc * pixels / T) : (0); }
|
||||
|
||||
private int flame_px(int pixels)
|
||||
{ int ibt = getContainer().field(1); return ((getContainer().field(0) * pixels) / ((ibt>0) ? (ibt) : (BTileEntity.STD_SMELTING_TIME))); }
|
||||
{ int ibt = getContainer().field(1); return ((getContainer().field(0) * pixels) / ((ibt>0) ? (ibt) : (DecorFurnaceTileEntity.STD_SMELTING_TIME))); }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,38 +8,41 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
|
||||
import wile.engineersdecor.ModContent;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.blocks.BlockDecorFurnace.DecorFurnaceBlock;
|
||||
import wile.engineersdecor.blocks.BlockDecorFurnace.DecorFurnaceContainer;
|
||||
import wile.engineersdecor.libmc.detail.Inventories;
|
||||
import wile.engineersdecor.libmc.detail.Networking;
|
||||
import net.minecraft.inventory.container.*;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.AbstractCookingRecipe;
|
||||
import net.minecraft.item.crafting.FurnaceRecipe;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.inventory.container.*;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.stats.Stats;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
@ -52,60 +55,68 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
|||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements IDecorBlock
|
||||
public class BlockDecorFurnaceElectrical
|
||||
{
|
||||
public BlockDecorFurnaceElectrical(long config, Block.Properties builder, final AxisAlignedBB[] unrotatedAABBs)
|
||||
{ super(config, builder, unrotatedAABBs); }
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Block
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world)
|
||||
{ return new BlockDecorFurnaceElectrical.BTileEntity(); }
|
||||
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult)
|
||||
public static class DecorFurnaceElectricalBlock extends DecorFurnaceBlock implements IDecorBlock
|
||||
{
|
||||
if(world.isRemote) return ActionResultType.SUCCESS;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnaceElectrical.BTileEntity)) return ActionResultType.FAIL;
|
||||
if((!(player instanceof ServerPlayerEntity) && (!(player instanceof FakePlayer)))) return ActionResultType.FAIL;
|
||||
NetworkHooks.openGui((ServerPlayerEntity)player,(INamedContainerProvider)te);
|
||||
player.addStat(Stats.INTERACT_WITH_FURNACE);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
public DecorFurnaceElectricalBlock(long config, Block.Properties builder, final AxisAlignedBB[] unrotatedAABBs)
|
||||
{ super(config, builder, unrotatedAABBs); }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack)
|
||||
{
|
||||
world.setBlockState(pos, state.with(LIT, false));
|
||||
if(world.isRemote) return;
|
||||
if((!stack.hasTag()) || (!stack.getTag().contains("inventory"))) return;
|
||||
CompoundNBT inventory_nbt = stack.getTag().getCompound("inventory");
|
||||
if(inventory_nbt.isEmpty()) return;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnaceElectrical.BTileEntity)) return;
|
||||
BTileEntity bte = (BlockDecorFurnaceElectrical.BTileEntity)te;
|
||||
bte.readnbt(inventory_nbt);
|
||||
bte.markDirty();
|
||||
world.setBlockState(pos, state.with(LIT, bte.burning()));
|
||||
}
|
||||
@Override
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world)
|
||||
{ return new BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity(); }
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void animateTick(BlockState state, World world, BlockPos pos, Random rnd)
|
||||
{}
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult)
|
||||
{
|
||||
if(world.isRemote) return ActionResultType.SUCCESS;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity)) return ActionResultType.FAIL;
|
||||
if((!(player instanceof ServerPlayerEntity) && (!(player instanceof FakePlayer)))) return ActionResultType.FAIL;
|
||||
NetworkHooks.openGui((ServerPlayerEntity)player,(INamedContainerProvider)te);
|
||||
player.addStat(Stats.INTERACT_WITH_FURNACE);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack)
|
||||
{
|
||||
world.setBlockState(pos, state.with(LIT, false));
|
||||
if(world.isRemote) return;
|
||||
if((!stack.hasTag()) || (!stack.getTag().contains("inventory"))) return;
|
||||
CompoundNBT inventory_nbt = stack.getTag().getCompound("inventory");
|
||||
if(inventory_nbt.isEmpty()) return;
|
||||
final TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity)) return;
|
||||
DecorFurnaceElectricalTileEntity bte = (BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity)te;
|
||||
bte.readnbt(inventory_nbt);
|
||||
bte.markDirty();
|
||||
world.setBlockState(pos, state.with(LIT, bte.burning()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void animateTick(BlockState state, World world, BlockPos pos, Random rnd)
|
||||
{}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Tile entity
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BTileEntity extends BlockDecorFurnace.BTileEntity implements ITickableTileEntity, INameable, IInventory, INamedContainerProvider, ISidedInventory, IEnergyStorage
|
||||
public static class DecorFurnaceElectricalTileEntity extends BlockDecorFurnace.DecorFurnaceTileEntity implements ITickableTileEntity, INameable, IInventory, INamedContainerProvider, ISidedInventory, IEnergyStorage
|
||||
{
|
||||
public static final IRecipeType<FurnaceRecipe> RECIPE_TYPE = IRecipeType.SMELTING;
|
||||
public static final int NUM_OF_FIELDS = 7;
|
||||
|
@ -145,7 +156,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
ModEngineersDecor.logger().info("Config electrical furnace speed:" + proc_speed_percent_ + ", power consumption:" + energy_consumption_);
|
||||
}
|
||||
|
||||
// BTileEntity -----------------------------------------------------------------------------
|
||||
// DecorFurnaceElectricalTileEntity -----------------------------------------------------------------------------
|
||||
|
||||
private int burntime_left_ = 0;
|
||||
private int proc_time_elapsed_ = 0;
|
||||
|
@ -158,10 +169,10 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
private int fifo_timer_ = 0;
|
||||
private boolean enabled_ = false;
|
||||
|
||||
public BTileEntity()
|
||||
public DecorFurnaceElectricalTileEntity()
|
||||
{ this(ModContent.TET_SMALL_ELECTRICAL_FURNACE); }
|
||||
|
||||
public BTileEntity(TileEntityType<?> te_type)
|
||||
public DecorFurnaceElectricalTileEntity(TileEntityType<?> te_type)
|
||||
{ super(te_type); }
|
||||
|
||||
public void reset()
|
||||
|
@ -239,7 +250,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
@Override
|
||||
public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player )
|
||||
{ return new BlockDecorFurnaceElectrical.BContainer(id, inventory, this, IWorldPosCallable.of(world, pos), fields); }
|
||||
{ return new BlockDecorFurnaceElectrical.DecorFurnaceElectricalContainer(id, inventory, this, IWorldPosCallable.of(world, pos), fields); }
|
||||
|
||||
// IInventory ------------------------------------------------------------------------------
|
||||
|
||||
|
@ -262,19 +273,19 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
// Fields -----------------------------------------------------------------------------------------------
|
||||
|
||||
protected final IIntArray fields = new IntArray(BTileEntity.NUM_OF_FIELDS)
|
||||
protected final IIntArray fields = new IntArray(DecorFurnaceElectricalTileEntity.NUM_OF_FIELDS)
|
||||
{
|
||||
@Override
|
||||
public int get(int id)
|
||||
{
|
||||
switch(id) {
|
||||
case 0: return BTileEntity.this.burntime_left_;
|
||||
case 1: return BTileEntity.this.energy_stored_;
|
||||
case 2: return BTileEntity.this.proc_time_elapsed_;
|
||||
case 3: return BTileEntity.this.proc_time_needed_;
|
||||
case 4: return BTileEntity.this.speed_;
|
||||
case 5: return BTileEntity.this.field_max_energy_stored_;
|
||||
case 6: return BTileEntity.this.field_isburning_;
|
||||
case 0: return DecorFurnaceElectricalTileEntity.this.burntime_left_;
|
||||
case 1: return DecorFurnaceElectricalTileEntity.this.energy_stored_;
|
||||
case 2: return DecorFurnaceElectricalTileEntity.this.proc_time_elapsed_;
|
||||
case 3: return DecorFurnaceElectricalTileEntity.this.proc_time_needed_;
|
||||
case 4: return DecorFurnaceElectricalTileEntity.this.speed_;
|
||||
case 5: return DecorFurnaceElectricalTileEntity.this.field_max_energy_stored_;
|
||||
case 6: return DecorFurnaceElectricalTileEntity.this.field_isburning_;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
@ -282,13 +293,13 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
public void set(int id, int value)
|
||||
{
|
||||
switch(id) {
|
||||
case 0: BTileEntity.this.burntime_left_ = value; break;
|
||||
case 1: BTileEntity.this.energy_stored_ = value; break;
|
||||
case 2: BTileEntity.this.proc_time_elapsed_ = value; break;
|
||||
case 3: BTileEntity.this.proc_time_needed_ = value; break;
|
||||
case 4: BTileEntity.this.speed_ = value; break;
|
||||
case 5: BTileEntity.this.field_max_energy_stored_ = value; break;
|
||||
case 6: BTileEntity.this.field_isburning_ = value; break;
|
||||
case 0: DecorFurnaceElectricalTileEntity.this.burntime_left_ = value; break;
|
||||
case 1: DecorFurnaceElectricalTileEntity.this.energy_stored_ = value; break;
|
||||
case 2: DecorFurnaceElectricalTileEntity.this.proc_time_elapsed_ = value; break;
|
||||
case 3: DecorFurnaceElectricalTileEntity.this.proc_time_needed_ = value; break;
|
||||
case 4: DecorFurnaceElectricalTileEntity.this.speed_ = value; break;
|
||||
case 5: DecorFurnaceElectricalTileEntity.this.field_max_energy_stored_ = value; break;
|
||||
case 6: DecorFurnaceElectricalTileEntity.this.field_isburning_ = value; break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -310,7 +321,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, Direction direction)
|
||||
{ return ((index!=SMELTING_INPUT_SLOT_NO) && (index!=FIFO_INPUT_0_SLOT_NO) && (index!=FIFO_INPUT_1_SLOT_NO)) || (stack.getItem()==Items.BUCKET); }
|
||||
{ return (index==FIFO_OUTPUT_0_SLOT_NO) || (index==FIFO_OUTPUT_1_SLOT_NO); }
|
||||
|
||||
// IEnergyStorage ----------------------------------------------------------------------------
|
||||
|
||||
|
@ -348,9 +359,9 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
protected static class BItemHandler implements IItemHandler
|
||||
{
|
||||
private BTileEntity te;
|
||||
private DecorFurnaceElectricalTileEntity te;
|
||||
|
||||
BItemHandler(BTileEntity te)
|
||||
BItemHandler(DecorFurnaceElectricalTileEntity te)
|
||||
{ this.te = te; }
|
||||
|
||||
@Override
|
||||
|
@ -530,12 +541,15 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
// Furnace --------------------------------------------------------------------------------------
|
||||
|
||||
protected void updateCurrentRecipe() //// Change this for other recipe registry (e.g. craft tweaker modified).
|
||||
protected void updateCurrentRecipe()
|
||||
{ setCurrentRecipe(getSmeltingResult(RECIPE_TYPE, world, stacks_.get(SMELTING_INPUT_SLOT_NO))); }
|
||||
|
||||
public boolean burning()
|
||||
{ return burntime_left_ > 0; }
|
||||
|
||||
private boolean is_accepted_hopper(final ItemStack stack)
|
||||
{ return (stack.getItem() == Blocks.HOPPER.asItem()) || (stack.getItem() == ModContent.FACTORY_HOPPER.asItem()); }
|
||||
|
||||
private boolean transferItems(final int index_from, final int index_to, int count)
|
||||
{
|
||||
ItemStack from = stacks_.get(index_from);
|
||||
|
@ -571,8 +585,8 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
boolean dirty = false;
|
||||
if(energy_stored_ < transfer_energy_consumption_) return false;
|
||||
final BlockState state = world.getBlockState(pos);
|
||||
if(!(state.getBlock() instanceof BlockDecorFurnaceElectrical)) return false;
|
||||
final Direction out_facing = state.get(HORIZONTAL_FACING);
|
||||
if(!(state.getBlock() instanceof DecorFurnaceElectricalBlock)) return false;
|
||||
final Direction out_facing = state.get(DecorFurnaceElectricalBlock.HORIZONTAL_FACING);
|
||||
if(out && (!stacks_.get(FIFO_OUTPUT_1_SLOT_NO).isEmpty())) {
|
||||
TileEntity te = world.getTileEntity(pos.offset(out_facing));
|
||||
if(te!=null) {
|
||||
|
@ -585,8 +599,8 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
}
|
||||
}
|
||||
}
|
||||
if(with_automatic_inventory_pulling_) {
|
||||
final Direction inp_facing = state.get(HORIZONTAL_FACING).getOpposite();
|
||||
if(with_automatic_inventory_pulling_ || is_accepted_hopper(stacks_.get(SMELTING_AUX_SLOT_NO))) {
|
||||
final Direction inp_facing = state.get(DecorFurnaceElectricalBlock.HORIZONTAL_FACING).getOpposite();
|
||||
if(inp && (stacks_.get(FIFO_INPUT_1_SLOT_NO).isEmpty())) {
|
||||
TileEntity te = world.getTileEntity(pos.offset(inp_facing));
|
||||
if(te!=null) {
|
||||
|
@ -635,8 +649,8 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
private void sync_blockstate()
|
||||
{
|
||||
final BlockState state = world.getBlockState(pos);
|
||||
if((state.getBlock() instanceof BlockDecorFurnaceElectrical) && (state.get(LIT) != burning())) {
|
||||
world.setBlockState(pos, state.with(LIT, burning()), 2);
|
||||
if((state.getBlock() instanceof DecorFurnaceElectricalBlock) && (state.get(DecorFurnaceElectricalBlock.LIT) != burning())) {
|
||||
world.setBlockState(pos, state.with(DecorFurnaceElectricalBlock.LIT, burning()), 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -646,7 +660,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
// container
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BContainer extends Container implements Networking.INetworkSynchronisableContainer
|
||||
public static class DecorFurnaceElectricalContainer extends Container implements Networking.INetworkSynchronisableContainer
|
||||
{
|
||||
private static final int PLAYER_INV_START_SLOTNO = 7;
|
||||
protected final PlayerEntity player_;
|
||||
|
@ -660,24 +674,24 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
public IInventory inventory() { return inventory_ ; }
|
||||
public World world() { return player_.world; }
|
||||
|
||||
public BContainer(int cid, PlayerInventory player_inventory)
|
||||
{ this(cid, player_inventory, new Inventory(BTileEntity.NUM_OF_SLOTS), IWorldPosCallable.DUMMY, new IntArray(BTileEntity.NUM_OF_FIELDS)); }
|
||||
public DecorFurnaceElectricalContainer(int cid, PlayerInventory player_inventory)
|
||||
{ this(cid, player_inventory, new Inventory(DecorFurnaceElectricalTileEntity.NUM_OF_SLOTS), IWorldPosCallable.DUMMY, new IntArray(DecorFurnaceElectricalTileEntity.NUM_OF_FIELDS)); }
|
||||
|
||||
private BContainer(int cid, PlayerInventory player_inventory, IInventory block_inventory, IWorldPosCallable wpc, IIntArray fields)
|
||||
private DecorFurnaceElectricalContainer(int cid, PlayerInventory player_inventory, IInventory block_inventory, IWorldPosCallable wpc, IIntArray fields)
|
||||
{
|
||||
super(ModContent.CT_SMALL_ELECTRICAL_FURNACE, cid);
|
||||
player_ = player_inventory.player;
|
||||
inventory_ = block_inventory;
|
||||
wpc_ = wpc;
|
||||
fields_ = fields;
|
||||
recipe_type_ = BTileEntity.RECIPE_TYPE;
|
||||
recipe_type_ = DecorFurnaceElectricalTileEntity.RECIPE_TYPE;
|
||||
addSlot(new Slot(inventory_, 0, 59, 28)); // smelting input
|
||||
addSlot(new Slot(inventory_, 1, 16, 52)); // aux
|
||||
addSlot(new BlockDecorFurnace.BContainer.BSlotResult(player_, inventory_, 2, 101, 28)); // smelting result
|
||||
addSlot(new BlockDecorFurnace.BContainer.BSlotInpFifo(inventory_, 3, 34, 28)); // input fifo 0
|
||||
addSlot(new BlockDecorFurnace.BContainer.BSlotInpFifo(inventory_, 4, 16, 28)); // input fifo 1
|
||||
addSlot(new BlockDecorFurnace.BContainer.BSlotOutFifo(player_, inventory_, 5, 126, 28)); // out fifo 0
|
||||
addSlot(new BlockDecorFurnace.BContainer.BSlotOutFifo(player_, inventory_, 6, 144, 28)); // out fifo 1
|
||||
addSlot(new DecorFurnaceContainer.BSlotResult(player_, inventory_, 2, 101, 28)); // smelting result
|
||||
addSlot(new DecorFurnaceContainer.BSlotInpFifo(inventory_, 3, 34, 28)); // input fifo 0
|
||||
addSlot(new DecorFurnaceContainer.BSlotInpFifo(inventory_, 4, 16, 28)); // input fifo 1
|
||||
addSlot(new DecorFurnaceContainer.BSlotOutFifo(player_, inventory_, 5, 126, 28)); // out fifo 0
|
||||
addSlot(new DecorFurnaceContainer.BSlotOutFifo(player_, inventory_, 6, 144, 28)); // out fifo 1
|
||||
for(int x=0; x<9; ++x) {
|
||||
addSlot(new Slot(player_inventory, x, 8+x*18, 144)); // player slots: 0..8
|
||||
}
|
||||
|
@ -712,7 +726,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
if(!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO, PLAYER_INV_START_SLOTNO+36, false)) return ItemStack.EMPTY;
|
||||
} else if((index >= PLAYER_INV_START_SLOTNO) && (index <= PLAYER_INV_START_SLOTNO+36)) {
|
||||
// Player inventory
|
||||
if(BTileEntity.canSmelt(world(), slot_stack)) {
|
||||
if(DecorFurnaceElectricalTileEntity.canSmelt(world(), slot_stack)) {
|
||||
if(
|
||||
(!mergeItemStack(slot_stack, 0, 1, false)) && // smelting input
|
||||
(!mergeItemStack(slot_stack, 3, 4, false)) && // fifo0
|
||||
|
@ -755,8 +769,8 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
public void onClientPacketReceived(int windowId, PlayerEntity player, CompoundNBT nbt)
|
||||
{
|
||||
if(!(inventory_ instanceof BTileEntity)) return;
|
||||
BTileEntity te = (BTileEntity)inventory_;
|
||||
if(!(inventory_ instanceof DecorFurnaceElectricalTileEntity)) return;
|
||||
DecorFurnaceElectricalTileEntity te = (DecorFurnaceElectricalTileEntity)inventory_;
|
||||
if(nbt.contains("speed")) te.speed_ = MathHelper.clamp(nbt.getInt("speed"), 0, 3);
|
||||
te.markDirty();
|
||||
}
|
||||
|
@ -767,11 +781,11 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static class BGui extends ContainerScreen<BContainer>
|
||||
public static class DecorFurnaceElectrical extends ContainerScreen<DecorFurnaceElectricalContainer>
|
||||
{
|
||||
protected final PlayerEntity player_;
|
||||
|
||||
public BGui(BContainer container, PlayerInventory player_inventory, ITextComponent title)
|
||||
public DecorFurnaceElectrical(DecorFurnaceElectricalContainer container, PlayerInventory player_inventory, ITextComponent title)
|
||||
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
|
||||
|
||||
@Override
|
||||
|
@ -815,7 +829,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
@Override
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
|
||||
{
|
||||
BContainer container = (BContainer)getContainer();
|
||||
DecorFurnaceElectricalContainer container = (DecorFurnaceElectricalContainer)getContainer();
|
||||
int mx = (int)(mouseX - getGuiLeft() + .5), my = (int)(mouseY - getGuiTop() + .5);
|
||||
if((!isPointInRegion(136, 48, 28, 28, mouseX, mouseY))) {
|
||||
return super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
@ -836,7 +850,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace implements ID
|
|||
|
||||
private int heat_px(int pixels)
|
||||
{
|
||||
int k = ((getContainer().field(0) * (pixels+1)) / (BlockDecorFurnaceElectrical.BTileEntity.HEAT_CAPACITY));
|
||||
int k = ((getContainer().field(0) * (pixels+1)) / (BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity.HEAT_CAPACITY));
|
||||
return (k < pixels) ? k : pixels;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import wile.engineersdecor.ModContent;
|
|||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.libmc.blocks.StandardBlocks;
|
||||
import wile.engineersdecor.libmc.detail.Auxiliaries;
|
||||
import wile.engineersdecor.libmc.detail.Inventories.InventoryRange;
|
||||
import wile.engineersdecor.libmc.detail.Inventories.SlotRange;
|
||||
import wile.engineersdecor.libmc.detail.Networking;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
@ -575,7 +576,7 @@ public class BlockDecorLabeledCrate
|
|||
}
|
||||
}
|
||||
// picture frame slot (54)
|
||||
addSlot(new Slot(inventory_, ++i, 191, 100) {
|
||||
addSlot(new Slot(new InventoryRange(inventory_, 54, 1), 0, 191, 100) {
|
||||
@Override public int getSlotStackLimit(){return 1;}
|
||||
});
|
||||
// player slots
|
||||
|
|
|
@ -60,7 +60,7 @@ import java.util.Random;
|
|||
|
||||
public class BlockDecorWasteIncinerator extends BlockDecor implements IDecorBlock
|
||||
{
|
||||
public static final BooleanProperty LIT = BlockDecorFurnace.LIT;
|
||||
public static final BooleanProperty LIT = BlockDecorFurnace.DecorFurnaceBlock.LIT;
|
||||
|
||||
public BlockDecorWasteIncinerator(long config, Block.Properties builder, final AxisAlignedBB unrotatedAABB)
|
||||
{ super(config, builder, unrotatedAABB); }
|
||||
|
|
|
@ -416,14 +416,14 @@ public class ModConfig
|
|||
.comment("Defines, in percent, how fast the electrical furnace smelts compared to " +
|
||||
"a vanilla furnace. 100% means vanilla furnace speed, 150% means the " +
|
||||
"electrical furnace is faster. The value can be changed on-the-fly for tuning.")
|
||||
.defineInRange("e_furnace_speed_percent", BlockDecorFurnaceElectrical.BTileEntity.DEFAULT_SPEED_PERCENT, 50, 800);
|
||||
.defineInRange("e_furnace_speed_percent", BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity.DEFAULT_SPEED_PERCENT, 50, 800);
|
||||
e_furnace_power_consumption = builder
|
||||
.translation(ModEngineersDecor.MODID + ".config.e_furnace_power_consumption")
|
||||
.comment("Defines how much RF per tick the the electrical furnace consumed (average) for smelting. " +
|
||||
"The feeders transferring items from/to adjacent have this consumption/8 for each stack transaction. " +
|
||||
"The default value is only slightly higher than a furnace with an IE external heater (and no burning fuel inside)." +
|
||||
"The config value can be changed on-the-fly for tuning.")
|
||||
.defineInRange("e_furnace_power_consumption", BlockDecorFurnaceElectrical.BTileEntity.DEFAULT_ENERGY_CONSUMPTION, 8, 4096);
|
||||
.defineInRange("e_furnace_power_consumption", BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity.DEFAULT_ENERGY_CONSUMPTION, 8, 4096);
|
||||
e_furnace_automatic_pulling = builder
|
||||
.translation(ModEngineersDecor.MODID + ".config.e_furnace_automatic_pulling")
|
||||
.comment("Defines if the electrical furnace automatically pulls items from an inventory at the input side." +
|
||||
|
@ -533,8 +533,8 @@ public class ModConfig
|
|||
}
|
||||
// Early non-opt out type based evaluation
|
||||
if(block instanceof BlockDecorCraftingTable.CraftingTableBlock) return COMMON.without_crafting_table.get();
|
||||
if(block instanceof BlockDecorFurnaceElectrical) return COMMON.without_electrical_furnace.get();
|
||||
if((block instanceof BlockDecorFurnace) && (!(block instanceof BlockDecorFurnaceElectrical))) return COMMON.without_lab_furnace.get();
|
||||
if(block instanceof BlockDecorFurnaceElectrical.DecorFurnaceElectricalBlock) return COMMON.without_electrical_furnace.get();
|
||||
if((block instanceof BlockDecorFurnace.DecorFurnaceBlock) && (!(block instanceof BlockDecorFurnaceElectrical.DecorFurnaceElectricalBlock))) return COMMON.without_lab_furnace.get();
|
||||
if(block instanceof BlockDecorPassiveFluidAccumulator) return COMMON.without_passive_fluid_accumulator.get();
|
||||
if(block instanceof BlockDecorWasteIncinerator) return COMMON.without_waste_incinerator.get();
|
||||
if(block instanceof BlockDecorDropper) return COMMON.without_factory_dropper.get();
|
||||
|
@ -614,12 +614,12 @@ public class ModConfig
|
|||
without_recipes_ = COMMON.without_recipes.get();
|
||||
without_direct_slab_pickup = COMMON.without_direct_slab_pickup.get();
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
BlockDecorFurnace.BTileEntity.on_config(COMMON.furnace_smelting_speed_percent.get(), COMMON.furnace_fuel_efficiency_percent.get(), COMMON.furnace_boost_energy_consumption.get());
|
||||
BlockDecorFurnace.DecorFurnaceTileEntity.on_config(COMMON.furnace_smelting_speed_percent.get(), COMMON.furnace_fuel_efficiency_percent.get(), COMMON.furnace_boost_energy_consumption.get());
|
||||
BlockDecorChair.on_config(COMMON.without_chair_sitting.get(), COMMON.without_mob_chair_sitting.get(), COMMON.chair_mob_sitting_probability_percent.get(), COMMON.chair_mob_standup_probability_percent.get());
|
||||
BlockDecorLadder.on_config(COMMON.without_ladder_speed_boost.get());
|
||||
BlockDecorCraftingTable.on_config(COMMON.without_crafting_table_history.get(), false, COMMON.with_crafting_quickmove_buttons.get(), COMMON.without_crafting_mouse_scrolling.get());
|
||||
BlockDecorPipeValve.on_config(COMMON.pipevalve_max_flowrate.get(), COMMON.pipevalve_redstone_gain.get());
|
||||
BlockDecorFurnaceElectrical.BTileEntity.on_config(COMMON.e_furnace_speed_percent.get(), COMMON.e_furnace_power_consumption.get(), COMMON.e_furnace_automatic_pulling.get());
|
||||
BlockDecorFurnaceElectrical.DecorFurnaceElectricalTileEntity.on_config(COMMON.e_furnace_speed_percent.get(), COMMON.e_furnace_power_consumption.get(), COMMON.e_furnace_automatic_pulling.get());
|
||||
BlockDecorSolarPanel.BTileEntity.on_config(COMMON.small_solar_panel_peak_production.get());
|
||||
BlockDecorBreaker.BTileEntity.on_config(COMMON.block_breaker_power_consumption.get(), COMMON.block_breaker_reluctance.get(), COMMON.block_breaker_min_breaking_time.get(), COMMON.block_breaker_requires_power.get());
|
||||
BlockDecorTreeCutter.BTileEntity.on_config(COMMON.tree_cuttter_energy_consumption.get(), COMMON.tree_cuttter_cutting_time_needed.get(), COMMON.tree_cuttter_requires_power.get());
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package wile.engineersdecor.libmc.detail;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
|
@ -253,5 +254,53 @@ public class Inventories
|
|||
return checked(fetched_stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class InventoryRange implements IInventory
|
||||
{
|
||||
public final IInventory inventory;
|
||||
public final int offset, size;
|
||||
|
||||
public InventoryRange(IInventory inventory, int offset, int size)
|
||||
{ this.inventory = inventory; this.offset = offset; this.size = size; }
|
||||
|
||||
public void clear()
|
||||
{ inventory.clear(); }
|
||||
|
||||
public int getSizeInventory()
|
||||
{ return size; }
|
||||
|
||||
public boolean isEmpty()
|
||||
{ for(int i=0; i<size; ++i) if(!inventory.getStackInSlot(offset+i).isEmpty()){return false;} return true; }
|
||||
|
||||
public ItemStack getStackInSlot(int index)
|
||||
{ return inventory.getStackInSlot(offset+index); }
|
||||
|
||||
public ItemStack decrStackSize(int index, int count)
|
||||
{ return inventory.decrStackSize(offset+index, count); }
|
||||
|
||||
public ItemStack removeStackFromSlot(int index)
|
||||
{ return inventory.removeStackFromSlot(offset+index); }
|
||||
|
||||
public void setInventorySlotContents(int index, ItemStack stack)
|
||||
{ inventory.setInventorySlotContents(offset+index, stack); }
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{ return inventory.getInventoryStackLimit(); }
|
||||
|
||||
public void markDirty()
|
||||
{ inventory.markDirty(); }
|
||||
|
||||
public boolean isUsableByPlayer(PlayerEntity player)
|
||||
{ return inventory.isUsableByPlayer(player); }
|
||||
|
||||
public void openInventory(PlayerEntity player)
|
||||
{ inventory.openInventory(player); }
|
||||
|
||||
public void closeInventory(PlayerEntity player)
|
||||
{ inventory.closeInventory(player); }
|
||||
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack)
|
||||
{ return inventory.isItemValidForSlot(offset+index, stack); }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,23 +16,23 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nPositioning$()$(br)You can adjust angle and drop force with $(t: ... technical term, means that the result will stay the same quite accurately, even if the value may not be precisely what it should be - that would be called accuracy then. In other words, the dropper will keep dropping where it dropped the first time.)high repeatability$(). Looking at the front face of the dropper, you see a x-y coordinate system (a red and a green line). The same is drawn in the top right area of the GUI. Clicking there will move the crosshair away from the centre, changing the spit angle from -45° to +45° left/right and up/down. At the left of the coordinate system, a spring is shown as vertical slider, which adjusts the prestress and thus the drop force."
|
||||
"text": "$(l)Positioning$()$(br)You can adjust angle and drop force with $(t: ... technical term, means that the result will stay the same quite accurately, even if the value may not be precisely what it should be - that would be called accuracy then. In other words, the dropper will keep dropping where it dropped the first time.)high repeatability$(). Looking at the front face of the dropper, you see a x-y coordinate system (a red and a green line). The same is drawn in the top right area of the GUI. Clicking there will move the crosshair away from the centre, changing the spit angle from -45° to +45° left/right and up/down. At the left of the coordinate system, a spring is shown as vertical slider, which adjusts the prestress and thus the drop force."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nStack Count$()$(br)The horizontal slider under the position controls (marked with 1 to 5 dots above) is used to set the number of items that are dropped simultaneously. Range is from 1 to 32.$(br)If a stack does not have that many items, it will be skipped. This is useful if you need an exact amount of items, e.g. for compressing in a $(o)IE Metal Press$(), or for in-world crafting contraptions."
|
||||
"text": "$(l)Stack Count$()$(br)The horizontal slider under the position controls (marked with 1 to 5 dots above) is used to set the number of items that are dropped simultaneously. Range is from 1 to 32.$(br)If a stack does not have that many items, it will be skipped. This is useful if you need an exact amount of items, e.g. for compressing in a $(o)IE Metal Press$(), or for in-world crafting contraptions."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nDrop Delay / Interval$()$(br)The horizontal slider below the stack adjustment allows to set a cool-down in 0.1s steps (delay after ejecting; the icons shall represent a dog and a snail for fast -> slow).$(br2)This can be useful if the contraption or device, which you feed with the dropped items, needs some processing time - means preventing item spam or despawning."
|
||||
"text": "$(l)Drop Delay / Interval$()$(br)The horizontal slider below the stack adjustment allows to set a cool-down in 0.1s steps (delay after ejecting; the icons shall represent a dog and a snail for fast -> slow).$(br2)This can be useful if the contraption or device, which you feed with the dropped items, needs some processing time - means preventing item spam or despawning."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nFilter Slots$()$(br)These slots compare the stacks that you place in them with all stacks in the storage. If the item is the same, and the stack in the storage is at least as big as the one in the filter, then the filter output will be ON, and the slot LED is lit green. If no stack or a too small stack is found in the storage, then the filter slot signal is OFF, and the slot LED red. If you leave a filter slot empty, then the LED is unlit, and the output is ignored."
|
||||
"text": "$(l)Filter Slots$()$(br)These slots compare the stacks that you place in them with all stacks in the storage. If the item is the same, and the stack in the storage is at least as big as the one in the filter, then the filter output will be ON, and the slot LED is lit green. If no stack or a too small stack is found in the storage, then the filter slot signal is OFF, and the slot LED red. If you leave a filter slot empty, then the LED is unlit, and the output is ignored."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nRedstone Controls$()$(br)In the lower right area of the GUI, there is a red LED (with down-arrow) and three circuit elements wired up. The LED is lit when the device sees an external Redstone signal, and can also be used as test-trigger button. Below are two logic gates, and one trigger control logic (right).$(br)Let us start at the end of the circuit: If you click at the trigger control, the $(t: The symbols are technical representations, showing what happens if you attach a lever and switch it on. The one curve goes up with the lever signal and stays there - called STEP. The other one also rises with the lever signal, but after a short time falls again by itself, although the lever is still on - that's a PULSE.)symbol changes between $(o)pulse mode$() and $(o)continuous mode$()."
|
||||
"text": "$(l)Redstone Controls$()$(br)In the lower right area of the GUI, there is a red LED (with down-arrow) and three circuit elements wired up. The LED is lit when the device sees an external Redstone signal, and can also be used as test-trigger button. Below are two logic gates, and one trigger control logic (right).$(br)Let us start at the end of the circuit: If you click at the trigger control, the $(t: The symbols are technical representations, showing what happens if you attach a lever and switch it on. The one curve goes up with the lever signal and stays there - called STEP. The other one also rises with the lever signal, but after a short time falls again by itself, although the lever is still on - that's a PULSE.)symbol changes between $(o)pulse mode$() and $(o)continuous mode$()."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
|
@ -40,11 +40,11 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "define if an external Redstone signal is absolutely needed, or if the device shall also spit automatically when filter slots match. And you can define if stacks in the filter slots shall be only dropped all together, or independently.$(br2)§nShutter Indication$()$(br)The front shutter can help you to see internal conditions without opening the GUI. If you have items in the filter slots and all filters match (LEDs green), so that the dropper is"
|
||||
"text": "define if an external Redstone signal is absolutely needed, or if the device shall also spit automatically when filter slots match. And you can define if stacks in the filter slots shall be only dropped all together, or independently.$(br2)$(l)Shutter Indication$()$(br)The front shutter can help you to see internal conditions without opening the GUI. If you have items in the filter slots and all filters match (LEDs green), so that the dropper is"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "only waiting for an external Redstone signal, then the shutter will be open.$(br2)§nFurther Details$()$(br)$(li)A blinking yellow LED above the delay slider indicates that the dropper is waiting for the delay to expire.$(li)When saying 'Redstone' OR 'filter slot output' for the second logic gate, and if the filter conditions are not met, then the dropper will instead spit an item that is not in the filter (good for cleaning)."
|
||||
"text": "only waiting for an external Redstone signal, then the shutter will be open.$(br2)$(l)Further Details$()$(br)$(li)A blinking yellow LED above the delay slider indicates that the dropper is waiting for the delay to expire.$(li)When saying 'Redstone' OR 'filter slot output' for the second logic gate, and if the filter conditions are not met, then the dropper will instead spit an item that is not in the filter (good for cleaning)."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "The hopper can be placed in all directions including up, in the latter case the device collects or draws items from below.$(br)When you break and relocate the hopper, stored items will stay in place, and settings will be preserved.$(br2)§nCollection$()$(br)The Hopper collects items from inventories or in-world into its eighteen internal storage slots, preferring to fill up existing stacks first."
|
||||
"text": "The hopper can be placed in all directions including up, in the latter case the device collects or draws items from below.$(br)When you break and relocate the hopper, stored items will stay in place, and settings will be preserved.$(br2)$(l)Collection$()$(br)The Hopper collects items from inventories or in-world into its eighteen internal storage slots, preferring to fill up existing stacks first."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nInsertion$()$(br)From its internal storage the hopper frequently transfers item stacks to inventories or devices it is directed to, by default one item at a time. It tries to replenish existing stacks before filling empty slots. In case the item in the currently selected slot (marked in the GUI with a red frame) cannot be inserted, the next possible slot will be selected (round robin).$(br)The slider in the middle of the GUI (icons shall represent a"
|
||||
"text": "$(l)Insertion$()$(br)From its internal storage the hopper frequently transfers item stacks to inventories or devices it is directed to, by default one item at a time. It tries to replenish existing stacks before filling empty slots. In case the item in the currently selected slot (marked in the GUI with a red frame) cannot be inserted, the next possible slot will be selected (round robin).$(br)The slider in the middle of the GUI (icons shall represent a"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
|
@ -28,7 +28,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nRedstone Controls$()$(br)In the lower right area of the GUI, there is a red LED (with arrow) and two circuit elements wired up. The LED is lit when the device sees an external Redstone signal, and can also be used as test-trigger button. Connected to that input are an analog inverter, followed by a trigger control logic.$(br)By default the curve shown for the inversion control is going down, meaning that this control $(t:Input 0..15 -> output 15..0)inverts the signal$(). Click it to change this to 'not inverted'."
|
||||
"text": "$(l)Redstone Controls$()$(br)In the lower right area of the GUI, there is a red LED (with arrow) and two circuit elements wired up. The LED is lit when the device sees an external Redstone signal, and can also be used as test-trigger button. Connected to that input are an analog inverter, followed by a trigger control logic.$(br)By default the curve shown for the inversion control is going down, meaning that this control $(t:Input 0..15 -> output 15..0)inverts the signal$(). Click it to change this to 'not inverted'."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
|
@ -36,7 +36,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nDetails$()$(br)$(li)The insertion stack size slider also defines how many items are drawn from the inventory above.$(li)The Factory Hopper does $(t:Unneeded server CPU waste)not insert$() into opposed Hoppers."
|
||||
"text": "$(l)Details$()$(br)$(li)The insertion stack size slider also defines how many items are drawn from the inventory above.$(li)The Factory Hopper does $(t:Unneeded server CPU waste)not insert$() into opposed Hoppers."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "Finally, the trigger control decides if the device shall work continuously, or only when the Redstone signal changes (edge detection trigger). By default this is set to $(o)continuous$(). Clicking changes this to $(o)triggered$(), means 'try to place only the moment when the signal goes off->on (not inverted) or on->off (inverted)'.$(br2)§nSpike Planting$()$(br)Normally blocks are placed in front of the placer. Plants can also be planted through the"
|
||||
"text": "Finally, the trigger control decides if the device shall work continuously, or only when the Redstone signal changes (edge detection trigger). By default this is set to $(o)continuous$(). Clicking changes this to $(o)triggered$(), means 'try to place only the moment when the signal goes off->on (not inverted) or on->off (inverted)'.$(br2)$(l)Spike Planting$()$(br)Normally blocks are placed in front of the placer. Plants can also be planted through the"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
|
|
|
@ -32,15 +32,15 @@
|
|||
{
|
||||
"title": "Item Transfer Tweaks",
|
||||
"type": "text",
|
||||
"text": "To speed up manual crafting and also keeping your inventory organized, there are several tweaks for the 'advanced crafter':$(br2)§nBalanced Quick Move:$() You can quickly fill up stacks in the crafting grid by $(o)SHIFT$()-clicking stacks in your inventory. The clicked stacks are distributed in a way that all stacks in the crafting grid have the same size."
|
||||
"text": "To speed up manual crafting and also keeping your inventory organized, there are several tweaks for the 'advanced crafter':$(br2)$(l)Balanced Quick Move:$() You can quickly fill up stacks in the crafting grid by $(o)SHIFT$()-clicking stacks in your inventory. The clicked stacks are distributed in a way that all stacks in the crafting grid have the same size."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nMouse Wheel:$() You can use the mouse wheel while hovering the result slot to quickly increase or decrease the crafting grid stacks. Normal increment is 1, while holding $(o)SHIFT$() 2, $(o)CTRL$() 4, and $(o)SHIFT-CTRL$() 8. Stacks in your own inventory will be used up first (from the smallest to the largest stack to keep the inventory clean). Then the storage slots will be accessed. Items will always be placed back in your inventory, filling up existing stacks first. Empty slots close to the"
|
||||
"text": "$(l)Mouse Wheel:$() You can use the mouse wheel while hovering the result slot to quickly increase or decrease the crafting grid stacks. Normal increment is 1, while holding $(o)SHIFT$() 2, $(o)CTRL$() 4, and $(o)SHIFT-CTRL$() 8. Stacks in your own inventory will be used up first (from the smallest to the largest stack to keep the inventory clean). Then the storage slots will be accessed. Items will always be placed back in your inventory, filling up existing stacks first. Empty slots close to the"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "existing stacks will be preferred next.$(br2)§nStorage Quick Move:$() When the crafting grid is empty, you can quickly move stacks from or to the storage slots by $(o)SHIFT-clicking$().$(br2)§nQuick Move Buttons:$() You can enable small arrow buttons in the Mod (client) config. They are disabled by default to keep the GUI simple and clean."
|
||||
"text": "existing stacks will be preferred next.$(br2)$(l)Storage Quick Move:$() When the crafting grid is empty, you can quickly move stacks from or to the storage slots by $(o)SHIFT-clicking$().$(br2)$(l)Quick Move Buttons:$() You can enable small arrow buttons in the Mod (client) config. They are disabled by default to keep the GUI simple and clean."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "$(o)§nQuick Move All$()$(br)When using Quick-Move-All (aka shift-ctrl-left-click) on a slot for moving all identical items between the crate storage and the player inventory, the GUI will fill up existing stacks, and then try to insert further stacks into empty slots next to already existing stacks. If no appropriate locations are found, the stacks are moved into the player inventory, and as last option into the hotbar."
|
||||
"text": "$(o)$(l)Quick Move All Tweaks$()$(br)When using Quick-Move-All (aka shift-ctrl-left-click) on a slot for moving all identical items between the crate storage and the player inventory, the GUI will fill up existing stacks, and then try to insert further stacks into empty slots next to already existing stacks. If no appropriate locations are found, the stacks are moved into the player inventory, and as last option into the hotbar."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -20,7 +20,15 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nSpeed override switch$()$(br)A four-position switch in the bottom right area of the GUI allows to alter the processing speed of the furnace. Default is position 1 (normal). At high power expenses, you can alter this: $(br)$(li)Position 0: OFF$(li)Position 1: x1.0 -> RF x1$(li)Position 2: x1.5 -> RF x2$(li)Position 3: x2.0 -> RF x4$(br2)(Positions 0..4 are down, left, top, right)."
|
||||
"text": "$(l)Speed override switch$()$(br)A four-position switch in the bottom right area of the GUI allows to alter the processing speed of the furnace. Default is position 1 (normal). At high power expenses, you can alter this: $(br)$(li)Position 0: OFF$(li)Position 1: x1.0 -> RF x1$(li)Position 2: x1.5 -> RF x2$(li)Position 3: x2.0 -> RF x4$(br2)(Positions 0..4 are down, left, top, right)."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "$(l)Automatic feeding support$()$(br)Placing a Hopper or Factory Hopper into the auxiliary slot at the bottom left of the GUI allows to automatically draw items from inventories at the input side (marked blue). The feeding mechanism will operate only when the first input FiFo slot is empty.$(br)$(o)Side note: The furnace passes stacks that it cannot process directly to the output, so it does not get stuck when some unsmeltable items are pulled in.$()"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "§nRF power speed-up:$() When putting an $(o)$(t:Immersive Engineering)IE$() $(o)External Heater$() into one ot the two auxiliary slots and provide RF power to the Lab Furnace, it processes $(t:Configurable, best to try it out for the pack you are playing)much faster$()."
|
||||
"text": "$(l)RF power speed-up:$() When putting an $(o)$(t:Immersive Engineering)IE$() $(o)External Heater$() into one ot the two auxiliary slots and provide RF power to the Lab Furnace, it processes $(t:Configurable, best to try it out for the pack you are playing)much faster$()."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue