From 9fe2870a76c4a5d6e3b985bdfea605278c6c7841 Mon Sep 17 00:00:00 2001 From: khj xiaogu <54445543+khjxiaogu@users.noreply.github.com> Date: Tue, 26 Oct 2021 01:05:19 +0800 Subject: [PATCH 1/7] Too Easy --- src/main/java/com/teammoeg/steampowered/SteamPowered.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/teammoeg/steampowered/SteamPowered.java b/src/main/java/com/teammoeg/steampowered/SteamPowered.java index c582914..dd0597c 100644 --- a/src/main/java/com/teammoeg/steampowered/SteamPowered.java +++ b/src/main/java/com/teammoeg/steampowered/SteamPowered.java @@ -81,7 +81,7 @@ public class SteamPowered { SPBlocks.register(); SPTiles.register(); SPItems.register(); - BlockStressDefaults.setDefaultImpact(new ResourceLocation("create","gantry_shaft"),8.0); + BlockStressDefaults.setDefaultImpact(new ResourceLocation("create","gantry_shaft"),32.0); ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, SPConfig.COMMON_CONFIG); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, SPConfig.SERVER_CONFIG); PacketHandler.register(); From 37f301476c86792bd4b43301afa00079570906d8 Mon Sep 17 00:00:00 2001 From: goumo_g <15157438197@163.com> Date: Mon, 25 Oct 2021 22:49:04 -0700 Subject: [PATCH 2/7] New model --- .../models/block/alternator/block.json | 52 ++++++++------ .../models/block/alternator/block_old.json | 35 --------- .../models/block/alternator/item.json | 68 ++++++++++-------- .../models/block/alternator/item_old.json | 52 -------------- .../textures/block/alternator/alternator.png | Bin 4998 -> 808 bytes .../block/alternator/alternator_old.png | Bin 1858 -> 0 bytes .../block/alternator/alternator_powered.png | Bin 0 -> 808 bytes .../textures/block/alternator/coil.png | Bin 862 -> 0 bytes 8 files changed, 70 insertions(+), 137 deletions(-) delete mode 100644 src/main/resources/assets/steampowered/models/block/alternator/block_old.json delete mode 100644 src/main/resources/assets/steampowered/models/block/alternator/item_old.json delete mode 100644 src/main/resources/assets/steampowered/textures/block/alternator/alternator_old.png create mode 100644 src/main/resources/assets/steampowered/textures/block/alternator/alternator_powered.png delete mode 100644 src/main/resources/assets/steampowered/textures/block/alternator/coil.png diff --git a/src/main/resources/assets/steampowered/models/block/alternator/block.json b/src/main/resources/assets/steampowered/models/block/alternator/block.json index e8f4376..ff9eb6f 100644 --- a/src/main/resources/assets/steampowered/models/block/alternator/block.json +++ b/src/main/resources/assets/steampowered/models/block/alternator/block.json @@ -1,35 +1,45 @@ { + "credit": "Made with Blockbench, by goumo_g", + "texture_size": [32, 32], "textures": { - "main": "steampowered:block/alternator/alternator", + "0": "steampowered:block/alternator/alternator", "particle": "steampowered:block/alternator/alternator" }, "elements": [ { - "name": "coil", - "from": [0, 0, 3], - "to": [16, 16, 13], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7]}, + "from": [0, 0, 0], + "to": [16, 3, 16], "faces": { - "north": {"uv": [8, 8, 16, 16], "texture": "#main"}, - "east": {"uv": [1.5, 0, 6.5, 8], "rotation": 180, "texture": "#main"}, - "south": {"uv": [8, 8, 16, 16], "texture": "#main"}, - "west": {"uv": [1.5, 0, 6.5, 8], "texture": "#main"}, - "up": {"uv": [1.5, 0, 6.5, 8], "rotation": 90, "texture": "#main"}, - "down": {"uv": [1.5, 0, 6.5, 8], "rotation": 270, "texture": "#main"} + "north": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "east": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "south": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "west": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "up": {"uv": [0, 0, 8, 8], "texture": "#0"}, + "down": {"uv": [0, 0, 8, 8], "texture": "#0"} } }, { - "name": "housing", - "from": [2, 2, 0], - "to": [14, 14, 14], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7]}, + "from": [3, 3, 1], + "to": [13, 14, 12], "faces": { - "north": {"uv": [9, 1, 15, 7], "texture": "#main"}, - "east": {"uv": [9, 1, 16, 7], "texture": "#main"}, - "south": {"uv": [1, 9, 7, 15], "texture": "#main"}, - "west": {"uv": [8, 1, 15, 7], "texture": "#main"}, - "up": {"uv": [9, 0, 15, 7], "texture": "#main"}, - "down": {"uv": [9, 1, 15, 8], "texture": "#main"} + "north": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"}, + "east": {"uv": [5.5, 8, 0, 13.5], "texture": "#0"}, + "south": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"}, + "west": {"uv": [0, 8, 5.5, 13.5], "texture": "#0"}, + "up": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"}, + "down": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"} + } + }, + { + "from": [2, 3, 12], + "to": [14, 15, 16], + "faces": { + "north": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"}, + "east": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"}, + "south": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"}, + "west": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"}, + "up": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"} } } ] diff --git a/src/main/resources/assets/steampowered/models/block/alternator/block_old.json b/src/main/resources/assets/steampowered/models/block/alternator/block_old.json deleted file mode 100644 index 36d0dcc..0000000 --- a/src/main/resources/assets/steampowered/models/block/alternator/block_old.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "textures": { - "0": "steampowered:block/alternator/coil", - "1": "create:block/depot_top", - "particle": "steampowered:block/alternator/coil" - }, - "elements": [ - { - "name": "coil", - "from": [0, 0, 1], - "to": [16, 16, 13], - "faces": { - "north": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "east": {"uv": [2, 0, 14, 16], "rotation": 180, "texture": "#0"}, - "south": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "west": {"uv": [2, 0, 14, 16], "texture": "#0"}, - "up": {"uv": [2, 0, 14, 16], "rotation": 90, "texture": "#0"}, - "down": {"uv": [2, 0, 14, 16], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "housing", - "from": [1, 1, 0], - "to": [15, 15, 14], - "faces": { - "north": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "east": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "south": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "west": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "up": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "down": {"uv": [1, 0, 15, 14], "texture": "#1"} - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/steampowered/models/block/alternator/item.json b/src/main/resources/assets/steampowered/models/block/alternator/item.json index 547fb65..80fbdfa 100644 --- a/src/main/resources/assets/steampowered/models/block/alternator/item.json +++ b/src/main/resources/assets/steampowered/models/block/alternator/item.json @@ -1,37 +1,47 @@ { + "credit": "Made with Blockbench, by goumo_g", + "texture_size": [32, 32], "textures": { - "main": "steampowered:block/alternator/alternator", + "0": "steampowered:block/alternator/alternator", "particle": "steampowered:block/alternator/alternator", - "1_0": "create:block/axis", - "1_1": "create:block/axis_top" + "2": "create:block/axis", + "3": "create:block/axis_top" }, "elements": [ { - "name": "coil", - "from": [0, 0, 3], - "to": [16, 16, 13], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7]}, + "from": [0, 0, 0], + "to": [16, 3, 16], "faces": { - "north": {"uv": [8, 8, 16, 16], "texture": "#main"}, - "east": {"uv": [1.5, 0, 6.5, 8], "rotation": 180, "texture": "#main"}, - "south": {"uv": [8, 8, 16, 16], "texture": "#main"}, - "west": {"uv": [1.5, 0, 6.5, 8], "texture": "#main"}, - "up": {"uv": [1.5, 0, 6.5, 8], "rotation": 90, "texture": "#main"}, - "down": {"uv": [1.5, 0, 6.5, 8], "rotation": 270, "texture": "#main"} + "north": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "east": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "south": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "west": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "up": {"uv": [0, 0, 8, 8], "texture": "#0"}, + "down": {"uv": [0, 0, 8, 8], "texture": "#0"} } }, { - "name": "housing", - "from": [2, 2, 0], - "to": [14, 14, 14], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7]}, + "from": [3, 3, 1], + "to": [13, 14, 12], "faces": { - "north": {"uv": [9, 1, 15, 7], "texture": "#main"}, - "east": {"uv": [9, 1, 16, 7], "texture": "#main"}, - "south": {"uv": [1, 9, 7, 15], "texture": "#main"}, - "west": {"uv": [8, 1, 15, 7], "texture": "#main"}, - "up": {"uv": [9, 0, 15, 7], "texture": "#main"}, - "down": {"uv": [9, 1, 15, 8], "texture": "#main"} + "north": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"}, + "east": {"uv": [5.5, 8, 0, 13.5], "texture": "#0"}, + "south": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"}, + "west": {"uv": [0, 8, 5.5, 13.5], "texture": "#0"}, + "up": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"}, + "down": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"} + } + }, + { + "from": [2, 3, 12], + "to": [14, 15, 16], + "faces": { + "north": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"}, + "east": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"}, + "south": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"}, + "west": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"}, + "up": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"} } }, { @@ -41,12 +51,12 @@ "shade": false, "rotation": {"angle": 22.5, "axis": "z", "origin": [8, 8, 8]}, "faces": { - "north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1_1"}, - "east": {"uv": [6, 0, 10, 10], "rotation": 270, "texture": "#1_0"}, - "south": {"uv": [6, 6, 10, 10], "texture": "#1_1"}, - "west": {"uv": [6, 0, 10, 10], "rotation": 90, "texture": "#1_0"}, - "up": {"uv": [6, 0, 10, 10], "rotation": 180, "texture": "#1_0"}, - "down": {"uv": [6, 0, 10, 10], "texture": "#1_0"} + "north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#3"}, + "east": {"uv": [6, 0, 10, 10], "rotation": 270, "texture": "#2"}, + "south": {"uv": [6, 6, 10, 10], "texture": "#3"}, + "west": {"uv": [6, 0, 10, 10], "rotation": 90, "texture": "#2"}, + "up": {"uv": [6, 0, 10, 10], "rotation": 180, "texture": "#2"}, + "down": {"uv": [6, 0, 10, 10], "texture": "#2"} } } ] diff --git a/src/main/resources/assets/steampowered/models/block/alternator/item_old.json b/src/main/resources/assets/steampowered/models/block/alternator/item_old.json deleted file mode 100644 index c92b160..0000000 --- a/src/main/resources/assets/steampowered/models/block/alternator/item_old.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "textures": { - "0": "steampowered:block/alternator/coil", - "1": "create:block/depot_top", - "1_0": "create:block/axis", - "1_1": "create:block/axis_top", - "particle": "steampowered:block/alternator/coil" - }, - "elements": [ - { - "name": "coil", - "from": [0, 0, 1], - "to": [16, 16, 13], - "faces": { - "north": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "east": {"uv": [2, 0, 14, 16], "rotation": 180, "texture": "#0"}, - "south": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "west": {"uv": [2, 0, 14, 16], "texture": "#0"}, - "up": {"uv": [2, 0, 14, 16], "rotation": 90, "texture": "#0"}, - "down": {"uv": [2, 0, 14, 16], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "housing", - "from": [1, 1, 0], - "to": [15, 15, 14], - "faces": { - "north": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "east": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "south": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "west": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "up": {"uv": [1, 0, 15, 14], "texture": "#1"}, - "down": {"uv": [1, 0, 15, 14], "texture": "#1"} - } - }, - { - "name": "Axis", - "from": [6, 6, 6], - "to": [10, 10, 16], - "shade": false, - "rotation": {"angle": 22.5, "axis": "z", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1_1"}, - "east": {"uv": [6, 0, 10, 10], "rotation": 270, "texture": "#1_0"}, - "south": {"uv": [6, 6, 10, 10], "texture": "#1_1"}, - "west": {"uv": [6, 0, 10, 10], "rotation": 90, "texture": "#1_0"}, - "up": {"uv": [6, 0, 10, 10], "rotation": 180, "texture": "#1_0"}, - "down": {"uv": [6, 0, 10, 10], "texture": "#1_0"} - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/steampowered/textures/block/alternator/alternator.png b/src/main/resources/assets/steampowered/textures/block/alternator/alternator.png index 08324ab68837eb7710bae097455c71dc2dca5147..9449341fbf957823523cbfc606b70762332da7f2 100644 GIT binary patch literal 808 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X<^=eJxE2KIRYjT92D`ekuv)XStuKj>WMxa`;tsWvzcZ<_ zJ;kCU)iTOOCDKl*GSaxJsv$p6J1QzZE344YOeWh`C)8R#(OWOoQ^Utxrl!7OLV{n2 zwY;OQXj7t9j-PH@M|)#}Wvr7@l)X}rt%{w7P(h$hMTA+blS+z*MwGp>pP96qk&Ldc zuBN7@jg5_~tE;lIvb?;!v9a<0|NlEz%nJm%)1)NGFBr%r6)<>*E2T0pFh25haSW-r zb!PI-vfBncE-SB2OFg=KuC4FwCDM#dAO8Q3W*7K;Vc(anHplIhYHb!}G-hCb$jyqmHmu~5Czd2kKgP8Bn?K)RyCUFFlHVL5K@moqm}6gs8%np@uJov4Y}gk!Nnmli z%> zOFp!japl|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#Kbxxj}pr(Nw&#eaS znh)l(pmj#4(`IAip%v8n`Yk%0Hd6WoQd%n=VZe3JI;m z7FrY~R;fv1JUi_J61!QarnjSWq9`HDa-KeIBZO~*&GQ_k64Ep#48| zbX}J$)3izzGeSU?Tl|3oGyTlLaiG_WfgGixik`%<>1dsyH3UJkf2k-g6iE^@HZ}l8 zLr2h!6rS+WI^p*1TL|HiBv}ccFg7+$yPa6P)j+3oZ=ar;8u=k%KG&H~xeET=*ue7y zj^onpc1s#4gx79A9l23gj^NkJ3tL+8X4i7Vz^l7=+vhNNX;T|E;U#Oj$@n7)&0*&Wuw+kXUYXATM07*qoM6N<$g3D`CssI20 diff --git a/src/main/resources/assets/steampowered/textures/block/alternator/alternator_powered.png b/src/main/resources/assets/steampowered/textures/block/alternator/alternator_powered.png new file mode 100644 index 0000000000000000000000000000000000000000..ba922fafac1d91d57ec35dc044473729a70cd142 GIT binary patch literal 808 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X<^=eJxE2KI)dss(MVYKGiJ!{AP|m=xhJoQU14F2l{GCaa z?I{)=sg_YLDv@?dm666-S%rRPGTFX5QBm=U-g^0g+ErBzq1N&~<}#_C8nI4FZ5{13 z^$j7`@{YQqIexkm68xGHtr`<7?KFg9om7HsRs77PD2i(^Q| ztuvEvmfbesaannFTI$i=kKbfYe#gRb=>PwGS%)*uzb{??B=fuD%U6aujZA`_DbY$Q zDYuIn@?}`N0%wMr{!%(9$DV6G|EWUY_HzH&+hzWj#e3zGf>Ib?{QUH|_M-l;+owOu ztmUXHD%BU?aHwzK1(P7q%RoW1*^~!BnxQ=XE&4>t7XN6HE9RYVWEmy760< zbr=3Ly|OwrqGXn;=6RP>hqAbG?e&~FRzF>s&)X4p=UtkC$c|R09h}P;6qqgMnyL43 zo@ZOKPX0RI68&@5@a&5m$P_fa(|9P*UGH6 zg-(}^_<8@GOl^1~^`Q1sbmW9o&X+n_4Vos-!J%Tz*+)tR7PC$)zVe3ajjs#yjc0;} zZvU7axP4O@IOJQ_@CBGO9Gz>*I@@GNs_K>e9EY@vtFn9!wsX2n>iKD|euAO(ahdwr z&wCy@3v4fE5oq`%72&yE=wGm&H$%+-jsMsmY-eC*xUzg%#M@2DUx2BF!PC{xWt~$( F69As1W##|? literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/steampowered/textures/block/alternator/coil.png b/src/main/resources/assets/steampowered/textures/block/alternator/coil.png deleted file mode 100644 index b26d5fe3354e51893433809c5f586bf981208663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 862 zcmV-k1EKthP)EX>4Tx04R}tkv&MmP!xqvQ>7wR2P=p;WT;LSL`8IyDi*;)X)CnqVDi#GXws0R zxHt-~1qXi?s}3&Cx;nTDg5VE`o12rOi;UzV4};>Mp{wy!-yF9wlcoz$X&VG2O6;H;AV< zEuHf|aflTqh4`F!%%BSrKXP4m`HgeIVS#6cjC69II7BQK+E{L5Ry0)NDdMoAYLqWz zTvj-5aaPM!*1RWwVKAqyq_|FN7%?m%js!%=sG@{2EJSG6NHLM5^Qeb^$nhu0C6lWJ zMvetkph9x|;D7LYwq|~E!c7WBfzB7({uluQyFjC6+uz5w-8cdK&%l+|@>lA>%qQu! zmKHt&`nG|K>y{?(0hc?#;FB&Hk|X(P3Hdzmen#Jv1^RD+?lpIA&2yYS0BM@l@(pls z2#gjed)?#RUF~!Gx2HM3AAGrTtE*q)P5=M^24YJ`L;za=TL4=s&_CX>@2HM@dakSAh-}0003sNklupHjJT}u^|V41^E&{bU4IPT znR!@2sH_l!vy0ncrMok517@~u_zbXRFlxb!&P@U!$iNjF9Zi+?7Xxn}BABC;f)D~y z${+*No>IzcCM)n6=-J`_i{y^cXFxR)G8~^|S From 03d58412ba5b39d986df66e2a1aa8fd68fc675d0 Mon Sep 17 00:00:00 2001 From: yuesha-yc Date: Tue, 26 Oct 2021 00:00:12 -0700 Subject: [PATCH 3/7] New Dynamo --- .../com/teammoeg/steampowered/SPConfig.java | 20 ++- .../client/render/AlternatorRenderer.java | 51 ------ .../client/render/DynamoRenderer.java | 38 ++++ .../content/alternator/AlternatorBlock.java | 142 --------------- .../content/alternator/DynamoBlock.java | 166 ++++++++++++++++++ ...rTileEntity.java => DynamoTileEntity.java} | 54 +++--- .../steampowered/ponder/SPPonderIndex.java | 4 +- .../steampowered/ponder/SPScenes.java | 8 +- .../steampowered/registrate/SPBlocks.java | 4 +- .../steampowered/registrate/SPTiles.java | 13 +- .../steampowered/blockstates/alternator.json | 48 +++-- .../assets/steampowered/lang/en_us.json | 17 +- .../assets/steampowered/lang/ja_jp.json | 41 +++-- .../assets/steampowered/lang/zh_cn.json | 17 +- .../block/{alternator => dynamo}/block.json | 4 +- .../models/block/dynamo/block_locked.json | 46 +++++ .../block/{alternator => dynamo}/item.json | 4 +- .../ponder/{alternator.nbt => dynamo.nbt} | Bin .../alternator.png => dynamo/dynamo.png} | Bin .../dynamo_locked.png} | Bin 20 files changed, 377 insertions(+), 300 deletions(-) delete mode 100644 src/main/java/com/teammoeg/steampowered/client/render/AlternatorRenderer.java create mode 100644 src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java delete mode 100644 src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorBlock.java create mode 100644 src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java rename src/main/java/com/teammoeg/steampowered/content/alternator/{AlternatorTileEntity.java => DynamoTileEntity.java} (81%) rename src/main/resources/assets/steampowered/models/block/{alternator => dynamo}/block.json (92%) create mode 100644 src/main/resources/assets/steampowered/models/block/dynamo/block_locked.json rename src/main/resources/assets/steampowered/models/block/{alternator => dynamo}/item.json (94%) rename src/main/resources/assets/steampowered/ponder/{alternator.nbt => dynamo.nbt} (100%) rename src/main/resources/assets/steampowered/textures/block/{alternator/alternator.png => dynamo/dynamo.png} (100%) rename src/main/resources/assets/steampowered/textures/block/{alternator/alternator_powered.png => dynamo/dynamo_locked.png} (100%) diff --git a/src/main/java/com/teammoeg/steampowered/SPConfig.java b/src/main/java/com/teammoeg/steampowered/SPConfig.java index 83b06f1..351ee4e 100644 --- a/src/main/java/com/teammoeg/steampowered/SPConfig.java +++ b/src/main/java/com/teammoeg/steampowered/SPConfig.java @@ -36,7 +36,6 @@ public class SPConfig { public final ForgeConfigSpec.IntValue steelFlywheelSteamConsumptionPerTick; public final ForgeConfigSpec.IntValue steelFlywheelSteamStorage; - public final ForgeConfigSpec.IntValue dynamoFeMaxIn; public final ForgeConfigSpec.IntValue dynamoFeMaxOut; public final ForgeConfigSpec.IntValue dynamoFeCapacity; public final ForgeConfigSpec.IntValue dynamoImpact; @@ -79,7 +78,6 @@ public class SPConfig { builder.push("dynamo").comment("If dynamo is disabled in the server config, the following will be ignored!"); { - dynamoFeMaxIn = builder.defineInRange("dynamoFeMaxIn", 0, 0, 8192); dynamoFeMaxOut = builder.defineInRange("dynamoFeMaxOut", 256, 0, 8192); dynamoFeCapacity = builder.defineInRange("dynamoFeCapacity", 2048, 0, 8192); dynamoImpact = builder.defineInRange("dynamoImpact", 16, 0, 8192); @@ -101,7 +99,7 @@ public class SPConfig { public final ForgeConfigSpec.BooleanValue allowUnverifiedContraption; public final ForgeConfigSpec.BooleanValue allowCartAssembler; - public final ForgeConfigSpec.BooleanValue disableSteamPoweredDynamo; + public final ForgeConfigSpec.BooleanValue disableDynamo; Server(ForgeConfigSpec.Builder builder) { builder.push("createmodify"); @@ -112,7 +110,21 @@ public class SPConfig { builder.pop(); builder.push("dynamo"); { - disableSteamPoweredDynamo = builder.comment("Set to false to enable this mod's dynamo.").define("disableSteamPoweredDynamo", true); + disableDynamo = builder + .comment("Set to true to DISABLE the DynamoBlock ONLY when Create: Crafts & Additions is loaded") + .comment("Create: Crafts & Additions is a mod which provides a similar electricity generation device called Alternator") + .comment("For pack developers who think having two similar devices is superfluous, you have two choices:") + .comment("Either you can set this config option to true and remove the DynamoBlock recipe through datapack") + .comment("Or if you instead want to use our DynamoBlock, you can remove the Alternator's recipe through datapack") + .comment("How to make datapack? Learn it from here: https://minecraft.gamepedia.com/Data_Pack") + .comment("However, please refer to the following: ") + .comment("We offers a redstone lock mechanism so that you can disconnect the DynamoBlock with redstone signal") + .comment("We offers a different model which provides different textures according to redstone status") + .comment("Clarification: As of Ver 1.1.1, Create: Steam Powered's DynamoBlock ONLY adapts from") + .comment("the code implementation of the Alternator created by MRH0, which is under MIT License") + .comment("We acknowledge and appreciate the great work done by MRH0. We learn from his code") + .comment("MRH0 is also under our credits list in mods.toml description") + .define("disableDynamo", false); } builder.pop(); } diff --git a/src/main/java/com/teammoeg/steampowered/client/render/AlternatorRenderer.java b/src/main/java/com/teammoeg/steampowered/client/render/AlternatorRenderer.java deleted file mode 100644 index ffdd257..0000000 --- a/src/main/java/com/teammoeg/steampowered/client/render/AlternatorRenderer.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Available under MIT the license more info at: https://tldrlegal.com/license/mit-license - * - * MIT License - * - * Copyright 2021 MRH0 - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, - * including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom t - * he Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.teammoeg.steampowered.client.render; - -import com.simibubi.create.AllBlockPartials; -import com.simibubi.create.content.contraptions.base.KineticTileEntity; -import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; -import com.simibubi.create.foundation.render.PartialBufferer; -import com.simibubi.create.foundation.render.SuperByteBuffer; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; - -/** - * Adapted from: Create: Crafts & Additions - * @author MRH0 - */ -public class AlternatorRenderer extends KineticTileEntityRenderer { - - public AlternatorRenderer(TileEntityRendererDispatcher dispatcher) { - super(dispatcher); - } - - @Override - protected SuperByteBuffer getRotatedModel(KineticTileEntity te) { - return PartialBufferer.getFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState()); - } -} diff --git a/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java b/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java new file mode 100644 index 0000000..912661f --- /dev/null +++ b/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 TeamMoeg + * + * This file is part of Steam Powered. + * + * Steam Powered is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * Steam Powered is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Steam Powered. If not, see . + */ + +package com.teammoeg.steampowered.client.render; + +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; +import com.simibubi.create.foundation.render.PartialBufferer; +import com.simibubi.create.foundation.render.SuperByteBuffer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; + +public class DynamoRenderer extends KineticTileEntityRenderer { + + public DynamoRenderer(TileEntityRendererDispatcher dispatcher) { + super(dispatcher); + } + + @Override + protected SuperByteBuffer getRotatedModel(KineticTileEntity te) { + return PartialBufferer.getFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState()); + } +} diff --git a/src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorBlock.java b/src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorBlock.java deleted file mode 100644 index cf5e2d3..0000000 --- a/src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorBlock.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Available under MIT the license more info at: https://tldrlegal.com/license/mit-license - * - * MIT License - * - * Copyright 2021 MRH0 - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, - * including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom t - * he Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.teammoeg.steampowered.content.alternator; - -import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; -import com.simibubi.create.content.contraptions.base.IRotate; -import com.simibubi.create.foundation.block.ITE; -import com.simibubi.create.foundation.utility.VoxelShaper; -import com.teammoeg.steampowered.SPConfig; -import com.teammoeg.steampowered.block.SPShapes; -import com.teammoeg.steampowered.registrate.SPTiles; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.item.BlockItemUseContext; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Direction; -import net.minecraft.util.Direction.Axis; -import net.minecraft.util.NonNullList; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.shapes.ISelectionContext; -import net.minecraft.util.math.shapes.VoxelShape; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.StringTextComponent; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.TranslationTextComponent; -import net.minecraft.world.IBlockReader; -import net.minecraft.world.IWorldReader; -import net.minecraft.world.World; - -import java.util.List; - -/** - * Adapted from: Create: Crafts & Additions - * @author MRH0 - */ -public class AlternatorBlock extends DirectionalKineticBlock implements ITE, IRotate { - - public static final VoxelShaper ALTERNATOR_SHAPE = SPShapes.shape(0, 3, 0, 16, 13, 16).add(2, 0, 2, 14, 14, 14).forDirectional(); - - @Override - public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - return ALTERNATOR_SHAPE.get(state.getValue(FACING)); - } - - @Override - public BlockState getStateForPlacement(BlockItemUseContext context) { - Direction preferred = getPreferredFacing(context); - if ((context.getPlayer() != null && context.getPlayer() - .isShiftKeyDown()) || preferred == null) - return super.getStateForPlacement(context); - return defaultBlockState().setValue(FACING, preferred); - } - - public AlternatorBlock(Properties properties) { - super(properties); - } - - @Override - public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) { - return face == state.getValue(FACING); - } - - @Override - public Axis getRotationAxis(BlockState state) { - return state.getValue(FACING) - .getAxis(); - } - - @Override - public Class getTileEntityClass() { - return AlternatorTileEntity.class; - } - - @Override - public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return SPTiles.ALTERNATOR.create(); - } - - @Override - public SpeedLevel getMinimumRequiredSpeedLevel() { - return SpeedLevel.MEDIUM; - } - - @Override - public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) { - TileEntity tileentity = state.hasTileEntity() ? worldIn.getBlockEntity(pos) : null; - if (tileentity != null) { - if (tileentity instanceof AlternatorTileEntity) { - ((AlternatorTileEntity) tileentity).updateCache(); - } - } - } - - @Override - public void fillItemCategory(ItemGroup group, NonNullList itemStacks) { - if (SPConfig.SERVER.disableSteamPoweredDynamo.get()) { - // dynamo disabled - } else { - super.fillItemCategory(group, itemStacks); - } - } - - @Override - public void appendHoverText(ItemStack i, IBlockReader w, List t, ITooltipFlag f) { - if (SPConfig.SERVER.disableSteamPoweredDynamo.get()) { - t.add(new StringTextComponent("Dynamo is disabled in the server config").withStyle(TextFormatting.RED)); - } else { - t.add(new StringTextComponent("Dynamo adapted from the mod Create: Crafts & Additions. Credits: MRH0").withStyle(TextFormatting.RED)); - t.add(new StringTextComponent("Codes and assets under MIT License").withStyle(TextFormatting.RED)); - t.add(new TranslationTextComponent("block.steampowered.alternator.tooltip.summary").withStyle(TextFormatting.GRAY)); - } - super.appendHoverText(i,w,t,f); - } -} diff --git a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java new file mode 100644 index 0000000..5b7e210 --- /dev/null +++ b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2021 TeamMoeg + * + * This file is part of Steam Powered. + * + * Steam Powered is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * Steam Powered is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Steam Powered. If not, see . + */ + +package com.teammoeg.steampowered.content.alternator; + +import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; +import com.simibubi.create.content.contraptions.base.IRotate; +import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.utility.VoxelShaper; +import com.teammoeg.steampowered.SPConfig; +import com.teammoeg.steampowered.block.SPShapes; +import com.teammoeg.steampowered.registrate.SPTiles; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemStack; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.StateContainer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorldReader; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; +import net.minecraftforge.fml.ModList; + +import java.util.List; +import java.util.Random; + +/** + * Adapted from: Create: Crafts & Additions + * @author MRH0 + * @author yuesha-yc + */ +public class DynamoBlock extends DirectionalKineticBlock implements ITE, IRotate { + + public static final BooleanProperty REDSTONE_LOCKED = BooleanProperty.create("redstone_locked"); + + //TODO: Fix shape + public static final VoxelShaper ALTERNATOR_SHAPE = SPShapes.shape(0, 3, 0, 16, 13, 16).add(2, 0, 2, 14, 14, 14).forDirectional(); + + @Override + public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { + return ALTERNATOR_SHAPE.get(state.getValue(FACING)); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + Direction preferred = getPreferredFacing(context); + if ((context.getPlayer() != null && context.getPlayer().isShiftKeyDown()) || preferred == null) { + return super.getStateForPlacement(context).setValue(REDSTONE_LOCKED, context.getLevel().hasNeighborSignal(context.getClickedPos())); + } + return defaultBlockState().setValue(FACING, preferred).setValue(REDSTONE_LOCKED, context.getLevel().hasNeighborSignal(context.getClickedPos())); + } + + public DynamoBlock(Properties properties) { + super(properties); + this.registerDefaultState(this.stateDefinition.any().setValue(REDSTONE_LOCKED, false)); + } + + protected void createBlockStateDefinition(StateContainer.Builder builder) { + super.createBlockStateDefinition(builder.add(REDSTONE_LOCKED)); + } + + @Override + public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) { + return face == state.getValue(FACING); + } + + @Override + public Axis getRotationAxis(BlockState state) { + return state.getValue(FACING) + .getAxis(); + } + + @Override + public Class getTileEntityClass() { + return DynamoTileEntity.class; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return SPTiles.DYNAMO.create(); + } + + @Override + public SpeedLevel getMinimumRequiredSpeedLevel() { + return SpeedLevel.MEDIUM; + } + + @Override + public void fillItemCategory(ItemGroup group, NonNullList itemStacks) { + if (ModList.get().isLoaded("createaddition") && SPConfig.SERVER.disableDynamo.get()) { + // removes dynamo from creative tab when CC&A is loaded AND config is set to true + } else { + super.fillItemCategory(group, itemStacks); + } + } + + @Override + public void appendHoverText(ItemStack i, IBlockReader w, List t, ITooltipFlag f) { + t.add(new TranslationTextComponent("block.steampowered.dynamo.tooltip.summary").withStyle(TextFormatting.GRAY)); + t.add(new StringTextComponent("We adapt and appreciate MRH0's code").withStyle(TextFormatting.GRAY)); + if (ModList.get().isLoaded("createaddition")) { + if (SPConfig.SERVER.disableDynamo.get()) { + t.add(new StringTextComponent("Dynamo is disabled in [save]/serverconfig/steampowered-server.toml").withStyle(TextFormatting.RED)); + } + } + super.appendHoverText(i,w,t,f); + } + + @Override + public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean flag) { + if (!world.isClientSide) { + TileEntity tileentity = state.hasTileEntity() ? world.getBlockEntity(pos) : null; + if (tileentity != null) { + if (tileentity instanceof DynamoTileEntity) { + ((DynamoTileEntity) tileentity).updateCache(); + } + } + + boolean isLocked = state.getValue(REDSTONE_LOCKED); + if (isLocked != world.hasNeighborSignal(pos)) { + if (isLocked) { + world.getBlockTicks().scheduleTick(pos, this, 4); + } else { + world.setBlock(pos, state.cycle(REDSTONE_LOCKED), 2); + } + } + + } + } + + @Override + public void tick(BlockState state, ServerWorld serverworld, BlockPos pos, Random random) { + if (state.getValue(REDSTONE_LOCKED) && !serverworld.hasNeighborSignal(pos)) { + serverworld.setBlock(pos, state.cycle(REDSTONE_LOCKED), 2); + } + } +} diff --git a/src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorTileEntity.java b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java similarity index 81% rename from src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorTileEntity.java rename to src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java index 7e17f8c..7e55aa4 100644 --- a/src/main/java/com/teammoeg/steampowered/content/alternator/AlternatorTileEntity.java +++ b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java @@ -1,28 +1,19 @@ -/** - * Available under MIT the license more info at: https://tldrlegal.com/license/mit-license +/* + * Copyright (c) 2021 TeamMoeg * - * MIT License + * This file is part of Steam Powered. * - * Copyright 2021 MRH0 + * Steam Powered is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, - * including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom t - * he Software is furnished to do so, subject to the following conditions: + * Steam Powered is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Steam Powered. If not, see . */ package com.teammoeg.steampowered.content.alternator; @@ -51,25 +42,26 @@ import net.minecraftforge.energy.IEnergyStorage; import java.util.List; /** - * Adapted from: Create: Crafts & Additions + * Adapted from: Create: Crafts & Additions under the MIT License * @author MRH0 + * @author yuesha-yc */ -public class AlternatorTileEntity extends KineticTileEntity { +public class DynamoTileEntity extends KineticTileEntity { protected final InternalEnergyStorage energy; private LazyOptional lazyEnergy; + private boolean redstoneLocked = false; private static final int - MAX_FE_IN = SPConfig.COMMON.dynamoFeMaxIn.get(), MAX_FE_OUT = SPConfig.COMMON.dynamoFeMaxOut.get(), // FE Output FE_CAPACITY = SPConfig.COMMON.dynamoFeCapacity.get(), // FE Storage IMPACT = SPConfig.COMMON.dynamoImpact.get(); // Impact on network private static final double EFFICIENCY = SPConfig.COMMON.dynamoEfficiency.get(); - public AlternatorTileEntity(TileEntityType typeIn) { + public DynamoTileEntity(TileEntityType typeIn) { super(typeIn); - energy = new InternalEnergyStorage(FE_CAPACITY, MAX_FE_IN, MAX_FE_OUT); + energy = new InternalEnergyStorage(FE_CAPACITY, 0, MAX_FE_OUT); lazyEnergy = LazyOptional.of(() -> energy); } @@ -107,19 +99,21 @@ public class AlternatorTileEntity extends KineticTileEntity { } public boolean isEnergyOutput(Direction side) { - return side != getBlockState().getValue(AlternatorBlock.FACING); + return side != getBlockState().getValue(DynamoBlock.FACING); } @Override public void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { super.fromTag(state, compound, clientPacket); energy.read(compound); + redstoneLocked = compound.getBoolean("redstonelocked"); } @Override public void write(CompoundNBT compound, boolean clientPacket) { super.write(compound, clientPacket); energy.write(compound); + compound.putBoolean("redstonelocked", redstoneLocked); } private boolean firstTickState = true; @@ -129,6 +123,10 @@ public class AlternatorTileEntity extends KineticTileEntity { super.tick(); if (level != null && level.isClientSide()) return; + + if (this.getBlockState().getValue(DynamoBlock.REDSTONE_LOCKED)) + return; + if (firstTickState) firstTick(); firstTickState = false; @@ -167,8 +165,6 @@ public class AlternatorTileEntity extends KineticTileEntity { updateCache(); } - ; - public void updateCache() { if (level.isClientSide()) return; diff --git a/src/main/java/com/teammoeg/steampowered/ponder/SPPonderIndex.java b/src/main/java/com/teammoeg/steampowered/ponder/SPPonderIndex.java index e19abdf..30f29a4 100644 --- a/src/main/java/com/teammoeg/steampowered/ponder/SPPonderIndex.java +++ b/src/main/java/com/teammoeg/steampowered/ponder/SPPonderIndex.java @@ -54,8 +54,8 @@ public class SPPonderIndex { STEAM_HELPER.forComponents(SPBlocks.BRONZE_FLYWHEEL, SPBlocks.CAST_IRON_FLYWHEEL, SPBlocks.STEEL_FLYWHEEL) .addStoryBoard("steam_engine", SPScenes::steamFlywheel, PonderTag.KINETIC_SOURCES, STEAM); - STEAM_HELPER.forComponents(SPBlocks.ALTERNATOR) - .addStoryBoard("alternator", SPScenes::alternator, PonderTag.KINETIC_APPLIANCES, STEAM); + STEAM_HELPER.forComponents(SPBlocks.DYNAMO) + .addStoryBoard("dynamo", SPScenes::dynamo, PonderTag.KINETIC_APPLIANCES, STEAM); } } diff --git a/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java b/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java index 3e7634f..c5a6877 100644 --- a/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java +++ b/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java @@ -194,8 +194,8 @@ public class SPScenes { scene.overlay.showText(80).placeNearTarget().colored(PonderPalette.MEDIUM).pointAt(util.vector.topOf(enginePos.west())).text(text3); } - public static void alternator(SceneBuilder scene, SceneBuildingUtil util) { - scene.title("alternator", "Generating Electric energy using a Alternator"); + public static void dynamo(SceneBuilder scene, SceneBuildingUtil util) { + scene.title("dynamo", "Generating Electric energy using a Dynamo"); scene.configureBasePlate(1, 0, 4); scene.world.showSection(util.select.layer(0), Direction.UP); @@ -209,7 +209,7 @@ public class SPScenes { scene.idle(10); scene.overlay.showText(50) - .text("The Alternator generates electric energy (fe) from rotational force") + .text("The Dynamo generates electric energy (fe) from rotational force") .placeNearTarget() .pointAt(util.vector.topOf(generator)); scene.idle(60); @@ -222,7 +222,7 @@ public class SPScenes { scene.overlay.showText(50) - .text("The Alternators energy production is determined by the input RPM") + .text("The Dynamos energy production is determined by the input RPM") .placeNearTarget() .pointAt(util.vector.topOf(generator)); scene.idle(60); diff --git a/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java b/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java index 8d5824c..8c2ce80 100644 --- a/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java +++ b/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java @@ -31,7 +31,7 @@ import com.simibubi.create.foundation.data.SharedProperties; import com.simibubi.create.repack.registrate.util.entry.BlockEntry; import com.teammoeg.steampowered.SPConfig; import com.teammoeg.steampowered.SteamPowered; -import com.teammoeg.steampowered.content.alternator.AlternatorBlock; +import com.teammoeg.steampowered.content.alternator.DynamoBlock; import com.teammoeg.steampowered.content.boiler.CastIronBoilerBlock; import com.teammoeg.steampowered.content.boiler.SteelBoilerBlock; import com.teammoeg.steampowered.content.burner.CastIronBurnerBlock; @@ -172,7 +172,7 @@ public class SPBlocks { .build() .register(); - public static final BlockEntry ALTERNATOR = REGISTRATE.block("alternator", AlternatorBlock::new) + public static final BlockEntry DYNAMO = REGISTRATE.block("alternator", DynamoBlock::new) .initialProperties(SPBlocks::hardMetal) .transform(BlockStressDefaults.setImpact(4.0)) .tag(AllTags.AllBlockTags.SAFE_NBT.tag) //Dono what this tag means (contraption safe?). diff --git a/src/main/java/com/teammoeg/steampowered/registrate/SPTiles.java b/src/main/java/com/teammoeg/steampowered/registrate/SPTiles.java index 5943e54..5ee0fad 100644 --- a/src/main/java/com/teammoeg/steampowered/registrate/SPTiles.java +++ b/src/main/java/com/teammoeg/steampowered/registrate/SPTiles.java @@ -28,12 +28,11 @@ import com.teammoeg.steampowered.SteamPowered; import com.teammoeg.steampowered.client.instance.BronzeFlywheelInstance; import com.teammoeg.steampowered.client.instance.CastIronFlywheelInstance; import com.teammoeg.steampowered.client.instance.SteelFlywheelInstance; -import com.teammoeg.steampowered.client.render.AlternatorRenderer; +import com.teammoeg.steampowered.client.render.DynamoRenderer; import com.teammoeg.steampowered.client.render.BronzeFlywheelRenderer; import com.teammoeg.steampowered.client.render.CastIronFlywheelRenderer; import com.teammoeg.steampowered.client.render.SteelFlywheelRenderer; -import com.teammoeg.steampowered.content.alternator.AlternatorTileEntity; -import com.teammoeg.steampowered.content.boiler.CastIronBoilerBlock; +import com.teammoeg.steampowered.content.alternator.DynamoTileEntity; import com.teammoeg.steampowered.content.boiler.CastIronBoilerTileEntity; import com.teammoeg.steampowered.content.boiler.SteelBoilerTileEntity; import com.teammoeg.steampowered.content.burner.CastIronBurnerTileEntity; @@ -101,11 +100,11 @@ public class SPTiles { .renderer(() -> KineticTileEntityRenderer::new) .register(); - public static final TileEntityEntry ALTERNATOR = REGISTRATE - .tileEntity("alternator", AlternatorTileEntity::new) + public static final TileEntityEntry DYNAMO = REGISTRATE + .tileEntity("alternator", DynamoTileEntity::new) .instance(() -> HalfShaftInstance::new) - .validBlocks(SPBlocks.ALTERNATOR) - .renderer(() -> AlternatorRenderer::new) + .validBlocks(SPBlocks.DYNAMO) + .renderer(() -> DynamoRenderer::new) .register(); public static final TileEntityEntry BRONZE_STEAM_FLYWHEEL = REGISTRATE diff --git a/src/main/resources/assets/steampowered/blockstates/alternator.json b/src/main/resources/assets/steampowered/blockstates/alternator.json index 88f1572..3e84ca4 100644 --- a/src/main/resources/assets/steampowered/blockstates/alternator.json +++ b/src/main/resources/assets/steampowered/blockstates/alternator.json @@ -1,27 +1,51 @@ { "variants": { - "facing=down": { - "model": "steampowered:block/alternator/block", + "facing=down,redstone_locked=false": { + "model": "steampowered:block/dynamo/block", "x": 270, "y": 90 }, - "facing=up": { - "model": "steampowered:block/alternator/block", + "facing=up,redstone_locked=false": { + "model": "steampowered:block/dynamo/block", "x": 90, "y": 90 }, - "facing=north": { - "model": "steampowered:block/alternator/block", + "facing=north,redstone_locked=false": { + "model": "steampowered:block/dynamo/block", "y": 180 }, - "facing=south": { - "model": "steampowered:block/alternator/block", + "facing=south,redstone_locked=false": { + "model": "steampowered:block/dynamo/block", "y": 0 }, - "facing=west": { - "model": "steampowered:block/alternator/block", + "facing=west,redstone_locked=false": { + "model": "steampowered:block/dynamo/block", "y": 90 }, - "facing=east": { - "model": "steampowered:block/alternator/block", + "facing=east,redstone_locked=false": { + "model": "steampowered:block/dynamo/block", + "y": 270 + }, + "facing=down,redstone_locked=true": { + "model": "steampowered:block/dynamo/block_locked", + "x": 270, "y": 90 + }, + "facing=up,redstone_locked=true": { + "model": "steampowered:block/dynamo/block_locked", + "x": 90, "y": 90 + }, + "facing=north,redstone_locked=true": { + "model": "steampowered:block/dynamo/block_locked", + "y": 180 + }, + "facing=south,redstone_locked=true": { + "model": "steampowered:block/dynamo/block_locked", + "y": 0 + }, + "facing=west,redstone_locked=true": { + "model": "steampowered:block/dynamo/block_locked", + "y": 90 + }, + "facing=east,redstone_locked=true": { + "model": "steampowered:block/dynamo/block_locked", "y": 270 } } diff --git a/src/main/resources/assets/steampowered/lang/en_us.json b/src/main/resources/assets/steampowered/lang/en_us.json index 56758c4..457ee80 100644 --- a/src/main/resources/assets/steampowered/lang/en_us.json +++ b/src/main/resources/assets/steampowered/lang/en_us.json @@ -40,20 +40,13 @@ "tooltip.steampowered.steam_engine.not_enough_steam": "Status: Not Enough Steam", "tooltip.steampowered.steam_engine.running": "Status: Running", - "item.steampowered.multimeter": "Multimeter", - "item.steampowered.multimeter.title":"[Multimeter]:", - "item.steampowered.multimeter.measuring":"[Measuring..]", - "item.steampowered.multimeter.ticks":"ticks", - "item.steampowered.multimeter.no_capability":"No Forge Energy capability on this side.", - "item.steampowered.multimeter.tooltip.summary": "Measures capacity and input/output on any side with a Forge Energy capability.", - "block.steampowered.alternator": "Dynamo", - "block.steampowered.alternator.tooltip.summary": "Generates FE from SU. The amount of energy produced is based on RPM.", + "block.steampowered.dynamo.tooltip.summary": "Generates FE from SU. The amount of energy produced is based on RPM.", - "steampowered.ponder.alternator.header": "Generating Electric energy using an Alternator", - "steampowered.ponder.alternator.text_1": "The Alternator requires at least 32 RPM to operate", - "steampowered.ponder.alternator.text_2": "It generates electric energy (FE) from rotational force", - "steampowered.ponder.alternator.text_3": "It's energy production is determined by the input RPM", + "steampowered.ponder.dynamo.header": "Generating Electric energy using a Dynamo", + "steampowered.ponder.dynamo.text_1": "The Dynamo requires at least 32 RPM to operate", + "steampowered.ponder.dynamo.text_2": "It generates electric energy (FE) from rotational force", + "steampowered.ponder.dynamo.text_3": "It's energy production is determined by the input RPM", "steampowered.ponder.tag.steam": "Steam", "steampowered.ponder.tag.steam.description": "Components related to steam production and usage", diff --git a/src/main/resources/assets/steampowered/lang/ja_jp.json b/src/main/resources/assets/steampowered/lang/ja_jp.json index f1629bc..111b1d2 100644 --- a/src/main/resources/assets/steampowered/lang/ja_jp.json +++ b/src/main/resources/assets/steampowered/lang/ja_jp.json @@ -16,12 +16,12 @@ "block.steampowered.bronze_large_cogwheel": "青銅の大きな歯車", "block.steampowered.cast_iron_large_cogwheel": "鋳鉄の大きな歯車", "block.steampowered.steel_large_cogwheel": "鋼鉄の大きな歯車", - "block.steampowered.bronze_boiler" : "Bronze Boiler", - "block.steampowered.cast_iron_boiler" : "Cast Iron Boiler", - "block.steampowered.steel_boiler" : "Steel Boiler", - "block.steampowered.bronze_burner" : "Bronze Burning Chamber", - "block.steampowered.cast_iron_burner" : "Cast Iron Burning Chamber", - "block.steampowered.steel_burner" : "Steel Burning Chamber", + "block.steampowered.bronze_boiler": "Bronze Boiler", + "block.steampowered.cast_iron_boiler": "Cast Iron Boiler", + "block.steampowered.steel_boiler": "Steel Boiler", + "block.steampowered.bronze_burner": "Bronze Burning Chamber", + "block.steampowered.cast_iron_burner": "Cast Iron Burning Chamber", + "block.steampowered.steel_burner": "Steel Burning Chamber", "fluid.steampowered.steam": "蒸気", "fluid.steampowered.steam_following": "蒸気", @@ -40,28 +40,31 @@ "tooltip.steampowered.steam_engine.not_enough_steam": "状態: 蒸気不足", "tooltip.steampowered.steam_engine.running": "状態: 稼働中", - "item.steampowered.multimeter": "マルチメーター", - "item.steampowered.multimeter.title":"[マルチメーター]:", - "item.steampowered.multimeter.measuring":"[計測中..]", - "item.steampowered.multimeter.ticks":"ticks", - "item.steampowered.multimeter.no_capability":"この面にはForge Energyの機能はありません", - "item.steampowered.multimeter.tooltip.summary": "_Forge Energy機能_を持つ任意の面の_容量と_入出力_を計測します", - "block.steampowered.alternator": "オルタネーター", - "block.steampowered.alternator.tooltip.summary": "_su_から_FE_を発電します。発電量は_rpm_で決まります", + "block.steampowered.dynamo.tooltip.summary": "_su_から_FE_を発電します。発電量は_rpm_で決まります", - "steampowered.ponder.alternator.header": "オルタネーターによる発電", - "steampowered.ponder.alternator.text_1": "オルタネーターの動作には最低でも32RPMが必要です", - "steampowered.ponder.alternator.text_2": "回転力で電気(FE)を発電します", - "steampowered.ponder.alternator.text_3": "発電量は供給される_RPM_(回転速度)で決まります", + "steampowered.ponder.dynamo.header": "オルタネーターによる発電", + "steampowered.ponder.dynamo.text_1": "オルタネーターの動作には最低でも32RPMが必要です", + "steampowered.ponder.dynamo.text_2": "回転力で電気(FE)を発電します", + "steampowered.ponder.dynamo.text_3": "発電量は供給される_RPM_(回転速度)で決まります", "steampowered.ponder.tag.steam": "蒸気", "steampowered.ponder.tag.steam.description": "蒸気を生成・利用する機械", + "tooltip.steampowered.burner.hu": "Heat Remaining: %s HU", + "tooltip.steampowered.burner.item": "Fuel Remaining: %s x %s", + "tooltip.steampowered.burner.huproduce": "Generates %s HU/t", + "tooltip.steampowered.burner.danger": "Caution! Standing on when burning causes damage!", + + "tooltip.steampowered.boiler.huconsume": "Maximum Heat Intake %s HU/t", + "tooltip.steampowered.boiler.waterconsume": "Requires Water %s mb/t", + "tooltip.steampowered.boiler.steamproduce": "Maximum Steam Output %s mb/t", + "tooltip.steampowered.boiler.danger": "Caution! Standing on when working causes damage!", + "steampowered.ponder.boiler.header": "Generating Steam through Boilers and Burning Chambers", "steampowered.ponder.boiler.text_1": "The Boiler needs water to produce Steam", "steampowered.ponder.boiler.text_2": "The Burning Chamber needs furnace fuel to heat the Boiler", "steampowered.ponder.boiler.text_3": "Right click with fuel item such as Coal or Planks to provide it with fuel", "steampowered.ponder.boiler.text_4": "Right click with empty hand to take out the remaining fuel", "steampowered.ponder.boiler.text_5": "Pump the steam out of the boiler to power the Steam Engines" -} +} \ No newline at end of file diff --git a/src/main/resources/assets/steampowered/lang/zh_cn.json b/src/main/resources/assets/steampowered/lang/zh_cn.json index 217cce0..8a7f9a7 100644 --- a/src/main/resources/assets/steampowered/lang/zh_cn.json +++ b/src/main/resources/assets/steampowered/lang/zh_cn.json @@ -40,20 +40,13 @@ "tooltip.steampowered.steam_engine.not_enough_steam": "状态:蒸汽不足", "tooltip.steampowered.steam_engine.running": "状态:工作中", - "item.steampowered.multimeter": "万用表", - "item.steampowered.multimeter.title":"[万用表]:", - "item.steampowered.multimeter.measuring":"[测量中..]", - "item.steampowered.multimeter.ticks":"刻", - "item.steampowered.multimeter.no_capability":"此面不支持 FE 功能", - "item.steampowered.multimeter.tooltip.summary": "测量任何一个有 FE 功能的面的容量与输入/输出", - "block.steampowered.alternator": "发电机", - "block.steampowered.alternator.tooltip.summary": "从应力产生 FE 能量,基于转速。", + "block.steampowered.dynamo.tooltip.summary": "从应力产生 FE 能量,基于转速。", - "steampowered.ponder.alternator.header": "使用交流发电机发电", - "steampowered.ponder.alternator.text_1": "交流发电机需要至少 32 rpm 的转速才能工作", - "steampowered.ponder.alternator.text_2": "它从旋转动力中产生电能(FE)", - "steampowered.ponder.alternator.text_3": "它产生能量的多少是由输入的转速决定的", + "steampowered.ponder.dynamo.header": "使用发电机发电", + "steampowered.ponder.dynamo.text_1": "发电机需要至少 32 rpm 的转速才能工作", + "steampowered.ponder.dynamo.text_2": "它从旋转动力中产生电能(FE)", + "steampowered.ponder.dynamo.text_3": "它产生能量的多少是由输入的转速决定的", "steampowered.ponder.tag.steam": "蒸汽", "steampowered.ponder.tag.steam.description": "使用或生产蒸汽的组件", diff --git a/src/main/resources/assets/steampowered/models/block/alternator/block.json b/src/main/resources/assets/steampowered/models/block/dynamo/block.json similarity index 92% rename from src/main/resources/assets/steampowered/models/block/alternator/block.json rename to src/main/resources/assets/steampowered/models/block/dynamo/block.json index ff9eb6f..6390cb2 100644 --- a/src/main/resources/assets/steampowered/models/block/alternator/block.json +++ b/src/main/resources/assets/steampowered/models/block/dynamo/block.json @@ -2,8 +2,8 @@ "credit": "Made with Blockbench, by goumo_g", "texture_size": [32, 32], "textures": { - "0": "steampowered:block/alternator/alternator", - "particle": "steampowered:block/alternator/alternator" + "0": "steampowered:block/dynamo/dynamo", + "particle": "steampowered:block/dynamo/dynamo" }, "elements": [ { diff --git a/src/main/resources/assets/steampowered/models/block/dynamo/block_locked.json b/src/main/resources/assets/steampowered/models/block/dynamo/block_locked.json new file mode 100644 index 0000000..f5c710b --- /dev/null +++ b/src/main/resources/assets/steampowered/models/block/dynamo/block_locked.json @@ -0,0 +1,46 @@ +{ + "credit": "Made with Blockbench, by goumo_g", + "texture_size": [32, 32], + "textures": { + "0": "steampowered:block/dynamo/dynamo_locked", + "particle": "steampowered:block/dynamo/dynamo" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 3, 16], + "faces": { + "north": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "east": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "south": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "west": {"uv": [8, 0, 16, 1.5], "texture": "#0"}, + "up": {"uv": [0, 0, 8, 8], "texture": "#0"}, + "down": {"uv": [0, 0, 8, 8], "texture": "#0"} + } + }, + { + "from": [3, 3, 1], + "to": [13, 14, 12], + "faces": { + "north": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"}, + "east": {"uv": [5.5, 8, 0, 13.5], "texture": "#0"}, + "south": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"}, + "west": {"uv": [0, 8, 5.5, 13.5], "texture": "#0"}, + "up": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"}, + "down": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"} + } + }, + { + "from": [2, 3, 12], + "to": [14, 15, 16], + "faces": { + "north": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"}, + "east": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"}, + "south": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"}, + "west": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"}, + "up": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/steampowered/models/block/alternator/item.json b/src/main/resources/assets/steampowered/models/block/dynamo/item.json similarity index 94% rename from src/main/resources/assets/steampowered/models/block/alternator/item.json rename to src/main/resources/assets/steampowered/models/block/dynamo/item.json index 80fbdfa..6219e64 100644 --- a/src/main/resources/assets/steampowered/models/block/alternator/item.json +++ b/src/main/resources/assets/steampowered/models/block/dynamo/item.json @@ -2,8 +2,8 @@ "credit": "Made with Blockbench, by goumo_g", "texture_size": [32, 32], "textures": { - "0": "steampowered:block/alternator/alternator", - "particle": "steampowered:block/alternator/alternator", + "0": "steampowered:block/dynamo/dynamo", + "particle": "steampowered:block/dynamo/dynamo", "2": "create:block/axis", "3": "create:block/axis_top" }, diff --git a/src/main/resources/assets/steampowered/ponder/alternator.nbt b/src/main/resources/assets/steampowered/ponder/dynamo.nbt similarity index 100% rename from src/main/resources/assets/steampowered/ponder/alternator.nbt rename to src/main/resources/assets/steampowered/ponder/dynamo.nbt diff --git a/src/main/resources/assets/steampowered/textures/block/alternator/alternator.png b/src/main/resources/assets/steampowered/textures/block/dynamo/dynamo.png similarity index 100% rename from src/main/resources/assets/steampowered/textures/block/alternator/alternator.png rename to src/main/resources/assets/steampowered/textures/block/dynamo/dynamo.png diff --git a/src/main/resources/assets/steampowered/textures/block/alternator/alternator_powered.png b/src/main/resources/assets/steampowered/textures/block/dynamo/dynamo_locked.png similarity index 100% rename from src/main/resources/assets/steampowered/textures/block/alternator/alternator_powered.png rename to src/main/resources/assets/steampowered/textures/block/dynamo/dynamo_locked.png From 3b2a0421a2f7d9caac6c776f74332a8d1052e189 Mon Sep 17 00:00:00 2001 From: yuesha-yc Date: Tue, 26 Oct 2021 00:58:51 -0700 Subject: [PATCH 4/7] Shaft --- .../models/block/dynamo/shaft.json | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/resources/assets/steampowered/models/block/dynamo/shaft.json diff --git a/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json b/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json new file mode 100644 index 0000000..78880a1 --- /dev/null +++ b/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json @@ -0,0 +1,25 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "0": "create:block/axis", + "1": "create:block/axis_top", + "particle": "create:block/axis" + }, + "elements": [ + { + "name": "Axis", + "from": [6, 6, 8], + "to": [10, 10, 16], + "shade": false, + "faces": { + "north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1"}, + "east": {"uv": [6, 0, 10, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [6, 6, 10, 10], "texture": "#1"}, + "west": {"uv": [6, 0, 10, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [6, 0, 10, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 0, 10, 8], "texture": "#0"} + } + } + ] +} \ No newline at end of file From c53b4fb3696c6ac39c49a0e4b5a1b4c21a2b549e Mon Sep 17 00:00:00 2001 From: yuesha-yc Date: Tue, 26 Oct 2021 01:22:13 -0700 Subject: [PATCH 5/7] Dynamo finished --- .../steampowered/block/SPBlockPartials.java | 2 ++ .../client/render/DynamoRenderer.java | 3 ++- .../content/alternator/DynamoBlock.java | 11 +++++--- .../content/alternator/DynamoTileEntity.java | 25 +++++++++++-------- .../assets/steampowered/lang/en_us.json | 5 ++-- .../assets/steampowered/lang/ja_jp.json | 8 +++--- .../assets/steampowered/lang/zh_cn.json | 5 ++-- .../models/block/dynamo/shaft.json | 4 +-- .../steampowered/models/item/alternator.json | 2 +- 9 files changed, 39 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/teammoeg/steampowered/block/SPBlockPartials.java b/src/main/java/com/teammoeg/steampowered/block/SPBlockPartials.java index 81f2b28..abd07e7 100644 --- a/src/main/java/com/teammoeg/steampowered/block/SPBlockPartials.java +++ b/src/main/java/com/teammoeg/steampowered/block/SPBlockPartials.java @@ -40,6 +40,8 @@ public class SPBlockPartials { public static final PartialModel STEEL_FLYWHEEL_UPPER_SLIDING = get("steel_flywheel/upper_sliding_connector"); public static final PartialModel STEEL_FLYWHEEL_LOWER_SLIDING = get("steel_flywheel/lower_sliding_connector"); + public static final PartialModel DYNAMO_SHAFT = get("dynamo/shaft"); + private static PartialModel get(String path) { return new PartialModel(new ResourceLocation("steampowered", "block/" + path)); } diff --git a/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java b/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java index 912661f..f02170a 100644 --- a/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java +++ b/src/main/java/com/teammoeg/steampowered/client/render/DynamoRenderer.java @@ -23,6 +23,7 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.foundation.render.PartialBufferer; import com.simibubi.create.foundation.render.SuperByteBuffer; +import com.teammoeg.steampowered.block.SPBlockPartials; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; public class DynamoRenderer extends KineticTileEntityRenderer { @@ -33,6 +34,6 @@ public class DynamoRenderer extends KineticTileEntityRenderer { @Override protected SuperByteBuffer getRotatedModel(KineticTileEntity te) { - return PartialBufferer.getFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState()); + return PartialBufferer.getFacing(SPBlockPartials.DYNAMO_SHAFT, te.getBlockState()); } } diff --git a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java index 5b7e210..ab68519 100644 --- a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java +++ b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java @@ -62,12 +62,15 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE lazyEnergy; private boolean redstoneLocked = false; - private static final int - MAX_FE_OUT = SPConfig.COMMON.dynamoFeMaxOut.get(), // FE Output - FE_CAPACITY = SPConfig.COMMON.dynamoFeCapacity.get(), // FE Storage - IMPACT = SPConfig.COMMON.dynamoImpact.get(); // Impact on network - private static final double - EFFICIENCY = SPConfig.COMMON.dynamoEfficiency.get(); + public static final int MAX_FE_OUT = SPConfig.COMMON.dynamoFeMaxOut.get(); // FE Output + public static final int FE_CAPACITY = SPConfig.COMMON.dynamoFeCapacity.get(); // FE Storage + public static final int IMPACT = SPConfig.COMMON.dynamoImpact.get(); // Impact on network + public static final double EFFICIENCY = SPConfig.COMMON.dynamoEfficiency.get(); // Efficiency public DynamoTileEntity(TileEntityType typeIn) { super(typeIn); @@ -67,10 +65,15 @@ public class DynamoTileEntity extends KineticTileEntity { @Override public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneaking) { - tooltip.add(new StringTextComponent(spacing).append(new TranslationTextComponent(SteamPowered.MODID + ".tooltip.energy.production").withStyle(TextFormatting.GRAY))); - tooltip.add(new StringTextComponent(spacing).append(new StringTextComponent(" " + format(getEnergyProductionRate((int) (isSpeedRequirementFulfilled() ? getSpeed() : 0))) + "fe/t ") // fix - .withStyle(TextFormatting.AQUA)).append(Lang.translate("gui.goggles.at_current_speed").withStyle(TextFormatting.DARK_GRAY))); - return super.addToGoggleTooltip(tooltip, isPlayerSneaking); + if (this.getBlockState().getValue(DynamoBlock.REDSTONE_LOCKED)) { + tooltip.add(new StringTextComponent(spacing).append(new TranslationTextComponent("tooltip.steampowered.dynamo.locked").withStyle(TextFormatting.RED))); + return true; + } else { + tooltip.add(new StringTextComponent(spacing).append(new TranslationTextComponent("tooltip.steampowered.energy.production").withStyle(TextFormatting.GRAY))); + tooltip.add(new StringTextComponent(spacing).append(new StringTextComponent(" " + format(getEnergyProductionRate((int) (isSpeedRequirementFulfilled() ? getSpeed() : 0))) + "fe/t ") // fix + .withStyle(TextFormatting.AQUA)).append(Lang.translate("gui.goggles.at_current_speed").withStyle(TextFormatting.DARK_GRAY))); + return super.addToGoggleTooltip(tooltip, isPlayerSneaking); + } } private static String format(int n) { @@ -99,7 +102,7 @@ public class DynamoTileEntity extends KineticTileEntity { } public boolean isEnergyOutput(Direction side) { - return side != getBlockState().getValue(DynamoBlock.FACING); + return side != getBlockState().getValue(DynamoBlock.FACING).getOpposite(); } @Override diff --git a/src/main/resources/assets/steampowered/lang/en_us.json b/src/main/resources/assets/steampowered/lang/en_us.json index 457ee80..82fd7bb 100644 --- a/src/main/resources/assets/steampowered/lang/en_us.json +++ b/src/main/resources/assets/steampowered/lang/en_us.json @@ -36,11 +36,12 @@ "steampowered.ponder.flywheel.text_2": "The provided Rotational Force has a very large stress capacity", "steampowered.ponder.flywheel.text_3": "Using Flywheels made of Steel or Cast Iron will increase efficiency and generated capacity of the Flywheel", - "steampowered.tooltip.energy.production": "Energy Generated:", + "tooltip.steampowered.energy.production": "Energy Generated:", "tooltip.steampowered.steam_engine.not_enough_steam": "Status: Not Enough Steam", "tooltip.steampowered.steam_engine.running": "Status: Running", + "tooltip.steampowered.dynamo.locked": "Status: Redstone Locked", - "block.steampowered.alternator": "Dynamo", + "block.steampowered.alternator": "Basic Dynamo", "block.steampowered.dynamo.tooltip.summary": "Generates FE from SU. The amount of energy produced is based on RPM.", "steampowered.ponder.dynamo.header": "Generating Electric energy using a Dynamo", diff --git a/src/main/resources/assets/steampowered/lang/ja_jp.json b/src/main/resources/assets/steampowered/lang/ja_jp.json index 111b1d2..5cf44b9 100644 --- a/src/main/resources/assets/steampowered/lang/ja_jp.json +++ b/src/main/resources/assets/steampowered/lang/ja_jp.json @@ -36,11 +36,12 @@ "steampowered.ponder.flywheel.text_2": "生成される回転力は非常に大きな応力容量を持っています", "steampowered.ponder.flywheel.text_3": "鋼鉄や鋳鉄の勢車を使うと、勢車の効率や生成される応力容量が向上します", - "steampowered.tooltip.energy.production": "エネルギー生成量:", + "tooltip.steampowered.energy.production": "エネルギー生成量:", "tooltip.steampowered.steam_engine.not_enough_steam": "状態: 蒸気不足", "tooltip.steampowered.steam_engine.running": "状態: 稼働中", + "tooltip.steampowered.dynamo.locked": "Status: Redstone Locked", - "block.steampowered.alternator": "オルタネーター", + "block.steampowered.alternator": "Basic オルタネーター", "block.steampowered.dynamo.tooltip.summary": "_su_から_FE_を発電します。発電量は_rpm_で決まります", "steampowered.ponder.dynamo.header": "オルタネーターによる発電", @@ -66,5 +67,6 @@ "steampowered.ponder.boiler.text_2": "The Burning Chamber needs furnace fuel to heat the Boiler", "steampowered.ponder.boiler.text_3": "Right click with fuel item such as Coal or Planks to provide it with fuel", "steampowered.ponder.boiler.text_4": "Right click with empty hand to take out the remaining fuel", - "steampowered.ponder.boiler.text_5": "Pump the steam out of the boiler to power the Steam Engines" + "steampowered.ponder.boiler.text_5": "Pump the steam out of the boiler to power the Steam Engines", + "tooltip.steampowered.dynamo.redstone_locked": "状態: Redstone Locked" } \ No newline at end of file diff --git a/src/main/resources/assets/steampowered/lang/zh_cn.json b/src/main/resources/assets/steampowered/lang/zh_cn.json index 8a7f9a7..8441afb 100644 --- a/src/main/resources/assets/steampowered/lang/zh_cn.json +++ b/src/main/resources/assets/steampowered/lang/zh_cn.json @@ -36,11 +36,12 @@ "steampowered.ponder.flywheel.text_2": "如此产生的旋转力具有非常大的应力值", "steampowered.ponder.flywheel.text_3": "使用钢或者铸铁制作的的蒸汽飞轮会使得飞轮效率和产能提升", - "steampowered.tooltip.energy.production": "已产生的能量:", + "tooltip.steampowered.energy.production": "已产生的能量:", "tooltip.steampowered.steam_engine.not_enough_steam": "状态:蒸汽不足", "tooltip.steampowered.steam_engine.running": "状态:工作中", + "tooltip.steampowered.dynamo.locked": "状态: 红石锁定", - "block.steampowered.alternator": "发电机", + "block.steampowered.alternator": "基础发电机", "block.steampowered.dynamo.tooltip.summary": "从应力产生 FE 能量,基于转速。", "steampowered.ponder.dynamo.header": "使用发电机发电", diff --git a/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json b/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json index 78880a1..9a34d03 100644 --- a/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json +++ b/src/main/resources/assets/steampowered/models/block/dynamo/shaft.json @@ -9,8 +9,8 @@ "elements": [ { "name": "Axis", - "from": [6, 6, 8], - "to": [10, 10, 16], + "from": [6, 6, 0], + "to": [10, 10, 8], "shade": false, "faces": { "north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#1"}, diff --git a/src/main/resources/assets/steampowered/models/item/alternator.json b/src/main/resources/assets/steampowered/models/item/alternator.json index a87ea01..fb48f29 100644 --- a/src/main/resources/assets/steampowered/models/item/alternator.json +++ b/src/main/resources/assets/steampowered/models/item/alternator.json @@ -1,5 +1,5 @@ { - "parent": "steampowered:block/alternator/item", + "parent": "steampowered:block/dynamo/item", "display": { "gui": { "rotation": [ 30, 45, 0 ], From c361c34fbda186459b3ef5a19830afb52aa9afbb Mon Sep 17 00:00:00 2001 From: yuesha-yc Date: Tue, 26 Oct 2021 02:25:46 -0700 Subject: [PATCH 6/7] Ponder scene completely refined --- .../content/alternator/DynamoBlock.java | 1 - .../content/alternator/DynamoTileEntity.java | 15 +++-- .../steampowered/ponder/SPScenes.java | 58 +++++++++++++++--- .../assets/steampowered/lang/en_us.json | 9 +-- .../assets/steampowered/lang/ja_jp.json | 9 +-- .../assets/steampowered/lang/zh_cn.json | 9 +-- .../assets/steampowered/ponder/dynamo.nbt | Bin 685 -> 721 bytes .../data/steampowered/recipes/alternator.json | 30 +++++++++ 8 files changed, 100 insertions(+), 31 deletions(-) create mode 100644 src/main/resources/data/steampowered/recipes/alternator.json diff --git a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java index ab68519..7bb96a8 100644 --- a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java +++ b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoBlock.java @@ -128,7 +128,6 @@ public class DynamoBlock extends DirectionalKineticBlock implements ITE t, ITooltipFlag f) { - t.add(new TranslationTextComponent("block.steampowered.dynamo.tooltip.summary").withStyle(TextFormatting.GRAY)); t.add(new StringTextComponent("We adapt and appreciate MRH0's code").withStyle(TextFormatting.GRAY)); if (ModList.get().isLoaded("createaddition")) { if (SPConfig.SERVER.disableDynamo.get()) { diff --git a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java index c26dd25..95c9c3c 100644 --- a/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java +++ b/src/main/java/com/teammoeg/steampowered/content/alternator/DynamoTileEntity.java @@ -22,7 +22,6 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.foundation.utility.Lang; import com.teammoeg.steampowered.SPConfig; -import com.teammoeg.steampowered.SteamPowered; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; @@ -86,8 +85,13 @@ public class DynamoTileEntity extends KineticTileEntity { @Override public float calculateStressApplied() { - this.lastStressApplied = IMPACT; - return IMPACT; + if (getBlockState().getValue(DynamoBlock.REDSTONE_LOCKED)) { + this.lastStressApplied = 0; + return 0; + } else { + this.lastStressApplied = IMPACT; + return IMPACT; + } } @Override @@ -153,11 +157,6 @@ public class DynamoTileEntity extends KineticTileEntity { return (int) (Math.abs(rpm) * EFFICIENCY); } - @Override - protected Block getStressConfigKey() { - return AllBlocks.MECHANICAL_MIXER.get(); - } - @Override public void setRemoved() { super.setRemoved(); diff --git a/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java b/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java index c5a6877..173940a 100644 --- a/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java +++ b/src/main/java/com/teammoeg/steampowered/ponder/SPScenes.java @@ -25,9 +25,13 @@ import com.simibubi.create.foundation.ponder.Selection; import com.simibubi.create.foundation.ponder.content.PonderPalette; import com.simibubi.create.foundation.ponder.elements.InputWindowElement; import com.simibubi.create.foundation.utility.Pointing; +import com.teammoeg.steampowered.content.alternator.DynamoBlock; import com.teammoeg.steampowered.content.burner.BurnerBlock; import com.teammoeg.steampowered.content.engine.SteamEngineBlock; import com.teammoeg.steampowered.registrate.SPBlocks; +import net.minecraft.block.LeverBlock; +import net.minecraft.block.RedstoneBlock; +import net.minecraft.block.RedstoneWireBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.Direction; @@ -198,33 +202,67 @@ public class SPScenes { scene.title("dynamo", "Generating Electric energy using a Dynamo"); scene.configureBasePlate(1, 0, 4); scene.world.showSection(util.select.layer(0), Direction.UP); + scene.idle(10); + scene.world.showSection(util.select.layer(1), Direction.UP); + scene.idle(10); + scene.world.showSection(util.select.layer(2), Direction.UP); + scene.idle(10); BlockPos generator = util.grid.at(3, 1, 2); + BlockPos shaft = util.grid.at(2, 1, 2); + BlockPos gauge = util.grid.at(1, 1, 2); + BlockPos cogwheel = util.grid.at(0, 1, 2); + BlockPos largecog = util.grid.at(0, 2, 3); + BlockPos redstone = util.grid.at(3, 1, 1); + BlockPos lever = util.grid.at(3, 1, 0); - for (int i = 0; i < 6; i++) { - scene.idle(5); - scene.world.showSection(util.select.position(i, 1, 2), Direction.DOWN); - //scene.world.showSection(util.select.position(i, 2, 2), Direction.DOWN); - } + scene.world.setKineticSpeed(util.select.position(largecog), 16.0F); + scene.idle(5); + scene.world.setKineticSpeed(util.select.position(cogwheel), 32.0F); + scene.idle(5); + scene.world.setKineticSpeed(util.select.position(shaft), 32.0F); + scene.idle(5); + scene.world.setKineticSpeed(util.select.position(generator), 32.0F); + scene.idle(5); - scene.idle(10); scene.overlay.showText(50) + .attachKeyFrame() .text("The Dynamo generates electric energy (fe) from rotational force") .placeNearTarget() .pointAt(util.vector.topOf(generator)); scene.idle(60); - scene.overlay.showText(50) - .text("It requires atleast 32 RPM to operate") - .placeNearTarget() - .pointAt(util.vector.topOf(generator)); + scene.effects.rotationSpeedIndicator(cogwheel); scene.idle(60); + scene.overlay.showText(50) + .text("It requires at least 32 RPM to operate") + .placeNearTarget() + .pointAt(util.vector.topOf(cogwheel)); + scene.idle(60); scene.overlay.showText(50) .text("The Dynamos energy production is determined by the input RPM") .placeNearTarget() .pointAt(util.vector.topOf(generator)); scene.idle(60); + + scene.overlay.showText(50) + .text("It has conversion efficiency of 75 Percent") + .placeNearTarget() + .pointAt(util.vector.topOf(generator)); + scene.idle(60); + + scene.overlay.showText(50) + .attachKeyFrame() + .text("You can lock the Dynamo with redstone signal so it will not apply stress to the network") + .placeNearTarget() + .pointAt(util.vector.centerOf(lever)); + scene.idle(60); + + scene.world.modifyBlock(lever, s -> s.setValue(LeverBlock.POWERED, true), false); + scene.world.modifyBlock(redstone, s -> s.setValue(RedstoneWireBlock.POWER, 15), false); + scene.world.modifyBlock(generator, s -> s.setValue(DynamoBlock.REDSTONE_LOCKED, true), false); + scene.idle(60); } } diff --git a/src/main/resources/assets/steampowered/lang/en_us.json b/src/main/resources/assets/steampowered/lang/en_us.json index 82fd7bb..604b3d7 100644 --- a/src/main/resources/assets/steampowered/lang/en_us.json +++ b/src/main/resources/assets/steampowered/lang/en_us.json @@ -41,13 +41,14 @@ "tooltip.steampowered.steam_engine.running": "Status: Running", "tooltip.steampowered.dynamo.locked": "Status: Redstone Locked", - "block.steampowered.alternator": "Basic Dynamo", - "block.steampowered.dynamo.tooltip.summary": "Generates FE from SU. The amount of energy produced is based on RPM.", + "block.steampowered.alternator": "Alternating Dynamo", "steampowered.ponder.dynamo.header": "Generating Electric energy using a Dynamo", - "steampowered.ponder.dynamo.text_1": "The Dynamo requires at least 32 RPM to operate", - "steampowered.ponder.dynamo.text_2": "It generates electric energy (FE) from rotational force", + "steampowered.ponder.dynamo.text_1": "The Dynamo generates electric energy (FE) from rotational force", + "steampowered.ponder.dynamo.text_2": "It requires at least 32 RPM to operate", "steampowered.ponder.dynamo.text_3": "It's energy production is determined by the input RPM", + "steampowered.ponder.dynamo.text_4": "It has conversion efficiency of 75 Percent", + "steampowered.ponder.dynamo.text_5": "You can lock the Dynamo with redstone signal so it will not apply stress to the network", "steampowered.ponder.tag.steam": "Steam", "steampowered.ponder.tag.steam.description": "Components related to steam production and usage", diff --git a/src/main/resources/assets/steampowered/lang/ja_jp.json b/src/main/resources/assets/steampowered/lang/ja_jp.json index 5cf44b9..1ebfa48 100644 --- a/src/main/resources/assets/steampowered/lang/ja_jp.json +++ b/src/main/resources/assets/steampowered/lang/ja_jp.json @@ -41,13 +41,14 @@ "tooltip.steampowered.steam_engine.running": "状態: 稼働中", "tooltip.steampowered.dynamo.locked": "Status: Redstone Locked", - "block.steampowered.alternator": "Basic オルタネーター", - "block.steampowered.dynamo.tooltip.summary": "_su_から_FE_を発電します。発電量は_rpm_で決まります", + "block.steampowered.alternator": "オルタネーター Dynamo", "steampowered.ponder.dynamo.header": "オルタネーターによる発電", - "steampowered.ponder.dynamo.text_1": "オルタネーターの動作には最低でも32RPMが必要です", - "steampowered.ponder.dynamo.text_2": "回転力で電気(FE)を発電します", + "steampowered.ponder.dynamo.text_1": "回転力で電気(FE)を発電します", + "steampowered.ponder.dynamo.text_2": "オルタネーターの動作には最低でも32RPMが必要です", "steampowered.ponder.dynamo.text_3": "発電量は供給される_RPM_(回転速度)で決まります", + "steampowered.ponder.dynamo.text_4": "It has conversion efficiency of 75 Percent", + "steampowered.ponder.dynamo.text_5": "You can lock the Dynamo with redstone signal so it will not apply stress to the network", "steampowered.ponder.tag.steam": "蒸気", "steampowered.ponder.tag.steam.description": "蒸気を生成・利用する機械", diff --git a/src/main/resources/assets/steampowered/lang/zh_cn.json b/src/main/resources/assets/steampowered/lang/zh_cn.json index 8441afb..7261ea2 100644 --- a/src/main/resources/assets/steampowered/lang/zh_cn.json +++ b/src/main/resources/assets/steampowered/lang/zh_cn.json @@ -41,13 +41,14 @@ "tooltip.steampowered.steam_engine.running": "状态:工作中", "tooltip.steampowered.dynamo.locked": "状态: 红石锁定", - "block.steampowered.alternator": "基础发电机", - "block.steampowered.dynamo.tooltip.summary": "从应力产生 FE 能量,基于转速。", + "block.steampowered.alternator": "交流式发电机", "steampowered.ponder.dynamo.header": "使用发电机发电", - "steampowered.ponder.dynamo.text_1": "发电机需要至少 32 rpm 的转速才能工作", - "steampowered.ponder.dynamo.text_2": "它从旋转动力中产生电能(FE)", + "steampowered.ponder.dynamo.text_1": "发电机从旋转动力中产生电能(FE)", + "steampowered.ponder.dynamo.text_2": "它需要至少 32 rpm 的转速才能工作", "steampowered.ponder.dynamo.text_3": "它产生能量的多少是由输入的转速决定的", + "steampowered.ponder.dynamo.text_4": "它的能量转化效率是百分之七十五", + "steampowered.ponder.dynamo.text_5": "你可以用红石信号锁定发电机,这样它就不会对动力网络造成压力了", "steampowered.ponder.tag.steam": "蒸汽", "steampowered.ponder.tag.steam.description": "使用或生产蒸汽的组件", diff --git a/src/main/resources/assets/steampowered/ponder/dynamo.nbt b/src/main/resources/assets/steampowered/ponder/dynamo.nbt index 232d874c9a541792535d7fdb08d53f595eb89551..baa86d7767088bb8a92e524df4c3d8b30bbb2b07 100644 GIT binary patch literal 721 zcmb2|=3sz;wbSqBUp5dq`uD2d+Xh7zsV4S$70)Zze`sr&FyWh2<;&cxvs;yqt2XbK zQ=dI~jrX0^ogtx9o;rXqoVBf5&UllLsoEie6a~8{UF}L08cph1ezD@qXGk{9RD=`CGc22CLJ8KUNQD_-;;72!Sp~(9 z#Zx}6X1cLuhh$=wv)whhC;K+>THJ_vd(eBX__mxfhN@=|4cKCMj$IFu-}U_ZWu<&B zcE|eA?Yna|nDi=Yw%*!xuJqS3`*oY=&VafJ|-Kr7=Pv>`<{ct(^roQ*^N0o@y`;n@q75s0j|5zzM zYQMu=xu3sL#4qn}=;mO#rj?wXt&Q3VnAH~c{n_@Z zW^bo$%)24P+tU(T=(PV!sb0HPVZ&!PON({o_gZ-7ZcDXv6943PwdLN|y!mpx0fGX> zPuEDYy*y$1?HpgITio`%omZ|+`5Crz+O6G(4cLUmPkh#hcUc^pQO&oK+d^5qR;%z{ v`8wx1!IBdvf11C1YPusTQdsR1`zL-Kb$kCad<+Z#qC8s1 literal 685 zcmb2|=3sz;z0*(UT`>@8>(@Vd$05fdMlLlXw1m-V)dV-E1IvmgU!Iv^acbP{{)8)R~fhMJX`U#mSu0Q`i|2+S3k1d--qsdKi5rzx@lL~c>{XlcIra9157{O?3m&rczPV_? z#IO8egP+~?OedS31BW>v#GC_%Ic>m1(*b1;8!$2HfHJ2|obal2&xC0#X%Xpn!#~dn z_`Ik6X7;aZtnU-kSkl(Nj25pw({tbq$C)_?&TzsA9gZ_i2Vlgc13H{%z(kSuX9<_W z1m%u2(WG6)Tm~%jmVQvV_`)Q3^4e80-={}5nt2}+IDhKARpD;;ZwoVL<*)nyqDJX@ zebIIGbNL(Ex9NQiVyd5Pc6R>cXW!RrG(FS~U8%D9_-N9+otF9+6YZL38`l5lKXW&K*&g+06=(l^oj3EQ*s~XXXYBtO8t)hU{Fys#>auq& z!D7Kvqp!4XTKcZ&KTm`#t`@DH$IlX+2!HgP-O2(RUPdqpI5Z+%??bN%<5SMOF$jJ)H2>d?^#I(r{Ioa&T%%eUl@ z-*nMe-vlgLJm1Q#|6F8uTx5~+ROu4ttAS|^vawY^vQA8$x4nPHb?zg7%HsO3#g!LV zK6qXHQ0>~*4*t8pHJ>SDn|v!e5&SqSIdrONmXCSY;k|t)*KK-boAvk Date: Tue, 26 Oct 2021 02:28:23 -0700 Subject: [PATCH 7/7] 1.1.1 Release --- build.gradle | 2 +- src/main/resources/META-INF/mods.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 0a71e6f..740cab6 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' group = 'com.teammoeg' -version = '1.16.5-1.1.0' +version = '1.16.5-1.1.1' java { archivesBaseName = 'steampowered' diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index b0a662c..29e8658 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -4,10 +4,10 @@ license = "GPLv3" issueTrackerURL = "https://github.com/TeamMoegMC/Steam-Powered/issues" [[mods]] #mandatory modId = "steampowered" #mandatory -version = "1.16.5-1.1.0" #mandatory +version = "1.16.5-1.1.1" #mandatory displayName = "Create: Steam Powered" #mandatory authors = "YueSha, khjxiaogu, goumo_g" -credits = "MRH0" +credits = "We appreciate MRH0 for his code on RPM-FE conversion logic which we adapted in Steam Powered" description = ''' Expanding Create mod to the Steam Age '''