Skip to content

Commit

Permalink
Merge pull request #26 from Keriils/fix-bug
Browse files Browse the repository at this point in the history
fix & adjust & add kami ring test
  • Loading branch information
Keriils authored Sep 15, 2024
2 parents 4a38adf + 8f4e974 commit 84dc0f9
Show file tree
Hide file tree
Showing 21 changed files with 266 additions and 46 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.settings
/.idea/
/.vscode/
/run/
/run/*
/build/
/eclipse/
.classpath
Expand All @@ -14,14 +14,14 @@
options.txt
/saves/
usernamecache.json
banned-ips.json
banned-players.json
!banned-ips.json
!banned-players.json
eula.txt
ops.json
!ops.json
server.properties
servers.dat
usercache.json
whitelist.json
!whitelist.json
/out/
*.iml
*.ipr
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
coreModClass = main.NHUtilitiesCore

# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
Expand Down
1 change: 1 addition & 0 deletions run/banned-ips.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions run/banned-players.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
7 changes: 7 additions & 0 deletions run/ops.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"uuid": "00e4a3be-ed21-4be2-88a6-8e82729eaced",
"name": "Xir_",
"level": 5
}
]
1 change: 1 addition & 0 deletions run/whitelist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.xir.NHUtilities.common.api;

public interface IEntityInvulnerable {

void setEntityInvulnerable(boolean invulnerable);

}
44 changes: 22 additions & 22 deletions src/main/java/com/xir/NHUtilities/common/items/FuelRodList.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,57 +56,57 @@ public static void fuelRodInit() {
fuelRodExcitedRadianceUranium = new FuelRod(
"fuelRodExcitedRadianceUranium",
1,
150,
6,
800,
2000,
26,
4000,
86400,
0F,
new ItemStack(depletedFuelRodExcitedRadianceUranium, 1));
fuelRodExcitedRadianceUranium_2 = new FuelRod(
"fuelRodExcitedRadianceUranium_2",
2,
600,
36,
1600,
2000,
26,
4000,
86400,
0F,
new ItemStack(depletedFuelRodExcitedRadianceUranium_2, 1));
fuelRodExcitedRadianceUranium_4 = new FuelRod(
"fuelRodExcitedRadianceUranium_4",
4,
1800,
144,
3200,
2000,
26,
4000,
86400,
0F,
new ItemStack(depletedFuelRodExcitedRadianceUranium_4, 1));

fuelRodSuperExcitedPrimordialPearlPlutonium = new FuelRod(
"fuelRodSuperExcitedPrimordialPearlPlutonium",
1,
3200,
128,
6400,
10000,
1.3F,
8600,
80,
12800,
15000,
3.3F,
new ItemStack(depletedFuelRodSuperExcitedPrimordialPearlPlutonium, 1));
fuelRodSuperExcitedPrimordialPearlPlutonium_2 = new FuelRod(
"fuelRodSuperExcitedPrimordialPearlPlutonium_2",
2,
8600,
80,
12800,
768,
12800,
10000,
15000,
3.3F,
new ItemStack(depletedFuelRodSuperExcitedPrimordialPearlPlutonium_2, 1));
fuelRodSuperExcitedPrimordialPearlPlutonium_4 = new FuelRod(
"fuelRodSuperExcitedPrimordialPearlPlutonium_4",
4,
38400,
3064,
25600,
10000,
1.3F,
8600,
80,
12800,
15000,
3.3F,
new ItemStack(depletedFuelRodSuperExcitedPrimordialPearlPlutonium_4, 1));

RegisterUtils.registerItem(ichorFuelRod);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.xir.NHUtilities.common.items.aItemCore.ItemBasic;
import com.xir.NHUtilities.common.items.baubles.GluttonyRing;
import com.xir.NHUtilities.common.items.baubles.HungerRing;
import com.xir.NHUtilities.common.items.baubles.KamiRing;
import com.xir.NHUtilities.common.items.lunchBoxPlus.LunchBoxPlus;
import com.xir.NHUtilities.common.items.timeVial.EternityVial;
import com.xir.NHUtilities.common.items.timeVial.TimeVial;
Expand All @@ -12,6 +13,7 @@ public class ModsItemsList {
// For Common Item
public static final ItemBasic gluttonyRing = new GluttonyRing();
public static final ItemBasic hungerRing = new HungerRing();
public static final ItemBasic KamiRing = new KamiRing();
public static final ItemBasic timeVial = new TimeVial();
public static final TimeVial eternityVial = new EternityVial();
public static final LunchBoxPlus lunchBoxPlus = new LunchBoxPlus();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.xir.NHUtilities.common.items.baubles;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;

import com.xir.NHUtilities.common.api.IEntityInvulnerable;
import com.xir.NHUtilities.common.items.aItemCore.ItemBasic;

import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;

@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles")
public class KamiRing extends ItemBasic implements IBauble {

public KamiRing() {
super("KamiRing");
setMaxStackSize(1);
}

@Override
@Optional.Method(modid = "Baubles")
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.RING;
}

@Override
@Optional.Method(modid = "Baubles")
public void onWornTick(ItemStack itemstack, @NotNull EntityLivingBase player) {

if (!player.isEntityInvulnerable() && (player instanceof IEntityInvulnerable entityInvulnerable)) {
entityInvulnerable.setEntityInvulnerable(true);
}

if (player instanceof EntityPlayer entityPlayer) {
if (entityPlayer.isDead) entityPlayer.isDead = false;
if (entityPlayer.worldObj.getTotalWorldTime() % 10 == 0) {
if (entityPlayer.getFoodStats()
.getFoodLevel() != 20) {
entityPlayer.getFoodStats()
.addStats(20, 5.0F);
}
}
}
}

@Override
@Optional.Method(modid = "Baubles")
public void onEquipped(ItemStack itemstack, EntityLivingBase player) {

}

@Override
@Optional.Method(modid = "Baubles")
public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {

if (player.isEntityInvulnerable() && (player instanceof IEntityInvulnerable entityInvulnerable)) {
entityInvulnerable.setEntityInvulnerable(false);
}

}

@Override
@Optional.Method(modid = "Baubles")
public boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
return true;
}

@Override
@Optional.Method(modid = "Baubles")
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,27 @@ public float influenceExplosion(IReactor iReactor, ItemStack itemStack) {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean extraInformation) {
final int powerInfo = (int) this.Power * 25;
list.add(
String.format(
StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.0"),
getMaxCustomDamage() - getCustomDamage(stack),
getMaxCustomDamage()));
if (this.HeatBonus > 0F) list.add(StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.1"));
list.add(String.format(StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.2"), this.Heat));
list.add(String.format(StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.3"), this.Power));
if (this.HeatBonus > 0F) list
.add(String.format(StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.1"), this.HeatBonus));
list.add(
String.format(
String.format(
StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.2"),
this.Heat,
this.Heat * 6,
this.Heat * 24)));
list.add(
String.format(
StatCollector.translateToLocal("text.NHUtilities.fuelRod.tooltip.3"),
powerInfo,
powerInfo * 4,
powerInfo * 12));
}
// endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes;
import static gregtech.api.recipe.RecipeMaps.extractorRecipes;
import static thaumcraft.common.config.ConfigItems.itemEldritchObject;
import static gregtech.api.recipe.RecipeMaps.maceratorRecipes;
import static witchinggadgets.common.WGContent.ItemMaterial;

import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -47,6 +47,18 @@ public static void registerNHUtilitiesGTRecipe() {
GT_Utility.getIntegratedCircuit(2))
.itemOutputs(new ItemStack(FuelRodList.fuelRodSuperExcitedPrimordialPearlPlutonium_2, 1))
.duration(10 * SECOND)
.noOptimize()
.eut(TierEU.RECIPE_IV)
.addTo(assemblerRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(
new ItemStack(FuelRodList.fuelRodSuperExcitedPrimordialPearlPlutonium, 4),
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Ichorium, 6),
GT_Utility.getIntegratedCircuit(4))
.itemOutputs(new ItemStack(FuelRodList.fuelRodSuperExcitedPrimordialPearlPlutonium_4, 1))
.duration(10 * SECOND)
.noOptimize()
.eut(TierEU.RECIPE_IV)
.addTo(assemblerRecipes);

Expand All @@ -57,6 +69,7 @@ public static void registerNHUtilitiesGTRecipe() {
GT_Utility.getIntegratedCircuit(5))
.itemOutputs(new ItemStack(FuelRodList.fuelRodSuperExcitedPrimordialPearlPlutonium_4, 1))
.duration(10 * SECOND)
.noOptimize()
.eut(TierEU.RECIPE_IV)
.addTo(assemblerRecipes);

Expand All @@ -78,6 +91,18 @@ public static void registerNHUtilitiesGTRecipe() {
GT_Utility.getIntegratedCircuit(2))
.itemOutputs(new ItemStack(FuelRodList.fuelRodExcitedRadianceUranium_2, 1))
.duration(10 * SECOND)
.noOptimize()
.eut(TierEU.RECIPE_IV)
.addTo(assemblerRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(
new ItemStack(FuelRodList.fuelRodExcitedRadianceUranium, 4),
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Shadow, 6),
GT_Utility.getIntegratedCircuit(4))
.itemOutputs(new ItemStack(FuelRodList.fuelRodExcitedRadianceUranium_4, 1))
.duration(10 * SECOND)
.noOptimize()
.eut(TierEU.RECIPE_IV)
.addTo(assemblerRecipes);

Expand All @@ -88,6 +113,7 @@ public static void registerNHUtilitiesGTRecipe() {
GT_Utility.getIntegratedCircuit(5))
.itemOutputs(new ItemStack(FuelRodList.fuelRodExcitedRadianceUranium_4, 1))
.duration(10 * SECOND)
.noOptimize()
.eut(TierEU.RECIPE_IV)
.addTo(assemblerRecipes);

Expand Down Expand Up @@ -166,15 +192,15 @@ public static void registerNHUtilitiesGTRecipe() {
.addTo(centrifugeRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(new ItemStack(itemEldritchObject, 1, 3))
.itemInputs(thaumcraft.api.ItemApi.getItem("itemEldritchObject", 3))
.itemOutputs(new ItemStack(FuelRodList.primordialPearlDust, 4))
.duration(100 * SECOND)
.eut(TierEU.RECIPE_EV)
.addTo(extractorRecipes);
.addTo(maceratorRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 0))
.itemOutputs(new ItemStack(FuelRodList.ichorDroplet, 4))
.itemOutputs(new ItemStack(FuelRodList.ichorDroplet, 2))
.duration(100 * SECOND)
.eut(TierEU.RECIPE_EV)
.addTo(extractorRecipes);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/xir/NHUtilities/loader/ItemsLoader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xir.NHUtilities.loader;

import static com.xir.NHUtilities.common.items.ModsItemsList.KamiRing;
import static com.xir.NHUtilities.common.items.ModsItemsList.eternityVial;
import static com.xir.NHUtilities.common.items.ModsItemsList.gluttonyRing;
import static com.xir.NHUtilities.common.items.ModsItemsList.hungerRing;
Expand All @@ -20,6 +21,7 @@ public static void registerNHUtilitiesItems() {
FuelRodList.fuelRodInit();
RegisterUtils.registerItem(gluttonyRing, enableGluttonyRingAndHungerRing);
RegisterUtils.registerItem(hungerRing, enableGluttonyRingAndHungerRing);
RegisterUtils.registerItem(KamiRing, true);
RegisterUtils.registerItem(timeVial, enableTimeVial);
RegisterUtils.registerItem(eternityVial, enableEternityVial);
RegisterUtils.registerItem(lunchBoxPlus, "LunchBoxPlus", enableLunchBoxPlus);
Expand Down
Loading

0 comments on commit 84dc0f9

Please sign in to comment.