-
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.
- Loading branch information
Showing
14 changed files
with
90 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,23 +1,25 @@ | ||
package com.lx862.mozccaps; | ||
|
||
import com.lx862.mozccaps.armor.CapArmorMaterial; | ||
import com.lx862.mozccaps.armor.CapModel; | ||
import com.lx862.mozccaps.network.Networking; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; | ||
import net.minecraft.item.ArmorItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class Main implements ModInitializer { | ||
public static final Item CAPS = new ArmorItem(new CapArmorMaterial(), ArmorItem.Type.HELMET, new FabricItemSettings()); | ||
public static final Item CAPS_STRAPPED = new ArmorItem(new CapArmorMaterial(), ArmorItem.Type.HELMET, new FabricItemSettings()); | ||
public static final Item CAPS = new ArmorItem(RegistryEntry.of(CapModel.ARMOR_MATERIAL), ArmorItem.Type.HELMET, new Item.Settings()); | ||
public static final Item CAPS_STRAPPED = new ArmorItem(RegistryEntry.of(CapModel.ARMOR_MATERIAL), ArmorItem.Type.HELMET, new Item.Settings()); | ||
|
||
@Override | ||
public void onInitialize() { | ||
Registry.register(Registries.ARMOR_MATERIAL, new Identifier("mozc_caps", "armor_material"), CapModel.ARMOR_MATERIAL); | ||
Registry.register(Registries.ITEM, new Identifier("mozc_caps", "caps"), CAPS); | ||
Registry.register(Registries.ITEM, new Identifier("mozc_caps", "caps_strapped"), CAPS_STRAPPED); | ||
Networking.registerReceiverServer(); | ||
|
||
Networking.registerServer(); | ||
} | ||
} |
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
52 changes: 0 additions & 52 deletions
52
src/main/java/com/lx862/mozccaps/armor/CapArmorMaterial.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
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
src/main/java/com/lx862/mozccaps/network/PlayerTypePayload.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 com.lx862.mozccaps.network; | ||
|
||
import net.minecraft.network.RegistryByteBuf; | ||
import net.minecraft.network.codec.PacketCodec; | ||
import net.minecraft.network.packet.CustomPayload; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.Uuids; | ||
|
||
import java.util.UUID; | ||
|
||
public record PlayerTypePayload(UUID player) implements CustomPayload { | ||
public static final CustomPayload.Id<PlayerTypePayload> PACKET_ID = new CustomPayload.Id<>(new Identifier("mozc_caps", "player_typed")); | ||
public static final PacketCodec<RegistryByteBuf, PlayerTypePayload> PACKET_CODEC = Uuids.PACKET_CODEC.xmap(PlayerTypePayload::new, PlayerTypePayload::player).cast(); | ||
|
||
@Override | ||
public Id<? extends CustomPayload> getId() { | ||
return PACKET_ID; | ||
} | ||
|
||
public UUID getPlayerUuid() { | ||
return player; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
} | ||
}, | ||
"result": { | ||
"item": "mozc_caps:caps", | ||
"id": "mozc_caps:caps", | ||
"count": 1 | ||
} | ||
} |
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
} | ||
}, | ||
"result": { | ||
"item": "mozc_caps:caps_strapped", | ||
"id": "mozc_caps:caps_strapped", | ||
"count": 1 | ||
} | ||
} |
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 |
---|---|---|
|
@@ -33,6 +33,6 @@ | |
"depends": { | ||
"fabricloader": "*", | ||
"fabric-api": "*", | ||
"minecraft": "~1.20" | ||
"minecraft": ">1.20.4" | ||
} | ||
} |