Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package com.craftingdead.core.world.item;

import java.util.List;
import java.util.Objects;
import java.util.OptionalInt;
import java.util.concurrent.ThreadLocalRandom;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -69,12 +70,20 @@ public ICapabilityProvider initCapabilities(ItemStack itemStack, @Nullable Compo
@Override
public void appendHoverText(ItemStack itemStack, @Nullable Level level,
List<Component> lines, TooltipFlag flag) {
var skins = Skins.REGISTRY.get(this.skin).getAcceptedGuns();
if (skins == null || skins.isEmpty()) {
lines.add(new TranslatableComponent("paint.no_guns")
.withStyle(ChatFormatting.GRAY));
return;
}
lines.add(new TranslatableComponent("paint.accepted_guns")
.withStyle(ChatFormatting.GRAY));
Skins.REGISTRY.get(this.skin).getAcceptedGuns().stream()
skins.stream()
.map(ForgeRegistries.ITEMS::getValue)
.filter(Objects::nonNull)
.map(Item::getDescription)
.map(text -> text.copy().withStyle(ChatFormatting.RED))
.forEach(lines::add);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,24 @@ public class Skins {

static {
register(VULCAN, ModItems.AK47);
register(ASMO, ModItems.AK47, ModItems.AWP, ModItems.M4A1, ModItems.P250, ModItems.P90,
ModItems.SCARL);
register(CANDY_APPLE, ModItems.AS50, ModItems.M107);
register(CYREX, ModItems.M4A1, ModItems.M9);
register(DIAMOND, ModItems.AS50, ModItems.DMR, ModItems.M107, ModItems.M4A1);
register(ASMO, ModItems.AK47, ModItems.AWP); // M4A1, P250, P90, SCAR-L
register(CANDY_APPLE); // AS50, M107
register(CYREX); // M4A1, M9
register(DIAMOND); // AS50, DMR, M107, M4A1
register(DRAGON, ModItems.AWP);
register(FADE, ModItems.G18, ModItems.MAC10);
register(FURY, ModItems.MINIGUN);
register(GEM, ModItems.P90);
register(INFERNO, ModItems.DESERT_EAGLE, ModItems.M4A1);
register(RUBY, ModItems.P90);
register(SCORCHED, ModItems.AWP, ModItems.DESERT_EAGLE, ModItems.DMR, ModItems.M4A1);
register(SLAUGHTER, ModItems.VECTOR);
register(UV, ModItems.MAC10);
register(HYPER_BEAST, ModItems.M4A1);
register(EMPEROR_DRAGON, ModItems.M4A1);
register(FADE); // G18, MAC-10
register(FURY); // Minigun
register(GEM); // P90
register(INFERNO, ModItems.DESERT_EAGLE); // M4A1
register(RUBY); // P90
register(SCORCHED, ModItems.AWP, ModItems.DESERT_EAGLE); // DMR, M4A1
register(SLAUGHTER); // Vector
register(UV); // MAC-10
register(HYPER_BEAST); // M4A1
register(EMPEROR_DRAGON); // M4A1
register(NUCLEAR_WINTER, ModItems.DESERT_EAGLE);
register(MONARCH, ModItems.AWP);
register(LOVELACE, ModItems.DESERT_EAGLE, ModItems.M4A1);
register(LOVELACE, ModItems.DESERT_EAGLE); // M4A1
}

private static <T> ResourceKey<Registry<T>> createRegistryKey(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"clothing_item.water_breathing": "Gives water breathing ability",
"clothing_item.water_speed": "Increases swimming speed",
"paint.accepted_guns":"Use with:",
"paint.no_guns": "Coming soon...",

"attachment_multiplier_type.damage": "Damage",
"attachment_multiplier_type.accuracy": "Accuracy",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class ServerConfig {

public final ForgeConfigSpec.BooleanValue allowSupplyDropBreak;
public final ForgeConfigSpec.IntValue supplyDropDuration;
public final ForgeConfigSpec.BooleanValue showSubtitles;

// ================================================================================
// Loot Values
Expand Down Expand Up @@ -256,11 +255,6 @@ public ServerConfig(ForgeConfigSpec.Builder builder) {
.translation("options.craftingdeadsurvival.server.supply_drop_duration")
.comment("Duration in seconds before a Supply Drop disappears from the world")
.defineInRange("supplyDropDuration", 1200, 1, Integer.MAX_VALUE);

this.showSubtitles = builder
.translation("options.craftingdeadsurvival.server.show_subtitles")
.comment("If true, allow the subtitles overlay to render for players")
.define("showSubtitles", true);
}
builder.pop();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package com.craftingdead.survival.mixin;

import com.craftingdead.survival.CraftingDeadSurvival;
import net.minecraft.client.gui.components.SubtitleOverlay;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -30,8 +29,8 @@ public class SubtitleOverlayMixin {

@Inject(method = "render", at = @At("HEAD"), cancellable = true)
private void disableSoundTextRendering(CallbackInfo ci) {
if (!CraftingDeadSurvival.serverConfig.showSubtitles.get()) {
ci.cancel();
}
// if (!CraftingDeadSurvival.serverConfig.showSubtitles.get()) {
// ci.cancel();
// }
}
}
}