Skip to content

Commit

Permalink
Merge pull request #1 from PineappleDevelopmentGroup/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Y2Kwastaken authored Jan 10, 2024
2 parents 68d7c9b + 31f139e commit a3ff1b2
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 155 deletions.
12 changes: 0 additions & 12 deletions blog/2019-05-28-first-blog-post.md

This file was deleted.

44 changes: 0 additions & 44 deletions blog/2019-05-29-long-blog-post.md

This file was deleted.

20 changes: 0 additions & 20 deletions blog/2021-08-01-mdx-blog-post.mdx

This file was deleted.

Binary file not shown.
25 changes: 0 additions & 25 deletions blog/2021-08-26-welcome/index.md

This file was deleted.

16 changes: 16 additions & 0 deletions blog/2024-01-9-welcome/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
slug: Welcome
title: Welcome
authors: [miles]
tags: [welcome]
---

Welcome to PineappleDevelopment's Official Blog!

I don't really yet know what we will be writing about here. But, if I ever have things on my mind I will write a blog about it.

Anyways I've spent time upgrading my docs website now we officially have a logo. Granted this is subject to change over time, but I'm content with it as of now. If you want to learn about PineappleLib you can check that out [here](/pineapple-lib).

Here is our logo

![Logo](pineappledev.png)
Binary file added blog/2024-01-9-welcome/pineappledev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 5 additions & 17 deletions blog/authors.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
endi:
name: Endilie Yacop Sucipto
title: Maintainer of Docusaurus
url: https://github.com/endiliey
image_url: https://github.com/endiliey.png

yangshun:
name: Yangshun Tay
title: Front End Engineer @ Facebook
url: https://github.com/yangshun
image_url: https://github.com/yangshun.png

slorber:
name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
miles:
name: Y2K_ | miles_dev
title: Pineapple Maintainer
url: https://miles.sh
image_url: https://github.com/Y2Kwastaken.png
24 changes: 8 additions & 16 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const remarkPluginsConfig = {
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'PineappleDevelopment',
tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',
tagline: 'Sweet',
favicon: 'img/pineapplefavicon.ico',

// Set the production url of your site here
url: 'https://docs.miles.sh/',
Expand Down Expand Up @@ -104,9 +104,9 @@ const config = {
},
},
navbar: {
title: 'My Site',
title: 'Pineapple Development',
logo: {
alt: 'My Site Logo',
alt: 'Pineapple Development Logo',
src: 'img/logo.svg',
},
items: [
Expand Down Expand Up @@ -137,25 +137,17 @@ const config = {
title: 'Docs',
items: [
{
label: 'Tutorial',
label: 'PineappleLib',
to: '/docs/libraries',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
href: 'https://discordapp.com/invite/NXW2FuQ6a5',
},
],
},
Expand All @@ -168,12 +160,12 @@ const config = {
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/PineappleDevelopmentGroup/',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} PineappleDevelopmentGroup, Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
Expand Down
91 changes: 90 additions & 1 deletion pineapple-lib/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ public class PlayerData {
The StringAdapter

```java title="PlayerDataAdapter.java"
public class PlayerDataAdapter implements StringAdapter<PlayerData>{
public class PlayerDataAdapter implements GenericStringAdapter<PlayerData> {

@Override
public Class<PlayerData> getRuntimeType() {
return PlayerData.class;
}

@Override
public String toString(PlayerData data) {
return data.toString();
Expand Down Expand Up @@ -219,3 +225,86 @@ private void registerAdapter() {
PineappleLib.getConfigurationManager().registerTypeAdapter(PlayerData.class, new PlayerDataAdapter());
}
```

### Complex Adapter

The PlayerData class to serialize

```java title="PlayerData.java"
public class PlayerData {

private final UUID uuid;
private int kills = 0;

public PlayerData(UUID uuid, int kills) {
this.uuid = uuid;
this.kills = kills;
}

public UUID getUUID() {
return this.uuid;
}

public int getKills() {
return this.kills;
}
}
```

The StringAdapter

```java title="PlayerDataAdapter.java"
public class PlayerDataAdapter implements TypeAdapter<Map<String, Object>, PlayerData> {

@Override
public Class<Map<String, Object>> getSavedType() {
return (Class<Map<String, Object>>) (Object) Map.class;
}

@Override
public Class<WeightedRandom<R>> getRuntimeType() {
return (Class<WeightedRandom<R>>) (Object) WeightedRandom.class;
}

@Override
public PlayerData read(Map<String, Object> value) {
return new PlayerData(UUID.fromString(value.get("uuid").toString()), (Integer) value.get("kills"));
}

@Override
public Map<String, Object> write(PlayerData value, Map<String, Object> existing, boolean replace) {
if (existing == null) {
existing = new HashMap<>();
}

if (!existing.containsKey("uuid") || replace) {
existing.put("uuid", value.getUUID().toString());
}

if (!existing.containsKey("kills") || replace) {
existing.put("kills", value.getKills());
}

return existing;
}
}
```

How it would look like used in a config:

```java title="PluginSettings.java"
public class PluginSettings {

@ConfigEntry("owner-data")
public static PlayerData OWNER_DATA = new PlayerData(UUID.randomUUID(), 20);

}
```

How to register the adapter:

```java
private void registerAdapter() {
PineappleLib.getConfigurationManager().registerTypeAdapter(PlayerData.class, new PlayerDataAdapter());
}
```
4 changes: 2 additions & 2 deletions src/components/HomepageFeatures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Heading from '@theme/Heading';
import styles from './styles.module.css';

const FeatureList = [
{
/*{
title: 'Easy to Use',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
Expand Down Expand Up @@ -32,7 +32,7 @@ const FeatureList = [
be extended while reusing the same header and footer.
</>
),
},
},*/
];

function Feature({Svg, title, description}) {
Expand Down
28 changes: 14 additions & 14 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-color-primary: #c88a1d;
--ifm-color-primary-dark: #9bcf1b;
--ifm-color-primary-darker: #84b017;
--ifm-color-primary-darkest: #3d7a51;
--ifm-color-primary-light: #9bcf1b;
--ifm-color-primary-lighter: #afeb17;
--ifm-color-primary-lightest: #b4f316;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--ifm-color-primary: #cdc560;
--ifm-color-primary-dark: #3d7a51;
--ifm-color-primary-darker: #356b47;
--ifm-color-primary-darkest: #2a5a3a;
--ifm-color-primary-light: #81a08c;
--ifm-color-primary-lighter: #b1d1bc;
--ifm-color-primary-lightest: #e5ffee;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/libraries">
Docusaurus Tutorial - 5min ⏱️
to="/pineapple-lib">
Getting Started With PineappleLib - 2min ⏱️
</Link>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/

.heroBanner {
padding: 4rem 0;
text-align: center;
Expand Down
Binary file removed static/img/docusaurus.png
Binary file not shown.
Binary file removed static/img/favicon.ico
Binary file not shown.
Loading

0 comments on commit a3ff1b2

Please sign in to comment.