@@ -0,0 +1,564 @@
+package com.ezardlabs.lostsector.objects;%0A%0Aimport java.util.List;%0A%0Apublic class DropTable %7B%0A%09private final List%3CString%3E prefabNames;%0A%09private final List%3CFloat%3E chances;%0A%0A%09public DropTable(List%3CString%3E prefabNames, List%3CFloat%3E chances) %7B%0A%09%09this.prefabNames = prefabNames;%0A%09%09this.chances = chances;%0A%09%7D%0A%0A%09public String getDrop() %7B%0A%09%09double rand = Math.random();%0A%09%09float total = 0;%0A%09%09for (int i = 0; i %3C chances.size(); i++) %7B%0A%09%09%09if (rand %3C chances.get(i) + total) %7B%0A%09%09%09%09return prefabNames.get(i);%0A%09%09%09%7D else %7B%0A%09%09%09%09total += chances.get(i);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%7D%0A

Add drop table