-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Buffers (item and power) #455
Open
Trytoon
wants to merge
13
commits into
Team-EnderIO:dev/1.20.1
Choose a base branch
from
Trytoon:my6.0.11
base: dev/1.20.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ff75272
Added Buffers (item and power)
Trytoon dbdec30
Fixed buffers not being able to push items
Trytoon 43150b8
Implemented requested changes + moved I/O update code to the be
Trytoon a83c9c6
switch editBox triggers
dphaldes 1bb42c4
change syncing and only update on change focus
ferriarnus 583c2af
small tweaks
ferriarnus 82eb60f
fixed textboxes resetting when resizing screen
Trytoon 4be8067
Merge branch 'dev/1.20.1' into my6.0.11
Trytoon 7441474
Merge remote-tracking branch 'upstream/dev/1.20.1' into my6.0.11
Trytoon c8a24cf
Merge branch 'my6.0.11' of https://github.com/Trytoon/EnderIO-Rewrite…
Trytoon c2c3896
fixed UI... now it should compile too :)
Trytoon 7c4622b
I forgot datagen
Trytoon 081177e
made buffer output energy equally between sides
Trytoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/core/java/com/enderio/core/common/util/NumberUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.enderio.core.common.util; | ||
|
||
public class NumberUtils { | ||
|
||
public static int getInteger(String value) { | ||
String integerValue = value.replaceAll("[., ]", ""); | ||
|
||
try { | ||
return Integer.parseInt(integerValue); | ||
} catch(Exception e) { | ||
return 0; | ||
} | ||
} | ||
|
||
public static long getLong(String value) { | ||
String longValue = value.replaceAll("[., ]", ""); | ||
try { | ||
return Long.parseLong(longValue); | ||
} catch(Exception e) { | ||
return 0; | ||
} | ||
} | ||
|
||
public static String formatWithPrefix(int number) { | ||
if (number < 100_000) { | ||
return Long.toString(number); | ||
} else if (number < 1_000_000) { | ||
return String.format("%.1fk", number / 1_000.0); | ||
} else if (number < 1_000_000_000) { | ||
return String.format("%.3fM", number / 1_000_000.0); | ||
} else { | ||
return String.format("%.3fB", number / 1_000_000_000.0); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/assets/enderio/blockstates/item_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"variants": { | ||
"facing=east": { | ||
"model": "enderio:block/item_buffer_combined", | ||
"y": 90 | ||
}, | ||
"facing=north": { | ||
"model": "enderio:block/item_buffer_combined" | ||
}, | ||
"facing=south": { | ||
"model": "enderio:block/item_buffer_combined", | ||
"y": 180 | ||
}, | ||
"facing=west": { | ||
"model": "enderio:block/item_buffer_combined", | ||
"y": 270 | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/assets/enderio/blockstates/omni_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"variants": { | ||
"facing=east": { | ||
"model": "enderio:block/omni_buffer_combined", | ||
"y": 90 | ||
}, | ||
"facing=north": { | ||
"model": "enderio:block/omni_buffer_combined" | ||
}, | ||
"facing=south": { | ||
"model": "enderio:block/omni_buffer_combined", | ||
"y": 180 | ||
}, | ||
"facing=west": { | ||
"model": "enderio:block/omni_buffer_combined", | ||
"y": 270 | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/assets/enderio/blockstates/power_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"variants": { | ||
"facing=east": { | ||
"model": "enderio:block/power_buffer_combined", | ||
"y": 90 | ||
}, | ||
"facing=north": { | ||
"model": "enderio:block/power_buffer_combined" | ||
}, | ||
"facing=south": { | ||
"model": "enderio:block/power_buffer_combined", | ||
"y": 180 | ||
}, | ||
"facing=west": { | ||
"model": "enderio:block/power_buffer_combined", | ||
"y": 270 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/generated/resources/assets/enderio/models/block/item_buffer_combined.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"parent": "minecraft:block/block", | ||
"children": { | ||
"machine": { | ||
"parent": "enderio:block/item_buffer" | ||
}, | ||
"overlay": { | ||
"parent": "enderio:block/io_overlay" | ||
} | ||
}, | ||
"item_render_order": [ | ||
"machine", | ||
"overlay" | ||
], | ||
"loader": "forge:composite", | ||
"textures": { | ||
"particle": "enderio:block/item_buffer_front" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/assets/enderio/models/block/omni_buffer_combined.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"parent": "minecraft:block/block", | ||
"children": { | ||
"machine": { | ||
"parent": "enderio:block/omni_buffer" | ||
}, | ||
"overlay": { | ||
"parent": "enderio:block/io_overlay" | ||
} | ||
}, | ||
"item_render_order": [ | ||
"machine", | ||
"overlay" | ||
], | ||
"loader": "forge:composite", | ||
"textures": { | ||
"particle": "enderio:block/omni_buffer_front" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/assets/enderio/models/block/power_buffer_combined.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"parent": "minecraft:block/block", | ||
"children": { | ||
"machine": { | ||
"parent": "enderio:block/power_buffer" | ||
}, | ||
"overlay": { | ||
"parent": "enderio:block/io_overlay" | ||
} | ||
}, | ||
"item_render_order": [ | ||
"machine", | ||
"overlay" | ||
], | ||
"loader": "forge:composite", | ||
"textures": { | ||
"particle": "enderio:block/power_buffer_front" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/enderio/models/item/item_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "enderio:block/item_buffer" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/enderio/models/item/omni_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "enderio:block/omni_buffer" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/enderio/models/item/power_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "enderio:block/power_buffer" | ||
} |
33 changes: 33 additions & 0 deletions
33
src/generated/resources/data/enderio/advancements/recipes/misc/item_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_ingredient": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"tag": "forge:ingots/iron" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "enderio:item_buffer" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_ingredient", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"enderio:item_buffer" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
35 changes: 35 additions & 0 deletions
35
src/generated/resources/data/enderio/advancements/recipes/misc/omni_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_ingredient": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"enderio:power_buffer" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "enderio:omni_buffer" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_ingredient", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"enderio:omni_buffer" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
35 changes: 35 additions & 0 deletions
35
src/generated/resources/data/enderio/advancements/recipes/misc/power_buffer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_ingredient": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"enderio:void_chassis" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "enderio:power_buffer" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_ingredient", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"enderio:power_buffer" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Generic ENERGY_MAX_RECEIVE and ENERGY_MAX_EXTRACT instead.