This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shuffle around a lot of constants. Categorize.
- Loading branch information
1 parent
bbafca8
commit 4422398
Showing
52 changed files
with
207 additions
and
336 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
17 changes: 0 additions & 17 deletions
17
core-api/src/main/java/dev/compactmods/machines/api/CMBlocks.java
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
core-api/src/main/java/dev/compactmods/machines/api/CompactMachinesAddon.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...pactmods/machines/api/core/Constants.java → ...v/compactmods/machines/api/Constants.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
12 changes: 0 additions & 12 deletions
12
core-api/src/main/java/dev/compactmods/machines/api/ICompactMachinesAddon.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...mpactmods/machines/api/core/Messages.java → ...ev/compactmods/machines/api/Messages.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
2 changes: 1 addition & 1 deletion
2
...mpactmods/machines/api/core/Tooltips.java → ...ev/compactmods/machines/api/Tooltips.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
3 changes: 2 additions & 1 deletion
3
...tmods/machines/api/core/Advancements.java → ...achines/api/advancement/Advancements.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
2 changes: 1 addition & 1 deletion
2
...tmods/machines/codec/CodecExtensions.java → ...s/machines/api/codec/CodecExtensions.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
2 changes: 1 addition & 1 deletion
2
...achines/codec/DoubleStreamExtensions.java → ...nes/api/codec/DoubleStreamExtensions.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
2 changes: 1 addition & 1 deletion
2
...mods/machines/codec/NbtListCollector.java → .../machines/api/codec/NbtListCollector.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
4 changes: 2 additions & 2 deletions
4
...actmods/machines/api/core/CMCommands.java → ...mods/machines/api/command/CMCommands.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
41 changes: 0 additions & 41 deletions
41
core-api/src/main/java/dev/compactmods/machines/api/core/CMTags.java
This file was deleted.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
core-api/src/main/java/dev/compactmods/machines/api/location/GlobalPosWithRotation.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,40 @@ | ||
package dev.compactmods.machines.api.location; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import dev.compactmods.machines.api.codec.CodecExtensions; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.GlobalPos; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.phys.Vec2; | ||
import net.minecraft.world.phys.Vec3; | ||
|
||
public record GlobalPosWithRotation(ResourceKey<Level> dimension, Vec3 position, Vec2 rotation) { | ||
|
||
/* | ||
* BlockPos also technically supported here, since pos matches GlobalPos.CODEC#pos - only difference | ||
* here is that BlockPos uses an INT stream, while VEC3D uses a double stream. | ||
*/ | ||
public static final Codec<GlobalPosWithRotation> CODEC = RecordCodecBuilder.create(i -> i.group( | ||
ResourceKey.codec(Registries.DIMENSION).fieldOf("dimension").forGetter(GlobalPosWithRotation::dimension), | ||
CodecExtensions.VECTOR3D.fieldOf("pos").forGetter(GlobalPosWithRotation::position), | ||
CodecExtensions.VEC2.optionalFieldOf("rot", Vec2.ZERO).forGetter(x -> x.rotation) | ||
).apply(i, GlobalPosWithRotation::new)); | ||
|
||
public static final GlobalPosWithRotation INVALID = new GlobalPosWithRotation(GlobalPos.of(Level.OVERWORLD, BlockPos.ZERO), Vec2.ZERO); | ||
|
||
public GlobalPosWithRotation(GlobalPos pos, Vec2 rotation) { | ||
this(pos.dimension(), Vec3.atBottomCenterOf(pos.pos()), rotation); | ||
} | ||
|
||
public GlobalPosWithRotation(ResourceKey<Level> dimension, BlockPos position, Vec2 rotation) { | ||
this(dimension, Vec3.atBottomCenterOf(position), rotation); | ||
} | ||
|
||
public static GlobalPosWithRotation fromPlayer(Player player) { | ||
return new GlobalPosWithRotation(player.level().dimension(), player.position(), new Vec2(player.xRotO, player.yRotO)); | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
core-api/src/main/java/dev/compactmods/machines/api/location/IDimensionalPosition.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ines/api/machine/IMachineBlockEntity.java → ...machines/api/machine/IColoredMachine.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,5 @@ | ||
package dev.compactmods.machines.api.machine; | ||
|
||
public interface IMachineBlockEntity { | ||
public interface IColoredMachine { | ||
int getColor(); | ||
} |
36 changes: 36 additions & 0 deletions
36
core-api/src/main/java/dev/compactmods/machines/api/machine/MachineConstants.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 dev.compactmods.machines.api.machine; | ||
|
||
import dev.compactmods.machines.api.Constants; | ||
import dev.compactmods.machines.api.util.KeyHelper; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
public interface MachineConstants { | ||
|
||
ResourceLocation BOUND_MACHINE_BLOCK_ID = new ResourceLocation(Constants.MOD_ID, "machine"); | ||
ResourceLocation BOUND_MACHINE_ENTITY = new ResourceLocation(Constants.MOD_ID, "machine"); | ||
|
||
ResourceLocation UNBOUND_MACHINE_BLOCK_ID = new ResourceLocation(Constants.MOD_ID, "new_machine"); | ||
ResourceLocation UNBOUND_MACHINE_ITEM_ID = new ResourceLocation(Constants.MOD_ID, "new_machine"); | ||
ResourceLocation UNBOUND_MACHINE_ENTITY = new ResourceLocation(Constants.MOD_ID, "new_machine"); | ||
|
||
ResourceKey<Block> UNBOUND_MACHINE_BLOCK_RESKEY = KeyHelper.blockResKey("new_machine"); | ||
ResourceKey<Item> UNBOUND_MACHINE_ITEM_RESKEY = KeyHelper.itemResKey("new_machine"); | ||
|
||
/** | ||
* Marks a block as an unbound Compact Machine; applied only to machines that are not yet bound to a room. | ||
*/ | ||
TagKey<Block> UNBOUND_MACHINE_BLOCK = KeyHelper.blockTag("new_machine"); | ||
|
||
/** | ||
* Marks a block as a bound Compact Machine; applied only to machines that are bound to a room. | ||
*/ | ||
TagKey<Block> BOUND_MACHINE_BLOCK = KeyHelper.blockTag("bound_machine"); | ||
|
||
TagKey<Block> MACHINE_BLOCK = KeyHelper.blockTag("machine"); | ||
TagKey<Item> MACHINE_ITEM = KeyHelper.itemTagKey("machine"); | ||
|
||
} |
8 changes: 0 additions & 8 deletions
8
core-api/src/main/java/dev/compactmods/machines/api/machine/MachineEntityNbt.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
core-api/src/main/java/dev/compactmods/machines/api/machine/MachineIds.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
core-api/src/main/java/dev/compactmods/machines/api/machine/MachineNbt.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
core-api/src/main/java/dev/compactmods/machines/api/machine/MachineTags.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
core-api/src/main/java/dev/compactmods/machines/api/room/WallConstants.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,25 @@ | ||
package dev.compactmods.machines.api.room; | ||
|
||
import dev.compactmods.machines.api.util.KeyHelper; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
public interface WallConstants { | ||
|
||
ResourceKey<Block> BREAKABLE_WALL = KeyHelper.blockResKey("wall"); | ||
ResourceKey<Block> SOLID_WALL = KeyHelper.blockResKey("solid_wall"); | ||
|
||
/** | ||
* Applied to solid wall items. | ||
*/ | ||
TagKey<Item> TAG_SOLID_WALL_ITEMS = KeyHelper.itemTagKey("solid_walls"); | ||
|
||
/** | ||
* Applied to solid walls and tunnel blocks. | ||
*/ | ||
TagKey<Block> TAG_SOLID_WALL_BLOCKS = KeyHelper.blockTag("solid_walls"); | ||
|
||
|
||
} |
3 changes: 1 addition & 2 deletions
3
core-api/src/main/java/dev/compactmods/machines/api/shrinking/PSDTags.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
Oops, something went wrong.