1.12: Fixed java related startup bug (issue #103).

This commit is contained in:
stfwi 2020-07-03 15:53:22 +02:00
parent c6cf013e3b
commit 76b45ee401
20 changed files with 249 additions and 154 deletions

View file

@ -4,4 +4,4 @@ org.gradle.jvmargs=-Xmx8G
version_minecraft=1.12.2
version_forge=14.23.5.2768
version_jei=4.10.0.198
version_engineersdecor=1.1.0
version_engineersdecor=1.1.1-b1

View file

@ -1,6 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"1.12.2": {
"1.1.1-b1": "[F] Fixed java related startup problem (issue #103, thx madmax3004, erebus42, StormbringerGTX, teagan75).",
"1.1.0": "[R] Maintenance Release build v1.1.0. Changes: * Compatibility fixes. * E-Furnace speed selection bug fixed. * Block Placer improvements. ~ v1.1.0-b3 [/] Version skipped for 1.12.2.",
"1.1.0-b2": "[F] Block Placer defers placements if collidable entities are in the way (issue #98, thx DrakoAlcarus).\n[F] Added Block verification during TE ticking in case devices are moved (issue #101, thx D0CTOR-ZED).",
"1.1.0-b1": "[F] Fixed Electrical Furnace speed sanitizing bug (issue #97, thx therobotmenace).\n[M] Changed Labeled Crate Nesting to circumvent server crashing in combination with the Sponge mod.",
@ -92,6 +93,6 @@
},
"promos": {
"1.12.2-recommended": "1.1.0",
"1.12.2-latest": "1.1.0"
"1.12.2-latest": "1.1.1-b1"
}
}

View file

@ -10,6 +10,9 @@ Mod sources for Minecraft version 1.12.2.
----
## Version history
- v1.1.1-b1 [F] Fixed java related startup problem (issue #103, thx madmax3004, erebus42,
StormbringerGTX, teagan75).
-------------------------------------------------------------------
- v1.1.0 [R] Maintenance Release build v1.1.0. Changes:
* Compatibility fixes.

View file

