Skip to content
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
wants to merge 13 commits into
base: dev/1.20.1
Choose a base branch
from
Open
8 changes: 8 additions & 0 deletions src/core/java/com/enderio/core/CoreNBTKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,12 @@ public class CoreNBTKeys {
public static final String ANCHOR_VISIBILITY = "AnchorVisibility";

//endregion

//region Buffer data

public static final String BUFFER_MAX_INPUT = "BufferMaxInput";

public static final String BUFFER_MAX_OUTPUT = "BufferMaxOutput";
Comment on lines +45 to +47
Copy link
Contributor

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.


//endregion
}
23 changes: 23 additions & 0 deletions src/core/java/com/enderio/core/common/util/NumberUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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;
}
}
}
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
}
}
}
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
}
}
}
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
}
}
}
5 changes: 5 additions & 0 deletions src/generated/resources/assets/enderio/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@
"block.enderio.hootch": "ɥɔʇooH",
"block.enderio.impulse_hopper": "ɹǝddoH ǝsןndɯI",
"block.enderio.industrial_insulation_block": "uoıʇɐןnsuI ןɐıɹʇsnpuI",
"block.enderio.item_buffer": "ɹǝɟɟnᗺ ɯǝʇI",
"block.enderio.light": "ʇɥbıꞀ",
"block.enderio.light_inverted": "pǝʇɹǝʌuI ʇɥbıꞀ",
"block.enderio.light_node": "ǝpoN ʇɥbıꞀ",
"block.enderio.liquid_sunshine": "ǝuıɥsunS pınbıꞀ",
"block.enderio.nutrient_distillation": "uoıʇɐןןıʇsıᗡ ʇuǝıɹʇnN",
"block.enderio.omni_buffer": "ɹǝɟɟnᗺ ıuɯO",
"block.enderio.painted_crafting_table": "ǝןqɐ⟘ buıʇɟɐɹƆ pǝʇuıɐԀ",
"block.enderio.painted_fence": "ǝɔuǝℲ pǝʇuıɐԀ",
"block.enderio.painted_fence_gate": "ǝʇɐ⅁ ǝɔuǝℲ pǝʇuıɐԀ",
Expand All @@ -155,6 +157,7 @@
"block.enderio.painted_trapdoor": "ɹoopdɐɹ⟘ pǝʇuıɐԀ",
"block.enderio.painted_wooden_pressure_plate": "ǝʇɐןԀ ǝɹnssǝɹԀ uǝpooM pǝʇuıɐԀ",
"block.enderio.painting_machine": "ǝuıɥɔɐW buıʇuıɐԀ",
"block.enderio.power_buffer": "ɹǝɟɟnᗺ ɹǝʍoԀ",
"block.enderio.powered_light": "ʇɥbıꞀ pǝɹǝʍoԀ",
"block.enderio.powered_light_inverted": "pǝʇɹǝʌuI ʇɥbıꞀ pǝɹǝʍoԀ",
"block.enderio.powered_light_inverted_wireless": "ssǝןǝɹıM pǝʇɹǝʌuI ʇɥbıꞀ pǝɹǝʍoԀ",
Expand Down Expand Up @@ -251,6 +254,7 @@
"gui.enderio.fluid_conduit.change_fluid1": ":pınןℲ pǝʞɔoꞀ",
"gui.enderio.fluid_conduit.change_fluid2": "¡ʇǝsǝɹ oʇ ʞɔıןƆ",
"gui.enderio.fluid_conduit.change_fluid3": "%s :pınןℲ",
"gui.enderio.input": "ʇnduI",
"gui.enderio.ioconfig": "uoıʇɐɹnbıɟuoƆ OI",
"gui.enderio.ioconfig.both": "ןןnԀ / ɥsnԀ",
"gui.enderio.ioconfig.disabled": "pǝןqɐsıᗡ",
Expand All @@ -260,6 +264,7 @@
"gui.enderio.ioconfig.push": "ɥsnԀ",
"gui.enderio.nocap.desc": "¡ʞɹoʍ uɐɔ ǝuıɥɔɐɯ sıɥʇ \n os ɹoʇıɔɐdɐɔ ʎuɐ ʇɹǝsuI",
"gui.enderio.nocap.title": "buıssıW ɹoʇıɔɐdɐƆ",
"gui.enderio.output": "ʇndʇnO",
"gui.enderio.progress": "%s%% ssǝɹboɹԀ",
"gui.enderio.range": "ǝbuɐᴚ",
"gui.enderio.range.hide": "ǝbuɐᴚ ǝpıH",
Expand Down
5 changes: 5 additions & 0 deletions src/generated/resources/assets/enderio/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@
"block.enderio.hootch": "Hootch",
"block.enderio.impulse_hopper": "Impulse Hopper",
"block.enderio.industrial_insulation_block": "Industrial Insulation",
"block.enderio.item_buffer": "Item Buffer",
"block.enderio.light": "Light",
"block.enderio.light_inverted": "Light Inverted",
"block.enderio.light_node": "Light Node",
"block.enderio.liquid_sunshine": "Liquid Sunshine",
"block.enderio.nutrient_distillation": "Nutrient Distillation",
"block.enderio.omni_buffer": "Omni Buffer",
"block.enderio.painted_crafting_table": "Painted Crafting Table",
"block.enderio.painted_fence": "Painted Fence",
"block.enderio.painted_fence_gate": "Painted Fence Gate",
Expand All @@ -155,6 +157,7 @@
"block.enderio.painted_trapdoor": "Painted Trapdoor",
"block.enderio.painted_wooden_pressure_plate": "Painted Wooden Pressure Plate",
"block.enderio.painting_machine": "Painting Machine",
"block.enderio.power_buffer": "Power Buffer",
"block.enderio.powered_light": "Powered Light",
"block.enderio.powered_light_inverted": "Powered Light Inverted",
"block.enderio.powered_light_inverted_wireless": "Powered Light Inverted Wireless",
Expand Down Expand Up @@ -251,6 +254,7 @@
"gui.enderio.fluid_conduit.change_fluid1": "Locked Fluid:",
"gui.enderio.fluid_conduit.change_fluid2": "Click to reset!",
"gui.enderio.fluid_conduit.change_fluid3": "Fluid: %s",
"gui.enderio.input": "Input",
"gui.enderio.ioconfig": "IO Configuration",
"gui.enderio.ioconfig.both": "Push / Pull",
"gui.enderio.ioconfig.disabled": "Disabled",
Expand All @@ -260,6 +264,7 @@
"gui.enderio.ioconfig.push": "Push",
"gui.enderio.nocap.desc": "Insert any capacitor so \n this machine can work!",
"gui.enderio.nocap.title": "Capacitor Missing",
"gui.enderio.output": "Output",
"gui.enderio.progress": "Progress %s%%",
"gui.enderio.range": "Range",
"gui.enderio.range.hide": "Hide Range",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "enderio:block/item_buffer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "enderio:block/omni_buffer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "enderio:block/power_buffer"
}
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
}
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
}
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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_nbt",
"ops": [
{
"op": "replace",
"source": "",
"target": "BlockEntityTag"
}
],
"source": "block_entity"
}
],
"name": "enderio:item_buffer"
}
],
"rolls": 1.0
}
],
"random_sequence": "enderio:blocks/item_buffer"
}
Loading
Loading