Trichter- & Automations-Integration (MC 26.1.2)
Dieses Dokument beschreibt die Trichter-Extraktionsmechanik, Transferraten-Parität, Redstone-Sortierer-Stabilität und Behälterintegration in Item Clumps für Minecraft 26.1.2.
📊 Feature-Infobox
| Eigenschaft | Spezifikation |
|---|---|
| Systemname | Trichter-Tröpfchen-Extraktions-Engine |
| Zielklasse | net.minecraft.world.level.block.entity.HopperBlockEntity |
| Extraktionsmethode | HopperBlockEntity.addItem(Container, ItemEntity) |
| Extraktionsrate | $1\text{ Item pro } 8\text{ Ticks}$ ($2.5\text{ Items/Sekunde}$) |
| Item-Scheiben-Strategie | baseItem.setCount(1) |
| Automations-Kompatibilität | 100 % kompatibel mit Vanilla-Redstone-Sortierern & Filtern |
⚙️ Die Automations-Tröpfchen-Architektur
In Vanilla Minecraft saugen Trichter ganze ItemEntity-Instanzen ein, wenn deren Stapelgröße $\le 64$ ist und Platz vorhanden ist. Würde ein Trichter unkontrolliert einen Stapel mit $5.000$ Items aufnehmen, liefe er sofort über oder Items würden gelöscht.
Item Clumps fängt HopperBlockEntity.addItem ab, um die Tröpfchen-Extraktion durchzusetzen:
┌────────────────────────────┐
│ Hopper Tick Cycle │
│ (Every 8 Game Ticks) │
└─────────────┬──────────────┘
│
▼
┌────────────────────────────┐
│ Is Item Entity Count > 1? │
└─────────────┬──────────────┘
│
┌────────────────┴────────────────┐
│ (Yes) │ (No)
▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐
│ Clone Single Item Slice │ │ Native Vanilla Extraction │
│ baseItem = stack.copy() │ │ (Standard 1-item / stack) │
│ baseItem.setCount(1) │ └───────────────────────────┘
└─────────────┬─────────────┘
│
▼
┌───────────────────────────┐
│ Try Insert Into Hopper │
│ HopperBlockEntity.addItem │
└─────────────┬─────────────┘
│
┌────────┴────────┐
│ │
(Success) (Failed / Full)
│ │
▼ ▼
┌───────────────────┐ ┌───────────────┐
│ Shrink Ground │ │ Abort Transfer│
│ Clump by 1; │ │ Entity Retains│
│ Refresh Name Tag. │ │ Full Count. │
└───────────────────┘ └───────────────┘💻 Reale Java-Quellcode-Implementierung
Aus HopperBlockEntityMixin.java in Minecraft 26.1.2:
java
@Inject(method = "addItem(Lnet/minecraft/world/Container;Lnet/minecraft/world/entity/item/ItemEntity;)Z", at = @At("HEAD"), cancellable = true)
private static void item_clumps$customHopperExtract(Container container, ItemEntity entity, CallbackInfoReturnable<Boolean> cir) {
ItemStack itemStack = entity.getItem();
int count = itemStack.getCount();
if (count > 1) {
// Entity is a clump. Extract exactly 1 item.
ItemStack baseItem = itemStack.copy();
baseItem.setCount(1);
ItemStack result = HopperBlockEntity.addItem(null, container, baseItem, null);
if (result.isEmpty()) {
// Hopper successfully absorbed the 1 item. Shrink entity stack.
ItemStack originalStack = entity.getItem();
originalStack.shrink(1);
entity.setItem(originalStack); // Updates standard item tracker and custom name
cir.setReturnValue(true);
} else {
// Hopper was full or couldn't take it
cir.setReturnValue(false);
}
}
}