-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added system for presignal repeater
- Loading branch information
Showing
16 changed files
with
172 additions
and
51 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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/com/troblecodings/signals/signalbox/MainSignalIdentifier.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,36 @@ | ||
package com.troblecodings.signals.signalbox; | ||
|
||
import java.util.Objects; | ||
|
||
import net.minecraft.core.BlockPos; | ||
|
||
public class MainSignalIdentifier { | ||
|
||
public final Point point; | ||
public final ModeSet mode; | ||
public final BlockPos pos; | ||
|
||
public MainSignalIdentifier(Point point, ModeSet mode, BlockPos pos) { | ||
this.point = point; | ||
this.mode = mode; | ||
this.pos = pos; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(mode, point, pos); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
MainSignalIdentifier other = (MainSignalIdentifier) obj; | ||
return Objects.equals(mode, other.mode) && Objects.equals(point, other.point) | ||
&& Objects.equals(pos, other.pos); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/com/troblecodings/signals/signalbox/OtherSignalIdentifier.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,36 @@ | ||
package com.troblecodings.signals.signalbox; | ||
|
||
import java.util.Objects; | ||
|
||
import net.minecraft.core.BlockPos; | ||
|
||
public class OtherSignalIdentifier extends MainSignalIdentifier { | ||
|
||
public final boolean isRepeater; | ||
|
||
public OtherSignalIdentifier(Point point, ModeSet mode, BlockPos pos, | ||
final boolean isRepeater) { | ||
super(point, mode, pos); | ||
this.isRepeater = isRepeater; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = super.hashCode(); | ||
result = prime * result + Objects.hash(isRepeater); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (!super.equals(obj)) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
OtherSignalIdentifier other = (OtherSignalIdentifier) obj; | ||
return isRepeater == other.isRepeater && super.equals(obj); | ||
} | ||
} |
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
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
Oops, something went wrong.