Permalink
Browse files

Painting the town: Adding Paintslinger API support

  • Loading branch information...
1 parent 8bc9f81 commit ae6af3d1825498a173ee226aa3ef9a7c655ce096 ShadowFox committed Oct 21, 2015
View
@@ -31,3 +31,31 @@ Thumbs.db
*.jar
!/gradle/wrapper/gradle-wrapper.jar
!GardenOfGlass.jar
+
+### OSX (adds a lot of garbage)###
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
@@ -84,6 +84,7 @@
public static Map<String, Integer> oreWeightsNether = new HashMap<String, Integer>();
public static Map<Item, Block> seeds = new HashMap();
public static Set<Item> looniumBlacklist = new LinkedHashSet();
+ public static Set<Block> paintableBlocks = new LinkedHashSet<Block>();
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18);
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
@@ -228,6 +229,12 @@
registerModWiki("GanysSurface", new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s"));
registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s"));
registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s"));
+
+ registerPaintableBlock(Blocks.stained_glass);
+ registerPaintableBlock(Blocks.stained_glass_pane);
+ registerPaintableBlock(Blocks.stained_hardened_clay);
+ registerPaintableBlock(Blocks.wool);
+ registerPaintableBlock(Blocks.carpet);
}
/**
@@ -268,6 +275,14 @@ public static Brew getBrewFromKey(String key) {
}
/**
+ * Registers a paintableBlock and returns it.
+ */
+ public static Block registerPaintableBlock(Block paintable){
+ paintableBlocks.add(paintable);
+ return paintable;
+ }
+
+ /**
* Registers a Petal Recipe.
* @param output The ItemStack to craft.
* @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper
@@ -392,6 +392,9 @@ public static void init() {
OreDictionary.registerOre("chestWood", Blocks.chest);
OreDictionary.registerOre("craftingTableWood", Blocks.crafting_table);
+ BotaniaAPI.registerPaintableBlock(unstableBlock);
+ BotaniaAPI.registerPaintableBlock(manaBeacon);
+
initTileEntities();
}
@@ -22,23 +22,13 @@
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.util.ForgeDirection;
+import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
public class LensPaint extends Lens {
- static final List<Block> paintableBlocks = new ArrayList() {{
- add(Blocks.stained_glass);
- add(Blocks.stained_glass_pane);
- add(Blocks.stained_hardened_clay);
- add(Blocks.wool);
- add(Blocks.carpet);
- add(ModBlocks.unstableBlock);
- add(ModBlocks.manaBeacon);
- }
- };
-
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
int storedColor = ItemLens.getStoredColor(stack);
@@ -54,7 +44,7 @@ public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObje
dead = true;
} else {
Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
- if(paintableBlocks.contains(block)) {
+ if(BotaniaAPI.paintableBlocks.contains(block)) {
int meta = entity.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ);
List<ChunkCoordinates> coordsToPaint = new ArrayList();
List<ChunkCoordinates> coordsFound = new ArrayList();

0 comments on commit ae6af3d

Please sign in to comment.