Code formatting

This commit is contained in:
FlorianMichael 2023-12-03 21:16:28 +01:00
parent 1175f84dc8
commit 995fb20f6a
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
46 changed files with 63 additions and 0 deletions

View File

@ -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;
}
}
```

View File

@ -38,4 +38,5 @@ public interface LoadCallback {
enum State {
PRE, POST
}
}

View File

@ -39,4 +39,5 @@ public interface LoadSaveFilesCallback {
enum State {
PRE, POST
}
}

View File

@ -39,4 +39,5 @@ public interface RegisterSettingsCallback {
enum State {
PRE, POST
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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) {
}
}

View File

@ -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);
}
}

View File

@ -55,4 +55,5 @@ public class JoinGameTracker extends StoredObject {
public void setEnchantmentSeed(long enchantmentSeed) {
this.enchantmentSeed = enchantmentSeed;
}
}

View File

@ -37,4 +37,5 @@ public class TeleportTracker extends StoredObject {
public void setPending(Boolean onGround) {
this.onGround = onGround;
}
}

View File

@ -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) {
}
}

View File

@ -152,4 +152,5 @@ public abstract class MixinDebugHud {
cir.getReturnValue().addAll(information);
}
}

View File

@ -105,4 +105,5 @@ public abstract class MixinServerInfo implements IServerInfo {
public void viaFabricPlus$setTranslatingVersion(VersionEnum version) {
viaFabricPlus$translatingVersion = version;
}
}

View File

@ -54,4 +54,5 @@ public abstract class MixinAutoRefillHandler_ItemSlotMonitor {
if (currentSlotId == 45) ci.cancel();
}
}
}

View File

@ -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));
}
}

View File

@ -36,4 +36,5 @@ public abstract class MixinDefaultJwtParserBuilder {
public Object removeServicesSupport(Class<Object> result) {
return new GsonDeserializer<>();
}
}

View File

@ -72,4 +72,5 @@ public abstract class MixinCamera {
}
}
}
}

View File

@ -52,4 +52,5 @@ public abstract class MixinEndPortalBlock extends BlockWithEntity {
cir.setReturnValue(viaFabricPlus$shape_r1_16_5);
}
}
}

View File

@ -62,4 +62,5 @@ public abstract class MixinFarmlandBlock extends Block {
return super.getCullingShape(state, view, pos);
}
}

View File

@ -64,4 +64,5 @@ public abstract class MixinSoulSandBlock extends Block {
return super.getVelocityMultiplier();
}
}

View File

@ -39,4 +39,5 @@ public class MixinBlobCache implements IBlobCache {
public Map<Long, CompletableFuture<byte[]>> viaFabricPlus$getPending() {
return pending;
}
}

View File

@ -37,4 +37,5 @@ public abstract class VFPViaSubCommand extends ViaSubCommand {
public UserConnection getUser() {
return ProtocolHack.getPlayNetworkUserConnection();
}
}

View File

@ -72,4 +72,5 @@ public class ViaFabricPlusVLCommandHandler extends VLCommandHandler {
.forEach(builder::add);
return builder.buildFuture();
}
}

View File

@ -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();
}
}

View File

@ -68,4 +68,5 @@ public class ViaFabricPlusVLInjector extends VLInjector {
return platformSpecific;
}
}

View File

@ -27,4 +27,5 @@ public class ViaFabricPlusViaLegacyPlatformImpl extends ViaLegacyPlatformImpl {
public String getCpeAppName() {
return "ViaFabricPlus";
}
}

View File

@ -52,4 +52,5 @@ public class ViaFabricPlusViaDecoder extends ViaDecoder {
throw t;
}
}
}

View File

@ -28,4 +28,5 @@ public class ViaFabricPlusClassicWorldHeightProvider extends ClassicWorldHeightP
public short getMaxChunkSectionCount(UserConnection user) {
return 64;
}
}

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -43,4 +43,5 @@ public class ViaFabricPlusOldAuthProvider extends OldAuthProvider {
ViaFabricPlus.global().getLogger().error("Error occurred while calling join server to verify session", e);
}
}
}

View File

@ -42,4 +42,5 @@ public class ViaFabricPlusCommandArgumentsProvider extends SignableCommandArgume
}
return Collections.emptyList();
}
}

View File

@ -34,4 +34,5 @@ public class ViaFabricPlusPlayerAbilitiesProvider extends PlayerAbilitiesProvide
public float getWalkingSpeed(UserConnection connection) {
return MinecraftClient.getInstance().player.getAbilities().getWalkSpeed();
}
}

View File

@ -37,4 +37,5 @@ public class ViaFabricPlusPlayerLookTargetProvider extends PlayerLookTargetProvi
return null;
}
}

View File

@ -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;
}
}

View 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;
}
}

View File

@ -92,4 +92,5 @@ public class AccountsSave extends AbstractSave {
public void setClassicubeAccount(CCAccount classicubeAccount) {
this.classicubeAccount = classicubeAccount;
}
}

View File

@ -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);
}
}
}

View File

@ -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();
}
}

View File

@ -190,4 +190,5 @@ public class VFPScreen extends Screen {
ViaFabricPlus.global().getLogger().error("Something went wrong!", throwable);
}
}

View File

@ -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);
}
}
}

View File

@ -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();
}
}
}

View File

@ -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;
}
}
}