Skip to content

Commit

Permalink
Redstone lamp added, can be enabled/disabled using right-click.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Mar 29, 2020
1 parent c901c6f commit 743ee7b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Texture packs
texturepacks
texturepacks/*
!texturepacks/minecraft

# Temporary editor files
Expand Down
2 changes: 1 addition & 1 deletion mods/creative_inventory/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
function show_creative_window(client, screen_width, screen_height, gui_scale)
items = {}
for k, v in pairs(openminer:registry():items()) do
if k ~= 1 then
if k ~= 1 and not v:has_group("group:ci_ignore") then
items[#items + 1] = {v:string_id()}
end
end
Expand Down
29 changes: 28 additions & 1 deletion mods/default/blocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ mod:block {
tiles = "oak_planks.png",

groups = {
om_planks = 1
default_planks = 1
}
}

Expand Down Expand Up @@ -288,3 +288,30 @@ mod:block {
inventory_image = "reeds_item.png"
}

mod:block {
id = "redstone_lamp_off",
name = "Redstone Lamp",
tiles = "redstone_lamp_off.png",

on_block_activated = function(pos, player, world, client, server, screen_width, screen_height, gui_scale)
local block = openminer:registry():get_block_from_string("default:redstone_lamp_on")
world:set_block(pos.x, pos.y, pos.z, block:id())
end
}

mod:block {
id = "redstone_lamp_on",
name = "Redstone Lamp",
tiles = "redstone_lamp_on.png",
is_light_source = true,

groups = {
ci_ignore = 1
},

on_block_activated = function(pos, player, world, client, server, screen_width, screen_height, gui_scale)
local block = openminer:registry():get_block_from_string("default:redstone_lamp_off")
world:set_block(pos.x, pos.y, pos.z, block:id())
end
}

4 changes: 2 additions & 2 deletions mods/default/recipes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ mod:crafting_recipe {
'#'
},

keys = {['#'] = "group:om_planks"}
keys = {['#'] = "group:default_planks"}
}

-- Planks
Expand All @@ -536,7 +536,7 @@ mod:crafting_recipe {
"##",
"##"
},
keys = {["#"] = "group:om_planks"}
keys = {["#"] = "group:default_planks"}
}

-- Furnace
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/default/textures/blocks/redstone_lamp_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added texturepacks/minecraft/blocks/redstone_lamp_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added texturepacks/minecraft/blocks/redstone_lamp_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 743ee7b

Please sign in to comment.