mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-28 01:38:34 +01:00
Compare commits
No commits in common. "8b5b073850eab854cad4c46de218d3fd1ac9dc3c" and "85a8ade6487fa87827f3fbdb0901fa2fde11c738" have entirely different histories.
8b5b073850
...
85a8ade648
17 changed files with 41 additions and 11 deletions
|
@ -15,6 +15,7 @@ import net.minecraft.core.HolderLookup;
|
||||||
import net.minecraft.data.PackOutput;
|
import net.minecraft.data.PackOutput;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.neoforged.neoforge.common.data.AdvancementProvider;
|
import net.neoforged.neoforge.common.data.AdvancementProvider;
|
||||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||||
|
|
||||||
|
|
|
@ -13,17 +13,21 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.flag.FeatureFlags;
|
import net.minecraft.world.flag.FeatureFlags;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.enchantment.Enchantments;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.CropBlock;
|
import net.minecraft.world.level.block.CropBlock;
|
||||||
import net.minecraft.world.level.storage.loot.LootPool;
|
import net.minecraft.world.level.storage.loot.LootPool;
|
||||||
import net.minecraft.world.level.storage.loot.LootTable;
|
import net.minecraft.world.level.storage.loot.LootTable;
|
||||||
import net.minecraft.world.level.storage.loot.ValidationContext;
|
import net.minecraft.world.level.storage.loot.ValidationContext;
|
||||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||||
|
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
|
||||||
import net.minecraft.world.level.storage.loot.functions.CopyNbtFunction;
|
import net.minecraft.world.level.storage.loot.functions.CopyNbtFunction;
|
||||||
|
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
|
||||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||||
import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition;
|
import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition;
|
||||||
import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider;
|
import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider;
|
||||||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
|
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
|
||||||
|
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
|
||||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
|
@ -52,8 +52,10 @@ import net.neoforged.fml.ModLoadingContext;
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.neoforged.fml.config.ModConfig;
|
import net.neoforged.fml.config.ModConfig;
|
||||||
import net.neoforged.fml.event.config.ModConfigEvent;
|
import net.neoforged.fml.event.config.ModConfigEvent;
|
||||||
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.neoforged.fml.loading.FMLEnvironment;
|
import net.neoforged.fml.loading.FMLEnvironment;
|
||||||
|
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
import net.neoforged.neoforge.common.conditions.ICondition;
|
import net.neoforged.neoforge.common.conditions.ICondition;
|
||||||
import net.neoforged.neoforge.common.world.BiomeModifier;
|
import net.neoforged.neoforge.common.world.BiomeModifier;
|
||||||
|
@ -130,9 +132,9 @@ public class ActuallyAdditions {
|
||||||
eventBus.addListener(this::setup);
|
eventBus.addListener(this::setup);
|
||||||
|
|
||||||
if (FMLEnvironment.dist.isClient()) {
|
if (FMLEnvironment.dist.isClient()) {
|
||||||
eventBus.addListener(ActuallyAdditionsClient::setup);
|
eventBus.addListener(this::clientSetup);
|
||||||
eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders);
|
eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders);
|
||||||
eventBus.addListener(ActuallyAdditionsClient::registerParticleFactories);
|
eventBus.addListener(this::particleFactoryRegister);
|
||||||
eventBus.register(new ClientRegistryHandler());
|
eventBus.register(new ClientRegistryHandler());
|
||||||
}
|
}
|
||||||
IFarmerBehavior.initBehaviors();
|
IFarmerBehavior.initBehaviors();
|
||||||
|
@ -166,6 +168,14 @@ public class ActuallyAdditions {
|
||||||
CommonConfig.Other.relayConfigureItem = item2 != null?item2: Items.AIR;
|
CommonConfig.Other.relayConfigureItem = item2 != null?item2: Items.AIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void clientSetup(FMLClientSetupEvent event) {
|
||||||
|
ActuallyAdditionsClient.setup(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void particleFactoryRegister(RegisterParticleProvidersEvent event) {
|
||||||
|
ActuallyAdditionsClient.registerParticleFactories();
|
||||||
|
}
|
||||||
|
|
||||||
public void serverStarted(ServerStartedEvent event) {
|
public void serverStarted(ServerStartedEvent event) {
|
||||||
// TODO: [port] check if this is needed
|
// TODO: [port] check if this is needed
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,6 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
||||||
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
|
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
|
|
||||||
public class ActuallyAdditionsClient {
|
public class ActuallyAdditionsClient {
|
||||||
|
@ -136,9 +135,9 @@ public class ActuallyAdditionsClient {
|
||||||
event.registerEntityRenderer(ActuallyAdditions.ENTITY_WORM.get(), RenderWorm::new);
|
event.registerEntityRenderer(ActuallyAdditions.ENTITY_WORM.get(), RenderWorm::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerParticleFactories(RegisterParticleProvidersEvent event) {
|
public static void registerParticleFactories() {
|
||||||
event.registerSpriteSet(ActuallyParticles.LASER_ITEM.get(), ParticleLaserItem.Factory::new);
|
Minecraft.getInstance().particleEngine.register(ActuallyParticles.LASER_ITEM.get(), ParticleLaserItem.Factory::new);
|
||||||
event.registerSpriteSet(ActuallyParticles.BEAM.get(), ParticleBeam.Factory::new);
|
Minecraft.getInstance().particleEngine.register(ActuallyParticles.BEAM.get(), ParticleBeam.Factory::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: [port] validate that this works
|
// TODO: [port] validate that this works
|
||||||
|
|
|
@ -10,8 +10,12 @@ import net.minecraft.world.item.CreativeModeTab;
|
||||||
import net.minecraft.world.item.CreativeModeTabs;
|
import net.minecraft.world.item.CreativeModeTabs;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
|
import net.neoforged.neoforge.energy.EnergyStorage;
|
||||||
|
import net.neoforged.neoforge.energy.IEnergyStorage;
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import de.ellpeck.actuallyadditions.mod.tile.CustomEnergyStorage;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.neoforge.attachment.AttachmentType;
|
import net.neoforged.neoforge.attachment.AttachmentType;
|
||||||
|
import net.neoforged.neoforge.energy.EnergyStorage;
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
import net.neoforged.neoforge.registries.NeoForgeRegistries;
|
import net.neoforged.neoforge.registries.NeoForgeRegistries;
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier;
|
||||||
import de.ellpeck.actuallyadditions.registration.AABlockReg;
|
import de.ellpeck.actuallyadditions.registration.AABlockReg;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.level.block.BaseEntityBlock;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.SlabBlock;
|
import net.minecraft.world.level.block.SlabBlock;
|
||||||
|
@ -78,8 +79,10 @@ import net.minecraft.world.level.material.PushReaction;
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
|
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.data.WorldData;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.EnergyDisplay;
|
import de.ellpeck.actuallyadditions.mod.inventory.gui.EnergyDisplay;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay;
|
import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -37,6 +38,7 @@ import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
import net.neoforged.bus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.neoforged.neoforge.client.event.RenderGuiOverlayEvent;
|
import net.neoforged.neoforge.client.event.RenderGuiOverlayEvent;
|
||||||
|
import net.neoforged.neoforge.client.event.RenderLevelStageEvent;
|
||||||
import net.neoforged.neoforge.client.gui.overlay.GuiOverlayManager;
|
import net.neoforged.neoforge.client.gui.overlay.GuiOverlayManager;
|
||||||
import net.neoforged.neoforge.event.TickEvent;
|
import net.neoforged.neoforge.event.TickEvent;
|
||||||
import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent;
|
import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent;
|
||||||
|
|
|
@ -25,8 +25,11 @@ import net.minecraft.world.entity.player.Inventory;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||||
import net.minecraft.world.inventory.ClickType;
|
import net.minecraft.world.inventory.ClickType;
|
||||||
|
import net.minecraft.world.inventory.ContainerListener;
|
||||||
import net.minecraft.world.inventory.Slot;
|
import net.minecraft.world.inventory.Slot;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.neoforged.api.distmarker.Dist;
|
||||||
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -52,8 +52,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
|
||||||
: 42), this.topPos + 5, this.tileGrinder.storage);
|
: 42), this.topPos + 5, this.tileGrinder.storage);
|
||||||
|
|
||||||
if (this.isDouble) {
|
if (this.isDouble) {
|
||||||
this.buttonAutoSplit = Button.builder(Component.literal("S"), (button) -> actionPerformed(0))
|
this.buttonAutoSplit = new Buttons.SmallerButton( this.leftPos - 10, this.topPos, Component.literal("S"), (button) -> actionPerformed(0));
|
||||||
.bounds(this.leftPos - 10, this.topPos, 16, 16).build();
|
|
||||||
this.addRenderableWidget(this.buttonAutoSplit);
|
this.addRenderableWidget(this.buttonAutoSplit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.client.gui.components.AbstractButton;
|
import net.minecraft.client.gui.components.AbstractButton;
|
||||||
import net.minecraft.client.gui.components.Button;
|
import net.minecraft.client.gui.components.Button;
|
||||||
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
|
|
|
@ -60,8 +60,7 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
|
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
|
||||||
this.buttonAutoSplit = Button.builder(Component.literal("S"), (button) -> PacketHandlerHelper.sendButtonPacket(this.tileFurnace, 0))
|
this.buttonAutoSplit = new Buttons.SmallerButton(this.leftPos, this.topPos, Component.literal("S"), (button) -> PacketHandlerHelper.sendButtonPacket(this.tileFurnace, 0));
|
||||||
.bounds(this.leftPos + 27, this.topPos + 5, 16, 16).build();
|
|
||||||
buttonAutoSplit.setFGColor(this.tileFurnace.isAutoSplit ? ChatFormatting.DARK_GREEN.getColor() : ChatFormatting.RED.getColor());
|
buttonAutoSplit.setFGColor(this.tileFurnace.isAutoSplit ? ChatFormatting.DARK_GREEN.getColor() : ChatFormatting.RED.getColor());
|
||||||
this.addRenderableWidget(this.buttonAutoSplit);
|
this.addRenderableWidget(this.buttonAutoSplit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.client.gui.components.Button;
|
import net.minecraft.client.gui.components.Button;
|
||||||
|
import net.minecraft.client.gui.components.Tooltip;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.items.metalists;
|
package de.ellpeck.actuallyadditions.mod.items.metalists;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.Rarity;
|
import net.minecraft.world.item.Rarity;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.items.misc;
|
package de.ellpeck.actuallyadditions.mod.items.misc;
|
||||||
|
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.base.ActuallyItem;
|
import de.ellpeck.actuallyadditions.mod.items.base.ActuallyItem;
|
||||||
import net.minecraft.world.food.FoodProperties;
|
import net.minecraft.world.food.FoodProperties;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
|
@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.update;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
|
|
|
@ -443,7 +443,7 @@
|
||||||
"tooltip.actuallyadditions.previouslyDoubleFurnace": "Previously \"Double Furnace\"",
|
"tooltip.actuallyadditions.previouslyDoubleFurnace": "Previously \"Double Furnace\"",
|
||||||
"tooltip.actuallyadditions.previouslyBag": "Previously \"Bag\"",
|
"tooltip.actuallyadditions.previouslyBag": "Previously \"Bag\"",
|
||||||
"tooltip.actuallyadditions.previouslyVoidBag": "Previously \"Void Bag\"",
|
"tooltip.actuallyadditions.previouslyVoidBag": "Previously \"Void Bag\"",
|
||||||
"tooltip.actuallyadditions.item_filling_wand.selected_block": "Selected Block: %s",
|
"tooltip.actuallyadditions.item_filling_wand.selected_block": "Selected Block:",
|
||||||
"tooltip.actuallyadditions.item_filling_wand.selected_block.none": "None",
|
"tooltip.actuallyadditions.item_filling_wand.selected_block.none": "None",
|
||||||
"tooltip.actuallyadditions.coffeeCup.noEffect": "No Effects",
|
"tooltip.actuallyadditions.coffeeCup.noEffect": "No Effects",
|
||||||
"_comment": "Gui Information",
|
"_comment": "Gui Information",
|
||||||
|
|
Loading…
Reference in a new issue