-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from railcraft-reborn/goggles
Change aura by key
- Loading branch information
Showing
15 changed files
with
181 additions
and
99 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8
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,2 +1,2 @@ | ||
// 1.20.1 2023-08-28T12:04:48.331781 Languages: en_us | ||
de762e91a530cb57804e562cb066132c7827113e assets/railcraft/lang/en_us.json | ||
// 1.20.1 2023-09-04T20:53:55.046849 Languages: en_us | ||
9f0012e8e466d4e0775e6550ef59e1001ffef02e assets/railcraft/lang/en_us.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package mods.railcraft.client; | ||
|
||
import org.lwjgl.glfw.GLFW; | ||
import com.mojang.blaze3d.platform.InputConstants; | ||
import mods.railcraft.Translations; | ||
import net.minecraft.client.KeyMapping; | ||
import net.minecraftforge.client.settings.KeyConflictContext; | ||
|
||
public class KeyBinding { | ||
|
||
public static final KeyMapping CHANGE_AURA_KEY = | ||
new KeyMapping(Translations.KeyBinding.CHANGE_AURA, KeyConflictContext.IN_GAME, | ||
InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_G, Translations.KeyBinding.CATEGORY); | ||
} |
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
28 changes: 28 additions & 0 deletions
28
src/main/java/mods/railcraft/network/play/UpdateAuraByKeyMessage.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,28 @@ | ||
package mods.railcraft.network.play; | ||
|
||
import java.util.function.Supplier; | ||
import mods.railcraft.world.item.GogglesItem; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraftforge.network.NetworkEvent; | ||
|
||
public record UpdateAuraByKeyMessage(CompoundTag tag) { | ||
|
||
public void encode(FriendlyByteBuf out) { | ||
out.writeNbt(tag); | ||
} | ||
|
||
public static UpdateAuraByKeyMessage decode(FriendlyByteBuf in) { | ||
return new UpdateAuraByKeyMessage(in.readNbt()); | ||
} | ||
|
||
public boolean handle(Supplier<NetworkEvent.Context> context) { | ||
var player = context.get().getSender(); | ||
var itemStack = player.getItemBySlot(EquipmentSlot.HEAD); | ||
if (itemStack.getItem() instanceof GogglesItem) { | ||
itemStack.setTag(tag); | ||
} | ||
return true; | ||
} | ||
} |
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
Oops, something went wrong.