package ljfa.glassshards.util;

import ljfa.glassshards.GlassShards;
import net.minecraft.block.Block;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.BlockPane;
import net.minecraft.block.BlockStainedGlass;
import net.minecraft.block.BlockStainedGlassPane;
import net.minecraft.block.material.Material;

/** Represents a certain type of glass for the purpose of shards */
public class GlassType {
    public static final float mult_block = 1.0f;
    public static final float mult_pane = 0.375f;
    
    public final float multiplier;
    public final boolean isStained;
    public final int color;
    
    public GlassType(float multiplier, boolean stained, int color) {
        this.multiplier = multiplier;
        this.isStained = stained;
        this.color = color;
    }
    
    public GlassType(float multiplier) {
        this(multiplier, false, -1);
    }
    
    /** Checks if the block is some kind of glass
     * @return A GlassShape representing the type, or null if it is not glass
     */
    public static GlassType getType(Block block, int meta) {
        if(GlassShards.chiselHelper != null) {
            GlassType gtype = GlassShards.chiselHelper.getType(block, meta);
            if(gtype != null)
                return gtype;
        }
        
        if(block instanceof BlockGlass)
            return new GlassType(mult_block);
        else if(block instanceof BlockStainedGlass)
            return new GlassType(mult_block, true, meta);
        else if(block instanceof BlockStainedGlassPane)
            return new GlassType(mult_pane, true, meta);
        else if(block instanceof BlockPane && block.getMaterial() == Material.glass)
            return new GlassType(mult_pane);
        else
            return null;
    }
}

@@ -323,97 +323,185 @@
 %0A/**
- Represents a certain type
+%0A * @author ljfa-ag%0A * Represents the traits
  of 
+a 
 glass 
-for the purpose of shards */%0Apublic class GlassType %7B
+block. Or pane or anything made of glass really.%0A */%0Apublic class GlassType %7B%0A    /** The multiplier for glass blocks. */
 %0A   
@@ -546,16 +546,59 @@
 = 1.0f;%0A
+    /** The multiplier for glass panes. */%0A
     publ
@@ -652,107 +652,565 @@
     
-public final float multiplier;%0A    public final boolean isStained;%0A    public final int color;%0A    
+/** How much of a full block's of glass it is worth. */%0A    public final float multiplier;%0A    /** Whether the glass is stained. */%0A    public final boolean isStained;%0A    /** The color of the glass. This is the same as vanilla stained glass metadata. */%0A    public final int color;%0A    %0A    /**%0A     * @param multiplier How much of a full block's of glass it is worth. Should be either mult_block or mult_pane.%0A     * @param stained Whether the glass is stained.%0A     * @param color The color of the glass, just like vanilla stained glass metadata.%0A     */
 %0A   
@@ -1382,24 +1382,198 @@
 %0A    %7D%0A    %0A
+    /**%0A     * Constructor for non-stained glass.%0A     * @param multiplier How much of a full block's of glass it is worth. Should be either mult_block or mult_pane.%0A     */%0A
     public G
@@ -1721,19 +1721,18 @@
  A Glass
-Sha
+Ty
 pe repre

Add comments