tutorial:interface_injection
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:interface_injection [2022/03/08 21:12] – use automatic intermediary -> yarn mappings juuz | tutorial:interface_injection [2025/02/12 18:42] (current) – Add node on unicode escape for $ earthcomputer | ||
---|---|---|---|
Line 11: | Line 11: | ||
The scope of this example is to add the following method into ''< | The scope of this example is to add the following method into ''< | ||
- | This, normally, is not possible because ''< | + | This, normally, is not possible because ''< |
< | < | ||
Line 38: | Line 38: | ||
@Override | @Override | ||
public Optional< | public Optional< | ||
- | //This is how to get the default sound, copied from BucketItem class. | + | |
- | return Optional.of(((FlowableFluid) (Object) this).isIn(FluidTags.LAVA) ? SoundEvents.ITEM_BUCKET_EMPTY_LAVA | + | |
} | } | ||
} | } | ||
Line 64: | Line 64: | ||
</ | </ | ||
- | You could also override this method in classes extending | + | You could also override this method in classes extending |
+ | |||
+ | Sometimes, your interface injections may need to include the '' |
tutorial/interface_injection.1646773957.txt.gz · Last modified: 2022/03/08 21:12 by juuz