mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Flatten corporea sparks
This commit is contained in:
1 parent
4afaacb351
commit
abcf2a748b
25 files changed
+46
-71
No files matched your search
@@ -369,6 +369,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.sparkUpgradeIsolated);
|
||||
addBlock(ModBlocks.sparkChanger);
|
||||
addItem(ModItems.corporeaSpark);
|
||||
addItem(ModItems.corporeaSparkMaster);
|
||||
addBlock(ModBlocks.corporeaIndex);
|
||||
addBlock(ModBlocks.corporeaFunnel);
|
||||
addBlock(ModBlocks.corporeaInterceptor);
|
||||
|
||||
@@ -601,8 +601,8 @@ public final class ModCraftingRecipes {
|
||||
recipeRedStringInterceptor = ModBlocks.redStringInterceptor.getRegistryName();
|
||||
recipeFlightTiara = path("flighttiara_0");
|
||||
recipesWings = allOfGroup("flighttiara_wings");
|
||||
recipeCorporeaSpark = path("corporeaspark_0");
|
||||
recipeMasterCorporeaSpark = path("corporeaspark_1");
|
||||
recipeCorporeaSpark = ModItems.corporeaSpark.getRegistryName();
|
||||
recipeMasterCorporeaSpark = ModItems.corporeaSparkMaster.getRegistryName();
|
||||
recipeCorporeaIndex = ModBlocks.corporeaIndex.getRegistryName();
|
||||
recipeCorporeaFunnel = ModBlocks.corporeaFunnel.getRegistryName();
|
||||
recipeCorporeaInterceptor = ModBlocks.corporeaInterceptor.getRegistryName();
|
||||
|
||||
@@ -71,7 +71,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickedResult(RayTraceResult target) {
|
||||
return isMaster() ? new ItemStack(ModItems.corporeaSpark, 1, 1) : new ItemStack(ModItems.corporeaSpark);
|
||||
return isMaster() ? new ItemStack(ModItems.corporeaSparkMaster) : new ItemStack(ModItems.corporeaSpark);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,7 +114,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
|
||||
}
|
||||
|
||||
private void dropAndKill() {
|
||||
entityDropItem(new ItemStack(ModItems.corporeaSpark, 1, isMaster() ? 1 : 0), 0F);
|
||||
entityDropItem(new ItemStack(isMaster() ? ModItems.corporeaSparkMaster : ModItems.corporeaSpark), 0F);
|
||||
setDead();
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,13 @@ public class FlattenItems implements IFixableData {
|
||||
ItemBaubleCosmetic.Variant[] vals = ItemBaubleCosmetic.Variant.values();
|
||||
return LibMisc.MOD_ID + ":" + LibItemNames.COSMETIC + "_" + vals[i % vals.length].name().toLowerCase(Locale.ROOT);
|
||||
});
|
||||
LOOKUP.put("botania:corporeaspark", i -> {
|
||||
if(i == 1) {
|
||||
return ModItems.corporeaSparkMaster.getRegistryName().toString();
|
||||
} else {
|
||||
return ModItems.corporeaSpark.getRegistryName().toString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,39 +10,24 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import vazkii.botania.api.corporea.CorporeaHelper;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.entity.EntityCorporeaSpark;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemCorporeaSpark extends ItemMod {
|
||||
|
||||
public ItemCorporeaSpark() {
|
||||
super(LibItemNames.CORPOREA_SPARK);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
if(isInCreativeTab(tab)) {
|
||||
for(int i = 0; i < 2; i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
public ItemCorporeaSpark(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -55,27 +40,14 @@ public class ItemCorporeaSpark extends ItemMod {
|
||||
stack.shrink(1);
|
||||
if(!world.isRemote) {
|
||||
EntityCorporeaSpark spark = new EntityCorporeaSpark(world);
|
||||
if(stack.getItemDamage() == 1)
|
||||
if(this == ModItems.corporeaSparkMaster)
|
||||
spark.setMaster(true);
|
||||
spark.setPosition(pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5);
|
||||
world.spawnEntity(spark);
|
||||
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 0);
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.CORPOREA_SPARK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -322,7 +322,8 @@ public final class ModItems {
|
||||
public static final Item ancientWillTorag = new ItemAncientWill(IAncientWillContainer.AncientWillType.TORAG);
|
||||
public static final Item ancientWillVerac = new ItemAncientWill(IAncientWillContainer.AncientWillType.VERAC);
|
||||
public static final Item ancientWillKaril = new ItemAncientWill(IAncientWillContainer.AncientWillType.KARIL);
|
||||
public static final Item corporeaSpark = new ItemCorporeaSpark();
|
||||
public static final Item corporeaSpark = new ItemCorporeaSpark(LibItemNames.CORPOREA_SPARK);
|
||||
public static final Item corporeaSparkMaster = new ItemCorporeaSpark(LibItemNames.CORPOREA_SPARK_MASTER);
|
||||
public static final Item livingwoodBow = new ItemLivingwoodBow();
|
||||
public static final Item crystalBow = new ItemCrystalBow();
|
||||
public static final Map<ItemBaubleCosmetic.Variant, Item> cosmetics = new EnumMap<>(ItemBaubleCosmetic.Variant.class);
|
||||
@@ -580,6 +581,7 @@ public final class ModItems {
|
||||
r.register(ancientWillVerac);
|
||||
r.register(ancientWillKaril);
|
||||
r.register(corporeaSpark);
|
||||
r.register(corporeaSparkMaster);
|
||||
r.register(livingwoodBow);
|
||||
r.register(crystalBow);
|
||||
cosmetics.values().forEach(r::register);
|
||||
|
||||
@@ -132,7 +132,8 @@ public final class LibItemNames {
|
||||
public static final String OVERGROWTH_SEED = "overgrowthseed";
|
||||
public static final String CRAFT_PATTERN = "pattern";
|
||||
public static final String ANCIENT_WILL = "ancient_will";
|
||||
public static final String CORPOREA_SPARK = "corporeaspark";
|
||||
public static final String CORPOREA_SPARK = "corporea_spark";
|
||||
public static final String CORPOREA_SPARK_MASTER = "corporea_spark_master";
|
||||
public static final String LIVINGWOOD_BOW = "livingwoodbow";
|
||||
public static final String CRYSTAL_BOW = "crystalbow";
|
||||
public static final String COSMETIC = "cosmetic";
|
||||
|
||||
Reference in new issue
Block a user