Skip to content

Commit

Permalink
feat: 🌳Significantly buff [Timewood Clock]
Browse files Browse the repository at this point in the history
Before tis change, each second Tree of Time chose 72 blocks in 16 blocks radius and called additional TileEntity tick and RandomUpdate tick

Now its:

- **Radius** reduced to 8 blocks that makes random ticks ~150 times more likely happen
- **Blocks count** each second 72 => 144
- **Random updates** now happens 8 times in a row
- **TE updates** now called 64 times at once

This would make [Timewood Clock] possible to use even for IC2 crops or some machines.

Also, since its effectively increasing RandomTicks updates, it open doors for unique new automations - there is no other blocks that could increase random ticks.
  • Loading branch information
Krutoy242 committed Jan 27, 2024
1 parent e3bc8ca commit cfb1137
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@@ -147,17 +147,22 @@ extends BlockTFMagicLog {
}

private void doTreeOfTimeEffect(World world, BlockPos pos, Random rand) {
- int numticks = 24 * this.func_149738_a(world);
+ int numticks = 48 * this.func_149738_a(world);
for (int i = 0; i < numticks; ++i) {
TileEntity te;
- BlockPos dPos = WorldUtil.randomOffset((Random)rand, (BlockPos)pos, (int)16);
+ int j;
+ BlockPos dPos = WorldUtil.randomOffset((Random)rand, (BlockPos)pos, (int)8);
IBlockState state = world.func_180495_p(dPos);
Block block = state.func_177230_c();
if (block != Blocks.field_150350_a && block.func_149653_t()) {
- block.func_180650_b(world, dPos, state, rand);
+ for (j = 0; j < 8; ++j) {
+ block.func_180650_b(world, dPos, state, rand);
+ }
}
if (!((te = world.func_175625_s(dPos)) instanceof ITickable) || te.func_145837_r()) continue;
- ((ITickable)te).func_73660_a();
+ for (j = 0; j < 64; ++j) {
+ ((ITickable)te).func_73660_a();
+ }
}
}

@@ -237,7 +242,7 @@ extends BlockTFMagicLog {
int matchChestNum = -1;
int matchCount = 0;
for (int chestNum = 0; chestNum < chests.size(); ++chestNum) {
- IInventory chest = (IInventory)chests.get(chestNum);
+ IInventory chest = chests.get(chestNum);
int currentChestMatches = 0;
for (int slotNum = 0; slotNum < chest.func_70302_i_(); ++slotNum) {
ItemStack currentItem = chest.func_70301_a(slotNum);
@@ -249,8 +254,8 @@ extends BlockTFMagicLog {
matchChestNum = chestNum;
}
if (matchChestNum >= 0 && matchChestNum != sortedChestNum) {
- IInventory moveChest = (IInventory)chests.get(matchChestNum);
- IInventory oldChest = (IInventory)chests.get(sortedChestNum);
+ IInventory moveChest = chests.get(matchChestNum);
+ IInventory oldChest = chests.get(sortedChestNum);
int moveSlot = this.getEmptySlotIn(moveChest);
if (moveSlot >= 0) {
oldChest.func_70299_a(sortedSlotNum, ItemStack.field_190927_a);

0 comments on commit cfb1137

Please sign in to comment.