Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
updated antimatter, started work on turbine rotors
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 15, 2023
1 parent fb54126 commit b1406ed
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static void onMaterialEvent(GregTechMaterialEvent event){
event.setMaterial(Uranium).asMetal(1405).harvestLevel(2);
event.setMaterial(Neptunium).asMetal(912, 0);
event.setMaterial(Plutonium).asMetal(912, 0);
event.setMaterial(Americium).asMetal(1149, 0);
event.setMaterial(Americium).asMetal(1149, 0, ROD_LONG);
event.setMaterial(Curium).asMetal(1613, 0);
event.setMaterial(Berkelium).asMetal(1259, 0);
event.setMaterial(Californium).asMetal(1173, 0);
Expand Down Expand Up @@ -156,7 +156,7 @@ public static void onMaterialEvent(GregTechMaterialEvent event){
event.setMaterial(Invar).asMetal(1700, FRAME);
event.setMaterial(IronMagnetic).asMetal(1811, ROD);
event.setMaterial(Kanthal).asMetal(1800, 1800);
event.setMaterial(Magnalium).asMetal(870, 0, PLATE);
event.setMaterial(Magnalium).asMetal(870, 0, PLATE, ROD_LONG);
event.setMaterial(NeodymiumMagnetic).asMetal(1297, 1297, ROD);
event.setMaterial(Neutronium).asMetal(10000, 10000, SCREW, BOLT, RING, GEAR, FRAME);
event.setMaterial(Naquadah).asMetal(5400, 5400).asOre();
Expand Down
17 changes: 12 additions & 5 deletions common/src/main/java/muramasa/gregtech/data/ToolTypes.java
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
package muramasa.gregtech.data;

import com.google.common.collect.ImmutableMap;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.Ref;
import muramasa.antimatter.data.AntimatterDefaultTools;
import muramasa.antimatter.item.ItemBattery;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.material.MaterialTypeItem;
import muramasa.antimatter.recipe.ingredient.PropertyIngredient;
import muramasa.antimatter.recipe.material.MaterialRecipe;
import muramasa.antimatter.tool.AntimatterToolType;
import muramasa.antimatter.tool.IAntimatterTool;
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.items.ItemPowerUnit;
import muramasa.gregtech.items.ItemTurbineRotor;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Tuple;
import net.minecraft.world.inventory.CraftingContainer;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Blocks;
import tesseract.TesseractCapUtils;
import tesseract.api.gt.IEnergyHandlerItem;
import tesseract.api.gt.IGTNode;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import static muramasa.antimatter.data.AntimatterMaterialTypes.PLATE;
import static muramasa.antimatter.data.AntimatterMaterialTypes.SCREW;
import static muramasa.antimatter.material.Material.NULL;
import static muramasa.gregtech.data.GregTechData.*;

public class ToolTypes {

public static final MaterialTypeItem<?> TURBINE_BLADE = AntimatterAPI.register(MaterialTypeItem.class, new MaterialTypeItem<>("turbine_blade", 2, true, (Ref.U * 3) + (Ref.U8 * 2)));//.unSplitName();
public static final AntimatterToolType SMALL_TURBINE_ROTOR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(GTIRef.ID, "small_turbine_rotor", 1, 1, 1, -1.0F, 0.0f, false)).setHasSecondary(false).setMaterialType(TURBINE_BLADE).setHasContainer(true).setDurabilityMultiplier(2).setToolSupplier(ItemTurbineRotor::new);
public static final AntimatterToolType TURBINE_ROTOR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(GTIRef.ID, "turbine_rotor", 1, 1, 1, 1.5F, 0.0f, false)).setHasSecondary(false).setMaterialType(TURBINE_BLADE).setHasContainer(true).setDurabilityMultiplier(2).setToolSupplier(ItemTurbineRotor::new);
public static final AntimatterToolType LARGE_TURBINE_ROTOR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(GTIRef.ID, "large_turbine_rotor", 1, 1, 1, 4.0F, 0.0f, false)).setHasSecondary(false).setMaterialType(TURBINE_BLADE).setHasContainer(true).setDurabilityMultiplier(2).setToolSupplier(ItemTurbineRotor::new);
public static final AntimatterToolType HUGE_TURBINE_ROTOR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(GTIRef.ID, "huge_turbine_rotor", 1, 1, 1, 2.0F, 0.0f, false)).setHasSecondary(false).setMaterialType(TURBINE_BLADE).setHasContainer(true).setDurabilityMultiplier(2).setToolSupplier(ItemTurbineRotor::new);
public static final MaterialRecipe.Provider POWERED_TOOL_BUILDER = MaterialRecipe.registerProvider("powered-tool", GTIRef.ID, id -> new MaterialRecipe.ItemBuilder() {

@Override
Expand Down Expand Up @@ -80,6 +85,8 @@ public Map<String, Object> getFromResult(@Nonnull ItemStack stack) {
}

public static void init(){
TURBINE_BLADE.unSplitName().setIgnoreTextureSets();
TURBINE_BLADE.dependents(SCREW, PLATE);
AntimatterDefaultTools.DRILL.setBrokenItems(ImmutableMap.of("drill_lv", i -> getBrokenItem(i, PowerUnitLV), "drill_mv", i -> getBrokenItem(i, PowerUnitMV), "drill_hv", i -> getBrokenItem(i, PowerUnitHV)));
AntimatterDefaultTools.CHAINSAW.setBrokenItems(ImmutableMap.of("chainsaw_lv", i -> getBrokenItem(i, PowerUnitLV), "chainsaw_mv", i -> getBrokenItem(i, PowerUnitMV), "chainsaw_hv", i -> getBrokenItem(i, PowerUnitHV)));
AntimatterDefaultTools.ELECTRIC_WRENCH.setBrokenItems(ImmutableMap.of("electric_wrench_lv", i -> getBrokenItem(i, PowerUnitLV), "electric_wrench_mv", i -> getBrokenItem(i, PowerUnitMV), "electric_wrench_hv", i -> getBrokenItem(i, PowerUnitHV)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected void addTranslations() {
add(GTIRef.ID + ".rei.tooltip.ore.byproducts", "Ore Byproducts List");
add(GTIRef.ID + ".rei.tooltip.material_tree", "Material Tree");
add("machine.transformer.voltage_info", "%s -> %s (Use Soft Hammer to invert)");
add(GTIRef.ID + ".rotor.tooltip.efficiency", "Turbine Efficiency: %s");
}

@Override
Expand Down
46 changes: 46 additions & 0 deletions common/src/main/java/muramasa/gregtech/items/ItemTurbineRotor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package muramasa.gregtech.items;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.tool.AntimatterItemTier;
import muramasa.antimatter.tool.AntimatterToolType;
import muramasa.antimatter.tool.MaterialTool;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class ItemTurbineRotor extends MaterialTool {
public ItemTurbineRotor(String domain, AntimatterToolType type, AntimatterItemTier tier, Properties properties) {
super(domain, type, tier, properties);
}

public int getEfficiency(){
return (int) (50.0F + (10.0F * (type.getBaseAttackDamage() + itemTier.getAttackDamageBonus())));
}

@Override
public void onGenericAddInformation(ItemStack stack, List<Component> tooltip, TooltipFlag flag) {
super.onGenericAddInformation(stack, tooltip, flag);
tooltip.add(new TranslatableComponent("gti.rotor.tooltip.efficiency", new TextComponent("" + getEfficiency()).withStyle(ChatFormatting.BLUE)));
}

@Override
public ItemStack resolveStack(Material primary, Material secondary, long startingEnergy, long maxEnergy) {
return new ItemStack(this);
}

@Override
public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlot slotType, ItemStack stack) {
return HashMultimap.create();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import muramasa.antimatter.data.AntimatterMaterials;
import muramasa.antimatter.datagen.providers.AntimatterRecipeProvider;
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.data.ToolTypes;
import net.minecraft.advancements.CriterionTriggerInstance;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -91,6 +92,14 @@ public static void loadAutoRecipes(Consumer<FinishedRecipe> consumer, Antimatter
.build(),
"PHP", "WRF", "PSP");
});
ToolTypes.TURBINE_BLADE.all().forEach(m -> {
provider.addStackRecipe(consumer, GTIRef.ID, "", "antimatter_materials", "has_screwdriver", provider.hasSafeItem(SCREWDRIVER.getTag()),
ToolTypes.TURBINE_BLADE.get(m, 1), ImmutableMap.<Character, Object>builder()
.put('S', SCREWDRIVER.getTag())
.put('F', FILE.getTag())
.put('P', PLATE.getMaterialTag(m))
.put('s', SCREW.getMaterialTag(m)).build(), "FPS", "sPs", " P ");
});
AntimatterMaterialTypes.PLATE.all().forEach(m -> {
if (!m.has(NOSMASH)){
if (m.has(AntimatterMaterialTypes.INGOT)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import muramasa.antimatter.item.ItemCover;
import muramasa.antimatter.machine.Tier;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.material.MaterialTags;
import muramasa.antimatter.material.MaterialTypeBlock;
import muramasa.antimatter.pipe.PipeItemBlock;
import muramasa.antimatter.pipe.PipeSize;
Expand All @@ -23,6 +24,7 @@
import muramasa.gregtech.data.GregTechData;
import muramasa.gregtech.data.Machines;
import muramasa.gregtech.data.TierMaps;
import muramasa.gregtech.data.ToolTypes;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.ItemLike;
Expand Down Expand Up @@ -60,6 +62,7 @@ public static void init() {
motors();
pistons();
rotors();
turbines();
}

//TODO proper type check for the cables
Expand Down Expand Up @@ -187,6 +190,23 @@ private static void rotors(){
});
}

private static void turbines(){
MaterialTags.TOOLS.getAll().forEach((m,t) -> {
if (t.toolTypes().contains(ToolTypes.SMALL_TURBINE_ROTOR)){
ASSEMBLING.RB().ii(ToolTypes.TURBINE_BLADE.getMaterialIngredient(m, 4), ROD_LONG.getMaterialIngredient(Magnalium, 1)).io(ToolTypes.SMALL_TURBINE_ROTOR.getToolStack(m)).add(m.getId() + "_small_turbine_rotor", 160, 100);
}
if (t.toolTypes().contains(ToolTypes.TURBINE_ROTOR)){
ASSEMBLING.RB().ii(ToolTypes.TURBINE_BLADE.getMaterialIngredient(m, 8), ROD_LONG.getMaterialIngredient(Titanium, 1)).io(ToolTypes.TURBINE_ROTOR.getToolStack(m)).add(m.getId() + "_turbine_rotor", 320, 400);
}
if (t.toolTypes().contains(ToolTypes.LARGE_TURBINE_ROTOR)){
ASSEMBLING.RB().ii(ToolTypes.TURBINE_BLADE.getMaterialIngredient(m, 12), ROD_LONG.getMaterialIngredient(TungstenSteel, 1)).io(ToolTypes.LARGE_TURBINE_ROTOR.getToolStack(m)).add(m.getId() + "_large_turbine_rotor", 640, 1600);
}
if (t.toolTypes().contains(ToolTypes.HUGE_TURBINE_ROTOR)){
ASSEMBLING.RB().ii(ToolTypes.TURBINE_BLADE.getMaterialIngredient(m, 16), ROD_LONG.getMaterialIngredient(Americium, 1)).io(ToolTypes.HUGE_TURBINE_ROTOR.getToolStack(m)).add(m.getId() + "_huge_turbine_rotor", 1280, 6400);
}
});
}

private static void addTierCasing (Tier tier) {
ASSEMBLING.RB().ii(of(PLATE.getMaterialTag(TIER_MATERIALS.get(tier)), 8), INT_CIRCUITS.get(8)).io(new ItemStack(AntimatterAPI.get(BlockCasing.class, "casing_" + tier.getId(), GTIRef.ID))).add("casing_" + tier.getId(),5 * 20, (long) Math.pow(2, 2 * tier.getIntegerId() + 1));
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b1406ed

Please sign in to comment.