generated from jaredlll08/MultiLoader-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50c9a94
commit 4af57bf
Showing
7 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
### 6.1.0 | ||
### 6.1.1 | ||
|
||
- Update to 1.21.1 | ||
- Pass Holder to Support Atrributes |
37 changes: 36 additions & 1 deletion
37
common/src/main/java/com/unrealdinnerbone/trenzalore/api/registry/RegistryEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,46 @@ | ||
package com.unrealdinnerbone.trenzalore.api.registry; | ||
|
||
import com.mojang.datafixers.util.Either; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.HolderOwner; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.TagKey; | ||
|
||
import java.util.Optional; | ||
import java.util.function.Predicate; | ||
import java.util.function.Supplier; | ||
import java.util.stream.Stream; | ||
|
||
public class RegistryEntry<T> implements Supplier<T> { | ||
|
||
private final String name; | ||
private final Supplier<T> entry; | ||
private Holder<T> holder; | ||
|
||
public RegistryEntry(String name, Supplier<T> entry) { | ||
this.name = name; | ||
this.entry = entry; | ||
} | ||
|
||
public <B> void setHolder(Holder<B> register) { | ||
this.holder = (Holder<T>) register; | ||
} | ||
|
||
public record RegistryEntry<T>(String name, Supplier<T> entry) implements Supplier<T> { | ||
public Holder<T> getHolder() { | ||
return holder; | ||
} | ||
|
||
@Override | ||
public T get() { | ||
return entry.get(); | ||
} | ||
|
||
public String name() { | ||
return name; | ||
} | ||
|
||
public Supplier<T> entry() { | ||
return entry; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 2 additions & 13 deletions
15
neo/src/main/java/com/unrealdinnerbone/trenzalore/TrenzaloreNeoRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters