Rewrite chicken handler for a new shittier world where inventory indicies aren't a thing ig

This commit is contained in:
Salt 2023-12-01 12:11:24 -06:00
parent 294713ce56
commit 8129f039cd

View File

@ -3,16 +3,22 @@
function placeBreeder() function placeBreeder()
print('Initializing breeder...') print('Initializing breeder...')
breeder = peripheral.wrap('top') breeder = peripheral.wrap('top')
-- Why are we discarding slot 2? -- First, we nab the new chicken in slot 1
-- Because, by design, it MUST be turtle.select(1)
-- the trash chicken from the last turtle.suckUp()
-- generation. -- Then, we destroy the breeder
breeder.pushItems('bottom', 2) turtle.select(2)
for i = 1, 16, 1 do
turtle.select(i)
turtle.suckUp()
end
turtle.digUp() turtle.digUp()
-- We are now in a position where we have:
-- 1: Good chicken
-- 2: Inferior chicken
-- 3: Seeds/second inferior chicken
-- 4: Breeder/seeds
-- 5: Null/breeder
-- In any case, discarding 1 item in slot 2 will eliminate poor genes
--turtle.select(2) -- Unnecessary due to previous instr
turtle.dropDown(1)
-- Now we re set-up the breeder
selectItem('chickens:breeder') selectItem('chickens:breeder')
turtle.placeUp() turtle.placeUp()
selectItem('minecraft:wheat_seeds') selectItem('minecraft:wheat_seeds')