This commit is contained in:
ThePython 2023-09-12 07:46:59 -07:00
parent a19cd400d4
commit 919ecd723c
11 changed files with 304 additions and 196 deletions

165
README.md
View File

@ -60,24 +60,163 @@ If you have a suggestion or notice a bug, visit the [GitHub issues page](https:/
![Minetest Game Screenshot](screenshot_mtg.png)
## Sources/license:
* Code: Forked and *heavily* modified from Enchant97's mod [Element Exchange](https://github.com/enchant97/minetest_element_exchange). Both this mod ane Element Exchange are licenced under GPLv3+. Based on Equivalent Exchange and ProjectE, mods for MineCraft.
* Code: Forked and *heavily* modified from Enchant97's mod [Element Exchange](https://github.com/enchant97/minetest_element_exchange). Both this mod and Element Exchange are licenced under GPLv3+. Based on Equivalent Exchange and ProjectE, mods for MineCraft.
* Textures:
* Energy Collector, Element Deconstructor, Element Constructor, and Exchange Orb: Directly from Element Exchange, GPLv3+.
* Energy Collector, Element Deconstructor, Element Constructor: Directly from Element Exchange, GPLv3+.
* Exchange Orb: *Slightly* modified from Element Exchange (I just changed the color to white so it could change colors correctly)
* Alchemical Coal, Mobius Fuel, and Aeternalis Fuel: modified versions of MineClone's coal texture (CC-BY-SA-3.0).
* Dark and Red Matter Armor (and eventually Gem Armor): modified versions of diamond armor from 3D Armor (CC-BY-SA-3.0) and `mcl_armor` (CC-BY-SA-3.0).
* All other textures (and sounds): Created by me, inspired by Equivalent Exchange and licensed under CC-BY-SA-3.0.
Copyright (C) 2023 ThePython10110
# Changelog:
### 1.0.0
* Initial release
* New features:
* MineClone support, including (sort of) hoppers
* Added the ability to add items by group
* Shift-clicking (listrings)!
* Changes:
* Completely redone recipes, now includes all items.
* Tools' energy value now depends on wear.
* Bugfixes:
* Items can no longer be put in the Constructor's output slot.
* Honestly, I'm going to count the broken energy values as a bug...
This program 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, either version 3 of the License, or
(at your option) any later version.
### 2.0
* New features:
* Added a changelog (you're reading it now!)
* Added all items from Why (a MineClone modpack I made)
* Added Philosopher's Stone (these controls are now inaccurate; changed in 3.0)
* Left click to increase range (minimum = 0, maximum = 4).
* Shift+left click to decrease range.
* Aux1+left click to open enchanting table (MineClone only).
* Right click to transmute nodes in range (mode 1).
* Shift+right click to transmute nodes in range (mode 2, has some differences).
* Aux1+right click to open crafting table (MineClone only).
* Can use to craft coal into iron, mese into diamonds, etc.
* Changes:
* Changed version numbers from x.x.x to x.x.
* Changed the recipe for the Exchange Orb
* New recipe is a Philosopher's Stone in the middle, diamonds in the corners, and iron/steel ingots on the sides.
* Changed the energy values of tin, copper, and bronze in Minetest Game.
* Renamed images to reflect mod name change ("exchangeclone" instead of "ee" for Element Exchange)
* Deleted unnecessary "config.lua"
* Bugfixes:
* Ghost Blocks (from Why) are now worth 0 instead of 1 (to prevent infinite energy)
* Fixed stairs and slabs not working in Minetest Game
This program 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.
### 3.0 (the most interesting release so far)
* New features:
* Added Alchemical Coal, Mobius Fuel, Aeternalis Fuel, Dark Matter (blocks and orbs), and Red Matter (blocks and orbs)
* Added PESA (Personal Energy Storage Accessor)
* A single inventory slot in which an orb can be placed. Energy from the orb is used for special abilities.
* Added Dark and Red Matter tools
* Faster than any other tools (in unmodded MTG/MCL), each has an ability
* Special abilities that break nodes (as well as shearing) drop items directly on the player.
* Swords:
* Can damage all mobs within a radius (Red Matter sword can toggle between hostile/all mobs), costing 384 energy.
* Pickaxes:
* Has 3x1 modes (long, tall, and wide, all slightly slower)
* Can mine a full vein of ores, dropping items and experience on the player and costing 8 energy per node broken
* Axes:
* Can break all wood and leaves within a radius, costing 8 energy per node broken.
* Shovels:
* Can break all shovely nodes within a radius, costing 8 energy per node broken
* Can create paths in a radius, costing 4 energy per node
* Hoes:
* Breaks dirt incredibly quickly
* Has a 3x3 mode for digging dirt (slightly slower)
* Can till all dirt within a radius, costs 4 energy per node
* Hammers:
* Breaks pickaxey nodes in a 3x3 area
* Can break all pickaxey nodes within a radius, costing 8 energy per node broken
* Shears:
* More wool/mushrooms dropped when shearing, chance of cloning sheep/mooshrooms
* Can shear all shearable plants/cobwebs within a radius, costing 8 energy per node broken.
* Changes:
* Added a mod whitelist in `energy.lua`, any item from a mod NOT in the whitelist (`exchangeclone.whitelisted_mods`) will have an energy value of 0
* Orbs now show their energy on right click instead of left click
* Changed Philosopher's Stone controls to make everything more consistant
* The Energy Collector setting is now energy/second instead of second/energy to fit much higher costs than Element Exchange (default is 5 energy/s).
* Set gravel value to 1 to match sand/stone/dirt/etc (MineClone).
* Tuff, blackstone, and basalt are now transmutable (MineClone).
* A couple of minor transmutation changes (MineClone).
* Changed emerald value to 4096 (MineClone).
* Gold cannot be crafted into diamonds using the PS; it can now be crafted into emeralds and emeralds into diamonds (MineClone).
* The PS's enchanting table now is limited to 8-bookshelf enchantments to make it more balanced (MineClone).
* Fixed terracotta values (MineClone)
* Enchanted tools/armor are now worth the same amount as unenchanted tools/armor instead of twice as much (MineClone).
* Enchanted tools/armor cannot be created by the Constructor (MineClone).
* It is now impossible to get stacks of invalid sizes with the Constructor (>16 ender pearls or >1 pickaxe, for example)
* Bugfixes:
* Fixed freezing when attempting to deconstruct 0-energy items
* The Constructor, Deconstructor, and Energy Collector are now not unbreakable in MineClone (I really should test in survival).
* Copper blocks are now worth 4 times as much as copper ingots instead of 9 (MineClone).
* The Energy Collector now drops its contents when broken (MineClone)
* Fixed Exchange Orb energy value (forgot to change it after changing the recipe)
* Changed Constructor, Deconstructor, and Collector recipes and energy values to make them cheaper.
### 3.1
* Changes:
* Added new energy values from Why (and Why's new Minetest Game energy values)
* Bugfixes:
* Fixed crash based on PESA inventory movement
* Added `mcl_blackstone` to the mod whitelist
### 3.2
* Changes:
* Set MineClone mod namespace to exchangeclone
### 4.0
* New features:
* The "Features that I plan on adding eventually" list below
* Cooldowns for tool abilities to limit lag
* Red Katar (combination of sword, axe, hoe, and shears)
* Red Morningstar (combination of hammer, pickaxe, and shovel)
* Dark Matter Armor (full set gives immunity to lava/fire and drowning)
* Red Matter Armor (full set gives lava/fire/drowning immunity PLUS 2000 health, although you may want HUD Bars to see it)
* Added energy values for MineClone's new items.
* Changes:
* Changed the amount of damage done by Dark/Red Matter Sword special abilities (used to be `max_damage/distance`, now is `max_damage-distance`)
* A whole bunch of things that won't be noticible when playing, mostly code reorganization. It's *possible* that tools that mine multiple nodes at a time (hammer, pickaxe, hoe, katar, and morningstar) will be less laggy
* Texture/sound license changed to CC-BY-SA-3.0 (because GPLv3+ isn't really meant as a media license).
* Bugfixes:
* Fixed an issue where MineClone dispensers could ONLY be used with Dark/Red Matter Shears (whoops).
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
### 4.1
* Bugfixes:
* Added energy values for new armor/tools
* Removed unnecessary chestplate image (not only is it unused, but I put it in the wrong folder for some reason)
### 4.2
* New features:
* New items from Why (flying sausage, useful green potatoes, etc.)
* Changes:
* The changelog now lives here!
* Exchange Orbs now change color based on the amount of energy (black->red->green->blue->magenta)
* Water is now worth 0 instead of 1 (since it's infinite)
* Bugfixes:
* Exchange Orbs will now correctly display their energy value (I typed `orb` instead of `exchange_orb` in the energy value list)
### Plans for 5.0
* New features:
* Dark/Red Matter Furnaces
* Transmutation Tablet (including portable version)
* The ability to upgrade dark/red matter tools to give them fortune, looting, fire aspect, and silk touch
* The ability to upgrade dark/red matter armor to give it thorns and frost walker
* Ability to smelt with the Philosopher's Stone and coal/charcoal
* Mind, Life, Body, and Soul Stones
### Features that I plan on adding eventually:
* Something that places nodes in a square (with varying range), possibly with a low energy cost
* Exchangeclone guidebook (maybe depend on doc mod?)
* As soon as Minetest 5.8 comes out, better textures for armor...
* Energy Condenser
* Upgraded Energy Collectors
* Divining Rods
* Rings (I'll probably add a new PESA-like item for holding rings, or just add more slots to the PESA)
* Archangel's Smite (though arrows will not track targets)
* Ring of Ignition
* Swiftwolf's Rending Gale (though without the force field)
* Zero Ring
* Harvest Band?
* Ring of Arcana (possibly without the Harvest Band)
* Gem Armor

View File

@ -64,8 +64,8 @@ function exchangeclone.check_armor_health(obj)
already_has_health = obj:get_meta():get_int("exchangeclone_red_matter_armor") or 0
end
if armor_pieces >= max_armor then
obj:set_properties({hp_max = 2000})
if already_has_health == 0 then
obj:set_properties({hp_max = 2000})
-- fix this if MineCraft changes to max_hp instead of hardcoding 20
obj:set_hp(2000-math.max(20-obj:get_hp(), 0))
obj:get_meta():set_int("exchangeclone_red_matter_armor", 1)

View File

@ -1,139 +0,0 @@
1.0.0
Initial release
New features:
MineClone support, including (sort of) hoppers
Added the ability to add items by group
Shift-clicking (listrings)!
Changes:
Completely redone recipes, now includes all items.
Tools' energy value now depends on wear.
Bugfixes:
Items can no longer be put in the Constructor's output slot.
2.0
New features:
Added a changelog (you're reading it now!)
Added all items from Why (a MineClone modpack I made)
Added Philosopher's Stone (these controls are now inaccurate; changed in 3.0)
Left click to increase range (minimum = 0, maximum = 4).
Shift+left click to decrease range.
Aux1+left click to open enchanting table (MineClone only).
Right click to transmute nodes in range (mode 1).
Shift+right click to transmute nodes in range (mode 2, has some differences).
Aux1+right click to open crafting table (MineClone only).
Can use to craft coal into iron, mese into diamonds, etc.
Changes:
Changed version numbers from x.x.x to x.x.
Changed the recipe for the Exchange Orb
New recipe is a Philosopher's Stone in the middle, diamonds in the corners, and iron/steel ingots on the sides.
Changed the energy values of tin, copper, and bronze in Minetest Game.
Renamed images to reflect mod name change ("exchangeclone" instead of "ee" for Element Exchange)
Deleted unnecessary "config.lua"
Bugfixes:
Ghost Blocks (from Why) are now worth 0 instead of 1 (to prevent infinite energy)
Fixed stairs and slabs not working in Minetest Game
3.0 (the most interesting release so far)
New features:
Added Alchemical Coal, Mobius Fuel, Aeternalis Fuel, Dark Matter (blocks and orbs), and Red Matter (blocks and orbs)
Added PESA (Personal Energy Storage Accessor)
A single inventory slot in which an orb can be placed. Energy from the orb is used for special abilities.
Added Dark and Red Matter tools
Faster than any other tools (in unmodded MTG/MCL), each has an ability
Special abilities that break nodes (as well as shearing) drop items directly on the player.
Swords:
Can damage all mobs within a radius (Red Matter sword can toggle between hostile/all mobs), costing 384 energy.
Pickaxes:
Has 3x1 modes (long, tall, and wide, all slightly slower)
Can mine a full vein of ores, dropping items and experience on the player
Axes:
Can break all wood and leaves within a radius, costing 8 energy per node broken.
Shovels:
Can break all shovely nodes within a radius, costing 8 energy per node broken
Can create paths in a radius, costing 8 energy per node
Hoes:
Breaks dirt incredibly quickly (and unfortunately all other shovely nodes because I can't figure out how to avoid it)
Has a 3x3 mode for digging dirt (slightly slower)
Can till all dirt within a radius, costs 2 energy per node
Hammers:
Breaks pickaxey nodes in a 3x3 area
Can break all pickaxey nodes within a radius, costing 8 energy per node broken
Shears:
More wool/mushrooms dropped when shearing, chance of cloning sheep/mooshrooms
Can shear all shearable plants/cobwebs within a radius, costing 8 energy per node broken.
Changes:
Added a mod whitelist in energy.lua, any item from a mod NOT in the whitelist (exchangeclone.whitelisted_mods) will have an energy value of 0
Orbs now show their energy on right click instead of left click
Changed Philosopher's Stone controls to make everything more consistant
The Energy Collector setting is now energy/second instead of second/energy to fit much higher costs than Element Exchange (default is 5 energy/s).
Set gravel value to 1 to match sand/stone/dirt/etc (MineClone).
Tuff, blackstone, and basalt are now transmutable (MineClone).
A couple of minor transmutation changes (MineClone).
Changed emerald value to 4096 (MineClone).
Gold cannot be crafted into diamonds using the PS; it can now be crafted into emeralds and emeralds into diamonds (MineClone).
The PS's enchanting table now is limited to 8-bookshelf enchantments to make it more balanced (MineClone).
Fixed terracotta values (MineClone)
Enchanted tools/armor are now worth the same amount as unenchanted tools/armor instead of twice as much (MineClone).
Enchanted tools/armor cannot be created by the Constructor (MineClone).
It is now impossible to get stacks of invalid sizes with the Constructor (>16 ender pearls or >1 pickaxe, for example)
Bugfixes:
Fixed freezing when attempting to deconstruct 0-energy items
The Constructor, Deconstructor, and Energy Collector are now not unbreakable in MineClone (I really should test in survival).
Copper blocks are now worth 4 times as much as copper ingots instead of 9 (MineClone).
The Energy Collector now drops its contents when broken (MineClone)
Fixed Exchange Orb energy value (forgot to change it after changing the recipe)
Changed Constructor, Deconstructor, and Collector recipes and energy values to make them cheaper.
3.1
Changes:
Added new energy values from Why (and Why's new Minetest Game energy values)
Bugfixes:
Fixed crash based on PESA inventory movement
Added mcl_blackstone to the mod whitelist
3.2
Changes:
Set MineClone mod namespace to exchangeclone
4.0
New features:
The "Features that I plan on adding eventually" list below
Cooldowns for tool abilities to limit lag
Red Katar (combination of sword, axe, hoe, and shears)
Red Morningstar (combination of hammer, pickaxe, and shovel)
Dark Matter Armor (full set gives immunity to lava/fire and drowning)
Red Matter Armor (full set gives lava/fire/drowning immunity PLUS 2000 health, although you may want HUD Bars to see it)
Added energy values for MineClone's new items.
Changes:
Changed the amount of damage done by Dark/Red Matter Sword special abilities (used to be max_damage/distance, now is max_damage-distance)
A whole bunch of things that won't be noticible when playing, mostly code reorganization. It's POSSIBLE that tools that mine multiple nodes (hammer, pickaxe, hoe, katar, and morningstar) will be less laggy
Texture/sound license changed to CC-BY-SA-3.0 (because GPLv3+ isn't really meant as a media license).
Bugfixes:
Fixed an issue where MineClone dispensers could ONLY be used with Dark/Red Matter Shears.
Plans for 4.1
New features:
New items from the next version of Why (I'm planning on doing that next)
Plans for 5.0
New features:
Exchangeclone guidebook (maybe depend on doc mod?)
The ability to upgrade dark/red matter tools to give them fortune, looting, fire aspect, and silk touch
The ability to upgrade dark/red matter armor to give it thorns and frost walker
Ability to smelt with the Philosopher's Stone and coal/charcoal
Mind, Life, Body, and Soul Stones
Features that I plan on adding eventually:
Something that places nodes in a square (with varying range), possibly with a low energy cost
As soon as Minetest 5.8 comes out, better textures for armor...
Dark/Red Matter Furnaces
Energy Condenser
Upgraded Energy Collectors
Transmutation Tablet (including portable version)
Divining Rods
Rings (I'll probably add a new PESA-like item for holding rings)
Archangel's Smite (though arrows will not track targets)
Ring of Ignition
Swiftwolf's Rending Gale (though without the force field)
Zero Ring
Ring of Arcana (minus the Harvest band)
Gem Armor

View File

@ -75,8 +75,8 @@ local function on_timer(pos, elapsed)
end
-- only get 1 orb as we can only use one
local stored = exchangeclone.get_orb_energy(inv, "dst", 1)
if stored + energy_value < stored then
return --will hopefully prevent overflow, not that overflow is likely
if stored + energy_value > exchangeclone.energy_max then
return
end
fuel_stack:set_count(fuel_stack:get_count() - 1)
inv:set_stack("main", 1, fuel_stack)

View File

@ -1,7 +1,7 @@
-- WARNING: Do not use aliases; they will be ignored.
exchangeclone.mtg_energy_values = {
["exchangeclone"] = {
orb = 33792,
exchange_orb = 33792,
element_deconstructor = 67592,
element_constructor = 92168,
energy_collector = 23901,
@ -33,6 +33,19 @@ exchangeclone.mtg_energy_values = {
red_matter_pickaxe_3x1 = 1974272,
dark_matter_axe = 434176,
red_matter_axe = 1974272,
red_katar = 7512064,
red_katar_3x3 = 7512064,
red_morningstar = 7053312,
red_morningstar_3x1 = 7053312,
red_morningstar_3x3 = 7053312,
helmet_dark_matter = 139264*5,
chestplate_dark_matter = 139264*8,
leggings_dark_matter = 139264*7,
boots_dark_matter = 139264*4,
helmet_red_matter = (139264+466944)*5,
chestplate_red_matter = (139264+466944)*8,
leggings_red_matter = (139264+466944)*7,
boots_red_matter = (139264+466944)*4,
pesa = 64,
},
["beds"] = {
@ -50,8 +63,8 @@ exchangeclone.mtg_energy_values = {
},
["bucket"] = {
bucket_empty = 768,
bucket_water = 769,
bucket_river_water = 769,
bucket_water = 768,
bucket_river_water = 768,
bucket_lava = 896,
},
["butterflies"] = {
@ -296,7 +309,7 @@ exchangeclone.mtg_energy_values = {
sword_pick = 40976,
sword_smoke = 16483,
sword_teleport = 16520,
sword_water = 1558,
sword_water = 1556,
},
["tnt"] = {
gunpowder = 25,
@ -322,18 +335,19 @@ exchangeclone.mtg_energy_values = {
portable_sound_machine = 2608,
},
["fake_liquids"] = {
solid_water_source = 4,
solid_water_source = 3,
solid_useless_bean_liquid_source = 0,
solid_glue_source = 36,
solid_river_water_source = 4,
solid_useful_green_potato_liquid_source = 3,
solid_glue_source = 35,
solid_river_water_source = 3,
solid_lava_source = 131,
bucket_fake_lava = 4865,
bucket_fake_lava = 4864,
bucket_fake_water = 4992,
solid_fake_lava_source = 4100,
solid_fake_lava_source = 4099,
solid_fake_water_source = 4227,
},
["sticky_things"] = {
bucket_glue = 801,
bucket_glue = 800,
glue_source = 0,
glue_flowing = 0,
},
@ -343,6 +357,24 @@ exchangeclone.mtg_energy_values = {
["small_why_things"] = {
craftable_barrier = 72,
},
["useful_green_potatoes"] = {
useful_green_potato = 256,
useful_green_potato_ingot = 256,
useful_green_potato_block = 256*9,
useful_green_potato_ingot_block = 256*9,
axe_useful_green_potato = 256*3+8,
pick_useful_green_potato = 256*3+8,
sword_useful_green_potato = 256*2+4,
shovel_useful_green_potato = 256+8,
hoe_useful_green_potato = 256*2+8,
helmet_useful_green_potato = 256*5,
chestplate_useful_green_potato = 256*8,
shield_useful_green_potato = 256*7,
leggings_useful_green_potato = 256*7,
boots_useful_green_potato = 256*4,
bucket_useful_green_potato_liquid = 768, -- renewable
useful_green_potato_gold = 2048*8+256
}
}
@ -360,7 +392,7 @@ exchangeclone.mcl_energy_values = {
element_deconstructor = 67592,
element_constructor = 92168,
energy_collector = 23883,
orb = 33792,
exchange_orb = 33792,
philosophers_stone = 9984,
alchemical_coal = 512,
mobius_fuel = 2048,
@ -389,6 +421,19 @@ exchangeclone.mcl_energy_values = {
red_matter_pickaxe_3x1 = 1974272,
dark_matter_axe = 434176,
red_matter_axe = 1974272,
red_katar = 7512064,
red_katar_3x3 = 7512064,
red_morningstar = 7053312,
red_morningstar_3x1 = 7053312,
red_morningstar_3x3 = 7053312,
helmet_dark_matter = 139264*5,
chestplate_dark_matter = 139264*8,
leggings_dark_matter = 139264*7,
boots_dark_matter = 139264*4,
helmet_red_matter = (139264+466944)*5,
chestplate_red_matter = (139264+466944)*8,
leggings_red_matter = (139264+466944)*7,
boots_red_matter = (139264+466944)*4,
pesa = 64,
},
["mcl_core"] = {
@ -512,7 +557,7 @@ exchangeclone.mcl_energy_values = {
helmet_netherite_enchanted = 114688,
leggings_netherite_enchanted = 131072,
chestplate_netherite_enchanted = 139264,
elytra = 73728*2,
elytra = 297216,
},
["mcl_anvils"] = {
anvil = 7936,
@ -826,8 +871,8 @@ exchangeclone.mcl_energy_values = {
},
["mcl_sponges"] = {
sponge = 1024,
sponge_wet = 1025,
sponge_wet_river_water = 1025,
sponge_wet = 1024,
sponge_wet_river_water = 1024,
},
["mcl_spyglass"] = {
spyglass = 426,
@ -1098,8 +1143,8 @@ exchangeclone.mcl_energy_values = {
},
["mcl_buckets"] = {
bucket_empty = 768,
bucket_water = 769,
bucket_river_water = 769,
bucket_water = 768,
bucket_river_water = 768,
bucket_lava = 896,
bucket_cod = 896,
bucket_salmon = 896,
@ -1225,19 +1270,25 @@ exchangeclone.mcl_energy_values = {
portable_sound_machine = 681,
},
["fake_liquids"] = {
solid_water_source = 4,
solid_water_source = 3,
solid_milk_source = 67,
solid_useless_bean_liquid_source = 0,
solid_glue_source = 12,
solid_river_water_source = 4,
solid_fake_lava_source = 68,
solid_useful_green_potato_liquid_source = 3,
solid_glue_source = 11,
solid_river_water_source = 3,
solid_fake_lava_source = 67,
solid_lava_source = 131,
solid_fake_water_source = 195,
bucket_fake_lava = 833,
bucket_fake_lava = 832,
bucket_fake_water = 960,
},
["flying_sausage"] = {
cooked_elytra = 297216,
burnt_elytra = 297216,
flying_sausage = 297216 + (576*8)
},
["sticky_things"] = {
bucket_glue = 797,
bucket_glue = 776,
glue_source = 0,
glue_flowing = 0,
sticky_block = 100,
@ -1255,6 +1306,7 @@ exchangeclone.mcl_energy_values = {
},
["small_why_things"] = {
craftable_barrier = 72,
blue_feather = 0,
},
["mcl_colorblocks"] = {
glazed_terracotta_black = 64,
@ -1273,6 +1325,23 @@ exchangeclone.mcl_energy_values = {
glazed_terracotta_silver = 64,
glazed_terracotta_white = 64,
glazed_terracotta_yellow = 64
},
["useful_green_potatoes"] = {
useful_green_potato = 256,
useful_green_potato_ingot = 256,
useful_green_potato_block = 256*9,
useful_green_potato_ingot_block = 256*9,
axe_useful_green_potato = 256*3+8,
pick_useful_green_potato = 256*3+8,
sword_useful_green_potato = 256*2+4,
shovel_useful_green_potato = 256+8,
hoe_useful_green_potato = 256*2+8,
helmet_useful_green_potato = 256*5,
chestplate_useful_green_potato = 256*8,
leggings_useful_green_potato = 256*7,
boots_useful_green_potato = 256*4,
bucket_useful_green_potato_liquid = 768,
useful_green_potato_gold = 2048*8+256
}
}
@ -1463,6 +1532,8 @@ exchangeclone.whitelisted_mods = {
mclx_fences = true,
mclx_stairs = true,
meat_blocks = true,
flying_sausage = true,
useful_green_potatoes = true,
screwdriver = true,
slime_things = true,
small_why_things = true,
@ -1473,20 +1544,20 @@ exchangeclone.whitelisted_mods = {
--only allow Mesecons in MineClone
if exchangeclone.mineclone then
for k, v in pairs({
["mesecons"] = true,
["mesecons_button"] = true,
["mesecons_delayer"] = true,
["mesecons_lightstone"] = true,
["mesecons_noteblock"] = true,
["mesecons_pistons"] = true,
["mesecons_pressureplates"] = true,
["mesecons_solarpanel"] = true,
["mesecons_torch"] = true,
["mesecons_walllever"] = true,
["mesecons_wires"] = true,
for _, mod in ipairs({
"mesecons",
"mesecons_button",
"mesecons_delayer",
"mesecons_lightstone",
"mesecons_noteblock",
"mesecons_pistons",
"mesecons_pressureplates",
"mesecons_solarpanel",
"mesecons_torch",
"mesecons_walllever",
"mesecons_wires",
}) do
exchangeclone.whitelisted_mods[k] = v
exchangeclone.whitelisted_mods[mod] = true
end
end
@ -1499,7 +1570,7 @@ local function set_item_energy(itemstring, energy_value)
if not (item_name and mod_name) then return end
if exchangeclone.whitelisted_mods[mod_name] then
if mod_name == "ghost_blocks" then
energy_value = 0 --I don't know what to do about ghost blocks.
energy_value = 0
end
if exchangeclone.mineclone then
if exchangeclone.mcl_energy_values[mod_name] then
@ -1556,7 +1627,7 @@ local function set_item_energy(itemstring, energy_value)
end
local function add_potion_energy(info)
local base_cost = 2 --cost of water bottle
local base_cost = 1 --cost of water bottle
--TODO: Change dragon's breath when MineClone does.
local dragon_breath_cost = 8.5
base_cost = math.floor(base_cost + (info.ingredient_cost / 3)) --/3 because 3 potions/ingredient

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -5,6 +5,8 @@ else
exchangeclone.mineclone = minetest.get_modpath("mcl_core")
end
exchangeclone.energy_max = 51200000 -- Max capacity of Klein Star Omega
local default_path = minetest.get_modpath("exchangeclone")
exchangeclone.collector_speed = minetest.settings:get("exchangeclone.energy_collector_speed") or 5
@ -32,4 +34,5 @@ dofile(default_path.."/shovels.lua")
dofile(default_path.."/red_matter_multitools.lua")
dofile(default_path.."/philosophers_stone.lua")
dofile(default_path.."/pesa.lua")
dofile(default_path.."/transmutation_tablet.lua")
dofile(default_path.."/energy.lua")

38
lib.lua
View File

@ -22,6 +22,11 @@ function exchangeclone.round(num)
end
end
-- https://forum.unity.com/threads/re-map-a-number-from-one-range-to-another.119437/
function exchangeclone.map(input, min1, max1, min2, max2)
return (input - min1) / (max1 - min1) * (max2 - min2) + min2
end
function exchangeclone.get_orb_energy(inventory, listname, index)
if not inventory then return end
if not listname then listname = "main" end
@ -33,14 +38,41 @@ function exchangeclone.get_orb_energy(inventory, listname, index)
end
function exchangeclone.set_orb_energy(inventory, listname, index, amount)
if (not inventory) or (not amount) or (amount < 0) then return end
if (not inventory) or (not amount) or (amount < 0) or (amount > exchangeclone.energy_max) then return end
if not listname then listname = "main" end
if not index then index = 1 end
local itemstack = inventory:get_stack(listname, index)
if not itemstack then return end
if not itemstack:get_name() then return end
itemstack:get_meta():set_float("stored_energy", amount)
itemstack:get_meta():set_string("description", "Exchange Orb\nCurrent Charge: "..amount)
-- Square roots will hopefully make it less linear
-- And if they don't, I don't really care and I don't want to think about math anymore.
local sqrt_amount = math.sqrt(amount)
local sqrt_max = math.sqrt(exchangeclone.energy_max)
local r, g, b = 0, 0, 0
if amount == 0 then
-- do nothing
elseif sqrt_amount < (sqrt_max/4) then
r = exchangeclone.map(sqrt_amount, 0, sqrt_max/4, 0, 255)
elseif sqrt_amount < (sqrt_max/2) then
g = exchangeclone.map(sqrt_amount, sqrt_max/4, sqrt_max/2, 0, 255)
r = 255 - g
elseif sqrt_amount < (3*sqrt_max/4) then
b = exchangeclone.map(sqrt_amount, sqrt_max/2, 3*sqrt_max/4, 0, 255)
g = 255 - b
else
r = exchangeclone.map(sqrt_amount, 3*sqrt_max/4, sqrt_max, 0, 255)
minetest.log(dump(r))
b = 255
end
local colorstring = minetest.rgba(r,g,b)
local meta = itemstack:get_meta()
meta:set_float("stored_energy", amount)
meta:set_string("description", "Exchange Orb\nCurrent Charge: "..amount)
meta:set_string("color", colorstring)
inventory:set_stack(listname, index, itemstack)
end

View File

@ -12,7 +12,8 @@ end
minetest.register_tool("exchangeclone:exchange_orb", {
description = "Exchange Orb\nCurrent Charge: 0",
inventory_image = "exchangeclone_exchange_orb.png",
--energy_value = 33792,
energy_value = 33792,
color = "#000000",
on_secondary_use = read_orb_charge,
on_place = read_orb_charge,
groups = {exchange_orb = 1, disable_repair = 1}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

1
transmutation_tablet.lua Normal file
View File

@ -0,0 +1 @@
-- Not until 5.0