-
Notifications
You must be signed in to change notification settings - Fork 8
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
921e99a
commit 0fc98aa
Showing
16 changed files
with
205 additions
and
34 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
18 changes: 18 additions & 0 deletions
18
src/main/java/ru/octol1ttle/flightassistant/computers/api/IPitchLimiter.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,5 +1,23 @@ | ||
package ru.octol1ttle.flightassistant.computers.api; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import net.minecraft.util.math.Direction; | ||
import ru.octol1ttle.flightassistant.config.ComputerConfig; | ||
|
||
public interface IPitchLimiter { | ||
List<IPitchLimiter> instances = new ArrayList<>(); | ||
|
||
default ComputerConfig.ProtectionMode getProtectionMode() { | ||
return ComputerConfig.ProtectionMode.HARD; | ||
} | ||
default float getMinimumPitch() { | ||
return -90.0f; | ||
} | ||
default float getMaximumPitch() { | ||
return 90.0f; | ||
} | ||
default boolean blockPitchChange(Direction direction) { | ||
return false; | ||
} | ||
} |
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
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
23 changes: 23 additions & 0 deletions
23
...main/java/ru/octol1ttle/flightassistant/registries/events/ComputerRegisteredCallback.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,23 @@ | ||
package ru.octol1ttle.flightassistant.registries.events; | ||
|
||
import net.fabricmc.fabric.api.event.Event; | ||
import net.fabricmc.fabric.api.event.EventFactory; | ||
import ru.octol1ttle.flightassistant.computers.api.IComputer; | ||
|
||
public interface ComputerRegisteredCallback { | ||
Event<ComputerRegisteredCallback> EVENT = EventFactory.createArrayBacked( | ||
ComputerRegisteredCallback.class, | ||
(listeners) -> (computer) -> { | ||
for (ComputerRegisteredCallback event : listeners) { | ||
event.onComputerRegistered(computer); | ||
} | ||
} | ||
); | ||
|
||
/** | ||
* Called after a computer has been registered. | ||
* | ||
* @param computer the {@link IComputer} instance | ||
*/ | ||
void onComputerRegistered(IComputer computer); | ||
} |
Oops, something went wrong.