mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 13:37:58 +01:00
1.18 -> 1.19
This commit is contained in:
parent
9e1b9161b8
commit
ded553bd31
90 changed files with 320 additions and 319 deletions
|
@ -1,6 +1,6 @@
|
|||
plugins {
|
||||
id 'java-library'
|
||||
id 'fabric-loom' version '0.10-SNAPSHOT'
|
||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
||||
id 'org.ajoberstar.reckon' version '0.13.0'
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ java {
|
|||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
group = project.group
|
||||
|
@ -65,8 +66,3 @@ processResources {
|
|||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = "sources"
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ org.gradle.daemon=false
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.18.2
|
||||
yarn_mappings=1.18.2+build.1
|
||||
loader_version=0.13.3
|
||||
fabric_version=0.47.8+1.18.2
|
||||
minecraft_version=1.19
|
||||
yarn_mappings=1.19+build.1
|
||||
loader_version=0.14.7
|
||||
fabric_version=0.55.3+1.19
|
||||
|
||||
# Mod Properties
|
||||
group=com.minelittlepony
|
||||
|
@ -15,6 +15,6 @@ org.gradle.daemon=false
|
|||
description=Magical Abilities for Mine Little Pony!
|
||||
|
||||
# Dependencies
|
||||
modmenu_version=3.1.0
|
||||
minelp_version=4.4.4
|
||||
kirin_version=1.10.0
|
||||
modmenu_version=4.0.0
|
||||
minelp_version=4.5.1
|
||||
kirin_version=1.11.0
|
||||
|
|
|
@ -48,7 +48,7 @@ public class InteractionManager {
|
|||
/**
|
||||
* Plays a custom sound instance
|
||||
*/
|
||||
public void playLoopingSound(Entity source, int type) {
|
||||
public void playLoopingSound(Entity source, int type, long seed) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import com.minelittlepony.unicopia.ability.magic.Affine;
|
|||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public enum Race implements Affine {
|
||||
|
@ -86,11 +85,11 @@ public enum Race implements Affine {
|
|||
}
|
||||
|
||||
public Text getDisplayName() {
|
||||
return new TranslatableText(getTranslationKey());
|
||||
return Text.translatable(getTranslationKey());
|
||||
}
|
||||
|
||||
public Text getAltDisplayName() {
|
||||
return new TranslatableText(getTranslationKey() + ".alt");
|
||||
return Text.translatable(getTranslationKey() + ".alt");
|
||||
}
|
||||
|
||||
public String getTranslationKey() {
|
||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.server.world.ServerWorld;
|
|||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.world.PersistentState;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.dimension.DimensionTypes;
|
||||
|
||||
public class WorldTribeManager extends PersistentState {
|
||||
|
||||
|
@ -31,13 +32,13 @@ public class WorldTribeManager extends PersistentState {
|
|||
}
|
||||
|
||||
public static String nameFor(RegistryEntry<DimensionType> dimension) {
|
||||
if (dimension.matchesKey(DimensionType.THE_END_REGISTRY_KEY)) {
|
||||
if (dimension.matchesKey(DimensionTypes.THE_END)) {
|
||||
return "unicopia:tribes_end";
|
||||
}
|
||||
return "unicopia:tribes";
|
||||
}
|
||||
|
||||
public static WorldTribeManager forWorld(ServerWorld world) {
|
||||
return world.getPersistentStateManager().getOrCreate(WorldTribeManager::new, WorldTribeManager::new, nameFor(world.method_40134()));
|
||||
return world.getPersistentStateManager().getOrCreate(WorldTribeManager::new, WorldTribeManager::new, nameFor(world.getDimensionEntry()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.minelittlepony.unicopia.ability.data.Hit;
|
|||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -79,7 +78,7 @@ public interface Ability<T extends Hit> {
|
|||
*/
|
||||
default Text getName() {
|
||||
Identifier id = Abilities.REGISTRY.getId(this);
|
||||
return new TranslatableText("ability." + id.getNamespace() + "." + id.getPath().replace('/', '.'));
|
||||
return Text.translatable("ability." + id.getNamespace() + "." + id.getPath().replace('/', '.'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.minelittlepony.unicopia.ability;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.minelittlepony.unicopia.AwaitTickQueue;
|
||||
import com.minelittlepony.unicopia.EquinePredicates;
|
||||
import com.minelittlepony.unicopia.Race;
|
||||
|
@ -15,6 +13,7 @@ import com.minelittlepony.unicopia.util.MagicalDamageSource;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
* A magic casting ability for unicorns.
|
||||
|
|
|
@ -182,7 +182,7 @@ public class EarthPonyStompAbility implements Ability<Hit> {
|
|||
ItemStack stack = UItems.PEBBLES.getDefaultStack();
|
||||
stack.setCount(1 + w.getRandom().nextInt(2));
|
||||
Block.dropStack(w, pos, stack);
|
||||
state.onStacksDropped((ServerWorld)w, pos, stack);
|
||||
state.onStacksDropped((ServerWorld)w, pos, stack, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.minelittlepony.unicopia.particle.MagicParticleEffect;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.level.ServerWorldProperties;
|
||||
|
@ -109,7 +109,7 @@ public class PegasusCaptureStormAbility implements Ability<Hit> {
|
|||
}
|
||||
|
||||
private void tell(Pony player, String translation) {
|
||||
player.getMaster().sendMessage(new TranslatableText(translation), true);
|
||||
player.getMaster().sendMessage(Text.translatable(translation), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.minelittlepony.unicopia.ability;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.unicopia.Race;
|
||||
|
@ -25,6 +23,7 @@ import net.minecraft.util.ActionResult;
|
|||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
* Casts magic onto the user directly, or uses the item in the main hand slot.
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.minelittlepony.unicopia.particle.MagicParticleEffect;
|
|||
import com.minelittlepony.unicopia.util.RayTraceHelper;
|
||||
import com.minelittlepony.unicopia.util.VecHelper;
|
||||
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
/**
|
||||
* Dispells an active spell
|
||||
|
@ -46,9 +46,9 @@ public class UnicornDispellAbility implements Ability<Pos> {
|
|||
if (type.getTapCount() > 1) {
|
||||
player.setAnimation(Animation.WOLOLO, 10);
|
||||
if (player.getSpellSlot().clear()) {
|
||||
player.getMaster().sendMessage(new TranslatableText("gui.unicopia.action.spells_cleared"), true);
|
||||
player.getMaster().sendMessage(Text.translatable("gui.unicopia.action.spells_cleared"), true);
|
||||
} else {
|
||||
player.getMaster().sendMessage(new TranslatableText("gui.unicopia.action.no_spells_cleared"), true);
|
||||
player.getMaster().sendMessage(Text.translatable("gui.unicopia.action.no_spells_cleared"), true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class InfernoSpell extends FireSpell {
|
|||
|
||||
Vec3d origin = source.getOriginVector();
|
||||
|
||||
BlockStateConverter converter = w.getDimension().isUltrawarm() ? StateMaps.HELLFIRE_AFFECTED.getInverse() : StateMaps.HELLFIRE_AFFECTED;
|
||||
BlockStateConverter converter = w.getDimension().ultrawarm() ? StateMaps.HELLFIRE_AFFECTED.getInverse() : StateMaps.HELLFIRE_AFFECTED;
|
||||
|
||||
for (int i = 0; i < radius; i++) {
|
||||
BlockPos pos = new BlockPos(shape.computePoint(w.random).add(origin));
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.minelittlepony.unicopia.util.Registries;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
@ -124,7 +123,7 @@ public final class SpellType<T extends Spell> implements Affine, SpellPredicate<
|
|||
}
|
||||
|
||||
public Text getName() {
|
||||
return new TranslatableText(getTranslationKey());
|
||||
return Text.translatable(getTranslationKey());
|
||||
}
|
||||
|
||||
public CustomisedSpellType<T> withTraits() {
|
||||
|
|
|
@ -13,8 +13,7 @@ import com.minelittlepony.common.client.gui.Tooltip;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtElement;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.*;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
|
@ -91,14 +90,14 @@ public enum Trait {
|
|||
: Formatting.WHITE;
|
||||
|
||||
return Tooltip.of(
|
||||
new TranslatableText("gui.unicopia.trait.label",
|
||||
new TranslatableText("trait." + getId().getNamespace() + "." + getId().getPath() + ".name")
|
||||
Text.translatable("gui.unicopia.trait.label",
|
||||
Text.translatable("trait." + getId().getNamespace() + "." + getId().getPath() + ".name")
|
||||
).formatted(Formatting.YELLOW)
|
||||
.append(new TranslatableText("gui.unicopia.trait.group", getGroup().name().toLowerCase()).formatted(Formatting.ITALIC, Formatting.GRAY))
|
||||
.append(new LiteralText("\n\n").formatted(Formatting.WHITE)
|
||||
.append(new TranslatableText("trait." + getId().getNamespace() + "." + getId().getPath() + ".description").formatted(Formatting.GRAY))
|
||||
.append(Text.translatable("gui.unicopia.trait.group", getGroup().name().toLowerCase()).formatted(Formatting.ITALIC, Formatting.GRAY))
|
||||
.append(Text.literal("\n\n").formatted(Formatting.WHITE)
|
||||
.append(Text.translatable("trait." + getId().getNamespace() + "." + getId().getPath() + ".description").formatted(Formatting.GRAY))
|
||||
.append("\n")
|
||||
.append(new TranslatableText("gui.unicopia.trait.corruption", ItemStack.MODIFIER_FORMAT.format(getGroup().getCorruption())).formatted(Formatting.ITALIC, corruptionColor))), 200);
|
||||
.append(Text.translatable("gui.unicopia.trait.corruption", ItemStack.MODIFIER_FORMAT.format(getGroup().getCorruption())).formatted(Formatting.ITALIC, corruptionColor))), 200);
|
||||
}
|
||||
|
||||
public static Collection<Trait> all() {
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
|||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
@ -53,7 +52,7 @@ public class TraitLoader extends SinglePreparationResourceReloader<Multimap<Iden
|
|||
|
||||
Multimap<Identifier, TraitStream> prepared = HashMultimap.create();
|
||||
|
||||
for (Identifier path : new HashSet<>(manager.findResources("traits", p -> p.endsWith(".json")))) {
|
||||
for (var path : manager.findResources("traits", p -> p.getPath().endsWith(".json")).keySet()) {
|
||||
profiler.push(path.toString());
|
||||
try {
|
||||
for (Resource resource : manager.getAllResources(path)) {
|
||||
|
|
|
@ -28,7 +28,7 @@ public class FrostedObsidianBlock extends FrostedIceBlock {
|
|||
|
||||
@Override
|
||||
protected void melt(BlockState state, World world, BlockPos pos) {
|
||||
if (world.getDimension().isUltrawarm()) {
|
||||
if (world.getDimension().ultrawarm()) {
|
||||
world.removeBlock(pos, false);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.minelittlepony.unicopia.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.minelittlepony.unicopia.EquinePredicates;
|
||||
import com.minelittlepony.unicopia.item.UItems;
|
||||
|
||||
|
@ -11,6 +9,7 @@ import net.minecraft.block.ShapeContext;
|
|||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.entity.passive.BeeEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.vehicle.AbstractMinecartEntity;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ClientInteractionManager extends InteractionManager {
|
||||
|
@ -50,12 +51,12 @@ public class ClientInteractionManager extends InteractionManager {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void playLoopingSound(Entity source, int type) {
|
||||
public void playLoopingSound(Entity source, int type, long seed) {
|
||||
client.execute(() -> {
|
||||
SoundManager soundManager = client.getSoundManager();
|
||||
|
||||
if (type == SOUND_EARS_RINGING && source instanceof LivingEntity) {
|
||||
soundManager.play(new LoopingSoundInstance<>((LivingEntity)source, e -> e.hasStatusEffect(UEffects.SUN_BLINDNESS), USounds.ENTITY_PLAYER_EARS_RINGING, 1, 1));
|
||||
soundManager.play(new LoopingSoundInstance<>((LivingEntity)source, e -> e.hasStatusEffect(UEffects.SUN_BLINDNESS), USounds.ENTITY_PLAYER_EARS_RINGING, 1, 1, Random.create(seed)));
|
||||
} else if (type == SOUND_BEE && source instanceof BeeEntity) {
|
||||
soundManager.playNextTick(
|
||||
((BeeEntity)source).hasAngerTime()
|
||||
|
@ -68,11 +69,11 @@ public class ClientInteractionManager extends InteractionManager {
|
|||
soundManager.play(new LoopingSoundInstance<>((PlayerEntity)source, e -> {
|
||||
PlayerPhysics physics = Pony.of(e).getPhysics();
|
||||
return physics.isFlying() && physics.getFlightType() == FlightType.INSECTOID;
|
||||
}, USounds.ENTITY_PLAYER_CHANGELING_BUZZ, 1F, 1F));
|
||||
}, USounds.ENTITY_PLAYER_CHANGELING_BUZZ, 1F, 1F, Random.create(seed)));
|
||||
} else if (type == SOUND_GLIDING && source instanceof PlayerEntity) {
|
||||
soundManager.play(new MotionBasedSoundInstance(SoundEvents.ITEM_ELYTRA_FLYING, (PlayerEntity)source));
|
||||
soundManager.play(new MotionBasedSoundInstance(SoundEvents.ITEM_ELYTRA_FLYING, (PlayerEntity)source, Random.create(seed)));
|
||||
} else if (type == SOUND_MAGIC_BEAM) {
|
||||
soundManager.play(new LoopedEntityTrackingSoundInstance(USounds.SPELL_CAST_SHOOT, 0.3F, 1F, source));
|
||||
soundManager.play(new LoopedEntityTrackingSoundInstance(USounds.SPELL_CAST_SHOOT, 0.3F, 1F, source, seed));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -13,13 +13,12 @@ import net.minecraft.client.toast.Toast;
|
|||
import net.minecraft.client.toast.ToastManager;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class DiscoveryToast implements Toast {
|
||||
private static final long MAX_AGE = 5000L;
|
||||
private static final Text TITLE = new TranslatableText("unicopia.toast.discoveries.title");
|
||||
private static final Text DESCRIPTION = new TranslatableText("unicopia.toast.discoveries.description");
|
||||
private static final Text TITLE = Text.translatable("unicopia.toast.discoveries.title");
|
||||
private static final Text DESCRIPTION = Text.translatable("unicopia.toast.discoveries.description");
|
||||
|
||||
private final List<Identifier> discoveries = new ArrayList<>();
|
||||
private long startTime;
|
||||
|
|
|
@ -4,16 +4,14 @@ import java.util.Optional;
|
|||
import java.util.stream.Stream;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Style;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.*;
|
||||
|
||||
public interface FlowingText {
|
||||
static Stream<Text> wrap(Text text, int maxWidth) {
|
||||
return MinecraftClient.getInstance().textRenderer.getTextHandler().wrapLines(text, maxWidth, Style.EMPTY).stream().map(line -> {
|
||||
LiteralText compiled = new LiteralText("");
|
||||
MutableText compiled = Text.literal("");
|
||||
line.visit((s, t) -> {
|
||||
compiled.append(new LiteralText(t).setStyle(s));
|
||||
compiled.append(Text.literal(t).setStyle(s));
|
||||
return Optional.empty();
|
||||
}, text.getStyle());
|
||||
return compiled;
|
||||
|
|
|
@ -20,7 +20,6 @@ import net.minecraft.client.option.KeyBinding;
|
|||
import net.minecraft.client.sound.PositionedSoundInstance;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class KeyBindingsHandler {
|
||||
|
@ -106,7 +105,7 @@ public class KeyBindingsHandler {
|
|||
private void changePage(MinecraftClient client, long max, int sigma) {
|
||||
page += sigma;
|
||||
client.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.75F + (0.25F * sigma)));
|
||||
UHud.INSTANCE.setMessage(new TranslatableText("gui.unicopia.page_num", page + 1, max + 1));
|
||||
UHud.INSTANCE.setMessage(Text.translatable("gui.unicopia.page_num", page + 1, max + 1));
|
||||
}
|
||||
|
||||
public class Binding {
|
||||
|
|
|
@ -26,9 +26,8 @@ import net.minecraft.entity.attribute.EntityAttributeModifier.Operation;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Pair;
|
||||
|
@ -60,10 +59,10 @@ public class ModifierTooltipRenderer implements ItemTooltipCallback {
|
|||
.forEach(entry -> describeModifiers(entry.getKey(), entry.getValue(), null, newLines));
|
||||
|
||||
if (!newLines.isEmpty()) {
|
||||
Text find = new TranslatableText("item.modifiers." + slot.getName()).formatted(Formatting.GRAY);
|
||||
Text find = Text.translatable("item.modifiers." + slot.getName()).formatted(Formatting.GRAY);
|
||||
int insertPosition = getInsertPosition(stack, find, flags, lines, context.isAdvanced());
|
||||
if (insertPosition == -1) {
|
||||
lines.add(LiteralText.EMPTY);
|
||||
lines.add(ScreenTexts.EMPTY);
|
||||
lines.add(find);
|
||||
lines.addAll(newLines);
|
||||
} else {
|
||||
|
@ -87,23 +86,23 @@ public class ModifierTooltipRenderer implements ItemTooltipCallback {
|
|||
|
||||
if (insertPosition == -1 && stack.hasNbt()) {
|
||||
if (isShowing(flags, ItemStack.TooltipSection.MODIFIERS) && stack.getNbt().getBoolean("Unbreakable")) {
|
||||
insertPosition = checkFor(lines, new TranslatableText("item.unbreakable").formatted(Formatting.BLUE));
|
||||
insertPosition = checkFor(lines, Text.translatable("item.unbreakable").formatted(Formatting.BLUE));
|
||||
}
|
||||
|
||||
if (insertPosition == -1 && isShowing(flags, ItemStack.TooltipSection.CAN_DESTROY) && stack.getNbt().contains("CanDestroy", 9)) {
|
||||
insertPosition = checkFor(lines, new TranslatableText("item.canBreak").formatted(Formatting.GRAY));
|
||||
insertPosition = checkFor(lines, Text.translatable("item.canBreak").formatted(Formatting.GRAY));
|
||||
}
|
||||
|
||||
if (insertPosition == -1 && isShowing(flags, ItemStack.TooltipSection.CAN_PLACE) && stack.getNbt().contains("CanPlaceOn", 9)) {
|
||||
insertPosition = checkFor(lines, new TranslatableText("item.canPlace").formatted(Formatting.GRAY));
|
||||
insertPosition = checkFor(lines, Text.translatable("item.canPlace").formatted(Formatting.GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
if (insertPosition == -1 && advanced) {
|
||||
if (stack.isDamaged()) {
|
||||
insertPosition = checkFor(lines, new TranslatableText("item.durability", stack.getMaxDamage() - stack.getDamage(), stack.getMaxDamage()));
|
||||
insertPosition = checkFor(lines, Text.translatable("item.durability", stack.getMaxDamage() - stack.getDamage(), stack.getMaxDamage()));
|
||||
} else {
|
||||
insertPosition = checkFor(lines, new LiteralText(Registry.ITEM.getId(stack.getItem()).toString()).formatted(Formatting.DARK_GRAY));
|
||||
insertPosition = checkFor(lines, Text.literal(Registry.ITEM.getId(stack.getItem()).toString()).formatted(Formatting.DARK_GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +131,7 @@ public class ModifierTooltipRenderer implements ItemTooltipCallback {
|
|||
}
|
||||
|
||||
if (baseAdjusted) {
|
||||
lines.add(new LiteralText(" ").append(getModifierLineBase("equals", displayValue, op, attribute, Formatting.DARK_GREEN)));
|
||||
lines.add(Text.literal(" ").append(getModifierLineBase("equals", displayValue, op, attribute, Formatting.DARK_GREEN)));
|
||||
} else if (value > 0) {
|
||||
lines.add(getModifierLineBase("plus", displayValue, op, attribute, attribute == PlayerAttributes.ENTITY_GRAVTY_MODIFIER ? Formatting.RED : Formatting.BLUE));
|
||||
} else if (value < 0) {
|
||||
|
@ -141,9 +140,9 @@ public class ModifierTooltipRenderer implements ItemTooltipCallback {
|
|||
}
|
||||
|
||||
private Text getModifierLineBase(String root, double displayValue, Operation op, EntityAttribute attribute, Formatting color) {
|
||||
return new TranslatableText("attribute.modifier." + root + "." + op.getId(),
|
||||
return Text.translatable("attribute.modifier." + root + "." + op.getId(),
|
||||
ItemStack.MODIFIER_FORMAT.format(displayValue),
|
||||
new TranslatableText(attribute.getTranslationKey())
|
||||
Text.translatable(attribute.getTranslationKey())
|
||||
).formatted(color);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry.Pendin
|
|||
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.item.ModelPredicateProviderRegistry;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.SpriteProvider;
|
||||
import net.minecraft.client.render.DiffuseLighting;
|
||||
|
@ -111,7 +111,7 @@ public interface URenderers {
|
|||
matrices.push();
|
||||
|
||||
});
|
||||
FabricModelPredicateProviderRegistry.register(UItems.GEMSTONE, new Identifier("affinity"), (stack, world, entity, seed) -> {
|
||||
ModelPredicateProviderRegistry.register(UItems.GEMSTONE, new Identifier("affinity"), (stack, world, entity, seed) -> {
|
||||
return GemstoneItem.isEnchanted(stack) ? 1 + GemstoneItem.getSpellKey(stack).getAffinity().ordinal() : 0;
|
||||
});
|
||||
ColorProviderRegistry.ITEM.register((stack, i) -> {
|
||||
|
|
|
@ -18,13 +18,13 @@ import com.minelittlepony.unicopia.entity.player.Pony;
|
|||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback;
|
||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.OpenToLanScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreens;
|
||||
import net.minecraft.client.gui.screen.world.CreateWorldScreen;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class UnicopiaClient implements ClientModInitializer {
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class UnicopiaClient implements ClientModInitializer {
|
|||
KeyBindingsHandler.bootstrap();
|
||||
URenderers.bootstrap();
|
||||
|
||||
ScreenRegistry.register(UScreenHandlers.SPELL_BOOK, SpellbookScreen::new);
|
||||
HandledScreens.register(UScreenHandlers.SPELL_BOOK, SpellbookScreen::new);
|
||||
|
||||
ClientTickEvents.END_CLIENT_TICK.register(this::onTick);
|
||||
ScreenInitCallback.EVENT.register(this::onScreenInit);
|
||||
|
@ -83,7 +83,7 @@ public class UnicopiaClient implements ClientModInitializer {
|
|||
if (screen instanceof OpenToLanScreen) {
|
||||
buttons.addButton(new Button(screen.width / 2 - 155, 130, 150, 20))
|
||||
.onClick(b -> MinecraftClient.getInstance().setScreen(new LanSettingsScreen(screen)))
|
||||
.getStyle().setText(new TranslatableText("unicopia.options.title"));
|
||||
.getStyle().setText(Text.translatable("unicopia.options.title"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,11 +19,10 @@ import net.minecraft.client.gui.Selectable;
|
|||
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
|
||||
import net.minecraft.client.sound.PositionedSoundInstance;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.math.Vector4f;
|
||||
|
||||
public class DismissSpellScreen extends GameGui {
|
||||
|
@ -33,7 +32,7 @@ public class DismissSpellScreen extends GameGui {
|
|||
private int relativeMouseY;
|
||||
|
||||
public DismissSpellScreen() {
|
||||
super(new TranslatableText("gui.unicopia.dismiss_spell"));
|
||||
super(Text.translatable("gui.unicopia.dismiss_spell"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,7 +71,7 @@ public class DismissSpellScreen extends GameGui {
|
|||
|
||||
matrices.push();
|
||||
matrices.translate(0, 0, 300);
|
||||
Text cancel = new LiteralText("Press ESC to cancel");
|
||||
Text cancel = Text.literal("Press ESC to cancel");
|
||||
getFont().drawWithShadow(matrices, cancel, (width - getFont().getWidth(cancel)) / 2, height - 30, 0xFFFFFFFF);
|
||||
matrices.pop();
|
||||
}
|
||||
|
@ -105,18 +104,18 @@ public class DismissSpellScreen extends GameGui {
|
|||
SphereModel.convertToCartesianCoord(this, radius, azimuth, azimuth);
|
||||
add(0, -(float)radius / 2F, 0, 0);
|
||||
|
||||
MutableText name = actualSpell.getType().getName().shallowCopy();
|
||||
MutableText name = actualSpell.getType().getName().copy();
|
||||
int color = actualSpell.getType().getColor();
|
||||
name.setStyle(name.getStyle().withColor(color == 0 ? 0xFFAAAAAA : color));
|
||||
|
||||
tooltip.add(new TranslatableText("Spell Type: %s", name));
|
||||
tooltip.add(Text.translatable("Spell Type: %s", name));
|
||||
actualSpell.getType().getTraits().appendTooltip(tooltip);
|
||||
tooltip.add(LiteralText.EMPTY);
|
||||
tooltip.add(new TranslatableText("Affinity: %s", actualSpell.getAffinity().name()).formatted(actualSpell.getAffinity().getColor()));
|
||||
tooltip.add(LiteralText.EMPTY);
|
||||
tooltip.addAll(FlowingText.wrap(new TranslatableText(actualSpell.getType().getTranslationKey() + ".lore").formatted(actualSpell.getAffinity().getColor()), 180).toList());
|
||||
tooltip.add(LiteralText.EMPTY);
|
||||
tooltip.add(new TranslatableText("[Click to Discard]"));
|
||||
tooltip.add(ScreenTexts.EMPTY);
|
||||
tooltip.add(Text.translatable("Affinity: %s", actualSpell.getAffinity().name()).formatted(actualSpell.getAffinity().getColor()));
|
||||
tooltip.add(ScreenTexts.EMPTY);
|
||||
tooltip.addAll(FlowingText.wrap(Text.translatable(actualSpell.getType().getTranslationKey() + ".lore").formatted(actualSpell.getAffinity().getColor()), 180).toList());
|
||||
tooltip.add(ScreenTexts.EMPTY);
|
||||
tooltip.add(Text.translatable("[Click to Discard]"));
|
||||
}
|
||||
|
||||
private Spell getActualSpell() {
|
||||
|
|
|
@ -56,8 +56,7 @@ public class DrawableUtil {
|
|||
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
|
||||
bufferBuilder.vertex(matrix, x1, y1, 0).color(r, g, b, k).next();
|
||||
bufferBuilder.vertex(matrix, x2, y2, 0).color(r, g, b, k).next();
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
BufferRenderer.drawWithoutShader(bufferBuilder.end());
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
|
@ -105,8 +104,7 @@ public class DrawableUtil {
|
|||
cylendricalVertex(bufferBuilder, model, innerRadius, angle + INCREMENT, r, g, b, k);
|
||||
}
|
||||
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
BufferRenderer.drawWithShader(bufferBuilder.end());
|
||||
RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
|
@ -172,8 +170,7 @@ public class DrawableUtil {
|
|||
}
|
||||
}
|
||||
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
BufferRenderer.drawWithShader(bufferBuilder.end());
|
||||
RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.minelittlepony.unicopia.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
@ -12,11 +14,9 @@ import net.minecraft.client.render.Tessellator;
|
|||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.item.ItemRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.BaseText;
|
||||
import net.minecraft.text.CharacterVisitor;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.text.*;
|
||||
|
||||
public class ItemTraitsTooltipRenderer extends BaseText implements OrderedText, TooltipComponent {
|
||||
public class ItemTraitsTooltipRenderer implements Text, OrderedText, TooltipComponent {
|
||||
|
||||
private final SpellTraits traits;
|
||||
|
||||
|
@ -67,8 +67,8 @@ public class ItemTraitsTooltipRenderer extends BaseText implements OrderedText,
|
|||
}
|
||||
|
||||
@Override
|
||||
public BaseText copy() {
|
||||
return new ItemTraitsTooltipRenderer(traits);
|
||||
public MutableText copy() {
|
||||
return Text.empty();
|
||||
}
|
||||
|
||||
public static void renderTraitIcon(Trait trait, float value, MatrixStack matrices, int xx, int yy) {
|
||||
|
@ -88,4 +88,22 @@ public class ItemTraitsTooltipRenderer extends BaseText implements OrderedText,
|
|||
immediate.draw();
|
||||
matrices.pop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Style getStyle() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextContent getContent() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Text> getSiblings() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.client.MinecraftClient;
|
|||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class LanSettingsScreen extends GameGui {
|
|||
private boolean forceHideWhitelist;
|
||||
|
||||
public LanSettingsScreen(Screen parent) {
|
||||
super(new TranslatableText("unicopia.options.title"), parent);
|
||||
super(Text.translatable("unicopia.options.title"), parent);
|
||||
|
||||
content.margin.setVertical(30);
|
||||
content.getContentPadding().setHorizontal(10);
|
||||
|
@ -101,7 +101,7 @@ public class LanSettingsScreen extends GameGui {
|
|||
|
||||
if (whitelistEnabled) {
|
||||
|
||||
content.addButton(new Label(LEFT, row += 20)).getStyle().setText(new TranslatableText("unicopia.options.whitelist.details").formatted(Formatting.DARK_GREEN));
|
||||
content.addButton(new Label(LEFT, row += 20)).getStyle().setText(Text.translatable("unicopia.options.whitelist.details").formatted(Formatting.DARK_GREEN));
|
||||
|
||||
row += 20;
|
||||
WHITELIST_GRID_PACKER.start();
|
||||
|
|
|
@ -21,7 +21,6 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
public class SettingsScreen extends GameGui {
|
||||
|
@ -33,7 +32,7 @@ public class SettingsScreen extends GameGui {
|
|||
private Style mineLpStatus;
|
||||
|
||||
public SettingsScreen(Screen parent) {
|
||||
super(new TranslatableText("unicopia.options.title"), parent);
|
||||
super(Text.translatable("unicopia.options.title"), parent);
|
||||
|
||||
content.margin.setVertical(30);
|
||||
content.getContentPadding().setHorizontal(10);
|
||||
|
@ -76,7 +75,7 @@ public class SettingsScreen extends GameGui {
|
|||
|
||||
content.addButton(new EnumSlider<>(LEFT, row += 25, config.preferredRace.get()))
|
||||
.onChange(config.preferredRace::set)
|
||||
.setTextFormat(v -> new TranslatableText("unicopia.options.preferred_race", v.getValue().getDisplayName()));
|
||||
.setTextFormat(v -> Text.translatable("unicopia.options.preferred_race", v.getValue().getDisplayName()));
|
||||
|
||||
IntegratedServer server = client.getServer();
|
||||
if (server != null) {
|
||||
|
@ -87,7 +86,7 @@ public class SettingsScreen extends GameGui {
|
|||
|
||||
content.addButton(new EnumSlider<>(LEFT, row += 20, tribes.getDefaultRace()))
|
||||
.onChange(tribes::setDefaultRace)
|
||||
.setTextFormat(v -> new TranslatableText("unicopia.options.world.default_race", v.getValue().getDisplayName()))
|
||||
.setTextFormat(v -> Text.translatable("unicopia.options.world.default_race", v.getValue().getDisplayName()))
|
||||
.setEnabled(client.isInSingleplayer());
|
||||
}
|
||||
}
|
||||
|
@ -97,13 +96,13 @@ public class SettingsScreen extends GameGui {
|
|||
|
||||
if (hasMineLP) {
|
||||
if (config.ignoreMineLP.get()) {
|
||||
return new TranslatableText("unicopia.options.ignore_mine_lp.undetected").formatted(Formatting.DARK_GREEN);
|
||||
return Text.translatable("unicopia.options.ignore_mine_lp.undetected").formatted(Formatting.DARK_GREEN);
|
||||
}
|
||||
|
||||
return new TranslatableText("unicopia.options.ignore_mine_lp.detected", MineLPConnector.getPlayerPonyRace().getDisplayName()).formatted(Formatting.GREEN);
|
||||
return Text.translatable("unicopia.options.ignore_mine_lp.detected", MineLPConnector.getPlayerPonyRace().getDisplayName()).formatted(Formatting.GREEN);
|
||||
}
|
||||
|
||||
return new TranslatableText("unicopia.options.ignore_mine_lp.missing").formatted(Formatting.RED);
|
||||
return Text.translatable("unicopia.options.ignore_mine_lp.missing").formatted(Formatting.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class TribeButton extends Button {
|
||||
|
@ -54,7 +54,7 @@ public class TribeButton extends Button {
|
|||
drawTexture(matrices, x - 4, y - 14, 76, 0, 78, 71);
|
||||
|
||||
if (hovered && screenWidth > 0) {
|
||||
drawCenteredText(matrices, getFont(), new TranslatableText("gui.unicopia.tribe_selection.describe." + race.name().toLowerCase()), screenWidth / 2, y + height, 0xFFFFFFFF);
|
||||
drawCenteredText(matrices, getFont(), Text.translatable("gui.unicopia.tribe_selection.describe." + race.name().toLowerCase()), screenWidth / 2, y + height, 0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import it.unimi.dsi.fastutil.booleans.BooleanConsumer;
|
|||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Language;
|
||||
|
||||
|
@ -21,7 +20,7 @@ public class TribeConfirmationScreen extends GameGui implements HidesHud {
|
|||
private final BooleanConsumer callback;
|
||||
|
||||
public TribeConfirmationScreen(BooleanConsumer callback, Race selection) {
|
||||
super(new TranslatableText("gui.unicopia.tribe_selection"));
|
||||
super(Text.translatable("gui.unicopia.tribe_selection"));
|
||||
this.callback = callback;
|
||||
this.selection = selection;
|
||||
}
|
||||
|
@ -35,10 +34,10 @@ public class TribeConfirmationScreen extends GameGui implements HidesHud {
|
|||
|
||||
int top = (height - columnHeight) / 2;
|
||||
|
||||
addDrawableChild(new ButtonWidget(width / 2 + 5, top + columnHeight + padding, 100, 20, new TranslatableText("Join Tribe"), b -> callback.accept(true)));
|
||||
addDrawableChild(new ButtonWidget(width / 2 - 105, top + columnHeight + padding, 100, 20, new TranslatableText("Go Back"), b -> callback.accept(false)));
|
||||
addDrawableChild(new ButtonWidget(width / 2 + 5, top + columnHeight + padding, 100, 20, Text.translatable("Join Tribe"), b -> callback.accept(true)));
|
||||
addDrawableChild(new ButtonWidget(width / 2 - 105, top + columnHeight + padding, 100, 20, Text.translatable("Go Back"), b -> callback.accept(false)));
|
||||
|
||||
addDrawable(new Label(width / 2, top - 30).setCentered()).getStyle().setText(new TranslatableText("gui.unicopia.tribe_selection.confirm", selection.getDisplayName().shallowCopy().formatted(Formatting.YELLOW)));
|
||||
addDrawable(new Label(width / 2, top - 30).setCentered()).getStyle().setText(Text.translatable("gui.unicopia.tribe_selection.confirm", selection.getDisplayName().copy().formatted(Formatting.YELLOW)));
|
||||
|
||||
addDrawable(new TribeButton((width - 70) / 2, top, 0, selection));
|
||||
|
||||
|
@ -46,9 +45,9 @@ public class TribeConfirmationScreen extends GameGui implements HidesHud {
|
|||
|
||||
int left = (width - columnWidth) / 2 + padding;
|
||||
|
||||
Text race = selection.getAltDisplayName().shallowCopy().formatted(Formatting.YELLOW);
|
||||
Text race = selection.getAltDisplayName().copy().formatted(Formatting.YELLOW);
|
||||
|
||||
addDrawable(new Label(left - 3, top += 10)).getStyle().setText(new TranslatableText("gui.unicopia.tribe_selection.confirm.goods", race).formatted(Formatting.YELLOW));
|
||||
addDrawable(new Label(left - 3, top += 10)).getStyle().setText(Text.translatable("gui.unicopia.tribe_selection.confirm.goods", race).formatted(Formatting.YELLOW));
|
||||
|
||||
top += 15;
|
||||
|
||||
|
@ -58,12 +57,12 @@ public class TribeConfirmationScreen extends GameGui implements HidesHud {
|
|||
String key = String.format("gui.unicopia.tribe_selection.confirm.goods.%d.%s", i, selection.name().toLowerCase());
|
||||
if (Language.getInstance().hasTranslation(key)) {
|
||||
TextBlock block = addDrawable(new TextBlock(left, top, maxWidth));
|
||||
block.getStyle().setText(new TranslatableText(key));
|
||||
block.getStyle().setText(Text.translatable(key));
|
||||
top += block.getBounds().height;
|
||||
}
|
||||
}
|
||||
|
||||
addDrawable(new Label(left - 3, top += 5)).getStyle().setText(new TranslatableText("gui.unicopia.tribe_selection.confirm.bads", race).formatted(Formatting.YELLOW));
|
||||
addDrawable(new Label(left - 3, top += 5)).getStyle().setText(Text.translatable("gui.unicopia.tribe_selection.confirm.bads", race).formatted(Formatting.YELLOW));
|
||||
|
||||
top += 15;
|
||||
|
||||
|
@ -71,7 +70,7 @@ public class TribeConfirmationScreen extends GameGui implements HidesHud {
|
|||
String key = String.format("gui.unicopia.tribe_selection.confirm.bads.%d.%s", i, selection.name().toLowerCase());
|
||||
if (Language.getInstance().hasTranslation(key)) {
|
||||
TextBlock block = addDrawable(new TextBlock(left, top, maxWidth));
|
||||
block.getStyle().setText(new TranslatableText(key));
|
||||
block.getStyle().setText(Text.translatable(key));
|
||||
top += block.getBounds().height;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.minelittlepony.unicopia.network.Channel;
|
|||
import com.minelittlepony.unicopia.network.MsgRequestSpeciesChange;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
|
@ -24,7 +24,7 @@ public class TribeSelectionScreen extends GameGui implements HidesHud {
|
|||
private boolean finished;
|
||||
|
||||
public TribeSelectionScreen(Set<Race> allowedRaces) {
|
||||
super(new TranslatableText("gui.unicopia.tribe_selection"));
|
||||
super(Text.translatable("gui.unicopia.tribe_selection"));
|
||||
this.allowedRaces = allowedRaces;
|
||||
}
|
||||
|
||||
|
@ -35,16 +35,16 @@ public class TribeSelectionScreen extends GameGui implements HidesHud {
|
|||
|
||||
int top = 0;
|
||||
|
||||
addDrawable(new Label(width / 2, top += 20).setCentered()).getStyle().setText(getTitle().shallowCopy().formatted(Formatting.YELLOW));
|
||||
addDrawable(new Label(width / 2, top += 20).setCentered()).getStyle().setText(getTitle().copy().formatted(Formatting.YELLOW));
|
||||
|
||||
top += height / 8;
|
||||
|
||||
TextBlock block = addDrawable(new TextBlock(left, top += 10, pageWidth));
|
||||
block.getStyle().setText(new TranslatableText("gui.unicopia.tribe_selection.welcome.journey"));
|
||||
block.getStyle().setText(Text.translatable("gui.unicopia.tribe_selection.welcome.journey"));
|
||||
top += block.getBounds().height;
|
||||
|
||||
block = addDrawable(new TextBlock(left, top += 7, pageWidth));
|
||||
block.getStyle().setText(new TranslatableText("gui.unicopia.tribe_selection.welcome.choice"));
|
||||
block.getStyle().setText(Text.translatable("gui.unicopia.tribe_selection.welcome.choice"));
|
||||
top += block.getBounds().height;
|
||||
|
||||
Race preference = UnicopiaClient.getPreferredRace();
|
||||
|
@ -67,7 +67,7 @@ public class TribeSelectionScreen extends GameGui implements HidesHud {
|
|||
top = height - 20;
|
||||
|
||||
if (!preference.isDefault()) {
|
||||
addDrawable(new Label(width / 2, top).setCentered()).getStyle().setText(new TranslatableText("gui.unicopia.tribe_selection.preference", preference.getDisplayName().shallowCopy().formatted(Formatting.YELLOW)));
|
||||
addDrawable(new Label(width / 2, top).setCentered()).getStyle().setText(Text.translatable("gui.unicopia.tribe_selection.preference", preference.getDisplayName().copy().formatted(Formatting.YELLOW)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.minelittlepony.unicopia.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -35,6 +34,7 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Quaternion;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public class UHud extends DrawableHelper {
|
||||
|
||||
|
@ -227,7 +227,7 @@ public class UHud extends DrawableHelper {
|
|||
client.getSoundManager().play(
|
||||
heartbeatSound = new LoopingSoundInstance<>(client.player, player -> {
|
||||
return Pony.of(player).getMagicalReserves().getExhaustion().getPercentFill() > 0.5F;
|
||||
}, USounds.ENTITY_PLAYER_HEARTBEAT, 1, 1)
|
||||
}, USounds.ENTITY_PLAYER_HEARTBEAT, 1, 1, client.world.random)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,9 +58,9 @@ public class LightningBoltParticle extends AbstractGeometryBasedParticle {
|
|||
|
||||
while (nodes.size() < intendedLength) {
|
||||
startPos = startPos.add(
|
||||
0.1 + world.random.nextDouble(6) - 3,
|
||||
0.1 + world.random.nextDouble(6) - 3,
|
||||
0.1 + world.random.nextDouble(6) - 3
|
||||
world.random.nextTriangular(0.1, 3),
|
||||
world.random.nextTriangular(0.1, 3),
|
||||
world.random.nextTriangular(0.1, 3)
|
||||
);
|
||||
|
||||
nodes.add(startPos);
|
||||
|
|
|
@ -15,6 +15,8 @@ import net.minecraft.util.math.Vector4f;
|
|||
public class SphereModel {
|
||||
public static final SphereModel SPHERE = new SphereModel(40, 40, DrawableUtil.TAU);
|
||||
public static final SphereModel DISK = new SphereModel(40, 2, DrawableUtil.PI);
|
||||
public static final SphereModel HEXAGON = new SphereModel(3, 2, DrawableUtil.TAU);
|
||||
public static final SphereModel PRISM = new SphereModel(6, 6, DrawableUtil.TAU);
|
||||
|
||||
private final List<Vector4f> vertices = new ArrayList<>();
|
||||
private final Vector4f drawVert = new Vector4f();
|
||||
|
@ -40,8 +42,8 @@ public class SphereModel {
|
|||
}
|
||||
|
||||
private static void compileVertices(double azimuthRange, double zenithIncrement, double azimuthIncrement, Consumer<Vector4f> collector) {
|
||||
for (double zenith = -DrawableUtil.PI; zenith < DrawableUtil.PI; zenith += zenithIncrement) {
|
||||
for (double azimuth = -azimuthRange; azimuth < azimuthRange; azimuth += azimuthIncrement) {
|
||||
for (double zenith = 0; zenith < DrawableUtil.PI; zenith += zenithIncrement) {
|
||||
for (double azimuth = 0; azimuth < azimuthRange; azimuth += azimuthIncrement) {
|
||||
collector.accept(convertToCartesianCoord(new Vector4f(), 1, zenith, azimuth));
|
||||
collector.accept(convertToCartesianCoord(new Vector4f(), 1, zenith + zenithIncrement, azimuth));
|
||||
collector.accept(convertToCartesianCoord(new Vector4f(), 1, zenith + zenithIncrement, azimuth + azimuthIncrement));
|
||||
|
|
|
@ -22,6 +22,6 @@ public class IcarusWingsFeatureRenderer<E extends LivingEntity> extends WingsFea
|
|||
|
||||
@Override
|
||||
protected Identifier getTexture(E entity) {
|
||||
return entity.world.getDimension().isUltrawarm() ? ICARUS_WINGS_CORRUPTED : ICARUS_WINGS;
|
||||
return entity.world.getDimension().ultrawarm() ? ICARUS_WINGS_CORRUPTED : ICARUS_WINGS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.client.sound.MovingSoundInstance;
|
|||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public abstract class FadeOutSoundInstance extends MovingSoundInstance {
|
||||
|
||||
|
@ -19,8 +20,8 @@ public abstract class FadeOutSoundInstance extends MovingSoundInstance {
|
|||
|
||||
private boolean fadingOut;
|
||||
|
||||
public FadeOutSoundInstance(SoundEvent sound, SoundCategory category, float volume) {
|
||||
super(sound, category);
|
||||
public FadeOutSoundInstance(SoundEvent sound, SoundCategory category, float volume, Random random) {
|
||||
super(sound, category, random);
|
||||
this.relative = true;
|
||||
this.repeat = true;
|
||||
this.volume = volume;
|
||||
|
@ -71,6 +72,6 @@ public abstract class FadeOutSoundInstance extends MovingSoundInstance {
|
|||
|
||||
@Override
|
||||
public final float getVolume() {
|
||||
return getLerpedVolume() * sound.getVolume();
|
||||
return getLerpedVolume() * sound.getVolume().get(field_38800);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.sound.SoundEvent;
|
||||
|
||||
public class LoopedEntityTrackingSoundInstance extends EntityTrackingSoundInstance {
|
||||
public LoopedEntityTrackingSoundInstance(SoundEvent soundEvent, float volume, float pitch, Entity entity) {
|
||||
super(soundEvent, entity.getSoundCategory(), volume, pitch, entity);
|
||||
public LoopedEntityTrackingSoundInstance(SoundEvent soundEvent, float volume, float pitch, Entity entity, long seed) {
|
||||
super(soundEvent, entity.getSoundCategory(), volume, pitch, entity, seed);
|
||||
this.repeat = true;
|
||||
this.repeatDelay = 0;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.function.Predicate;
|
|||
import net.minecraft.client.sound.SoundInstance;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public class LoopingSoundInstance<T extends Entity> extends FadeOutSoundInstance {
|
||||
|
||||
|
@ -12,8 +13,8 @@ public class LoopingSoundInstance<T extends Entity> extends FadeOutSoundInstance
|
|||
|
||||
private final Predicate<T> shouldPlay;
|
||||
|
||||
public LoopingSoundInstance(T source, Predicate<T> shouldPlay, SoundEvent soundEvent, float volume, float pitch) {
|
||||
super(soundEvent, source.getSoundCategory(), volume);
|
||||
public LoopingSoundInstance(T source, Predicate<T> shouldPlay, SoundEvent soundEvent, float volume, float pitch, Random random) {
|
||||
super(soundEvent, source.getSoundCategory(), volume, random);
|
||||
this.source = source;
|
||||
this.shouldPlay = shouldPlay;
|
||||
this.pitch = pitch;
|
||||
|
|
|
@ -9,13 +9,14 @@ import com.minelittlepony.unicopia.item.enchantment.UEnchantments;
|
|||
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public class MagicAuraSoundInstance extends FadeOutSoundInstance {
|
||||
|
||||
private final Living<?> living;
|
||||
|
||||
public MagicAuraSoundInstance(SoundCategory category, Living<?> living) {
|
||||
super(USounds.ITEM_MAGIC_AURA, category, 1);
|
||||
public MagicAuraSoundInstance(SoundCategory category, Living<?> living, Random random) {
|
||||
super(USounds.ITEM_MAGIC_AURA, category, 1, random);
|
||||
this.living = living;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.minelittlepony.unicopia.entity.player.Pony;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public class MotionBasedSoundInstance extends FadeOutSoundInstance {
|
||||
|
||||
|
@ -12,8 +13,8 @@ public class MotionBasedSoundInstance extends FadeOutSoundInstance {
|
|||
|
||||
private int tickCount;
|
||||
|
||||
public MotionBasedSoundInstance(SoundEvent sound, PlayerEntity player) {
|
||||
super(sound, player.getSoundCategory(), 0.1F);
|
||||
public MotionBasedSoundInstance(SoundEvent sound, PlayerEntity player, Random random) {
|
||||
super(sound, player.getSoundCategory(), 0.1F, random);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
package com.minelittlepony.unicopia.command;
|
||||
|
||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.command.v2.ArgumentTypeRegistry;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.command.argument.ArgumentTypes;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class Commands {
|
||||
@SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
|
||||
public static void bootstrap() {
|
||||
ArgumentTypes.register("unicopia:enumeration", EnumArgumentType.class, new EnumArgumentType.Serializer());
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
|
||||
ArgumentTypeRegistry.registerArgumentType(new Identifier("unicopia", "enumeration"), EnumArgumentType.class, new EnumArgumentType.Serializer());
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, access, environment) -> {
|
||||
SpeciesCommand.register(dispatcher);
|
||||
RacelistCommand.register(dispatcher);
|
||||
GravityCommand.register(dispatcher);
|
||||
|
|
|
@ -26,13 +26,12 @@ import net.minecraft.nbt.NbtCompound;
|
|||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.world.GameRules;
|
||||
|
||||
public class DisguiseCommand {
|
||||
private static final SimpleCommandExceptionType FAILED_EXCEPTION = new SimpleCommandExceptionType(new TranslatableText("commands.disguise.notfound"));
|
||||
private static final SimpleCommandExceptionType FAILED_EXCEPTION = new SimpleCommandExceptionType(Text.translatable("commands.disguise.notfound"));
|
||||
|
||||
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
|
||||
dispatcher.register(CommandManager
|
||||
|
@ -88,13 +87,13 @@ public class DisguiseCommand {
|
|||
.setDisguise(entity);
|
||||
|
||||
if (source.getEntity() == player) {
|
||||
source.sendFeedback(new TranslatableText("commands.disguise.success.self", entity.getName()), true);
|
||||
source.sendFeedback(Text.translatable("commands.disguise.success.self", entity.getName()), true);
|
||||
} else {
|
||||
if (player.getEntityWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) {
|
||||
player.sendSystemMessage(new TranslatableText("commands.disguise.success", entity.getName()), Util.NIL_UUID);
|
||||
player.sendMessage(Text.translatable("commands.disguise.success", entity.getName()));
|
||||
}
|
||||
|
||||
source.sendFeedback(new TranslatableText("commands.disguise.success.other", player.getName(), entity.getName()), true);
|
||||
source.sendFeedback(Text.translatable("commands.disguise.success.other", player.getName(), entity.getName()), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -115,13 +114,13 @@ public class DisguiseCommand {
|
|||
iplayer.getSpellSlot().removeIf(SpellPredicate.IS_DISGUISE, true);
|
||||
|
||||
if (source.getEntity() == player) {
|
||||
source.sendFeedback(new TranslatableText("commands.disguise.removed.self"), true);
|
||||
source.sendFeedback(Text.translatable("commands.disguise.removed.self"), true);
|
||||
} else {
|
||||
if (player.getEntityWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) {
|
||||
player.sendSystemMessage(new TranslatableText("commands.disguise.removed"), Util.NIL_UUID);
|
||||
player.sendMessage(Text.translatable("commands.disguise.removed"));
|
||||
}
|
||||
|
||||
source.sendFeedback(new TranslatableText("commands.disguise.removed.other", player.getName()), true);
|
||||
source.sendFeedback(Text.translatable("commands.disguise.removed.other", player.getName()), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -21,7 +21,9 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
|||
|
||||
import io.netty.buffer.ByteBufInputStream;
|
||||
import io.netty.buffer.ByteBufOutputStream;
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.command.argument.serialize.ArgumentSerializer;
|
||||
import net.minecraft.command.argument.serialize.ArgumentSerializer.ArgumentTypeProperties;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
class EnumArgumentType<T extends Enum<T>> implements ArgumentType<T>, Serializable {
|
||||
|
@ -100,27 +102,52 @@ class EnumArgumentType<T extends Enum<T>> implements ArgumentType<T>, Serializab
|
|||
return suggestions;
|
||||
}
|
||||
|
||||
public static class Serializer<T extends Enum<T>> implements ArgumentSerializer<EnumArgumentType<T>> {
|
||||
@Override
|
||||
public void toPacket(EnumArgumentType<T> type, PacketByteBuf buf) {
|
||||
try (ObjectOutputStream stream = new ObjectOutputStream(new ByteBufOutputStream(buf))) {
|
||||
stream.writeObject(type);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Serializer<T extends Enum<T>> implements ArgumentSerializer<EnumArgumentType<T>, Serializer<T>.Properties> {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public EnumArgumentType<T> fromPacket(PacketByteBuf buf) {
|
||||
public Properties fromPacket(PacketByteBuf buf) {
|
||||
try (ObjectInputStream stream = new ObjectInputStream(new ByteBufInputStream(buf))) {
|
||||
return (EnumArgumentType<T>)stream.readObject();
|
||||
return getArgumentTypeProperties((EnumArgumentType<T>)stream.readObject());
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toJson(EnumArgumentType<T> type, JsonObject json) { }
|
||||
public void writePacket(Properties properties, PacketByteBuf buf) {
|
||||
try (ObjectOutputStream stream = new ObjectOutputStream(new ByteBufOutputStream(buf))) {
|
||||
stream.writeObject(properties.type);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeJson(Properties properties, JsonObject json) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties getArgumentTypeProperties(EnumArgumentType<T> type) {
|
||||
return new Properties(type);
|
||||
}
|
||||
|
||||
public final class Properties implements ArgumentTypeProperties<EnumArgumentType<T>> {
|
||||
|
||||
private final EnumArgumentType<T> type;
|
||||
|
||||
public Properties(EnumArgumentType<T> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumArgumentType<T> createType(CommandRegistryAccess var1) {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArgumentSerializer<EnumArgumentType<T>, ?> getSerializer() {
|
||||
return Serializer.this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,8 +10,7 @@ import net.minecraft.command.argument.EntityArgumentType;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.GameRules;
|
||||
|
||||
class GravityCommand {
|
||||
|
@ -44,9 +43,9 @@ class GravityCommand {
|
|||
float gravity = iplayer.getPhysics().getGravityModifier();
|
||||
|
||||
if (source.getPlayer() == player) {
|
||||
player.sendMessage(new TranslatableText(translationKey, gravity), false);
|
||||
player.sendMessage(Text.translatable(translationKey, gravity), false);
|
||||
} else {
|
||||
source.sendFeedback(new TranslatableText(translationKey + ".other", player.getName(), gravity), true);
|
||||
source.sendFeedback(Text.translatable(translationKey + ".other", player.getName(), gravity), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -61,13 +60,13 @@ class GravityCommand {
|
|||
iplayer.setDirty();
|
||||
|
||||
if (source.getEntity() == player) {
|
||||
source.sendFeedback(new TranslatableText("commands.gamemode.success.self", gravity), true);
|
||||
source.sendFeedback(Text.translatable("commands.gamemode.success.self", gravity), true);
|
||||
} else {
|
||||
if (source.getWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) {
|
||||
player.sendSystemMessage(new TranslatableText(translationKey, gravity), Util.NIL_UUID);
|
||||
player.sendMessage(Text.translatable(translationKey, gravity));
|
||||
}
|
||||
|
||||
source.sendFeedback(new TranslatableText(translationKey + ".other", player.getName(), gravity), true);
|
||||
source.sendFeedback(Text.translatable(translationKey + ".other", player.getName(), gravity), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.server.command.CommandManager;
|
|||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
class RacelistCommand {
|
||||
|
@ -52,9 +51,9 @@ class RacelistCommand {
|
|||
translationKey += ".failed";
|
||||
}
|
||||
|
||||
Text formattedName = new TranslatableText(race.name().toLowerCase()).formatted(Formatting.GOLD);
|
||||
Text formattedName = Text.translatable(race.name().toLowerCase()).formatted(Formatting.GOLD);
|
||||
|
||||
source.sendFeedback(new TranslatableText(translationKey, formattedName).formatted(Formatting.GREEN), false);
|
||||
source.sendFeedback(Text.translatable(translationKey, formattedName).formatted(Formatting.GREEN), false);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,8 @@ import net.minecraft.command.argument.EntityArgumentType;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.world.GameRules;
|
||||
|
||||
|
@ -54,18 +52,18 @@ class SpeciesCommand {
|
|||
pony.setSpecies(race);
|
||||
pony.setDirty();
|
||||
|
||||
Text formattedName = new TranslatableText(race.name().toLowerCase());
|
||||
Text formattedName = Text.translatable(race.name().toLowerCase());
|
||||
|
||||
if (!isSelf) {
|
||||
source.sendFeedback(new TranslatableText("commands.race.success.other", player.getName(), formattedName), true);
|
||||
source.sendFeedback(Text.translatable("commands.race.success.other", player.getName(), formattedName), true);
|
||||
} else {
|
||||
if (player.getEntityWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) {
|
||||
player.sendMessage(new TranslatableText("commands.race.success.self"), false);
|
||||
player.sendMessage(Text.translatable("commands.race.success.self"), false);
|
||||
}
|
||||
source.sendFeedback(new TranslatableText("commands.race.success.otherself", player.getName(), formattedName), true);
|
||||
source.sendFeedback(Text.translatable("commands.race.success.otherself", player.getName(), formattedName), true);
|
||||
}
|
||||
} else if (player.getEntityWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) {
|
||||
player.sendMessage(new TranslatableText("commands.race.permission"), false);
|
||||
player.sendMessage(Text.translatable("commands.race.permission"), false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -77,22 +75,22 @@ class SpeciesCommand {
|
|||
String name = "commands.race.tell.";
|
||||
name += isSelf ? "self" : "other";
|
||||
|
||||
player.sendMessage(new TranslatableText(name)
|
||||
.append(new TranslatableText(spec.getTranslationKey())
|
||||
player.sendMessage(Text.translatable(name)
|
||||
.append(Text.translatable(spec.getTranslationKey())
|
||||
.styled(s -> s.withColor(Formatting.GOLD))), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list(PlayerEntity player) {
|
||||
player.sendMessage(new TranslatableText("commands.race.list"), false);
|
||||
player.sendMessage(Text.translatable("commands.race.list"), false);
|
||||
|
||||
MutableText message = new LiteralText("");
|
||||
MutableText message = Text.literal("");
|
||||
|
||||
boolean first = true;
|
||||
for (Race i : Race.values()) {
|
||||
if (!i.isDefault() && i.isPermitted(player)) {
|
||||
message.append(new TranslatableText((!first ? "\n" : "") + " - " + i.name().toLowerCase()));
|
||||
message.append(Text.translatable((!first ? "\n" : "") + " - " + i.name().toLowerCase()));
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
@ -105,9 +103,9 @@ class SpeciesCommand {
|
|||
static int describe(PlayerEntity player, Race species) {
|
||||
String name = species.name().toLowerCase();
|
||||
|
||||
player.sendMessage(new TranslatableText(String.format("commands.race.describe.%s.1", name)).styled(s -> s.withColor(Formatting.YELLOW)), false);
|
||||
player.sendMessage(new TranslatableText(String.format("commands.race.describe.%s.2", name)), false);
|
||||
player.sendMessage(new TranslatableText(String.format("commands.race.describe.%s.3", name)).styled(s -> s.withColor(Formatting.RED)), false);
|
||||
player.sendMessage(Text.translatable(String.format("commands.race.describe.%s.1", name)).styled(s -> s.withColor(Formatting.YELLOW)), false);
|
||||
player.sendMessage(Text.translatable(String.format("commands.race.describe.%s.2", name)), false);
|
||||
player.sendMessage(Text.translatable(String.format("commands.race.describe.%s.3", name)).styled(s -> s.withColor(Formatting.RED)), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.*;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
class TraitCommand {
|
||||
|
@ -44,13 +43,13 @@ class TraitCommand {
|
|||
|
||||
static int add(ServerCommandSource source, PlayerEntity player, Trait trait, float amount) throws CommandSyntaxException {
|
||||
if (trait == null) {
|
||||
source.sendError(new LiteralText("Invalid trait"));
|
||||
source.sendError(Text.literal("Invalid trait"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ItemStack stack = player.getMainHandStack();
|
||||
if (stack.isEmpty()) {
|
||||
source.sendError(new LiteralText("That trait cannot be added to the current item"));
|
||||
source.sendError(Text.literal("That trait cannot be added to the current item"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -61,7 +60,7 @@ class TraitCommand {
|
|||
|
||||
static int remove(ServerCommandSource source, PlayerEntity player, Trait trait) throws CommandSyntaxException {
|
||||
if (trait == null) {
|
||||
source.sendError(new LiteralText("Invalid trait"));
|
||||
source.sendError(Text.literal("Invalid trait"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -85,9 +84,9 @@ class TraitCommand {
|
|||
float gravity = iplayer.getPhysics().getGravityModifier();
|
||||
|
||||
if (source.getPlayer() == player) {
|
||||
player.sendMessage(new TranslatableText(translationKey, gravity), false);
|
||||
player.sendMessage(Text.translatable(translationKey, gravity), false);
|
||||
} else {
|
||||
source.sendFeedback(new TranslatableText(translationKey + ".other", player.getName(), gravity), true);
|
||||
source.sendFeedback(Text.translatable(translationKey + ".other", player.getName(), gravity), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.minelittlepony.unicopia.container;
|
||||
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public enum SpellbookPage {
|
||||
|
@ -12,7 +11,7 @@ public enum SpellbookPage {
|
|||
public static final SpellbookPage[] VALUES = values();
|
||||
private static int current;
|
||||
|
||||
private final Text label = new TranslatableText("gui.unicopia.spellbook.page." + name().toLowerCase());
|
||||
private final Text label = Text.translatable("gui.unicopia.spellbook.page." + name().toLowerCase());
|
||||
|
||||
public Text getLabel() {
|
||||
return label;
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class SpellbookScreen extends HandledScreen<SpellbookScreenHandler> implements RecipeBookProvider {
|
||||
|
@ -156,7 +155,7 @@ public class SpellbookScreen extends HandledScreen<SpellbookScreenHandler> imple
|
|||
textRenderer.draw(matrices, title, titleX, titleY, 4210752);
|
||||
textRenderer.draw(matrices, SpellbookPage.getCurrent().getLabel(), 220, this.titleY, 4210752);
|
||||
|
||||
Text pageText = new TranslatableText("%s/%s", SpellbookPage.getCurrent().ordinal() + 1, SpellbookPage.VALUES.length);
|
||||
Text pageText = Text.translatable("%s/%s", SpellbookPage.getCurrent().ordinal() + 1, SpellbookPage.VALUES.length);
|
||||
textRenderer.draw(matrices, pageText,
|
||||
x + 325 - textRenderer.getWidth(pageText) / 2F, y + 188 - textRenderer.fontHeight, 4210752);
|
||||
}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
package com.minelittlepony.unicopia.container;
|
||||
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry.SimpleClientHandlerFactory;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
public interface UScreenHandlers {
|
||||
ScreenHandlerType<SpellbookScreenHandler> SPELL_BOOK = register("spell_book", SpellbookScreenHandler::new);
|
||||
|
||||
static <T extends ScreenHandler> ScreenHandlerType<T> register(String name, SimpleClientHandlerFactory<T> factory) {
|
||||
return ScreenHandlerRegistry.registerSimple(new Identifier("unicopia", name), factory);
|
||||
static <T extends ScreenHandler> ScreenHandlerType<T> register(String name, ScreenHandlerType.Factory<T> factory) {
|
||||
return Registry.register(Registry.SCREEN_HANDLER, new Identifier("unicopia", name), new ScreenHandlerType<>(factory));
|
||||
}
|
||||
|
||||
static void bootstrap() { }
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.minelittlepony.unicopia.entity;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -31,6 +30,7 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import net.minecraft.entity.data.TrackedDataHandlerRegistry;
|
|||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CastSpellEntity extends LightEmittingEntity implements Caster<LivingEntity>, WeaklyOwned<LivingEntity> {
|
||||
|
@ -54,7 +53,7 @@ public class CastSpellEntity extends LightEmittingEntity implements Caster<Livin
|
|||
public Text getName() {
|
||||
Entity master = getMaster();
|
||||
if (master != null) {
|
||||
return new TranslatableText("entity.unicopia.cast_spell.by", master.getName());
|
||||
return Text.translatable("entity.unicopia.cast_spell.by", master.getName());
|
||||
}
|
||||
return super.getName();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.minelittlepony.unicopia.entity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
@ -26,6 +25,7 @@ import net.minecraft.particle.ParticleEffect;
|
|||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public class ItemImpl implements Equine<ItemEntity>, Owned<ItemEntity> {
|
||||
private static final TrackedData<Integer> ITEM_RACE = DataTracker.registerData(ItemEntity.class, TrackedDataHandlerRegistry.INTEGER);
|
||||
|
|
|
@ -13,10 +13,10 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityDimensions;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.tag.BiomeTags;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.Biome.Category;
|
||||
|
||||
public interface UEntities {
|
||||
EntityType<ButterflyEntity> BUTTERFLY = register("butterfly", FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT, ButterflyEntity::new)
|
||||
|
@ -59,8 +59,15 @@ public interface UEntities {
|
|||
final Predicate<BiomeSelectionContext> butterflySpawnable = BiomeSelectors.foundInOverworld()
|
||||
.and(ctx -> ctx.getBiome().getPrecipitation() == Biome.Precipitation.RAIN);
|
||||
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(BiomeSelectors.categories(Category.RIVER, Category.FOREST, Category.EXTREME_HILLS)), SpawnGroup.AMBIENT, BUTTERFLY, 3, 3, 12);
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(BiomeSelectors.categories(Category.PLAINS, Category.JUNGLE)), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19);
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(
|
||||
BiomeSelectors.tag(BiomeTags.IS_RIVER)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_FOREST))
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_HILL))
|
||||
), SpawnGroup.AMBIENT, BUTTERFLY, 3, 3, 12);
|
||||
BiomeModifications.addSpawn(butterflySpawnable.and(
|
||||
BiomeSelectors.tag(BiomeTags.IS_JUNGLE)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_MOUNTAIN))
|
||||
), SpawnGroup.AMBIENT, BUTTERFLY, 7, 5, 19);
|
||||
|
||||
UTradeOffers.bootstrap();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.minelittlepony.unicopia.entity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.unicopia.UTags;
|
||||
|
@ -18,6 +16,7 @@ import net.minecraft.item.Items;
|
|||
import net.minecraft.tag.ItemTags;
|
||||
import net.minecraft.tag.TagKey;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.village.TradeOffer;
|
||||
import net.minecraft.village.TradeOffers;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
|
|
|
@ -10,7 +10,7 @@ public class BeeBehaviour extends EntityBehaviour<BeeEntity> {
|
|||
public BeeEntity onCreate(BeeEntity entity, EntityAppearance context, boolean replaceOld) {
|
||||
super.onCreate(entity, context, replaceOld);
|
||||
if (replaceOld && entity.world.isClient) {
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_BEE);
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_BEE, entity.getId());
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public interface Disguise extends FlightType.Provider, PlayerDimensions.Provider
|
|||
}
|
||||
|
||||
static abstract class PlayerAccess extends PlayerEntity {
|
||||
public PlayerAccess() { super(null, null, 0, null); }
|
||||
public PlayerAccess() { super(null, null, 0, null, null); }
|
||||
static TrackedData<Byte> getModelBitFlag() {
|
||||
return PLAYER_MODEL_PARTS;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class MinecartBehaviour extends EntityBehaviour<AbstractMinecartEntity> {
|
|||
public AbstractMinecartEntity onCreate(AbstractMinecartEntity entity, EntityAppearance context, boolean replaceOld) {
|
||||
super.onCreate(entity, context, replaceOld);
|
||||
if (replaceOld && entity.world.isClient) {
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_MINECART);
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_MINECART, entity.getId());
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.minelittlepony.unicopia.entity.behaviour;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
import com.minelittlepony.unicopia.mixin.MixinSheepEntity;
|
||||
|
||||
|
@ -14,6 +12,7 @@ import net.minecraft.entity.player.PlayerInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.WorldEvents;
|
||||
|
||||
public class SheepBehaviour extends EntityBehaviour<SheepEntity> {
|
||||
|
|
|
@ -2,17 +2,12 @@ package com.minelittlepony.unicopia.entity.behaviour;
|
|||
|
||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
|
||||
import net.minecraft.entity.JumpingMount;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.passive.HorseBaseEntity;
|
||||
import net.minecraft.entity.passive.*;
|
||||
|
||||
public class SteedBehaviour<T extends LivingEntity & JumpingMount> extends EntityBehaviour<T> {
|
||||
public class SteedBehaviour<T extends AbstractHorseEntity> extends EntityBehaviour<T> {
|
||||
|
||||
@Override
|
||||
public void update(Pony player, T entity, Disguise spell) {
|
||||
|
||||
HorseBaseEntity horse = ((HorseBaseEntity)entity);
|
||||
|
||||
public void update(Pony player, T horse, Disguise spell) {
|
||||
boolean angry = !player.getEntity().isOnGround() && player.getMaster().isSprinting();
|
||||
boolean sneaking = isSneakingOnGround(player);
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.entity.effect.StatusEffectCategory;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
|
@ -142,7 +141,7 @@ public class RaceChangeStatusEffect extends StatusEffect {
|
|||
}
|
||||
|
||||
public Text getMessage(Race race) {
|
||||
return new TranslatableText(getTranslationKey(), race.getDisplayName());
|
||||
return Text.translatable(getTranslationKey(), race.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
|||
if (typeChanged) {
|
||||
pony.spawnParticles(ParticleTypes.CLOUD, 10);
|
||||
|
||||
entity.playSound(entity.world.getDimension().isUltrawarm() ? USounds.ITEM_ICARUS_WINGS_CORRUPT : USounds.ITEM_ICARUS_WINGS_PURIFY, 0.1125F, 1.5F);
|
||||
entity.playSound(entity.world.getDimension().ultrawarm() ? USounds.ITEM_ICARUS_WINGS_CORRUPT : USounds.ITEM_ICARUS_WINGS_PURIFY, 0.1125F, 1.5F);
|
||||
}
|
||||
|
||||
entity.getAbilities().allowFlying = type.canFlyCreative(entity);
|
||||
|
@ -345,7 +345,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
|||
|
||||
if (!SpellPredicate.IS_DISGUISE.isOn(pony)) {
|
||||
if (ticksInAir % GLIDING_SOUND_INTERVAL == 1 && pony.isClient()) {
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_GLIDING);
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_GLIDING, entity.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
|||
} else if (type == FlightType.INSECTOID && !SpellPredicate.IS_DISGUISE.isOn(pony)) {
|
||||
if (entity.world.isClient && !soundPlaying) {
|
||||
soundPlaying = true;
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_CHANGELING_BUZZ);
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_CHANGELING_BUZZ, entity.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
|||
if (entity.world.hasRain(entity.getBlockPos())) {
|
||||
energyConsumed *= 3;
|
||||
}
|
||||
if (entity.world.getDimension().isUltrawarm()) {
|
||||
if (entity.world.getDimension().ultrawarm()) {
|
||||
energyConsumed *= 4;
|
||||
damageInterval /= 2;
|
||||
minDamage *= 3;
|
||||
|
|
|
@ -63,7 +63,6 @@ import net.minecraft.network.packet.s2c.play.EntityPassengersSetS2CPacket;
|
|||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -356,7 +355,6 @@ public class Pony extends Living<PlayerEntity> implements Transmittable, Copieab
|
|||
|
||||
if (getSpecies() == Race.BAT) {
|
||||
if (SunBlindnessStatusEffect.hasSunExposure(entity)) {
|
||||
System.out.println("Sun exposure " + entity);
|
||||
if (ticksInSun < 200) {
|
||||
ticksInSun++;
|
||||
}
|
||||
|
@ -366,7 +364,7 @@ public class Pony extends Living<PlayerEntity> implements Transmittable, Copieab
|
|||
entity.addStatusEffect(new StatusEffectInstance(UEffects.SUN_BLINDNESS, SunBlindnessStatusEffect.MAX_DURATION * 10, 1, true, false));
|
||||
UCriteria.LOOK_INTO_SUN.trigger(entity);
|
||||
} else if (isClientPlayer()) {
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_EARS_RINGING);
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_EARS_RINGING, getEntity().getId());
|
||||
}
|
||||
}
|
||||
} else if (ticksInSun > 0) {
|
||||
|
@ -434,6 +432,7 @@ public class Pony extends Living<PlayerEntity> implements Transmittable, Copieab
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void handleFall(float distance, float damageMultiplier, DamageSource cause) {
|
||||
super.handleFall(distance, damageMultiplier, cause);
|
||||
|
@ -500,13 +499,13 @@ public class Pony extends Living<PlayerEntity> implements Transmittable, Copieab
|
|||
public Optional<Text> trySleep(BlockPos pos) {
|
||||
|
||||
if (UItems.ALICORN_AMULET.isApplicable(entity)) {
|
||||
return Optional.of(new TranslatableText("block.unicopia.bed.not_tired"));
|
||||
return Optional.of(Text.translatable("block.unicopia.bed.not_tired"));
|
||||
}
|
||||
|
||||
return findAllSpellsInRange(10)
|
||||
.filter(p -> p instanceof Pony && ((Pony)p).isEnemy(this))
|
||||
.findFirst()
|
||||
.map(p -> new TranslatableText("block.unicopia.bed.not_safe"));
|
||||
.map(p -> Text.translatable("block.unicopia.bed.not_safe"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraft.client.world.ClientWorld;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.GameMode;
|
||||
|
||||
public class DummyClientPlayerEntity extends AbstractClientPlayerEntity implements Owned<PlayerEntity> {
|
||||
|
@ -27,7 +27,7 @@ public class DummyClientPlayerEntity extends AbstractClientPlayerEntity implemen
|
|||
private PlayerEntity owner;
|
||||
|
||||
public DummyClientPlayerEntity(ClientWorld world, GameProfile profile) {
|
||||
super(world, profile);
|
||||
super(world, profile, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,7 +49,7 @@ public class DummyClientPlayerEntity extends AbstractClientPlayerEntity implemen
|
|||
playerInfo = connection.getPlayerListEntry(getGameProfile().getId());
|
||||
|
||||
if (playerInfo == null) {
|
||||
playerInfo = new PlayerListEntry(new Packet().entry());
|
||||
playerInfo = new PlayerListEntry(new Packet().entry(), MinecraftClient.getInstance().getServicesSignatureVerifier());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class DummyClientPlayerEntity extends AbstractClientPlayerEntity implemen
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onEquipStack(ItemStack stack) {
|
||||
protected void playEquipSound(ItemStack stack) {
|
||||
/*noop*/
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class DummyClientPlayerEntity extends AbstractClientPlayerEntity implemen
|
|||
getGameProfile(),
|
||||
0,
|
||||
GameMode.DEFAULT,
|
||||
new LiteralText(getGameProfile().getName()));
|
||||
Text.literal(getGameProfile().getName()), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ public class DummyPlayerEntity extends PlayerEntity implements Owned<PlayerEntit
|
|||
private PlayerEntity owner;
|
||||
|
||||
public DummyPlayerEntity(World world, GameProfile profile) {
|
||||
super(world, BlockPos.ORIGIN, 0, profile);
|
||||
super(world, BlockPos.ORIGIN, 0, profile, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEquipStack(ItemStack stack) {
|
||||
protected void playEquipSound(ItemStack stack) {
|
||||
/*noop*/
|
||||
}
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ public class DummyServerPlayerEntity extends ServerPlayerEntity implements Owned
|
|||
private PlayerEntity owner;
|
||||
|
||||
public DummyServerPlayerEntity(ServerWorld world, GameProfile profile) {
|
||||
super(world.getServer(), world, profile);
|
||||
super(world.getServer(), world, profile, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEquipStack(ItemStack stack) {
|
||||
protected void playEquipSound(ItemStack stack) {
|
||||
/*noop*/
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ import net.minecraft.particle.ParticleEffect;
|
|||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.StringHelper;
|
||||
|
@ -71,7 +70,7 @@ public class AlicornAmuletItem extends AmuletItem implements PlayerCharmTracker.
|
|||
if (iplayer != null) {
|
||||
int attachedTime = iplayer.getCharms().getArmour().getTicks(this);
|
||||
if (attachedTime > 0) {
|
||||
tooltip.add(new TranslatableText(getTranslationKey() + ".lore", StringHelper.formatTicks(attachedTime)));
|
||||
tooltip.add(Text.translatable(getTranslationKey() + ".lore", StringHelper.formatTicks(attachedTime)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,12 +22,10 @@ import net.minecraft.item.ArmorMaterials;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.StringVisitable;
|
||||
import net.minecraft.text.Style;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -54,7 +52,7 @@ public class AmuletItem extends WearableItem {
|
|||
&& entity instanceof LivingEntity
|
||||
&& ((LivingEntity) entity).getEquippedStack(EquipmentSlot.CHEST) == stack
|
||||
&& isApplicable((LivingEntity)entity)) {
|
||||
ParticleUtils.spawnParticles(entity.world.getDimension().isUltrawarm() ? ParticleTypes.SOUL_FIRE_FLAME : ParticleTypes.COMPOSTER, entity, 1);
|
||||
ParticleUtils.spawnParticles(entity.world.getDimension().ultrawarm() ? ParticleTypes.SOUL_FIRE_FLAME : ParticleTypes.COMPOSTER, entity, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,8 +60,8 @@ public class AmuletItem extends WearableItem {
|
|||
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> list, TooltipContext tooltipContext) {
|
||||
|
||||
for (StringVisitable line : MinecraftClient.getInstance().textRenderer.getTextHandler().wrapLines(
|
||||
new TranslatableText(getTranslationKey(stack) + ".lore"), 150, Style.EMPTY)) {
|
||||
MutableText compiled = new LiteralText("").formatted(Formatting.ITALIC, Formatting.GRAY);
|
||||
Text.translatable(getTranslationKey(stack) + ".lore"), 150, Style.EMPTY)) {
|
||||
MutableText compiled = Text.literal("").formatted(Formatting.ITALIC, Formatting.GRAY);
|
||||
line.visit(s -> {
|
||||
compiled.append(s);
|
||||
return Optional.empty();
|
||||
|
@ -72,7 +70,7 @@ public class AmuletItem extends WearableItem {
|
|||
}
|
||||
|
||||
if (isChargable()) {
|
||||
list.add(new TranslatableText("item.unicopia.amulet.energy", (int)Math.floor(getEnergy(stack)), maxEnergy));
|
||||
list.add(Text.translatable("item.unicopia.amulet.energy", (int)Math.floor(getEnergy(stack)), maxEnergy));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.WorldEvents;
|
||||
|
@ -32,7 +31,7 @@ public class FilledJarItem extends JarItem implements ChameleonItem {
|
|||
|
||||
@Override
|
||||
public Text getName(ItemStack stack) {
|
||||
return hasAppearance(stack) ? new TranslatableText(getTranslationKey(stack), getAppearanceStack(stack).getName()) : UItems.EMPTY_JAR.getName(UItems.EMPTY_JAR.getDefaultStack());
|
||||
return hasAppearance(stack) ? Text.translatable(getTranslationKey(stack), getAppearanceStack(stack).getName()) : UItems.EMPTY_JAR.getName(UItems.EMPTY_JAR.getDefaultStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,6 @@ import net.minecraft.item.DyeableItem;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stat.Stats;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
|
@ -41,7 +40,7 @@ public class FriendshipBraceletItem extends WearableItem implements DyeableItem,
|
|||
|
||||
ItemStack result = stack.copy();
|
||||
result.setCount(1);
|
||||
result.getOrCreateNbt().putString("issuer", player.getName().asString());
|
||||
result.getOrCreateNbt().putString("issuer", player.getName().getString());
|
||||
result.getOrCreateNbt().putUuid("issuer_id", player.getUuid());
|
||||
|
||||
if (!player.getAbilities().creativeMode) {
|
||||
|
@ -67,10 +66,10 @@ public class FriendshipBraceletItem extends WearableItem implements DyeableItem,
|
|||
@Environment(EnvType.CLIENT)
|
||||
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> list, TooltipContext tooltipContext) {
|
||||
if (isSigned(stack)) {
|
||||
list.add(new TranslatableText("item.unicopia.friendship_bracelet.issuer", getSignatorName(stack)));
|
||||
list.add(Text.translatable("item.unicopia.friendship_bracelet.issuer", getSignatorName(stack)));
|
||||
}
|
||||
if (isGlowing(stack)) {
|
||||
list.add(new TranslatableText("item.unicopia.friendship_bracelet.glowing").formatted(Formatting.ITALIC, Formatting.GRAY));
|
||||
list.add(Text.translatable("item.unicopia.friendship_bracelet.glowing").formatted(Formatting.ITALIC, Formatting.GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import net.minecraft.item.ItemGroup;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -61,7 +60,7 @@ public class GemstoneItem extends Item {
|
|||
if (isEnchanted(stack)) {
|
||||
SpellType<?> key = getSpellKey(stack);
|
||||
|
||||
MutableText line = new TranslatableText(key.getTranslationKey() + ".lore").formatted(key.getAffinity().getColor());
|
||||
MutableText line = Text.translatable(key.getTranslationKey() + ".lore").formatted(key.getAffinity().getColor());
|
||||
|
||||
if (!Unicopia.SIDE.getPlayerSpecies().canCast()) {
|
||||
line = line.formatted(Formatting.OBFUSCATED);
|
||||
|
@ -94,10 +93,10 @@ public class GemstoneItem extends Item {
|
|||
public Text getName(ItemStack stack) {
|
||||
if (isEnchanted(stack)) {
|
||||
if (!Unicopia.SIDE.getPlayerSpecies().canCast()) {
|
||||
return new TranslatableText(getTranslationKey(stack) + ".obfuscated");
|
||||
return Text.translatable(getTranslationKey(stack) + ".obfuscated");
|
||||
}
|
||||
|
||||
return new TranslatableText(getTranslationKey(stack) + ".enchanted", getSpellKey(stack).getName());
|
||||
return Text.translatable(getTranslationKey(stack) + ".enchanted", getSpellKey(stack).getName());
|
||||
}
|
||||
return super.getName();
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package com.minelittlepony.unicopia.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellbookRecipe;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.crafting.TraitRequirementRecipe;
|
||||
|
||||
import net.fabricmc.fabric.api.loot.v1.FabricLootSupplier;
|
||||
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
|
||||
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
|
||||
import net.minecraft.loot.LootTable;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.recipe.RecipeSerializer;
|
||||
|
@ -37,7 +38,7 @@ public interface URecipes {
|
|||
}
|
||||
|
||||
static void bootstrap() {
|
||||
LootTableLoadingCallback.EVENT.register((res, manager, id, supplier, setter) -> {
|
||||
LootTableEvents.MODIFY.register((res, manager, id, supplier, setter) -> {
|
||||
if (!"minecraft".contentEquals(id.getNamespace())) {
|
||||
return;
|
||||
}
|
||||
|
@ -45,7 +46,7 @@ public interface URecipes {
|
|||
Identifier modId = new Identifier("unicopiamc", id.getPath());
|
||||
LootTable table = manager.getTable(modId);
|
||||
if (table != LootTable.EMPTY) {
|
||||
supplier.withPools(((FabricLootSupplier)table).getPools());
|
||||
supplier.pools(List.of(table.pools));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public class GemFindingEnchantment extends SimpleEnchantment {
|
|||
@Override
|
||||
public void onEquipped(Living<?> user) {
|
||||
if (user.isClient()) {
|
||||
MinecraftClient.getInstance().getSoundManager().play(new MagicAuraSoundInstance(user.getEntity().getSoundCategory(), user));
|
||||
MinecraftClient.getInstance().getSoundManager().play(new MagicAuraSoundInstance(user.getEntity().getSoundCategory(), user, user.getReferenceWorld().getRandom()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.minelittlepony.unicopia.item.enchantment;
|
|||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -21,6 +20,7 @@ import net.minecraft.resource.ResourceManager;
|
|||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.function.Function;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
public enum Toxicity {
|
||||
|
@ -29,7 +28,7 @@ public enum Toxicity {
|
|||
}
|
||||
|
||||
public Text getTooltip() {
|
||||
return new TranslatableText(getTranslationKey()).formatted(color);
|
||||
return Text.translatable(getTranslationKey()).formatted(color);
|
||||
}
|
||||
|
||||
public static Toxicity byName(String name) {
|
||||
|
|
|
@ -12,7 +12,6 @@ import net.minecraft.item.FoodComponent;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.StringHelper;
|
||||
import net.minecraft.world.Difficulty;
|
||||
|
||||
|
@ -68,7 +67,7 @@ public interface Toxin extends Affliction {
|
|||
|
||||
@Override
|
||||
public Text getName() {
|
||||
return self.getName().shallowCopy().append(" + ").append(other.getName());
|
||||
return self.getName().copy().append(" + ").append(other.getName());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -90,13 +89,13 @@ public interface Toxin extends Affliction {
|
|||
static Toxin of(StatusEffect effect, int seconds, int amplifier) {
|
||||
int ticks = seconds * 20;
|
||||
|
||||
MutableText text = effect.getName().shallowCopy();
|
||||
MutableText text = effect.getName().copy();
|
||||
|
||||
if (amplifier > 0) {
|
||||
text = new TranslatableText("potion.withAmplifier", text, new TranslatableText("potion.potency." + amplifier));
|
||||
text = Text.translatable("potion.withAmplifier", text, Text.translatable("potion.potency." + amplifier));
|
||||
}
|
||||
|
||||
text = new TranslatableText("potion.withDuration", text, StringHelper.formatTicks(ticks));
|
||||
text = Text.translatable("potion.withDuration", text, StringHelper.formatTicks(ticks));
|
||||
|
||||
return of(text, (player, stack) -> {
|
||||
StatusEffectInstance current = player.getStatusEffect(effect);
|
||||
|
@ -138,7 +137,7 @@ public interface Toxin extends Affliction {
|
|||
|
||||
@Override
|
||||
public Text getName() {
|
||||
return Predicate.this.getName().shallowCopy().append(toxin.getName());
|
||||
return Predicate.this.getName().copy().append(toxin.getName());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
@Mixin(DamageSource.class)
|
||||
abstract class MixinDamageSource {
|
||||
|
@ -23,11 +22,11 @@ abstract class MixinDamageSource {
|
|||
|
||||
Entity prime = entity.getPrimeAdversary();
|
||||
if (prime != null && !(attacker instanceof Owned<?> && ((Owned<Entity>)attacker).isOwnedBy(prime))) {
|
||||
info.setReturnValue(new TranslatableText("death.attack.generic.and_also", info.getReturnValue(), attacker.getDisplayName()));
|
||||
info.setReturnValue(Text.translatable("death.attack.generic.and_also", info.getReturnValue(), attacker.getDisplayName()));
|
||||
return;
|
||||
}
|
||||
|
||||
info.setReturnValue(new TranslatableText("death.attack." + self.getName() + ".player", entity.getDisplayName(), attacker.getDisplayName()));
|
||||
info.setReturnValue(Text.translatable("death.attack." + self.getName() + ".player", entity.getDisplayName(), attacker.getDisplayName()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
|||
|
||||
@Mixin(ServerPlayerEntity.class)
|
||||
abstract class MixinServerPlayerEntity extends PlayerEntity implements ScreenHandlerListener, PonyContainer<Pony>, MotionChecker {
|
||||
MixinServerPlayerEntity() {super(null, null, 0, null);}
|
||||
MixinServerPlayerEntity() {super(null, null, 0, null, null);}
|
||||
|
||||
@Override
|
||||
@Accessor("inTeleportationState")
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.World;
|
|||
|
||||
@Mixin(ServerWorld.class)
|
||||
abstract class MixinServerWorld extends World implements StructureWorldAccess {
|
||||
private MixinServerWorld() {super(null, null, null, null, false, false, 0);}
|
||||
MixinServerWorld() { super(null, null, null, null, false, false, 0, 0); }
|
||||
|
||||
@Inject(method = "onBlockChanged", at = @At("HEAD"))
|
||||
private void onOnBlockChanged(BlockPos pos, BlockState oldState, BlockState newState, CallbackInfo info) {
|
||||
|
|
|
@ -13,8 +13,8 @@ import net.minecraft.client.input.KeyboardInput;
|
|||
|
||||
@Mixin(KeyboardInput.class)
|
||||
abstract class MixinKeyboardInput extends Input {
|
||||
@Inject(method = "tick(Z)V", at = @At("RETURN"))
|
||||
private void onTick(boolean strafe, CallbackInfo info) {
|
||||
@Inject(method = "tick(ZF)V", at = @At("RETURN"))
|
||||
private void onTick(boolean a, float b, CallbackInfo info) {
|
||||
Pony player = Pony.of(MinecraftClient.getInstance().player);
|
||||
|
||||
if (player != null && player.getPhysics().isGravityNegative()) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class ClientNetworkHandlerImpl implements ClientNetworkHandler {
|
|||
}
|
||||
|
||||
if (entity.getType() == UEntities.MAGIC_BEAM) {
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_MAGIC_BEAM);
|
||||
InteractionManager.instance().playLoopingSound(entity, InteractionManager.SOUND_MAGIC_BEAM, entity.getId());
|
||||
}
|
||||
|
||||
world.addEntity(packet.getId(), entity);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.minelittlepony.unicopia.particle;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import com.minelittlepony.common.util.Color;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
|
@ -12,6 +11,7 @@ import net.minecraft.particle.ParticleEffect;
|
|||
import net.minecraft.particle.ParticleType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
public class MagicParticleEffect implements ParticleEffect {
|
||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.entity.damage.DamageSource;
|
|||
import net.minecraft.entity.damage.EntityDamageSource;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public class MagicalDamageSource extends EntityDamageSource {
|
||||
|
||||
|
@ -89,6 +88,6 @@ public class MagicalDamageSource extends EntityDamageSource {
|
|||
params.add(item.toHoverableText());
|
||||
}
|
||||
|
||||
return new TranslatableText(basic, params.toArray());
|
||||
return Text.translatable(basic, params.toArray());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,15 +22,12 @@ public interface Resources {
|
|||
.create();
|
||||
|
||||
static Stream<Resource> getResources(ResourceManager manager, Identifier id) {
|
||||
try {
|
||||
return manager.getAllResources(id).stream();
|
||||
} catch (IOException ignored) { }
|
||||
return Stream.empty();
|
||||
}
|
||||
|
||||
static Stream<Identifier> loadFile(Resource res, Type type, String msg) throws JsonParseException {
|
||||
try (Resource resource = res) {
|
||||
return (GSON.<List<Identifier>>fromJson(new InputStreamReader(resource.getInputStream()), type)).stream();
|
||||
try (InputStreamReader reader = new InputStreamReader(res.getInputStream())) {
|
||||
return (GSON.<List<Identifier>>fromJson(reader, type)).stream();
|
||||
} catch (JsonParseException e) {
|
||||
Unicopia.LOGGER.warn(msg + res.getResourcePackName(), e);
|
||||
} catch (IOException ignored) {}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.minelittlepony.unicopia.util.shape;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
public class Cylinder implements Shape {
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.minelittlepony.unicopia.util.shape;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
* A lonely Line. The simplest form of shape.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.minelittlepony.unicopia.util.shape;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Spliterator;
|
||||
import java.util.Spliterators.AbstractSpliterator;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
@ -11,6 +10,7 @@ import java.util.stream.StreamSupport;
|
|||
import com.google.common.collect.Streams;
|
||||
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -2,8 +2,7 @@ package com.minelittlepony.unicopia.util.shape;
|
|||
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
* A sphere, or 2d circle of you so desire.
|
||||
|
|
|
@ -34,13 +34,10 @@
|
|||
"fabricloader": ">=0.12.0",
|
||||
"java": ">=17",
|
||||
"fabric-api-base": ">=0.1.0",
|
||||
"fabric-events-lifecycle-v0": ">=0.1.0",
|
||||
"kirin": "*"
|
||||
},
|
||||
"suggests": {
|
||||
"minelp": "*",
|
||||
"modmenu": "*",
|
||||
"fabric-keybindings-v0": ">=0.1.0",
|
||||
"fabric-rendering-v1": ">=0.1.0"
|
||||
"modmenu": "*"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue