minecraft_items 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b5c94838ed5eb5a33eb9d117c557855fea93c587059d546b33366721a694d3b
4
- data.tar.gz: c23585a9d6397ea04c5af037f60757b858252bb9e3abb15821560d762c57c183
3
+ metadata.gz: 41511a9b8e715a1cf1e4fdb1892bc5a46696eeb9323fb315843bbd5b113f32c1
4
+ data.tar.gz: 14f194c56b4e37b08814e6032d52a00c9089f2d5eb4a4cf1adf0cf747e759fd8
5
5
  SHA512:
6
- metadata.gz: 6036ca1850bb0689c7c0109c4cdfe026b6345661b7104281f565bebd67dd2057c6ec8b27048973b843149e5613284cecdf517c9a4a08efe381530c755c19ebb1
7
- data.tar.gz: 99b582213a442041fc8d202ac37f5f82608e02a56117c989c156d2c3e855b9a1019d33dda1e161171337b6fd58ec1eac02f35be31ed62a4a239cd9f1b5d32d8e
6
+ metadata.gz: d1257c21053b9fe531f73b587f7d6276700114851f64fe17a08bf5fcd6b957d883fc940fc570e3f94c5cbcd7016d142b66af141e44260aae26e192e867c41f8f
7
+ data.tar.gz: 0f2c08f7dc3bf386fad3eb04015f8fc2ddf68f6a9c04ecfd2e50e45e6ac9a3cd6214aa06f30c38f21409ef5c819211725d0806beff9315ebed29ab5ecd5574ae
data/README.md CHANGED
@@ -23,14 +23,40 @@ glazed_terracotta_types
23
23
  utility_types
24
24
  ```
25
25
  These types all have variants or other items that can be made from them.
26
- As there is more variants than types and to keep the instructions short and sweet, please go to the variants.xml file for a full list of them.
26
+ As there is more variants than types and to keep the instructions short and sweet, please go to the variants.xml file or running
27
+ ```
28
+ MinecraftItems.minecraft_variants
29
+ ```
30
+ for a full list of them.
27
31
 
28
32
  To retrieve a list of all minecraft wood types do this:
33
+
29
34
  ```
35
+ MinecraftItems.wood_types
30
36
 
31
- # Full list of types of items
32
- Minecraft.wood_types
33
- # =>
37
+ =>
34
38
  ['oak', 'spruce', 'birch', 'jungle', 'acacia', 'dark oak', 'crimson', 'warped', 'mangrove']
39
+ ```
35
40
 
41
+ Subsequently, after seeing the wood_types and wanted to know the variants for one of the types, let's say spruce, I would:
36
42
  ```
