Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
complete build2
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Sep 24, 2022
1 parent 9475b03 commit bb06864
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 69 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ This is a small Minecraft mod for [Cabricality](https://github.com/DM-Earth/Cabr

- Make Trade Cards and Profession Cards easier to translate.
- Replace Ad Astra and Bits and Chisels' wrench with the Create one.
- Tweak bounding boxes of Flags from Ad Astra to match the custom models in Cabricality.
- Catch the registrations with namespace of `cabricality` and add them to vanilla datafixers.
- Catch the registrations with namespace of `cabricality` and add them to vanilla DataFixers.
- Move items form KubeJS to a new item group instead of that KubeJS one.

When certain necessary mods are not loaded:
Expand All @@ -31,7 +30,6 @@ When certain necessary mods are not loaded:

### With Changes

- `com.github.alexnijjar.ad_astra.blocks.flags.FlagBlock`
- `com.simibubi.create.content.contraptions.wrench.WrenchItem`
- `dev.latvian.mods.kubejs.KubeJS`
- `net.minecraft.util.registry.Registry`
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2G
# check these on https://fabricmc.net/develop
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.3
loader_version=0.14.6
loader_version=0.14.8

# Mod Properties
mod_version = 0.1-alpha1-build2
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/dm/earth/cabricality/ModChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import java.util.Map;

public class ModChecker {
private static List<String> missingModList = new ArrayList<>();
private static Map<String, String> requiredModList = new HashMap<>();
private static final List<String> missingModList = new ArrayList<>();
private static final Map<String, String> requiredModList = new HashMap<>();

public static void check(){
if (isFullLoaded()) {
Expand Down
43 changes: 0 additions & 43 deletions src/main/java/com/dm/earth/cabricality/mixin/FlagBlockMixin.java

This file was deleted.

34 changes: 17 additions & 17 deletions src/main/java/com/dm/earth/cabricality/mixin/WrenchItemMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,34 @@ private void injected(ItemUsageContext context, CallbackInfoReturnable<ActionRes

void invert(Axis axis, BitsBlockEntity e) {
BlockState[][][] rotated = new BlockState[16][16][16];
switch(axis) {
case X:
switch (axis) {
case X -> {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = 0; k < 16; k++) {
rotated[i][j][k] = e.getState(i, j, -k+15);
rotated[i][j][k] = e.getState(i, j, -k + 15);
}
}
}
break;
case Y:
}
case Y -> {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = 0; k < 16; k++) {
rotated[i][j][k] = e.getState( i, -j+15,k);
rotated[i][j][k] = e.getState(i, -j + 15, k);
}
}
}
break;
case Z:
}
case Z -> {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = 0; k < 16; k++) {
rotated[i][j][k] = e.getState(-i+15, j, k);
rotated[i][j][k] = e.getState(-i + 15, j, k);
}
}
}
break;
}
}
e.setStates(rotated);
e.rebuildServer();
Expand All @@ -82,34 +82,34 @@ void invert(Axis axis, BitsBlockEntity e) {
//Rotation Algorithm from https://stackoverflow.com/questions/53110374/how-to-rotate-2-d-array-in-java, extended to 3D
void rotate(Axis axis, BitsBlockEntity e) {
BlockState[][][] rotated = new BlockState[16][16][16];
switch(axis) {
case X:
switch (axis) {
case X -> {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = 0; k < 16; k++) {
rotated[i][j][k] = e.getState(i, 16 - k - 1, j);
}
}
}
break;
case Y:
}
case Y -> {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = 0; k < 16; k++) {
rotated[i][j][k] = e.getState(16 - k - 1, j, i);
}
}
}
break;
case Z:
}
case Z -> {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = 0; k < 16; k++) {
rotated[i][j][k] = e.getState(16 - j - 1, i, k);
}
}
}
break;
}
}
e.setStates(rotated);
e.rebuildServer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.Map;

public class DataFixerUtils {
private static Map<String, String> dataFixerMapCommon = new HashMap<>();
private static final Map<String, String> dataFixerMapCommon = new HashMap<>();

public static void addFixer(Identifier oldId, Identifier newId) {
dataFixerMapCommon.put(oldId.toString(), newId.toString());
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/cabricality.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"package": "com.dm.earth.cabricality.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"FlagBlockMixin",
"KubeJSMixin",
"RegistryMixin",
"SchemasMixin",
Expand Down

0 comments on commit bb06864

Please sign in to comment.