Magical seeds oh my...

This commit is contained in:
Flanks255 2022-01-09 11:58:55 -06:00
parent 2707b69d7a
commit 20a5dc1712
6 changed files with 93 additions and 161 deletions

View file

@ -63,7 +63,6 @@ import net.minecraftforge.registries.ForgeRegistries;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
//@Mod(modid = ActuallyAdditions.MODID, name = ActuallyAdditions.NAME, version = ActuallyAdditions.VERSION, guiFactory = ActuallyAdditions.GUIFACTORY, dependencies = ActuallyAdditions.DEPS)
@Mod(ActuallyAdditions.MODID)
public class ActuallyAdditions {
@ -76,7 +75,6 @@ public class ActuallyAdditions {
@Deprecated
public static final String GUIFACTORY = "de.ellpeck.actuallyadditions.mod.config.GuiFactory";
public static final String DEPS = "required:forge@[14.23.5.2836,);before:craftingtweaks;after:fastbench@[1.3.2,)";
// public static final boolean DEOBF = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
public static final ItemGroup GROUP = new ItemGroup(MODID) {
@OnlyIn(Dist.CLIENT)
@ -90,13 +88,6 @@ public class ActuallyAdditions {
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, "entities");
public static final RegistryObject<EntityType<EntityWorm>> ENTITY_WORM = ENTITIES.register("worm", () -> EntityType.Builder.of(EntityWorm::new, EntityClassification.CREATURE).build(MODID + ":worm"));
@Deprecated
public static ActuallyAdditions INSTANCE;
// TODO: [port] eval
// static {
// FluidRegistry.enableUniversalBucket();
// }
public static boolean commonCapsLoaded;
public ActuallyAdditions() {

View file

@ -42,6 +42,7 @@ import java.util.Locale;
public class CommonEvents {
//TODO spawner shards are yeeted right?
@SubscribeEvent
public void onBlockBreakEvent(BlockEvent.BreakEvent event) {
BlockState state = event.getState();
@ -125,7 +126,7 @@ public class CommonEvents {
}
}
//TODO Checking Achievements?
//TODO Checking Achievements? yeet?
/*public static void checkAchievements(ItemStack gotten, PlayerEntity player, InitAchievements.Type type){
if(gotten != null && player != null){
for(TheAchievements ach : TheAchievements.values()){
@ -138,6 +139,7 @@ public class CommonEvents {
}
}*/
//TODO this isnt how this should be done im pretty sure...
@SubscribeEvent
public void onEntityDropEvent(LivingDropsEvent event) {
if (event.getEntityLiving().level != null && !event.getEntityLiving().level.isClientSide && event.getSource().getEntity() instanceof PlayerEntity) {
@ -159,6 +161,7 @@ public class CommonEvents {
}
}
//TODO im pretty sure this can be done with normal advancements...
@SubscribeEvent
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event) {
//checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING);
@ -182,11 +185,13 @@ public class CommonEvents {
}
}
//TODO im pretty sure this can be done with normal advancements...
@SubscribeEvent
public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event) {
//checkAchievements(event.smelting, event.player, InitAchievements.Type.SMELTING);
}
//TODO im pretty sure this can be done with normal advancements...
@SubscribeEvent
public void onPickupEvent(EntityItemPickupEvent event) {
//checkAchievements(event.getItem().getItem(), event.getEntityPlayer(), InitAchievements.Type.PICK_UP);

View file

@ -66,8 +66,8 @@ public final class ActuallyItems {
public static final RegistryObject<Item> DRILL_CORE = ITEMS.register("drill_core", ItemBase::new);
public static final RegistryObject<Item> LENS = ITEMS.register("lens", ItemBase::new);
public static final RegistryObject<Item> ENDER_STAR = ITEMS.register("ender_star", ItemBase::new);
public static final RegistryObject<Item> CRYSTALLIZED_CANOLA_SEED = ITEMS.register("crystallized_canola_seed", ItemBase::new);
public static final RegistryObject<Item> EMPOWERED_CANOLA_SEED = ITEMS.register("empowered_canola_seed", ItemBase::new);
public static final RegistryObject<Item> CRYSTALLIZED_CANOLA_SEED = ITEMS.register("crystallized_canola_seed", () -> new CanolaSeed(false));
public static final RegistryObject<Item> EMPOWERED_CANOLA_SEED = ITEMS.register("empowered_canola_seed", () -> new CanolaSeed(true));
// SHARDS
public static final RegistryObject<Item> RESTONIA_CRYSTAL_SHARD = ITEMS.register("restonia_crystal_shard", ItemBase::new);

View file

@ -0,0 +1,50 @@
package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fluids.IFluidBlock;
public class CanolaSeed extends ItemBase {
public boolean empowered;
public CanolaSeed(boolean empowered) {
this.empowered = empowered;
}
@Override
public boolean isFoil(ItemStack p_77636_1_) {
return empowered;
}
@Override
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
if (!entity.level.isClientSide) {
if (stack != null) {
BlockPos pos = entity.blockPosition();
BlockState state = entity.level.getBlockState(pos);
Block block = state.getBlock();
if (block instanceof FlowingFluidBlock && state.getFluidState().isSource()) {
Fluid fluid = ((FlowingFluidBlock) block).getFluid();
if (fluid != null && fluid == (empowered
? InitFluids.CRYSTALIZED_OIL.get()
: InitFluids.REFINED_CANOLA_OIL.get())) {
entity.kill();
entity.level.setBlockAndUpdate(pos, (empowered
? InitFluids.EMPOWERED_OIL.getBlock()
: InitFluids.CRYSTALIZED_OIL.getBlock()).defaultBlockState());
}
}
}
}
return super.onEntityItemUpdate(stack, entity);
}
}

View file

@ -1,114 +0,0 @@
/*
* This file ("ItemMisc.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
public class ItemMisc extends ItemBase {
// public static final TheMiscItems[] ALL_MISC_ITEMS = TheMiscItems.values();
//
// public ItemMisc() {
// super(name);
// this.setHasSubtypes(true);
// }
//
// @Override
// public int getMetadata(int damage) {
// return damage;
// }
//
// @Override
// public String getTranslationKey(ItemStack stack) {
// return stack.getItemDamage() >= ALL_MISC_ITEMS.length
// ? StringUtil.BUGGED_ITEM_NAME
// : this.getTranslationKey() + "_" + ALL_MISC_ITEMS[stack.getItemDamage()].name;
// }
//
// @Override
// public IRarity getForgeRarity(ItemStack stack) {
// return stack.getItemDamage() >= ALL_MISC_ITEMS.length
// ? EnumRarity.COMMON
// : ALL_MISC_ITEMS[stack.getItemDamage()].rarity;
// }
//
// @Override
// @OnlyIn(Dist.CLIENT)
// public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list) {
// if (this.isInCreativeTab(tab)) {
// for (int j = 0; j < ALL_MISC_ITEMS.length; j++) {
// if (j != TheMiscItems.YOUTUBE_ICON.ordinal()) {
// list.add(new ItemStack(this, 1, j));
// }
// }
// }
// }
//
// @Override
// protected void registerRendering() {
// for (int i = 0; i < ALL_MISC_ITEMS.length; i++) {
// String name = this.getRegistryName() + "_" + ALL_MISC_ITEMS[i].name;
// ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory");
// }
// }
//
// @Override
// public boolean onEntityItemUpdate(ItemEntity entity) {
// if (!entity.world.isRemote) {
// ItemStack stack = entity.getItem();
// if (stack != null) {
// boolean isEmpowered = stack.getItemDamage() == TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal();
// if (stack.getItemDamage() == TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal() || isEmpowered) {
// BlockPos pos = entity.getPosition();
// BlockState state = entity.world.getBlockState(pos);
// Block block = state.getBlock();
//
// if (block instanceof IFluidBlock && block.getMetaFromState(state) == 0) {
// Fluid fluid = ((IFluidBlock) block).getFluid();
// if (fluid != null && fluid == (isEmpowered
// ? InitFluids.fluidCrystalOil
// : InitFluids.fluidRefinedCanolaOil)) {
// entity.setDead();
// entity.world.setBlockState(pos, (isEmpowered
// ? InitFluids.blockEmpoweredOil
// : InitFluids.blockCrystalOil).getDefaultState());
// }
// }
// }
// }
// }
//
// return super.onEntityItemUpdate(entity);
// }
//
// @Override
// public boolean hasEffect(ItemStack stack) {
// return stack.getItemDamage() == TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal();
// }
//
// @Override
// public int getItemBurnTime(ItemStack stack) {
// int k = stack.getMetadata();
//
// if (k == TheMiscItems.TINY_CHAR.ordinal()) {
// return 200;
// }
// if (k == TheMiscItems.TINY_COAL.ordinal()) {
// return 200;
// }
// if (k == TheMiscItems.BIOCOAL.ordinal()) {
// return 800;
// }
//
// return super.getItemBurnTime(stack);
// }
}

View file

@ -96,10 +96,10 @@
"death.actuallyadditions.atomicReconstructor.5": "%s should have used some re-construction foam.",
"_comment": "Blocks",
"block.actuallyadditions.compost": "Compost",
"block.actuallyadditions.misc_ore_black_quartz": "Black Quartz Ore",
"block.actuallyadditions.misc_black_quartz": "Block of Black Quartz",
"block.actuallyadditions.misc_black_quartz_chiseled": "Chiseled Block of Black Quartz",
"block.actuallyadditions.misc_black_quartz_pillar": "Pillar of Black Quartz",
"block.actuallyadditions.ore_black_quartz": "Black Quartz Ore",
"block.actuallyadditions.black_quartz": "Block of Black Quartz",
"block.actuallyadditions.black_quartz_chiseled": "Chiseled Block of Black Quartz",
"block.actuallyadditions.black_quartz_pillar": "Pillar of Black Quartz",
"block.actuallyadditions.feeder": "Automatic Feeder",
"block.actuallyadditions.giant_chest": "Small Storage Crate",
"block.actuallyadditions.giant_chest_medium": "Medium Storage Crate",
@ -111,12 +111,12 @@
"block.actuallyadditions.furnace_solar": "Solar Panel",
"block.actuallyadditions.heat_collector": "Heat Collector",
"block.actuallyadditions.item_repairer": "Item Repairer",
"block.actuallyadditions.misc_wood_casing": "Wood Casing",
"block.actuallyadditions.wood_casing": "Wood Casing",
"block.actuallyadditions.greenhouse_glass": "Greenhouse Glass",
"block.actuallyadditions.energizer": "Energizer",
"block.actuallyadditions.enervator": "Enervator",
"block.actuallyadditions.rice": "Rice Plant",
"block.actuallyadditions.misc_charcoal": "Block of Charcoal",
"block.actuallyadditions.charcoal": "Block of Charcoal",
"block.actuallyadditions.coal_generator": "Coal Generator",
"block.actuallyadditions.lamp_powerer": "Lamp Controller",
"block.actuallyadditions.colored_lamp_white": "White Lamp",
@ -143,7 +143,7 @@
"block.actuallyadditions.phantom_placer": "Phantom Placer",
"block.actuallyadditions.phantom_breaker": "Phantom Breaker",
"block.actuallyadditions.lava_factory_controller": "Lava Factory Controller",
"block.actuallyadditions.misc_lava_factory_case": "Casing",
"block.actuallyadditions.lava_factory_case": "Casing",
"block.actuallyadditions.fluid_placer": "Fluid Placer",
"block.actuallyadditions.fluid_collector": "Fluid Collector",
"block.actuallyadditions.phantom_booster": "Phantom Booster",
@ -166,12 +166,12 @@
"block.actuallyadditions.refined_canola_oil": "Refined Canola Oil",
"block.actuallyadditions.crystallized_oil": "Crystallized Oil",
"block.actuallyadditions.empowered_oil": "Empowered Oil",
"block.actuallyadditions.misc_enderpearl": "Block of Enderpearl",
"block.actuallyadditions.enderpearl": "Block of Enderpearl",
"block.actuallyadditions.oil_generator": "Oil Generator",
"block.actuallyadditions.breaker": "Auto-Breaker",
"block.actuallyadditions.placer": "Auto-Placer",
"block.actuallyadditions.dropper": "Automatic Precision Dropper",
"block.actuallyadditions.misc_ender_casing": "Ender Casing",
"block.actuallyadditions.ender_casing": "Ender Casing",
"block.actuallyadditions.flax": "Flax Plant",
"block.actuallyadditions.coffee_machine": "Coffee Maker",
"block.actuallyadditions.xp_solidifier": "Experience Solidifier",
@ -183,7 +183,7 @@
"block.actuallyadditions.laser_relay_advanced": "Advanced Energy Laser Relay",
"block.actuallyadditions.laser_relay_extreme": "Extreme Energy Laser Relay",
"block.actuallyadditions.laser_relay_fluids": "Fluid Laser Relay",
"block.actuallyadditions.misc_iron_casing": "Iron Casing",
"block.actuallyadditions.iron_casing": "Iron Casing",
"block.actuallyadditions.black_lotus": "Black Lotus",
"block.actuallyadditions.testifi_bucks_white_fence": "Ethetic Quartz Wall",
"block.actuallyadditions.testifi_bucks_green_fence": "Ethetic Green Wall",
@ -262,12 +262,12 @@
"item.actuallyadditions.drill": "Drill",
"item.actuallyadditions.rice": "Rice",
"item.actuallyadditions.food_doughnut": "Doughnut",
"item.actuallyadditions.misc_rice_dough": "Rice Dough",
"item.actuallyadditions.rice_dough": "Rice Dough",
"item.actuallyadditions.food_rice_bread": "Rice Bread",
"item.actuallyadditions.rice_seeds": "Rice Seeds",
"item.actuallyadditions.misc_tiny_coal": "Tiny Coal",
"item.actuallyadditions.misc_tiny_charcoal": "Tiny Charcoal",
"item.actuallyadditions.misc_rice_slime": "Rice Slimeball",
"item.actuallyadditions.tiny_coal": "Tiny Coal",
"item.actuallyadditions.tiny_charcoal": "Tiny Charcoal",
"item.actuallyadditions.rice_slime": "Rice Slimeball",
"item.actuallyadditions.battery": "Single Battery",
"item.actuallyadditions.battery_double": "Double Battery",
"item.actuallyadditions.battery_triple": "Triple Battery",
@ -281,7 +281,7 @@
"item.actuallyadditions.crystallized_oil_bucket": "Crystallized Oil Bucket",
"item.actuallyadditions.empowered_oil_bucket": "Empowered Oil Bucket",
"item.actuallyadditions.wings_of_the_bats": "Wings Of The Bats",
"item.actuallyadditions.misc_bat_wing": "Bat's Wing",
"item.actuallyadditions.bat_wing": "Bat's Wing",
"item.actuallyadditions.wooden_paxel": "Wooden AIOT",
"item.actuallyadditions.stone_paxel": "Stone AIOT",
"item.actuallyadditions.iron_paxel": "Iron AIOT",
@ -291,7 +291,7 @@
"item.actuallyadditions.obsidian_paxel": "Obsidian AIOT",
"item.actuallyadditions.quartz_paxel": "Black Quartz AIOT",
"item.actuallyadditions.phantom_connector": "Phantom Connector",
"item.actuallyadditions.misc_cup": "Empty Cup",
"item.actuallyadditions.cup": "Empty Cup",
"item.actuallyadditions.coffee": "Cup with Coffee",
"item.actuallyadditions.coffee_seeds": "Coffee Seeds",
"item.actuallyadditions.coffee_beans": "Coffee Beans",
@ -307,15 +307,15 @@
"item.actuallyadditions.drill_upgrade_block_placing": "Drill Block Placing Augment",
"item.actuallyadditions.drill_upgrade_three_by_three": "Drill Mining Augment I",
"item.actuallyadditions.drill_upgrade_five_by_five": "Drill Mining Augment II",
"item.actuallyadditions.misc_mashed_food": "Bio-Mash",
"item.actuallyadditions.mashed_food": "Bio-Mash",
"item.actuallyadditions.fertilizer": "Fertilizer",
"item.actuallyadditions.misc_dough": "Dough",
"item.actuallyadditions.misc_paper_cone": "Paper Cone",
"item.actuallyadditions.misc_knife_blade": "Knife Blade",
"item.actuallyadditions.misc_knife_handle": "Knife Handle",
"item.actuallyadditions.misc_black_quartz": "Black Quartz",
"item.actuallyadditions.misc_ring": "Ring",
"item.actuallyadditions.misc_ring.storage": "Blaze Stored",
"item.actuallyadditions.dough": "Dough",
"item.actuallyadditions.paper_cone": "Paper Cone",
"item.actuallyadditions.knife_blade": "Knife Blade",
"item.actuallyadditions.knife_handle": "Knife Handle",
"item.actuallyadditions.black_quartz": "Black Quartz",
"item.actuallyadditions.ring": "Ring",
"item.actuallyadditions.ring.storage": "Blaze Stored",
"item.actuallyadditions.tele_staff": "Teleport Staff",
"item.actuallyadditions.jam_cu_ba_ra": "CuBaRa-Jam",
"item.actuallyadditions.jam_gra_ki_ba": "GraKiBa-Jam",
@ -361,8 +361,8 @@
"item.actuallyadditions.food_carrot_juice": "Carrot Juice",
"item.actuallyadditions.food_pumpkin_stew": "Pumpkin Stew",
"item.actuallyadditions.food_cheese": "Cheese",
"item.actuallyadditions.misc_coil": "Basic Coil",
"item.actuallyadditions.misc_coil_advanced": "Advanced Coil",
"item.actuallyadditions.coil": "Basic Coil",
"item.actuallyadditions.coil_advanced": "Advanced Coil",
"item.actuallyadditions.potion_ring": "Ring of",
"item.actuallyadditions.potion_ring_advanced": "Advanced Ring of",
"item.actuallyadditions.solidified_experience": "Solidified Experience",
@ -393,8 +393,8 @@
"item.actuallyadditions.chest_to_crate_upgrade": "Chest To Storage Crate Upgrade",
"item.actuallyadditions.small_to_medium_crate_upgrade": "Small To Medium Storage Crate Upgrade",
"item.actuallyadditions.medium_to_large_crate_upgrade": "Medium To Large Storage Crate Upgrade",
"item.actuallyadditions.misc_drill_core": "Drill Core",
"item.actuallyadditions.misc_black_dye": "Black Dye",
"item.actuallyadditions.drill_core": "Drill Core",
"item.actuallyadditions.black_dye": "Black Dye",
"item.actuallyadditions.crystal_red": "Restonia Crystal",
"item.actuallyadditions.crystal_blue": "Palis Crystal",
"item.actuallyadditions.crystal_light_blue": "Diamatine Crystal",
@ -407,7 +407,7 @@
"item.actuallyadditions.crystal_empowered_green": "Empowered Emeradic Crystal",
"item.actuallyadditions.crystal_empowered_black": "Empowered Void Crystal",
"item.actuallyadditions.crystal_empowered_white": "Empowered Enori Crystal",
"item.actuallyadditions.misc_lens": "Lens",
"item.actuallyadditions.lens": "Lens",
"item.actuallyadditions.color_lens": "Lens of Color",
"item.actuallyadditions.explosion_lens": "Lens of Detonation",
"item.actuallyadditions.damage_lens": "Lens of Certain Death",
@ -474,21 +474,21 @@
"item.actuallyadditions.paxel_crystal_white": "Enori Crystal AIOT",
"item.actuallyadditions.paxel_crystal_green": "Emeradic Crystal AIOT",
"item.actuallyadditions.food_bacon": "Bacon",
"item.actuallyadditions.misc_ender_star": "Ender Star",
"item.actuallyadditions.ender_star": "Ender Star",
"item.actuallyadditions.spawner_changer": "Spawner Changer",
"item.actuallyadditions.misc_spawner_shard": "Spawner Shards",
"item.actuallyadditions.spawner_shard": "Spawner Shards",
"item.actuallyadditions.minecart_firework_box": "Firework Box Cart",
"item.actuallyadditions.water_bowl": "Bowl of Water",
"item.actuallyadditions.filter": "Item Filter",
"item.actuallyadditions.misc_biomass": "Biomass",
"item.actuallyadditions.misc_biocoal": "Bio Coal",
"item.actuallyadditions.biomass": "Biomass",
"item.actuallyadditions.biocoal": "Bio Coal",
"item.actuallyadditions.player_probe": "Player Probe",
"item.actuallyadditions.worm": "Worm",
"item.actuallyadditions.bag": "Traveler's Sack",
"item.actuallyadditions.bag.storage": "filled slots",
"item.actuallyadditions.void_bag": "Void Sack",
"item.actuallyadditions.misc_crystallized_canola_seed": "Crystallized Canola Seed",
"item.actuallyadditions.misc_empowered_canola_seed": "Empowered Canola Seed",
"item.actuallyadditions.crystallized_canola_seed": "Crystallized Canola Seed",
"item.actuallyadditions.empowered_canola_seed": "Empowered Canola Seed",
"item.actuallyadditions.mining_lens": "Lens of the Miner",
"item.actuallyadditions.more_damage_lens": "Lens of the Killer",
"item.actuallyadditions.filling_wand": "Handheld Filler",