Skip to content

Commit 85b6121

Browse files
committed
πŸŽ‰ Initial mod skeleton
1 parent 765d33c commit 85b6121

File tree

32 files changed

+1034
-0
lines changed

32 files changed

+1034
-0
lines changed

β€Ž.editorconfigβ€Ž

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
max_line_length = 120
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[*.{json,toml,properties,yml}]
16+
indent_size = 2

β€Ž.gitattributesβ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* text eol=lf
2+
*.bat text eol=crlf
3+
*.patch text eol=lf
4+
*.java text eol=lf
5+
*.png binary
6+
*.gif binary
7+
*.exe binary
8+
*.dll binary
9+
*.jar binary
10+
*.lzma binary
11+
*.zip binary
12+
*.pyd binary
13+
*.cfg text eol=lf
14+
*.jks binary

β€Ž.gitignoreβ€Ž

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Eclipse
2+
bin
3+
*.launch
4+
.settings
5+
.metadata
6+
.classpath
7+
.project
8+
/workspace/
9+
10+
# IntelliJ
11+
/out/
12+
*.ipr
13+
*.iws
14+
*.iml
15+
/.idea/*
16+
17+
# Gradle
18+
/build/
19+
/.gradle/
20+
21+
# Other
22+
/eclipse/
23+
*/reports/*
24+
25+
# Visual Studio Code
26+
/.settings/
27+
/.vscode/
28+
/bin/
29+
30+
# MacOS
31+
*.DS_Store

β€ŽCommon/.gitignoreβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Gradle
2+
/build/
3+
/.gradle/
4+
5+
# Datagen Cache
6+
/src/generated/resources/.cache/

β€ŽCommon/build.gradleβ€Ž

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
id "multiloader-common"
3+
id "net.neoforged.moddev"
4+
}
5+
6+
neoForge {
7+
neoFormVersion = neo_form_version
8+
// If they exist, access transformers are automatically detected now.
9+
parchment {
10+
minecraftVersion = parchment_minecraft
11+
mappingsVersion = parchment_version
12+
}
13+
}
14+
15+
dependencies {
16+
compileOnly "org.spongepowered:mixin:0.8.5"
17+
// fabric and neoforge both bundle mixinextras, so it is safe to use it in common
18+
compileOnly "io.github.llamalad7:mixinextras-common:0.3.5"
19+
annotationProcessor "io.github.llamalad7:mixinextras-common:0.3.5"
20+
21+
// Dependencies we use for this mod to run as we expect it to.
22+
implementation "net.tslat.smartbrainlib:SmartBrainLib-common-${minecraft_version}:${smart_brain_lib_common_version}"
23+
implementation "software.bernie.geckolib:geckolib-common-${minecraft_version}:${geckolib_common_version}"
24+
implementation "com.teamresourceful.resourcefulconfig:resourcefulconfig-common-${minecraft_version}:${resourceful_config_common_version}"
25+
implementation "com.github.glitchfiend:TerraBlender-common:${minecraft_version}-${terrablender_common_version}"
26+
}
27+
28+
sourceSets.main.resources {
29+
srcDir "src/generated/resources"
30+
}
31+
32+
configurations {
33+
commonJava {
34+
canBeResolved = false
35+
canBeConsumed = true
36+
}
37+
commonResources {
38+
canBeResolved = false
39+
canBeConsumed = true
40+
}
41+
}
42+
43+
artifacts {
44+
commonJava sourceSets.main.java.sourceDirectories.singleFile
45+
for (def dir : sourceSets.main.resources.sourceDirectories.files) {
46+
commonResources dir
47+
}
48+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package dev.upcraft.poppingpresents;
2+
3+
import dev.upcraft.poppingpresents.platform.IPlatform;
4+
5+
import java.util.ServiceLoader;
6+
7+
public class PPCommon {
8+
9+
public static final String MOD_ID = "popping_presents";
10+
public static final IPlatform COMMON_PLATFORM = ServiceLoader.load(IPlatform.class).findFirst().orElseThrow();
11+
12+
public static void init() {
13+
}
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package dev.upcraft.poppingpresents;
3+
4+
import org.jspecify.annotations.NullMarked;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package dev.upcraft.poppingpresents.platform;
2+
3+
import net.minecraft.sounds.SoundEvent;
4+
import net.minecraft.world.entity.Entity;
5+
import net.minecraft.world.entity.EntityType;
6+
import net.minecraft.world.entity.Mob;
7+
import net.minecraft.world.item.CreativeModeTab;
8+
import net.minecraft.world.item.Item;
9+
import net.minecraft.world.item.SpawnEggItem;
10+
import net.minecraft.world.level.block.Block;
11+
import net.minecraft.world.level.block.entity.BlockEntity;
12+
import net.minecraft.world.level.block.entity.BlockEntityType;
13+
14+
import java.util.function.Supplier;
15+
16+
public interface IPlatform {
17+
18+
String getPlatformName();
19+
boolean isModLoaded(String modId);
20+
boolean isDevelopmentEnvironment();
21+
default String getEnvironmentName() {
22+
return isDevelopmentEnvironment() ? "development" : "production";
23+
}
24+
25+
<T extends BlockEntity> Supplier<BlockEntityType<T>> registerBlockEntity(
26+
String id, Supplier<BlockEntityType<T>> blockEntityType);
27+
<T extends Block> Supplier<T> registerBlock(String id, Supplier<T> block);
28+
<T extends Entity> Supplier<EntityType<T>> registerEntity(String id, Supplier<EntityType<T>> entity);
29+
<T extends Item> Supplier<T> registerItem(String id, Supplier<T> item);
30+
<T extends SoundEvent> Supplier<T> registerSound(String id, Supplier<T> sound);
31+
<T extends CreativeModeTab> Supplier<T> registerCreativeModeTab(String id, Supplier<T> tab);
32+
<E extends Mob> Supplier<SpawnEggItem> makeSpawnEgg(
33+
Item.Properties itemProperties, Supplier<EntityType<E>> entityType);
34+
CreativeModeTab.Builder newCreativeTabBuilder();
35+
}

β€ŽCommon/src/main/resources/META-INF/accesstransformer.cfgβ€Ž

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
accessWidener v2 named

0 commit comments

Comments
Β (0)