a6587d55ce
Игрок: - RsxPlayer extends EntityPlayerSP: наш игрок с нашими числами движения. - RsxMovementInput extends MovementInputFromOptions: отменяет ванильный множитель подкрадывания 0.3 и ставит наш. - RsxPlayerTuning: подкрадывание 1.5 блока/с (было ~1.3), прыжок 1.35 блока (было 1.25). Прыжок считается по высоте: v = 0.42 * sqrt(h / 1.25) = 0.43713. Правило пользователя: значение меньше заданного не принимается, остаётся 1.5. Переопределяется из командной строки: -Drsx.sneakSpeed, -Drsx.jumpHeight. - Мобы прыгают как в ванилле: переопределение в RsxPlayer, а не в EntityLivingBase. - Три строки патчей в ванильное дерево: PlayerControllerMP создаёт RsxPlayer, Minecraft создаёт RsxMovementInput. Вся логика в нашем коде. - Форк собирается чисто, 3278 классов. Каталог: - tools/catalog-remake.py собирает assets/rustex/CATALOG.md и catalog.json. - Что нашли у ремейка: 218 предметов (46 одежды, 44 ресурса, 33 оружия, 31 медицина, 21 инструмент, 17 построек, 11 боеприпасов, 11 разных, 4 ловушки), 91 объект nextgen (бочки, ящики, двери, верстаки, печи, руда, модели монументов), 553 модели .obj (384 оружия с перезарядкой, 128 деталей постройки, 36 мебели, 4 руды), 133 иконки предметов, 2004 звука, текстуры монументов и животных, скины игрока (9 файлов 256x256 плюс 9 с моргающими глазами) в assets/rustex/player/. - Скины игрока - текстуры ремейка, модель тела ванильная. Декомпил ремейка лежит на диске: G:\src-decoded (5207 файлов, строки расшифрованы). Поведение клиента можно читать, а не угадывать: конфиг оружия с отдачей, схема viewmodel, формат данных. Значения же приходят с сервера, в клиенте только схема и значения по умолчанию. План дополнен разделами 2.8 (игрок) и 2.9 (декомпил).
41 lines
1.4 KiB
Java
41 lines
1.4 KiB
Java
package net.rustnotmc.client;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.entity.EntityPlayerSP;
|
|
import net.minecraft.client.network.NetHandlerPlayClient;
|
|
import net.minecraft.stats.RecipeBook;
|
|
import net.minecraft.stats.StatisticsManager;
|
|
import net.minecraft.world.World;
|
|
|
|
/**
|
|
* Our player.
|
|
*
|
|
* The vanilla player with two things changed: the crouch is a little faster
|
|
* and the jump is a little higher. Everything else is the vanilla behaviour,
|
|
* so the player still walks, swims, rides, fights and dies the way the game
|
|
* always did.
|
|
*
|
|
* The class exists so that the numbers of our movement live in our code and
|
|
* not in the patches of the vanilla tree: the patches only have to say "the
|
|
* player is ours", and everything else is here.
|
|
*/
|
|
public class RsxPlayer extends EntityPlayerSP {
|
|
|
|
public RsxPlayer(Minecraft minecraft, World world, NetHandlerPlayClient connection,
|
|
StatisticsManager statistics, RecipeBook recipeBook) {
|
|
super(minecraft, world, connection, statistics, recipeBook);
|
|
this.movementInput = new RsxMovementInput(minecraft.gameSettings);
|
|
}
|
|
|
|
/**
|
|
* How high the player jumps.
|
|
*
|
|
* The override lives here and not in EntityLivingBase, because the mobs
|
|
* have to keep jumping the way they always did.
|
|
*/
|
|
@Override
|
|
protected float getJumpUpwardsMotion() {
|
|
return RsxPlayerTuning.jumpMotion();
|
|
}
|
|
}
|