Skip to content

Commit 6477962

Browse files
Merge pull request #69 from TeamKun/develop
v1.7.0
2 parents 3746607 + b7eeada commit 6477962

File tree

207 files changed

+11588
-4139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+11588
-4139
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish to HangarMC
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
name: Publish to HangarMC
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- name: Get the url of the artifact url from release assets
15+
id: get_asset_url
16+
uses: actions/github-script@v7
17+
with:
18+
result-encoding: string
19+
script: |
20+
const assets = await github.repos.listReleaseAssets({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
release_id: context.payload.release.id
24+
});
25+
// Find the asset with the name ending with .jar
26+
const asset = assets.data.find(asset => asset.name.endsWith('.jar'));
27+
if (!asset) {
28+
throw new Error('No asset found');
29+
}
30+
31+
return asset.browser_download_url;
32+
33+
- name: Publish to HangarMC
34+
uses: benwoo1110/hangar-upload-action@v1
35+
with:
36+
api_token: ${{ secrets.HANGAR_TOKEN }}
37+
slug: Scenamatica
38+
version: ${{ github.event.release.tag_name }}
39+
channel: ${{ github.event.release.prerelease == true && 'Beta' || 'Release' }}
40+
files: |
41+
[
42+
{
43+
"platform": "PAPER",
44+
"url": true,
45+
"externalUrl": "${{ steps.get_asset_url.outputs.result }}"
46+
}
47+
]
48+
description: ${{ github.event.release.body }}

.github/workflows/scenamatica-build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868
needs: self-tests
6969
steps:
7070
- name: Clean artifacts
71-
uses: geekyeggo/delete-artifact@v2
71+
uses: geekyeggo/delete-artifact@v5
7272
with:
7373
name: scenamatica

Scenamatica/.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Scenamatica/NMSBridge/NMSCore/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.kunlab.scenamatica</groupId>
88
<artifactId>NMSBridge</artifactId>
9-
<version>1.6.2</version>
9+
<version>1.7.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

@@ -23,62 +23,62 @@
2323
<dependency>
2424
<groupId>org.kunlab.scenamatica.nms</groupId>
2525
<artifactId>NMSTypes</artifactId>
26-
<version>1.6.2</version>
26+
<version>1.7.0</version>
2727
</dependency>
2828

2929
<!-- NMS Implementions -->
3030
<dependency>
3131
<groupId>org.kunlab.scenamatica.nms</groupId>
3232
<artifactId>v1_13_R1</artifactId>
33-
<version>1.6.2</version>
33+
<version>1.7.0</version>
3434
<scope>compile</scope>
3535
</dependency>
3636
<dependency>
3737
<groupId>org.kunlab.scenamatica.nms</groupId>
3838
<artifactId>v1_13_R2</artifactId>
39-
<version>1.6.2</version>
39+
<version>1.7.0</version>
4040
<scope>compile</scope>
4141
</dependency>
4242
<dependency>
4343
<groupId>org.kunlab.scenamatica.nms</groupId>
4444
<artifactId>v1_14_R1</artifactId>
45-
<version>1.6.2</version>
45+
<version>1.7.0</version>
4646
<scope>compile</scope>
4747
</dependency>
4848
<dependency>
4949
<groupId>org.kunlab.scenamatica.nms</groupId>
5050
<artifactId>v1_15_R1</artifactId>
51-
<version>1.6.2</version>
51+
<version>1.7.0</version>
5252
<scope>compile</scope>
5353
</dependency>
5454
<dependency>
5555
<groupId>org.kunlab.scenamatica.nms</groupId>
5656
<artifactId>v1_16_R1</artifactId>
57-
<version>1.6.2</version>
57+
<version>1.7.0</version>
5858
<scope>compile</scope>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.kunlab.scenamatica.nms</groupId>
6262
<artifactId>v1_16_R2</artifactId>
63-
<version>1.6.2</version>
63+
<version>1.7.0</version>
6464
<scope>compile</scope>
6565
</dependency>
6666
<dependency>
6767
<groupId>org.kunlab.scenamatica.nms</groupId>
6868
<artifactId>v1_16_R3</artifactId>
69-
<version>1.6.2</version>
69+
<version>1.7.0</version>
7070
<scope>compile</scope>
7171
</dependency>
7272
<dependency>
7373
<groupId>org.kunlab.scenamatica.nms</groupId>
7474
<artifactId>v1_17_R1</artifactId>
75-
<version>1.6.2</version>
75+
<version>1.7.0</version>
7676
<scope>compile</scope>
7777
</dependency>
7878
<dependency>
7979
<groupId>org.kunlab.scenamatica.nms</groupId>
8080
<artifactId>v1_18_R1</artifactId>
81-
<version>1.6.2</version>
81+
<version>1.7.0</version>
8282
<scope>compile</scope>
8383
</dependency>
8484
</dependencies>

