Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
Should be almost 100% accurate and craft fast at 0 delay setting. Tested on 200+ ping.
  • Loading branch information
PK268 committed Jan 16, 2025
1 parent 7cbb6a5 commit 7815094
Show file tree
Hide file tree
Showing 2 changed files with 227 additions and 49 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G

#properties
minecraft_version = 1.20.1
plugin_version = 1.0.1
plugin_version = 1.1.0
maven_group = org.rocket3
archives_base_name = rocket3
fabric_loader_version = 0.16.7
274 changes: 226 additions & 48 deletions src/main/java/org/rocket3/Rocket3Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,39 @@ public boolean CheckRecipe(boolean paper, AbstractContainerMenu containerMenu)

return true;
}
return false;
else
{
for(int inventorySlot = 1; inventorySlot <= 3; inventorySlot++)
{
if(containerMenu.getSlot(inventorySlot).hasItem())
{
if(!containerMenu.getSlot(inventorySlot).getItem().getDisplayName().getString().equals("[Gunpowder]"))
{
return false;
}
}
else
{
return false;
}
}
if(!containerMenu.getSlot(4).getItem().getDisplayName().getString().equals("[Paper]"))
{
return false;
}

for(int inventorySlot = 5; inventorySlot <= 9; inventorySlot++)
{
if(containerMenu.getSlot(inventorySlot).hasItem())
{
return false;
}
}

return true;
}
}
public void CorrectRecipe(boolean paper, AbstractContainerMenu containerMenu)
public boolean CorrectRecipe(boolean paper, AbstractContainerMenu containerMenu)
{
if(paper)
{
Expand All @@ -120,6 +150,56 @@ public void CorrectRecipe(boolean paper, AbstractContainerMenu containerMenu)
catch (Exception e){}
}
}
if(!CheckRecipe(paper,containerMenu))
{
for(int inventorySlot = 1; inventorySlot <= 9; inventorySlot++)
{
if(containerMenu.getSlot(inventorySlot).hasItem())
{
try
{
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(inventorySlot, true);
}
catch (Exception e){}
}
}
return false;
}
return true;
}
else
{
for(int inventorySlot = 5; inventorySlot <= 9; inventorySlot++)
{
if(containerMenu.getSlot(inventorySlot).hasItem())
{
try
{
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(inventorySlot, true);

}
catch (Exception e){}
}
}
if(!CheckRecipe(paper,containerMenu))
{
for(int inventorySlot = 1; inventorySlot <= 9; inventorySlot++)
{
if(containerMenu.getSlot(inventorySlot).hasItem())
{
try
{
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(inventorySlot, true);
}
catch (Exception e){}
}
}
return false;
}
return true;
}
}
private static final ExecutorService executor = Executors.newFixedThreadPool(2);
Expand All @@ -132,10 +212,10 @@ public void CorrectRecipe(boolean paper, AbstractContainerMenu containerMenu)
@Subscribe
private void onUpdate(EventUpdate event) {
if(activated)
fillCraftingGridWithDirt();
rocket3Update();
}
Minecraft minecraft = Minecraft.getInstance();
public void fillCraftingGridWithDirt() {
public void rocket3Update() {
if (!(minecraft.screen instanceof CraftingScreen)) {
return; // Not in a crafting table GUI
}
Expand Down Expand Up @@ -192,7 +272,7 @@ public void fillCraftingGridWithDirt() {
{
try
{
Thread.sleep(delay.getValue());
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(j, true);
}
catch (Exception e)
Expand All @@ -212,9 +292,36 @@ public void fillCraftingGridWithDirt() {
if(minecraft.screen instanceof CraftingScreen && stack.getCount() == 64 && stack.getDisplayName().getString().equals("[Gunpowder]"))
{
try {
Thread.sleep(delay.getValue());

InventoryUtils.clickSlot(inventorySlot, true);
if(!CheckRecipe(false, containerMenu))
{
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(inventorySlot, true);
}
else
{
if(!CorrectRecipe(false,containerMenu))
return;
if(CheckRecipe(false,containerMenu))
{
try{

Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getTag().toString().equals("{Fireworks:{Flight:3b}}") && CheckRecipe(false,containerMenu))
{

InventoryUtils.clickSlot(0, true); //Grab the rockets
totalCrafted += 64*3;
if(countCrafted.getValue())
ChatUtils.print("Crafted! Total this session: " + totalCrafted);
break;
}
}
catch (Exception e)
{

}
}
}
}
catch (Exception e)
{
Expand All @@ -227,21 +334,85 @@ public void fillCraftingGridWithDirt() {
{
if(minecraft.screen instanceof CraftingScreen && stack.getCount() == 64 && stack.getDisplayName().getString().equals("[Paper]"))
{
try {
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(inventorySlot, true);
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(0, true); //Grab the fireworks
totalCrafted += 64*3;
if(countCrafted.getValue())
ChatUtils.print("Crafted! Total this session: " + totalCrafted);
if(!CheckRecipe(false, containerMenu))
{
try {
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(inventorySlot, true);
}
catch (Exception e)
{}
}
catch (Exception e)
else
{

if(!CorrectRecipe(false,containerMenu))
return;
if(CheckRecipe(false,containerMenu))
{
try{
Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getTag().toString().equals("{Fireworks:{Flight:3b}}") && CheckRecipe(false,containerMenu))
{

InventoryUtils.clickSlot(0, true); //Grab the rockets
totalCrafted += 64*3;
if(countCrafted.getValue())
ChatUtils.print("Crafted! Total this session: " + totalCrafted);
break;
}
}
catch (Exception e)
{

}
}
return;
}

if(CheckRecipe(false,containerMenu))
{
try
{

Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getTag().toString().equals("{Fireworks:{Flight:3b}}") && CheckRecipe(false,containerMenu))
{

InventoryUtils.clickSlot(0, true); //Grab the rockets
totalCrafted += 64*3;
if(countCrafted.getValue())
ChatUtils.print("Crafted! Total this session: " + totalCrafted);
break;
}
}
catch (Exception e){}

}
else
{
if(!CorrectRecipe(false,containerMenu))
return;
if(CheckRecipe(false,containerMenu))
{
try
{

Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getTag().toString().equals("{Fireworks:{Flight:3b}}") && CheckRecipe(false,containerMenu))
{

InventoryUtils.clickSlot(0, true); //Grab the rockets
totalCrafted += 64*3;
if(countCrafted.getValue())
ChatUtils.print("Crafted! Total this session: " + totalCrafted);
break;
}
}
catch (Exception e){}
}
}

return;
}
}
}
}
Expand Down Expand Up @@ -285,57 +456,64 @@ else if(craftingPaper)
}
else
{
CorrectRecipe(true,containerMenu);
if(!CorrectRecipe(false,containerMenu))
return;
if(CheckRecipe(true,containerMenu))
{
try{
Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getDisplayName().getString().equals("[Paper]") && CheckRecipe(true,containerMenu))
{
InventoryUtils.clickSlot(0, true); //Grab the paper
break;
}
}
catch (Exception e)
{

}
}
}
}
}
catch (Exception e)
{
catch (Exception e)
{

}
break;
}
break;
}
}
else
{
try{
if(CheckRecipe(true,containerMenu))
{
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(0, true); //Grab the paper
}
else
{
CorrectRecipe(true,containerMenu);
if(CheckRecipe(true,containerMenu))
{
Thread.sleep(delay.getValue());
InventoryUtils.clickSlot(0, true); //Grab the paper
try{
if(CheckRecipe(true,containerMenu))
{
Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getDisplayName().getString().equals("[Paper]") && CheckRecipe(true,containerMenu))
{
InventoryUtils.clickSlot(0, true); //Grab the paper
}
}
else
{
if(!CorrectRecipe(false,containerMenu))
return;
if(CheckRecipe(true,containerMenu))
{
Thread.sleep(delay.getValue());
if(containerMenu.getSlot(0).getItem().getDisplayName().getString().equals("[Paper]") && CheckRecipe(true,containerMenu))
{
InventoryUtils.clickSlot(0, true); //Grab the paper
}
}
}
}
catch (Exception e) {}
return;
}
}
catch (Exception e)
{

}

return;
}
}
}
}


}
});
}
}
Expand Down

0 comments on commit 7815094

Please sign in to comment.