对齐击杀提示
This commit is contained in:
parent
e9d77974b9
commit
a4cd9e40d9
3 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,7 @@ plugins {
|
||||||
id 'org.spongepowered.mixin' version '0.7.+'
|
id 'org.spongepowered.mixin' version '0.7.+'
|
||||||
}
|
}
|
||||||
|
|
||||||
version = '0.0.7-SNAPSHOT'
|
version = '0.0.8-SNAPSHOT'
|
||||||
group = 'com.Atsushio.target'
|
group = 'com.Atsushio.target'
|
||||||
archivesBaseName = 'target'
|
archivesBaseName = 'target'
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class KillMessageOverlay {
|
||||||
event.getGuiGraphics().drawString(
|
event.getGuiGraphics().drawString(
|
||||||
Minecraft.getInstance().font,
|
Minecraft.getInstance().font,
|
||||||
attackerName,
|
attackerName,
|
||||||
w - 2 * targetNameWidth - 36 - attackerNameWidth,
|
w - targetNameWidth - 50 - attackerNameWidth,
|
||||||
h,
|
h,
|
||||||
record.attacker.getTeamColor(),
|
record.attacker.getTeamColor(),
|
||||||
false
|
false
|
||||||
|
@ -61,14 +61,15 @@ public class KillMessageOverlay {
|
||||||
ResourceLocation resourceLocation = gunItem.getGunIcon();
|
ResourceLocation resourceLocation = gunItem.getGunIcon();
|
||||||
|
|
||||||
event.getGuiGraphics().blit(resourceLocation,
|
event.getGuiGraphics().blit(resourceLocation,
|
||||||
w - 2 * targetNameWidth - 30,
|
w - targetNameWidth - 46,
|
||||||
h,
|
h,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
32,
|
32,
|
||||||
8,
|
8,
|
||||||
-32,
|
-32,
|
||||||
8);
|
8
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.getGuiGraphics().drawString(
|
event.getGuiGraphics().drawString(
|
||||||
|
|
|
@ -225,6 +225,7 @@ public class LivingEntityEventHandler {
|
||||||
DamageSource source = event.getSource();
|
DamageSource source = event.getSource();
|
||||||
|
|
||||||
if (source.getDirectEntity() instanceof ServerPlayer player) {
|
if (source.getDirectEntity() instanceof ServerPlayer player) {
|
||||||
|
// TODO 修改发包
|
||||||
if (source.is(TargetModDamageTypes.GUN_FIRE)) {
|
if (source.is(TargetModDamageTypes.GUN_FIRE)) {
|
||||||
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new PlayerKillMessage(player.getId(), entity.getId(), false));
|
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new PlayerKillMessage(player.getId(), entity.getId(), false));
|
||||||
} else if (source.is(TargetModDamageTypes.GUN_FIRE_HEADSHOT)) {
|
} else if (source.is(TargetModDamageTypes.GUN_FIRE_HEADSHOT)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue