Skip to content

Commit

Permalink
Lightning -> Lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentinTheKid committed Oct 9, 2024
1 parent 5d15714 commit 7827770
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ public class ModSettingsApiExample extends ModSettingsExample {
private final ModSettingModule modSettingModule = Apollo.getModuleManager().getModule(ModSettingModule.class);

@Override
public void disableLightningModExample(Player viewer) {
public void disableLightingModExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> this.modSettingModule.getOptions().set(apolloPlayer, ModLighting.ENABLED, false));
}

@Override
public void rollbackLightningModEnabledState(Player viewer) {
public void rollbackLightingModEnabledState(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
// To rollback the server override value of the setting, simply set the value to "null"
apolloPlayerOpt.ifPresent(apolloPlayer -> this.modSettingModule.getOptions().set(apolloPlayer, ModLighting.ENABLED, null));
}

@Override
public void broadcastDisableLightningModExample() {
public void broadcastDisableLightingModExample() {
this.modSettingModule.getOptions().set(ModLighting.ENABLED, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command

switch (args[0].toLowerCase()) {
case "disable": {
modSettingsExample.disableLightningModExample(player);
player.sendMessage("Disabling lightning mod....");
modSettingsExample.disableLightingModExample(player);
player.sendMessage("Disabling lighting mod....");
break;
}

case "reset": {
modSettingsExample.rollbackLightningModEnabledState(player);
player.sendMessage("Rollbacking lightning mod enabled state....");
modSettingsExample.rollbackLightingModEnabledState(player);
player.sendMessage("Rollbacking lighting mod enabled state....");
break;
}

case "broadcast": {
modSettingsExample.broadcastDisableLightningModExample();
player.sendMessage("Broadcasting disable lightning mod....");
modSettingsExample.broadcastDisableLightingModExample();
player.sendMessage("Broadcasting disable lighting mod....");
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

public abstract class ModSettingsExample extends ApolloExample {

public abstract void disableLightningModExample(Player viewer);
public abstract void disableLightingModExample(Player viewer);

public abstract void rollbackLightningModEnabledState(Player viewer);
public abstract void rollbackLightingModEnabledState(Player viewer);

public abstract void broadcastDisableLightningModExample();
public abstract void broadcastDisableLightingModExample();

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class ModSettingsJsonExample extends ModSettingsExample {

@Override
public void disableLightningModExample(Player viewer) {
public void disableLightingModExample(Player viewer) {
Map<String, Object> properties = new HashMap<>();
properties.put("lighting.enabled", false);

Expand All @@ -43,7 +43,7 @@ public void disableLightningModExample(Player viewer) {
}

@Override
public void rollbackLightningModEnabledState(Player viewer) {
public void rollbackLightingModEnabledState(Player viewer) {
Map<String, Object> properties = new HashMap<>();
// To rollback the server override value of the setting, simply set the value to "null"
properties.put("lighting.enabled", null);
Expand All @@ -53,7 +53,7 @@ public void rollbackLightningModEnabledState(Player viewer) {
}

@Override
public void broadcastDisableLightningModExample() {
public void broadcastDisableLightingModExample() {
Map<String, Object> properties = new HashMap<>();
properties.put("lighting.enabled", false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class ModSettingsProtoExample extends ModSettingsExample {

@Override
public void disableLightningModExample(Player viewer) {
public void disableLightingModExample(Player viewer) {
Map<String, Value> properties = new HashMap<>();
properties.put("lighting.enabled", Value.newBuilder().setBoolValue(false).build());

Expand All @@ -44,7 +44,7 @@ public void disableLightningModExample(Player viewer) {
}

@Override
public void rollbackLightningModEnabledState(Player viewer) {
public void rollbackLightingModEnabledState(Player viewer) {
Map<String, Value> properties = new HashMap<>();
// To rollback the server override value of the setting, simply set the value to "null"
properties.put("lighting.enabled", Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build());
Expand All @@ -54,7 +54,7 @@ public void rollbackLightningModEnabledState(Player viewer) {
}

@Override
public void broadcastDisableLightningModExample() {
public void broadcastDisableLightingModExample() {
Map<String, Value> properties = new HashMap<>();
properties.put("lighting.enabled", Value.newBuilder().setBoolValue(false).build());

Expand Down
36 changes: 18 additions & 18 deletions docs/developers/modules/modsetting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ Explore each integration by cycling through each tab, to find the best fit for y

<Tab>

### Disable Lightning Mod
### Disable Lighting Mod

```java
public void disableLightningModExample(Player viewer) {
public void disableLightingModExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> this.modSettingModule.getOptions().set(apolloPlayer, ModLighting.ENABLED, false));
}
```

### Reset Lightning Mod to it's default value
### Reset Lighting Mod to it's default value

```java
public void rollbackLightningModEnabledState(Player viewer) {
public void rollbackLightingModEnabledState(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
// To rollback the server override value of the setting, simply set the value to "null"
apolloPlayerOpt.ifPresent(apolloPlayer -> this.modSettingModule.getOptions().set(apolloPlayer, ModLighting.ENABLED, null));
}
```

### Broadcast Disable Lightning Mod the an entire server
### Broadcast Disable Lighting Mod the an entire server

```java
public void broadcastDisableLightningModExample(Player viewer) {
public void broadcastDisableLightingModExample(Player viewer) {
this.modSettingModule.getOptions().set(ModLighting.ENABLED, false);
}
```
Expand All @@ -59,10 +59,10 @@ public void broadcastDisableLightningModExample(Player viewer) {

<Tab>

### Disable Lightning Mod
### Disable Lighting Mod

```java
public void disableLightningModExample(Player viewer) {
public void disableLightingModExample(Player viewer) {
Map<String, Value> properties = new HashMap<>();
properties.put("lighting.enabled", Value.newBuilder().setBoolValue(false).build());

Expand All @@ -71,10 +71,10 @@ public void disableLightningModExample(Player viewer) {
}
```

### Reset Lightning Mod to it's default value
### Reset Lighting Mod to it's default value

```java
public void rollbackLightningModEnabledState(Player viewer) {
public void rollbackLightingModEnabledState(Player viewer) {
Map<String, Value> properties = new HashMap<>();
// To rollback the server override value of the setting, simply set the value to "null"
properties.put("lighting.enabled", Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build());
Expand All @@ -84,10 +84,10 @@ public void rollbackLightningModEnabledState(Player viewer) {
}
```

### Broadcast Disable Lightning Mod the an entire server
### Broadcast Disable Lighting Mod the an entire server

```java
public void broadcastDisableLightningModExample() {
public void broadcastDisableLightingModExample() {
Map<String, Value> properties = new HashMap<>();
properties.put("lighting.enabled", Value.newBuilder().setBoolValue(false).build());

Expand All @@ -100,10 +100,10 @@ public void broadcastDisableLightningModExample() {

<Tab>

### Disable Lightning Mod
### Disable Lighting Mod

```java
public void disableLightningModExample(Player viewer) {
public void disableLightingModExample(Player viewer) {
Map<String, Object> properties = new HashMap<>();
properties.put("lighting.enabled", false);

Expand All @@ -112,10 +112,10 @@ public void disableLightningModExample(Player viewer) {
}
```

### Reset Lightning Mod to it's default value
### Reset Lighting Mod to it's default value

```java
public void rollbackLightningModEnabledState(Player viewer) {
public void rollbackLightingModEnabledState(Player viewer) {
// To rollback the server override value of the setting, simply set the value to "null"
Map<String, Object> properties = new HashMap<>();
properties.put("lighting.enabled", null);
Expand All @@ -125,10 +125,10 @@ public void rollbackLightningModEnabledState(Player viewer) {
}
```

### Broadcast Disable Lightning Mod the an entire server
### Broadcast Disable Lighting Mod the an entire server

```java
public void broadcastDisableLightningModExample() {
public void broadcastDisableLightingModExample() {
Map<String, Object> properties = new HashMap<>();
properties.put("lighting.enabled", false);

Expand Down

1 comment on commit 7827770

@LunarClientBot
Copy link
Collaborator

@LunarClientBot LunarClientBot commented on 7827770 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📄 Documentation Deployment

Status:✅ Completed
Environment:preview
URL:https://2c3e8a92.lunarclient-dev.pages.dev

Please sign in to comment.