diff --git a/gradle.properties b/gradle.properties index cbe82fe..1a81c1e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.21.1+build.3 loader_version=0.16.10 # Mod Properties -mod_version=0.0.1.alpha.3 +mod_version=0.0.1.alpha.4 maven_group=arzumify.coretechs archives_base_name=coretechs diff --git a/src/main/java/arzumify/coretechs/energy/CopperWire.java b/src/main/java/arzumify/coretechs/energy/CopperWire.java index caf3531..27e49df 100644 --- a/src/main/java/arzumify/coretechs/energy/CopperWire.java +++ b/src/main/java/arzumify/coretechs/energy/CopperWire.java @@ -45,7 +45,7 @@ public class CopperWire extends BlockWithEntity implements PolymerTexturedBlock @Override protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { System.out.println("onStateReplaced"); - if (!world.isClient() && state.isOf(newState.getBlock())) { + if (!world.isClient() && !state.isOf(newState.getBlock())) { System.out.println("world is not client"); var entity = world.getBlockEntity(pos); System.out.println("entity: " + entity); diff --git a/src/main/java/arzumify/coretechs/energy/CopperWireEntity.java b/src/main/java/arzumify/coretechs/energy/CopperWireEntity.java index deb3096..57537f4 100644 --- a/src/main/java/arzumify/coretechs/energy/CopperWireEntity.java +++ b/src/main/java/arzumify/coretechs/energy/CopperWireEntity.java @@ -1,9 +1,9 @@ package arzumify.coretechs.energy; import arzumify.coretechs.BlockEntityTypes; +import arzumify.located.math.Vec3i; import arzumify.polyenergy.api.EnergyProvider; import arzumify.polyenergy.api.EnergyReceiver; -import arzumify.located.math.Vec3i; import arzumify.polyenergy.impl.MatchMaker; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerBlockEntityEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; @@ -87,8 +87,7 @@ public class CopperWireEntity extends BlockEntity implements EnergyProvider, Ene reload(); } - - + @Override public void onUnload(BlockEntity blockEntity, ServerWorld serverWorld) { MatchMaker.matchMaker.Remove(this); diff --git a/src/main/java/arzumify/coretechs/energy/CreativeGenerator.java b/src/main/java/arzumify/coretechs/energy/CreativeGenerator.java index 14817ae..ddbe796 100644 --- a/src/main/java/arzumify/coretechs/energy/CreativeGenerator.java +++ b/src/main/java/arzumify/coretechs/energy/CreativeGenerator.java @@ -39,7 +39,7 @@ public class CreativeGenerator extends BlockWithEntity implements BlockEntityPro @Override protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { System.out.println("onStateReplaced"); - if (!world.isClient() && state.isOf(newState.getBlock())) { + if (!world.isClient() && !state.isOf(newState.getBlock())) { System.out.println("world is not client"); var entity = world.getBlockEntity(pos); System.out.println("entity: " + entity); diff --git a/src/main/java/arzumify/coretechs/energy/Magnet.java b/src/main/java/arzumify/coretechs/energy/Magnet.java index fafd5dc..77de191 100644 --- a/src/main/java/arzumify/coretechs/energy/Magnet.java +++ b/src/main/java/arzumify/coretechs/energy/Magnet.java @@ -18,7 +18,6 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraft.world.WorldAccess; import org.jetbrains.annotations.Nullable; public class Magnet extends BlockWithEntity implements BlockEntityProvider, PolymerTexturedBlock { @@ -42,7 +41,7 @@ public class Magnet extends BlockWithEntity implements BlockEntityProvider, Poly @Override protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { System.out.println("onStateReplaced"); - if (!world.isClient() && state.isOf(newState.getBlock())) { + if (!world.isClient() && !state.isOf(newState.getBlock())) { System.out.println("world is not client"); var entity = world.getBlockEntity(pos); System.out.println("entity: " + entity); @@ -53,11 +52,6 @@ public class Magnet extends BlockWithEntity implements BlockEntityProvider, Poly super.onStateReplaced(state, world, pos, newState, moved); } - @Override - public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { - super.onBroken(world, pos, state); - } - @Override protected MapCodec getCodec() { return createCodec(Magnet::new); diff --git a/src/main/java/arzumify/coretechs/energy/Summoner.java b/src/main/java/arzumify/coretechs/energy/Summoner.java index 2289f9b..70eb7c9 100644 --- a/src/main/java/arzumify/coretechs/energy/Summoner.java +++ b/src/main/java/arzumify/coretechs/energy/Summoner.java @@ -18,7 +18,6 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraft.world.WorldAccess; import org.jetbrains.annotations.Nullable; public class Summoner extends BlockWithEntity implements BlockEntityProvider, PolymerTexturedBlock { @@ -42,7 +41,7 @@ public class Summoner extends BlockWithEntity implements BlockEntityProvider, Po @Override protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { System.out.println("onStateReplaced"); - if (!world.isClient() && state.isOf(newState.getBlock())) { + if (!world.isClient() && !state.isOf(newState.getBlock())) { System.out.println("world is not client"); var entity = world.getBlockEntity(pos); System.out.println("entity: " + entity); @@ -53,11 +52,6 @@ public class Summoner extends BlockWithEntity implements BlockEntityProvider, Po super.onStateReplaced(state, world, pos, newState, moved); } - @Override - public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { - super.onBroken(world, pos, state); - } - @Override protected MapCodec getCodec() { return createCodec(Summoner::new); diff --git a/src/main/java/arzumify/coretechs/energy/Voltmeter.java b/src/main/java/arzumify/coretechs/energy/Voltmeter.java index 5475a99..448acf5 100644 --- a/src/main/java/arzumify/coretechs/energy/Voltmeter.java +++ b/src/main/java/arzumify/coretechs/energy/Voltmeter.java @@ -41,7 +41,7 @@ public class Voltmeter extends BlockWithEntity implements BlockEntityProvider, P @Override protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { System.out.println("onStateReplaced"); - if (!world.isClient() && state.isOf(newState.getBlock())) { + if (!world.isClient() && !state.isOf(newState.getBlock())) { System.out.println("world is not client"); var entity = world.getBlockEntity(pos); System.out.println("entity: " + entity); diff --git a/src/main/resources/assets/coretechs/icon-original.png b/src/main/resources/assets/coretechs/icon-original.png new file mode 100755 index 0000000..bac4c10 Binary files /dev/null and b/src/main/resources/assets/coretechs/icon-original.png differ diff --git a/src/main/resources/assets/coretechs/icon.png b/src/main/resources/assets/coretechs/icon.png index 9ce9441..c3852af 100644 Binary files a/src/main/resources/assets/coretechs/icon.png and b/src/main/resources/assets/coretechs/icon.png differ diff --git a/src/main/resources/assets/coretechs/models/block/magnet.json b/src/main/resources/assets/coretechs/models/block/magnet.json index 3edda07..07933f9 100644 --- a/src/main/resources/assets/coretechs/models/block/magnet.json +++ b/src/main/resources/assets/coretechs/models/block/magnet.json @@ -1,7 +1,6 @@ { "credit": "Made with Blockbench", "parent": "block/block", - "texture_size": [23, 23], "textures": { "0": "coretechs:item/magnet", "particle": "coretechs:item/magnet" @@ -11,24 +10,120 @@ "from": [2, 0, 2], "to": [14, 1, 14], "faces": { - "north": {"uv": [6.26087, 0, 14.6087, 0.69565], "texture": "#0"}, - "east": {"uv": [6.26087, 0, 14.6087, 0.69565], "texture": "#0"}, - "south": {"uv": [6.26087, 0, 14.6087, 0.69565], "texture": "#0"}, - "west": {"uv": [6.26087, 0.69565, 14.6087, 0], "texture": "#0"}, - "up": {"uv": [6.26087, 0, 14.6087, 8.34783], "texture": "#0"}, - "down": {"uv": [6.26087, 0, 14.6087, 8.34783], "texture": "#0"} + "north": { + "uv": [ + 4.5, + 5.5, + 10.5, + 6 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4.5, + 5.5, + 10.5, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.5, + 5.5, + 10.5, + 6 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 5.5, + 10.5, + 6 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4.5, + 0, + 10.5, + 6 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4.5, + 0, + 10.5, + 6 + ], + "texture": "#0" + } } }, { "from": [3, 2, 3], "to": [13, 16, 13], "faces": { - "north": {"uv": [0, 0, 6.95652, 9.73913], "texture": "#0"}, - "east": {"uv": [0, 0, 6.95652, 9.73913], "texture": "#0"}, - "south": {"uv": [0, 0, 6.95652, 9.73913], "texture": "#0"}, - "west": {"uv": [0, 0, 6.95652, 9.73913], "texture": "#0"}, - "up": {"uv": [6.95652, 16, 0, 9.04348], "texture": "#0"}, - "down": {"uv": [6.95652, 9.04348, 0, 16], "texture": "#0"} + "north": { + "uv": [ + 0, + 0, + 5, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 5, + 7 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5, + 0, + 0, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 5, + 7 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 6.5, + 5, + 11.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 6.5, + 5, + 11.5 + ], + "texture": "#0" + } } }, { @@ -40,47 +135,116 @@ "east": {"uv": [0.69565, 0.69565, 3.47826, 1.3913], "texture": "#0"}, "south": {"uv": [0.69565, 0.69565, 3.47826, 1.3913], "texture": "#0"}, "west": {"uv": [0.69565, 0.69565, 3.47826, 1.3913], "texture": "#0"}, - "up": {"uv": [0, 0, 2.78261, 2.78261], "texture": "#missing"}, - "down": {"uv": [0, 0, 2.78261, 2.78261], "texture": "#missing"} + "up": { + "uv": [ + 8, + 1.5, + 10, + 3.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 1.5, + 10, + 3.5 + ], + "texture": "#0" + } } } ], - "gui_light": "side", "display": { - "gui": { - "rotation": [ 30, 225, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.625, 0.625, 0.625 ] - }, - "ground": { - "rotation": [ 0, 0, 0 ], - "translation": [ 0, 3, 0], - "scale":[ 0.25, 0.25, 0.25 ] - }, - "fixed": { - "rotation": [ 0, 0, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.5, 0.5, 0.5 ] - }, "thirdperson_righthand": { - "rotation": [ 75, 45, 0 ], - "translation": [ 0, 2.5, 0], - "scale": [ 0.375, 0.375, 0.375 ] + "rotation": [ + 75, + 45, + 0 + ], + "translation": [ + 0, + 2.5, + 0 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] }, "thirdperson_lefthand": { - "rotation": [ 75, 45, 0 ], - "translation": [ 0, 2.5, 0], - "scale": [ 0.375, 0.375, 0.375 ] + "rotation": [ + 75, + 45, + 0 + ], + "translation": [ + 0, + 2.5, + 0 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] }, "firstperson_righthand": { - "rotation": [ 0, 45, 0 ], - "translation": [ 0, 0, 0 ], - "scale": [ 0.40, 0.40, 0.40 ] + "rotation": [ + 0, + 45, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] }, "firstperson_lefthand": { - "rotation": [ 0, 225, 0 ], - "translation": [ 0, 0, 0 ], - "scale": [ 0.40, 0.40, 0.40 ] + "rotation": [ + 0, + 225, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "ground": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 0.25, + 0.25, + 0.25 + ] + }, + "gui": { + "rotation": [ + 30, + 225, + 0 + ], + "scale": [ + 0.625, + 0.625, + 0.625 + ] + }, + "fixed": { + "scale": [ + 0.5, + 0.5, + 0.5 + ] } } } \ No newline at end of file diff --git a/src/main/resources/assets/coretechs/textures/item/creative_generator.png b/src/main/resources/assets/coretechs/textures/item/creative_generator.png index fea0032..1d108b1 100644 Binary files a/src/main/resources/assets/coretechs/textures/item/creative_generator.png and b/src/main/resources/assets/coretechs/textures/item/creative_generator.png differ diff --git a/src/main/resources/assets/coretechs/textures/item/default_machine_face.png b/src/main/resources/assets/coretechs/textures/item/default_machine_face.png index 58969db..df07359 100644 Binary files a/src/main/resources/assets/coretechs/textures/item/default_machine_face.png and b/src/main/resources/assets/coretechs/textures/item/default_machine_face.png differ diff --git a/src/main/resources/assets/coretechs/textures/item/magnet.png b/src/main/resources/assets/coretechs/textures/item/magnet.png index 3785f85..a27bb87 100644 Binary files a/src/main/resources/assets/coretechs/textures/item/magnet.png and b/src/main/resources/assets/coretechs/textures/item/magnet.png differ diff --git a/src/main/resources/assets/coretechs/textures/item/wire.png b/src/main/resources/assets/coretechs/textures/item/wire.png index 4d9d7c2..ece0616 100644 Binary files a/src/main/resources/assets/coretechs/textures/item/wire.png and b/src/main/resources/assets/coretechs/textures/item/wire.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 82d9d8f..8f6f8c5 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -24,7 +24,8 @@ "minecraft": ">1.20", "java": ">=21", "fabric-api": "*", - "polymer-bundled": "*" + "polymer-bundled": "*", + "polyenergy": "*" }, "suggests": { }