43
+ MinecraftItems.spruce_variants
44
+ =>
45
+ ["Spruce Door",
46
+ "Spruce Fence",
47
+ "Spruce Fence Gate",
48
+ "Spruce Log",
49
+ "Spruce Planks",
50
+ "Spruce Sign",
51
+ "Spruce Slab",
52
+ "Spruce Stairs",
53
+ "Spruce Trapdoor",
54
+ "Spruce Wood",
55
+ "Stripped Spruce Log",
56
+ "Stripped Spruce Wood"]
57
+ ```
58
+ It should also be noted that both type and variant data is in the form of a hash where the name of the types or variants (e.g. wood_types or spruce_variants) is the key and the value is an array of strings for the pertinent type or variant.
59
+ ```
60
+ wood_types hash example
61
+ wood_types: ["oak", "spruce", "birch", "jungle", "acacia", "dark oak", "mangrove", "crimson", "warped"]
62
+ ```
@@ -1,12 +1,16 @@
1
1
  require 'active_support/core_ext/hash/indifferent_access'
2
- require 'block_types' #first require block types. This includes the modules that contain the methods for loading the minecraft item hashes
2
+ require 'block_types'
3
3
 
4
- class MinecraftItems #make a Minecraft parent class
5
- class << self #and make all the methods inside class methods?
6
- include BlockTypes
7
- #if not it will default to this which is just an error method
8
- def method_missing(method_name)
9
- if method_name.to_s.include?("_variants")
4
+ class MinecraftItems
5
+ class << self
6
+ include BlockTypes
7
+
8
+ def method_missing(method_name)
9
+ if method_name.to_s.include?("all_types")
10
+ minecraft_types
11
+ elsif method_name.to_s.include?("all_variants")
12
+ minecraft_variants
13
+ elsif method_name.to_s.include?("_variants")
10
14
  minecraft_variants[method_name]
11
15
  elsif method_name.to_s.include?("_types")
12
16
  minecraft_types[method_name]
@@ -1,13 +1,11 @@
1
- $:.push File.expand_path("../lib", __FILE__)
2
-
3
1
  Gem::Specification.new do |s|
4
2
  s.name = 'minecraft_items'
5
- s.version = '0.1.2'
3
+ s.version = '0.1.4'
6
4
  s.licenses = ['MIT']
7
5
  s.summary = "A list of most minecraft items"
8
6
  s.description = "With a few simple commands return all the types of blocks as well as each types variant."
9
7
  s.authors = ["Maximilian Alexander", "Zane Sandin"]
10
8
  s.email = 'maxx.stack15@gmail.com'
11
9
  s.homepage = 'https://github.com/malexander15/minecraft_items'
12
- s.files = Dir['lib/block_types.rb', 'lib/item_list.rb', 'lib/minecraft_items.rb', 'lib/concerns/*.rb', 'lib/concerns/*.yml', 'minecraft_items.gemspec', 'README.md', 'LICENSE.md', 'Gemfile']
10
+ s.files = Dir['lib/block_types.rb', 'lib/minecraft_items.rb', 'lib/concerns/*.rb', 'lib/concerns/*.yml', 'minecraft_items.gemspec', 'README.md', 'LICENSE.md', 'Gemfile']
13
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minecraft_items
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximilian Alexander
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-13 00:00:00.000000000 Z
12
+ date: 2023-03-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: With a few simple commands return all the types of blocks as well as
15
15
  each types variant.
@@ -26,7 +26,6 @@ files:
26
26
  - lib/concerns/minecraft_variants.rb
27
27
  - lib/concerns/types.yml
28
28
  - lib/concerns/variants.yml
29
- - lib/item_list.rb
30
29
  - lib/minecraft_items.rb
31
30
  - minecraft_items.gemspec
32
31
  homepage: https://github.com/malexander15/minecraft_items
data/lib/item_list.rb DELETED
@@ -1,37 +0,0 @@
1
- WOODS = {
2
- "Acacia" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
3
- "Oak" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
4
- "Birch" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
5
- "Jungle" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
6
- "Dark Oak" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
7
- "Spruce" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
8
- "Spruce" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
9
- "Crimson" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
10
- "Warped" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"],
11
- "Mangrove" => ["Block", "Slab", "Stairs", "Fence", "Gate", "Trapdoor", "Pressure plate"]
12
- }
13
- ROCKS = {
14
- "Stone" => ["Slab", "Stairs", "Wall"],
15
- "Smooth Stone" => ["Slab", "Stairs", "Wall"],
16
- "Cobblestone" => ["Slab", "Stairs", "Wall"],
17
- "Stone Brick" => ["Slab", "Stairs", "Wall"],
18
- "Andesite" => ["Slab", "Stairs", "Wall"],
19
- "Polished Andesite",["Slab", "Stairs", "Wall"],
20
- "Diorite" => ["Slab", "Stairs", "Wall"],
21
- "Polished Diorite" => ["Slab", "Stairs", "Wall"],
22
- "Granite" => ["Slab", "Stairs", "Wall"],
23
- "Polished Granite" => ["Slab", "Stairs", "Wall"],
24
- "Sandstone" => ["Slab", "Stairs", "Wall"],
25
- "Red Sandstone" => ["Slab", "Stairs", "Wall"],
26
- "Brick" => ["Slab", "Stairs", "Wall"],
27
- "Prismarine" => ["Slab", "Stairs", "Wall"],
28
- "Nether Brick" => ["Slab", "Stairs", "Wall"],
29
- "Quartz" => ["Slab", "Stairs", "Wall"],
30
- "Purpur" => ["Slab", "Stairs", "Wall"],
31
- "Endstone" => ["Slab", "Stairs", "Wall"],
32
- "Blackstone" => ["Slab", "Stairs", "Wall"],
33
- "Copper" => ["Slab", "Stairs", "Wall"],
34
- "Deepslate" => ["Slab", "Stairs", "Wall"],
35
- "Mud" => ["Slab", "Stairs", "Wall"]
36
- }
37
- REDSTONE = %w(Comparator Repeater Redstone_dust Redstone_torch Sculk Target_block Tripwire Button Pressure_plate Dispenser Dropper Hopper Chest Piston Stick_piston Activator_rails Detector_rails Powered_rails Rails Jukebox Notblock TNT Iron)