use of com.mraof.minestuck.util.GristSet in project Minestuck by mraof.
the class GristCachePacket method generatePacket.
@Override
public MinestuckPacket generatePacket(Object... dat) {
GristSet gristSet = (GristSet) dat[0];
data.writeInt(gristSet.gristTypes.size());
for (Map.Entry<GristType, Integer> entry : gristSet.getMap().entrySet()) {
data.writeInt(entry.getKey().getId());
data.writeInt(entry.getValue());
}
data.writeBoolean((Boolean) dat[1]);
return this;
}
use of com.mraof.minestuck.util.GristSet in project Minestuck by mraof.
the class EntityUnderling method onDeathUpdate.
@Override
protected void onDeathUpdate() {
super.onDeathUpdate();
if (this.deathTime == 20 && !this.world.isRemote) {
GristSet grist = this.getGristSpoils();
if (fromSpawner)
grist.scaleGrist(0.5F);
if (!dropCandy) {
for (GristAmount gristType : grist.getArray()) this.world.spawnEntity(new EntityGrist(world, randX(), this.posY, randZ(), gristType));
} else {
for (GristAmount gristType : grist.getArray()) {
int candy = (gristType.getAmount() + 2) / 4;
int gristAmount = gristType.getAmount() - candy * 2;
if (candy > 0)
this.world.spawnEntity(new EntityItem(world, randX(), this.posY, randZ(), new ItemStack(MinestuckItems.candy, candy, gristType.getType().getId() + 1)));
if (gristAmount > 0)
this.world.spawnEntity(new EntityGrist(world, randX(), this.posY, randZ(), new GristAmount(gristType.getType(), gristAmount)));
}
}
if (this.rand.nextInt(4) == 0)
this.world.spawnEntity(new EntityVitalityGel(world, randX(), this.posY, randZ(), this.getVitalityGel()));
}
}
use of com.mraof.minestuck.util.GristSet in project Minestuck by mraof.
the class MinestuckJeiPlugin method register.
@Override
public void register(IModRegistry registry) {
ArrayList<AlchemiterRecipeWrapper> alchemiterRecipes = new ArrayList<AlchemiterRecipeWrapper>();
for (Map.Entry<List<Object>, GristSet> entry : GristRegistry.getAllConversions().entrySet()) {
for (ItemStack stack : getItemStacks(entry.getKey().get(0), (Integer) entry.getKey().get(1))) {
alchemiterRecipes.add(new AlchemiterRecipeWrapper(stack, entry.getValue()));
}
}
registry.addRecipes(alchemiterRecipes, alchemiterCategory.getUid());
registry.addRecipeCatalyst(new ItemStack(MinestuckBlocks.sburbMachine, 1, BlockSburbMachine.MachineType.ALCHEMITER.ordinal()), alchemiterCategory.getUid());
ArrayList<PunchCardRecipeWrapper> latheRecipes = new ArrayList<PunchCardRecipeWrapper>();
ArrayList<PunchCardRecipeWrapper> designixRecipes = new ArrayList<PunchCardRecipeWrapper>();
for (Map.Entry<List<Object>, ItemStack> entry : CombinationRegistry.getAllConversions().entrySet()) {
List<ItemStack> firstStacks = getItemStacks(entry.getKey().get(0), (Integer) entry.getKey().get(1));
List<ItemStack> secondStacks = getItemStacks(entry.getKey().get(2), (Integer) entry.getKey().get(3));
if (!(firstStacks.isEmpty() || secondStacks.isEmpty())) {
if ((Boolean) entry.getKey().get(4) == CombinationRegistry.MODE_AND) {
latheRecipes.add(new TotemLatheRecipeWrapper(firstStacks, secondStacks, entry.getValue()));
} else {
designixRecipes.add(new DesignixRecipeWrapper(firstStacks, secondStacks, entry.getValue()));
}
}
}
Debug.info("Adding " + (latheRecipes.size() + designixRecipes.size()) + " punch card recipes to the jei plugin");
registry.addRecipes(latheRecipes, totemLatheCategory.getUid());
registry.addRecipes(designixRecipes, designixCategory.getUid());
registry.addRecipeCatalyst(new ItemStack(MinestuckBlocks.sburbMachine, 1, BlockSburbMachine.MachineType.TOTEM_LATHE.ordinal()), totemLatheCategory.getUid());
registry.addRecipeCatalyst(new ItemStack(MinestuckBlocks.sburbMachine, 1, BlockSburbMachine.MachineType.PUNCH_DESIGNIX.ordinal()), designixCategory.getUid());
}
use of com.mraof.minestuck.util.GristSet in project Minestuck by mraof.
the class Minegicka3Support method registerRecipes.
@Override
public void registerRecipes() throws Exception {
Item thingy = ((Item) (Class.forName("com.williameze.minegicka3.ModBase").getField("thingy").get(null)));
Item thingy2 = ((Item) (Class.forName("com.williameze.minegicka3.ModBase").getField("thingyGood").get(null)));
Item thingy3 = ((Item) (Class.forName("com.williameze.minegicka3.ModBase").getField("thingySuper").get(null)));
Item stick = ((Item) (Class.forName("com.williameze.minegicka3.ModBase").getField("stick").get(null)));
Item stick2 = ((Item) (Class.forName("com.williameze.minegicka3.ModBase").getField("stickGood").get(null)));
Item stick3 = ((Item) (Class.forName("com.williameze.minegicka3.ModBase").getField("stickSuper").get(null)));
GristRegistry.addGristConversion(new ItemStack(thingy), false, new GristSet(new GristType[] { GristType.Rust, GristType.Gold }, new int[] { 16, 16 }));
CombinationRegistry.addCombination(new ItemStack(thingy), new ItemStack(Items.STICK), CombinationRegistry.MODE_AND, new ItemStack(stick));
CombinationRegistry.addCombination(new ItemStack(thingy2), new ItemStack(Items.STICK), CombinationRegistry.MODE_AND, new ItemStack(stick2));
CombinationRegistry.addCombination(new ItemStack(thingy3), new ItemStack(Items.STICK), CombinationRegistry.MODE_AND, new ItemStack(stick3));
}
use of com.mraof.minestuck.util.GristSet in project Minestuck by mraof.
the class TinkersConstructSupport method registerRecipes.
@Override
public void registerRecipes() throws Exception {
Block oreBush1 = ((Block) Class.forName("tconstruct.world.TinkerWorld").getField("oreBerry").get(null));
Block oreBush2 = ((Block) Class.forName("tconstruct.world.TinkerWorld").getField("oreBerrySecond").get(null));
String[] items1 = { "ingotIron", "ingotGold", "ingotCopper", "ingotTin" };
GristRegistry.addGristConversion(new ItemStack(oreBush1, 1, 0), new GristSet(new GristType[] { GristType.Rust, GristType.Build, GristType.Amber }, new int[] { 16, 1, 1 }));
GristRegistry.addGristConversion(new ItemStack(oreBush1, 1, 1), new GristSet(new GristType[] { GristType.Gold, GristType.Build, GristType.Amber }, new int[] { 16, 1, 1 }));
GristRegistry.addGristConversion(new ItemStack(oreBush1, 1, 2), new GristSet(new GristType[] { GristType.Rust, GristType.Cobalt, GristType.Build, GristType.Amber }, new int[] { 16, 3, 1, 1 }));
GristRegistry.addGristConversion(new ItemStack(oreBush1, 1, 3), new GristSet(new GristType[] { GristType.Rust, GristType.Caulk, GristType.Build, GristType.Amber }, new int[] { 16, 8, 1, 1 }));
GristRegistry.addGristConversion(new ItemStack(oreBush2, 1, 0), new GristSet(new GristType[] { GristType.Rust, GristType.Chalk, GristType.Build, GristType.Amber }, new int[] { 16, 6, 1, 1 }));
GristRegistry.addGristConversion(new ItemStack(oreBush2, 1, 1), new GristSet(new GristType[] { GristType.Uranium, GristType.Quartz, GristType.Diamond, GristType.Ruby, GristType.Build, GristType.Amber }, new int[] { 8, 1, 4, 4, 1, 1 }));
for (int i = 0; i < items1.length; i++) CombinationRegistry.addCombination("treeLeaves", items1[i], CombinationRegistry.MODE_AND, new ItemStack(oreBush1, 1, i));
CombinationRegistry.addCombination("treeLeaves", "ingotAluminium", CombinationRegistry.MODE_AND, new ItemStack(oreBush2, 1, 0));
CombinationRegistry.addCombination("treeLeaves", Items.EXPERIENCE_BOTTLE, 0, CombinationRegistry.MODE_AND, new ItemStack(oreBush2, 1, 1));
}
Aggregations