This repository has been archived by the owner on Nov 18, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
2137808
commit 72ba197
Showing
30 changed files
with
399 additions
and
193 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
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/raoulvdberge/refinedpipes/network/NetworkFactory.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.raoulvdberge.refinedpipes.network; | ||
|
||
import net.minecraft.nbt.CompoundNBT; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
public interface NetworkFactory { | ||
Network create(BlockPos pos); | ||
|
||
Network create(CompoundNBT tag); | ||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/raoulvdberge/refinedpipes/network/NetworkRegistry.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.raoulvdberge.refinedpipes.network; | ||
|
||
import net.minecraft.util.ResourceLocation; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class NetworkRegistry { | ||
public static final NetworkRegistry INSTANCE = new NetworkRegistry(); | ||
|
||
private final Map<ResourceLocation, NetworkFactory> factories = new HashMap<>(); | ||
|
||
private NetworkRegistry() { | ||
} | ||
|
||
public void addFactory(ResourceLocation type, NetworkFactory factory) { | ||
factories.put(type, factory); | ||
} | ||
|
||
@Nullable | ||
public NetworkFactory getFactory(ResourceLocation type) { | ||
return factories.get(type); | ||
} | ||
} |
Oops, something went wrong.