-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from Cjsah/1.18
更新一丢丢
- Loading branch information
Showing
4 changed files
with
60 additions
and
9 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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/xekr/ironstars/efficiency/EFFNetwork.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,35 @@ | ||
package com.xekr.ironstars.efficiency; | ||
|
||
import com.xekr.ironstars.IronStarsUtil; | ||
import com.xekr.ironstars.blocks.entity.AbstractEFFBlockEntity; | ||
import net.minecraft.util.Mth; | ||
|
||
import java.util.HashMap; | ||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
public class EFFNetwork { | ||
private static final Map<UUID, EFFNetwork> NETWORK = new HashMap<>(); | ||
|
||
private final UUID id; | ||
private final Map<AbstractEFFBlockEntity, Integer> sources = new HashMap<>(); | ||
private final Map<AbstractEFFBlockEntity, Integer> members = new LinkedHashMap<>(); | ||
|
||
private EFFNetwork(AbstractEFFBlockEntity blockEntity) { | ||
this.id = Mth.createInsecureUUID(IronStarsUtil.RANDOM); | ||
this.sources.put(blockEntity, blockEntity.getMachineEfficiency()); | ||
} | ||
|
||
public static EFFNetwork create(AbstractEFFBlockEntity blockEntity) { | ||
if (blockEntity.hasNetwork() || !blockEntity.isSourceMachine()) return null; | ||
EFFNetwork network = new EFFNetwork(blockEntity); | ||
NETWORK.put(network.id, network); | ||
return network; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
} |
4 changes: 0 additions & 4 deletions
4
src/main/java/com/xekr/ironstars/efficiency/EfficiencyNetwork.java
This file was deleted.
Oops, something went wrong.