Skip to content

Commit 9a81ff5

Browse files
committed
fixes
1 parent b7ac9a4 commit 9a81ff5

File tree

108 files changed

+1097
-2443
lines changed

Some content is hidden

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

108 files changed

+1097
-2443
lines changed

build.gradle

+16-14
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,37 @@ plugins {
33
id 'maven-publish'
44
}
55

6+
sourceCompatibility = JavaVersion.VERSION_17
7+
targetCompatibility = JavaVersion.VERSION_17
8+
9+
archivesBaseName = project.archives_base_name
610
version = project.mod_version
711
group = project.maven_group
812

913
repositories {
10-
mavenCentral()
11-
maven { url "https://api.modrinth.com/maven" }
14+
// Add repositories to retrieve artifacts from in here.
15+
// You should only use this when depending on other mods because
16+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
18+
// for more information about repositories.
1219
}
1320

1421
dependencies {
1522
// base
1623
minecraft "com.mojang:minecraft:${project.minecraft_version}"
1724
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
1825
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
26+
1927
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
2028

21-
// apis
2229
implementation 'org.reflections:reflections:0.10.2'
2330
include modApi('teamreborn:energy:2.2.0') {
2431
exclude(group: "net.fabricmc.fabric-api")
2532
}
26-
modApi('maven.modrinth:mealapi:0.3.1+1.19')
2733
}
2834

