minecraft_items 0.1.3 → 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: ea0afe68a5c059f2044e9ae46bafaac8f96fcdd8006f97c152d78428733df5a5
4
- data.tar.gz: 4519a1275cd10268b41e4469c478d481d18b4123c821b9dcd3f01ef3a5658822
3
+ metadata.gz: 41511a9b8e715a1cf1e4fdb1892bc5a46696eeb9323fb315843bbd5b113f32c1
4
+ data.tar.gz: 14f194c56b4e37b08814e6032d52a00c9089f2d5eb4a4cf1adf0cf747e759fd8
5
5
  SHA512:
6
- metadata.gz: e2c2767d450f4b96a7fd53e8423f1efc817b4aa7a817d21282594efe963caaf37c6c3916c7d43e5aed5668f85fa436eec1c73dec54fc6f7cdb0bf763096c3f55
7
- data.tar.gz: 3be37bfecd8c45dc00a2cd2ce7da704a155fcd5f7bd28e27ac4fcdda04394c477638d5d7f2432740e9261ca5c8acfee8fbbfd84ce16aac65ff7ccb8c68cf774a
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,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'minecraft_items'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "A list of most minecraft items"
6
6
  s.description = "With a few simple commands return all the types of blocks as well as each types variant."
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.3
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-15 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.