-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add WaystonesListReceivedEvent, deprecate KnownWaystonesEvent
- Loading branch information
1 parent
209ffd5
commit b05710f
Showing
18 changed files
with
80 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
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
26 changes: 26 additions & 0 deletions
26
shared/src/main/java/net/blay09/mods/waystones/api/WaystoneTypes.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,26 @@ | ||
package net.blay09.mods.waystones.api; | ||
|
||
import net.blay09.mods.waystones.Waystones; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.item.DyeColor; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class WaystoneTypes { | ||
public static final ResourceLocation WAYSTONE = new ResourceLocation(Waystones.MOD_ID, "waystone"); | ||
public static final ResourceLocation WARP_PLATE = new ResourceLocation(Waystones.MOD_ID, "warp_plate"); | ||
public static final ResourceLocation PORTSTONE = new ResourceLocation(Waystones.MOD_ID, "portstone"); | ||
|
||
private static final ResourceLocation SHARESTONE = new ResourceLocation(Waystones.MOD_ID, "sharestone"); | ||
|
||
public static ResourceLocation getSharestone(@Nullable DyeColor color) { | ||
if (color == null) { | ||
return SHARESTONE; | ||
} | ||
|
||
return new ResourceLocation(Waystones.MOD_ID, color.getSerializedName() + "_sharestone"); | ||
} | ||
|
||
public static boolean isSharestone(ResourceLocation waystoneType) { | ||
return waystoneType.equals(SHARESTONE) || waystoneType.getPath().endsWith("_sharestone"); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
shared/src/main/java/net/blay09/mods/waystones/api/WaystonesListReceivedEvent.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,30 @@ | ||
package net.blay09.mods.waystones.api; | ||
|
||
import net.blay09.mods.balm.api.event.BalmEvent; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This event is fired on the client side when the client has received a list of waystones of the player. | ||
* <p> | ||
* Note that for WaystoneTypes.WAYSTONE, the list will only contain the waystones that the player has discovered. | ||
*/ | ||
public class WaystonesListReceivedEvent extends BalmEvent { | ||
|
||
private final ResourceLocation waystoneType; | ||
private final List<IWaystone> waystones; | ||
|
||
public WaystonesListReceivedEvent(ResourceLocation waystoneType, List<IWaystone> waystones) { | ||
this.waystoneType = waystoneType; | ||
this.waystones = waystones; | ||
} | ||
|
||
public ResourceLocation getWaystoneType() { | ||
return waystoneType; | ||
} | ||
|
||
public List<IWaystone> getWaystones() { | ||
return waystones; | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
shared/src/main/java/net/blay09/mods/waystones/core/WarpMode.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
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