Class Bus
java.lang.Object
com.gtnewhorizons.horizonqa.api.gt.Bus
View of a single input or output bus tile. Obtained from
Multiblock.-
Method Summary
Modifier and TypeMethodDescriptionvoidassertContains(ItemMatcher matcher) Passes when at least one slot matchesmatcher.voidassertContains(net.minecraft.item.ItemStack stack) Passes when at least one slot containsstack(item, damage, and NBT match; stack size ignored).voidvoidassertNotContains(ItemMatcher matcher) Passes when no slot matchesmatcher.voidassertNotContains(net.minecraft.item.ItemStack stack) Passes when no slot containsstack(item, damage, and NBT match; stack size ignored).clear()Directly clears every slot, bypassing normal extraction rules.fillAllSlots(net.minecraft.item.ItemStack stack) Directly fills every slot with a copy ofstack, bypassing normal insertion rules.insert(net.minecraft.item.ItemStack... stacks) Inserts each stack usingInventoryHelper.insert(net.minecraft.inventory.IInventory, net.minecraft.item.ItemStack); fails if any stack is not fully accepted.programmedCircuit(int config) Sets the programmed circuit on this bus toconfig(0–24).setSlot(int index, net.minecraft.item.ItemStack stack) Directly sets a bus slot for test setup, bypassing normal insertion rules.net.minecraft.item.ItemStackslot(int index) Stack inindex, ornullif empty.
-
Method Details
-
insert
Inserts each stack usingInventoryHelper.insert(net.minecraft.inventory.IInventory, net.minecraft.item.ItemStack); fails if any stack is not fully accepted. -
programmedCircuit
Sets the programmed circuit on this bus toconfig(0–24). Writes directly into the circuit slot to bypass the normal inventory insertion that skips that slot.- Throws:
IllegalArgumentException- ifconfigis out of range or the circuit item is unavailableGameTestAssertException- if this bus does not support configuration circuits
-
assertContains
public void assertContains(net.minecraft.item.ItemStack stack) Passes when at least one slot containsstack(item, damage, and NBT match; stack size ignored). -
assertContains
Passes when at least one slot matchesmatcher. -
assertNotContains
public void assertNotContains(net.minecraft.item.ItemStack stack) Passes when no slot containsstack(item, damage, and NBT match; stack size ignored). -
assertNotContains
Passes when no slot matchesmatcher. -
assertEmpty
public void assertEmpty() -
slot
public net.minecraft.item.ItemStack slot(int index) Stack inindex, ornullif empty.- Throws:
IndexOutOfBoundsException- ifindexis not in range
-
setSlot
Directly sets a bus slot for test setup, bypassing normal insertion rules.This is intended for fixture setup such as pre-filling an output bus. Use
insert(ItemStack...)when the test needs to simulate normal item insertion. -
fillAllSlots
Directly fills every slot with a copy ofstack, bypassing normal insertion rules. -
clear
Directly clears every slot, bypassing normal extraction rules.
-