Skip to content

Commit 2fa8169

Browse files
committed
Merge branch 'develop'
2 parents 27cf535 + e4f775f commit 2fa8169

20 files changed

Lines changed: 372 additions & 89 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fabric.loom.multiProjectOptimisation=true
2222
spasm_version = 0.2.2
2323

2424
# Mod Properties
25-
mod_version = 2.0.0-alpha.6.1
25+
mod_version = 2.0.0-alpha.6.2
2626
maven_group = net.modificationstation
2727
archives_base_name = StationAPI
2828

src/test/java/net/modificationstation/sltest/achievement/AchievementListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import net.mine_diver.unsafeevents.listener.EventListener;
44
import net.minecraft.achievement.Achievement;
5-
import net.minecraft.item.Item;
5+
import net.modificationstation.sltest.block.Blocks;
66
import net.modificationstation.sltest.item.ItemListener;
77
import net.modificationstation.stationapi.api.client.gui.screen.achievement.AchievementPage;
88
import net.modificationstation.stationapi.api.event.achievement.AchievementRegisterEvent;
@@ -20,7 +20,7 @@ public class AchievementListener {
2020
public void registerAchievements(AchievementRegisterEvent event) {
2121
testAchievementPage = new AchievementPageTest(NAMESPACE.id("testPage"));
2222
testAchievement = new TemplateAchievement(NAMESPACE.id("test_achievement"), "sltest.testAchievement", 0, 0, ItemListener.testItem, null);
23-
testAchievementChild = new TemplateAchievement(NAMESPACE.id("test_achievement_child"), "sltest.testAchievementChild", 0, 2, Item.GOLDEN_APPLE, testAchievement);
23+
testAchievementChild = new TemplateAchievement(NAMESPACE.id("test_achievement_child"), "sltest.testAchievementChild", 0, 2, Blocks.FREEZER.get(), testAchievement);
2424
event.achievements.add(testAchievement);
2525
event.achievements.add(testAchievementChild);
2626
testAchievementPage.addAchievements(testAchievement, testAchievementChild);

src/test/java/net/modificationstation/sltest/item/ModdedPickaxeItem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import net.modificationstation.stationapi.api.util.Identifier;
1313
import net.modificationstation.stationapi.api.util.math.Direction;
1414

15+
import static net.modificationstation.sltest.SLTest.NAMESPACE;
16+
1517
public class ModdedPickaxeItem extends TemplatePickaxeItem implements CustomDispenseBehavior {
1618

1719
public ModdedPickaxeItem(Identifier identifier, ToolMaterial material) {
@@ -28,7 +30,7 @@ public boolean useOnBlock(ItemStack item, PlayerEntity player, World level, int
2830
return true;
2931
} else if (facing == Direction.UP.ordinal()) {
3032
if (!level.isRemote) {
31-
LivingEntity entity = (LivingEntity) EntityRegistry.create("GPoor", level);
33+
LivingEntity entity = (LivingEntity) EntityRegistry.create(NAMESPACE.id("gpoor").toString(), level);
3234
entity.setPosition(x + 0.5, y + 1, z + 0.5);
3335
level.spawnEntity(entity);
3436
entity.animateSpawn();
@@ -41,7 +43,7 @@ public boolean useOnBlock(ItemStack item, PlayerEntity player, World level, int
4143

4244
@Override
4345
public void dispense(ItemDispenseContext context) {
44-
LivingEntity entity = (LivingEntity) EntityRegistry.create("GPoor", context.dispenser.world);
46+
LivingEntity entity = (LivingEntity) EntityRegistry.create(NAMESPACE.id("gpoor").toString(), context.dispenser.world);
4547
context.shootEntity(entity);
4648
}
4749
}

src/test/java/net/modificationstation/sltest/render/entity/EntityRendererListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public class EntityRendererListener {
1010

1111
@EventListener
1212
public void registerEntityRenderers(EntityRendererRegisterEvent event) {
13-
event.renderers.put(PoorGuy.class, new UndeadEntityRenderer(new BipedEntityModel(), 0.5f));
13+
event.register(PoorGuy.class, new UndeadEntityRenderer(new BipedEntityModel(), 0.5f));
1414
}
1515
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import net.modificationstation.stationapi.gradle.SubprojectHelpers.getSubprojectVersion
21
import net.modificationstation.stationapi.gradle.SubprojectHelpers.addModuleDependencies
2+
import net.modificationstation.stationapi.gradle.SubprojectHelpers.getSubprojectVersion
33

44
base.archivesName.set("station-achievements-v0")
55
version = getSubprojectVersion(project, "1.0.0")
66

77
addModuleDependencies(project,
88
"station-api-base",
99
"station-resource-loader-v0",
10-
"station-localization-api-v0"
10+
"station-localization-api-v0",
11+
"station-items-v0"
1112
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package net.modificationstation.stationapi.impl.achievement;
2+
3+
import net.mine_diver.unsafeevents.listener.EventListener;
4+
import net.minecraft.achievement.Achievements;
5+
import net.modificationstation.stationapi.api.StationAPI;
6+
import net.modificationstation.stationapi.api.event.achievement.AchievementRegisterEvent;
7+
import net.modificationstation.stationapi.api.event.registry.AfterBlockAndItemRegisterEvent;
8+
import net.modificationstation.stationapi.api.mod.entrypoint.Entrypoint;
9+
import net.modificationstation.stationapi.api.mod.entrypoint.EntrypointManager;
10+
import net.modificationstation.stationapi.api.mod.entrypoint.EventBusPolicy;
11+
12+
import java.lang.invoke.MethodHandles;
13+
14+
@Entrypoint(eventBus = @EventBusPolicy(registerInstance = false))
15+
public final class AchievementRegisterEventImpl {
16+
static {
17+
EntrypointManager.registerLookup(MethodHandles.lookup());
18+
}
19+
20+
@EventListener
21+
private static void dispatchAchievementRegisterEvent(AfterBlockAndItemRegisterEvent event) {
22+
//noinspection unchecked
23+
StationAPI.EVENT_BUS.post(AchievementRegisterEvent.builder().achievements(Achievements.ACHIEVEMENTS).build());
24+
}
25+
}

station-achievements-v0/src/main/java/net/modificationstation/stationapi/mixin/achievement/AchievementsMixin.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

station-achievements-v0/src/main/resources/fabric.mod.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"entrypoints": {
2222
"stationapi:event_bus_client": [
2323
"net.modificationstation.stationapi.impl.client.gui.screen.achievement.AchievementPageImpl"
24+
],
25+
"stationapi:event_bus": [
26+
"net.modificationstation.stationapi.impl.achievement.AchievementRegisterEventImpl"
2427
]
2528
},
2629
"mixins": [

station-achievements-v0/src/main/resources/station-achievements-v0.mixins.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"minVersion": "0.8",
44
"package": "net.modificationstation.stationapi.mixin.achievement",
55
"compatibilityLevel": "JAVA_17",
6-
"mixins": [
7-
"AchievementsMixin"
8-
],
96
"client": [
107
"client.AchievementsScreenMixin"
118
],

station-blocks-v0/src/main/java/net/modificationstation/stationapi/api/registry/tag/BlockTags.java

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,101 @@
1010
@NoArgsConstructor(access = AccessLevel.PRIVATE)
1111
public final class BlockTags {
1212
public static final TagKey<Block>
13-
LOGS = of("logs"),
14-
LEAVES = of("leaves"),
15-
PLANKS = of("planks"),
16-
INFINIBURN = of("infiniburn");
13+
BOOKSHELVES = of("c:bookshelves"),
14+
BRICK_BLOCKS = of("c:brick_blocks"),
15+
NORMAL_BRICK_BLOCKS = of("c:brick_blocks/normal"),
16+
BUTTONS = of("c:buttons"),
17+
STONE_BUTTONS = of("c:buttons/stone"),
18+
CACTI = of("c:cacti"),
19+
CHESTS = of("c:chests"),
20+
WOODEN_CHESTS = of("c:chests/wooden"),
21+
CLAY_BLOCKS = of("c:clay_blocks"),
22+
COBBLESTONES = of("c:cobblestones"),
23+
MOSSY_COBBLESTONES = of("c:cobblestones/mossy"),
24+
NORMAL_COBBLESTONES = of("c:cobblestones/normal"),
25+
DIRTS = of("c:dirts"),
26+
DOORS = of("c:doors"),
27+
IRON_DOORS = of("c:doors/iron"),
28+
WOODEN_DOORS = of("c:doors/wooden"),
29+
OAK_DOORS = of("c:doors/wooden/oak"),
30+
FENCE_GATES = of("c:fence_gates"),
31+
WOODEN_FENCE_GATES = of("c:fence_gates/wooden"),
32+
FENCES = of("c:fences"),
33+
WOODEN_FENCES = of("c:fences/wooden"),
34+
OAK_FENCES = of("c:fences/wooden/oak"),
35+
FLOWERS = of("c:flowers"),
36+
NORMAL_FLOWERS = of("c:flowers/normal"),
37+
TALL_FLOWERS = of("c:flowers/tall"),
38+
GLASS_BLOCKS = of("c:glass_blocks"),
39+
COLORLESS_GLASS_BLOCKS = of("c:glass_blocks/colorless"),
40+
GRASS_BLOCKS = of("c:grass_blocks"),
41+
GRAVELS = of("c:gravels"),
42+
LADDERS = of("c:ladders"),
43+
WOODEN_LADDERS = of("c:ladders/wooden"),
44+
OAK_LADDERS = of("c:ladders/wooden/oak"),
45+
LEAVES = of("c:leaves"),
46+
LOGS = of("c:logs"),
47+
MUSHROOMS = of("c:mushrooms"),
48+
BROWN_MUSHROOMS = of("c:mushrooms/brown"),
49+
RED_MUSHROOMS = of("c:mushrooms/red"),
50+
NETHERRACKS = of("c:netherracks"),
51+
OBSIDIANS = of("c:obsidians"),
52+
NORMAL_OBSIDIANS = of("c:obsidians/normal"),
53+
ORE_BEARING_GROUND_NETHERRACK = of("c:ore_bearing_ground/netherrack"),
54+
ORE_BEARING_GROUND_STONE = of("c:ore_bearing_ground/stone"),
55+
ORES = of("c:ores"),
56+
COAL_ORES = of("c:ores/coal"),
57+
DIAMOND_ORES = of("c:ores/diamond"),
58+
GOLD_ORES = of("c:ores/gold"),
59+
IRON_ORES = of("c:ores/iron"),
60+
LAPIS_ORES = of("c:ores/lapis"),
61+
REDSTONE_ORES = of("c:ores/redstone"),
62+
PLANKS = of("c:planks"),
63+
OAK_PLANKS = of("c:planks/oak"),
64+
PRESSURE_PLATES = of("c:pressure_plates"),
65+
STONE_PRESSURE_PLATES = of("c:pressure_plates/stone"),
66+
WOODEN_PRESSURE_PLATES = of("c:pressure_plates/wooden"),
67+
OAK_PRESSURE_PLATES = of("c:pressure_plates/wooden/oak"),
68+
PUMPKINS = of("c:pumpkins"),
69+
JACK_O_LANTERNS = of("c:pumpkins/jack_o_lanterns"),
70+
NORMAL_PUMPKINS = of("c:pumpkins/normal"),
71+
RAILS = of("c:rails"),
72+
SANDS = of("c:sands"),
73+
NORMAL_SANDS = of("c:sands/normal"),
74+
SANDSTONE_BLOCKS = of("c:sandstone/blocks"),
75+
NORMAL_SANDSTONE_BLOCKS = of("c:sandstone/normal_blocks"),
76+
SAPLINGS = of("c:saplings"),
77+
SIGNS = of("c:signs"),
78+
WOODEN_SIGNS = of("c:signs/wooden"),
79+
OAK_SIGNS = of("c:signs/wooden/oak"),
80+
OAK_STANDING_SIGNS = of("c:signs/wooden/oak/standing"),
81+
OAK_WALL_SIGNS = of("c:signs/wooden/oak/wall"),
82+
SNOW = of("c:snow"),
83+
STAIRS = of("c:stairs"),
84+
COBBLESTONE_STAIRS = of("c:stairs/cobblestone"),
85+
WOODEN_STAIRS = of("c:stairs/wooden"),
86+
OAK_STAIRS = of("c:stairs/wooden/oak"),
87+
STONES = of("c:stones"),
88+
STORAGE_BLOCKS = of("c:storage_blocks"),
89+
DIAMOND_STORAGE_BLOCKS = of("c:storage_blocks/diamond"),
90+
GOLD_STORAGE_BLOCKS = of("c:storage_blocks/gold"),
91+
IRON_STORAGE_BLOCKS = of("c:storage_blocks/iron"),
92+
LAPIS_STORAGE_BLOCKS = of("c:storage_blocks/lapis"),
93+
TRAPDOORS = of("c:trapdoors"),
94+
WOODEN_TRAPDOORS = of("c:trapdoors/wooden"),
95+
OAK_TRAPDOORS = of("c:trapdoors/wooden/oak"),
96+
WOOLS = of("c:wools"),
97+
98+
INFINIBURN = of("infiniburn"),
99+
MINEABLE_AXE = of("mineable/axe"),
100+
MINEABLE_HOE = of("mineable/hoe"),
101+
MINEABLE_PICKAXE = of("mineable/pickaxe"),
102+
MINEABLE_SHEARS = of("mineable/shears"),
103+
MINEABLE_SHOVEL = of("mineable/shovel"),
104+
MINEABLE_SWORD = of("mineable/sword"),
105+
NEEDS_DIAMOND_TOOL = of("needs_diamond_tool"),
106+
NEEDS_IRON_TOOL = of("needs_iron_tool"),
107+
NEEDS_STONE_TOOL = of("needs_stone_tool");
17108

18109
private static TagKey<Block> of(String id) {
19110
return TagKey.of(BlockRegistry.KEY, Identifier.of(id));

0 commit comments

Comments
 (0)