mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-26 13:28:33 +01:00
parent
23a4292f47
commit
a5b7bd1e82
13 changed files with 126 additions and 10 deletions
|
@ -4,20 +4,22 @@ import de.ellpeck.prettypipes.entities.PipeFrameEntity;
|
||||||
import de.ellpeck.prettypipes.entities.PipeFrameRenderer;
|
import de.ellpeck.prettypipes.entities.PipeFrameRenderer;
|
||||||
import de.ellpeck.prettypipes.items.*;
|
import de.ellpeck.prettypipes.items.*;
|
||||||
import de.ellpeck.prettypipes.misc.ItemEqualityType;
|
import de.ellpeck.prettypipes.misc.ItemEqualityType;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.FilterModifierModuleItem;
|
import de.ellpeck.prettypipes.network.PipeNetwork;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.LowPriorityModuleItem;
|
import de.ellpeck.prettypipes.packets.PacketHandler;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.RedstoneModuleItem;
|
import de.ellpeck.prettypipes.pipe.IPipeConnectable;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.SpeedModuleItem;
|
import de.ellpeck.prettypipes.pipe.PipeBlock;
|
||||||
|
import de.ellpeck.prettypipes.pipe.PipeRenderer;
|
||||||
|
import de.ellpeck.prettypipes.pipe.PipeTileEntity;
|
||||||
|
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeContainer;
|
||||||
|
import de.ellpeck.prettypipes.pipe.containers.MainPipeContainer;
|
||||||
|
import de.ellpeck.prettypipes.pipe.containers.MainPipeGui;
|
||||||
|
import de.ellpeck.prettypipes.pipe.modules.*;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.craft.CraftingModuleContainer;
|
import de.ellpeck.prettypipes.pipe.modules.craft.CraftingModuleContainer;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.craft.CraftingModuleGui;
|
import de.ellpeck.prettypipes.pipe.modules.craft.CraftingModuleGui;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.craft.CraftingModuleItem;
|
import de.ellpeck.prettypipes.pipe.modules.craft.CraftingModuleItem;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.extraction.ExtractionModuleContainer;
|
import de.ellpeck.prettypipes.pipe.modules.extraction.ExtractionModuleContainer;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.extraction.ExtractionModuleGui;
|
import de.ellpeck.prettypipes.pipe.modules.extraction.ExtractionModuleGui;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.extraction.ExtractionModuleItem;
|
import de.ellpeck.prettypipes.pipe.modules.extraction.ExtractionModuleItem;
|
||||||
import de.ellpeck.prettypipes.network.PipeNetwork;
|
|
||||||
import de.ellpeck.prettypipes.packets.PacketHandler;
|
|
||||||
import de.ellpeck.prettypipes.pipe.*;
|
|
||||||
import de.ellpeck.prettypipes.pipe.containers.*;
|
|
||||||
import de.ellpeck.prettypipes.pipe.modules.filter.FilterIncreaseModuleContainer;
|
import de.ellpeck.prettypipes.pipe.modules.filter.FilterIncreaseModuleContainer;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.filter.FilterIncreaseModuleGui;
|
import de.ellpeck.prettypipes.pipe.modules.filter.FilterIncreaseModuleGui;
|
||||||
import de.ellpeck.prettypipes.pipe.modules.filter.FilterIncreaseModuleItem;
|
import de.ellpeck.prettypipes.pipe.modules.filter.FilterIncreaseModuleItem;
|
||||||
|
@ -143,6 +145,7 @@ public final class Registry {
|
||||||
registry.registerAll(createTieredModule("filter_module", FilterModuleItem::new));
|
registry.registerAll(createTieredModule("filter_module", FilterModuleItem::new));
|
||||||
registry.registerAll(createTieredModule("speed_module", SpeedModuleItem::new));
|
registry.registerAll(createTieredModule("speed_module", SpeedModuleItem::new));
|
||||||
registry.registerAll(createTieredModule("low_priority_module", LowPriorityModuleItem::new));
|
registry.registerAll(createTieredModule("low_priority_module", LowPriorityModuleItem::new));
|
||||||
|
registry.registerAll(createTieredModule("high_priority_module", HighPriorityModuleItem::new));
|
||||||
registry.registerAll(createTieredModule("retrieval_module", RetrievalModuleItem::new));
|
registry.registerAll(createTieredModule("retrieval_module", RetrievalModuleItem::new));
|
||||||
registry.register(new StackSizeModuleItem("stack_size_module"));
|
registry.register(new StackSizeModuleItem("stack_size_module"));
|
||||||
registry.registerAll(Arrays.stream(ItemEqualityType.values()).map(t -> new FilterModifierModuleItem(t.name().toLowerCase(Locale.ROOT) + "_filter_modifier", t)).toArray(Item[]::new));
|
registry.registerAll(Arrays.stream(ItemEqualityType.values()).map(t -> new FilterModifierModuleItem(t.name().toLowerCase(Locale.ROOT) + "_filter_modifier", t)).toArray(Item[]::new));
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package de.ellpeck.prettypipes.pipe.modules;
|
||||||
|
|
||||||
|
import de.ellpeck.prettypipes.items.IModule;
|
||||||
|
import de.ellpeck.prettypipes.items.ModuleItem;
|
||||||
|
import de.ellpeck.prettypipes.items.ModuleTier;
|
||||||
|
import de.ellpeck.prettypipes.pipe.PipeTileEntity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class HighPriorityModuleItem extends ModuleItem {
|
||||||
|
private final int priority;
|
||||||
|
|
||||||
|
public HighPriorityModuleItem(String name, ModuleTier tier) {
|
||||||
|
super(name);
|
||||||
|
this.priority = tier.forTier(50, 100, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPriority(ItemStack module, PipeTileEntity tile) {
|
||||||
|
return this.priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCompatible(ItemStack module, PipeTileEntity tile, IModule other) {
|
||||||
|
return !(other instanceof HighPriorityModuleItem) && !(other instanceof LowPriorityModuleItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasContainer(ItemStack module, PipeTileEntity tile) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,7 +21,7 @@ public class LowPriorityModuleItem extends ModuleItem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCompatible(ItemStack module, PipeTileEntity tile, IModule other) {
|
public boolean isCompatible(ItemStack module, PipeTileEntity tile, IModule other) {
|
||||||
return !(other instanceof LowPriorityModuleItem);
|
return !(other instanceof LowPriorityModuleItem) && !(other instanceof HighPriorityModuleItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
"item.prettypipes.low_low_priority_module": "Low Priority Module",
|
"item.prettypipes.low_low_priority_module": "Low Priority Module",
|
||||||
"item.prettypipes.medium_low_priority_module": "Lower Priority Module",
|
"item.prettypipes.medium_low_priority_module": "Lower Priority Module",
|
||||||
"item.prettypipes.high_low_priority_module": "Lowest Priority Module",
|
"item.prettypipes.high_low_priority_module": "Lowest Priority Module",
|
||||||
|
"item.prettypipes.low_high_priority_module": "High Priority Module",
|
||||||
|
"item.prettypipes.medium_high_priority_module": "Higher Priority Module",
|
||||||
|
"item.prettypipes.high_high_priority_module": "Highest Priority Module",
|
||||||
"item.prettypipes.low_retrieval_module": "Low Retrieval Module",
|
"item.prettypipes.low_retrieval_module": "Low Retrieval Module",
|
||||||
"item.prettypipes.medium_retrieval_module": "Medium Retrieval Module",
|
"item.prettypipes.medium_retrieval_module": "Medium Retrieval Module",
|
||||||
"item.prettypipes.high_retrieval_module": "High Retrieval Module",
|
"item.prettypipes.high_retrieval_module": "High Retrieval Module",
|
||||||
|
@ -32,7 +35,8 @@
|
||||||
"info.prettypipes.extraction_module": "Pulls items from adjacent inventories\nFilters and pull rates vary by tier\nHigh tiers prevent over-sending",
|
"info.prettypipes.extraction_module": "Pulls items from adjacent inventories\nFilters and pull rates vary by tier\nHigh tiers prevent over-sending",
|
||||||
"info.prettypipes.filter_module": "Restricts flow from pipes into adjacent inventories\nFilter amount varies by tier",
|
"info.prettypipes.filter_module": "Restricts flow from pipes into adjacent inventories\nFilter amount varies by tier",
|
||||||
"info.prettypipes.speed_module": "Increases speed of items exiting adjacent inventories\nSpeed varies by tier",
|
"info.prettypipes.speed_module": "Increases speed of items exiting adjacent inventories\nSpeed varies by tier",
|
||||||
"info.prettypipes.low_priority_module": "Decreases the reception priority of adjacent inventories\nLower priority means items will prefer other inventories",
|
"info.prettypipes.low_priority_module": "Decreases the reception priority of adjacent inventories\nLower priority means items will prefer other inventories, regardless of distance",
|
||||||
|
"info.prettypipes.high_priority_module": "Increases the reception priority of adjacent inventories\nHigher priority means items will prefer this inventory, regardless of distance",
|
||||||
"info.prettypipes.retrieval_module": "Pulls items from other inventories in the network\nFilters and pull rates vary by tier\nHigh tiers prevent over-sending",
|
"info.prettypipes.retrieval_module": "Pulls items from other inventories in the network\nFilters and pull rates vary by tier\nHigh tiers prevent over-sending",
|
||||||
"info.prettypipes.stack_size_module": "Limits the amount of items that can enter adjacent inventories\nAutomatically prevents over-sending",
|
"info.prettypipes.stack_size_module": "Limits the amount of items that can enter adjacent inventories\nAutomatically prevents over-sending",
|
||||||
"info.prettypipes.damage_filter_modifier": "Causes any filter slots to filter by item damage",
|
"info.prettypipes.damage_filter_modifier": "Causes any filter slots to filter by item damage",
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "prettypipes:item/high_high_priority_module"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "prettypipes:item/low_high_priority_module"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "prettypipes:item/medium_high_priority_module"
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 361 B |
Binary file not shown.
After Width: | Height: | Size: 357 B |
Binary file not shown.
After Width: | Height: | Size: 343 B |
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"CCC",
|
||||||
|
"CMC",
|
||||||
|
"CCC"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"C": {
|
||||||
|
"item": "minecraft:paper"
|
||||||
|
},
|
||||||
|
"M": {
|
||||||
|
"item": "prettypipes:medium_high_priority_module"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "prettypipes:high_high_priority_module"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
" C ",
|
||||||
|
"RMR",
|
||||||
|
" R "
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"R": {
|
||||||
|
"item": "minecraft:redstone"
|
||||||
|
},
|
||||||
|
"C": {
|
||||||
|
"item": "minecraft:paper"
|
||||||
|
},
|
||||||
|
"M": {
|
||||||
|
"item": "prettypipes:blank_module"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "prettypipes:low_high_priority_module"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
" C ",
|
||||||
|
"CMC",
|
||||||
|
" C "
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"C": {
|
||||||
|
"item": "minecraft:paper"
|
||||||
|
},
|
||||||
|
"M": {
|
||||||
|
"item": "prettypipes:low_high_priority_module"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "prettypipes:medium_high_priority_module"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue