Skip to content

Commit

Permalink
vials in multiplayer second try
Browse files Browse the repository at this point in the history
  • Loading branch information
TobibusFate committed Nov 2, 2022
1 parent 94087d3 commit 3316ffa
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ CurseForge page:
- ~~Add some commands to get metalminds charged.~~ [v1.2.1]
- ~~Add some advancements.~~ [v1.2.2]
- ~~Add command for Charged MetalMinds~~ [v1.2.2]
- ~~Vials in mutiplayer~~ [v1.2.3]
- ~~Vials in mutiplayer~~ [v1.2.4]
- Banners with metals symbols.
- Do steel flying more comfortable. (Its not a priority)
- Add sound effects.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}


version = '1.19.2-1.2.3'
version = '1.19.2-1.2.4'

group = 'net.rudahee.metallics_arts' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'metallics_arts'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,21 @@ public LargeVialItemRecipe(ResourceLocation location) {

@Override
public boolean matches(CraftingContainer inv, Level world) {
ItemStack actualIngredient = null;
boolean[] ingredients = {false, false};
int cantMaxPep = 10;
ItemStack actualIngredient;
boolean hasVial = false;

int[] metalsEnVial = new int[MetalsNBTData.values().length];
Arrays.fill(metalsEnVial,0);
int[] cantStorage = new int[MetalsNBTData.values().length];
Arrays.fill(cantStorage,0);
boolean[] addMetal = new boolean[MetalsNBTData.values().length];
Arrays.fill(addMetal,false);
boolean[] ingredients = {false, false};
boolean hasVial = false;
int cantMaxPep = 10;

for (MetalsNBTData metal : MetalsNBTData.values()) {
cantStorage[metal.getIndex()] = metal.getMaxAllomanticTicksStorage()/cantMaxPep;
}

for(int i = 0; i < inv.getContainerSize(); i++) {
actualIngredient = inv.getItem(i);
Expand All @@ -69,14 +74,23 @@ public boolean matches(CraftingContainer inv, Level world) {
hasVial = true;
}
if (actualIngredient.hasTag()){
for (MetalsNBTData metal : MetalsNBTData.values()) {
if (actualIngredient.getTag().contains(metal.getGemNameLower())){
metalsEnVial[metal.getIndex()] = actualIngredient.getTag().getInt(metal.getNameLower());
}
}
}
ingredients[0] = true;

/*if (actualIngredient.hasTag()){
for (MetalsNBTData metal : MetalsNBTData.values()) {
if (actualIngredient.getTag().contains(metal.getGemNameLower())){
cantStorage[metal.getIndex()] = metal.getMaxAllomanticTicksStorage()/cantMaxPep;
metalsEnVial[metal.getIndex()] = actualIngredient.getTag().getInt(metal.getNameLower());
}
}
ingredients[0] = true;
}
}*/
}
auxiliar = actualIngredient;
if (INGREDIENT_NUGGET.stream().anyMatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class SmallVialItemRecipe extends CustomRecipe {
if (!ModItems.ITEM_METAL_NUGGET.get("lead").getDescriptionId().equals(metal.getDescriptionId())
&& !ModItems.ITEM_METAL_NUGGET.get("silver").getDescriptionId().equals(metal.getDescriptionId())
&& !ModItems.ITEM_METAL_NUGGET.get("nickel").getDescriptionId().equals(metal.getDescriptionId())) {

add(Ingredient.of(metal.asItem()));
}
add(Ingredient.of(Items.IRON_NUGGET.asItem()));
Expand All @@ -50,6 +49,12 @@ public SmallVialItemRecipe(ResourceLocation location) {

@Override
public boolean matches(CraftingContainer inv, Level world) {
boolean[] ingredients = {false, false};
int cantMaxPep = 5;
ItemStack actualIngredient;
boolean hasVial = false;


int[] metalsEnVial = new int[MetalsNBTData.values().length];
Arrays.fill(metalsEnVial,0);

Expand All @@ -59,25 +64,27 @@ public boolean matches(CraftingContainer inv, Level world) {
boolean[] addMetal = new boolean[MetalsNBTData.values().length];
Arrays.fill(addMetal,false);


boolean[] ingredients = {false, false};

int cantMaxPep = 5;
ItemStack actualIngredient = null;

boolean hasVial = false;

for (MetalsNBTData metal : MetalsNBTData.values()) {
cantStorage[metal.getIndex()] = (metal.getMaxAllomanticTicksStorage()/2)/cantMaxPep;
}
for(int i = 0; i < inv.getContainerSize(); i++) {
actualIngredient = inv.getItem(i);
if (actualIngredient != null && !actualIngredient.isEmpty()) {
if (INGREDIENT_VIAL.test(inv.getItem(i))) {
System.out.println("algo");
if (hasVial) {
return false;
} else {
hasVial = true;
}
if (actualIngredient.hasTag()){
for (MetalsNBTData metal : MetalsNBTData.values()) {
if (actualIngredient.getTag().contains(metal.getGemNameLower())){
metalsEnVial[metal.getIndex()] = actualIngredient.getTag().getInt(metal.getNameLower());
}
}
}
ingredients[0] = true;
/*if (actualIngredient.hasTag()){
for (MetalsNBTData metal : MetalsNBTData.values()) {
if (actualIngredient.getTag().contains(metal.getGemNameLower())){
cantStorage[metal.getIndex()] = (metal.getMaxAllomanticTicksStorage()/2)/cantMaxPep;
Expand All @@ -86,6 +93,7 @@ public boolean matches(CraftingContainer inv, Level world) {
}
ingredients[0] = true;
}
*/
}
auxiliar = actualIngredient;

Expand Down

0 comments on commit 3316ffa

Please sign in to comment.