mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-21 11:46:49 +01:00
Code formatting
This commit is contained in:
parent
1175f84dc8
commit
995fb20f6a
@ -64,6 +64,7 @@ if (ItemRegistryDiff.contains(Items.STONE, VersionRange.andOlder(VersionEnum.r1_
|
||||
### Creating own settings for the settings screen
|
||||
```java
|
||||
public class ExampleSettingGroup extends SettingGroup {
|
||||
|
||||
private static final ExampleSettingGroup instance = new ExampleSettingGroup();
|
||||
|
||||
public final BooleanSetting test = new BooleanSetting(this, Text.of("Test"), false);
|
||||
@ -75,6 +76,7 @@ public class ExampleSettingGroup extends SettingGroup {
|
||||
public static ExampleSettingGroup global() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -38,4 +38,5 @@ public interface LoadCallback {
|
||||
enum State {
|
||||
PRE, POST
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,4 +39,5 @@ public interface LoadSaveFilesCallback {
|
||||
enum State {
|
||||
PRE, POST
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,4 +39,5 @@ public interface RegisterSettingsCallback {
|
||||
enum State {
|
||||
PRE, POST
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public class CPEAdditions {
|
||||
|
||||
public final static List<ClassicProtocolExtension> ALLOWED_EXTENSIONS = Arrays.asList(ClassicProtocolExtension.ENV_WEATHER_TYPE);
|
||||
public final static Map<Integer, ClientboundPacketsc0_30cpe> CUSTOM_PACKETS = new HashMap<>();
|
||||
|
||||
@ -53,4 +54,5 @@ public class CPEAdditions {
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import java.util.List;
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
public class GridItemSelectionScreen extends VFPScreen {
|
||||
|
||||
public static final GridItemSelectionScreen INSTANCE = new GridItemSelectionScreen();
|
||||
|
||||
private static final int MAX_ROW_DIVIDER = 9;
|
||||
@ -118,4 +119,5 @@ public class GridItemSelectionScreen extends VFPScreen {
|
||||
y += ITEM_XY_BOX_DIMENSION_CLASSIC;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -173,4 +173,5 @@ public class WorldHeightSupport {
|
||||
private static void changeDimensionTagHeight(final UserConnection user, final CompoundTag tag) {
|
||||
tag.put("height", new IntTag(Via.getManager().getProviders().get(ClassicWorldHeightProvider.class).getMaxChunkSectionCount(user) << 4));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import net.raphimc.vialegacy.protocols.classic.protocolc0_28_30toc0_28_30cpe.sto
|
||||
import net.raphimc.vialoader.util.VersionEnum;
|
||||
|
||||
public class ListExtensionsCommand extends VFPViaSubCommand {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "listextensions";
|
||||
@ -50,4 +51,5 @@ public class ListExtensionsCommand extends VFPViaSubCommand {
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import net.raphimc.vialoader.util.VersionEnum;
|
||||
import net.raphimc.vialegacy.protocols.alpha.protocola1_0_17_1_0_17_4toa1_0_16_2.storage.TimeLockStorage;
|
||||
|
||||
public class SetTimeCommand extends VFPViaSubCommand {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "settime";
|
||||
@ -62,4 +63,5 @@ public class SetTimeCommand extends VFPViaSubCommand {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import net.minecraft.entity.vehicle.BoatEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class BoatModel1_8 extends CompositeEntityModel<BoatEntity> {
|
||||
|
||||
public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier("viafabricplus", "boat1_8"), "main");
|
||||
private final ImmutableList<ModelPart> parts;
|
||||
|
||||
@ -57,4 +58,5 @@ public class BoatModel1_8 extends CompositeEntityModel<BoatEntity> {
|
||||
@Override
|
||||
public void setAngles(BoatEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RotationAxis;
|
||||
|
||||
public class BoatRenderer1_8 extends EntityRenderer<BoatEntity> {
|
||||
|
||||
private static final Identifier TEXTURE = new Identifier("viafabricplus", "textures/boat1_8.png");
|
||||
private final BoatModel1_8 model;
|
||||
|
||||
@ -69,4 +70,5 @@ public class BoatRenderer1_8 extends EntityRenderer<BoatEntity> {
|
||||
matrices.pop();
|
||||
super.render(entity, yaw, tickDelta, matrices, vertexConsumers, light);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -55,4 +55,5 @@ public class JoinGameTracker extends StoredObject {
|
||||
public void setEnchantmentSeed(long enchantmentSeed) {
|
||||
this.enchantmentSeed = enchantmentSeed;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,4 +37,5 @@ public class TeleportTracker extends StoredObject {
|
||||
public void setPending(Boolean onGround) {
|
||||
this.onGround = onGround;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ViaFabricPlusMixinPlugin implements IMixinConfigPlugin {
|
||||
|
||||
public static final String INJECTOR_PACKAGE = "de.florianmichael.viafabricplus.injection.mixin.";
|
||||
|
||||
private static final String MC_FIXES_PACKAGE = "fixes.minecraft.";
|
||||
@ -93,4 +94,5 @@ public class ViaFabricPlusMixinPlugin implements IMixinConfigPlugin {
|
||||
@Override
|
||||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -152,4 +152,5 @@ public abstract class MixinDebugHud {
|
||||
|
||||
cir.getReturnValue().addAll(information);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -105,4 +105,5 @@ public abstract class MixinServerInfo implements IServerInfo {
|
||||
public void viaFabricPlus$setTranslatingVersion(VersionEnum version) {
|
||||
viaFabricPlus$translatingVersion = version;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,4 +54,5 @@ public abstract class MixinAutoRefillHandler_ItemSlotMonitor {
|
||||
if (currentSlotId == 45) ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,4 +36,5 @@ public abstract class MixinClasses {
|
||||
private static void removeServicesSupport(String fqcn, CallbackInfoReturnable<Class<Object>> cir) throws ClassNotFoundException {
|
||||
cir.setReturnValue((Class<Object>) Class.forName(fqcn));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,4 +36,5 @@ public abstract class MixinDefaultJwtParserBuilder {
|
||||
public Object removeServicesSupport(Class<Object> result) {
|
||||
return new GsonDeserializer<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -72,4 +72,5 @@ public abstract class MixinCamera {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,4 +52,5 @@ public abstract class MixinEndPortalBlock extends BlockWithEntity {
|
||||
cir.setReturnValue(viaFabricPlus$shape_r1_16_5);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,4 +62,5 @@ public abstract class MixinFarmlandBlock extends Block {
|
||||
|
||||
return super.getCullingShape(state, view, pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,4 +64,5 @@ public abstract class MixinSoulSandBlock extends Block {
|
||||
|
||||
return super.getVelocityMultiplier();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,4 +39,5 @@ public class MixinBlobCache implements IBlobCache {
|
||||
public Map<Long, CompletableFuture<byte[]>> viaFabricPlus$getPending() {
|
||||
return pending;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,4 +37,5 @@ public abstract class VFPViaSubCommand extends ViaSubCommand {
|
||||
public UserConnection getUser() {
|
||||
return ProtocolHack.getPlayNetworkUserConnection();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -72,4 +72,5 @@ public class ViaFabricPlusVLCommandHandler extends VLCommandHandler {
|
||||
.forEach(builder::add);
|
||||
return builder.buildFuture();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
import java.util.UUID;
|
||||
|
||||
public class ViaFabricPlusViaCommandSender implements ViaCommandSender {
|
||||
|
||||
private final CommandSource source;
|
||||
|
||||
public ViaFabricPlusViaCommandSender(final CommandSource source) {
|
||||
@ -52,4 +53,5 @@ public class ViaFabricPlusViaCommandSender implements ViaCommandSender {
|
||||
public String getName() {
|
||||
return ((FabricClientCommandSource) source).getPlayer().getEntityName();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,4 +68,5 @@ public class ViaFabricPlusVLInjector extends VLInjector {
|
||||
|
||||
return platformSpecific;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,4 +27,5 @@ public class ViaFabricPlusViaLegacyPlatformImpl extends ViaLegacyPlatformImpl {
|
||||
public String getCpeAppName() {
|
||||
return "ViaFabricPlus";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,4 +52,5 @@ public class ViaFabricPlusViaDecoder extends ViaDecoder {
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,4 +28,5 @@ public class ViaFabricPlusClassicWorldHeightProvider extends ClassicWorldHeightP
|
||||
public short getMaxChunkSectionCount(UserConnection user) {
|
||||
return 64;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,4 +30,5 @@ public class ViaFabricPlusEncryptionProvider extends EncryptionProvider {
|
||||
public void enableDecryption(UserConnection user) {
|
||||
((IClientConnection) user.getChannel().attr(ProtocolHack.CLIENT_CONNECTION_ATTRIBUTE_KEY).get()).viaFabricPlus$setupPreNettyDecryption();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ViaFabricPlusGameProfileFetcher extends GameProfileFetcher {
|
||||
|
||||
public static final HttpAuthenticationService AUTHENTICATION_SERVICE = new YggdrasilAuthenticationService(Proxy.NO_PROXY);
|
||||
public static final MinecraftSessionService SESSION_SERVICE = AUTHENTICATION_SERVICE.createMinecraftSessionService();
|
||||
public static final GameProfileRepository GAME_PROFILE_REPOSITORY = AUTHENTICATION_SERVICE.createProfileRepository();
|
||||
@ -72,4 +73,5 @@ public class ViaFabricPlusGameProfileFetcher extends GameProfileFetcher {
|
||||
}
|
||||
return gameProfile;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,4 +43,5 @@ public class ViaFabricPlusOldAuthProvider extends OldAuthProvider {
|
||||
ViaFabricPlus.global().getLogger().error("Error occurred while calling join server to verify session", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,4 +42,5 @@ public class ViaFabricPlusCommandArgumentsProvider extends SignableCommandArgume
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,4 +34,5 @@ public class ViaFabricPlusPlayerAbilitiesProvider extends PlayerAbilitiesProvide
|
||||
public float getWalkingSpeed(UserConnection connection) {
|
||||
return MinecraftClient.getInstance().player.getAbilities().getWalkSpeed();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,4 +37,5 @@ public class ViaFabricPlusPlayerLookTargetProvider extends PlayerLookTargetProvi
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import java.io.*;
|
||||
*/
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
public abstract class AbstractSave {
|
||||
|
||||
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||
|
||||
private final File file;
|
||||
@ -87,4 +88,5 @@ public abstract class AbstractSave {
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SaveManager {
|
||||
|
||||
private final List<AbstractSave> saves = new ArrayList<>();
|
||||
|
||||
private final SettingsSave settingsSave;
|
||||
@ -69,4 +70,5 @@ public class SaveManager {
|
||||
public AccountsSave getAccountsSave() {
|
||||
return accountsSave;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -92,4 +92,5 @@ public class AccountsSave extends AbstractSave {
|
||||
public void setClassicubeAccount(CCAccount classicubeAccount) {
|
||||
this.classicubeAccount = classicubeAccount;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import de.florianmichael.viafabricplus.util.ChatUtil;
|
||||
import net.raphimc.vialoader.util.VersionEnum;
|
||||
|
||||
public class SettingsSave extends AbstractSave {
|
||||
|
||||
private final SettingsManager settingsManager;
|
||||
|
||||
public SettingsSave(final SettingsManager settingsManager) {
|
||||
@ -75,4 +76,5 @@ public class SettingsSave extends AbstractSave {
|
||||
ProtocolHack.setTargetVersion(ProtocolHack.NATIVE_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ import javax.annotation.Nullable;
|
||||
* functions and features used in all screens which are added by ViaFabricPlus
|
||||
*/
|
||||
public abstract class VFPListEntry extends AlwaysSelectedEntryListWidget.Entry<VFPListEntry> {
|
||||
|
||||
protected static final int SCISSORS_OFFSET = 4;
|
||||
public static final int SLOT_MARGIN = 3;
|
||||
|
||||
@ -116,4 +117,5 @@ public abstract class VFPListEntry extends AlwaysSelectedEntryListWidget.Entry<V
|
||||
mappedRender(context, index, y, x, entryWidth, entryHeight, mouseX, mouseY, hovered, tickDelta);
|
||||
matrices.pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -190,4 +190,5 @@ public class VFPScreen extends Screen {
|
||||
|
||||
ViaFabricPlus.global().getLogger().error("Something went wrong!", throwable);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ import net.raphimc.vialoader.util.VersionEnum;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class PerServerVersionScreen extends VFPScreen {
|
||||
|
||||
private final Consumer<VersionEnum> selectionConsumer;
|
||||
|
||||
public PerServerVersionScreen(final Screen prevScreen, final Consumer<VersionEnum> selectionConsumer) {
|
||||
@ -124,4 +125,5 @@ public class PerServerVersionScreen extends VFPScreen {
|
||||
context.drawCenteredTextWithShadow(textRenderer, this.versionEnum.getName(), x + entryWidth / 2, y - 1 + entryHeight / 2 - textRenderer.fontHeight / 2, -1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import net.raphimc.vialoader.util.VersionEnum;
|
||||
import java.awt.*;
|
||||
|
||||
public class ProtocolSelectionScreen extends VFPScreen {
|
||||
|
||||
public static final ProtocolSelectionScreen INSTANCE = new ProtocolSelectionScreen();
|
||||
|
||||
private ButtonWidget betaCraftButton;
|
||||
@ -148,4 +149,5 @@ public class ProtocolSelectionScreen extends VFPScreen {
|
||||
matrices.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget;
|
||||
|
||||
public class SettingsScreen extends VFPScreen {
|
||||
|
||||
public static final SettingsScreen INSTANCE = new SettingsScreen();
|
||||
|
||||
public SettingsScreen() {
|
||||
@ -75,4 +76,5 @@ public class SettingsScreen extends VFPScreen {
|
||||
return this.width - 5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user