2935
processResources {
3036
inputs.property "version", project.version
31-
filteringCharset "UTF-8"
3237

3338
filesMatching("fabric.mod.json") {
3439
expand "version": project.version
@@ -41,26 +46,23 @@ tasks.withType(JavaCompile).configureEach {
4146
}
4247

4348
java {
49+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
50+
// if it is present.
51+
// If you remove this line, sources will not be generated.
4452
withSourcesJar()
4553
}
4654

4755
jar {
4856
from("LICENSE") {
49-
rename { "${it}_${project.archivesBaseName}" }
57+
rename { "${it}_${project.archivesBaseName}"}
5058
}
5159
}
5260

5361
// configure the maven publication
5462
publishing {
5563
publications {
5664
mavenJava(MavenPublication) {
57-
// add all the jars that should be included when publishing to maven
58-
artifact(remapJar) {
59-
builtBy remapJar
60-
}
61-
artifact(sourcesJar) {
62-
builtBy remapSourcesJar
63-
}
65+
from components.java
6466
}
6567
}
6668

@@ -71,4 +73,4 @@ publishing {
7173
// The repositories here will be used for publishing your artifact, not for
7274
// retrieving dependencies.
7375
}
74-
}
76+
}

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ maven_group=tcfplayz
55
archives_base_name=chemicals
66

77
minecraft_version=1.19
8+
yarn_mappings=1.19+build.1
89
loader_version=0.14.6
9-
fabric_version=0.55.1+1.19
10-
yarn_mappings=1.19+build.1
10+
fabric_version=0.57.0+1.19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
package tcfplayz.chemicals;
2+
3+
import net.fabricmc.api.ModInitializer;
4+
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
5+
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
6+
7+
import net.minecraft.item.*;
8+
import net.minecraft.util.Identifier;
9+
import net.minecraft.util.registry.Registry;
10+
11+
import org.reflections.Reflections;
12+
13+
import tcfplayz.chemicals.blocks.*;
14+
import tcfplayz.chemicals.elements.*;
15+
import tcfplayz.chemicals.items.salt.Salt;
16+
import tcfplayz.misc.utils.blocks.Blocks;
17+
import tcfplayz.misc.utils.items.*;
18+
19+
import java.lang.reflect.InvocationTargetException;
20+
import java.util.Set;
21+
22+
public class ChemicalsInit implements ModInitializer {
23+
24+
public static final String modid = "chemicals";
25+
26+
public static final ItemGroup chemical = FabricItemGroupBuilder.build(
27+
new Identifier(modid, "chemicals"),
28+
() -> new ItemStack(new Hydrogen()));
29+
public static final ItemGroup chemistryitems = FabricItemGroupBuilder.build(
30+
new Identifier(modid, "chemistryitems"),
31+
() -> new ItemStack(new AtomCollider()));
32+
public static final ItemGroup others = FabricItemGroupBuilder.build(
33+
new Identifier(modid, "otheritems"),
34+
() -> new ItemStack(new Salt()));
35+
36+
@Override
37+
public void onInitialize() {
38+
Reflections reflections = new Reflections("tcfplayz.chemicals");
39+
Set<Class<? extends Elements>> classelement = reflections.getSubTypesOf(Elements.class);
40+
for (Class<? extends Elements> clazz : classelement) {
41+
try {
42+
Registry.register(Registry.ITEM, new Identifier(modid, clazz.getDeclaredConstructor().newInstance().getID()), clazz.getDeclaredConstructor().newInstance());
43+
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
44+
e.printStackTrace();
45+
}
46+
}
47+
Set<Class<? extends Blocks>> classblock = reflections.getSubTypesOf(Blocks.class);
48+
for (Class<? extends Blocks> clazz : classblock) {
49+
try {
50+
Blocks blocks = clazz.getDeclaredConstructor().newInstance();
51+
Identifier id = new Identifier(modid, blocks.getID());
52+
Registry.register(Registry.BLOCK, id, blocks);
53+
Registry.register(Registry.ITEM, id, new BlockItem(blocks, new FabricItemSettings().group(ChemicalsInit.chemistryitems)));
54+
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
55+
e.printStackTrace();
56+
}
57+
}
58+
/* Set<Class<? extends BossCreator>> classblock2 = reflections.getSubTypesOf(BossCreator.class);
59+
for (Class<? extends BossCreator> clazz : classblock2) {
60+
try {
61+
Constructor<? extends BossCreator> entity = clazz.getDeclaredConstructor();
62+
BossCreator e = clazz.getDeclaredConstructor().newInstance();
63+
final EntityType<BossCreator> CUBE = Registry.register(
64+
Registry.ENTITY_TYPE,
65+
new Identifier("entitytesting", "cube"),
66+
FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, e).dimensions(EntityDimensions.fixed(0.75f, 0.75f)).build()
67+
);
68+
Identifier id = new Identifier(modid, blocks.getID());
69+
70+
System.out.println("registered " + blocks.getID());
71+
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
72+
e.printStackTrace();
73+
}
74+
} */
75+
Set<Class<? extends Solutions>> solution = reflections.getSubTypesOf(Solutions.class);
76+
for (Class<? extends Solutions> clazz : solution) {
77+
try {
78+
Registry.register(Registry.ITEM, new Identifier(modid, clazz.getDeclaredConstructor().newInstance().getID()), clazz.getDeclaredConstructor().newInstance());
79+
System.out.println("registered " + clazz.getDeclaredConstructor().newInstance().getID());
80+
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
81+
e.printStackTrace();
82+
}
83+
}
84+
Set<Class<? extends OtherItems>> items = reflections.getSubTypesOf(OtherItems.class);
85+
for (Class<? extends OtherItems> clazz : items) {
86+
try {
87+
Registry.register(Registry.ITEM, new Identifier(modid, clazz.getDeclaredConstructor().newInstance().getID()), clazz.getDeclaredConstructor().newInstance());
88+
System.out.println("registered " + clazz.getDeclaredConstructor().newInstance().getID());
89+
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
90+
e.printStackTrace();
91+
}
92+
}
93+
}
94+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package tcfplayz.chemicals.blocks;
2+
3+
import net.minecraft.block.BlockState;
4+
import net.minecraft.block.ShapeContext;
5+
import net.minecraft.util.function.BooleanBiFunction;
6+
import net.minecraft.util.math.BlockPos;
7+
import net.minecraft.util.shape.VoxelShape;
8+
import net.minecraft.util.shape.VoxelShapes;
9+
import net.minecraft.world.BlockView;
10+
import tcfplayz.misc.utils.blocks.Blocks;
11+
12+
import java.util.stream.Stream;
13+
14+
public class AtomCollider extends Blocks {
15+
16+
17+
public String getID() {
18+
return "atom_collider";
19+
}
20+
21+
@Override
22+
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
23+
int f = 16;
24+
return Stream.of(VoxelShapes.combine(VoxelShapes.combine(VoxelShapes.cuboid(0, 0, 0, 4/f, 5/f, 4/f),
25+
VoxelShapes.combine(VoxelShapes.cuboid(12, 0, 0, 16, 5, 4),
26+
VoxelShapes.combine(VoxelShapes.cuboid(0, 0, 12, 4, 5, 16),
27+
VoxelShapes.cuboid(12, 0, 12, 16, 5, 16), BooleanBiFunction.OR), BooleanBiFunction.OR), BooleanBiFunction.OR),
28+
VoxelShapes.cuboid(0, 5, 0, 16, 16, 16), BooleanBiFunction.OR)).reduce((v1, v2) -> VoxelShapes.combine(v1, v2, BooleanBiFunction.OR)).get();
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package tcfplayz.chemicals.blocks;
2+
3+
4+
import net.minecraft.block.Block;
5+
6+
public class AtomSeparator extends Block {
7+
8+
public AtomSeparator(Settings settings) {
9+
super(settings);
10+
}
11+
12+
public String getID() {
13+
return "atom_separator";
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package tcfplayz.chemicals.blocks;
2+
3+
4+
import net.minecraft.block.BlockState;
5+
import net.minecraft.block.ShapeContext;
6+
import net.minecraft.util.function.BooleanBiFunction;
7+
import net.minecraft.util.math.BlockPos;
8+
import net.minecraft.util.shape.VoxelShape;
9+
import net.minecraft.util.shape.VoxelShapes;
10+
import net.minecraft.world.BlockView;
11+
12+
import tcfplayz.misc.utils.blocks.Blocks;
13+
14+
import java.util.stream.Stream;
15+
16+
public class BunsenBurner extends Blocks {
17+
18+
public String getID() {
19+
return "bunsen_burner";
20+
}
21+
22+
@Override
23+
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
24+
float f = 16.0F;
25+
return Stream.of(VoxelShapes.combine(VoxelShapes.cuboid(3/f, 3/f, 3/f, 13/f, 4/f, 13/f),
26+
VoxelShapes.combine(VoxelShapes.cuboid(2/f, 1/f, 2/f, 14/f, 3/f, 14/f),
27+
VoxelShapes.combine(VoxelShapes.cuboid(1/f, 1/f, 1/f, 15/f, 2/f, 15/f),
28+
VoxelShapes.cuboid(0/f, 0/f, 0/f, 16/f, 1/f, 16/f), BooleanBiFunction.OR), BooleanBiFunction.OR), BooleanBiFunction.OR),
29+
VoxelShapes.cuboid(0/f, 8/f, 7/f, 6/f, 10/f, 9/f),
30+
VoxelShapes.cuboid(6/f, 1/f, 6/f, 10/f, 16/f, 10/f)).reduce((v1, v2) -> VoxelShapes.combine(v1, v2, BooleanBiFunction.OR)).get();
31+
}
32+
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package tcfplayz.chemicals.blocks;
2+
3+
import net.minecraft.block.Block;
4+
import net.minecraft.block.Material;
5+
6+
public class MaterialReadder extends Block {
7+
8+
public MaterialReadder() {
9+
super((Block.Settings.of(Material.METAL).requiresTool().hardness(4f)));
10+
}
11+
12+
public String getID() {
13+
return "material_readder";
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package tcfplayz.chemicals.blocks;
2+
3+
import net.minecraft.block.Block;
4+
import net.minecraft.block.Material;
5+
6+
public class MaterialReducer extends Block {
7+
8+
public MaterialReducer(Settings settings) {
9+
super((Block.Settings.of(Material.METAL).requiresTool().hardness(4f)));
10+
}
11+
12+
public String getID() {
13+
return "material_reducer";
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package tcfplayz.chemicals.blocks;
2+
3+
public class PlasmaQuarry {
4+
// stop
5+
// https://discord.com/channels/802077281165639691/914150012454318161/927164709508091924
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.basic;
2+
3+
public class Drill {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.basic;
2+
3+
public class LabBrewer {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package tcfplayz.chemicals.blocks.basic;
2+
3+
public class LaboratoryCrafter {
4+
// create lab in your miniworld
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.basic;
2+
3+
public class QuarryDrill {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class ColdChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class CopperChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class DebugChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class DiamondChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class IronChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class SuperiorChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class UraniumChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package tcfplayz.chemicals.blocks.chest;
2+
3+
public class UraniumColdChest {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package tcfplayz.chemicals.blocks.crafts;
2+
3+
import net.minecraft.block.BlockState;
4+
import net.minecraft.entity.player.PlayerEntity;
5+
import net.minecraft.util.ActionResult;
6+
import net.minecraft.util.Hand;
7+
import net.minecraft.util.hit.BlockHitResult;
8+
import net.minecraft.util.math.BlockPos;
9+
import net.minecraft.world.World;
10+
import tcfplayz.misc.utils.blocks.Blocks;
11+
12+
13+
public class TableChest extends Blocks {
14+
15+
@Override
16+
public String getID() {
17+
return "chem_table_chest";
18+
}
19+
20+
@Override
21+
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
22+
if (!world.isClient) {
23+
// player.getInventory().getMainHandStack()
24+
}
25+
26+
return ActionResult.SUCCESS;
27+
}
28+
29+
}

0 commit comments

Comments
 (0)