diff --git a/Classes/IJInventoryItem.m b/Classes/IJInventoryItem.m index 524feb4..0225c22 100644 --- a/Classes/IJInventoryItem.m +++ b/Classes/IJInventoryItem.m @@ -62,38 +62,47 @@ NSUInteger itemsPerRow = 9; NSUInteger pixelsPerColumn = 36; NSUInteger pixelsPerRow = 56; + NSImage *atlas; + BOOL notFound = FALSE; int index = 0; - if (itemId <= 92) + if (itemId <= 94) { - if (itemId <= 25) + if (itemId <= 17) index = itemId - 1; // first item is 1 - else if (itemId == 35) - index = itemId - (35 - 25); + else if (itemId <= 35 ) + index = itemId + 1; else if (itemId >= 37) - index = itemId - (37 - 26); + index = itemId + 6; atlasOffset = NSMakePoint(36, 75); } - else if (itemId >= 256 && itemId <= 355) + else if (itemId >= 256 && itemId <= 351) { index = itemId - 256; - atlasOffset = NSMakePoint(445, 23+52); + atlasOffset = NSMakePoint(445, 75); + } + else if (itemId >= 352 && itemId <= 356) + { + index = itemId - 241; + atlasOffset = NSMakePoint(445, 75); } else if (itemId == 2256) { index = 0; - atlasOffset = NSMakePoint(445, pixelsPerRow*12+17); + atlasOffset = NSMakePoint(445+pixelsPerColumn*8, pixelsPerRow*13 + 18); } else if (itemId == 2257) { index = 0; - atlasOffset = NSMakePoint(445+pixelsPerColumn, pixelsPerRow*12+17); + atlasOffset = NSMakePoint(445, pixelsPerRow*14+18); } else { NSLog(@"%s error: unrecognized item id %d", __PRETTY_FUNCTION__, itemId); - return nil; + index = 0; + atlasOffset = NSMakePoint(1, 30); + notFound = TRUE; } atlasOffset.x += pixelsPerColumn * (index % itemsPerRow); @@ -101,8 +110,12 @@ NSRect atlasRect = NSMakeRect(atlasOffset.x, atlasOffset.y, itemImageSize.width, itemImageSize.height); - - NSImage *atlas = [NSImage imageNamed:@"DataValuesV110Transparent.png"]; + if (notFound != TRUE) { + atlas = [NSImage imageNamed:@"DataValuesV110Transparent.png"]; + }else { + atlas = [NSImage imageNamed:@"blockNotFound.png"]; + } + NSImage *output = [[NSImage alloc] initWithSize:itemImageSize]; atlasRect.origin.y = atlas.size.height - atlasRect.origin.y; diff --git a/Images/DataValuesV110.png b/Images/DataValuesV110.png index d2965b2..e423fe0 100644 Binary files a/Images/DataValuesV110.png and b/Images/DataValuesV110.png differ diff --git a/Images/DataValuesV110Transparent.png b/Images/DataValuesV110Transparent.png index 1ff1fa8..454000a 100644 Binary files a/Images/DataValuesV110Transparent.png and b/Images/DataValuesV110Transparent.png differ diff --git a/Images/blockNotFound.png b/Images/blockNotFound.png new file mode 100644 index 0000000..b535f50 Binary files /dev/null and b/Images/blockNotFound.png differ diff --git a/InsideJob.xcodeproj/project.pbxproj b/InsideJob.xcodeproj/project.pbxproj index 6e3810c..1392ea4 100644 --- a/InsideJob.xcodeproj/project.pbxproj +++ b/InsideJob.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 256AC3DA0F4B6AC300CF3369 /* InsideJobAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* InsideJobAppDelegate.m */; }; + 663803B2131769E90015CFAD /* blockNotFound.png in Resources */ = {isa = PBXBuildFile; fileRef = 663803B1131769E90015CFAD /* blockNotFound.png */; }; 668B2556125D5A3E0060BF71 /* NBTContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 668B2555125D5A3E0060BF71 /* NBTContainer.m */; }; 668B255C125D5BCA0060BF71 /* NSData+CocoaDevAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 668B255B125D5BCA0060BF71 /* NSData+CocoaDevAdditions.m */; }; 668B2560125D5C1C0060BF71 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 668B255F125D5C1C0060BF71 /* libz.dylib */; }; @@ -42,6 +43,7 @@ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 663803B1131769E90015CFAD /* blockNotFound.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blockNotFound.png; sourceTree = ""; }; 668B2554125D5A3E0060BF71 /* NBTContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NBTContainer.h; sourceTree = ""; }; 668B2555125D5A3E0060BF71 /* NBTContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NBTContainer.m; sourceTree = ""; }; 668B255A125D5BCA0060BF71 /* NSData+CocoaDevAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+CocoaDevAdditions.h"; sourceTree = ""; }; @@ -225,6 +227,7 @@ 66BC07711262823E005A23F4 /* Images */ = { isa = PBXGroup; children = ( + 663803B1131769E90015CFAD /* blockNotFound.png */, 66BCFE61125FCEC6005A23F4 /* DataValuesV110Transparent.png */, 66BCFC35125EA53E005A23F4 /* InsideJob.icns */, ); @@ -291,6 +294,7 @@ 66BCFC36125EA53E005A23F4 /* InsideJob.icns in Resources */, 66BCFE62125FCEC6005A23F4 /* DataValuesV110Transparent.png in Resources */, 66BC077312628257005A23F4 /* ItemPropertiesView.xib in Resources */, + 663803B2131769E90015CFAD /* blockNotFound.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Items.csv b/Items.csv index 4882e68..a2277ec 100644 --- a/Items.csv +++ b/Items.csv @@ -18,8 +18,8 @@ 18,Leaves 19,Sponge 20,Glass -21,Lapis Lazui Ore -22,Lapis Lazui Block +21,Lapis Lazuli Ore +22,Lapis Lazuli Block 23,Dispenser 24,Sandstone 25,Note Block @@ -32,6 +32,10 @@ 42,Iron Block 43,Double Step 44,Step +# 44,Stone Step, 0 +# 44,Sandstone Step, 1 +# 44,Wodden Step, 2 +# 44,Cobblestone Step, 3 45,Brick 46,TNT 47,Bookcase @@ -80,6 +84,8 @@ 90,Portal 91,Jack-O-Lantern 92,Cake Block +93,Redstone Repeater (off) +94,Redstone Repeater (on) 256,Iron Spade 257,Iron Pickaxe 258,Iron Axe @@ -175,9 +181,28 @@ 348,Glowstone Dust 349,Raw Fish 350,Cooked Fish -351,Ink Sack +#Dye +#351,Ink sack,0 +#351,Rose Red,1 +#351,Cactus Green,2 +#351,Brown,3 +#351,Lapis Lazuli Dye,4 +#351,Purple Dye,5 +#351,Cyan Dye,6 +#351,Light Gray Dye,7 +#351,Gray Dye,8 +#351,Pink Dye,9 +#351,Lime Dye,10 +#351,Dandelion Yellow Dye,11 +#351,Light Blue Dye,12 +#351,Magenta Dye,13 +#351,Orange Dye,14 +#351,Bone Meal,15 +351,Dye +#Dye End 352,Bone 353,Sugar 354,Cake +355,Bed 2256,Gold Record -2257,Green Record +2257,Green Record \ No newline at end of file