mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-28 01:38:34 +01:00
Compare commits
No commits in common. "8104cc4be26498b18e07d29aadfd1b72ed61bc5f" and "44e055499eaf4a612eb01c3c9a544f4715f52239" have entirely different histories.
8104cc4be2
...
44e055499e
30 changed files with 207 additions and 489 deletions
|
@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
|
|||
org.gradle.daemon=false
|
||||
# Actually Additions
|
||||
|
||||
mod_version=1.2.10
|
||||
mod_version=1.2.8
|
||||
|
||||
# Forge
|
||||
game_version=1.20.4
|
||||
|
|
46
port.MD
46
port.MD
|
@ -1,19 +1,19 @@
|
|||
# Remove
|
||||
- [x] Lush caves
|
||||
- [ ] Lush caves
|
||||
- [x] 11 lens (lens of disruption)
|
||||
- [x] Smiley cloud
|
||||
- [ ] Smiley cloud
|
||||
- [x] Occasional solidified XP drop from mobs
|
||||
- [x] Treasure chests
|
||||
- [x] Composter and bio-mash, biomass, bio coal and fertilizer
|
||||
- [x] Charcoal blocks
|
||||
- [x] Ender pearl blocks
|
||||
- [x] ESDs
|
||||
- [x] Fishing nets
|
||||
- [x] Solar panels
|
||||
- [ ] Fishing nets
|
||||
- [ ] Solar panels
|
||||
- [X] Item repairers
|
||||
- [x] Knife (food can just be crafted normally)
|
||||
- [X] Black lotuses and black dye
|
||||
- [x] Chest to storage crate upgrade (makes little sense with the way they are being changed), keep the other ones though
|
||||
- [ ] Chest to storage crate upgrade (makes little sense with the way they are being changed), keep the other ones though
|
||||
- [x] Ring of liquid banning
|
||||
- [x] Emerald and obsidian armor and tools
|
||||
- [x] Black quartz armor and tools
|
||||
|
@ -22,8 +22,8 @@
|
|||
- [x] Jam villager and jams
|
||||
- [x] Potion rings
|
||||
- [x] Fur balls
|
||||
- [x] The food (except for stuff used elsewhere like the coffee)
|
||||
- [x] The weird rainbow colored item names, except for the crystals which should keep their color-matching names
|
||||
- [ ] The food (except for stuff used elsewhere like the coffee)
|
||||
- [ ] The weird rainbow colored item names, except for the crystals which should keep their color-matching names
|
||||
|
||||
# Change
|
||||
- [ ] Make crystal clusters spawn in amethyst nodes in 1.18, leave unused in 1.16 (same with crystal shards)
|
||||
|
@ -52,44 +52,44 @@
|
|||
# Keep As Is
|
||||
- [X] Battery box
|
||||
- [ ] Item interfaces and item laser system
|
||||
- [x] Farmer
|
||||
- [ ] Farmer
|
||||
- [x] Empowerer and display stands
|
||||
- [x] Tiny torch
|
||||
- [ ] Shock absorber
|
||||
- [x] Player interface
|
||||
- [ ] Player interface
|
||||
- [ ] Vertical digger
|
||||
- [x] Atomic reconstructor
|
||||
- [x] Ranged collector
|
||||
- [ ] Atomic reconstructor
|
||||
- [ ] Ranged collector
|
||||
- [ ] Breakers, placers and long-range breakers, as well as fluid variants
|
||||
- [ ] Leaf-eating generator
|
||||
- [ ] Lamps and lamp controller
|
||||
- [ ] Lava factory controller
|
||||
- [x] The entire canola system
|
||||
- [x] Phantomfaces and their variants
|
||||
- [ ] The entire canola system
|
||||
- [ ] Phantomfaces and their variants
|
||||
- [ ] Feeder
|
||||
- [ ] Crusher and double crusher
|
||||
- [ ] Heat collectors
|
||||
- [x] Precision dropper
|
||||
- [x] Engineer's goggles
|
||||
- [ ] Laser relay modifiers and wrench
|
||||
- [x] Handheld filler
|
||||
- [x] Sacks
|
||||
- [x] Player probe
|
||||
- [x] Item filter
|
||||
- [ ] Handheld filler
|
||||
- [ ] Sacks
|
||||
- [ ] Player probe
|
||||
- [ ] Item filter
|
||||
- [ ] Water bowl
|
||||
- [x] Tiny coal and charcoal
|
||||
- [x] Rice slimeballs
|
||||
- [ ] Rice slimeballs
|
||||
- [ ] Storage crate keeper
|
||||
- [x] Color, detonation, certain death, killer and disenchanting lenses
|
||||
- [ ] Color, detonation, certain death, killer and disenchanting lenses
|
||||
- [ ] Storage crate upgrades, except for the "chest to storage crate" one
|
||||
- [ ] Ring of growth
|
||||
- [x] Ring of magnetization
|
||||
- [ ] Ring of magnetization
|
||||
- [x] Teleport staff
|
||||
- [ ] Wings of the Bats and wing items dropped from bats
|
||||
- [x] Drills and drill upgrades
|
||||
- [x] Batteries
|
||||
- [ ] Drills and drill upgrades
|
||||
- [ ] Batteries
|
||||
- [x] Crafting table on a stick
|
||||
- [x] Leaf blowers
|
||||
- [ ] The book
|
||||
- [x] The Crystal Flux name and rainbow effect
|
||||
- [x] Engineer's village house and engineer villager
|
||||
- [ ] Engineer's village house and engineer villager
|
|
@ -1,4 +1,4 @@
|
|||
// 1.20.4 2024-03-16T12:15:55.7079887 Item Recipes
|
||||
// 1.20.4 2024-03-14T17:01:13.6665594 Item Recipes
|
||||
d374edde9294d1a224b4b5610b50117a11328c00 data/actuallyadditions/recipes/advanced_coil.json
|
||||
f67629e45d152c96f3467a90a67520f78ecf9f07 data/actuallyadditions/recipes/advanced_leaf_blower.json
|
||||
d65e5a70232fa2f0e74d2a67c1cd4b0e87124242 data/actuallyadditions/recipes/basic_coil.json
|
||||
|
@ -118,6 +118,5 @@ b4aa29ef0d47b557f354a23cb6ee8ef60d273de3 data/actuallyadditions/recipes/teleport
|
|||
5745a05f877fce254a1990f1e89f80e91846e270 data/actuallyadditions/recipes/tiny_to_coal.json
|
||||
91bebb02fc416a650eea26c2d87049de91866cf0 data/actuallyadditions/recipes/travelers_sack.json
|
||||
89c9512eeb746befb1bdc31037baa9bd86220f74 data/actuallyadditions/recipes/triple_battery.json
|
||||
babb9a9e8a18d124c235df9214265c84738b0c1d data/actuallyadditions/recipes/void_sack.json
|
||||
0737014abee48f688982412297e04e994aa6f9a6 data/actuallyadditions/recipes/wings_of_the_bats.json
|
||||
c80073fcade3cdcb15f28c4a1cb12df4ae6cf4ec data/actuallyadditions/recipes/wooden_aiot.json
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// 1.20.4 2024-03-16T13:05:21.230216 Mining Lens Recipes
|
||||
// 1.20.4 2024-03-14T16:41:17.9423551 Mining Lens Recipes
|
||||
2e77c114530406cd2b3c59a921817803bb718b68 data/actuallyadditions/recipes/mininglens/deepslate_deepslate_coal_ore.json
|
||||
21c9c0a0457e212098f377bd95950f98dffd4f20 data/actuallyadditions/recipes/mininglens/deepslate_deepslate_copper_ore.json
|
||||
e791752df12b4dd6c337e160857117f298bbe52b data/actuallyadditions/recipes/mininglens/deepslate_deepslate_diamond_ore.json
|
||||
00cb1642560fbd392263735bc697e5a24417b612 data/actuallyadditions/recipes/mininglens/deepslate_deepslate_emerald_ore.json
|
||||
b9e872f89dc2c45d54ee0215a4a335949baee42a data/actuallyadditions/recipes/mininglens/deepslate_deepslate_gold_ore.json
|
||||
|
@ -12,7 +11,6 @@ f1c2091a2c4bbb81e1908bb9c4ebbcc0bae492b2 data/actuallyadditions/recipes/miningle
|
|||
7227ee2a53f520facb7fe8f7b34a1a74c9a49e85 data/actuallyadditions/recipes/mininglens/nether_nether_quartz_ore.json
|
||||
de47fcc5b2acc4f0511e95de63b9b084a2dfbaad data/actuallyadditions/recipes/mininglens/stone_black_quartz_ore.json
|
||||
550a0fe3577fcdaf0e1af1b2e3a518256992e00b data/actuallyadditions/recipes/mininglens/stone_coal_ore.json
|
||||
a572a63ce7259b176bf45409cfde9744edba0730 data/actuallyadditions/recipes/mininglens/stone_copper_ore.json
|
||||
869a51e0fc919b7a4577bb7c466ca07a6ae0370b data/actuallyadditions/recipes/mininglens/stone_diamond_ore.json
|
||||
f74f71eb82bc63538662217d9b0eb136bd262618 data/actuallyadditions/recipes/mininglens/stone_emerald_ore.json
|
||||
231db303e6f5b38fee1beec4dfb7e37932b50b8a data/actuallyadditions/recipes/mininglens/stone_gold_ore.json
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"item": "minecraft:deepslate"
|
||||
},
|
||||
"result": {
|
||||
"item": "minecraft:deepslate_copper_ore"
|
||||
},
|
||||
"weight": 3000
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "minecraft:copper_ore"
|
||||
},
|
||||
"weight": 5000
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "actuallyadditions:travelers_sack"
|
||||
},
|
||||
{
|
||||
"tag": "forge:ender_pearls"
|
||||
},
|
||||
{
|
||||
"tag": "forge:obsidian"
|
||||
},
|
||||
{
|
||||
"item": "actuallyadditions:void_crystal_block"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "actuallyadditions:void_sack"
|
||||
}
|
||||
}
|
|
@ -109,12 +109,12 @@ public class ItemRecipeGenerator extends RecipeProvider {
|
|||
.define('V', ActuallyBlocks.VOID_CRYSTAL.getItem()).save(recipeOutput);
|
||||
|
||||
//Void Bag
|
||||
Recipe.shapeless(ActuallyItems.VOID_SACK.get())
|
||||
/* Recipe.shapeless(ActuallyItems.VOID_SACK.get())
|
||||
.requires(ActuallyItems.TRAVELERS_SACK.get())
|
||||
.requires(Tags.Items.ENDER_PEARLS)
|
||||
.requires(Tags.Items.OBSIDIAN)
|
||||
.requires(ActuallyBlocks.VOID_CRYSTAL.getItem())
|
||||
.save(recipeOutput);
|
||||
.save(recipeOutput);*/ //TODO not done yet
|
||||
|
||||
//Lens
|
||||
Recipe.shaped(ActuallyItems.LENS.get())
|
||||
|
|
|
@ -65,7 +65,6 @@ public class MiningLensGenerator extends RecipeProvider {
|
|||
|
||||
private void buildMiningLens(RecipeOutput consumer) {
|
||||
buildStoneOre(consumer, 5000, Items.COAL_ORE);
|
||||
buildStoneOre(consumer, 5000, Items.COPPER_ORE);
|
||||
buildStoneOre(consumer, 3000, Items.IRON_ORE);
|
||||
buildStoneOre(consumer, 500, Items.GOLD_ORE);
|
||||
buildNetherOre(consumer, 500, Items.NETHER_GOLD_ORE);
|
||||
|
@ -79,7 +78,6 @@ public class MiningLensGenerator extends RecipeProvider {
|
|||
|
||||
buildDeepSlateOre(consumer, 2000, Items.DEEPSLATE_COAL_ORE);
|
||||
buildDeepSlateOre(consumer, 3000, Items.DEEPSLATE_IRON_ORE);
|
||||
buildDeepSlateOre(consumer, 3000, Items.DEEPSLATE_COPPER_ORE);
|
||||
buildDeepSlateOre(consumer, 500, Items.DEEPSLATE_GOLD_ORE);
|
||||
buildDeepSlateOre(consumer, 50, Items.DEEPSLATE_DIAMOND_ORE);
|
||||
buildDeepSlateOre(consumer, 250, Items.DEEPSLATE_LAPIS_ORE);
|
||||
|
|
|
@ -33,6 +33,7 @@ import de.ellpeck.actuallyadditions.mod.gen.village.ActuallyVillagers;
|
|||
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
||||
import de.ellpeck.actuallyadditions.mod.items.Worm;
|
||||
import de.ellpeck.actuallyadditions.mod.lootmodifier.ActuallyLootModifiers;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.BannerHelper;
|
||||
|
@ -141,7 +142,6 @@ public class ActuallyAdditions {
|
|||
|
||||
if (FMLEnvironment.dist.isClient()) {
|
||||
eventBus.addListener(ActuallyAdditionsClient::setup);
|
||||
eventBus.addListener(ActuallyAdditionsClient::setupMenus);
|
||||
eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders);
|
||||
eventBus.addListener(ActuallyAdditionsClient::registerParticleFactories);
|
||||
eventBus.register(new ClientRegistryHandler());
|
||||
|
|
|
@ -11,12 +11,40 @@
|
|||
package de.ellpeck.actuallyadditions.mod;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.*;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.ReconstructorRenderer;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderBatteryBox;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderDisplayStand;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderEmpowerer;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderLaserRelay;
|
||||
import de.ellpeck.actuallyadditions.mod.entity.RenderWorm;
|
||||
import de.ellpeck.actuallyadditions.mod.event.ClientEvents;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.*;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.CrusherScreen;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBioReactor;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCanolaPress;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoalGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDirectionalBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDrill;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDropper;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiEnergizer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiEnervator;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFarmer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFeeder;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFermentingBarrel;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFilter;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFireworkBox;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFluidCollector;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiLaserRelayItemWhitelist;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiMiner;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiOilGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiPhantomPlacer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiRangedCollector;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiXPSolidifier;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.SackGui;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
|
||||
import de.ellpeck.actuallyadditions.mod.particle.ActuallyParticles;
|
||||
|
@ -24,6 +52,7 @@ import de.ellpeck.actuallyadditions.mod.particle.ParticleBeam;
|
|||
import de.ellpeck.actuallyadditions.mod.particle.ParticleLaserItem;
|
||||
import de.ellpeck.actuallyadditions.mod.patchouli.PatchouliPages;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.MenuScreens;
|
||||
import net.minecraft.client.multiplayer.ClientPacketListener;
|
||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
@ -34,41 +63,37 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
||||
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent;
|
||||
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
|
||||
public class ActuallyAdditionsClient {
|
||||
public static void setupMenus(RegisterMenuScreensEvent evt) {
|
||||
evt.register(ActuallyContainers.SACK_CONTAINER.get(), SackGui::new);
|
||||
evt.register(ActuallyContainers.VOID_SACK_CONTAINER.get(), VoidSackGui::new);
|
||||
evt.register(ActuallyContainers.BIO_REACTOR_CONTAINER.get(), GuiBioReactor::new);
|
||||
evt.register(ActuallyContainers.BREAKER_CONTAINER.get(), GuiBreaker::new);
|
||||
evt.register(ActuallyContainers.CANOLA_PRESS_CONTAINER.get(), GuiCanolaPress::new);
|
||||
evt.register(ActuallyContainers.COAL_GENERATOR_CONTAINER.get(), GuiCoalGenerator::new);
|
||||
evt.register(ActuallyContainers.COFFEE_MACHINE_CONTAINER.get(), GuiCoffeeMachine::new);
|
||||
evt.register(ActuallyContainers.DIRECTIONAL_BREAKER_CONTAINER.get(), GuiDirectionalBreaker::new);
|
||||
evt.register(ActuallyContainers.DRILL_CONTAINER.get(), GuiDrill::new);
|
||||
evt.register(ActuallyContainers.DROPPER_CONTAINER.get(), GuiDropper::new);
|
||||
evt.register(ActuallyContainers.ENERVATOR_CONTAINER.get(), GuiEnervator::new);
|
||||
evt.register(ActuallyContainers.ENERGIZER_CONTAINER.get(), GuiEnergizer::new);
|
||||
evt.register(ActuallyContainers.FARMER_CONTAINER.get(), GuiFarmer::new);
|
||||
evt.register(ActuallyContainers.FEEDER_CONTAINER.get(), GuiFeeder::new);
|
||||
evt.register(ActuallyContainers.FERMENTING_BARREL_CONTAINER.get(), GuiFermentingBarrel::new);
|
||||
evt.register(ActuallyContainers.FILTER_CONTAINER.get(), GuiFilter::new);
|
||||
evt.register(ActuallyContainers.FIREWORK_BOX_CONTAINER.get(), GuiFireworkBox::new);
|
||||
evt.register(ActuallyContainers.FLUID_COLLECTOR_CONTAINER.get(), GuiFluidCollector::new);
|
||||
evt.register(ActuallyContainers.FURNACE_DOUBLE_CONTAINER.get(), GuiFurnaceDouble::new);
|
||||
evt.register(ActuallyContainers.GRINDER_CONTAINER.get(), CrusherScreen::new);
|
||||
evt.register(ActuallyContainers.LASER_RELAY_ITEM_WHITELIST_CONTAINER.get(), GuiLaserRelayItemWhitelist::new);
|
||||
evt.register(ActuallyContainers.MINER_CONTAINER.get(), GuiMiner::new);
|
||||
evt.register(ActuallyContainers.OIL_GENERATOR_CONTAINER.get(), GuiOilGenerator::new);
|
||||
evt.register(ActuallyContainers.PHANTOM_PLACER_CONTAINER.get(), GuiPhantomPlacer::new);
|
||||
evt.register(ActuallyContainers.RANGED_COLLECTOR_CONTAINER.get(), GuiRangedCollector::new);
|
||||
evt.register(ActuallyContainers.XPSOLIDIFIER_CONTAINER.get(), GuiXPSolidifier::new);
|
||||
}
|
||||
|
||||
public static void setup(FMLClientSetupEvent event) {
|
||||
MenuScreens.register(ActuallyContainers.BAG_CONTAINER.get(), SackGui::new);
|
||||
MenuScreens.register(ActuallyContainers.BIO_REACTOR_CONTAINER.get(), GuiBioReactor::new);
|
||||
MenuScreens.register(ActuallyContainers.BREAKER_CONTAINER.get(), GuiBreaker::new);
|
||||
MenuScreens.register(ActuallyContainers.CANOLA_PRESS_CONTAINER.get(), GuiCanolaPress::new);
|
||||
MenuScreens.register(ActuallyContainers.COAL_GENERATOR_CONTAINER.get(), GuiCoalGenerator::new);
|
||||
MenuScreens.register(ActuallyContainers.COFFEE_MACHINE_CONTAINER.get(), GuiCoffeeMachine::new);
|
||||
MenuScreens.register(ActuallyContainers.DIRECTIONAL_BREAKER_CONTAINER.get(), GuiDirectionalBreaker::new);
|
||||
MenuScreens.register(ActuallyContainers.DRILL_CONTAINER.get(), GuiDrill::new);
|
||||
MenuScreens.register(ActuallyContainers.DROPPER_CONTAINER.get(), GuiDropper::new);
|
||||
MenuScreens.register(ActuallyContainers.ENERVATOR_CONTAINER.get(), GuiEnervator::new);
|
||||
MenuScreens.register(ActuallyContainers.ENERGIZER_CONTAINER.get(), GuiEnergizer::new);
|
||||
MenuScreens.register(ActuallyContainers.FARMER_CONTAINER.get(), GuiFarmer::new);
|
||||
MenuScreens.register(ActuallyContainers.FEEDER_CONTAINER.get(), GuiFeeder::new);
|
||||
MenuScreens.register(ActuallyContainers.FERMENTING_BARREL_CONTAINER.get(), GuiFermentingBarrel::new);
|
||||
MenuScreens.register(ActuallyContainers.FILTER_CONTAINER.get(), GuiFilter::new);
|
||||
MenuScreens.register(ActuallyContainers.FIREWORK_BOX_CONTAINER.get(), GuiFireworkBox::new);
|
||||
MenuScreens.register(ActuallyContainers.FLUID_COLLECTOR_CONTAINER.get(), GuiFluidCollector::new);
|
||||
MenuScreens.register(ActuallyContainers.FURNACE_DOUBLE_CONTAINER.get(), GuiFurnaceDouble::new);
|
||||
MenuScreens.register(ActuallyContainers.GRINDER_CONTAINER.get(), CrusherScreen::new);
|
||||
MenuScreens.register(ActuallyContainers.LASER_RELAY_ITEM_WHITELIST_CONTAINER.get(), GuiLaserRelayItemWhitelist::new);
|
||||
MenuScreens.register(ActuallyContainers.MINER_CONTAINER.get(), GuiMiner::new);
|
||||
MenuScreens.register(ActuallyContainers.OIL_GENERATOR_CONTAINER.get(), GuiOilGenerator::new);
|
||||
MenuScreens.register(ActuallyContainers.PHANTOM_PLACER_CONTAINER.get(), GuiPhantomPlacer::new);
|
||||
MenuScreens.register(ActuallyContainers.RANGED_COLLECTOR_CONTAINER.get(), GuiRangedCollector::new);
|
||||
MenuScreens.register(ActuallyContainers.XPSOLIDIFIER_CONTAINER.get(), GuiXPSolidifier::new);
|
||||
// From old proxy
|
||||
NeoForge.EVENT_BUS.register(new ClientEvents());
|
||||
NeoForge.EVENT_BUS.register(new SpecialRenderInit());
|
||||
|
|
|
@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
|||
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
|
||||
import de.ellpeck.actuallyadditions.mod.data.WorldData;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.DrillItem;
|
||||
import de.ellpeck.actuallyadditions.mod.items.Sack;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.sack.SackManager;
|
||||
|
@ -67,21 +68,11 @@ public class CommonEvents {
|
|||
if (i != player.getInventory().selected) {
|
||||
|
||||
ItemStack invStack = player.getInventory().getItem(i);
|
||||
if (StackUtil.isValid(invStack) && (invStack.getItem() instanceof Sack) && invStack.hasTag()) {
|
||||
if (StackUtil.isValid(invStack) && invStack.getItem() instanceof Sack && invStack.hasTag()) {
|
||||
if (invStack.getOrCreateTag().getBoolean("AutoInsert")) {
|
||||
boolean changed = false;
|
||||
|
||||
boolean isVoid = ((Sack) invStack.getItem()).isVoid;
|
||||
|
||||
FilterSettings filter = new FilterSettings(4, false, false);
|
||||
filter.readFromNBT(invStack.getOrCreateTag(), "Filter");
|
||||
|
||||
if (isVoid) {
|
||||
if (filter.check(stack)) {
|
||||
stack.setCount(0);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var optHandler = SackManager.get().getHandler(invStack);
|
||||
|
||||
if (optHandler.isEmpty())
|
||||
|
@ -89,7 +80,13 @@ public class CommonEvents {
|
|||
|
||||
ItemStackHandlerAA inv = optHandler.get();
|
||||
|
||||
FilterSettings filter = new FilterSettings(4, false, false);
|
||||
filter.readFromNBT(invStack.getOrCreateTag(), "Filter");
|
||||
if (filter.check(stack)) {
|
||||
if (isVoid) {
|
||||
stack.setCount(0);
|
||||
changed = true;
|
||||
} else {
|
||||
for (int j = 0; j < inv.getSlots(); j++) {
|
||||
ItemStack bagStack = inv.getStackInSlot(j);
|
||||
if (StackUtil.isValid(bagStack)) {
|
||||
|
@ -107,7 +104,7 @@ public class CommonEvents {
|
|||
changed = true;
|
||||
}
|
||||
|
||||
if (stack.isEmpty()) {
|
||||
if (!StackUtil.isValid(stack)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -115,9 +112,9 @@ public class CommonEvents {
|
|||
}
|
||||
|
||||
if (changed) {
|
||||
/* if (!isVoid) {
|
||||
if (!isVoid) {
|
||||
DrillItem.writeSlotsToNBT(inv, invStack);
|
||||
}*/
|
||||
}
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.util.function.Supplier;
|
|||
public class ActuallyContainers {
|
||||
public static final DeferredRegister<MenuType<?>> CONTAINERS = DeferredRegister.create(BuiltInRegistries.MENU, ActuallyAdditions.MODID);
|
||||
|
||||
public static final Supplier<MenuType<SackContainer>> SACK_CONTAINER = CONTAINERS.register("sack_container", () -> IMenuTypeExtension.create(SackContainer::fromNetwork));
|
||||
public static final Supplier<MenuType<VoidSackContainer>> VOID_SACK_CONTAINER = CONTAINERS.register("void_sack_container", () -> IMenuTypeExtension.create(VoidSackContainer::new));
|
||||
public static final Supplier<MenuType<SackContainer>> BAG_CONTAINER = CONTAINERS.register("bag_container", () -> IMenuTypeExtension.create(SackContainer::fromNetwork));
|
||||
public static final Supplier<MenuType<ContainerBioReactor>> BIO_REACTOR_CONTAINER = CONTAINERS.register("bioreactor_container", () -> IMenuTypeExtension.create(ContainerBioReactor::fromNetwork));
|
||||
public static final Supplier<MenuType<ContainerBreaker>> BREAKER_CONTAINER = CONTAINERS.register("breaker_container", () -> IMenuTypeExtension.create(ContainerBreaker::fromNetwork));
|
||||
public static final Supplier<MenuType<ContainerCanolaPress>> CANOLA_PRESS_CONTAINER = CONTAINERS.register("canola_press_container", () -> IMenuTypeExtension.create(ContainerCanolaPress::fromNetwork));
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyTags;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotDeletion;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotImmovable;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
|
||||
|
@ -45,7 +46,7 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
}
|
||||
|
||||
public SackContainer(int windowId, Inventory playerInventory, UUID uuid, ItemStackHandlerAA handler) {
|
||||
super(ActuallyContainers.SACK_CONTAINER.get(), windowId);
|
||||
super(ActuallyContainers.BAG_CONTAINER.get(), windowId);
|
||||
|
||||
this.inventory = playerInventory;
|
||||
this.bagInventory = handler;
|
||||
|
@ -54,6 +55,15 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
this.addSlot(new SlotFilter(this.filter, row, 155, 10 + row * 18));
|
||||
}
|
||||
|
||||
if (false) { // TODO isvoid, move to its own container
|
||||
this.addSlot(new SlotDeletion(this.bagInventory, 0, 64, 65) {
|
||||
@Override
|
||||
public boolean mayPlace(ItemStack stack) {
|
||||
return SackContainer.this.filter.check(stack);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Sack inventory
|
||||
for (int row = 0; row < 4; row++) {
|
||||
for (int col = 0; col < 7; col++) {
|
||||
|
@ -84,6 +94,7 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
|
||||
ItemStack stack = playerInventory.getSelected();
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof Sack) {
|
||||
//DrillItem.loadSlotsFromNBT(this.bagInventory, playerInventory.getSelected());
|
||||
if (stack.hasTag()) {
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
this.filter.readFromNBT(compound, "Filter");
|
||||
|
@ -92,6 +103,46 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
}
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public void broadcastChanges() { // TODO is this needed anymore?
|
||||
super.broadcastChanges();
|
||||
|
||||
if (this.filter.needsUpdateSend() || this.autoInsert != this.oldAutoInsert) {
|
||||
for (ContainerListener listener : this..containerListeners) {
|
||||
listener.setContainerData(this, 0, this.filter.isWhitelist
|
||||
? 1
|
||||
: 0);
|
||||
listener.setContainerData(this, 1, this.filter.respectMeta
|
||||
? 1
|
||||
: 0);
|
||||
listener.setContainerData(this, 2, this.filter.respectNBT
|
||||
? 1
|
||||
: 0);
|
||||
listener.setContainerData(this, 3, this.filter.respectOredict);
|
||||
listener.setContainerData(this, 4, this.autoInsert
|
||||
? 1
|
||||
: 0);
|
||||
listener.setContainerData(this, 5, this.filter.respectMod
|
||||
? 1
|
||||
: 0);
|
||||
}
|
||||
this.filter.updateLasts();
|
||||
this.oldAutoInsert = this.autoInsert;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void setData(int id, int data) {
|
||||
if (id == 0) {
|
||||
this.filter.isWhitelist = data == 1;
|
||||
} else if (id == 1) {
|
||||
this.autoInsert = data == 1;
|
||||
} else if (id == 2) {
|
||||
this.filter.respectMod = data == 1;
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public ItemStack quickMoveStack(@Nonnull Player player, int slot) {
|
||||
int inventoryStart = this.bagInventory.getSlots() + 4;
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotDeletion;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotImmovable;
|
||||
import de.ellpeck.actuallyadditions.mod.items.Sack;
|
||||
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.FilterSettings;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.ClickType;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VoidSackContainer extends AbstractContainerMenu implements IButtonReactor {
|
||||
public final FilterSettings filter = new FilterSettings(4, false,false);
|
||||
|
||||
private final ItemStackHandlerAA bagInventory;
|
||||
private final Inventory inventory;
|
||||
public boolean autoInsert;
|
||||
private boolean oldAutoInsert;
|
||||
|
||||
protected VoidSackContainer(int windowId, Inventory inv, FriendlyByteBuf data) {
|
||||
this(windowId, inv);
|
||||
}
|
||||
|
||||
public VoidSackContainer(int pContainerId, Inventory pPlayerInventory) {
|
||||
super(ActuallyContainers.VOID_SACK_CONTAINER.get(), pContainerId);
|
||||
|
||||
this.inventory = pPlayerInventory;
|
||||
this.bagInventory = new ItemStackHandlerAA(1);
|
||||
|
||||
for (int c = 0; c < 4; c++) {
|
||||
this.addSlot(new SlotFilter(this.filter, c, 98 + c * 17, 17));
|
||||
}
|
||||
|
||||
this.addSlot(new SlotDeletion(this.bagInventory, 0, 13, 18) {
|
||||
@Override
|
||||
public boolean mayPlace(ItemStack stack) {
|
||||
return VoidSackContainer.this.filter.check(stack);
|
||||
}
|
||||
});
|
||||
|
||||
// Player Inventory
|
||||
for (int row = 0; row < 3; row++) {
|
||||
for (int col = 0; col < 9; col++) {
|
||||
this.addSlot(new Slot(inventory, col + row * 9 + 9, 8 + col * 18, 47 + row * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Player Hotbar
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (i == inventory.selected) {
|
||||
this.addSlot(new SlotImmovable(inventory, i, 8 + i * 18, 105));
|
||||
} else {
|
||||
this.addSlot(new Slot(inventory, i, 8 + i * 18, 105));
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack stack = inventory.getSelected();
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof Sack) {
|
||||
if (stack.hasTag()) {
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
this.filter.readFromNBT(compound, "Filter");
|
||||
this.autoInsert = compound.getBoolean("AutoInsert");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clicked(int slotId, int dragType, @Nonnull ClickType clickTypeIn, @Nonnull Player player) {
|
||||
if (SlotFilter.checkFilter(this, slotId, player)) {
|
||||
return;
|
||||
} else if (clickTypeIn == ClickType.SWAP && dragType == this.inventory.selected) {
|
||||
return;
|
||||
} else {
|
||||
super.clicked(slotId, dragType, clickTypeIn, player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed(@Nonnull Player player) {
|
||||
ItemStack stack = this.inventory.getSelected();
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof Sack) {
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
this.filter.writeToNBT(compound, "Filter");
|
||||
compound.putBoolean("AutoInsert", this.autoInsert);
|
||||
}
|
||||
super.removed(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onButtonPressed(int buttonID, Player player) {
|
||||
if (buttonID == 0) {
|
||||
this.autoInsert = !this.autoInsert;
|
||||
} else {
|
||||
this.filter.onButtonPressed(buttonID - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack quickMoveStack(@Nonnull Player pPlayer, int pIndex) {
|
||||
return ItemStack.EMPTY; //TODO old behavior was shift clicking moved stacks around the normal inventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stillValid(@Nonnull Player pPlayer) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -33,7 +33,7 @@ public class FilterSettingsGui {
|
|||
public Button whitelistButton;
|
||||
public Button modButton;
|
||||
|
||||
public FilterSettingsGui(FilterSettings settings, int x, int y, boolean vertical, Consumer<AbstractButton> buttonConsumer, Consumer<Integer> clickConsumer, int idOffset) {
|
||||
public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer<AbstractButton> buttonConsumer, Consumer<Integer> clickConsumer, int idOffset) {
|
||||
this.theSettings = settings;
|
||||
|
||||
this.whitelistButton = Button.builder(Component.literal("WH"), $ -> {
|
||||
|
@ -42,10 +42,7 @@ public class FilterSettingsGui {
|
|||
})
|
||||
.bounds(x, y, 16, 12).build();
|
||||
buttonConsumer.accept(this.whitelistButton);
|
||||
if (vertical)
|
||||
y += 14;
|
||||
else
|
||||
x += 18;
|
||||
this.modButton = Button.builder(Component.literal("MO"), $ -> {
|
||||
theSettings.respectMod = !theSettings.respectMod;
|
||||
clickConsumer.accept(idOffset + 1);
|
||||
|
|
|
@ -68,8 +68,8 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
|
|||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.leftFilter = new FilterSettingsGui(this.tile.leftFilter, this.leftPos + 3, this.topPos + 6, true, this::addRenderableWidget, this::buttonClicked, 0);
|
||||
this.rightFilter = new FilterSettingsGui(this.tile.rightFilter, this.leftPos + 157, this.topPos + 6, true, this::addRenderableWidget, this::buttonClicked, 4);
|
||||
this.leftFilter = new FilterSettingsGui(this.tile.leftFilter, this.leftPos + 3, this.topPos + 6, this::addRenderableWidget, this::buttonClicked, 0);
|
||||
this.rightFilter = new FilterSettingsGui(this.tile.rightFilter, this.leftPos + 157, this.topPos + 6, this::addRenderableWidget, this::buttonClicked, 4);
|
||||
|
||||
this.buttonSmartWhitelistLeft = this.addRenderableWidget(Button.builder(
|
||||
Component.literal("S"),
|
||||
|
|
|
@ -48,7 +48,7 @@ public class GuiRangedCollector extends AAScreen<ContainerRangedCollector> {
|
|||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.filter = new FilterSettingsGui(this.collector.filter, this.leftPos + 3, this.topPos + 6, true, this::addRenderableWidget, this::buttonClicked, 0);
|
||||
this.filter = new FilterSettingsGui(this.collector.filter, this.leftPos + 3, this.topPos + 6, this::addRenderableWidget, this::buttonClicked, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,8 +32,10 @@ import java.util.Optional;
|
|||
|
||||
public class SackGui extends AAScreen<SackContainer> {
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bag");
|
||||
private static final ResourceLocation RES_LOC_VOID = AssetUtil.getGuiLocation("gui_void_bag");
|
||||
|
||||
private final SackContainer container;
|
||||
private final boolean isVoid;
|
||||
private FilterSettingsGui filter;
|
||||
private Button buttonAutoInsert;
|
||||
|
||||
|
@ -41,6 +43,7 @@ public class SackGui extends AAScreen<SackContainer> {
|
|||
super(container, inventory, title);
|
||||
this.imageWidth = 176;
|
||||
this.imageHeight = 90 + 86;
|
||||
this.isVoid = false; //TODO fix later
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
|
@ -48,7 +51,7 @@ public class SackGui extends AAScreen<SackContainer> {
|
|||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 137, this.topPos + 10, true, this::addRenderableWidget, this::buttonClicked, 1);
|
||||
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 137, this.topPos + 10, this::addRenderableWidget, this::buttonClicked, 1);
|
||||
|
||||
this.buttonAutoInsert = Button.builder(
|
||||
Component.literal("I")
|
||||
|
@ -78,6 +81,13 @@ public class SackGui extends AAScreen<SackContainer> {
|
|||
this.filter.tick();
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
AssetUtil.displayNameString(this.font, this.imageWidth, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + "." + (this.isVoid
|
||||
? "voidBag"
|
||||
: "bag") + ".name"));
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
||||
|
@ -100,6 +110,6 @@ public class SackGui extends AAScreen<SackContainer> {
|
|||
|
||||
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 90, 0, 0, 176, 86);
|
||||
|
||||
guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 90);
|
||||
guiGraphics.blit(this.isVoid ? RES_LOC_VOID : RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 90);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* This file ("GuiBag.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.inventory.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.VoidSackContainer;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class VoidSackGui extends AAScreen<VoidSackContainer> {
|
||||
private static final ResourceLocation RES_LOC_VOID = AssetUtil.getGuiLocation("gui_void_bag");
|
||||
|
||||
private final VoidSackContainer container;
|
||||
private FilterSettingsGui filter;
|
||||
private Button buttonAutoInsert;
|
||||
|
||||
public VoidSackGui(VoidSackContainer container, Inventory inventory, Component title) {
|
||||
super(container, inventory, title);
|
||||
this.imageWidth = 176;
|
||||
this.imageHeight = 90 + 43;
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 97, this.topPos + 3, false, this::addRenderableWidget, this::buttonClicked, 1);
|
||||
|
||||
this.buttonAutoInsert = Button.builder(
|
||||
Component.literal("I")
|
||||
.withStyle(this.container.autoInsert? ChatFormatting.DARK_GREEN : ChatFormatting.RED),
|
||||
(button) -> {
|
||||
this.container.autoInsert = !this.container.autoInsert;
|
||||
this.buttonAutoInsert.setMessage(Component.literal(this.container.autoInsert? "I" : "O")
|
||||
.withStyle(this.container.autoInsert? ChatFormatting.DARK_GREEN : ChatFormatting.RED));
|
||||
this.buttonClicked(0);
|
||||
}).pos(leftPos - 17, topPos + 16).size(20, 20)
|
||||
.build();
|
||||
|
||||
this.addRenderableWidget(this.buttonAutoInsert);
|
||||
}
|
||||
|
||||
public void buttonClicked(int id) {
|
||||
CompoundTag data = new CompoundTag();
|
||||
data.putInt("ButtonID", id);
|
||||
data.putInt("PlayerID", Minecraft.getInstance().player.getId());
|
||||
data.putString("WorldID", Minecraft.getInstance().level.dimension().location().toString());
|
||||
PacketDistributor.SERVER.noArg().send(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void containerTick() {
|
||||
super.containerTick();
|
||||
this.filter.tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
||||
this.filter.drawHover(guiGraphics, mouseX, mouseY);
|
||||
|
||||
if (this.buttonAutoInsert.isMouseOver(mouseX, mouseY)) {
|
||||
List<Component> text = new ArrayList<>();
|
||||
text.add(Component.literal("Auto-Insert " + (this.container.autoInsert
|
||||
? "On"
|
||||
: "Off")).withStyle(ChatFormatting.BOLD));
|
||||
text.add(Component.literal("Turn this on to make items that get picked up automatically go into the bag.")); //TODO how to word wrap these to 200?
|
||||
text.add(Component.literal("Note that this WON'T work when you are holding the bag in your hand.").withStyle(ChatFormatting.GRAY).withStyle(ChatFormatting.ITALIC)); //TODO this too
|
||||
guiGraphics.renderTooltip(font, text, Optional.empty(), mouseX, mouseY); //TODO i have no idea what im doing here...
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int x, int y) {
|
||||
RenderSystem.setShaderColor(1F, 1F, 1F, 1F);
|
||||
|
||||
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 43, 0, 0, 176, 86);
|
||||
|
||||
guiGraphics.blit( RES_LOC_VOID, this.leftPos, this.topPos, 0, 0, 176, 43);
|
||||
}
|
||||
}
|
|
@ -45,21 +45,23 @@ public class SlotFilter extends SlotItemHandlerUnconditioned {
|
|||
}
|
||||
|
||||
private void slotClick(Player player, ItemStack cursorItem) {
|
||||
ItemStack heldStack = cursorItem;
|
||||
ItemStack stackInSlot = this.getItem();
|
||||
if (!stackInSlot.isEmpty() && cursorItem.isEmpty()) {
|
||||
|
||||
if (StackUtil.isValid(stackInSlot) && !StackUtil.isValid(heldStack)) {
|
||||
if (isFilter(stackInSlot)) {
|
||||
player.containerMenu.setCarried(stackInSlot);
|
||||
player.getInventory().setPickedItem(stackInSlot);
|
||||
}
|
||||
|
||||
this.set(ItemStack.EMPTY);
|
||||
} else if (StackUtil.isValid(cursorItem)) {
|
||||
} else if (StackUtil.isValid(heldStack)) {
|
||||
if (!isFilter(stackInSlot)) {
|
||||
ItemStack s = cursorItem.copy();
|
||||
ItemStack s = heldStack.copy();
|
||||
s.setCount(1);
|
||||
this.set(s);
|
||||
|
||||
if (isFilter(cursorItem)) {
|
||||
cursorItem.shrink(1);
|
||||
if (isFilter(heldStack)) {
|
||||
heldStack.shrink(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
package de.ellpeck.actuallyadditions.mod.items;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.SackContainer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.VoidSackContainer;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||
import de.ellpeck.actuallyadditions.mod.sack.SackData;
|
||||
import de.ellpeck.actuallyadditions.mod.sack.SackManager;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
@ -30,7 +30,6 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -42,7 +41,6 @@ public class Sack extends ItemBase {
|
|||
this.isVoid = isVoid;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public InteractionResult useOn(UseOnContext context) {
|
||||
ItemStack stack = context.getPlayer().getItemInHand(context.getHand());
|
||||
|
@ -61,13 +59,13 @@ public class Sack extends ItemBase {
|
|||
|
||||
for (int j = 0; j < inv.getSlots(); j++) {
|
||||
ItemStack invStack = inv.getStackInSlot(j);
|
||||
if (!invStack.isEmpty()) {
|
||||
if (StackUtil.isValid(invStack)) {
|
||||
for (int i = 0; i < cap.getSlots(); i++) {
|
||||
ItemStack remain = cap.insertItem(i, invStack, false);
|
||||
if (!ItemStack.matches(remain, invStack)) {
|
||||
inv.setStackInSlot(j, remain.copy());
|
||||
localChanged = true;
|
||||
if (remain.isEmpty()) {
|
||||
if (!StackUtil.isValid(remain)) {
|
||||
break;
|
||||
}
|
||||
invStack = remain;
|
||||
|
@ -89,9 +87,8 @@ public class Sack extends ItemBase {
|
|||
return InteractionResult.PASS;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player player, @Nonnull InteractionHand hand) {
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {
|
||||
ItemStack sackStack = player.getItemInHand(hand);
|
||||
if (!world.isClientSide && hand == InteractionHand.MAIN_HAND && sackStack.getItem() instanceof Sack && player instanceof ServerPlayer) {
|
||||
|
||||
|
@ -107,8 +104,12 @@ public class Sack extends ItemBase {
|
|||
|
||||
player.openMenu(new SimpleMenuProvider((id, inv, entity) ->
|
||||
new SackContainer(id, inv, uuid, data.getSpecialHandler()), sackStack.getHoverName()), (buffer -> buffer.writeUUID(uuid)));
|
||||
} else
|
||||
player.openMenu(new SimpleMenuProvider((id, inv, entity) -> new VoidSackContainer(id, inv), sackStack.getHoverName()));
|
||||
}
|
||||
|
||||
|
||||
/* NetworkHooks.openGui((ServerPlayerEntity) player,
|
||||
new SimpleNamedContainerProvider((windowId, playerInventory, playerEntity) ->
|
||||
new ContainerBag(windowId, playerInventory, playerEntity.getItemInHand(hand), this.isVoid), StringComponent.empty()));*/
|
||||
}
|
||||
return InteractionResultHolder.pass(player.getItemInHand(hand));
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay {
|
|||
}
|
||||
//TODO dont send the entire tank at once, gg
|
||||
if (totalReceiverAmount > 0 && !relaysThatWork.isEmpty()) {
|
||||
int amountPer = stack.getAmount() / totalReceiverAmount > 0
|
||||
int amountPer = stack.getAmount() / totalReceiverAmount <= 0
|
||||
? stack.getAmount() / totalReceiverAmount
|
||||
: stack.getAmount();
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@
|
|||
"item.actuallyadditions.player_probe": "Player Probe",
|
||||
"item.actuallyadditions.worm": "Worm",
|
||||
"item.actuallyadditions.travelers_sack": "Traveler's Sack",
|
||||
"item.actuallyadditions.void_sack": "Void Sack",
|
||||
"item.actuallyadditions.void_sack": "Void Sack (wip)",
|
||||
"item.actuallyadditions.crystallized_canola_seed": "Crystallized Canola Seed",
|
||||
"item.actuallyadditions.empowered_canola_seed": "Empowered Canola Seed",
|
||||
"item.actuallyadditions.lens_of_the_miner": "Lens of the Miner",
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:mod_loaded",
|
||||
"modid": "xycraft_world"
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "xycraft_world:aluminum_ore_stone"
|
||||
},
|
||||
"weight": 250
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:mod_loaded",
|
||||
"modid": "xycraft_world"
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "xycraft_world:xychorium_ore_stone_blue"
|
||||
},
|
||||
"weight": 300
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:mod_loaded",
|
||||
"modid": "xycraft_world"
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "xycraft_world:xychorium_ore_stone_dark"
|
||||
},
|
||||
"weight": 300
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:mod_loaded",
|
||||
"modid": "xycraft_world"
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "xycraft_world:xychorium_ore_stone_green"
|
||||
},
|
||||
"weight": 300
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:mod_loaded",
|
||||
"modid": "xycraft_world"
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "xycraft_world:xychorium_ore_stone_light"
|
||||
},
|
||||
"weight": 300
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:mod_loaded",
|
||||
"modid": "xycraft_world"
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:mining_lens",
|
||||
"ingredient": {
|
||||
"tag": "forge:stone"
|
||||
},
|
||||
"result": {
|
||||
"item": "xycraft_world:xychorium_ore_stone_red"
|
||||
},
|
||||
"weight": 300
|
||||
}
|
Loading…
Reference in a new issue