Skip to content

Commit

Permalink
Bunch of random things again
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePython10110 committed Dec 25, 2023
1 parent d5c153e commit b21c182
Show file tree
Hide file tree
Showing 10 changed files with 335 additions and 368 deletions.
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ Dependencies: Minetest Game or MineClone.
## Known issues:
* Dark/Red Matter armor don't work they way they should, especially in MTG. I would greatly appreciate a PR that makes them work more like ProjectE.
* The sword/katar AOE ability does not take upgrades into account. This will probably not be fixed (MCL)
* When machines are exploded, they (and the items inside) do not drop. I can't figure out why.
* For technical reasons (making them work with MCL hoppers), Exchange Orbs and Upgrades can be used as fuel. This isn't really a problem, but it will be removed once I decide the new hopper API is new enough that most people are using it.
* Dark/Red matter shears will sometimes (randomly) be treated as normal shears when used by MCL dispensers. This will not be fixed.
* Dark/Red Matter Shears will sometimes (randomly) be treated as normal shears when used by MCL dispensers. This will not be fixed.
* In Mineclonia, when inserting items into Dark/Red Matter Furnaces with hoppers, they will not start at the correct speed, instead being limited to a maximum of 1 item/second. This will not be fixed unless Mineclonia changes how things work.
* In Mineclonia, hoppers can put invalid items into Energy Collectors.

**If you have a suggestion or notice a bug, visit the [GitHub issues page](https://github.com/thepython10110/exchangeclone/issues).**

Expand All @@ -66,10 +67,12 @@ Dependencies: Minetest Game or MineClone.

### TODO:
* Figure out what's going to happen with Technic (the PR probably won't be merged)
* Test everything in MTG, MCL2, and MCLA (and 5.7)
* Finish changelog
* Finish wiki
* Improve covalence formspec
* Test everything in MTG, MCL2, and MCLA (and 5.7)
* Everything breaks properly in MTG
* Fix Tmcl_banners thing
* Fix Technic Beta

### v6.0 (The Compatibility Update)

Expand All @@ -82,7 +85,9 @@ Dependencies: Minetest Game or MineClone.
* Changed A LOT of things internally. Any mods depending on ExchangeClone (probably not very many, which is good) will probably need to update stuff.
* **The PESA will be removed in version 7.0.**

**Full Changelog**
I didn't get to everything I wanted to, mostly because the automatic energy values required quite a lot of work.

#### Full Changelog**
* New Features:
* Automatically generated energy values! Based on crafting and cooking recipes.
* Depending on the number of crafting recipes you have, this could increase load times. This is definitely a bit of an issue in MineClone2, probably due to the number of banner/dye recipes. Eventually (hopefully), loom functionality will be added and this will improve quite a bit.
Expand Down Expand Up @@ -120,24 +125,25 @@ Dependencies: Minetest Game or MineClone.
* Tool abilities now have no energy cost (to match ProjectE).
* Tool abilities now take upgrades into account (silk touch, fortune, etc.) except for the sword AOE ability (which would require irritating hacky workarounds).
* Several neutral mobs (endermen, spiders, piglins) are now affected by the dark/red matter sword in "slay hostile" mode, to match ProjectE.
* No more mod whitelist.
* Bugfixes:
* Fixed potion energy values (MCL)
* Fixed Red Matter Shield recipe (MTG)
* Fixed other modes of DM/RM tools not having energy values
* Deconstructors and Constructors will now continue trying to work instead of just stopping when there is too much or too little energy.
* Tool abilities now update nodes that require support (torches, sand, etc.).
* MCL raw copper, iron, and gold blocks now correctly double in DM/RM furnaces.
* Finally fixed that bug where things don't drop when exploded.

### v5.4
* Fixed a minor bug with the Energy Collector (thanks @programmerjake!)
* Now adding v's to version numbers... because it looks nice, I guess.

### 5.3
* Bugfixes
* Fixed shearing beehives in MCL (thanks @Ranko-Saotome!)
* Fixed shearing beehives in MCL (thanks @Ranko-Saotome!)

### 5.2
* Bugfixes
* Removed unnecessary logging every time players take damage (I was testing stuff out with the armor, thanks @Ranko-Saotome for reporting)
* Removed unnecessary logging every time players take damage (I was testing stuff out with the armor, thanks @Ranko-Saotome for reporting)

### 5.1
* New Features:
Expand Down Expand Up @@ -193,8 +199,7 @@ Dependencies: Minetest Game or MineClone.
* Fixed an error message about the `invert` texture modifier

