From 1938f34faf34282bbbd0d477df5c5b10f833b7f2 Mon Sep 17 00:00:00 2001 From: stfwi Date: Wed, 13 Nov 2019 18:09:53 +0100 Subject: [PATCH] Gas concrete added (1.12), RF-required config options added (issue #63). Clinker recipe yield increased. Item-on-ground item display fixed (issue #61). Sign bounding box orientations fixed (issue #62). --- 1.12/meta/update.json | 3 +- 1.12/readme.md | 5 +- .../java/wile/engineersdecor/ModContent.java | 39 +- .../blocks/BlockDecorMilker.java | 544 ++++++++++++++++++ .../blocks/BlockDecorMineralSmelter.java | 4 +- .../engineersdecor/blocks/BlockDecorTest.java | 56 +- .../wile/engineersdecor/detail/ExtItems.java | 3 + .../engineersdecor/detail/ModAuxiliaries.java | 21 +- .../wile/engineersdecor/detail/ModConfig.java | 36 +- .../wile/engineersdecor/detail/ModTesrs.java | 1 + .../blockstates/small_milking_machine.json | 13 + .../assets/engineersdecor/lang/en_us.lang | 12 +- .../assets/engineersdecor/lang/ru_ru.lang | 12 +- .../assets/engineersdecor/lang/zh_cn.lang | 9 +- .../device/small_milking_machine_model.json | 271 +++++++++ .../small_milking_machine_model_active.json | 271 +++++++++ ...all_milking_machine_recipe_standalone.json | 37 ++ .../small_milking_machine_recipe.json | 41 ++ .../clinker_brick_block_recipe.json | 2 +- 1.14/gradle.properties | 2 +- 1.14/meta/update.json | 3 +- 1.14/readme.md | 3 + .../java/wile/engineersdecor/ModContent.java | 10 +- .../blocks/BlockDecorBreaker.java | 21 +- .../blocks/BlockDecorTreeCutter.java | 29 +- .../engineersdecor/detail/ModAuxiliaries.java | 21 +- .../wile/engineersdecor/detail/ModConfig.java | 133 ++++- .../assets/engineersdecor/lang/en_us.json | 8 +- .../assets/engineersdecor/lang/ru_ru.json | 3 + .../assets/engineersdecor/lang/zh_cn.json | 3 + .../independent/clinker_brick_recipe.json | 2 +- meta/update.json | 6 +- 32 files changed, 1525 insertions(+), 99 deletions(-) create mode 100644 1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorMilker.java create mode 100644 1.12/src/main/resources/assets/engineersdecor/blockstates/small_milking_machine.json create mode 100644 1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model.json create mode 100644 1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model_active.json create mode 100644 1.12/src/main/resources/assets/engineersdecor/recipes/alternative/small_milking_machine_recipe_standalone.json create mode 100644 1.12/src/main/resources/assets/engineersdecor/recipes/dependent/small_milking_machine_recipe.json diff --git a/1.12/meta/update.json b/1.12/meta/update.json index 62cce10..2d6c4ce 100644 --- a/1.12/meta/update.json +++ b/1.12/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.12.2": { + "1.0.16-b2": "[A] Added Gas Concrete (including slab, wall, stairs, and slab slice).\n[A] Added explicit RF-power-required option for Small Block Breaker and Small Tree Cutter (issue #63).\n[M] Increased clinker brick recipe yield to 8 for the master builders needs.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Fixed sign bounding boxes (issue #62, thx angela/themartin).", "1.0.16-b1": "[A] Added Fluid Collection Funnel.\n[A] Added config opt-outs for Breaker, Placer, Fluid Funnel, Mineral Smelter.\n[A] Added configs tweaks for Small Block Breaker and Small Tree Cutter (cffr#185).\n[F] Fixed Block Placer discarding item metadata/variants while placing (issue #60).\n[F] Fixed Block Breaker duping empty shulker boxes, model updated.", "1.0.15": "[R] Release based on v1.0.15-b2. Release-to-release changes: * Added Small Block Breaker * Small Tree Cutter fixes and compatability improved. * Crafting table compat fixes.\n[M] Small Tree Cutter log detection bug fixed (issue #59).\n[M] Small Tree Cutter supports Menril chopping (issue #54).", "1.0.15-b2": "[A] Added Small Block Breaker\n[M] Crafting Table: Allowing NBT \"Damage\" mismatch only items that are declared damagable (issue #56).\n[M] Tree Cutter: Loosened the strict mod namespace requirement for Dynamic Trees log detection (issue #52) to enable checking DT compat mod log blocks.", @@ -67,6 +68,6 @@ }, "promos": { "1.12.2-recommended": "1.0.15", - "1.12.2-latest": "1.0.16-b1" + "1.12.2-latest": "1.0.16-b2" } } \ No newline at end of file diff --git a/1.12/readme.md b/1.12/readme.md index 3382696..2c77095 100644 --- a/1.12/readme.md +++ b/1.12/readme.md @@ -10,8 +10,11 @@ Mod sources for Minecraft version 1.12.2. ---- ## Version history - ~ v1.0.16-b2 [A] Added Gas Concrete (including slab, wall, stairs, and slab slice). + - v1.0.16-b2 [A] Added Gas Concrete (including slab, wall, stairs, and slab slice). + [A] Added explicit RF-power-required option for Small Block Breaker and Small Tree Cutter (issue #63). + [M] Increased clinker brick recipe yield to 8 for the master builders needs. [F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint). + [F] Fixed sign bounding boxes (issue #62, thx angela/themartin). - v1.0.16-b1 [A] Added Fluid Collection Funnel. [A] Added config opt-outs for Breaker, Placer, Fluid Funnel, Mineral Smelter. diff --git a/1.12/src/main/java/wile/engineersdecor/ModContent.java b/1.12/src/main/java/wile/engineersdecor/ModContent.java index e50528b..6138e72 100644 --- a/1.12/src/main/java/wile/engineersdecor/ModContent.java +++ b/1.12/src/main/java/wile/engineersdecor/ModContent.java @@ -143,6 +143,13 @@ public class ModContent ModAuxiliaries.getPixeledAABB(1.1,0,1.1, 14.9,16,14.9) ); + public static final BlockDecorMilker SMALL_MILKING_MACHINE = new BlockDecorMilker( + "small_milking_machine", + BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_CUTOUT|BlockDecor.CFG_ELECTRICAL, + Material.IRON, 1f, 15f, SoundType.METAL, + ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,13) + ); + public static final BlockDecorSolarPanel SMALL_SOLAR_PANEL = new BlockDecorSolarPanel( "small_solar_panel", BlockDecor.CFG_LOOK_PLACEMENT, @@ -355,51 +362,51 @@ public class ModContent public static final BlockDecorDirected SIGN_MODLOGO = new BlockDecorDirected( "sign_decor", - BlockDecor.CFG_CUTOUT|BlockDecor.CFG_OPPOSITE_PLACEMENT|(1<= 1000) { + final ItemStack insert_stack = out_stack.copy(); + ItemStack remainder = ItemHandlerHelper.insertItemStacked(player_inventory, insert_stack, false); + if(remainder.getCount() < insert_stack.getCount()) { + te.drain(1000); + in_stack.shrink(1); + drained = true; + if(remainder.getCount() > 0) { + final EntityItem ei = new EntityItem(world, player.posX, player.posY + 0.5, player.posZ, remainder); + ei.setPickupDelay(40); + ei.motionX = 0; + ei.motionZ = 0; + world.spawnEntity(ei); + } + } + } + if(drained) { + world.playSound(null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 0.8f, 1f); + } + return true; + } + + @Nullable + private BTileEntity getTe(World world, BlockPos pos) + { final TileEntity te=world.getTileEntity(pos); return (!(te instanceof BTileEntity)) ? (null) : ((BTileEntity)te); } + + //-------------------------------------------------------------------------------------------------------------------- + // Tile entity + //-------------------------------------------------------------------------------------------------------------------- + + public static class BTileEntity extends TileEntity implements ITickable, ICapabilityProvider, IEnergyStorage + { + public static final int TICK_INTERVAL = 80; + public static final int PROCESSING_TICK_INTERVAL = 10; + public static final int TANK_CAPACITY = 12000; + public static final int MAX_MILKING_TANK_LEVEL = TANK_CAPACITY-500; + public static final int MAX_ENERGY_BUFFER = 16000; + public static final int MAX_ENERGY_TRANSFER = 512; + public static final int DEFAULT_ENERGY_CONSUMPTION = 16; + private static final EnumFacing FLUID_TRANSFER_DIRECTRIONS[] = {EnumFacing.DOWN,EnumFacing.EAST,EnumFacing.SOUTH,EnumFacing.WEST,EnumFacing.NORTH}; + private static final ItemStack BUCKET_STACK = new ItemStack(Items.BUCKET); + private enum MilkingState { IDLE, PICKED, COMING, POSITIONING, MILKING, LEAVING, WAITING } + + private static FluidStack milk_fluid_ = new FluidStack(FluidRegistry.WATER, 0); + private static int energy_consumption = DEFAULT_ENERGY_CONSUMPTION; + private int tick_timer_; + private int energy_stored_; + private int tank_level_ = 0; + private UUID tracked_cow_ = null; + private MilkingState state_ = MilkingState.IDLE; + private int state_timeout_ = 0; + private int state_timer_ = 0; + private BlockPos tracked_cow_original_position_ = null; + + public static void on_config(int energy_consumption_per_tick, int heatup_per_second) + { + energy_consumption = MathHelper.clamp(energy_consumption_per_tick, 0, 4096); + ModEngineersDecor.logger.info("Config milker energy consumption:" + energy_consumption + "rf/t"); + } + + public BTileEntity() + { reset(); } + + public void reset() + { + tank_level_ = 0; + energy_stored_ = 0; + tick_timer_ = 0; + tracked_cow_ = null; + state_ = MilkingState.IDLE; + state_timeout_ = 0; + } + + public NBTTagCompound destroy_getnbt() + { + final UUID cowuid = tracked_cow_; + NBTTagCompound nbt = new NBTTagCompound(); + writenbt(nbt, false); reset(); + if(cowuid == null) return nbt; + world.getEntitiesWithinAABB(EntityCow.class, new AxisAlignedBB(pos).grow(16, 16, 16), e->e.getPersistentID().equals(cowuid)).forEach(e->e.setNoAI(false)); + return nbt; + } + + public void readnbt(NBTTagCompound nbt, boolean update_packet) + { + tank_level_ = nbt.getInteger("tank"); + energy_stored_ = nbt.getInteger("energy"); + } + + protected void writenbt(NBTTagCompound nbt, boolean update_packet) + { + if(tank_level_ > 0) nbt.setInteger("tank", tank_level_); + if(energy_stored_ > 0) nbt.setInteger("energy", energy_stored_ ); + } + + private IFluidHandler fluid_handler() + { return fluid_handler_; } + + private int fluid_level() + { return MathHelper.clamp(tank_level_, 0, TANK_CAPACITY); } + + private void drain(int amount) + { tank_level_ = MathHelper.clamp(tank_level_-1000, 0, TANK_CAPACITY); markDirty(); } + + // TileEntity ------------------------------------------------------------------------------ + + @Override + public boolean shouldRefresh(World world, BlockPos pos, IBlockState os, IBlockState ns) + { return (os.getBlock() != ns.getBlock()) || (!(ns.getBlock() instanceof BlockDecorMilker)); } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { super.readFromNBT(nbt); readnbt(nbt, false); } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { super.writeToNBT(nbt); writenbt(nbt, false); return nbt; } + + // IEnergyStorage ---------------------------------------------------------------------------- + + @Override + public boolean canExtract() + { return false; } + + @Override + public boolean canReceive() + { return true; } + + @Override + public int getMaxEnergyStored() + { return MAX_ENERGY_BUFFER; } + + @Override + public int getEnergyStored() + { return energy_stored_; } + + @Override + public int extractEnergy(int maxExtract, boolean simulate) + { return 0; } + + @Override + public int receiveEnergy(int maxReceive, boolean simulate) + { + if(energy_stored_ >= MAX_ENERGY_BUFFER) return 0; + int n = Math.min(maxReceive, (MAX_ENERGY_BUFFER - energy_stored_)); + if(n > MAX_ENERGY_TRANSFER) n = MAX_ENERGY_TRANSFER; + if(!simulate) {energy_stored_ += n; markDirty(); } + return n; + } + + // IFluidHandler / IFluidTankProperties --------------------------------------------------------------------- + + private static class BFluidHandler implements IFluidHandler, IFluidTankProperties + { + private final BTileEntity te; + private final IFluidTankProperties[] props_ = {this}; + BFluidHandler(BTileEntity te) { this.te=te; } + @Override @Nullable public FluidStack getContents() { return new FluidStack(milk_fluid_, te.fluid_level()); } + @Override public IFluidTankProperties[] getTankProperties() { return props_; } + @Override public int fill(FluidStack resource, boolean doFill) { return 0; } + @Override public int getCapacity() { return TANK_CAPACITY; } + @Override public boolean canFill() { return false; } + @Override public boolean canDrain() { return (milk_fluid_.amount > 0); } + @Override public boolean canFillFluidType(FluidStack fs) { return false; } + @Override public boolean canDrainFluidType(FluidStack fs) { return fs.isFluidEqual(milk_fluid_); } + + @Override @Nullable public FluidStack drain(FluidStack resource, boolean doDrain) + { return (!resource.isFluidEqual(milk_fluid_)) ? (null) : drain(resource.amount, doDrain); } + + @Override @Nullable public FluidStack drain(int maxDrain, boolean doDrain) + { + if(te.fluid_level() <= 0) return null; + FluidStack fs = milk_fluid_.copy(); + fs.amount = Math.min(fs.amount, te.fluid_level()); + if(doDrain) te.tank_level_ -= fs.amount; + return fs; + } + } + + private final BFluidHandler fluid_handler_ = new BFluidHandler(this); + + // ICapabilityProvider --------------------------------------------------------------------------- + + @Override + public boolean hasCapability(Capability cap, EnumFacing facing) + { + if((cap==CapabilityEnergy.ENERGY) && (energy_consumption>0)) return true; + if((cap==CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) && (milk_fluid_.amount>0)) return true; + return super.hasCapability(cap, facing); + } + + @Override + @SuppressWarnings("unchecked") + @Nullable + public T getCapability(Capability capability, @Nullable EnumFacing facing) + { + if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) { + return (T)fluid_handler_; + } else if(capability == CapabilityEnergy.ENERGY) { + return (T)this; + } else { + return super.getCapability(capability, facing); + } + } + + // ITickable ------------------------------------------------------------------------------------ + + private void log(String s) + {} // may be enabled with config + + private ItemStack milk_filled_container_item(ItemStack stack) + { + // Returns out stack for input stack size == 1 (convert one item of the stack). + if(stack.isItemEqualIgnoreDurability(BTileEntity.BUCKET_STACK)) return new ItemStack(Items.MILK_BUCKET); + if((ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE!=null) && stack.getItem().equals(Items.GLASS_BOTTLE)) return new ItemStack(ExtItems.BOTTLED_MILK_BOTTLE_DRINKLABLE); + return ItemStack.EMPTY; + } + + private void fill_adjacent_inventory_item_containers(EnumFacing block_facing) + { + // Check inventory existence, back to down if possible, otherwise sort back into same inventory. + IInventory src, dst; + { + TileEntity te_src = world.getTileEntity(pos.offset(block_facing)); + TileEntity te_dst = world.getTileEntity(pos.down()); + if(!(te_src instanceof IInventory)) te_src = null; + if(!(te_dst instanceof IInventory)) te_dst = null; + if((te_src==null)) te_src = te_dst; + if((te_dst==null)) te_dst = te_src; + if((te_src==null) || (te_dst==null)) return; + src = (IInventory)te_src; + dst = (IInventory)te_dst; + } + + /// @todo --> hier weitermachen + } + + private boolean milking_process() + { + if((tracked_cow_ == null) && (fluid_level() >= MAX_MILKING_TANK_LEVEL)) return false; // nothing to do + EntityCow cow = null; + { + final List cows = world.getEntitiesWithinAABB(EntityCow.class, new AxisAlignedBB(pos).grow(16, 3, 16), + e->(((tracked_cow_==null) && (!e.isChild() && !e.isInLove()))||(e.getPersistentID().equals(tracked_cow_))) + ); + if(cows.size() == 1) { + cow = cows.get(0); // tracked or only one + } else if(cows.size() > 1) { + cow = cows.get(world.rand.nextInt(cows.size()-1)); // pick one + } + } + if((state_ != MilkingState.IDLE) && ((state_timeout_ -= PROCESSING_TICK_INTERVAL) <= 0)) { log("Cow motion timeout"); cow = null; } + if((cow == null) || (cow.isDead) || ((tracked_cow_ != null) && (!tracked_cow_.equals(cow.getPersistentID())))) { tracked_cow_ = null; cow = null; } + if(tracked_cow_ == null) state_ = MilkingState.IDLE; + if(cow == null) return false; // retry next cycle + final EnumFacing facing = world.getBlockState(getPos()).getValue(FACING).getOpposite(); + tick_timer_ = PROCESSING_TICK_INTERVAL; + state_timer_ -= PROCESSING_TICK_INTERVAL; + if(state_timer_ > 0) return false; + switch(state_) { + case IDLE: { + final List blocking_entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos).grow(1, 2, 1)); + if(blocking_entities.size() > 0) return false; // an entity is blocking the way + if(cow.getLeashed() || cow.isChild() || cow.isInLove() || (!cow.onGround) || cow.isBeingRidden() || cow.isSprinting()) return false; + tracked_cow_ = cow.getPersistentID(); + state_ = MilkingState.PICKED; + state_timeout_ = 200; + tracked_cow_original_position_ = cow.getPosition(); + log("Idle: Picked cow" + tracked_cow_); + return true; + } + case PICKED: { + if(cow.hasPath()) return true; + BlockPos p = getPos().offset(facing).offset(facing.rotateY()); + if(!cow.getNavigator().tryMoveToXYZ(p.getX(), p.getY(), p.getZ(),1.0)) { + log("Picked: No path"); + tracked_cow_ = null; + return false; + } + state_ = MilkingState.COMING; + state_timeout_ = 300; // 15s should be enough + log("Picked: coming"); + return true; + } + case COMING: { + BlockPos p = getPos().offset(facing).offset(facing.rotateY()); + if(cow.getPosition().distanceSq(p) > 1) { + if(cow.hasPath()) return true; + if(!cow.getNavigator().tryMoveToXYZ(p.getX(), p.getY(), p.getZ(),1.0)) { + log("Coming: lost path"); + tracked_cow_ = null; + return false; + } else { + state_timeout_ -= 100; + } + } else { + BlockPos next_p = getPos().offset(facing); + if(!cow.getNavigator().tryMoveToXYZ(next_p.getX(), next_p.getY(), next_p.getZ(), 1.0)) { + log("Coming: No path"); + tracked_cow_ = null; + return false; + } + log("Coming: position reached"); + state_ = MilkingState.POSITIONING; + state_timeout_ = 100; // 5s + } + return true; + } + case POSITIONING: { + BlockPos p = getPos().offset(facing); + if(cow.getPosition().distanceSq(p) > 0) { + if(cow.hasPath()) return true; + if(!cow.getNavigator().tryMoveToXYZ(p.getX(), p.getY(), p.getZ(), 1.0)) { + log("Positioning: lost path"); + } else { + state_timeout_ -= 200; + } + tracked_cow_ = null; + return false; + } + cow.setNoAI(true); + cow.move(MoverType.SELF, p.getX()+0.5-cow.posX, 0,p.getZ()+0.5-cow.posZ); + world.playSound(null, pos, SoundEvents.ENTITY_COW_MILK, SoundCategory.BLOCKS, 0.5f, 1f); + state_timeout_ = 600; + state_ = MilkingState.MILKING; + state_timer_ = 30; + log("Positioning: start milking"); + return true; + } + case MILKING: { + tank_level_ = MathHelper.clamp(tank_level_+1000, 0, TANK_CAPACITY); + state_timeout_ = 600; + state_ = MilkingState.LEAVING; + state_timer_ = 20; + BlockPos p = (tracked_cow_original_position_ != null) ? (tracked_cow_original_position_) : getPos().offset(facing.rotateYCCW(),2); + cow.setNoAI(false); + cow.getNavigator().tryMoveToXYZ(p.getX(), p.getY(), p.getZ(), 1.0); + log("Milking: done, leave"); + return true; + } + case LEAVING: { + BlockPos p = (tracked_cow_original_position_ != null) ? (tracked_cow_original_position_) : getPos().offset(facing.rotateYCCW(),2); + cow.getNavigator().tryMoveToXYZ(p.getX(), p.getY(), p.getZ(), 1.0); + state_timeout_ = 600; + state_timer_ = 500; + state_ = MilkingState.WAITING; + log("Leaving: process done"); + return true; + } + case WAITING: { + return true; // wait for the timeout to kick in until starting with the next. + } + default: + tracked_cow_ = null; + } + return (tracked_cow_ != null); + } + + @Override + public void update() + { + if((world.isRemote) || ((--tick_timer_ > 0))) return; + tick_timer_ = TICK_INTERVAL; + final IBlockState block_state = world.getBlockState(pos); + boolean dirty = false; + // Track and milk cows + if(milking_process()) dirty = true; + // Fluid transfer + if((milk_fluid_.amount > 0) && (fluid_level() >= 1000)) { + for(EnumFacing facing: FLUID_TRANSFER_DIRECTRIONS) { + IFluidHandler fh = FluidUtil.getFluidHandler(world, pos.offset(facing), facing.getOpposite()); + if(fh == null) continue; + FluidStack fs = milk_fluid_.copy(); + fs.amount = 1000; + int nfilled = MathHelper.clamp(fh.fill(fs, true), 0, 1000); + if(nfilled <= 0) continue; + tank_level_ -= nfilled; + if(tank_level_ < 0) tank_level_ = 0; + dirty = true; + break; + } + } + // Adjacent inventory update, only done just after milking to prevent waste of server cpu. + if(dirty && (fluid_level() >= 1000)) { + fill_adjacent_inventory_item_containers(block_state.getValue(FACING)); + } + // State update + IBlockState new_state = block_state.withProperty(FILLED, fluid_level()>0).withProperty(ACTIVE, state_==MilkingState.MILKING); + if(block_state != new_state) world.setBlockState(pos, new_state,1|2|16); + if(dirty) markDirty(); + } + } + +} diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorMineralSmelter.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorMineralSmelter.java index 6a733be..1000741 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorMineralSmelter.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorMineralSmelter.java @@ -9,9 +9,8 @@ */ package wile.engineersdecor.blocks; -import net.minecraft.block.state.BlockFaceShape; -import net.minecraft.world.IBlockAccess; import wile.engineersdecor.ModEngineersDecor; +import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.Block; @@ -19,6 +18,7 @@ import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.world.World; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.Explosion; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.EntityLivingBase; diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorTest.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorTest.java index 1b2655a..9d1d83e 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorTest.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorTest.java @@ -8,20 +8,25 @@ */ package wile.engineersdecor.blocks; + + import wile.engineersdecor.detail.ModAuxiliaries; +import net.minecraft.world.World; import net.minecraft.block.state.IBlockState; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.ITickable; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraft.block.material.Material; -import net.minecraft.block.SoundType; import net.minecraft.util.math.AxisAlignedBB; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.List; +import java.util.UUID; public class BlockDecorTest extends BlockDecorDirected implements ModAuxiliaries.IExperimentalFeature @@ -54,9 +59,8 @@ public class BlockDecorTest extends BlockDecorDirected implements ModAuxiliaries public static class BTileEntity extends TileEntity implements ITickable { - public static double increment = 0.008; - private double progress_ = 0; - private double incr_ = increment; + private static int tick_interval_ = 40; + private int tick_timer_ = 0; public BTileEntity() {} @@ -65,29 +69,45 @@ public class BlockDecorTest extends BlockDecorDirected implements ModAuxiliaries public boolean shouldRefresh(World world, BlockPos pos, IBlockState os, IBlockState ns) { return (os.getBlock() != ns.getBlock()) || (!(ns.getBlock() instanceof BlockDecorTest)); } + //------------------------------------------------------------------------------------------------------------------ + + public static double increment = 0.008; + private boolean TESR_TEST = false; + private double progress_ = -1; + private double incr_ = increment; + public double progress() { return progress_; } + private void tesr_basic_test(boolean reset) + { + if(!TESR_TEST || !world.isRemote) return; + if(reset) { + progress_ = 0; incr_ = increment; + } else { + progress_ += incr_; + if(progress_ < 0) { + incr_ = increment; + progress_ = 0; + } else if(progress_ > 1.0) { + progress_ = 1.0; + incr_ = -increment; + } + } + } - public double progress() - { return progress_; } + //------------------------------------------------------------------------------------------------------------------ public boolean clicked(EntityPlayer player, boolean lclicked) { - progress_ = 0; - incr_ = increment; + tesr_basic_test(true); return true; } @Override public void update() { - progress_ += incr_; - if(progress_ < 0) { - incr_ = increment; - progress_ = 0; - } else if(progress_ > 1.0) { - progress_ = 1.0; - incr_ = -increment; - } + tesr_basic_test(false); + if(++tick_timer_ < tick_interval_) return; + tick_timer_ = tick_interval_; } } } diff --git a/1.12/src/main/java/wile/engineersdecor/detail/ExtItems.java b/1.12/src/main/java/wile/engineersdecor/detail/ExtItems.java index 0e6ac5e..20b68a2 100644 --- a/1.12/src/main/java/wile/engineersdecor/detail/ExtItems.java +++ b/1.12/src/main/java/wile/engineersdecor/detail/ExtItems.java @@ -16,6 +16,9 @@ public class ExtItems @GameRegistry.ObjectHolder("immersiveengineering:metal_device1") public static final Item IE_EXTERNAL_HEATER = null; + @GameRegistry.ObjectHolder("bottledmilk:milk_bottle_drinkable") + public static final Item BOTTLED_MILK_BOTTLE_DRINKLABLE = null; + public static final void onPostInit() {} } diff --git a/1.12/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java b/1.12/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java index 8ae2358..9c46618 100644 --- a/1.12/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java +++ b/1.12/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java @@ -48,10 +48,27 @@ public class ModAuxiliaries final String ft = tr.getFormattedText(); if(ft.contains("${")) { // Non-recursive, non-argument lang file entry cross referencing. - Pattern pt = Pattern.compile("\\$\\{([\\w\\.]+)\\}"); + Pattern pt = Pattern.compile("\\$\\{([^}]+)\\}"); Matcher mt = pt.matcher(ft); StringBuffer sb = new StringBuffer(); - while(mt.find()) mt.appendReplacement(sb, (new TextComponentTranslation(mt.group(1))).getFormattedText().trim()); + while(mt.find()) { + String m = mt.group(1); + if(m.contains("?")) { + String[] kv = m.split("\\?", 2); + String key = kv[0].trim(); + boolean not = key.startsWith("!"); + if(not) key = key.replaceFirst("!", ""); + m = kv[1].trim(); + if(!ModConfig.getServerConfig().hasKey(key)) { + m = ""; + } else { + boolean r = ModConfig.getServerConfig().getBoolean(key); + if(not) r = !r; + if(!r) m = ""; + } + } + mt.appendReplacement(sb, (new TextComponentTranslation(m)).getFormattedText().trim()); + } mt.appendTail(sb); return sb.toString(); } else { diff --git a/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java b/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java index 681851c..ab0c4c4 100644 --- a/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java +++ b/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java @@ -12,10 +12,11 @@ package wile.engineersdecor.detail; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.blocks.*; -import net.minecraftforge.common.config.Config; -import net.minecraftforge.common.config.ConfigManager; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.block.Block; import net.minecraft.item.Item; +import net.minecraftforge.common.config.Config; +import net.minecraftforge.common.config.ConfigManager; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -211,6 +212,11 @@ public class ModConfig @Config.RequiresMcRestart public boolean without_mineral_smelter = false; + @Config.Comment({"Disable the Small Mikling Machine."}) + @Config.Name("Without milking machine") + @Config.RequiresMcRestart + public boolean without_milker = false; + @Config.Comment({"Disable directly picking up layers from slabs and slab slices by left clicking while looking up/down."}) @Config.Name("Without slab pickup") public boolean without_direct_slab_pickup = false; @@ -400,6 +406,12 @@ public class ModConfig @Config.RangeInt(min=10, max=100) public int block_breaker_min_breaking_time = BlockDecorBreaker.BTileEntity.DEFAULT_MIN_BREAKING_TIME; + @Config.Comment({ + "Defines if the Small Block Breaker does not work without RF power." + }) + @Config.Name("Block Breaker: Power required") + public boolean block_breaker_requires_power = false; + @Config.Comment({ "Defines how much RF power the Small Tree Cutter requires to magnificently increase the processing speed. " + "The config value can be changed on-the-fly for tuning." @@ -416,6 +428,12 @@ 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; + + @Config.Comment({ + "Defines if the Small Tree Cutter does not work without RF power." + }) + @Config.Name("Tree Cutter: Power required") + public boolean tree_cuttter_requires_power = false; } @SuppressWarnings("unused") @@ -440,6 +458,10 @@ public class ModConfig private static final ArrayList includes_ = new ArrayList(); private static final ArrayList excludes_ = new ArrayList(); + private static final NBTTagCompound server_config_ = new NBTTagCompound(); + + public static final NBTTagCompound getServerConfig() // config that may be synchronized from server to client via net pkg. + { return server_config_; } public static final boolean isWithoutOptOutRegistration() { return (zmisc!=null) && (zmisc.without_optout_registration); } @@ -496,6 +518,7 @@ public class ModConfig if(block instanceof BlockDecorSolarPanel) return optout.without_solar_panel; if(block instanceof BlockDecorFluidFunnel) return optout.without_fluid_funnel; if(block instanceof BlockDecorMineralSmelter) return optout.without_mineral_smelter; + if(block instanceof BlockDecorMilker) return optout.without_milker; if(block instanceof BlockDecorPipeValve) return optout.without_valves; // Type based evaluation where later filters may match, too @@ -537,8 +560,8 @@ public class ModConfig 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); 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, false); - BlockDecorTreeCutter.BTileEntity.on_config(tweaks.tree_cuttter_energy_consumption, tweaks.tree_cuttter_cutting_time_needed, false); + 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); { optout.includes = optout.includes.toLowerCase().replaceAll(ModEngineersDecor.MODID+":", "").replaceAll("[^*_,a-z0-9]", ""); if(!optout.includes.isEmpty()) ModEngineersDecor.logger.info("Pattern includes: '" + optout.includes + "'"); @@ -559,6 +582,11 @@ public class ModConfig if(!excl[i].isEmpty()) excludes_.add(excl[i]); } } + { + // Check if the config is already synchronized or has to be synchronised. + server_config_.setBoolean("tree_cuttter_requires_power", tweaks.tree_cuttter_requires_power); + server_config_.setBoolean("block_breaker_requires_power", tweaks.block_breaker_requires_power); + } } } diff --git a/1.12/src/main/java/wile/engineersdecor/detail/ModTesrs.java b/1.12/src/main/java/wile/engineersdecor/detail/ModTesrs.java index f8adc30..3b44cd4 100644 --- a/1.12/src/main/java/wile/engineersdecor/detail/ModTesrs.java +++ b/1.12/src/main/java/wile/engineersdecor/detail/ModTesrs.java @@ -97,6 +97,7 @@ public class ModTesrs @Override public void render(final BlockDecorTest.BTileEntity te, double x, double y, double z, final float partialTicks, final int destroyStage, final float alpha) { + if(te.progress() < 0) return; renderBlockState(Blocks.SANDSTONE.getDefaultState(), te.getPos(), (new Vec3d(1,1,1)).scale(te.progress()), x,y,z); } diff --git a/1.12/src/main/resources/assets/engineersdecor/blockstates/small_milking_machine.json b/1.12/src/main/resources/assets/engineersdecor/blockstates/small_milking_machine.json new file mode 100644 index 0000000..18f3000 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/blockstates/small_milking_machine.json @@ -0,0 +1,13 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "engineersdecor:device/small_milking_machine_model" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "facing": { "north": {"y":0}, "south": {"y":180}, "west": {"y":-90}, "east": {"y":90} }, + "filled": { "false":{}, "true":{} }, + "active": { "false":{}, "true":{ "model": "engineersdecor:device/small_milking_machine_model_active" } } + } +} diff --git a/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang b/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang index 88af6ee..bff3024 100644 --- a/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang +++ b/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang @@ -9,7 +9,8 @@ engineersdecor.tooltip.hint.extended=§6[§9SHIFT§r More Info§6]§r engineersdecor.tooltip.hint.help=§6[§9CTRL-SHIFT§r Help§6]§r engineersdecor.tooltip.slabpickup.help=§rFast pickup by left-clicking while looking up/down and holding this slab. #----------------------------------------------------------------------------------------------------------- -# Stone/"ceramic material" based blocks +engineersdecor.tooltip.requires_rf_power=Requires RF power. +engineersdecor.tooltip.massive_speed_boost_with_rf_power=Apply RF power to magnificently increase the speed. #----------------------------------------------------------------------------------------------------------- tile.engineersdecor.clinker_brick_block.name=Clinker Brick Block tile.engineersdecor.clinker_brick_block.help=§6A brick block with position dependent texture variations.§r\nLooks slightly darker and more color intensive than the vanilla brick block. @@ -183,7 +184,8 @@ tile.engineersdecor.small_block_breaker.name=Small Block Breaker tile.engineersdecor.small_block_breaker.help=§6Breaks blocks in front of it.§r\n\ Can be disabled by applying a redstone signal. \ The time needed to destroy a block depends on the hardness of that block. \ - Provide RF/FE power to speed up the breaking process (massively). + ${!block_breaker_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power}\ + ${block_breaker_requires_power?engineersdecor.tooltip.requires_rf_power} tile.engineersdecor.small_mineral_smelter.name=Small Mineral Melting Furnace tile.engineersdecor.small_mineral_smelter.help=§6High temperature, high insulation electrical stone melting furnace.§r\n\ Heats up mineral blocks to magma blocks, and finally to lava. Click with a \ @@ -200,7 +202,11 @@ tile.engineersdecor.small_solar_panel.help=§6Produces a small amount of power w tile.engineersdecor.small_tree_cutter.name=Small Tree Cutter tile.engineersdecor.small_tree_cutter.help=§6Chops grown trees in front of it.§r\n\ Does not collect the lumbers. Deactivate with a redstone signal. \ - Provide RF power to boost the cutting speed (takes a long time without power). + ${!tree_cuttter_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power}\ + ${tree_cuttter_requires_power?engineersdecor.tooltip.requires_rf_power} +tile.engineersdecor.small_milking_machine.name=Small Milking Machine +tile.engineersdecor.small_milking_machine.help=§6Frequently attracts and milks cows.§r\n\ + Has an internal fluid tank. Does not feed the animals. Use buckets to retrieve the milk. #----------------------------------------------------------------------------------------------------------- tile.engineersdecor.sign_decor.name=Sign Plate (Engineer's decor) tile.engineersdecor.sign_decor.help=§6This should not be craftable or visible in JEI. Used for creative tab and screenshots. diff --git a/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang b/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang index eb632a0..2510755 100644 --- a/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang +++ b/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang @@ -9,7 +9,8 @@ engineersdecor.tooltip.hint.extended=§6[§9SHIFT§r Больше информа engineersdecor.tooltip.hint.help=§6[§9CTRL-SHIFT§r Помощь§6]§r engineersdecor.tooltip.slabpickup.help=§rБыстрое поднятие щелчком ЛКМ, смотря вверх/вниз с этой плитой в руках. #----------------------------------------------------------------------------------------------------------- -# Stone/"ceramic material" based blocks +engineersdecor.tooltip.requires_rf_power=Requires RF power. +engineersdecor.tooltip.massive_speed_boost_with_rf_power=Apply RF power to magnificently increase the speed. #----------------------------------------------------------------------------------------------------------- tile.engineersdecor.clinker_brick_block.name=Клинкерный кирпич tile.engineersdecor.clinker_brick_block.help=§6Кирпичный блок с вариациями текстуры, зависящими от положения.§r\nВыглядит темнее и интенсивнее, чем Кирпичный блок. @@ -179,7 +180,8 @@ tile.engineersdecor.small_block_breaker.name=Factory Block Breaker #tile.engineersdecor.small_block_breaker.help=§6Breaks blocks in front of it.§r\n\ Can be disabled by applying a redstone signal. \ The time needed to destroy a block depends on the hardness of that block. \ - Provide RF/FE power to speed up the breaking process (massively). + ${!block_breaker_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power}\ + ${block_breaker_requires_power?engineersdecor.tooltip.requires_rf_power} tile.engineersdecor.small_mineral_smelter.name=Small Mineral Melting Furnace #tile.engineersdecor.small_mineral_smelter.help=§6High temperature, high insulation electrical stone melting furnace.§r\n\ Heats up mineral blocks to magma blocks, and finally to lava. Click with a \ @@ -196,7 +198,11 @@ tile.engineersdecor.small_solar_panel.name=Small Solar Panel tile.engineersdecor.small_tree_cutter.name=Small Tree Cutter #tile.engineersdecor.small_tree_cutter.help=§6Chops grown trees in front of it.§r\n\ Does not collect the lumbers. Deactivate with a redstone signal. \ - Provide RF power to boost the cutting speed (takes a long time without power). + ${!tree_cuttter_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power}\ + ${tree_cuttter_requires_power?engineersdecor.tooltip.requires_rf_power} +tile.engineersdecor.small_milking_machine.name=Small Milking Machine +#tile.engineersdecor.small_milking_machine.help=§6Frequently attracts and milks cows.§r\n\ + Has an internal fluid tank. Does not feed the animals. Use buckets to retrieve the milk. #----------------------------------------------------------------------------------------------------------- tile.engineersdecor.sign_decor.name=Табличка с надписью (Логотип Engineer's decor) tile.engineersdecor.sign_decor.help=§Это не должно быть крафтовым или видимым в JEI. Используется для творческой вкладки и скриншотов. diff --git a/1.12/src/main/resources/assets/engineersdecor/lang/zh_cn.lang b/1.12/src/main/resources/assets/engineersdecor/lang/zh_cn.lang index 57396d9..7540d56 100644 --- a/1.12/src/main/resources/assets/engineersdecor/lang/zh_cn.lang +++ b/1.12/src/main/resources/assets/engineersdecor/lang/zh_cn.lang @@ -9,7 +9,8 @@ engineersdecor.tooltip.hint.extended=§6[§9SHIFT§r 查看更多信息§6]§r engineersdecor.tooltip.hint.help=§6[§9CTRL-SHIFT§r 查看帮助§6]§r engineersdecor.tooltip.slabpickup.help=§r手持同类台阶往上/下看时单击该台阶可无需破坏快速拾起。 #----------------------------------------------------------------------------------------------------------- -# Stone/"ceramic material" based blocks +engineersdecor.tooltip.requires_rf_power=Requires RF power. +engineersdecor.tooltip.massive_speed_boost_with_rf_power=Apply RF power to magnificently increase the speed. #----------------------------------------------------------------------------------------------------------- tile.engineersdecor.clinker_brick_block.name=过烧砖块 tile.engineersdecor.clinker_brick_block.help=§6一种放在不同位置贴图有不同变化的砖块。§r\n比原版砖看起来颜色更深,色度也更高。 @@ -182,7 +183,8 @@ tile.engineersdecor.small_block_breaker.name=Factory Block Breaker #tile.engineersdecor.small_block_breaker.help=§6Breaks blocks in front of it.§r\n\ Can be disabled by applying a redstone signal. \ The time needed to destroy a block depends on the hardness of that block. \ - Provide RF/FE power to speed up the breaking process (massively). + ${!block_breaker_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power}\ + ${block_breaker_requires_power?engineersdecor.tooltip.requires_rf_power} tile.engineersdecor.small_mineral_smelter.name=小型矿物熔炼炉 tile.engineersdecor.small_mineral_smelter.help=§6高温、高绝缘电熔石炉。§r\n\ 把矿物块加热成岩浆块,最后变成熔岩。由于\ @@ -197,6 +199,9 @@ tile.engineersdecor.small_tree_cutter.name=小型砍树机 tile.engineersdecor.small_tree_cutter.help=§6砍倒正前方的树。§r\n\ 不收集木材。通入红石信号停用。\ 提供RF来加快砍树速度。(没有的话会很慢。) +tile.engineersdecor.small_milking_machine.name=Small Milking Machine +#tile.engineersdecor.small_milking_machine.help=§6Frequently attracts and milks cows.§r\n\ + Has an internal fluid tank. Does not feed the animals. Use buckets to retrieve the milk. #----------------------------------------------------------------------------------------------------------- tile.engineersdecor.sign_decor.name=标志板(工程师的装饰) tile.engineersdecor.sign_decor.help=§6这不应该可合成或在JEI看到。用于创造模式的物品栏标签和截屏。 diff --git a/1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model.json b/1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model.json new file mode 100644 index 0000000..2366da2 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model.json @@ -0,0 +1,271 @@ +{ + "parent": "block/cube", + "textures": { + "s": "engineersdecor:blocks/device/tree_cutter_side", + "particle": "engineersdecor:blocks/device/tree_cutter_side", + "t": "engineersdecor:blocks/device/tree_cutter_top", + "b": "engineersdecor:blocks/device/tree_cutter_bottom" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 1, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, -2]}, + "faces": { + "north": {"uv": [0, 15, 16, 16], "texture": "#s"}, + "east": {"uv": [3, 15, 16, 16], "texture": "#s"}, + "south": {"uv": [0, 15, 16, 16], "texture": "#s"}, + "west": {"uv": [0, 15, 13, 16], "texture": "#s"}, + "up": {"uv": [0, 0, 16, 13], "texture": "#t"}, + "down": {"uv": [0, 3, 16, 16], "texture": "#b"} + } + }, + { + "from": [0, 14, 0], + "to": [16, 16, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 23, -2]}, + "faces": { + "north": {"uv": [0, 0, 16, 2], "texture": "#s"}, + "east": {"uv": [3, 0, 16, 2], "texture": "#s"}, + "south": {"uv": [0, 0, 16, 2], "texture": "#s"}, + "west": {"uv": [0, 0, 13, 2], "texture": "#s"}, + "up": {"uv": [0, 0, 16, 13], "texture": "#t"}, + "down": {"uv": [0, 3, 16, 16], "texture": "#b"} + } + }, + { + "from": [0, 1, 1], + "to": [1, 14, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 7.5, 5.5]}, + "faces": { + "north": {"uv": [15, 2, 16, 15], "texture": "#s"}, + "east": {"uv": [5, 2, 15, 15], "texture": "#s"}, + "south": {"uv": [0, 2, 1, 15], "texture": "#s"}, + "west": {"uv": [1, 2, 11, 15], "texture": "#s"}, + "up": {"uv": [0, 1, 1, 11], "texture": "#t"}, + "down": {"uv": [0, 5, 1, 15], "texture": "#b"} + } + }, + { + "from": [1, 1, 0], + "to": [15, 14, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 7.5, 5.5]}, + "faces": { + "north": {"uv": [1, 2, 15, 15], "texture": "#s"}, + "east": {"uv": [6, 2, 16, 15], "texture": "#s"}, + "south": {"uv": [1, 2, 15, 15], "texture": "#s"}, + "west": {"uv": [0, 2, 10, 15], "texture": "#s"}, + "up": {"uv": [1, 0, 15, 10], "texture": "#t"}, + "down": {"uv": [1, 6, 15, 16], "texture": "#b"} + } + }, + { + "from": [6, 1, 10], + "to": [10, 14, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 7.5, 15.5]}, + "faces": { + "north": {"uv": [6, 2, 10, 15], "texture": "#s"}, + "east": {"uv": [5, 2, 6, 15], "texture": "#s"}, + "south": {"uv": [6, 2, 10, 15], "texture": "#s"}, + "west": {"uv": [10, 2, 11, 15], "texture": "#s"}, + "up": {"uv": [6, 10, 10, 11], "texture": "#t"}, + "down": {"uv": [6, 5, 10, 6], "texture": "#b"} + } + }, + { + "from": [15, 1, 1], + "to": [16, 14, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [13.5, 7.5, 9]}, + "faces": { + "north": {"uv": [0, 2, 1, 15], "texture": "#s"}, + "east": {"uv": [5, 2, 15, 15], "texture": "#s"}, + "south": {"uv": [15, 2, 16, 15], "texture": "#s"}, + "west": {"uv": [1, 2, 11, 15], "texture": "#s"}, + "up": {"uv": [15, 1, 16, 11], "texture": "#t"}, + "down": {"uv": [15, 5, 16, 15], "texture": "#b"} + } + }, + { + "from": [7.5, 2, 12], + "to": [8.5, 12, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [13, 3, 14, 10], "rotation": 180, "texture": "#b"}, + "east": {"uv": [0, 6, 8, 8], "rotation": 270, "texture": "#s"}, + "south": {"uv": [2, 4, 3, 13], "texture": "#t"}, + "west": {"uv": [6, 6, 16, 8], "rotation": 90, "texture": "#s"}, + "up": {"uv": [5, 6, 6, 8], "rotation": 180, "texture": "#s"}, + "down": {"uv": [10, 6, 11, 8], "texture": "#s"} + } + }, + { + "from": [8.5, 10, 11], + "to": [9.5, 13, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 19, 9]}, + "faces": { + "north": {"uv": [6.5, 3, 7.5, 6], "texture": "#s"}, + "east": {"uv": [1, 3, 5, 6], "texture": "#s"}, + "south": {"uv": [8.5, 3, 9.5, 6], "texture": "#s"}, + "west": {"uv": [11, 3, 15, 6], "texture": "#s"}, + "up": {"uv": [8.5, 11, 9.5, 15], "texture": "#t"}, + "down": {"uv": [8.5, 1, 9.5, 5], "texture": "#b"} + } + }, + { + "from": [8.5, 13, 11], + "to": [9.5, 14, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 20, 9]}, + "faces": { + "north": {"uv": [6.5, 2, 7.5, 3], "texture": "#s"}, + "east": {"uv": [2, 2, 5, 3], "texture": "#s"}, + "south": {"uv": [8.5, 2, 9.5, 3], "texture": "#s"}, + "west": {"uv": [11, 2, 14, 3], "texture": "#s"}, + "up": {"uv": [8.5, 11, 9.5, 14], "texture": "#t"}, + "down": {"uv": [8.5, 2, 9.5, 5], "texture": "#b"} + } + }, + { + "from": [6.5, 13, 11], + "to": [7.5, 14, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 20, 9]}, + "faces": { + "north": {"uv": [8.5, 2, 9.5, 3], "texture": "#s"}, + "east": {"uv": [2, 2, 5, 3], "texture": "#s"}, + "south": {"uv": [6.5, 2, 7.5, 3], "texture": "#s"}, + "west": {"uv": [11, 2, 14, 3], "texture": "#s"}, + "up": {"uv": [6.5, 11, 7.5, 14], "texture": "#t"}, + "down": {"uv": [6.5, 2, 7.5, 5], "texture": "#b"} + } + }, + { + "from": [6.5, 10, 11], + "to": [7.5, 13, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 19, 9]}, + "faces": { + "north": {"uv": [8.5, 3, 9.5, 6], "texture": "#s"}, + "east": {"uv": [1, 3, 5, 6], "texture": "#s"}, + "south": {"uv": [6.5, 3, 7.5, 6], "texture": "#s"}, + "west": {"uv": [11, 3, 15, 6], "texture": "#s"}, + "up": {"uv": [6.5, 11, 7.5, 15], "texture": "#t"}, + "down": {"uv": [6.5, 1, 7.5, 5], "texture": "#b"} + } + }, + { + "from": [7.5, 10, 11], + "to": [8.5, 13, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 19, 9]}, + "faces": { + "north": {"uv": [7.5, 3, 8.5, 6], "texture": "#s"}, + "east": {"uv": [4, 3, 5, 6], "texture": "#s"}, + "south": {"uv": [7.5, 3, 8.5, 6], "texture": "#s"}, + "west": {"uv": [11, 3, 12, 6], "texture": "#s"}, + "up": {"uv": [7.5, 11, 8.5, 12], "texture": "#t"}, + "down": {"uv": [7.5, 4, 8.5, 5], "texture": "#b"} + } + }, + { + "from": [6.5, 2, 13], + "to": [7.5, 5, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [8.5, 11, 9.5, 14], "rotation": 180, "texture": "#b"}, + "east": {"uv": [2, 11, 3, 14], "rotation": 270, "texture": "#s"}, + "south": {"uv": [6.5, 11, 7.5, 14], "texture": "#t"}, + "west": {"uv": [13, 11, 14, 14], "texture": "#s"}, + "up": {"uv": [6.5, 13, 7.5, 14], "rotation": 180, "texture": "#s"}, + "down": {"uv": [6.5, 2, 7.5, 3], "texture": "#s"} + } + }, + { + "from": [8.5, 2, 13], + "to": [9.5, 5, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [6.5, 11, 7.5, 14], "rotation": 180, "texture": "#b"}, + "east": {"uv": [2, 11, 3, 14], "texture": "#s"}, + "south": {"uv": [8.5, 11, 9.5, 14], "texture": "#t"}, + "west": {"uv": [13, 11, 14, 14], "rotation": 90, "texture": "#s"}, + "up": {"uv": [8.5, 13, 9.5, 14], "rotation": 180, "texture": "#s"}, + "down": {"uv": [8.5, 2, 9.5, 3], "texture": "#s"} + } + }, + { + "from": [6.5, 4, 14], + "to": [7.5, 5, 15], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [9, 0, 10, 0], "rotation": 180, "texture": "#b"}, + "east": {"uv": [0, 4, 0, 6], "rotation": 270, "texture": "#s"}, + "south": {"uv": [8, 14, 9, 15], "texture": "#t"}, + "west": {"uv": [15, 4, 16, 6], "rotation": 90, "texture": "#s"}, + "up": {"uv": [6, 4, 7, 6], "rotation": 180, "texture": "#s"}, + "down": {"uv": [9, 4, 10, 6], "texture": "#s"} + } + }, + { + "from": [8.5, 4, 14], + "to": [9.5, 5, 15], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [11, 0, 12, 0], "rotation": 180, "texture": "#b"}, + "east": {"uv": [0, 4, 1, 6], "rotation": 270, "texture": "#s"}, + "south": {"uv": [10, 14, 11, 15], "texture": "#t"}, + "west": {"uv": [16, 4, 16, 6], "rotation": 90, "texture": "#s"}, + "up": {"uv": [4, 4, 5, 6], "rotation": 180, "texture": "#s"}, + "down": {"uv": [11, 4, 12, 6], "texture": "#s"} + } + }, + { + "from": [8.5, 2, 14], + "to": [9.5, 3, 15], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [11, 0, 12, 0], "rotation": 180, "texture": "#b"}, + "east": {"uv": [0, 4, 1, 6], "rotation": 270, "texture": "#s"}, + "south": {"uv": [10, 14, 11, 15], "texture": "#t"}, + "west": {"uv": [16, 4, 16, 6], "rotation": 90, "texture": "#s"}, + "up": {"uv": [4, 4, 5, 6], "rotation": 180, "texture": "#s"}, + "down": {"uv": [11, 4, 12, 6], "texture": "#s"} + } + }, + { + "from": [6.5, 2, 14], + "to": [7.5, 3, 15], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [9, 0, 10, 0], "rotation": 180, "texture": "#b"}, + "east": {"uv": [0, 4, 0, 6], "rotation": 270, "texture": "#s"}, + "south": {"uv": [8, 13, 9, 14], "texture": "#t"}, + "west": {"uv": [15, 4, 16, 6], "rotation": 90, "texture": "#s"}, + "up": {"uv": [6, 4, 7, 6], "rotation": 180, "texture": "#s"}, + "down": {"uv": [9, 4, 10, 6], "texture": "#s"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [73, 180, 0], + "translation": [0, -1.75, -1.5], + "scale": [0.2, 0.2, 0.2] + }, + "firstperson_righthand": { + "rotation": [18, 22, 0], + "translation": [1.25, 0, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 1.75, 0], + "scale": [0.2, 0.2, 0.2] + }, + "gui": { + "rotation": [30, 40, 0], + "translation": [0.5, -0.25, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "rotation": [0, 180, 0], + "translation": [0, 0, -3.25], + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model_active.json b/1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model_active.json new file mode 100644 index 0000000..575b050 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/models/block/device/small_milking_machine_model_active.json @@ -0,0 +1,271 @@ +{ + "parent": "block/cube", + "textures": { + "s": "engineersdecor:blocks/device/tree_cutter_side", + "particle": "engineersdecor:blocks/device/tree_cutter_side", + "t": "engineersdecor:blocks/device/tree_cutter_top", + "b": "engineersdecor:blocks/device/tree_cutter_bottom" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 1, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, -2]}, + "faces": { + "north": {"uv": [0, 15, 16, 16], "texture": "#s"}, + "east": {"uv": [3, 15, 16, 16], "texture": "#s"}, + "south": {"uv": [0, 15, 16, 16], "texture": "#s"}, + "west": {"uv": [0, 15, 13, 16], "texture": "#s"}, + "up": {"uv": [0, 0, 16, 13], "texture": "#t"}, + "down": {"uv": [0, 3, 16, 16], "texture": "#b"} + } + }, + { + "from": [0, 14, 0], + "to": [16, 16, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 23, -2]}, + "faces": { + "north": {"uv": [0, 0, 16, 2], "texture": "#s"}, + "east": {"uv": [3, 0, 16, 2], "texture": "#s"}, + "south": {"uv": [0, 0, 16, 2], "texture": "#s"}, + "west": {"uv": [0, 0, 13, 2], "texture": "#s"}, + "up": {"uv": [0, 0, 16, 13], "texture": "#t"}, + "down": {"uv": [0, 3, 16, 16], "texture": "#b"} + } + }, + { + "from": [0, 1, 1], + "to": [1, 14, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 7.5, 5.5]}, + "faces": { + "north": {"uv": [15, 2, 16, 15], "texture": "#s"}, + "east": {"uv": [5, 2, 15, 15], "texture": "#s"}, + "south": {"uv": [0, 2, 1, 15], "texture": "#s"}, + "west": {"uv": [1, 2, 11, 15], "texture": "#s"}, + "up": {"uv": [0, 1, 1, 11], "texture": "#t"}, + "down": {"uv": [0, 5, 1, 15], "texture": "#b"} + } + }, + { + "from": [1, 1, 0], + "to": [15, 14, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 7.5, 5.5]}, + "faces": { + "north": {"uv": [1, 2, 15, 15], "texture": "#s"}, + "east": {"uv": [6, 2, 16, 15], "texture": "#s"}, + "south": {"uv": [1, 2, 15, 15], "texture": "#s"}, + "west": {"uv": [0, 2, 10, 15], "texture": "#s"}, + "up": {"uv": [1, 0, 15, 10], "texture": "#t"}, + "down": {"uv": [1, 6, 15, 16], "texture": "#b"} + } + }, + { + "from": [6, 1, 10], + "to": [10, 14, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 7.5, 15.5]}, + "faces": { + "north": {"uv": [6, 2, 10, 15], "texture": "#s"}, + "east": {"uv": [5, 2, 6, 15], "texture": "#s"}, + "south": {"uv": [6, 2, 10, 15], "texture": "#s"}, + "west": {"uv": [10, 2, 11, 15], "texture": "#s"}, + "up": {"uv": [6, 10, 10, 11], "texture": "#t"}, + "down": {"uv": [6, 5, 10, 6], "texture": "#b"} + } + }, + { + "from": [15, 1, 1], + "to": [16, 14, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [13.5, 7.5, 9]}, + "faces": { + "north": {"uv": [0, 2, 1, 15], "texture": "#s"}, + "east": {"uv": [5, 2, 15, 15], "texture": "#s"}, + "south": {"uv": [15, 2, 16, 15], "texture": "#s"}, + "west": {"uv": [1, 2, 11, 15], "texture": "#s"}, + "up": {"uv": [15, 1, 16, 11], "texture": "#t"}, + "down": {"uv": [15, 5, 16, 15], "texture": "#b"} + } + }, + { + "from": [8.5, 10, 11], + "to": [9.5, 13, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 19, 9]}, + "faces": { + "north": {"uv": [6.5, 3, 7.5, 6], "texture": "#s"}, + "east": {"uv": [1, 3, 5, 6], "texture": "#s"}, + "south": {"uv": [8.5, 3, 9.5, 6], "texture": "#s"}, + "west": {"uv": [11, 3, 15, 6], "texture": "#s"}, + "up": {"uv": [8.5, 11, 9.5, 15], "texture": "#t"}, + "down": {"uv": [8.5, 1, 9.5, 5], "texture": "#b"} + } + }, + { + "from": [8.5, 13, 11], + "to": [9.5, 14, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 20, 9]}, + "faces": { + "north": {"uv": [6.5, 2, 7.5, 3], "texture": "#s"}, + "east": {"uv": [2, 2, 5, 3], "texture": "#s"}, + "south": {"uv": [8.5, 2, 9.5, 3], "texture": "#s"}, + "west": {"uv": [11, 2, 14, 3], "texture": "#s"}, + "up": {"uv": [8.5, 11, 9.5, 14], "texture": "#t"}, + "down": {"uv": [8.5, 2, 9.5, 5], "texture": "#b"} + } + }, + { + "from": [6.5, 13, 11], + "to": [7.5, 14, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 20, 9]}, + "faces": { + "north": {"uv": [8.5, 2, 9.5, 3], "texture": "#s"}, + "east": {"uv": [2, 2, 5, 3], "texture": "#s"}, + "south": {"uv": [6.5, 2, 7.5, 3], "texture": "#s"}, + "west": {"uv": [11, 2, 14, 3], "texture": "#s"}, + "up": {"uv": [6.5, 11, 7.5, 14], "texture": "#t"}, + "down": {"uv": [6.5, 2, 7.5, 5], "texture": "#b"} + } + }, + { + "from": [6.5, 10, 11], + "to": [7.5, 13, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 19, 9]}, + "faces": { + "north": {"uv": [8.5, 3, 9.5, 6], "texture": "#s"}, + "east": {"uv": [1, 3, 5, 6], "texture": "#s"}, + "south": {"uv": [6.5, 3, 7.5, 6], "texture": "#s"}, + "west": {"uv": [11, 3, 15, 6], "texture": "#s"}, + "up": {"uv": [6.5, 11, 7.5, 15], "texture": "#t"}, + "down": {"uv": [6.5, 1, 7.5, 5], "texture": "#b"} + } + }, + { + "from": [7.5, 10, 11], + "to": [8.5, 13, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 19, 9]}, + "faces": { + "north": {"uv": [7.5, 3, 8.5, 6], "texture": "#s"}, + "east": {"uv": [4, 3, 5, 6], "texture": "#s"}, + "south": {"uv": [7.5, 3, 8.5, 6], "texture": "#s"}, + "west": {"uv": [11, 3, 12, 6], "texture": "#s"}, + "up": {"uv": [7.5, 11, 8.5, 12], "texture": "#t"}, + "down": {"uv": [7.5, 4, 8.5, 5], "texture": "#b"} + } + }, + { + "from": [7.5, 10, 12], + "to": [8.5, 12, 22], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [5, 6, 6, 8], "texture": "#s"}, + "east": {"uv": [0, 6, 8, 8], "texture": "#s"}, + "south": {"uv": [10, 6, 11, 8], "texture": "#s"}, + "west": {"uv": [6, 6, 16, 8], "texture": "#s"}, + "up": {"uv": [2, 4, 3, 13], "texture": "#t"}, + "down": {"uv": [13, 3, 14, 10], "texture": "#b"} + } + }, + { + "from": [8.5, 11, 19], + "to": [9.5, 12, 22], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [8.5, 13, 9.5, 14], "texture": "#s"}, + "east": {"uv": [2, 11, 3, 14], "rotation": 90, "texture": "#s"}, + "south": {"uv": [8.5, 2, 9.5, 3], "texture": "#s"}, + "west": {"uv": [13, 11, 14, 14], "texture": "#s"}, + "up": {"uv": [8.5, 11, 9.5, 14], "texture": "#t"}, + "down": {"uv": [6.5, 11, 7.5, 14], "texture": "#b"} + } + }, + { + "from": [8.5, 12, 19], + "to": [9.5, 13, 20], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [4, 4, 5, 6], "texture": "#s"}, + "east": {"uv": [0, 4, 1, 6], "texture": "#s"}, + "south": {"uv": [11, 4, 12, 6], "texture": "#s"}, + "west": {"uv": [16, 4, 16, 6], "texture": "#s"}, + "up": {"uv": [10, 14, 11, 15], "texture": "#t"}, + "down": {"uv": [11, 0, 12, 0], "texture": "#b"} + } + }, + { + "from": [8.5, 12, 21], + "to": [9.5, 13, 22], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [4, 4, 5, 6], "texture": "#s"}, + "east": {"uv": [0, 4, 1, 6], "texture": "#s"}, + "south": {"uv": [11, 4, 12, 6], "texture": "#s"}, + "west": {"uv": [16, 4, 16, 6], "texture": "#s"}, + "up": {"uv": [10, 14, 11, 15], "texture": "#t"}, + "down": {"uv": [11, 0, 12, 0], "texture": "#b"} + } + }, + { + "from": [6.5, 11, 19], + "to": [7.5, 12, 22], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [6.5, 13, 7.5, 14], "texture": "#s"}, + "east": {"uv": [2, 11, 3, 14], "texture": "#s"}, + "south": {"uv": [6.5, 2, 7.5, 3], "texture": "#s"}, + "west": {"uv": [13, 11, 14, 14], "rotation": 270, "texture": "#s"}, + "up": {"uv": [6.5, 11, 7.5, 14], "texture": "#t"}, + "down": {"uv": [8.5, 11, 9.5, 14], "texture": "#b"} + } + }, + { + "from": [6.5, 12, 21], + "to": [7.5, 13, 22], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [6, 4, 7, 6], "texture": "#s"}, + "east": {"uv": [0, 4, 0, 6], "texture": "#s"}, + "south": {"uv": [9, 4, 10, 6], "texture": "#s"}, + "west": {"uv": [15, 4, 16, 6], "texture": "#s"}, + "up": {"uv": [8, 13, 9, 14], "texture": "#t"}, + "down": {"uv": [9, 0, 10, 0], "texture": "#b"} + } + }, + { + "from": [6.5, 12, 19], + "to": [7.5, 13, 20], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 11, 13]}, + "faces": { + "north": {"uv": [6, 4, 7, 6], "texture": "#s"}, + "east": {"uv": [0, 4, 0, 6], "texture": "#s"}, + "south": {"uv": [9, 4, 10, 6], "texture": "#s"}, + "west": {"uv": [15, 4, 16, 6], "texture": "#s"}, + "up": {"uv": [8, 14, 9, 15], "texture": "#t"}, + "down": {"uv": [9, 0, 10, 0], "texture": "#b"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [57, 82, -38], + "translation": [2.25, -0.5, -2], + "scale": [0.35, 0.35, 0.35] + }, + "firstperson_righthand": { + "rotation": [18, 22, 0], + "translation": [1.25, 0, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 1.75, 0], + "scale": [0.2, 0.2, 0.2] + }, + "gui": { + "rotation": [30, 40, 0], + "translation": [1.25, -1, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "rotation": [0, 180, 0], + "translation": [0, 0, -3.25], + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/1.12/src/main/resources/assets/engineersdecor/recipes/alternative/small_milking_machine_recipe_standalone.json b/1.12/src/main/resources/assets/engineersdecor/recipes/alternative/small_milking_machine_recipe_standalone.json new file mode 100644 index 0000000..d0d5704 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/recipes/alternative/small_milking_machine_recipe_standalone.json @@ -0,0 +1,37 @@ +{ + "conditions": [ + { + "type": "engineersdecor:grc", + "result": "engineersdecor:small_milking_machine", + "missing": ["immersiveengineering:material"] + } + ], + "type": "minecraft:crafting_shaped", + "pattern": [ + "PPP", + "PAO", + "PRP" + ], + "key": { + "O": { + "item": "minecraft:observer", + "data": 0 + }, + "P": { + "item": "#ingotIron", + "data": 0 + }, + "A": { + "item": "minecraft:milk_bucket", + "data": 0 + }, + "R": { + "item": "minecraft:redstone_block", + "data": 0 + } + }, + "result": { + "item": "engineersdecor:small_milking_machine", + "count": 1 + } +} diff --git a/1.12/src/main/resources/assets/engineersdecor/recipes/dependent/small_milking_machine_recipe.json b/1.12/src/main/resources/assets/engineersdecor/recipes/dependent/small_milking_machine_recipe.json new file mode 100644 index 0000000..9265e18 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/recipes/dependent/small_milking_machine_recipe.json @@ -0,0 +1,41 @@ +{ + "conditions": [ + { + "type": "engineersdecor:grc", + "result": "engineersdecor:small_milking_machine", + "required": ["immersiveengineering:material"] + } + ], + "type": "minecraft:crafting_shaped", + "pattern": [ + "PPP", + "PAO", + "CRC" + ], + "key": { + "O": { + "item": "minecraft:observer", + "data": 0 + }, + "P": { + "item": "#plateAnyFerroMetal", + "data": 0 + }, + "A": { + "item": "minecraft:milk_bucket", + "data": 0 + }, + "R": { + "item": "minecraft:redstone_block", + "data": 0 + }, + "C": { + "item": "#anyMechanicalComponent", + "data": 0 + } + }, + "result": { + "item": "engineersdecor:small_milking_machine", + "count": 1 + } +} diff --git a/1.12/src/main/resources/assets/engineersdecor/recipes/independent/clinker_brick_block_recipe.json b/1.12/src/main/resources/assets/engineersdecor/recipes/independent/clinker_brick_block_recipe.json index de65ae4..9e4b33d 100644 --- a/1.12/src/main/resources/assets/engineersdecor/recipes/independent/clinker_brick_block_recipe.json +++ b/1.12/src/main/resources/assets/engineersdecor/recipes/independent/clinker_brick_block_recipe.json @@ -23,6 +23,6 @@ }, "result": { "item": "engineersdecor:clinker_brick_block", - "count": 4 + "count": 8 } } diff --git a/1.14/gradle.properties b/1.14/gradle.properties index ba70010..aeabd87 100644 --- a/1.14/gradle.properties +++ b/1.14/gradle.properties @@ -5,4 +5,4 @@ version_minecraft=1.14.4 version_forge_minecraft=1.14.4-28.1.79 version_fml_mappings=20190719-1.14.3 version_jei=1.14.4:6.0.0.10 -version_engineersdecor=1.0.16-b2 +version_engineersdecor=1.0.16-b3 diff --git a/1.14/meta/update.json b/1.14/meta/update.json index aff04e2..201076f 100644 --- a/1.14/meta/update.json +++ b/1.14/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.14.4": { + "1.0.16-b3": "[A] Config options (opt-outs and tweaks) added.\n[M] Increased clinker brick recipe yield to 8 for the builders needs.", "1.0.16-b2": "[A] Added Gas Concrete (including wall, stairs, slab, and slab slice).\n[F] Fixed Small Block Breaker active model.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Added two missing recipes.", "1.0.16-b1": "[U] Updated to Forge 1.14.4-28.1.79/20190719-1.14.3.\n[A] Added Fluid Collection Funnel.", "1.0.15-b3": "[A] Added Small Block Breaker.\n[M] Mineral Smelter fluid handler/transfer added.", @@ -32,6 +33,6 @@ }, "promos": { "1.14.4-recommended": "", - "1.14.4-latest": "1.0.16-b2" + "1.14.4-latest": "1.0.16-b3" } } \ No newline at end of file diff --git a/1.14/readme.md b/1.14/readme.md index dd6c326..c39a6d4 100644 --- a/1.14/readme.md +++ b/1.14/readme.md @@ -11,6 +11,9 @@ Mod sources for Minecraft version 1.14.4. ## Version history + - v1.0.16-b3 [A] Config options (opt-outs and tweaks) added. + [M] Increased clinker brick recipe yield to 8 for the builders needs. + - v1.0.16-b2 [A] Added Gas Concrete (including wall, stairs, slab, and slab slice). [F] Fixed Small Block Breaker active model. [F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint). diff --git a/1.14/src/main/java/wile/engineersdecor/ModContent.java b/1.14/src/main/java/wile/engineersdecor/ModContent.java index a827659..13ccd91 100644 --- a/1.14/src/main/java/wile/engineersdecor/ModContent.java +++ b/1.14/src/main/java/wile/engineersdecor/ModContent.java @@ -392,19 +392,19 @@ public class ModContent public static final BlockDecorDropper FACTORY_DROPPER = (BlockDecorDropper)(new BlockDecorDropper( BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_REDSTONE_CONTROLLED, - Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2f, 15f).sound(SoundType.METAL), + Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL), ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,15) )).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "factory_dropper")); public static final BlockDecorPlacer FACTORY_PLACER = (BlockDecorPlacer)(new BlockDecorPlacer( - BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK|BlockDecor.CFG_REDSTONE_CONTROLLED, - Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2f, 15f).sound(SoundType.METAL), + BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_REDSTONE_CONTROLLED, + Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL), ModAuxiliaries.getPixeledAABB(2,2,2, 14,14,14) )).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "factory_placer")); public static final BlockDecorBreaker SMALL_BLOCK_BREAKER = (BlockDecorBreaker)(new BlockDecorBreaker( - BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK, - Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2f, 15f).sound(SoundType.METAL), + BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK, + Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL), ModAuxiliaries.getPixeledAABB(0,0,0, 16,12,16) )).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "small_block_breaker")); diff --git a/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorBreaker.java b/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorBreaker.java index 7dcdea8..b59390a 100644 --- a/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorBreaker.java +++ b/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorBreaker.java @@ -122,16 +122,19 @@ public class BlockDecorBreaker extends BlockDecorDirectedHorizontal private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY; 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 boost_energy_; - public static void on_config(int boost_energy_per_tick, int breaking_time_per_hardness, int min_breaking_time_ticks) + 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); breaking_reluctance = MathHelper.clamp(breaking_time_per_hardness, 5, 50); min_breaking_time = MathHelper.clamp(min_breaking_time_ticks, 10, 100); - ModEngineersDecor.logger().info("Config block breaker: Boost energy consumption:" + boost_energy_consumption + "rf/t, reluctance=" + breaking_reluctance + "/hrdn, break time offset=" + min_breaking_time ); + 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() @@ -259,9 +262,19 @@ public class BlockDecorBreaker extends BlockDecorDirectedHorizontal tick_timer_ = IDLE_TICK_INTERVAL; return; } - proc_time_elapsed_ += TICK_INTERVAL; - boolean active = true; int time_needed = (int)(target_state.getBlockHardness(world, pos) * breaking_reluctance) + min_breaking_time; + if(boost_energy_ >= boost_energy_consumption) { + boost_energy_ = 0; + proc_time_elapsed_ += TICK_INTERVAL * (1+BOOST_FACTOR); + time_needed += min_breaking_time * (3*BOOST_FACTOR/5); + active_timer_ = 2; + } else if(!requires_power) { + proc_time_elapsed_ += TICK_INTERVAL; + active_timer_ = 1024; + } else if(active_timer_ > 0) { + --active_timer_; + } + boolean active = (active_timer_ > 0); if(boost_energy_ >= boost_energy_consumption) { boost_energy_ = 0; proc_time_elapsed_ += TICK_INTERVAL * BOOST_FACTOR; diff --git a/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorTreeCutter.java b/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorTreeCutter.java index 3e453f3..2b9cd9e 100644 --- a/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorTreeCutter.java +++ b/1.14/src/main/java/wile/engineersdecor/blocks/BlockDecorTreeCutter.java @@ -87,18 +87,22 @@ public class BlockDecorTreeCutter extends BlockDecorDirectedHorizontal 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 = 20 * 60; // 60 secs, so that people don't come to the bright idea to carry one with them. + 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 boost_energy_consumption = DEFAULT_BOOST_ENERGY; - private static int cutting_time_needed = DEFAULT_CUTTING_TIME_NEEDED; + private static int cutting_time_needed = 20 * DEFAULT_CUTTING_TIME_NEEDED; + private static boolean requires_power = false; private int tick_timer_; - private int proc_time_elapsed_; // small, not saved in nbt. - private int boost_energy_; // small, not saved in nbt. + private int active_timer_; + private int proc_time_elapsed_; + private int boost_energy_; - public static void on_config(int boost_energy_per_tick) + 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); - ModEngineersDecor.logger().info("Config tree cutter: Boost energy consumption:" + boost_energy_consumption + "rf/t"); + 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() @@ -173,12 +177,21 @@ public class BlockDecorTreeCutter extends BlockDecorDirectedHorizontal if(!TreeCutting.canChop(tree_state) || (world.isBlockPowered(pos))) { if(device_state.get(ACTIVE)) world.setBlockState(pos, device_state.with(ACTIVE, false), 1|2); proc_time_elapsed_ = 0; + active_timer_ = 0; tick_timer_ = IDLE_TICK_INTERVAL; return; } proc_time_elapsed_ += TICK_INTERVAL; - if(boost_energy_ >= boost_energy_consumption) { boost_energy_ = 0; proc_time_elapsed_ += TICK_INTERVAL*BOOST_FACTOR; } - boolean active = true; + if(boost_energy_ >= boost_energy_consumption) { + boost_energy_ = 0; + proc_time_elapsed_ += TICK_INTERVAL*BOOST_FACTOR; + active_timer_ = 2; + } else if(!requires_power) { + active_timer_ = 1024; + } else if(active_timer_ > 0) { + --active_timer_; + } + boolean active = (active_timer_ > 0); if(proc_time_elapsed_ >= cutting_time_needed) { proc_time_elapsed_ = 0; TreeCutting.chopTree(world, tree_state, tree_pos, 512, false); diff --git a/1.14/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java b/1.14/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java index d5cd541..9fccf3b 100644 --- a/1.14/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java +++ b/1.14/src/main/java/wile/engineersdecor/detail/ModAuxiliaries.java @@ -61,10 +61,27 @@ public class ModAuxiliaries final String ft = tr.getFormattedText(); if(ft.contains("${")) { // Non-recursive, non-argument lang file entry cross referencing. - Pattern pt = Pattern.compile("\\$\\{([\\w\\.]+)\\}"); + Pattern pt = Pattern.compile("\\$\\{([^}]+)\\}"); Matcher mt = pt.matcher(ft); StringBuffer sb = new StringBuffer(); - while(mt.find()) mt.appendReplacement(sb, (new TranslationTextComponent(mt.group(1))).getFormattedText().trim()); + while(mt.find()) { + String m = mt.group(1); + if(m.contains("?")) { + String[] kv = m.split("\\?", 2); + String key = kv[0].trim(); + boolean not = key.startsWith("!"); + if(not) key = key.replaceFirst("!", ""); + m = kv[1].trim(); + if(!ModConfig.getServerConfig().contains(key)) { + m = ""; + } else { + boolean r = ModConfig.getServerConfig().getBoolean(key); + if(not) r = !r; + if(!r) m = ""; + } + } + mt.appendReplacement(sb, (new TranslationTextComponent(m)).getFormattedText().trim()); + } mt.appendTail(sb); return sb.toString(); } else { diff --git a/1.14/src/main/java/wile/engineersdecor/detail/ModConfig.java b/1.14/src/main/java/wile/engineersdecor/detail/ModConfig.java index fbe48cd..709b4d8 100644 --- a/1.14/src/main/java/wile/engineersdecor/detail/ModConfig.java +++ b/1.14/src/main/java/wile/engineersdecor/detail/ModConfig.java @@ -12,7 +12,7 @@ package wile.engineersdecor.detail; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.blocks.*; -import wile.engineersdecor.blocks.BlockDecorSolarPanel.BTileEntity; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.common.ForgeConfigSpec; @@ -49,6 +49,7 @@ public class ModConfig public static class ClientConfig { public final ForgeConfigSpec.BooleanValue without_tooltips; + public final ForgeConfigSpec.BooleanValue without_ters; ClientConfig(ForgeConfigSpec.Builder builder) { @@ -62,6 +63,10 @@ public class ModConfig .translation(ModEngineersDecor.MODID + ".config.without_tooltips") .comment("Disable CTRL-SHIFT item tooltip display.") .define("without_tooltips", false); + without_ters = builder + .translation(ModEngineersDecor.MODID + ".config.without_ters") + .comment("Disable all TERs (tile entity renderers).") + .define("without_ters", false); } builder.pop(); } @@ -93,29 +98,35 @@ public class ModConfig public final ForgeConfigSpec.BooleanValue without_stairs; public final ForgeConfigSpec.BooleanValue without_ie_concrete_wall; public final ForgeConfigSpec.BooleanValue without_panzer_glass; - public final ForgeConfigSpec.BooleanValue without_crafting_table; - public final ForgeConfigSpec.BooleanValue without_lab_furnace; - public final ForgeConfigSpec.BooleanValue without_electrical_furnace; + public final ForgeConfigSpec.BooleanValue without_ladders; public final ForgeConfigSpec.BooleanValue without_treated_wood_furniture; public final ForgeConfigSpec.BooleanValue without_windows; public final ForgeConfigSpec.BooleanValue without_light_sources; - public final ForgeConfigSpec.BooleanValue without_ladders; + public final ForgeConfigSpec.BooleanValue without_slabs; + public final ForgeConfigSpec.BooleanValue without_halfslabs; + public final ForgeConfigSpec.BooleanValue without_poles; + public final ForgeConfigSpec.BooleanValue without_hsupports; + public final ForgeConfigSpec.BooleanValue without_sign_plates; + public final ForgeConfigSpec.BooleanValue without_floor_grating; + public final ForgeConfigSpec.BooleanValue without_crafting_table; + public final ForgeConfigSpec.BooleanValue without_lab_furnace; + public final ForgeConfigSpec.BooleanValue without_electrical_furnace; + public final ForgeConfigSpec.BooleanValue without_valves; + public final ForgeConfigSpec.BooleanValue without_passive_fluid_accumulator; + public final ForgeConfigSpec.BooleanValue without_waste_incinerator; + public final ForgeConfigSpec.BooleanValue without_factory_dropper; + public final ForgeConfigSpec.BooleanValue without_factory_hopper; + public final ForgeConfigSpec.BooleanValue without_factory_placer; + public final ForgeConfigSpec.BooleanValue without_block_breaker; + public final ForgeConfigSpec.BooleanValue without_solar_panel; + public final ForgeConfigSpec.BooleanValue without_fluid_funnel; + public final ForgeConfigSpec.BooleanValue without_mineral_smelter; public final ForgeConfigSpec.BooleanValue without_chair_sitting; public final ForgeConfigSpec.BooleanValue without_mob_chair_sitting; public final ForgeConfigSpec.BooleanValue without_ladder_speed_boost; public final ForgeConfigSpec.BooleanValue without_crafting_table_history; - public final ForgeConfigSpec.BooleanValue without_valves; - public final ForgeConfigSpec.BooleanValue without_passive_fluid_accumulator; - public final ForgeConfigSpec.BooleanValue without_waste_incinerator; - public final ForgeConfigSpec.BooleanValue without_sign_plates; - public final ForgeConfigSpec.BooleanValue without_factory_dropper; - public final ForgeConfigSpec.BooleanValue without_factory_placer; - public final ForgeConfigSpec.BooleanValue without_factory_breaker; - public final ForgeConfigSpec.BooleanValue without_slabs; - public final ForgeConfigSpec.BooleanValue without_halfslabs; public final ForgeConfigSpec.BooleanValue without_direct_slab_pickup; - public final ForgeConfigSpec.BooleanValue without_poles; - public final ForgeConfigSpec.BooleanValue without_hsupports; + // Misc public final ForgeConfigSpec.BooleanValue with_experimental; public final ForgeConfigSpec.BooleanValue without_recipes; @@ -132,6 +143,13 @@ public class ModConfig public final ForgeConfigSpec.BooleanValue with_crafting_quickmove_buttons; public final ForgeConfigSpec.IntValue pipevalve_max_flowrate; public final ForgeConfigSpec.IntValue pipevalve_redstone_gain; + public final ForgeConfigSpec.IntValue block_breaker_power_consumption; + public final ForgeConfigSpec.IntValue block_breaker_reluctance; + public final ForgeConfigSpec.IntValue block_breaker_min_breaking_time; + public final ForgeConfigSpec.BooleanValue block_breaker_requires_power; + public final ForgeConfigSpec.IntValue tree_cuttter_energy_consumption; + public final ForgeConfigSpec.IntValue tree_cuttter_cutting_time_needed; + public final ForgeConfigSpec.BooleanValue tree_cuttter_requires_power; CommonConfig(ForgeConfigSpec.Builder builder) { @@ -245,18 +263,38 @@ public class ModConfig .translation(ModEngineersDecor.MODID + ".config.without_sign_plates") .comment("Disable decorative sign plates (caution, hazards, etc).") .define("without_sign_plates", false); + without_floor_grating = builder + .translation(ModEngineersDecor.MODID + ".config.without_floor_grating") + .comment("Disable floor gratings.") + .define("without_floor_grating", false); without_factory_dropper = builder .translation(ModEngineersDecor.MODID + ".config.without_factory_dropper") .comment("Disable the factory dropper.") .define("without_factory_dropper", false); + without_factory_hopper = builder + .translation(ModEngineersDecor.MODID + ".config.without_factory_hopper") + .comment("Disable the factory hopper.") + .define("without_factory_hopper", false); without_factory_placer = builder .translation(ModEngineersDecor.MODID + ".config.without_factory_placer") .comment("Disable the factory placer.") .define("without_factory_placer", false); - without_factory_breaker = builder - .translation(ModEngineersDecor.MODID + ".config.without_factory_breaker") + without_block_breaker = builder + .translation(ModEngineersDecor.MODID + ".config.without_block_breaker") .comment("Disable the small block breaker.") - .define("without_factory_breaker", false); + .define("without_block_breaker", false); + without_solar_panel = builder + .translation(ModEngineersDecor.MODID + ".config.without_solar_panel") + .comment("Disable the small solar panel.") + .define("without_solar_panel", false); + without_fluid_funnel = builder + .translation(ModEngineersDecor.MODID + ".config.without_fluid_funnel") + .comment("Disable the small fluid collection funnel.") + .define("without_fluid_funnel", false); + without_mineral_smelter = builder + .translation(ModEngineersDecor.MODID + ".config.without_mineral_smelter") + .comment("Disable the small mineral smelter.") + .define("without_mineral_smelter", false); without_slabs = builder .translation(ModEngineersDecor.MODID + ".config.without_slabs") .comment("Disable horizontal half-block slab.") @@ -373,8 +411,43 @@ public class ModConfig "Note that the agerage power is much less, as no power is produced at all during the night, " + "and the power curve is nonlinear rising/falling during the day. Bad weather conditions also " + "decrease the production. The config value can be changed on-the-fly for tuning.") - .defineInRange("small_solar_panel_peak_production", BTileEntity.DEFAULT_PEAK_POWER, 10, 256); - + .defineInRange("small_solar_panel_peak_production", BlockDecorSolarPanel.BTileEntity.DEFAULT_PEAK_POWER, 10, 256); + block_breaker_power_consumption = builder + .translation(ModEngineersDecor.MODID + ".config.block_breaker_power_consumption") + .comment("Defines how much RF power the Small Block Breaker requires to magnificently increase the processing speed. " + + "The config value can be changed on-the-fly for tuning.") + .defineInRange("block_breaker_power_consumption", BlockDecorBreaker.BTileEntity.DEFAULT_BOOST_ENERGY, 16, 512); + block_breaker_reluctance = builder + .translation(ModEngineersDecor.MODID + ".config.block_breaker_reluctance") + .comment("Defines how much time the Small Block Breaker needs per block hardness, " + + "means: 'reluctance' * hardness + min_time, you change the 'reluctance' here." + + "The unit is ticks/hardness. " + "The config value can be changed on-the-fly for tuning.") + .defineInRange("block_breaker_reluctance", BlockDecorBreaker.BTileEntity.DEFAULT_BREAKING_RELUCTANCE, 5, 50); + block_breaker_min_breaking_time = builder + .translation(ModEngineersDecor.MODID + ".config.block_breaker_min_breaking_time") + .comment("Defines how much time the Small Block Breaker needs at least, better said it's an offset: " + + "'reluctance' * hardness + min_time, you change the 'min_time' here, value " + + "in ticks." + "The config value can be changed on-the-fly for tuning.") + .defineInRange("block_breaker_min_breaking_time", BlockDecorBreaker.BTileEntity.DEFAULT_MIN_BREAKING_TIME, 10, 100); + block_breaker_requires_power = builder + .translation(ModEngineersDecor.MODID + ".config.block_breaker_requires_power") + .comment("Defines if the Small Block Breaker does not work without RF power.") + .define("block_breaker_requires_power", false); + tree_cuttter_energy_consumption = builder + .translation(ModEngineersDecor.MODID + ".config.tree_cuttter_energy_consumption") + .comment("Defines how much RF power the Small Tree Cutter requires to magnificently increase the processing speed. " + + "The config value can be changed on-the-fly for tuning.") + .defineInRange("tree_cuttter_energy_consumption", BlockDecorTreeCutter.BTileEntity.DEFAULT_BOOST_ENERGY, 16, 512); + tree_cuttter_cutting_time_needed = builder + .translation(ModEngineersDecor.MODID + ".config.tree_cuttter_cutting_time_needed") + .comment("Defines how much time the Small Tree Cutter needs to cut a tree without RF power. " + + "The value is in seconds. With energy it is 6 times faster. " + + "The config value can be changed on-the-fly for tuning.") + .defineInRange("tree_cuttter_cutting_time_needed", BlockDecorTreeCutter.BTileEntity.DEFAULT_CUTTING_TIME_NEEDED, 10, 240); + tree_cuttter_requires_power = builder + .translation(ModEngineersDecor.MODID + ".config.tree_cuttter_requires_power") + .comment("Defines if the Small Tree Cutter does not work without RF power.") + .define("tree_cuttter_requires_power", false); builder.pop(); } } @@ -430,12 +503,17 @@ public class ModConfig if(block instanceof BlockDecorWasteIncinerator) return COMMON.without_waste_incinerator.get(); if(block instanceof BlockDecorDropper) return COMMON.without_factory_dropper.get(); if(block instanceof BlockDecorPlacer) return COMMON.without_factory_placer.get(); - if(block instanceof BlockDecorBreaker) return COMMON.without_factory_breaker.get(); + if(block instanceof BlockDecorBreaker) return COMMON.without_block_breaker.get(); if(block instanceof BlockDecorHalfSlab) return COMMON.without_halfslabs.get(); if(block instanceof BlockDecorLadder) return COMMON.without_ladders.get(); if(block instanceof BlockDecorWindow) return COMMON.without_windows.get(); if(block instanceof BlockDecorPipeValve) return COMMON.without_valves.get(); if(block instanceof BlockDecorHorizontalSupport) return COMMON.without_hsupports.get(); + if(block instanceof BlockDecorFloorGrating) return COMMON.without_floor_grating.get(); + if(block instanceof BlockDecorHopper) return COMMON.without_factory_hopper.get(); + if(block instanceof BlockDecorFluidFunnel) return COMMON.without_fluid_funnel.get(); + if(block instanceof BlockDecorSolarPanel) return COMMON.without_solar_panel.get(); + if(block instanceof BlockDecorMineralSmelter) return COMMON.without_mineral_smelter.get(); // Type based evaluation where later filters may match, too if(COMMON.without_slabs.get() && (block instanceof BlockDecorSlab)) return true; if(COMMON.without_stairs.get() && (block instanceof BlockDecorStairs)) return true; @@ -476,10 +554,14 @@ public class ModConfig //-------------------------------------------------------------------------------------------------------------------- private static final ArrayList includes_ = new ArrayList(); private static final ArrayList excludes_ = new ArrayList(); + private static final CompoundNBT server_config_ = new CompoundNBT(); public static boolean without_crafting_table = false; public static boolean immersiveengineering_installed = false; private static boolean with_experimental_features_ = false; + public static final CompoundNBT getServerConfig() // config that may be synchronized from server to client via net pkg. + { return server_config_; } + public static final void apply() { BlockDecorFurnace.BTileEntity.on_config(COMMON.furnace_smelting_speed_percent.get(), COMMON.furnace_fuel_efficiency_percent.get(), COMMON.furnace_boost_energy_consumption.get()); @@ -489,6 +571,8 @@ public class ModConfig 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()); 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()); without_crafting_table = isOptedOut(ModContent.TREATED_WOOD_CRAFTING_TABLE); immersiveengineering_installed = ModAuxiliaries.isModLoaded("immersiveengineering"); with_experimental_features_ = COMMON.with_experimental.get(); @@ -516,5 +600,10 @@ public class ModConfig if(!excl[i].isEmpty()) excludes_.add(excl[i]); } } + { + // Check if the config is already synchronized or has to be synchronised. + server_config_.putBoolean("tree_cuttter_requires_power", COMMON.tree_cuttter_requires_power.get()); + server_config_.putBoolean("block_breaker_requires_power", COMMON.block_breaker_requires_power.get()); + } } } diff --git a/1.14/src/main/resources/assets/engineersdecor/lang/en_us.json b/1.14/src/main/resources/assets/engineersdecor/lang/en_us.json index 1448620..1e69f7f 100644 --- a/1.14/src/main/resources/assets/engineersdecor/lang/en_us.json +++ b/1.14/src/main/resources/assets/engineersdecor/lang/en_us.json @@ -7,6 +7,8 @@ "engineersdecor.tooltip.hint.extended": "§6[§9SHIFT§r More Info§6]§r", "engineersdecor.tooltip.hint.help": "§6[§9CTRL-SHIFT§r Help§6]§r", "engineersdecor.tooltip.slabpickup.help": "§rFast pickup by left-clicking while looking up/down and holding this slab.", + "engineersdecor.tooltip.requires_rf_power": "Requires RF power.", + "engineersdecor.tooltip.massive_speed_boost_with_rf_power": "Apply RF power to magnificently increase the speed.", "engineersdecor.config.pattern_excludes": "Pattern excludes", "engineersdecor.config.pattern_includes": "Pattern includes", "engineersdecor.config.without_clinker_bricks": "Without clinker bricks", @@ -172,13 +174,15 @@ "block.engineersdecor.factory_placer": "Factory Block Placer", "block.engineersdecor.factory_placer.help": "§6Allows placing blocks and planting crops or trees.§r\n GUI Redstone controls: Not inverted / inverted (default), pulse mode / continuous mode (default).\\n Also supports spike planing from underneath the soil. Spits out items that it cannot place or plant.", "block.engineersdecor.small_block_breaker": "Small Block Breaker", - "block.engineersdecor.small_block_breaker.help": "§6Breaks blocks in front of it.§r\n Can be disabled by applying a redstone signal. The time needed to destroy a block depends on the hardness of that block. Provide RF/FE power to speed up the breaking process (massively).", + "block.engineersdecor.small_block_breaker.help": "§6Breaks blocks in front of it.§r\n Can be disabled by applying a redstone signal. The time needed to destroy a block depends on the hardness of that block. ${!block_breaker_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power} ${block_breaker_requires_power?engineersdecor.tooltip.requires_rf_power}", "block.engineersdecor.small_mineral_smelter": "Small Mineral Melting Furnace", "block.engineersdecor.small_mineral_smelter.help": "§6High temperature, high insulation electrical stone melting furnace.§r\n Heats up mineral blocks to magma blocks, and finally to lava. Click with a mineral block (stone, cobble, etc) or use item insertion to place a block in the melter. Use bucket or fluid extraction to retrieve the lava. When cooling down lava, obsidian is generated. Remove the RF power or apply a redstone signal to disable the furnace. For automation, use a redstone comparator to see in which melting phase the mineral is a moment.", "block.engineersdecor.small_solar_panel": "Small Solar Panel", "block.engineersdecor.small_solar_panel.help": "§6Produces a small amount of power when exposed to sunlight.§r\n Useful for charging LF capacitors in remote systems with low consumption. The internal charge pump circuit accumulates and frequently transfers RF. Production depends on day time and the weather.", "block.engineersdecor.small_tree_cutter": "Small Tree Cutter", - "block.engineersdecor.small_tree_cutter.help": "§6Chops grown trees in front of it.§r\n Does not collect the lumbers. Deactivate with a redstone signal. Provide RF power to boost the cutting speed (takes a long time without power).", + "block.engineersdecor.small_tree_cutter.help": "§6Chops grown trees in front of it.§r\n Does not collect the lumbers. Deactivate with a redstone signal. ${!tree_cuttter_requires_power?engineersdecor.tooltip.massive_speed_boost_with_rf_power} ${tree_cuttter_requires_power?engineersdecor.tooltip.requires_rf_power}", + "block.engineersdecor.small_milking_machine": "Small Milking Machine", + "block.engineersdecor.small_milking_machine.help": "§6Frequently attracts and milks cows.§r\n Has an internal fluid tank. Does not feed the animals. Use buckets to retrieve the milk.", "block.engineersdecor.sign_decor": "Sign Plate (Engineer's decor)", "block.engineersdecor.sign_decor.help": "§6This should not be craftable or visible in JEI. Used for creative tab and screenshots.", "block.engineersdecor.sign_hotwire": "Sign \"Caution Hot Wire\"", diff --git a/1.14/src/main/resources/assets/engineersdecor/lang/ru_ru.json b/1.14/src/main/resources/assets/engineersdecor/lang/ru_ru.json index e7011cb..b7dcfbb 100644 --- a/1.14/src/main/resources/assets/engineersdecor/lang/ru_ru.json +++ b/1.14/src/main/resources/assets/engineersdecor/lang/ru_ru.json @@ -7,6 +7,8 @@ "engineersdecor.tooltip.hint.extended": "§6[§9SHIFT§r Больше информации§6]§r", "engineersdecor.tooltip.hint.help": "§6[§9CTRL-SHIFT§r Помощь§6]§r", "engineersdecor.tooltip.slabpickup.help": "§rБыстрое поднятие щелчком ЛКМ, смотря вверх/вниз с этой плитой в руках.", + "engineersdecor.tooltip.requires_rf_power": "Requires RF power.", + "engineersdecor.tooltip.massive_speed_boost_with_rf_power": "Apply RF power to magnificently increase the speed.", "engineersdecor.config.pattern_excludes": "Pattern excludes", "engineersdecor.config.pattern_includes": "Pattern includes", "engineersdecor.config.without_clinker_bricks": "Без клинкерных кирпичей", @@ -164,6 +166,7 @@ "block.engineersdecor.small_mineral_smelter": "Small Mineral Melting Furnace", "block.engineersdecor.small_solar_panel": "Small Solar Panel", "block.engineersdecor.small_tree_cutter": "Small Tree Cutter", + "block.engineersdecor.small_milking_machine": "Small Milking Machine", "block.engineersdecor.sign_decor": "Табличка с надписью (Логотип Engineer's decor)", "block.engineersdecor.sign_decor.help": "§Это не должно быть крафтовым или видимым в JEI. Используется для творческой вкладки и скриншотов.", "block.engineersdecor.sign_hotwire": "Знак «Осторожно, под напряжением»", diff --git a/1.14/src/main/resources/assets/engineersdecor/lang/zh_cn.json b/1.14/src/main/resources/assets/engineersdecor/lang/zh_cn.json index ddc1636..0e5f95b 100644 --- a/1.14/src/main/resources/assets/engineersdecor/lang/zh_cn.json +++ b/1.14/src/main/resources/assets/engineersdecor/lang/zh_cn.json @@ -7,6 +7,8 @@ "engineersdecor.tooltip.hint.extended": "§6[§9SHIFT§r 查看更多信息§6]§r", "engineersdecor.tooltip.hint.help": "§6[§9CTRL-SHIFT§r 查看帮助§6]§r", "engineersdecor.tooltip.slabpickup.help": "§r手持同类台阶往上/下看时单击该台阶可无需破坏快速拾起。", + "engineersdecor.tooltip.requires_rf_power": "Requires RF power.", + "engineersdecor.tooltip.massive_speed_boost_with_rf_power": "Apply RF power to magnificently increase the speed.", "engineersdecor.config.pattern_excludes": "模式不包括", "engineersdecor.config.pattern_includes": "模式包括", "engineersdecor.config.without_clinker_bricks": "不要过烧砖", @@ -170,6 +172,7 @@ "block.engineersdecor.small_solar_panel.help": "§6暴露在阳光下时产生少量能量。§r\n 用于低消耗地在远程系统给低压电容器充电。 内部电荷泵电路积累并频繁输出RF。产出取决于时间 和天气。", "block.engineersdecor.small_tree_cutter": "小型砍树机", "block.engineersdecor.small_tree_cutter.help": "§6砍倒正前方的树。§r\n 不收集木材。通入红石信号停用。 提供RF来加快砍树速度。(没有的话会很慢。)", + "block.engineersdecor.small_milking_machine": "Small Milking Machine", "block.engineersdecor.sign_decor": "标志板(工程师的装饰)", "block.engineersdecor.sign_decor.help": "§6这不应该可合成或在JEI看到。用于创造模式的物品栏标签和截屏。", "block.engineersdecor.sign_hotwire": "指示牌 \"小心电线\"", diff --git a/1.14/src/main/resources/data/engineersdecor/recipes/independent/clinker_brick_recipe.json b/1.14/src/main/resources/data/engineersdecor/recipes/independent/clinker_brick_recipe.json index 3449797..4825f9c 100644 --- a/1.14/src/main/resources/data/engineersdecor/recipes/independent/clinker_brick_recipe.json +++ b/1.14/src/main/resources/data/engineersdecor/recipes/independent/clinker_brick_recipe.json @@ -18,6 +18,6 @@ }, "result": { "item": "engineersdecor:clinker_brick_block", - "count": 4 + "count": 8 } } diff --git a/meta/update.json b/meta/update.json index ad178fe..81424e2 100644 --- a/meta/update.json +++ b/meta/update.json @@ -2,11 +2,12 @@ "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "promos": { "1.12.2-recommended": "1.0.15", - "1.12.2-latest": "1.0.16-b1", + "1.12.2-latest": "1.0.16-b2", "1.14.4-recommended": "", - "1.14.4-latest": "1.0.16-b2" + "1.14.4-latest": "1.0.16-b3" }, "1.12.2": { + "1.0.16-b2": "[A] Added Gas Concrete (including slab, wall, stairs, and slab slice).\n[A] Added explicit RF-power-required option for Small Block Breaker and Small Tree Cutter (issue #63).\n[M] Increased clinker brick recipe yield to 8 for the master builders needs.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Fixed sign bounding boxes (issue #62, thx angela/themartin).", "1.0.16-b1": "[A] Added Fluid Collection Funnel.\n[A] Added config opt-outs for Breaker, Placer, Fluid Funnel, Mineral Smelter.\n[A] Added configs tweaks for Small Block Breaker and Small Tree Cutter (cffr#185).\n[F] Fixed Block Placer discarding item metadata/variants while placing (issue #60).\n[F] Fixed Block Breaker duping empty shulker boxes, model updated.", "1.0.15": "[R] Release based on v1.0.15-b2. Release-to-release changes: * Added Small Block Breaker * Small Tree Cutter fixes and compatability improved. * Crafting table compat fixes.\n[M] Small Tree Cutter log detection bug fixed (issue #59).\n[M] Small Tree Cutter supports Menril chopping (issue #54).", "1.0.15-b2": "[A] Added Small Block Breaker\n[M] Crafting Table: Allowing NBT \"Damage\" mismatch only items that are declared damagable (issue #56).\n[M] Tree Cutter: Loosened the strict mod namespace requirement for Dynamic Trees log detection (issue #52) to enable checking DT compat mod log blocks.", @@ -72,6 +73,7 @@ "1.0.0-b1": "[A] Initial structure.\n[A] Added clinker bricks and clinker brick stairs.\n[A] Added slag bricks and slag brick stairs.\n[A] Added metal rung ladder.\n[A] Added staggered metal steps ladder.\n[A] Added treated wood ladder.\n[A] Added treated wood pole.\n[A] Added treated wood table." }, "1.14.4": { + "1.0.16-b3": "[A] Config options (opt-outs and tweaks) added.\n[M] Increased clinker brick recipe yield to 8 for the builders needs.", "1.0.16-b2": "[A] Added Gas Concrete (including wall, stairs, slab, and slab slice).\n[F] Fixed Small Block Breaker active model.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Added two missing recipes.", "1.0.16-b1": "[U] Updated to Forge 1.14.4-28.1.79/20190719-1.14.3.\n[A] Added Fluid Collection Funnel.", "1.0.15-b3": "[A] Added Small Block Breaker.\n[M] Mineral Smelter fluid handler/transfer added.",