@ -40,6 +40,37 @@ import java.util.Random;
public class BlockDecorBreaker extends BlockDecorDirectedHorizontal
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
public static final int IDLE_TICK_INTERVAL = 40;
public static final int TICK_INTERVAL = 5;
public static final int BOOST_FACTOR = 8;
public static final int DEFAULT_BOOST_ENERGY = 64;
public static final int DEFAULT_BREAKING_RELUCTANCE = 17;
public static final int DEFAULT_MIN_BREAKING_TIME = 15;
public static final int MAX_BREAKING_TIME = 800;
private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY;
private static int energy_max = 10000;
private static int breaking_reluctance = DEFAULT_BREAKING_RELUCTANCE;
private static int min_breaking_time = DEFAULT_MIN_BREAKING_TIME;
private static boolean requires_power = false;
public static void on_config(int boost_energy_per_tick, int breaking_time_per_hardness, int min_breaking_time_ticks, boolean power_required)
{
boost_energy_consumption = TICK_INTERVAL * MathHelper.clamp(boost_energy_per_tick, 16, 512);
energy_max = Math.max(boost_energy_consumption * 10, 10000);
breaking_reluctance = MathHelper.clamp(breaking_time_per_hardness, 5, 50);
min_breaking_time = MathHelper.clamp(min_breaking_time_ticks, 10, 100);
requires_power = power_required;
ModEngineersDecor.logger.info("Config block breaker: Boost energy consumption:" + (boost_energy_consumption/TICK_INTERVAL) + "rf/t, reluctance=" + breaking_reluctance + "t/hrdn, break time offset=" + min_breaking_time + "t");
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public static final PropertyBool ACTIVE = PropertyBool.create("active");
public BlockDecorBreaker(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
@ -115,34 +146,12 @@ public class BlockDecorBreaker extends BlockDecorDirectedHorizontal
public static class BTileEntity extends TileEntity implements ITickable, IEnergyStorage
{
public static final int IDLE_TICK_INTERVAL = 40;
public static final int TICK_INTERVAL = 5;
public static final int BOOST_FACTOR = 8;
public static final int DEFAULT_BOOST_ENERGY = 64;
public static final int DEFAULT_BREAKING_RELUCTANCE = 17;
public static final int DEFAULT_MIN_BREAKING_TIME = 15;
public static final int MAX_BREAKING_TIME = 800;
private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY;
private static int energy_max = 10000;
private static int breaking_reluctance = DEFAULT_BREAKING_RELUCTANCE;
private static int min_breaking_time = DEFAULT_MIN_BREAKING_TIME;
private static boolean requires_power = false;
private int tick_timer_;
private int active_timer_;
private int proc_time_elapsed_;
private int time_needed_;
private int energy_;
public static void on_config(int boost_energy_per_tick, int breaking_time_per_hardness, int min_breaking_time_ticks, boolean power_required)
{
boost_energy_consumption = TICK_INTERVAL * MathHelper.clamp(boost_energy_per_tick, 16, 512);
energy_max = Math.max(boost_energy_consumption * 10, 10000);
breaking_reluctance = MathHelper.clamp(breaking_time_per_hardness, 5, 50);
min_breaking_time = MathHelper.clamp(min_breaking_time_ticks, 10, 100);
requires_power = power_required;
ModEngineersDecor.logger.info("Config block breaker: Boost energy consumption:" + (boost_energy_consumption/TICK_INTERVAL) + "rf/t, reluctance=" + breaking_reluctance + "t/hrdn, break time offset=" + min_breaking_time + "t");
}
public BTileEntity()
{}

View file

@ -30,6 +30,10 @@ import java.util.Random;
public class BlockDecorChair extends BlockDecorDirected
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
private static boolean sitting_enabled = true;
private static double sitting_probability = 0.1;
private static double standup_probability = 0.01;
@ -42,6 +46,10 @@ public class BlockDecorChair extends BlockDecorDirected
ModEngineersDecor.logger.info("Config chairs: " + sitting_enabled + ", sit: " + sitting_probability, ", stand up: " + standup_probability);
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public BlockDecorChair(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
{ super(registryName, config, material, hardness, resistance, sound, unrotatedAABB); setLightOpacity(0); setTickRandomly(true); }

View file

@ -64,6 +64,10 @@ import java.util.List;
public class BlockDecorCraftingTable extends BlockDecorDirected
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
public static boolean with_assist = true;
public static boolean with_assist_direct_history_refab = false;
public static boolean with_assist_quickmove_buttons = false;
@ -79,6 +83,10 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
CraftingHistory.max_history_size(32);
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public BlockDecorCraftingTable(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
{
super(registryName, config, material, hardness, resistance, sound, unrotatedAABB);

View file

@ -58,6 +58,34 @@ import java.util.Random;
public class BlockDecorFurnace extends BlockDecorDirected
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
public static final int TICK_INTERVAL = 4;
public static final int FIFO_INTERVAL = 20;
public static final int MAX_BURNTIME = 0x7fff;
public static final int DEFAULT_BOOST_ENERGY = 32;
public static final int VANILLA_FURNACE_SPEED_INTERVAL = 200;
public static final int DEFAULT_SPEED_INTERVAL = 150;
private static double proc_fuel_efficiency_ = 1.0;
private static int proc_speed_interval_ = DEFAULT_SPEED_INTERVAL;
private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY * TICK_INTERVAL;
public static void on_config(int speed_percent, int fuel_efficiency_percent, int boost_energy_per_tick)
{
double ratio = (100.0 / MathHelper.clamp(speed_percent, 10, 500)) ;
proc_speed_interval_ = MathHelper.clamp((int)(ratio * VANILLA_FURNACE_SPEED_INTERVAL), 20, 400);
proc_fuel_efficiency_ = ((double) MathHelper.clamp(fuel_efficiency_percent, 10, 500)) / 100;
boost_energy_consumption = TICK_INTERVAL * MathHelper.clamp(boost_energy_per_tick, 16, 512);
ModEngineersDecor.logger.info("Config lab furnace interval:" + proc_speed_interval_ + ", efficiency:" + proc_fuel_efficiency_);
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public static final PropertyBool LIT = PropertyBool.create("lit");
public BlockDecorFurnace(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
@ -226,7 +254,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
{ final int tc=te.getField(2), T=te.getField(3); return ((T>0) && (tc>0)) ? (tc * pixels / T) : (0); }
private int flame_px(int pixels)
{ int ibt = te.getField(1); return ((te.getField(0) * pixels) / ((ibt>0) ? (ibt) : (BTileEntity.proc_speed_interval_))); }
{ int ibt = te.getField(1); return ((te.getField(0) * pixels) / ((ibt>0) ? (ibt) : (proc_speed_interval_))); }
}
//--------------------------------------------------------------------------------------------------------------------
@ -434,12 +462,6 @@ public class BlockDecorFurnace extends BlockDecorDirected
public static class BTileEntity extends TileEntity implements ITickable, ISidedInventory, IEnergyStorage
{
public static final int TICK_INTERVAL = 4;
public static final int FIFO_INTERVAL = 20;
public static final int MAX_BURNTIME = 0x7fff;
public static final int DEFAULT_BOOST_ENERGY = 32;
public static final int VANILLA_FURNACE_SPEED_INTERVAL = 200;
public static final int DEFAULT_SPEED_INTERVAL = 150;
public static final int NUM_OF_SLOTS = 11;
public static final int SMELTING_INPUT_SLOT_NO = 0;
public static final int SMELTING_FUEL_SLOT_NO = 1;
@ -453,10 +475,6 @@ public class BlockDecorFurnace extends BlockDecorDirected
public static final int AUX_0_SLOT_NO = 9;
public static final int AUX_1_SLOT_NO =10;
private static double proc_fuel_efficiency_ = 1.0;
private static int proc_speed_interval_ = DEFAULT_SPEED_INTERVAL;
private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY * TICK_INTERVAL;
private int tick_timer_;
private int fifo_timer_;
private int burntime_left_;
@ -468,15 +486,6 @@ public class BlockDecorFurnace extends BlockDecorDirected
protected ItemStack current_smelting_input_stack_ = ItemStack.EMPTY;
protected NonNullList<ItemStack> stacks_;
public static void on_config(int speed_percent, int fuel_efficiency_percent, int boost_energy_per_tick)
{
double ratio = (100.0 / MathHelper.clamp(speed_percent, 10, 500)) ;
proc_speed_interval_ = MathHelper.clamp((int)(ratio * VANILLA_FURNACE_SPEED_INTERVAL), 20, 400);
proc_fuel_efficiency_ = ((double) MathHelper.clamp(fuel_efficiency_percent, 10, 500)) / 100;
boost_energy_consumption = TICK_INTERVAL * MathHelper.clamp(boost_energy_per_tick, 16, 512);
ModEngineersDecor.logger.info("Config lab furnace interval:" + proc_speed_interval_ + ", efficiency:" + proc_fuel_efficiency_);
}
public BTileEntity()
{ reset(); }
@ -809,8 +818,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
{
if(--tick_timer_ > 0) return;
tick_timer_ = TICK_INTERVAL;
final IBlockState state = world.getBlockState(pos);
if(!(state.getBlock() instanceof BlockDecorFurnace)) return;
if(!((world.getBlockState(getPos()).getBlock()) instanceof BlockDecorFurnace)) return;
final boolean was_burning = isBurning();
if(was_burning) burntime_left_ -= TICK_INTERVAL;
if(fuel_burntime_ < 0) fuel_burntime_ = getItemBurnTime(stacks_.get(SMELTING_FUEL_SLOT_NO));
@ -868,7 +876,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
}
if(was_burning != isBurning()) {
dirty = true;
world.setBlockState(pos, state.withProperty(LIT, isBurning()));
world.setBlockState(pos, world.getBlockState(pos).withProperty(LIT, isBurning()));
}
if(dirty) markDirty();
}

View file

@ -11,6 +11,7 @@ package wile.engineersdecor.blocks;
import wile.engineersdecor.ModContent;
import wile.engineersdecor.ModEngineersDecor;
import wile.engineersdecor.detail.Networking;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@ -39,7 +40,6 @@ import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import wile.engineersdecor.detail.Networking;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ -48,6 +48,29 @@ import java.util.Random;
public class BlockDecorFurnaceElectrical extends BlockDecorFurnace
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
private static int energy_consumption_ = BTileEntity.DEFAULT_SCALED_ENERGY_CONSUMPTION;
private static int transfer_energy_consumption_ = BTileEntity.DEFAULT_SCALED_ENERGY_CONSUMPTION/8;
private static int proc_speed_percent_ = BTileEntity.DEFAULT_SPEED_PERCENT;
private static double speed_setting_factor_[] = {0.0, 1.0, 1.5, 2.0};
private static boolean with_automatic_inventory_pulling_ = false;
public static void on_config(int speed_percent, int standard_energy_per_tick, boolean with_automatic_inventory_pulling)
{
proc_speed_percent_ = MathHelper.clamp(speed_percent, 10, 500);
energy_consumption_ = MathHelper.clamp(standard_energy_per_tick, 10, 256) * BTileEntity.HEAT_INCREMENT * proc_speed_percent_ / 100;
transfer_energy_consumption_ = MathHelper.clamp(energy_consumption_/8, 8, BTileEntity.HEAT_INCREMENT);
with_automatic_inventory_pulling_ = with_automatic_inventory_pulling;
ModEngineersDecor.logger.info("Config electrical furnace speed:" + proc_speed_percent_ + ", power consumption:" + energy_consumption_);
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public BlockDecorFurnaceElectrical(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
{
super(registryName, config, material, hardness, resistance, sound, unrotatedAABB);
@ -328,23 +351,6 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace
public static final int DEFAULT_ENERGY_CONSUMPTION = 16 ;
public static final int DEFAULT_SCALED_ENERGY_CONSUMPTION = DEFAULT_ENERGY_CONSUMPTION * HEAT_INCREMENT * DEFAULT_SPEED_PERCENT/100;
// Config ----------------------------------------------------------------------------------
private static int energy_consumption_ = DEFAULT_SCALED_ENERGY_CONSUMPTION;
private static int transfer_energy_consumption_ = DEFAULT_SCALED_ENERGY_CONSUMPTION/8;
private static int proc_speed_percent_ = DEFAULT_SPEED_PERCENT;
private static double speed_setting_factor_[] = {0.0, 1.0, 1.5, 2.0};
private static boolean with_automatic_inventory_pulling_ = false;
public static void on_config(int speed_percent, int standard_energy_per_tick, boolean with_automatic_inventory_pulling)
{
proc_speed_percent_ = MathHelper.clamp(speed_percent, 10, 500);
energy_consumption_ = MathHelper.clamp(standard_energy_per_tick, 10, 256) * HEAT_INCREMENT * proc_speed_percent_ / 100;
transfer_energy_consumption_ = MathHelper.clamp(energy_consumption_/8, 8, HEAT_INCREMENT);
with_automatic_inventory_pulling_ = with_automatic_inventory_pulling;
ModEngineersDecor.logger.info("Config electrical furnace speed:" + proc_speed_percent_ + ", power consumption:" + energy_consumption_);
}
// BTileEntity ------------------------------------------------------------------------------
private int burntime_left_;

View file

@ -40,15 +40,26 @@ import java.util.List;
public class BlockDecorLadder extends BlockLadder
{
protected static final AxisAlignedBB EDLADDER_SOUTH_AABB = ModAuxiliaries.getPixeledAABB(3, 0, 0, 13, 16, 3);
protected static final AxisAlignedBB EDLADDER_EAST_AABB = ModAuxiliaries.getRotatedAABB(EDLADDER_SOUTH_AABB, EnumFacing.EAST, false);
protected static final AxisAlignedBB EDLADDER_WEST_AABB = ModAuxiliaries.getRotatedAABB(EDLADDER_SOUTH_AABB, EnumFacing.WEST, false);
protected static final AxisAlignedBB EDLADDER_NORTH_AABB = ModAuxiliaries.getRotatedAABB(EDLADDER_SOUTH_AABB, EnumFacing.NORTH, false);
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
protected static final double ladder_speed = 0.7;
protected static boolean with_ladder_speed_boost = true;
public static final void on_config(boolean without_ladder_speed_boost)
{ with_ladder_speed_boost = !without_ladder_speed_boost; }
{
with_ladder_speed_boost = !without_ladder_speed_boost;
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
protected static final AxisAlignedBB EDLADDER_SOUTH_AABB = ModAuxiliaries.getPixeledAABB(3, 0, 0, 13, 16, 3);
protected static final AxisAlignedBB EDLADDER_EAST_AABB = ModAuxiliaries.getRotatedAABB(EDLADDER_SOUTH_AABB, EnumFacing.EAST, false);
protected static final AxisAlignedBB EDLADDER_WEST_AABB = ModAuxiliaries.getRotatedAABB(EDLADDER_SOUTH_AABB, EnumFacing.WEST, false);
protected static final AxisAlignedBB EDLADDER_NORTH_AABB = ModAuxiliaries.getRotatedAABB(EDLADDER_SOUTH_AABB, EnumFacing.NORTH, false);
public BlockDecorLadder(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound)
{

View file

@ -60,6 +60,45 @@ import java.util.Map;
public class BlockDecorMilker extends BlockDecorDirectedHorizontal
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
public static final int BUCKET_SIZE = 1000;
public static final int TICK_INTERVAL = 80;
public static final int PROCESSING_TICK_INTERVAL = 20;
public static final int TANK_CAPACITY = BUCKET_SIZE * 12;
public static final int MAX_MILKING_TANK_LEVEL = TANK_CAPACITY-500;
public static final int FILLED_INDICATION_THRESHOLD = BUCKET_SIZE;
public static final int MAX_ENERGY_BUFFER = 16000;
public static final int MAX_ENERGY_TRANSFER = 512;
public static final int DEFAULT_ENERGY_CONSUMPTION = 0;
private static FluidStack milk_fluid_ = new FluidStack(FluidRegistry.WATER, 0);
private static HashMap<ItemStack, ItemStack> milk_containers_ = new HashMap<>();
private static int energy_consumption = DEFAULT_ENERGY_CONSUMPTION;
public static void on_config(int energy_consumption_per_tick)
{
energy_consumption = MathHelper.clamp(energy_consumption_per_tick, 0, 128);
{
Fluid milk = FluidRegistry.getFluid("milk");
if(milk != null) milk_fluid_ = new FluidStack(milk, BUCKET_SIZE);
}
{
milk_containers_.put(new ItemStack(Items.BUCKET), new ItemStack(Items.MILK_BUCKET));
if(ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE!=null) milk_containers_.put(new ItemStack(Items.GLASS_BOTTLE), new ItemStack(ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE));
}
ModEngineersDecor.logger.info(
"Config milker energy consumption:" + energy_consumption + "rf/t"
+ ((milk_fluid_==null)?"":" [milk fluid available]")
+ ((ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE==null)?"":" [bottledmilk mod available]")
);
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public static final PropertyBool FILLED = PropertyBool.create("filled");
public static final PropertyBool ACTIVE = PropertyBool.create("active");
@ -103,7 +142,7 @@ public class BlockDecorMilker extends BlockDecorDirectedHorizontal
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos)
{
BTileEntity te = getTe(world, pos);
return (te==null) ? 0 : MathHelper.clamp((16 * te.fluid_level())/BTileEntity.TANK_CAPACITY, 0, 15);
return (te==null) ? 0 : MathHelper.clamp((16 * te.fluid_level())/TANK_CAPACITY, 0, 15);
}
@Override
@ -149,11 +188,11 @@ public class BlockDecorMilker extends BlockDecorDirectedHorizontal
if(out_stack.isEmpty()) return FluidUtil.interactWithFluidHandler(player, hand, te.fluid_handler());
boolean drained = false;
IItemHandler player_inventory = new PlayerMainInvWrapper(player.inventory);
if(te.fluid_level() >= BTileEntity.BUCKET_SIZE) {
if(te.fluid_level() >= BUCKET_SIZE) {
final ItemStack insert_stack = out_stack.copy();
ItemStack remainder = ItemHandlerHelper.insertItemStacked(player_inventory, insert_stack, false);
if(remainder.getCount() < insert_stack.getCount()) {
te.drain(BTileEntity.BUCKET_SIZE);
te.drain(BUCKET_SIZE);
in_stack.shrink(1);
drained = true;
if(remainder.getCount() > 0) {
@ -181,21 +220,9 @@ public class BlockDecorMilker extends BlockDecorDirectedHorizontal
public static class BTileEntity extends TileEntity implements ITickable, ICapabilityProvider, IEnergyStorage
{
public static final int BUCKET_SIZE = 1000;
public static final int TICK_INTERVAL = 80;
public static final int PROCESSING_TICK_INTERVAL = 20;
public static final int TANK_CAPACITY = BUCKET_SIZE * 12;
public static final int MAX_MILKING_TANK_LEVEL = TANK_CAPACITY-500;
public static final int FILLED_INDICATION_THRESHOLD = BUCKET_SIZE;
public static final int MAX_ENERGY_BUFFER = 16000;
public static final int MAX_ENERGY_TRANSFER = 512;
public static final int DEFAULT_ENERGY_CONSUMPTION = 0;
private static final EnumFacing FLUID_TRANSFER_DIRECTRIONS[] = {EnumFacing.DOWN,EnumFacing.EAST,EnumFacing.SOUTH,EnumFacing.WEST,EnumFacing.NORTH};
private enum MilkingState { IDLE, PICKED, COMING, POSITIONING, MILKING, LEAVING, WAITING }
private static FluidStack milk_fluid_ = new FluidStack(FluidRegistry.WATER, 0);
private static HashMap<ItemStack, ItemStack> milk_containers_ = new HashMap<>();
private static int energy_consumption = DEFAULT_ENERGY_CONSUMPTION;
private int tick_timer_;
private int energy_stored_;
private int tank_level_ = 0;
@ -205,24 +232,6 @@ public class BlockDecorMilker extends BlockDecorDirectedHorizontal
private int state_timer_ = 0;
private BlockPos tracked_cow_original_position_ = null;
public static void on_config(int energy_consumption_per_tick)
{
energy_consumption = MathHelper.clamp(energy_consumption_per_tick, 0, 128);
{
Fluid milk = FluidRegistry.getFluid("milk");
if(milk != null) milk_fluid_ = new FluidStack(milk, BUCKET_SIZE);
}
{
milk_containers_.put(new ItemStack(Items.BUCKET), new ItemStack(Items.MILK_BUCKET));
if(ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE!=null) milk_containers_.put(new ItemStack(Items.GLASS_BOTTLE), new ItemStack(ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE));
}
ModEngineersDecor.logger.info(
"Config milker energy consumption:" + energy_consumption + "rf/t"
+ ((milk_fluid_==null)?"":" [milk fluid available]")
+ ((ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE==null)?"":" [bottledmilk mod available]")
);
}
public BTileEntity()
{ reset(); }

View file

@ -42,15 +42,26 @@ import javax.annotation.Nullable;
public class BlockDecorPipeValve extends BlockDecorDirected
{
public static final PropertyInteger RS_CONNECTION_DIR = PropertyInteger.create("rsdir", 0,4);
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
private static int fluid_maxflow_mb = 1000;
private static int redstone_flow_slope_mb = 1000/15;
public static void on_config(int container_size_decl, int redstone_slope)
{
BTileEntity.fluid_maxflow_mb = MathHelper.clamp(container_size_decl, 1, 10000);
BTileEntity.redstone_flow_slope_mb = MathHelper.clamp(redstone_slope, 1, 10000);
ModEngineersDecor.logger.info("Config pipe valve: maxflow:" + BTileEntity.fluid_maxflow_mb + "mb, redstone amp:" + BTileEntity.redstone_flow_slope_mb + "mb/sig");
fluid_maxflow_mb = MathHelper.clamp(container_size_decl, 1, 10000);
redstone_flow_slope_mb = MathHelper.clamp(redstone_slope, 1, 10000);
ModEngineersDecor.logger.info("Config pipe valve: maxflow:" + fluid_maxflow_mb + "mb, redstone amp:" + redstone_flow_slope_mb + "mb/sig");
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public static final PropertyInteger RS_CONNECTION_DIR = PropertyInteger.create("rsdir", 0,4);
public BlockDecorPipeValve(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
{ super(registryName, config, material, hardness, resistance, sound, unrotatedAABB); }
@ -131,8 +142,6 @@ public class BlockDecorPipeValve extends BlockDecorDirected
public static class BTileEntity extends TileEntity implements IFluidHandler, IFluidTankProperties, ICapabilityProvider, IFluidPipe
{
private static final BackFlowHandler back_flow_handler_ = new BackFlowHandler();
protected static int fluid_maxflow_mb = 1000;
protected static int redstone_flow_slope_mb = 1000/15;
private final IFluidTankProperties[] fluid_props_ = {this};
private EnumFacing block_facing_ = EnumFacing.NORTH;
private boolean filling_ = false;

View file

@ -38,6 +38,25 @@ import javax.annotation.Nullable;
public class BlockDecorSolarPanel extends BlockDecor
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
private static int peak_power_per_tick_ = BTileEntity.DEFAULT_PEAK_POWER;
private static int max_power_storage_ = 10000;
private static int max_feed_power = 128;
public static void on_config(int peak_power_per_tick, int max_feed_power_per_tick)
{
peak_power_per_tick_ = peak_power_per_tick;
max_feed_power = max_feed_power_per_tick;
ModEngineersDecor.logger.info("Config small solar panel: Peak production:" + peak_power_per_tick_ + "/tick");
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public static final PropertyInteger EXPOSITION = PropertyInteger.create("exposition", 0, 4);
public BlockDecorSolarPanel(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
@ -116,21 +135,12 @@ public class BlockDecorSolarPanel extends BlockDecor
public static final int TICK_INTERVAL = 8;
public static final int ACCUMULATION_INTERVAL = 4;
private static final EnumFacing transfer_directions_[] = {EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.NORTH };
private static int peak_power_per_tick_ = DEFAULT_PEAK_POWER;
private static int max_power_storage_ = 10000;
private static int max_feed_power = 128;
private int current_production_ = 0;
private int tick_timer_ = 0;
private int recalc_timer_ = 0;
private int accumulated_power_ = 0;
private int current_feedin_ = 0;
public static void on_config(int peak_power_per_tick)
{
peak_power_per_tick_ = peak_power_per_tick;
ModEngineersDecor.logger.info("Config small solar panel: Peak production:" + peak_power_per_tick_ + "/tick");
}
//------------------------------------------------------------------------------------------------------------------
public BTileEntity()

View file

@ -38,6 +38,34 @@ import java.util.Random;
public class BlockDecorTreeCutter extends BlockDecorDirectedHorizontal
{
//--------------------------------------------------------------------------------------------------------------------
// Config
//--------------------------------------------------------------------------------------------------------------------
public static final int IDLE_TICK_INTERVAL = 40;
public static final int TICK_INTERVAL = 5;
public static final int BOOST_FACTOR = 6;
public static final int DEFAULT_BOOST_ENERGY = 64;
public static final int DEFAULT_CUTTING_TIME_NEEDED = 60; // 60 secs, so that people don't come to the bright idea to carry one with them.
private static int energy_max = DEFAULT_BOOST_ENERGY * 20;
private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY;
private static int cutting_time_needed = 20 * DEFAULT_CUTTING_TIME_NEEDED;
private static boolean requires_power = false;
public static void on_config(int boost_energy_per_tick, int cutting_time_seconds, boolean power_required)
{
boost_energy_consumption = TICK_INTERVAL * MathHelper.clamp(boost_energy_per_tick, 16, 512);
energy_max = Math.max(boost_energy_consumption * 10, 10000);
cutting_time_needed = 20 * MathHelper.clamp(cutting_time_seconds, 10, 240);
requires_power = power_required;
ModEngineersDecor.logger.info("Config tree cutter: Boost energy consumption:" + boost_energy_consumption + "rf/t" + (requires_power?" (power required for operation) ":"") + ", cutting time " + cutting_time_needed + "t." );
}
//--------------------------------------------------------------------------------------------------------------------
// Block
//--------------------------------------------------------------------------------------------------------------------
public static final PropertyBool ACTIVE = PropertyBool.create("active");
public BlockDecorTreeCutter(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
@ -104,30 +132,11 @@ public class BlockDecorTreeCutter extends BlockDecorDirectedHorizontal
public static class BTileEntity extends TileEntity implements ITickable, IEnergyStorage
{
public static final int IDLE_TICK_INTERVAL = 40;
public static final int TICK_INTERVAL = 5;
public static final int BOOST_FACTOR = 6;
public static final int DEFAULT_BOOST_ENERGY = 64;
public static final int DEFAULT_CUTTING_TIME_NEEDED = 60; // 60 secs, so that people don't come to the bright idea to carry one with them.
private static int energy_max = DEFAULT_BOOST_ENERGY * 20;
private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY;
private static int cutting_time_needed = 20 * DEFAULT_CUTTING_TIME_NEEDED;
private static boolean requires_power = false;
private int tick_timer_;
private int active_timer_;
private int proc_time_elapsed_; // small, not saved in nbt.
private int energy_; // small, not saved in nbt.
public static void on_config(int boost_energy_per_tick, int cutting_time_seconds, boolean power_required)
{
boost_energy_consumption = TICK_INTERVAL * MathHelper.clamp(boost_energy_per_tick, 16, 512);
energy_max = Math.max(boost_energy_consumption * 10, 10000);
cutting_time_needed = 20 * MathHelper.clamp(cutting_time_seconds, 10, 240);
requires_power = power_required;
ModEngineersDecor.logger.info("Config tree cutter: Boost energy consumption:" + boost_energy_consumption + "rf/t" + (requires_power?" (power required for operation) ":"") + ", cutting time " + cutting_time_needed + "t." );
}
public BTileEntity()
{}

View file

@ -22,7 +22,6 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import wile.engineersdecor.blocks.BlockDecorMilker.BTileEntity;
import javax.annotation.Nullable;
import java.util.ArrayList;
@ -400,7 +399,7 @@ public class ModConfig
})
@Config.Name("Block Breaker: Power consumption")
@Config.RangeInt(min=16, max=512)
public int block_breaker_power_consumption = BlockDecorBreaker.BTileEntity.DEFAULT_BOOST_ENERGY;
public int block_breaker_power_consumption = BlockDecorBreaker.DEFAULT_BOOST_ENERGY;
@Config.Comment({
"Defines how much time the Small Block Breaker needs per block hardness, " +
@ -410,7 +409,7 @@ public class ModConfig
})
@Config.Name("Block Breaker: Breaking reluctance")
@Config.RangeInt(min=5, max=50)
public int block_breaker_reluctance = BlockDecorBreaker.BTileEntity.DEFAULT_BREAKING_RELUCTANCE;
public int block_breaker_reluctance = BlockDecorBreaker.DEFAULT_BREAKING_RELUCTANCE;
@Config.Comment({
"Defines how much time the Small Block Breaker needs at least, better said it's an offset: " +
@ -420,7 +419,7 @@ public class ModConfig
})
@Config.Name("Block Breaker: Min breaking time")
@Config.RangeInt(min=10, max=100)
public int block_breaker_min_breaking_time = BlockDecorBreaker.BTileEntity.DEFAULT_MIN_BREAKING_TIME;
public int block_breaker_min_breaking_time = BlockDecorBreaker.DEFAULT_MIN_BREAKING_TIME;
@Config.Comment({
"Defines if the Small Block Breaker does not work without RF power."
@ -434,7 +433,7 @@ public class ModConfig
})
@Config.Name("Tree Cutter: Power consumption")
@Config.RangeInt(min=16, max=512)
public int tree_cuttter_energy_consumption = BlockDecorTreeCutter.BTileEntity.DEFAULT_BOOST_ENERGY;
public int tree_cuttter_energy_consumption = BlockDecorTreeCutter.DEFAULT_BOOST_ENERGY;
@Config.Comment({
"Defines how much time the Small Tree Cutter needs to cut a tree without RF power. " +
@ -443,7 +442,7 @@ public class ModConfig
})
@Config.Name("Tree Cutter: Cutting time")
@Config.RangeInt(min=10, max=240)
public int tree_cuttter_cutting_time_needed = BlockDecorTreeCutter.BTileEntity.DEFAULT_CUTTING_TIME_NEEDED;
public int tree_cuttter_cutting_time_needed = BlockDecorTreeCutter.DEFAULT_CUTTING_TIME_NEEDED;
@Config.Comment({
"Defines if the Small Tree Cutter does not work without RF power."
@ -459,7 +458,7 @@ public class ModConfig
})
@Config.Name("Milker: Power consumption")
@Config.RangeInt(min=0, max=128)
public int milker_energy_consumption = BTileEntity.DEFAULT_ENERGY_CONSUMPTION;
public int milker_energy_consumption = BlockDecorMilker.DEFAULT_ENERGY_CONSUMPTION;
}
@SuppressWarnings("unused")
@ -612,16 +611,16 @@ public class ModConfig
public static final void apply()
{
BlockDecorFurnace.BTileEntity.on_config(tweaks.furnace_smelting_speed_percent, tweaks.furnace_fuel_efficiency_percent, tweaks.furnace_boost_energy_consumption);
BlockDecorFurnace.on_config(tweaks.furnace_smelting_speed_percent, tweaks.furnace_fuel_efficiency_percent, tweaks.furnace_boost_energy_consumption);
BlockDecorChair.on_config(optout.without_chair_sitting, optout.without_mob_chair_sitting, tweaks.chair_mob_sitting_probability_percent, tweaks.chair_mob_standup_probability_percent);
BlockDecorLadder.on_config(optout.without_ladder_speed_boost);
BlockDecorCraftingTable.on_config(optout.without_crafting_table_history, false, tweaks.with_crafting_quickmove_buttons, tweaks.without_crafting_mouse_scrolling);
BlockDecorPipeValve.on_config(tweaks.pipevalve_max_flowrate, tweaks.pipevalve_redstone_slope);
BlockDecorFurnaceElectrical.BTileEntity.on_config(tweaks.e_furnace_speed_percent, tweaks.e_furnace_power_consumption, false);
BlockDecorSolarPanel.BTileEntity.on_config(tweaks.solar_panel_peak_power);
BlockDecorBreaker.BTileEntity.on_config(tweaks.block_breaker_power_consumption, tweaks.block_breaker_reluctance, tweaks.block_breaker_min_breaking_time, tweaks.block_breaker_requires_power);
BlockDecorTreeCutter.BTileEntity.on_config(tweaks.tree_cuttter_energy_consumption, tweaks.tree_cuttter_cutting_time_needed, tweaks.tree_cuttter_requires_power);
BlockDecorMilker.BTileEntity.on_config(tweaks.milker_energy_consumption);
BlockDecorFurnaceElectrical.on_config(tweaks.e_furnace_speed_percent, tweaks.e_furnace_power_consumption, false);
BlockDecorSolarPanel.on_config(tweaks.solar_panel_peak_power, 128);
BlockDecorBreaker.on_config(tweaks.block_breaker_power_consumption, tweaks.block_breaker_reluctance, tweaks.block_breaker_min_breaking_time, tweaks.block_breaker_requires_power);
BlockDecorTreeCutter.on_config(tweaks.tree_cuttter_energy_consumption, tweaks.tree_cuttter_cutting_time_needed, tweaks.tree_cuttter_requires_power);
BlockDecorMilker.on_config(tweaks.milker_energy_consumption);
BlockDecorPlacer.BTileEntity.on_config();
{
// Check if the config is already synchronized or has to be synchronised.

View file

@ -5,4 +5,4 @@ version_minecraft=1.14.4
version_forge_minecraft=1.14.4-28.2.3
version_fml_mappings=20190719-1.14.3
version_jei=1.14.4:6.0.0.10
version_engineersdecor=1.1.0
version_engineersdecor=1.1.1-b1

View file

@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.14.4.
## Version history
~ v1.1.1-b1 [F]
-------------------------------------------------------------------
- v1.1.0 [R] Release build v1.1.0. Changes:
* GUI button/slider tooltips added (1.5s delay).

View file

@ -5,4 +5,4 @@ version_minecraft=1.15.2
version_forge_minecraft=1.15.2-31.2.20
version_fml_mappings=20200514-1.15.1
version_jei=1.15.2:6.0.0.2
version_engineersdecor=1.1.0
version_engineersdecor=1.1.1-b1

View file

@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.15.1.
## Version history
~ v1.1.1-b1 [F]
-------------------------------------------------------------------
- v1.1.0 [R] Release build v1.1.0. Changes:
* GUI button/slider tooltips added (1.5s delay).

View file

@ -10,7 +10,7 @@
c.gradle_property_version_forge = function() { return "version_forge"; }
c.project_download_inet_page = function() { return "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/"; }
c.options = {
// without_ref_repository_check: true
without_ref_repository_check: true
};
c.languages = {
"en_us": { code:"en_us", name:"English", region:"United States" },

View file

@ -2,13 +2,14 @@
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"promos": {
"1.12.2-recommended": "1.1.0",
"1.12.2-latest": "1.1.0",
"1.12.2-latest": "1.1.1-b1",
"1.14.4-recommended": "1.1.0",
"1.14.4-latest": "1.1.0",
"1.15.2-recommended": "1.1.0",
"1.15.2-latest": "1.1.0"
},
"1.12.2": {
"1.1.1-b1": "[F] Fixed java related startup problem (issue #103, thx madmax3004, erebus42, StormbringerGTX, teagan75).",
"1.1.0": "[R] Maintenance Release build v1.1.0. Changes: * Compatibility fixes. * E-Furnace speed selection bug fixed. * Block Placer improvements. ~ v1.1.0-b3 [/] Version skipped for 1.12.2.",
"1.1.0-b2": "[F] Block Placer defers placements if collidable entities are in the way (issue #98, thx DrakoAlcarus).\n[F] Added Block verification during TE ticking in case devices are moved (issue #101, thx D0CTOR-ZED).",
"1.1.0-b1": "[F] Fixed Electrical Furnace speed sanitizing bug (issue #97, thx therobotmenace).\n[M] Changed Labeled Crate Nesting to circumvent server crashing in combination with the Sponge mod.",