### 4.4
* New Features
* Mineclonia Support
* Added Mineclonia Support (or at least, I thought I did)
* The version numbers kind of disagree around here and I'm too lazy to fix it.

### 4.3
Expand All @@ -209,13 +214,11 @@ Dependencies: Minetest Game or MineClone.
* Exchange Orbs will now correctly display their energy value (I typed `orb` instead of `exchange_orb` in the energy value list)

### 4.2
* Bugfixes:
* Fixed a dependency error (thanks, @opfromthestart!)
* Fixed a dependency error (thanks, @opfromthestart!)

### 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)
* 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.0
* New features:
Expand All @@ -234,15 +237,12 @@ Dependencies: Minetest Game or MineClone.
* Fixed an issue where MineClone dispensers could ONLY be used with Dark/Red Matter Shears (whoops).

### 3.2
* Changes:
* Set MineClone mod namespace to `exchangeclone`
* Set MineClone mod namespace to `exchangeclone`

### 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
* Added new energy values from Why (and Why's new Minetest Game energy values)
* Fixed crash based on PESA inventory movement
* Added `mcl_blackstone` to the mod whitelist

### 3.0 (the formerly most interesting release)
* New features:
Expand Down Expand Up @@ -334,6 +334,7 @@ Dependencies: Minetest Game or MineClone.
</details>

### Features that I plan on adding eventually:
* Achievements
* ~~As soon as Minetest 5.8 comes out, better textures for armor...~~ Don't want to limit it to 5.8
* Divining Rods
* Rings (I'll probably add a new PESA-like item for holding rings)
Expand All @@ -347,4 +348,6 @@ Dependencies: Minetest Game or MineClone.
* Catalytic Lens
* Mind, Life, Body, and Soul Stones
* Mercurial Eye
* Talisman of Repair
* Gem of Eternal Density
* Probably other things
39 changes: 30 additions & 9 deletions exchangeclone/alchemical_chests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@ local function alchemical_on_construct(color)
end
end

local pipeworks_connect = exchangeclone.pipeworks and "^pipeworks_tube_connection_stony.png" or ""

minetest.register_node("exchangeclone:alchemical_chest", {
description = S("Alchemical Chest"),
groups = {container = 2, alchemical_chest = 1, cracky = 2, pickaxey = 2},
groups = {container = 2, alchemical_chest = 1, cracky = 2, pickaxey = 2, tubedevice = 1, tubedevice_receiver = 1},
_mcl_hardness = 3,
_mcl_blast_resistance = 6,
paramtype2 = "4dir",
tiles = {
"exchangeclone_alchemical_chest_top.png",
"exchangeclone_alchemical_chest_bottom.png",
"exchangeclone_alchemical_chest_side.png",
"exchangeclone_alchemical_chest_side.png",
"exchangeclone_alchemical_chest_side.png",
"exchangeclone_alchemical_chest_front.png",
"exchangeclone_alchemical_chest_top.png"..pipeworks_connect,
"exchangeclone_alchemical_chest_bottom.png"..pipeworks_connect,
"exchangeclone_alchemical_chest_side.png"..pipeworks_connect,
"exchangeclone_alchemical_chest_side.png"..pipeworks_connect,
"exchangeclone_alchemical_chest_side.png"..pipeworks_connect,
"exchangeclone_alchemical_chest_front.png"..pipeworks_connect,
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
Expand All @@ -55,6 +57,25 @@ minetest.register_node("exchangeclone:alchemical_chest", {
inv:set_size("main", 104)
inv:set_width("main", 13)
end,
tube = exchangeclone.pipeworks and {
input_inventory = "main",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1},
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local result = inv:add_item("main", stack)
if result then
local func = minetest.registered_items[node.name].on_metadata_inventory_put
if func then func(pos) end
end
return result
end
},
on_blast = exchangeclone.on_blast({"main"}),
on_rotate = exchangeclone.pipeworks and pipeworks.on_rotate,
after_place_node = exchangeclone.pipeworks and pipeworks.after_place,
after_dig_node = exchangeclone.drop_after_dig({"main"}),
can_dig = exchangeclone.can_dig,
})

local stone_itemstring = exchangeclone.mcl and "mcl_core:stone" or "default:stone"
Expand All @@ -78,8 +99,8 @@ minetest.register_on_joinplayer(function(player, last_login)
end)

for color, color_data in pairs(exchangeclone.colors) do
local bag_itemstring = "exchangeclone:"..color.."_alchemical_bag"
local advanced_itemstring = "exchangeclone:"..color.."_advanced_alchemical_chest"
local bag_itemstring = "exchangeclone:alchemical_bag_"..color
local advanced_itemstring = "exchangeclone:advanced_alchemical_chest_"..color
local wool_itemstring = (exchangeclone.mcl and "mcl_wool:" or "wool:")..color
local dye_itemstring = (exchangeclone.mcl and "mcl_dye:" or "dye:")..color

Expand Down
2 changes: 2 additions & 0 deletions exchangeclone/baubles.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- Currently none of this stuff actually runs (didn't get to it in v6.0)

local S = minetest.get_translator()

local storage = minetest.get_mod_storage()
Expand Down
58 changes: 16 additions & 42 deletions exchangeclone/constructor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ minetest.register_lbm({
end,
})

local function can_dig(pos, player)
if exchangeclone.mcl then return true end
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("fuel") and inv:is_empty("src") and inv:is_empty("dst")
end

local function constructor_action(pos)
local using_orb = true
local player
Expand Down Expand Up @@ -135,48 +128,25 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
return stack:get_count()
end

local function on_blast(pos)
local drops = {}
exchangeclone.get_inventory_drops(pos, "fuel", drops)
exchangeclone.get_inventory_drops(pos, "src", drops)
exchangeclone.get_inventory_drops(pos, "dst", drops)
drops[#drops+1] = "exchangeclone:constructor"
minetest.remove_node(pos)
return drops
end
local pipeworks_connect = exchangeclone.pipeworks and "^pipeworks_tube_connection_metallic.png" or ""

minetest.register_node("exchangeclone:constructor", {
description = S("Constructor"),
tiles = {
"exchangeclone_constructor_up.png",
"exchangeclone_constructor_down.png",
"exchangeclone_constructor_right.png",
"exchangeclone_constructor_right.png",
"exchangeclone_constructor_right.png",
"exchangeclone_constructor_right.png"
"exchangeclone_constructor_up.png"..pipeworks_connect,
"exchangeclone_constructor_down.png"..pipeworks_connect,
"exchangeclone_constructor_right.png"..pipeworks_connect,
"exchangeclone_constructor_right.png"..pipeworks_connect,
"exchangeclone_constructor_right.png"..pipeworks_connect,
"exchangeclone_constructor_right.png"..pipeworks_connect,
},
groups = {cracky = 2, container = exchangeclone.mcl2 and 2 or 4, pickaxey = 2, tubedevice = 1, tubedevice_receiver = 1},
_mcl_hardness = 3,
_mcl_blast_resistance = 6,
sounds = exchangeclone.sound_mod.node_sound_metal_defaults(),
is_ground_content = false,
can_dig = can_dig,
after_dig_node = function(pos, oldnode, oldmetadata, player)
if exchangeclone.mcl then
local meta = minetest.get_meta(pos)
local meta2 = meta:to_table()
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for _, listname in pairs({"src", "dst", "fuel"}) do
local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
minetest.add_item(p, stack)
end
end
meta:from_table(meta2)
end
end,
can_dig = exchangeclone.can_dig,
after_dig_node = exchangeclone.drop_after_dig({"src", "fuel", "dst"}),
after_place_node = function(pos, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
meta:set_string("exchangeclone_placer", player:get_player_name())
Expand All @@ -190,16 +160,20 @@ minetest.register_node("exchangeclone:constructor", {
on_metadata_inventory_take = function(pos, listname, index, stack, player)
constructor_action(pos)
end,
on_blast = on_blast,
on_blast = exchangeclone.on_blast({"src", "fuel", "dst"}),
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
on_timer = constructor_action,
_mcl_hoppers_on_try_pull = exchangeclone.hoppers_on_try_pull,
_mcl_hoppers_on_try_push = exchangeclone.hoppers_on_try_push,
_mcl_hoppers_on_try_pull = exchangeclone.mcl2_hoppers_on_try_pull(),
_mcl_hoppers_on_try_push = exchangeclone.mcl2_hoppers_on_try_push(nil, function(stack) return stack:get_name() == "exchangeclone:exchange_orb" end),
_mcl_hoppers_on_after_push = function(pos)
minetest.get_node_timer(pos):start(1.0)
end,
_on_hopper_in = exchangeclone.mcla_on_hopper_in(
nil,
function(stack) return stack:get_name() == "exchangeclone:exchange_orb" end
),
})

if exchangeclone.pipeworks then
Expand Down
Loading

0 comments on commit b21c182

Please sign in to comment.