Add supplier variant to AbstractBlock.Properties#lootFrom (#7563)

This commit is contained in:
Alex O'Neill 2020-12-28 16:42:15 -05:00 committed by GitHub
parent 2904772b16
commit fc68b81b21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,12 +144,22 @@
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_;
return this;
@@ -933,7 +971,7 @@
@@ -932,11 +970,17 @@
return this;
}
+ @Deprecated // FORGE: Use the variant that takes a Supplier below
public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
- this.field_222381_j = p_222379_1_.func_220068_i();
+ this.lootTableSupplier = () -> p_222379_1_.delegate.get().func_220068_i();
return this;
}
+ public AbstractBlock.Properties lootFrom(java.util.function.Supplier<? extends Block> blockIn) {
+ this.lootTableSupplier = () -> blockIn.get().func_220068_i();
+ return this;
+ }
+
public AbstractBlock.Properties func_235859_g_() {
this.field_235813_o_ = true;
return this;