Scenamatica/NMSBridge/NMSTypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.kunlab.scenamatica</groupId>
88
<artifactId>NMSBridge</artifactId>
9-
<version>1.6.2</version>
9+
<version>1.7.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

Scenamatica/NMSBridge/NMSTypes/src/main/java/org/kunlab/scenamatica/nms/WrapperProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.bukkit.entity.Entity;
77
import org.bukkit.entity.HumanEntity;
88
import org.bukkit.entity.Item;
9+
import org.bukkit.entity.LightningStrike;
910
import org.bukkit.entity.LivingEntity;
1011
import org.bukkit.entity.Player;
1112
import org.bukkit.inventory.ItemStack;
@@ -16,6 +17,7 @@
1617
import org.kunlab.scenamatica.nms.types.entity.NMSEntityItem;
1718
import org.kunlab.scenamatica.nms.types.entity.NMSEntityLiving;
1819
import org.kunlab.scenamatica.nms.types.entity.NMSEntityPlayer;
20+
import org.kunlab.scenamatica.nms.types.entity.NMSLightningStrike;
1921
import org.kunlab.scenamatica.nms.types.item.NMSItemStack;
2022
import org.kunlab.scenamatica.nms.types.world.NMSWorldServer;
2123

@@ -35,6 +37,8 @@ public interface WrapperProvider
3537

3638
NMSEntityPlayer wrap(Player bukkitEntity);
3739

40+
NMSLightningStrike wrap(LightningStrike bukkitLightningStrike);
41+
3842
// ==================[ ITEMS ]==================
3943

4044
NMSItemStack wrap(ItemStack bukkitItemStack);
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package org.kunlab.scenamatica.nms.enums.entity;
2+
3+
import org.bukkit.event.weather.LightningStrikeEvent;
4+
5+
public enum NMSLightningStrikeCause
6+
{
7+
COMMAND,
8+
TRIDENT,
9+
TRAP,
10+
WEATHER,
11+
UNKNOWN;
12+
13+
public static NMSLightningStrikeCause fromBukkit(LightningStrikeEvent.Cause cause)
14+
{
15+
if (cause == null)
16+
return null;
17+
18+
switch (cause)
19+
{
20+
case COMMAND:
21+
return COMMAND;
22+
case TRIDENT:
23+
return TRIDENT;
24+
case TRAP:
25+
return TRAP;
26+
case WEATHER:
27+
return WEATHER;
28+
default:
29+
return UNKNOWN;
30+
}
31+
}
32+
33+
public static LightningStrikeEvent.Cause toBukkit(NMSLightningStrikeCause cause)
34+
{
35+
switch (cause)
36+
{
37+
case COMMAND:
38+
return LightningStrikeEvent.Cause.COMMAND;
39+
case TRIDENT:
40+
return LightningStrikeEvent.Cause.TRIDENT;
41+
case TRAP:
42+
return LightningStrikeEvent.Cause.TRAP;
43+
case WEATHER:
44+
return LightningStrikeEvent.Cause.WEATHER;
45+
default:
46+
return null;
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)