mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Merge branch '1.11' into 1.12
* 1.11: add a couple of comments [no-ci] add Anchor Upgrade to Entangleporter Store Quantum Entangleporter frequency (name and public/private only) in the itemstack when dismantled. Displayed in the sneak key info tooltip. Increase Entangleporter frequency to be able to store as much as ultimate tiers can transmit. static field access to Class access Conflicts: src/main/java/mekanism/common/frequency/Frequency.java src/main/java/mekanism/common/tile/TileEntityQuantumEntangloporter.java
This commit is contained in:
commit
b40cd5c20e
9 files changed
+368
-11
No files matched your search
@@ -12,6 +12,8 @@ import mekanism.common.PacketHandler;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class Frequency
|
||||
{
|
||||
public static final String TELEPORTER = "Teleporter";
|
||||
@@ -146,4 +148,36 @@ public class Frequency
|
||||
return obj instanceof Frequency && ((Frequency)obj).name.equals(name)
|
||||
&& ((Frequency)obj).ownerUUID.equals(ownerUUID) && ((Frequency)obj).publicFreq == publicFreq;
|
||||
}
|
||||
|
||||
public Identity getIdentity(){
|
||||
return new Identity(this.name, this.publicFreq);
|
||||
}
|
||||
|
||||
public static class Identity {
|
||||
public String name;
|
||||
public boolean publicFreq;
|
||||
|
||||
private Identity(String name, boolean publicFreq)
|
||||
{
|
||||
this.name = name;
|
||||
this.publicFreq = publicFreq;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Identity load(NBTTagCompound data)
|
||||
{
|
||||
if (!data.getString("name").isEmpty()){
|
||||
return new Identity(data.getString("name"), data.getBoolean("publicFreq"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public NBTTagCompound serialise()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("name", this.name);
|
||||
tag.setBoolean("publicFreq", this.publicFreq);
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user