mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-28 09:48:34 +01:00
Compare commits
No commits in common. "154add17bd716fe83286004db0db10261e980022" and "08b4f923f28f411ac282dbbd5cb6215772ca4b3c" have entirely different histories.
154add17bd
...
08b4f923f2
65 changed files with 99 additions and 1068 deletions
|
@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
# Actually Additions
|
# Actually Additions
|
||||||
|
|
||||||
mod_version=1.2.6
|
mod_version=1.2.5
|
||||||
|
|
||||||
# Forge
|
# Forge
|
||||||
game_version=1.20.4
|
game_version=1.20.4
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
// 1.20.4 2024-03-13T03:30:52.2359302 Global Loot Modifiers : actuallyadditions
|
|
||||||
c314f845c2f475a0e11bbbeaf9ce082f283e84ed data/actuallyadditions/loot_modifiers/bat_loot.json
|
|
||||||
f77519b3b0453bb66d43569f8c67e59de6e49a2f data/actuallyadditions/loot_modifiers/dungeon_loot.json
|
|
||||||
24211d6853742ccd8fc0116f93710ef5ee759c29 data/neoforge/loot_modifiers/global_loot_modifiers.json
|
|
|
@ -1,8 +1,6 @@
|
||||||
// 1.20.4 2024-03-12T17:06:32.3158961 Mining Lens Recipes
|
// 1.20.4 2024-03-12T20:08:36.1633314 Mining Lens Recipes
|
||||||
7341f498818439ac0a9272a1beaa8f19389012ef data/actuallyadditions/recipes/mininglens/nether_ancient_debris.json
|
|
||||||
411b455c637359f1f46df6fced8cd7558436e938 data/actuallyadditions/recipes/mininglens/nether_nether_gold_ore.json
|
411b455c637359f1f46df6fced8cd7558436e938 data/actuallyadditions/recipes/mininglens/nether_nether_gold_ore.json
|
||||||
7227ee2a53f520facb7fe8f7b34a1a74c9a49e85 data/actuallyadditions/recipes/mininglens/nether_nether_quartz_ore.json
|
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
|
550a0fe3577fcdaf0e1af1b2e3a518256992e00b data/actuallyadditions/recipes/mininglens/stone_coal_ore.json
|
||||||
869a51e0fc919b7a4577bb7c466ca07a6ae0370b data/actuallyadditions/recipes/mininglens/stone_diamond_ore.json
|
869a51e0fc919b7a4577bb7c466ca07a6ae0370b data/actuallyadditions/recipes/mininglens/stone_diamond_ore.json
|
||||||
f74f71eb82bc63538662217d9b0eb136bd262618 data/actuallyadditions/recipes/mininglens/stone_emerald_ore.json
|
f74f71eb82bc63538662217d9b0eb136bd262618 data/actuallyadditions/recipes/mininglens/stone_emerald_ore.json
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"type": "actuallyadditions:bat_loot",
|
|
||||||
"conditions": [
|
|
||||||
{
|
|
||||||
"condition": "minecraft:killed_by_player"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:entities/bat"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
{
|
|
||||||
"type": "actuallyadditions:dungeon_loot",
|
|
||||||
"conditions": [
|
|
||||||
{
|
|
||||||
"condition": "minecraft:any_of",
|
|
||||||
"terms": [
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/simple_dungeon"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/abandoned_mineshaft"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/village/village_weaponsmith"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/stronghold_library"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/igloo_chest"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/desert_pyramid"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/nether_bridge"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/end_city_treasure"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "neoforge:loot_table_id",
|
|
||||||
"loot_table_id": "minecraft:chests/woodland_mansion"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:netherrack"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "minecraft:ancient_debris"
|
|
||||||
},
|
|
||||||
"weight": 1
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "actuallyadditions:black_quartz_ore"
|
|
||||||
},
|
|
||||||
"weight": 3000
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"entries": [
|
|
||||||
"actuallyadditions:dungeon_loot",
|
|
||||||
"actuallyadditions:bat_loot"
|
|
||||||
],
|
|
||||||
"replace": false
|
|
||||||
}
|
|
|
@ -66,8 +66,6 @@ public class ActuallyAdditionsData {
|
||||||
|
|
||||||
generator.addProvider(true, new PachouliGenerator(packOutput));
|
generator.addProvider(true, new PachouliGenerator(packOutput));
|
||||||
|
|
||||||
generator.addProvider(true, new GlobalLootModifierGenerator(packOutput));
|
|
||||||
|
|
||||||
generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(
|
generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(
|
||||||
packOutput, patchedProvider, Set.of(ActuallyAdditions.MODID)));
|
packOutput, patchedProvider, Set.of(ActuallyAdditions.MODID)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
package de.ellpeck.actuallyadditions.data;
|
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.lootmodifier.BatLootModifier;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.lootmodifier.DungeonLootModifier;
|
|
||||||
import net.minecraft.data.PackOutput;
|
|
||||||
import net.minecraft.world.entity.EntityType;
|
|
||||||
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
|
|
||||||
import net.minecraft.world.level.storage.loot.predicates.AnyOfCondition;
|
|
||||||
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
|
|
||||||
import net.minecraft.world.level.storage.loot.predicates.LootItemKilledByPlayerCondition;
|
|
||||||
import net.neoforged.neoforge.common.data.GlobalLootModifierProvider;
|
|
||||||
import net.neoforged.neoforge.common.loot.LootTableIdCondition;
|
|
||||||
|
|
||||||
public class GlobalLootModifierGenerator extends GlobalLootModifierProvider {
|
|
||||||
public GlobalLootModifierGenerator(PackOutput packOutput) {
|
|
||||||
super(packOutput, ActuallyAdditions.MODID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void start() {
|
|
||||||
this.add("bat_loot", new BatLootModifier(
|
|
||||||
new LootItemCondition[]{
|
|
||||||
LootItemKilledByPlayerCondition.killedByPlayer().build(),
|
|
||||||
LootTableIdCondition.builder(EntityType.BAT.getDefaultLootTable()).build()
|
|
||||||
}));
|
|
||||||
this.add("dungeon_loot", new DungeonLootModifier(
|
|
||||||
new LootItemCondition[]{
|
|
||||||
AnyOfCondition.anyOf(
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.SIMPLE_DUNGEON),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.ABANDONED_MINESHAFT),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.VILLAGE_WEAPONSMITH),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.STRONGHOLD_LIBRARY),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.IGLOO_CHEST),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.DESERT_PYRAMID),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.NETHER_BRIDGE),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.END_CITY_TREASURE),
|
|
||||||
LootTableIdCondition.builder(BuiltInLootTables.WOODLAND_MANSION)
|
|
||||||
).build()
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
package de.ellpeck.actuallyadditions.data;
|
package de.ellpeck.actuallyadditions.data;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.crafting.MiningLensRecipe;
|
import de.ellpeck.actuallyadditions.mod.crafting.MiningLensRecipe;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.NoAdvRecipeOutput;
|
import de.ellpeck.actuallyadditions.mod.util.NoAdvRecipeOutput;
|
||||||
import net.minecraft.data.PackOutput;
|
import net.minecraft.data.PackOutput;
|
||||||
|
@ -65,7 +64,5 @@ public class MiningLensGenerator extends RecipeProvider {
|
||||||
buildStoneOre(consumer, 200, Items.REDSTONE_ORE);
|
buildStoneOre(consumer, 200, Items.REDSTONE_ORE);
|
||||||
buildStoneOre(consumer, 30, Items.EMERALD_ORE);
|
buildStoneOre(consumer, 30, Items.EMERALD_ORE);
|
||||||
buildNetherOre(consumer, 3000, Items.NETHER_QUARTZ_ORE);
|
buildNetherOre(consumer, 3000, Items.NETHER_QUARTZ_ORE);
|
||||||
buildStoneOre(consumer, 3000, ActuallyBlocks.BLACK_QUARTZ_ORE.getItem());
|
|
||||||
buildNetherOre(consumer, 1, Items.ANCIENT_DEBRIS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.Worm;
|
import de.ellpeck.actuallyadditions.mod.items.Worm;
|
||||||
import de.ellpeck.actuallyadditions.mod.lootmodifier.ActuallyLootModifiers;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.misc.BannerHelper;
|
import de.ellpeck.actuallyadditions.mod.misc.BannerHelper;
|
||||||
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.LaserRelayConnectionHandler;
|
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.LaserRelayConnectionHandler;
|
||||||
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.MethodHandler;
|
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.MethodHandler;
|
||||||
|
@ -117,7 +116,6 @@ public class ActuallyAdditions {
|
||||||
ActuallyVillagers.init(eventBus);
|
ActuallyVillagers.init(eventBus);
|
||||||
ActuallyPOITypes.init(eventBus);
|
ActuallyPOITypes.init(eventBus);
|
||||||
ActuallyAttachments.init(eventBus);
|
ActuallyAttachments.init(eventBus);
|
||||||
ActuallyLootModifiers.init(eventBus);
|
|
||||||
ActuallyContainers.CONTAINERS.register(eventBus);
|
ActuallyContainers.CONTAINERS.register(eventBus);
|
||||||
ENTITIES.register(eventBus);
|
ENTITIES.register(eventBus);
|
||||||
CONDITION_CODECS.register(eventBus);
|
CONDITION_CODECS.register(eventBus);
|
||||||
|
|
|
@ -12,30 +12,20 @@ package de.ellpeck.actuallyadditions.mod.blocks;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterfaceHopping;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterfaceHopping;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Block;
|
|
||||||
import net.minecraft.world.level.block.Mirror;
|
|
||||||
import net.minecraft.world.level.block.Rotation;
|
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.StateDefinition;
|
|
||||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|
||||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class BlockItemInterfaceHopping extends BlockItemInterface {
|
public class BlockItemInterfaceHopping extends BlockItemInterface {
|
||||||
public static final DirectionProperty FACING = BlockStateProperties.FACING_HOPPER;
|
|
||||||
public BlockItemInterfaceHopping() {
|
public BlockItemInterfaceHopping() {
|
||||||
super();
|
super();
|
||||||
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.DOWN));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,26 +44,4 @@ public class BlockItemInterfaceHopping extends BlockItemInterface {
|
||||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> entityType) {
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> entityType) {
|
||||||
return level.isClientSide? TileEntityItemInterfaceHopping::clientTick : TileEntityItemInterfaceHopping::serverTick;
|
return level.isClientSide? TileEntityItemInterfaceHopping::clientTick : TileEntityItemInterfaceHopping::serverTick;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getStateForPlacement(BlockPlaceContext pContext) {
|
|
||||||
Direction direction = pContext.getClickedFace().getOpposite();
|
|
||||||
return this.defaultBlockState()
|
|
||||||
.setValue(FACING, direction.getAxis() == Direction.Axis.Y ? Direction.DOWN : direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState rotate(BlockState pState, Rotation pRotation) {
|
|
||||||
return pState.setValue(FACING, pRotation.rotate(pState.getValue(FACING)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState mirror(BlockState pState, Mirror pMirror) {
|
|
||||||
return pState.rotate(pMirror.getRotation(pState.getValue(FACING)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
|
|
||||||
pBuilder.add(FACING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,8 @@ import io.netty.util.internal.ConcurrentSet;
|
||||||
import net.minecraft.ChatFormatting;
|
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.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.InteractionResult;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
@ -208,20 +208,20 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
|
||||||
BlockPos pos = ((BlockHitResult) rayCast).getBlockPos();
|
BlockPos pos = ((BlockHitResult) rayCast).getBlockPos();
|
||||||
if (minecraft.level != null) {
|
if (minecraft.level != null) {
|
||||||
boolean wearing = ItemEngineerGoggles.isWearing(player);
|
boolean wearing = ItemEngineerGoggles.isWearing(player);
|
||||||
if (wearing || !stack.isEmpty()) {
|
if (wearing || StackUtil.isValid(stack)) {
|
||||||
boolean compass = stack.getItem() == CommonConfig.Other.relayConfigureItem;
|
boolean compass = stack.getItem() == CommonConfig.Other.relayConfigureItem;
|
||||||
if (wearing || compass || stack.getItem() instanceof ItemLaserWrench) {
|
if (wearing || compass || stack.getItem() instanceof ItemLaserWrench) {
|
||||||
BlockEntity tile = minecraft.level.getBlockEntity(pos);
|
BlockEntity tile = minecraft.level.getBlockEntity(pos);
|
||||||
if (tile instanceof TileEntityLaserRelay relay) {
|
if (tile instanceof TileEntityLaserRelay relay) {
|
||||||
|
|
||||||
Component strg = relay.getExtraDisplayString();
|
String strg = relay.getExtraDisplayString();
|
||||||
guiGraphics.drawString(minecraft.font, strg, (int) (resolution.getGuiScaledWidth() / 2f + 5), (int) (resolution.getGuiScaledHeight() / 2f + 5), 0xFFFFFF);
|
guiGraphics.drawString(minecraft.font, strg, (int) (resolution.getGuiScaledWidth() / 2f + 5), (int) (resolution.getGuiScaledHeight() / 2f + 5), 0xFFFFFF);
|
||||||
|
|
||||||
Component expl;
|
String expl;
|
||||||
if (compass) {
|
if (compass) {
|
||||||
expl = relay.getCompassDisplayString();
|
expl = relay.getCompassDisplayString();
|
||||||
} else {
|
} else {
|
||||||
expl = Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.mode.noCompasss", Component.translatable(CommonConfig.Other.relayConfigureItem.getDescriptionId()).getString()).withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC);
|
expl = ChatFormatting.GRAY.toString() + ChatFormatting.ITALIC + I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.mode.noCompasss", I18n.get(CommonConfig.Other.relayConfigureItem.getDescriptionId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
guiGraphics.drawString(minecraft.font, expl, (int) (resolution.getGuiScaledWidth() / 2f + 5), (int) (resolution.getGuiScaledHeight() / 2f + 15), 0xFFFFFF);
|
guiGraphics.drawString(minecraft.font, expl, (int) (resolution.getGuiScaledWidth() / 2f + 5), (int) (resolution.getGuiScaledHeight() / 2f + 15), 0xFFFFFF);
|
||||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
@ -153,7 +154,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
||||||
BlockEntity tile = minecraft.level.getBlockEntity(pos);
|
BlockEntity tile = minecraft.level.getBlockEntity(pos);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
if (tile instanceof IPhantomTile phantom) {
|
if (tile instanceof IPhantomTile phantom) {
|
||||||
guiGraphics.drawString(minecraft.font, Component.translatable("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc").append(": " + phantom.getRange()).withStyle(ChatFormatting.GOLD), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, ChatFormatting.WHITE.getColor());
|
guiGraphics.drawString(minecraft.font, ChatFormatting.GOLD + I18n.get("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, ChatFormatting.WHITE.getColor());
|
||||||
if (phantom.hasBoundPosition()) {
|
if (phantom.hasBoundPosition()) {
|
||||||
int distance = Mth.ceil(new Vec3(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vec3(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ())));
|
int distance = Mth.ceil(new Vec3(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vec3(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ())));
|
||||||
BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition());
|
BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition());
|
||||||
|
@ -170,7 +171,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
||||||
drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
|
drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
guiGraphics.drawString(minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.notConnected.desc").withStyle(ChatFormatting.RED), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, ChatFormatting.WHITE.getColor());
|
guiGraphics.drawString(minecraft.font, ChatFormatting.RED + I18n.get("tooltip.actuallyadditions.phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, ChatFormatting.WHITE.getColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
|
@ -58,7 +58,7 @@ public class RenderBatteryBox implements BlockEntityRenderer<TileEntityBatteryBo
|
||||||
Font font = Minecraft.getInstance().font;
|
Font font = Minecraft.getInstance().font;
|
||||||
|
|
||||||
String energyTotal = Lang.cleanEnergyValues(cap, false);
|
String energyTotal = Lang.cleanEnergyValues(cap, false);
|
||||||
Component energyName = Component.translatable("misc.actuallyadditions.power_name_long");
|
String energyName = I18n.get("misc.actuallyadditions.power_name_long");
|
||||||
float backgroundOpacity = Minecraft.getInstance().options.getBackgroundOpacity(0.25F);
|
float backgroundOpacity = Minecraft.getInstance().options.getBackgroundOpacity(0.25F);
|
||||||
int j = (int) (backgroundOpacity * 255.0F) << 24;
|
int j = (int) (backgroundOpacity * 255.0F) << 24;
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,6 @@ public class CommonConfig {
|
||||||
public static ModConfigSpec.BooleanValue DO_UPDATE_CHECK;
|
public static ModConfigSpec.BooleanValue DO_UPDATE_CHECK;
|
||||||
public static ModConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC;
|
public static ModConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC;
|
||||||
public static ModConfigSpec.BooleanValue DO_CAT_DROPS;
|
public static ModConfigSpec.BooleanValue DO_CAT_DROPS;
|
||||||
public static ModConfigSpec.BooleanValue DO_BAT_DROPS;
|
|
||||||
public static ModConfigSpec.IntValue FUR_CHANCE;
|
public static ModConfigSpec.IntValue FUR_CHANCE;
|
||||||
public static ModConfigSpec.BooleanValue WORMS;
|
public static ModConfigSpec.BooleanValue WORMS;
|
||||||
public static ModConfigSpec.IntValue WORMS_DIE_TIME;
|
public static ModConfigSpec.IntValue WORMS_DIE_TIME;
|
||||||
|
@ -122,9 +121,6 @@ public class CommonConfig {
|
||||||
DO_CAT_DROPS = BUILDER.comment("If true, Cats drop Hairy Balls Occasionally.")
|
DO_CAT_DROPS = BUILDER.comment("If true, Cats drop Hairy Balls Occasionally.")
|
||||||
.define("doCatDrops", true);
|
.define("doCatDrops", true);
|
||||||
|
|
||||||
DO_BAT_DROPS = BUILDER.comment("Should Bat wings drop from Bats?")
|
|
||||||
.define("doBatDrops", true);
|
|
||||||
|
|
||||||
FUR_CHANCE = BUILDER.comment("The 1/n drop chance, per tick, for a fur ball to be dropped.")
|
FUR_CHANCE = BUILDER.comment("The 1/n drop chance, per tick, for a fur ball to be dropped.")
|
||||||
.defineInRange("furDropChance", 5000, 1, Integer.MAX_VALUE);
|
.defineInRange("furDropChance", 5000, 1, Integer.MAX_VALUE);
|
||||||
|
|
||||||
|
|
|
@ -12,46 +12,35 @@ package de.ellpeck.actuallyadditions.mod.event;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay;
|
import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
||||||
import de.ellpeck.actuallyadditions.mod.data.WorldData;
|
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.items.DrillItem;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ItemDrillUpgrade;
|
|
||||||
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;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
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.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.HitResult;
|
import net.minecraft.world.phys.HitResult;
|
||||||
import net.minecraft.world.phys.Vec3;
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
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.RenderHighlightEvent;
|
|
||||||
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;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class ClientEvents {
|
public class ClientEvents {
|
||||||
|
|
||||||
|
@ -204,17 +193,16 @@ public class ClientEvents {
|
||||||
|
|
||||||
if (tileHit instanceof TileEntityBase base) {
|
if (tileHit instanceof TileEntityBase base) {
|
||||||
if (base.isRedstoneToggle()) {
|
if (base.isRedstoneToggle()) {
|
||||||
Component component = Component.translatable("info." + ActuallyAdditions.MODID + ".redstoneMode").append(": ")
|
String strg = String.format("%s: %s", I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode"), ChatFormatting.DARK_RED + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode." + (base.isPulseMode
|
||||||
.append(Component.translatable("info." + ActuallyAdditions.MODID + ".redstoneMode." + (base.isPulseMode
|
|
||||||
? "pulse"
|
? "pulse"
|
||||||
: "deactivation")).withStyle(ChatFormatting.DARK_RED));
|
: "deactivation")) + ChatFormatting.RESET);
|
||||||
guiGraphics.drawString(font, component, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 5), 0xFFFFFF);
|
guiGraphics.drawString(font, strg, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 5), 0xFFFFFF);
|
||||||
|
|
||||||
Component expl;
|
String expl;
|
||||||
if (!stack.isEmpty() && stack.getItem() == CommonConfig.Other.redstoneConfigureItem) {
|
if (!stack.isEmpty() && stack.getItem() == CommonConfig.Other.redstoneConfigureItem) {
|
||||||
expl = Component.translatable("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem").withStyle(ChatFormatting.GREEN);
|
expl = ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem");
|
||||||
} else {
|
} else {
|
||||||
expl = Component.translatable("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", Component.translatable(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId()).getString()).withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC);
|
expl = ChatFormatting.GRAY.toString() + ChatFormatting.ITALIC + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", I18n.get(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId()));
|
||||||
}
|
}
|
||||||
guiGraphics.drawString(font, expl, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 15), 0xFFFFFF);
|
guiGraphics.drawString(font, expl, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 15), 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
@ -239,46 +227,6 @@ public class ClientEvents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void renderBlockHighlight(RenderHighlightEvent.Block event) {
|
|
||||||
Minecraft mc = Minecraft.getInstance();
|
|
||||||
Player player = mc.player;
|
|
||||||
if (mc.player == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ItemStack stack = player.getMainHandItem();
|
|
||||||
if (stack.getItem() instanceof DrillItem drillItem) {
|
|
||||||
if (!player.isShiftKeyDown() && drillItem.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)) {
|
|
||||||
Level level = player.level();
|
|
||||||
Vec3 vec3 = event.getCamera().getPosition();
|
|
||||||
double d0 = vec3.x();
|
|
||||||
double d1 = vec3.y();
|
|
||||||
double d2 = vec3.z();
|
|
||||||
BlockHitResult blockHitResult = event.getTarget();
|
|
||||||
BlockPos targetPos = blockHitResult.getBlockPos();
|
|
||||||
BlockState blockState = level.getBlockState(targetPos);
|
|
||||||
VertexConsumer lineConsumer = event.getMultiBufferSource().getBuffer(RenderType.lines());
|
|
||||||
if (stack.isCorrectToolForDrops(blockState)) {
|
|
||||||
int radius = 0;
|
|
||||||
if (drillItem.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)) {
|
|
||||||
radius = 2;
|
|
||||||
} else if (drillItem.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)) {
|
|
||||||
radius = 1;
|
|
||||||
}
|
|
||||||
if (radius == 0) return; //No radius, no need to render extra hitboxes
|
|
||||||
|
|
||||||
List<BlockPos> coords = drillItem.gatherBreakingPositions(stack, radius, level, targetPos, blockHitResult.getDirection(), player);
|
|
||||||
for (BlockPos blockPos : coords) {
|
|
||||||
if (blockPos.equals(targetPos)) continue; //Let the original event draw this one!
|
|
||||||
AssetUtil.renderHitOutline(event.getPoseStack(), lineConsumer, player, d0, d1, d2, level, blockPos, level.getBlockState(blockPos));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* @SubscribeEvent //TODO someday move the laser rendering to a new system
|
/* @SubscribeEvent //TODO someday move the laser rendering to a new system
|
||||||
public void onRenderStage(final RenderLevelStageEvent event) {
|
public void onRenderStage(final RenderLevelStageEvent event) {
|
||||||
if(event.getStage() == RenderLevelStageEvent.Stage.AFTER_SOLID_BLOCKS) {
|
if(event.getStage() == RenderLevelStageEvent.Stage.AFTER_SOLID_BLOCKS) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerBioReactor;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
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.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
|
|
|
@ -11,9 +11,11 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
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.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
|
@ -36,7 +38,7 @@ public class GuiDrill extends AAScreen<ContainerDrill> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
||||||
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, this.title.getString());
|
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, I18n.get("container." + ActuallyAdditions.MODID + ".drill"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
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.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
|
|
|
@ -11,9 +11,11 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
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.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
|
@ -35,7 +37,7 @@ public class GuiFilter extends AAScreen<ContainerFilter> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
||||||
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, this.title.getString());
|
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, I18n.get("container." + ActuallyAdditions.MODID + ".filter"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,34 +13,23 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
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.GuiGraphics;
|
||||||
import net.minecraft.client.gui.components.Button;
|
import net.minecraft.client.gui.components.Button;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.client.resources.language.I18n;
|
||||||
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.util.FormattedCharSequence;
|
|
||||||
import net.minecraft.world.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
import net.neoforged.neoforge.network.PacketDistributor;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItemWhitelist> {
|
public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItemWhitelist> {
|
||||||
|
|
||||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_laser_relay_item_whitelist");
|
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_laser_relay_item_whitelist");
|
||||||
private final Component inboundText = Component.translatable("info." + ActuallyAdditions.MODID + ".gui.inbound");
|
|
||||||
private final Component outboundText = Component.translatable("info." + ActuallyAdditions.MODID + ".gui.outbound");
|
|
||||||
private final TileEntityLaserRelayItemAdvanced tile;
|
private final TileEntityLaserRelayItemAdvanced tile;
|
||||||
|
|
||||||
private FilterSettingsGui leftFilter;
|
private FilterSettingsGui leftFilter;
|
||||||
|
@ -68,53 +57,43 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
this.leftFilter = new FilterSettingsGui(this.tile.leftFilter, this.leftPos + 3, this.topPos + 6, this::addRenderableWidget, this::buttonClicked, 0);
|
// this.leftFilter = new FilterSettingsGui(this.tile.leftFilter, this.leftPos + 3, this.topPos + 6, this.buttonList);
|
||||||
this.rightFilter = new FilterSettingsGui(this.tile.rightFilter, this.leftPos + 157, this.topPos + 6, this::addRenderableWidget, this::buttonClicked, 4);
|
// this.rightFilter = new FilterSettingsGui(this.tile.rightFilter, this.leftPos + 157, this.topPos + 6, this.buttonList);
|
||||||
|
//
|
||||||
this.buttonSmartWhitelistLeft = this.addRenderableWidget(Button.builder(
|
// this.buttonSmartWhitelistLeft = new Buttons.SmallerButton(2, this.leftPos + 3, this.topPos + 79, "S");
|
||||||
Component.literal("S"),
|
// this.buttonSmartWhitelistRight = new Buttons.SmallerButton(3, this.leftPos + 157, this.topPos + 79, "S");
|
||||||
(button) -> {
|
// this.addButton(this.buttonSmartWhitelistLeft);
|
||||||
PacketHandlerHelper.sendButtonPacket(this.tile, 2);
|
// this.addButton(this.buttonSmartWhitelistRight);
|
||||||
}).bounds(this.leftPos + 3, this.topPos + 79, 16, 16)
|
|
||||||
.build());
|
|
||||||
|
|
||||||
this.buttonSmartWhitelistRight = this.addRenderableWidget(Button.builder(
|
|
||||||
Component.literal("S"),
|
|
||||||
(button) -> {
|
|
||||||
PacketHandlerHelper.sendButtonPacket(this.tile, 3);
|
|
||||||
}).bounds(this.leftPos + 157, this.topPos + 79, 16, 16)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
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 actionPerformed(Button button) {
|
||||||
|
// PacketHandlerHelper.sendButtonPacket(this.tile, button.id);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(@Nonnull GuiGraphics guiGraphics, int x, int y, float f) {
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.render(guiGraphics, x, y, f);
|
||||||
|
//
|
||||||
|
// if (this.buttonSmartWhitelistLeft.isMouseOver() || this.buttonSmartWhitelistRight.isMouseOver()) {
|
||||||
|
// List<String> list = new ArrayList<>();
|
||||||
|
// list.add(TextFormatting.BOLD + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.smart"));
|
||||||
|
// list.addAll(this.font.listFormattedStringToWidth(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.smartInfo"), 200));
|
||||||
|
// this.drawHoveringText(list, x, y); //renderComponentTooltip
|
||||||
|
// }
|
||||||
|
|
||||||
if (this.buttonSmartWhitelistLeft.isMouseOver(mouseX, mouseY) || this.buttonSmartWhitelistRight.isMouseOver(mouseX, mouseY)) {
|
this.leftFilter.drawHover(guiGraphics, x, y);
|
||||||
List<FormattedCharSequence> list = new ArrayList<>();
|
this.rightFilter.drawHover(guiGraphics, x, y);
|
||||||
list.add(Component.translatable("info." + ActuallyAdditions.MODID + ".gui.smart").withStyle(ChatFormatting.BOLD).getVisualOrderText());
|
|
||||||
list.addAll(this.font.split(Component.translatable("info." + ActuallyAdditions.MODID + ".gui.smartInfo"), 200));
|
|
||||||
guiGraphics.renderTooltip(this.font, list, mouseX, mouseY); //renderTooltip
|
|
||||||
}
|
|
||||||
|
|
||||||
this.leftFilter.drawHover(guiGraphics, mouseX, mouseY);
|
|
||||||
this.rightFilter.drawHover(guiGraphics, mouseX, mouseY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
||||||
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, this.title.getString());
|
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, this.tile);
|
||||||
|
|
||||||
guiGraphics.drawString(font, inboundText, 46 - this.font.width(inboundText) / 2, 80, 0x404040, false);
|
String s1 = I18n.get("info." + ActuallyAdditions.MODID + ".gui.inbound");
|
||||||
guiGraphics.drawString(font, outboundText, 131 - this.font.width(outboundText) / 2, 80, 0x404040, false);
|
String s2 = I18n.get("info." + ActuallyAdditions.MODID + ".gui.outbound");
|
||||||
|
guiGraphics.drawString(font, s1, 46 - this.font.width(s1) / 2, 80, 0x404040, false);
|
||||||
|
guiGraphics.drawString(font, s2, 131 - this.font.width(s2) / 2, 80, 0x404040, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -124,5 +103,6 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
|
||||||
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86);
|
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86);
|
||||||
|
|
||||||
guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 93);
|
guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 93);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerOilGenerator;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
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.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
|
@ -69,7 +70,7 @@ public class GuiOilGenerator extends AAScreen<ContainerOilGenerator> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.generator.maxBurnTime > 0 && this.generator.currentEnergyProduce > 0) {
|
if (this.generator.maxBurnTime > 0 && this.generator.currentEnergyProduce > 0) {
|
||||||
guiGraphics.drawCenteredString(this.font, Component.literal(this.generator.currentEnergyProduce + " ").append(Component.translatable("misc.actuallyadditions.energy_tick")), this.leftPos + 87, this.topPos + 65, 0xFFFFFF);
|
guiGraphics.drawCenteredString(this.font, this.generator.currentEnergyProduce + " " + I18n.get("misc.actuallyadditions.energy_tick"), this.leftPos + 87, this.topPos + 65, 0xFFFFFF);
|
||||||
guiGraphics.drawCenteredString(this.font, "for " + this.generator.maxBurnTime + " t", this.leftPos + 87, this.topPos + 75, 0xFFFFFF);
|
guiGraphics.drawCenteredString(this.font, "for " + this.generator.maxBurnTime + " t", this.leftPos + 87, this.topPos + 75, 0xFFFFFF);
|
||||||
PoseStack poseStack = guiGraphics.pose();
|
PoseStack poseStack = guiGraphics.pose();
|
||||||
poseStack.pushPose();
|
poseStack.pushPose();
|
||||||
|
|
|
@ -54,7 +54,6 @@ import net.neoforged.neoforge.items.IItemHandler;
|
||||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class DrillItem extends ItemEnergy {
|
public class DrillItem extends ItemEnergy {
|
||||||
|
@ -175,7 +174,7 @@ public class DrillItem extends ItemEnergy {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResultHolder<ItemStack> use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) {
|
public InteractionResultHolder<ItemStack> use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) {
|
||||||
if (!world.isClientSide && player.isShiftKeyDown() && hand == InteractionHand.MAIN_HAND) {
|
if (!world.isClientSide && player.isShiftKeyDown() && hand == InteractionHand.MAIN_HAND) {
|
||||||
player.openMenu(new SimpleMenuProvider((id, inv, p) -> new ContainerDrill(id, inv), Component.translatable("container." + ActuallyAdditions.MODID + ".drill")));
|
player.openMenu(new SimpleMenuProvider((id, inv, p) -> new ContainerDrill(id, inv), Component.literal("")));
|
||||||
// player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ);
|
// player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||||
}
|
}
|
||||||
return new InteractionResultHolder<>(InteractionResult.PASS, player.getItemInHand(hand));
|
return new InteractionResultHolder<>(InteractionResult.PASS, player.getItemInHand(hand));
|
||||||
|
@ -458,77 +457,6 @@ public class DrillItem extends ItemEnergy {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a list of block positions that can be broken taking radius, poker and side into account
|
|
||||||
* @param stack The Drill
|
|
||||||
* @param radius The Radius to break Blocks in (0 means only 1 Block will be broken!)
|
|
||||||
* @param world The World
|
|
||||||
* @param aPos The position of the block being broken
|
|
||||||
* @param side The side of the block being broken
|
|
||||||
* @param player The Player who breaks the Blocks
|
|
||||||
* @return A list of block positions that can be broken
|
|
||||||
*/
|
|
||||||
public List<BlockPos> gatherBreakingPositions(ItemStack stack, int radius, Level world, BlockPos aPos, Direction side, Player player) {
|
|
||||||
int energyStored = this.getEnergyStored(stack);
|
|
||||||
List<BlockPos> positions = new ArrayList<>();
|
|
||||||
|
|
||||||
int xRange = radius;
|
|
||||||
int yRange = radius;
|
|
||||||
int zRange = 0;
|
|
||||||
|
|
||||||
//Corrects Blocks to hit depending on Side of original Block hit
|
|
||||||
if (side.getAxis() == Direction.Axis.Y) {
|
|
||||||
zRange = radius;
|
|
||||||
yRange = 0;
|
|
||||||
}
|
|
||||||
if (side.getAxis() == Direction.Axis.X) {
|
|
||||||
xRange = 0;
|
|
||||||
zRange = radius;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Not defined later because main Block is getting broken below
|
|
||||||
BlockState state = world.getBlockState(aPos);
|
|
||||||
float mainHardness = state.getDestroySpeed(world, aPos);
|
|
||||||
|
|
||||||
//Break Middle Block first
|
|
||||||
int use = this.getEnergyUsePerBlock(stack);
|
|
||||||
if (energyStored < use) {
|
|
||||||
return positions;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (radius == 2 && side.getAxis() != Direction.Axis.Y) {
|
|
||||||
aPos = aPos.above();
|
|
||||||
BlockState theState = world.getBlockState(aPos);
|
|
||||||
if (theState.getDestroySpeed(world, aPos) <= mainHardness + 5.0F) {
|
|
||||||
positions.add(aPos.immutable());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Break Blocks around
|
|
||||||
if (radius > 0 && mainHardness >= 0.2F) {
|
|
||||||
for (int xPos = aPos.getX() - xRange; xPos <= aPos.getX() + xRange; xPos++) {
|
|
||||||
for (int yPos = aPos.getY() - yRange; yPos <= aPos.getY() + yRange; yPos++) {
|
|
||||||
for (int zPos = aPos.getZ() - zRange; zPos <= aPos.getZ() + zRange; zPos++) {
|
|
||||||
if (!(aPos.getX() == xPos && aPos.getY() == yPos && aPos.getZ() == zPos)) {
|
|
||||||
if (energyStored >= use) {
|
|
||||||
//Only break Blocks around that are (about) as hard or softer
|
|
||||||
BlockPos thePos = new BlockPos(xPos, yPos, zPos);
|
|
||||||
BlockState theState = world.getBlockState(thePos);
|
|
||||||
if (theState.getDestroySpeed(world, thePos) <= mainHardness + 5.0F) {
|
|
||||||
energyStored -= use;
|
|
||||||
positions.add(thePos.immutable());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return positions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return positions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to harvest a certain Block
|
* Tries to harvest a certain Block
|
||||||
* Breaks the Block, drops Particles etc.
|
* Breaks the Block, drops Particles etc.
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.items;
|
package de.ellpeck.actuallyadditions.mod.items;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||||
|
@ -38,7 +37,7 @@ public class ItemFilter extends ItemBase {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {
|
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {
|
||||||
if (!world.isClientSide && hand == InteractionHand.MAIN_HAND) {
|
if (!world.isClientSide && hand == InteractionHand.MAIN_HAND) {
|
||||||
player.openMenu(new SimpleMenuProvider((windowId, inv, playerEnt) -> new ContainerFilter(windowId, inv), Component.translatable("container." + ActuallyAdditions.MODID + ".filter")));
|
player.openMenu(new SimpleMenuProvider((windowId, inv, playerEnt) -> new ContainerFilter(windowId, inv), Component.empty()));
|
||||||
// player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ);
|
// player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||||
}
|
}
|
||||||
return InteractionResultHolder.pass(player.getItemInHand(hand));
|
return InteractionResultHolder.pass(player.getItemInHand(hand));
|
||||||
|
|
|
@ -22,7 +22,6 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherCategory;
|
||||||
import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory;
|
import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory;
|
||||||
import de.ellpeck.actuallyadditions.mod.jei.fermenting.FermentingCategory;
|
import de.ellpeck.actuallyadditions.mod.jei.fermenting.FermentingCategory;
|
||||||
import de.ellpeck.actuallyadditions.mod.jei.laser.LaserRecipeCategory;
|
import de.ellpeck.actuallyadditions.mod.jei.laser.LaserRecipeCategory;
|
||||||
import de.ellpeck.actuallyadditions.mod.jei.lens.MiningLensRecipeCategory;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.jei.pressing.PressingCategory;
|
import de.ellpeck.actuallyadditions.mod.jei.pressing.PressingCategory;
|
||||||
import mezz.jei.api.IModPlugin;
|
import mezz.jei.api.IModPlugin;
|
||||||
import mezz.jei.api.JeiPlugin;
|
import mezz.jei.api.JeiPlugin;
|
||||||
|
@ -53,7 +52,6 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
||||||
public static final RecipeType<EmpowererRecipe> EMPOWERER = RecipeType.create(ActuallyAdditions.MODID, "empowerer", EmpowererRecipe.class);
|
public static final RecipeType<EmpowererRecipe> EMPOWERER = RecipeType.create(ActuallyAdditions.MODID, "empowerer", EmpowererRecipe.class);
|
||||||
public static final RecipeType<CoffeeIngredientRecipe> COFFEE_MACHINE = RecipeType.create(ActuallyAdditions.MODID, "coffee_machine", CoffeeIngredientRecipe.class);
|
public static final RecipeType<CoffeeIngredientRecipe> COFFEE_MACHINE = RecipeType.create(ActuallyAdditions.MODID, "coffee_machine", CoffeeIngredientRecipe.class);
|
||||||
public static final RecipeType<CrushingRecipe> CRUSHING = RecipeType.create(ActuallyAdditions.MODID, "crushing", CrushingRecipe.class);
|
public static final RecipeType<CrushingRecipe> CRUSHING = RecipeType.create(ActuallyAdditions.MODID, "crushing", CrushingRecipe.class);
|
||||||
public static final RecipeType<MiningLensRecipe> MINING_LENS = RecipeType.create(ActuallyAdditions.MODID, "mining_lens", MiningLensRecipe.class);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerCategories(IRecipeCategoryRegistration registry) {
|
public void registerCategories(IRecipeCategoryRegistration registry) {
|
||||||
|
@ -65,7 +63,6 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
||||||
registry.addRecipeCategories(new CoffeeMachineCategory(helpers.getGuiHelper()));
|
registry.addRecipeCategories(new CoffeeMachineCategory(helpers.getGuiHelper()));
|
||||||
registry.addRecipeCategories(new PressingCategory(helpers.getGuiHelper()));
|
registry.addRecipeCategories(new PressingCategory(helpers.getGuiHelper()));
|
||||||
registry.addRecipeCategories(new CrusherCategory(helpers.getGuiHelper()));
|
registry.addRecipeCategories(new CrusherCategory(helpers.getGuiHelper()));
|
||||||
registry.addRecipeCategories(new MiningLensRecipeCategory(helpers.getGuiHelper()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,7 +76,6 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
||||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CANOLA_PRESS.getItem()), PRESSING);
|
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CANOLA_PRESS.getItem()), PRESSING);
|
||||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CRUSHER.getItem()), CRUSHING);
|
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CRUSHER.getItem()), CRUSHING);
|
||||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CRUSHER_DOUBLE.getItem()), CRUSHING);
|
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CRUSHER_DOUBLE.getItem()), CRUSHING);
|
||||||
registry.addRecipeCatalyst(new ItemStack(ActuallyItems.LENS_OF_THE_MINER.get()), MINING_LENS);
|
|
||||||
|
|
||||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyItems.itemBooklet.get()), BookletRecipeCategory.NAME);
|
// registry.addRecipeCatalyst(new ItemStack(ActuallyItems.itemBooklet.get()), BookletRecipeCategory.NAME);
|
||||||
// registry.addRecipeCatalyst(new ItemStack(InitBlocks.blockCompost.get()), CompostRecipeCategory.NAME);
|
// registry.addRecipeCatalyst(new ItemStack(InitBlocks.blockCompost.get()), CompostRecipeCategory.NAME);
|
||||||
|
@ -95,7 +91,6 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
||||||
registry.addRecipes(COFFEE_MACHINE, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.COFFEE_INGREDIENT.get()).stream().map(RecipeHolder::value).toList());
|
registry.addRecipes(COFFEE_MACHINE, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.COFFEE_INGREDIENT.get()).stream().map(RecipeHolder::value).toList());
|
||||||
registry.addRecipes(PRESSING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.PRESSING.get()).stream().map(RecipeHolder::value).toList());
|
registry.addRecipes(PRESSING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.PRESSING.get()).stream().map(RecipeHolder::value).toList());
|
||||||
registry.addRecipes(CRUSHING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.CRUSHING.get()).stream().map(RecipeHolder::value).toList());
|
registry.addRecipes(CRUSHING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.CRUSHING.get()).stream().map(RecipeHolder::value).toList());
|
||||||
registry.addRecipes(MINING_LENS, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.MINING_LENS.get()).stream().map(RecipeHolder::value).toList());
|
|
||||||
//registry.addRecipes(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, BookletRecipeCategory.NAME);
|
//registry.addRecipes(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, BookletRecipeCategory.NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import mezz.jei.api.recipe.RecipeType;
|
||||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||||
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.resources.language.I18n;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
@ -68,7 +69,7 @@ public class CoffeeMachineCategory implements IRecipeCategory<CoffeeIngredientRe
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
if (!Strings.isNullOrEmpty(recipe.getExtraText())) {
|
if (!Strings.isNullOrEmpty(recipe.getExtraText())) {
|
||||||
guiGraphics.drawString(mc.font, Component.translatable("jei." + ActuallyAdditions.MODID + ".coffee.special").append( ":"), 2, 4, 4210752, false);
|
guiGraphics.drawString(mc.font, Component.translatable("jei." + ActuallyAdditions.MODID + ".coffee.special").append( ":"), 2, 4, 4210752, false);
|
||||||
guiGraphics.drawString(mc.font, Component.literal(recipe.getExtraText()), 2, 16, 4210752, false);
|
guiGraphics.drawString(mc.font, I18n.get(recipe.getExtraText()), 2, 16, 4210752, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipe.getMaxAmplifier() > 0) {
|
if (recipe.getMaxAmplifier() > 0) {
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
/*
|
|
||||||
* This file ("ReconstructorRecipeCategory.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.jei.lens;
|
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.crafting.MiningLensRecipe;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.jei.JEIActuallyAdditionsPlugin;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
|
||||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
|
||||||
import mezz.jei.api.gui.drawable.IDrawable;
|
|
||||||
import mezz.jei.api.gui.drawable.IDrawableStatic;
|
|
||||||
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
|
||||||
import mezz.jei.api.helpers.IGuiHelper;
|
|
||||||
import mezz.jei.api.recipe.IFocusGroup;
|
|
||||||
import mezz.jei.api.recipe.RecipeIngredientRole;
|
|
||||||
import mezz.jei.api.recipe.RecipeType;
|
|
||||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
|
||||||
import net.minecraft.core.RegistryAccess;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
|
|
||||||
public class MiningLensRecipeCategory implements IRecipeCategory<MiningLensRecipe> {
|
|
||||||
private final IDrawableStatic background;
|
|
||||||
private final ItemStack RECONSTRUCTOR = new ItemStack(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getItem());
|
|
||||||
|
|
||||||
public MiningLensRecipeCategory(IGuiHelper helper) {
|
|
||||||
this.background = helper.drawableBuilder(AssetUtil.getGuiLocation("gui_nei_atomic_reconstructor"), 0, 0, 96, 60).setTextureSize(256,256).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RecipeType<MiningLensRecipe> getRecipeType() {
|
|
||||||
return JEIActuallyAdditionsPlugin.MINING_LENS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Component getTitle() {
|
|
||||||
return Component.translatable("jei.actuallyadditions.mining_lens");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IDrawable getBackground() {
|
|
||||||
return this.background;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IDrawable getIcon() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setRecipe(IRecipeLayoutBuilder builder, MiningLensRecipe recipe, IFocusGroup focuses) {
|
|
||||||
Minecraft minecraft = Minecraft.getInstance();
|
|
||||||
ClientLevel level = minecraft.level;
|
|
||||||
if (level == null) {
|
|
||||||
throw new NullPointerException("level must not be null.");
|
|
||||||
}
|
|
||||||
RegistryAccess registryAccess = level.registryAccess();
|
|
||||||
|
|
||||||
builder.addSlot(RecipeIngredientRole.INPUT, 5, 19).addIngredients(recipe.getInput());
|
|
||||||
builder.addSlot(RecipeIngredientRole.INPUT, 27, 20).addItemStack(RECONSTRUCTOR);
|
|
||||||
builder.addSlot(RecipeIngredientRole.INPUT, 43, 20).addItemStack(new ItemStack(ActuallyItems.LENS_OF_THE_MINER.get()));
|
|
||||||
|
|
||||||
builder.addSlot(RecipeIngredientRole.OUTPUT, 66, 19).addItemStack(recipe.getResultItem(registryAccess));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(MiningLensRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) {
|
|
||||||
Minecraft mc = Minecraft.getInstance();
|
|
||||||
|
|
||||||
Component component = Component.translatable("jei.actuallyadditions.mining_lens.weight");
|
|
||||||
guiGraphics.drawString(mc.font, component, 2, 42, 0, false);
|
|
||||||
|
|
||||||
String weight = String.valueOf(recipe.getWeight());
|
|
||||||
guiGraphics.drawString(mc.font, weight, 16 - mc.font.width(weight) / 2, 52, 0, false);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.lootmodifier;
|
|
||||||
|
|
||||||
import com.mojang.serialization.Codec;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import net.neoforged.bus.api.IEventBus;
|
|
||||||
import net.neoforged.neoforge.common.loot.IGlobalLootModifier;
|
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
|
||||||
import net.neoforged.neoforge.registries.NeoForgeRegistries;
|
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
public class ActuallyLootModifiers {
|
|
||||||
private static final DeferredRegister<Codec<? extends IGlobalLootModifier>> GLM = DeferredRegister.create(NeoForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, ActuallyAdditions.MODID);
|
|
||||||
|
|
||||||
public static final Supplier<Codec<? extends IGlobalLootModifier>> BAT_LOOT = GLM.register("bat_loot", BatLootModifier.CODEC);
|
|
||||||
public static final Supplier<Codec<? extends IGlobalLootModifier>> DUNGEON_LOOT = GLM.register("dungeon_loot", DungeonLootModifier.CODEC);
|
|
||||||
|
|
||||||
public static void init(IEventBus evt) {
|
|
||||||
GLM.register(evt);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.lootmodifier;
|
|
||||||
|
|
||||||
import com.google.common.base.Supplier;
|
|
||||||
import com.google.common.base.Suppliers;
|
|
||||||
import com.mojang.serialization.Codec;
|
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
|
||||||
import net.minecraft.util.RandomSource;
|
|
||||||
import net.minecraft.world.entity.ambient.Bat;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
import net.minecraft.world.level.storage.loot.LootContext;
|
|
||||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|
||||||
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
|
|
||||||
import net.neoforged.neoforge.common.loot.IGlobalLootModifier;
|
|
||||||
import net.neoforged.neoforge.common.loot.LootModifier;
|
|
||||||
|
|
||||||
public class BatLootModifier extends LootModifier {
|
|
||||||
public static final Supplier<Codec<BatLootModifier>> CODEC = Suppliers.memoize(() ->
|
|
||||||
RecordCodecBuilder.create(inst -> codecStart(inst).apply(inst, BatLootModifier::new)));
|
|
||||||
|
|
||||||
public BatLootModifier(LootItemCondition[] conditionsIn) {
|
|
||||||
super(conditionsIn);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ObjectArrayList<ItemStack> doApply(ObjectArrayList<ItemStack> generatedLoot, LootContext context) {
|
|
||||||
RandomSource random = context.getRandom();
|
|
||||||
if (CommonConfig.Other.DO_BAT_DROPS.get() &&
|
|
||||||
context.hasParam(LootContextParams.KILLER_ENTITY) &&
|
|
||||||
context.hasParam(LootContextParams.DAMAGE_SOURCE) &&
|
|
||||||
context.hasParam(LootContextParams.THIS_ENTITY) &&
|
|
||||||
context.getParam(LootContextParams.THIS_ENTITY) instanceof Bat) {
|
|
||||||
int looting = context.getLootingModifier();
|
|
||||||
if (random.nextInt(15) <= looting * 2) {
|
|
||||||
generatedLoot.add(new ItemStack(ActuallyItems.BATS_WING.get(), random.nextInt(2 + looting) + 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return generatedLoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Codec<? extends IGlobalLootModifier> codec() {
|
|
||||||
return CODEC.get();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,141 +0,0 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.lootmodifier;
|
|
||||||
|
|
||||||
import com.google.common.base.Supplier;
|
|
||||||
import com.google.common.base.Suppliers;
|
|
||||||
import com.mojang.serialization.Codec;
|
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
|
||||||
import de.ellpeck.actuallyadditions.api.ActuallyTags;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
|
||||||
import net.minecraft.core.Holder;
|
|
||||||
import net.minecraft.core.HolderSet;
|
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.tags.TagKey;
|
|
||||||
import net.minecraft.util.RandomSource;
|
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
import net.minecraft.world.item.Items;
|
|
||||||
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
|
|
||||||
import net.minecraft.world.level.storage.loot.LootContext;
|
|
||||||
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
|
|
||||||
import net.neoforged.neoforge.common.loot.IGlobalLootModifier;
|
|
||||||
import net.neoforged.neoforge.common.loot.LootModifier;
|
|
||||||
|
|
||||||
public class DungeonLootModifier extends LootModifier {
|
|
||||||
public static final Supplier<Codec<DungeonLootModifier>> CODEC = Suppliers.memoize(() ->
|
|
||||||
RecordCodecBuilder.create(inst -> codecStart(inst).apply(inst, DungeonLootModifier::new)));
|
|
||||||
|
|
||||||
public DungeonLootModifier(LootItemCondition[] conditionsIn) {
|
|
||||||
super(conditionsIn);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ObjectArrayList<ItemStack> doApply(ObjectArrayList<ItemStack> generatedLoot, LootContext context) {
|
|
||||||
RandomSource random = context.getRandom();
|
|
||||||
if (CommonConfig.Other.DUNGEON_LOOT.get()) {
|
|
||||||
ResourceLocation lootTable = context.getQueriedLootTableId();
|
|
||||||
boolean addCrystals = false;
|
|
||||||
boolean addDrillCore = false;
|
|
||||||
boolean addQuartz = false;
|
|
||||||
boolean addBatWings = false;
|
|
||||||
if (BuiltInLootTables.SIMPLE_DUNGEON.equals(lootTable)) {
|
|
||||||
addCrystals = true;
|
|
||||||
addDrillCore = true;
|
|
||||||
addQuartz = true;
|
|
||||||
} else if (BuiltInLootTables.ABANDONED_MINESHAFT.equals(lootTable)) {
|
|
||||||
addCrystals = true;
|
|
||||||
addDrillCore = true;
|
|
||||||
} else if (BuiltInLootTables.VILLAGE_WEAPONSMITH.equals(lootTable)) {
|
|
||||||
addDrillCore = true;
|
|
||||||
addQuartz = true;
|
|
||||||
} else if (BuiltInLootTables.STRONGHOLD_LIBRARY.equals(lootTable)) {
|
|
||||||
addBatWings = true;
|
|
||||||
} else if (BuiltInLootTables.IGLOO_CHEST.equals(lootTable)) {
|
|
||||||
addBatWings = true;
|
|
||||||
} else if (BuiltInLootTables.DESERT_PYRAMID.equals(lootTable)) {
|
|
||||||
addDrillCore = true;
|
|
||||||
addBatWings = true;
|
|
||||||
} else if (BuiltInLootTables.NETHER_BRIDGE.equals(lootTable)) {
|
|
||||||
addBatWings = true;
|
|
||||||
addCrystals = true;
|
|
||||||
addDrillCore = true;
|
|
||||||
} else if (BuiltInLootTables.END_CITY_TREASURE.equals(lootTable)) {
|
|
||||||
addBatWings = true;
|
|
||||||
addCrystals = true;
|
|
||||||
addDrillCore = true;
|
|
||||||
addQuartz = true;
|
|
||||||
} else if (BuiltInLootTables.WOODLAND_MANSION.equals(lootTable)) {
|
|
||||||
addBatWings = true;
|
|
||||||
addCrystals = true;
|
|
||||||
addDrillCore = true;
|
|
||||||
addQuartz = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addCrystals) {
|
|
||||||
// LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(0, TheCrystals.values().length - 1));
|
|
||||||
// LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 3));
|
|
||||||
// LootFunction[] functions = new LootFunction[] { damage, amount };
|
|
||||||
// pool.addEntry(new LootEntryItem(InitItems.itemCrystal, 20, 0, functions, noCondition, ActuallyAdditions.MODID + ":crystalItems"));
|
|
||||||
// pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockCrystal), 3, 0, functions, noCondition, ActuallyAdditions.MODID + ":crystalBlocks"));
|
|
||||||
if (random.nextInt(5) == 0) {
|
|
||||||
int count = random.nextInt(3) + 1;
|
|
||||||
Item crystal = getRandomItem(random, ActuallyTags.Items.CRYSTALS, ActuallyItems.RESTONIA_CRYSTAL.get());
|
|
||||||
generatedLoot.add(new ItemStack(crystal, count));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (random.nextInt(15) == 0) {
|
|
||||||
int count = random.nextInt(3) + 1;
|
|
||||||
Item crystal = getRandomItem(random, ActuallyTags.Items.CRYSTAL_BLOCKS, ActuallyBlocks.RESTONIA_CRYSTAL.getItem());
|
|
||||||
generatedLoot.add(new ItemStack(crystal, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (addDrillCore) {
|
|
||||||
System.out.println("Deciding to add drill core or not");
|
|
||||||
if (random.nextInt(10) == 0) {
|
|
||||||
generatedLoot.add(new ItemStack(ActuallyItems.DRILL_CORE.get()));
|
|
||||||
}
|
|
||||||
// LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.DRILL_CORE.ordinal()));
|
|
||||||
// pool.addEntry(new LootEntryItem(InitItems.itemMisc, 5, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":drillCore"));
|
|
||||||
}
|
|
||||||
if (addQuartz) {
|
|
||||||
if (random.nextInt(5) == 0) {
|
|
||||||
int count = random.nextInt(5) + 1;
|
|
||||||
generatedLoot.add(new ItemStack(ActuallyItems.BLACK_QUARTZ.get(), count));
|
|
||||||
}
|
|
||||||
// LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.QUARTZ.ordinal()));
|
|
||||||
// LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 5));
|
|
||||||
// pool.addEntry(new LootEntryItem(InitItems.itemMisc, 20, 0, new LootFunction[] { damage, amount }, noCondition, ActuallyAdditions.MODID + ":quartz"));
|
|
||||||
}
|
|
||||||
if (addBatWings) {
|
|
||||||
if (random.nextInt(10) == 0) {
|
|
||||||
int count = random.nextInt(2) + 1;
|
|
||||||
generatedLoot.add(new ItemStack(ActuallyItems.BATS_WING.get(), count));
|
|
||||||
}
|
|
||||||
// LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.BAT_WING.ordinal()));
|
|
||||||
// LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 2));
|
|
||||||
// pool.addEntry(new LootEntryItem(InitItems.itemMisc, 5, 0, new LootFunction[] { damage, amount }, noCondition, ActuallyAdditions.MODID + ":batWings"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return generatedLoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Item getRandomItem(RandomSource random, TagKey<Item> tagKey, Item defaultItem) {
|
|
||||||
HolderSet.Named<Item> holderSet = BuiltInRegistries.ITEM.getTag(tagKey).orElse(null);
|
|
||||||
if (holderSet != null) {
|
|
||||||
Holder<Item> itemHolder = holderSet.getRandomElement(random).orElse(null);
|
|
||||||
if (itemHolder != null) {
|
|
||||||
return itemHolder.value();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return defaultItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Codec<? extends IGlobalLootModifier> codec() {
|
|
||||||
return CODEC.get();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.misc;
|
package de.ellpeck.actuallyadditions.mod.misc;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
|
|
@ -75,8 +75,7 @@ public abstract class TileEntityBase extends BlockEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) {
|
public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) {
|
||||||
if (pkt.getTag() != null) //TODO: pkt.getTag() is nullable. Hopping Item Interface will throw in the log when placed because of this
|
this.readSyncableNBT(pkt.getTag(), NBTType.SYNC);
|
||||||
this.readSyncableNBT(pkt.getTag(), NBTType.SYNC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -198,15 +198,16 @@ public class TileEntityItemInterface extends TileEntityBase {
|
||||||
|
|
||||||
int slotsQueried = 0;
|
int slotsQueried = 0;
|
||||||
for (GenericItemHandlerInfo info : this.genericInfos) {
|
for (GenericItemHandlerInfo info : this.genericInfos) {
|
||||||
if (!info.isLoaded()) continue;
|
|
||||||
for (SlotlessableItemHandlerWrapper handler : info.handlers) {
|
for (SlotlessableItemHandlerWrapper handler : info.handlers) {
|
||||||
IItemHandler normalHandler = handler.getNormalHandler();
|
Optional<IItemHandler> normalHandler = Optional.ofNullable(handler.getNormalHandler());
|
||||||
if (normalHandler != null) {
|
slotsQueried += normalHandler.map(cap -> {
|
||||||
for (int i = 0; i < normalHandler.getSlots(); i++) {
|
int queried = 0;
|
||||||
this.itemHandlerInfos.put(slotsQueried, new IItemHandlerInfo(normalHandler, i, info.relayInQuestion));
|
for (int i = 0; i < cap.getSlots(); i++) {
|
||||||
slotsQueried++;
|
this.itemHandlerInfos.put(queried, new IItemHandlerInfo(cap, i, info.relayInQuestion));
|
||||||
|
queried++;
|
||||||
}
|
}
|
||||||
}
|
return queried;
|
||||||
|
}).orElse(0);
|
||||||
// TODO: [port] add back
|
// TODO: [port] add back
|
||||||
|
|
||||||
// if (ActuallyAdditions.commonCapsLoaded) {
|
// if (ActuallyAdditions.commonCapsLoaded) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class TileEntityItemInterfaceHopping extends TileEntityItemInterface {
|
||||||
List<ItemEntity> items = level.getEntities(EntityType.ITEM, axisAlignedBB, EntitySelector.ENTITY_STILL_ALIVE);
|
List<ItemEntity> items = level.getEntities(EntityType.ITEM, axisAlignedBB, EntitySelector.ENTITY_STILL_ALIVE);
|
||||||
if (items != null && !items.isEmpty()) {
|
if (items != null && !items.isEmpty()) {
|
||||||
for (ItemEntity item : items) {
|
for (ItemEntity item : items) {
|
||||||
if (item != null) {
|
if (item != null && item.isAlive()) {
|
||||||
if (ActuallyAdditions.commonCapsLoaded) {
|
if (ActuallyAdditions.commonCapsLoaded) {
|
||||||
Object slotless = tile.itemHandler.getSlotlessHandler();
|
Object slotless = tile.itemHandler.getSlotlessHandler();
|
||||||
// TODO: [port] add back?
|
// TODO: [port] add back?
|
||||||
|
@ -79,12 +79,11 @@ public class TileEntityItemInterfaceHopping extends TileEntityItemInterface {
|
||||||
|
|
||||||
Optional<IItemHandler> handler = Optional.ofNullable(tile.itemHandler.getNormalHandler());
|
Optional<IItemHandler> handler = Optional.ofNullable(tile.itemHandler.getNormalHandler());
|
||||||
handler.ifPresent(cap -> {
|
handler.ifPresent(cap -> {
|
||||||
System.out.println(cap.getSlots());
|
|
||||||
for (int i = 0; i < cap.getSlots(); i++) {
|
for (int i = 0; i < cap.getSlots(); i++) {
|
||||||
ItemStack left = cap.insertItem(i, item.getItem(), false);
|
ItemStack left = cap.insertItem(i, item.getItem(), false);
|
||||||
item.setItem(left);
|
item.setItem(left);
|
||||||
|
|
||||||
if (left.isEmpty()) {
|
if (!StackUtil.isValid(left)) {
|
||||||
item.discard();
|
item.discard();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +126,7 @@ public class TileEntityItemInterfaceHopping extends TileEntityItemInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockState state = this.level.getBlockState(this.getBlockPos());
|
BlockState state = this.level.getBlockState(this.getBlockPos());
|
||||||
Direction facing = state.getValue(BlockStateProperties.FACING_HOPPER);
|
Direction facing = state.getValue(BlockStateProperties.FACING);
|
||||||
|
|
||||||
BlockPos toPos = this.getBlockPos().relative(facing);
|
BlockPos toPos = this.getBlockPos().relative(facing);
|
||||||
if (this.level.isLoaded(toPos)) {
|
if (this.level.isLoaded(toPos)) {
|
||||||
|
|
|
@ -22,7 +22,6 @@ import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
@ -201,10 +200,10 @@ public abstract class TileEntityLaserRelay extends TileEntityInventoryBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public abstract Component getExtraDisplayString();
|
public abstract String getExtraDisplayString();
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public abstract Component getCompassDisplayString();
|
public abstract String getCompassDisplayString();
|
||||||
|
|
||||||
public abstract void onCompassAction(Player player);
|
public abstract void onCompassAction(Player player);
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
@ -259,14 +259,14 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public Component getExtraDisplayString() {
|
public String getExtraDisplayString() {
|
||||||
return Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.energy.extra").append(": ").append(Component.translatable(this.mode.name).withStyle(ChatFormatting.DARK_RED));
|
return I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.energy.extra") + ": " + ChatFormatting.DARK_RED + I18n.get(this.mode.name) + ChatFormatting.RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public Component getCompassDisplayString() {
|
public String getCompassDisplayString() {
|
||||||
return Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.energy.display").withStyle(ChatFormatting.GREEN);
|
return ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.energy.display");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -18,10 +18,10 @@ import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy.Mode;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy.Mode;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
@ -251,14 +251,14 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public Component getExtraDisplayString() {
|
public String getExtraDisplayString() {
|
||||||
return Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.fluid.extra").append(": ").append(Component.translatable(this.mode.name).withStyle(ChatFormatting.DARK_RED));
|
return I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.fluid.extra") + ": " + ChatFormatting.DARK_RED + I18n.get(this.mode.name) + ChatFormatting.RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public Component getCompassDisplayString() {
|
public String getCompassDisplayString() {
|
||||||
return Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.energy.display").withStyle(ChatFormatting.GREEN);
|
return ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.energy.display");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,10 +19,10 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface.GenericItem
|
||||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper;
|
import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
@ -158,14 +158,14 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public Component getExtraDisplayString() {
|
public String getExtraDisplayString() {
|
||||||
return Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.item.extra").append(": ").append(Component.literal(String.valueOf(this.getPriority())).withStyle(ChatFormatting.DARK_RED));
|
return I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.item.extra") + ": " + ChatFormatting.DARK_RED + this.getPriority() + ChatFormatting.RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public Component getCompassDisplayString() {
|
public String getCompassDisplayString() {
|
||||||
return Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.item.display.1").append("\n").append(Component.translatable("info." + ActuallyAdditions.MODID + ".laserRelay.item.display.2")).withStyle(ChatFormatting.GREEN);
|
return ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.item.display.1") + "\n" + I18n.get("info." + ActuallyAdditions.MODID + ".laserRelay.item.display.2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getDisplayName() {
|
public Component getDisplayName() {
|
||||||
return Component.translatable("container.actuallyadditions.laserRelayAdvanced");
|
return Component.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
|
@ -101,7 +101,6 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
if (hasBoundPosition())
|
if (hasBoundPosition())
|
||||||
serverLevel.registerCapabilityListener(boundPosition, capListener);
|
serverLevel.registerCapabilityListener(boundPosition, capListener);
|
||||||
}
|
}
|
||||||
invalidateCapabilities();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int strength = this.getComparatorStrength();
|
int strength = this.getComparatorStrength();
|
||||||
|
|
|
@ -36,19 +36,13 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.texture.TextureManager;
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
import net.minecraft.client.resources.language.I18n;
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.client.resources.model.BakedModel;
|
import net.minecraft.client.resources.model.BakedModel;
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.world.item.ItemDisplayContext;
|
import net.minecraft.world.item.ItemDisplayContext;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
import net.neoforged.neoforge.client.ClientHooks;
|
import net.neoforged.neoforge.client.ClientHooks;
|
||||||
|
@ -429,43 +423,4 @@ public final class AssetUtil {
|
||||||
}
|
}
|
||||||
return new float[]{0.0f, (pos -= 170.0f) * 3.0f, 255.0f - pos * 3.0f};
|
return new float[]{0.0f, (pos -= 170.0f) * 3.0f, 255.0f - pos * 3.0f};
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static void renderHitOutline(PoseStack poseStack, VertexConsumer consumer, Entity entity,
|
|
||||||
double camX, double camY, double camZ, Level level, BlockPos pos, BlockState state) {
|
|
||||||
renderShape(poseStack, consumer, state.getShape(level, pos, CollisionContext.of(entity)),
|
|
||||||
(double) pos.getX() - camX,
|
|
||||||
(double) pos.getY() - camY,
|
|
||||||
(double) pos.getZ() - camZ,
|
|
||||||
0.0F,
|
|
||||||
0.0F,
|
|
||||||
0.0F,
|
|
||||||
0.4F
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
private static void renderShape(PoseStack poseStack, VertexConsumer consumer, VoxelShape shape,
|
|
||||||
double x, double y, double z, float red, float green, float blue, float alpha) {
|
|
||||||
PoseStack.Pose posestack$pose = poseStack.last();
|
|
||||||
shape.forAllEdges(
|
|
||||||
(minX, minY, minZ, maxX, maxY, maxZ) -> {
|
|
||||||
float f = (float) (maxX - minX);
|
|
||||||
float f1 = (float) (maxY - minY);
|
|
||||||
float f2 = (float) (maxZ - minZ);
|
|
||||||
float f3 = Mth.sqrt(f * f + f1 * f1 + f2 * f2);
|
|
||||||
f /= f3;
|
|
||||||
f1 /= f3;
|
|
||||||
f2 /= f3;
|
|
||||||
consumer.vertex(posestack$pose.pose(), (float) (minX + x), (float) (minY + y), (float) (minZ + z))
|
|
||||||
.color(red, green, blue, alpha)
|
|
||||||
.normal(posestack$pose.normal(), f, f1, f2)
|
|
||||||
.endVertex();
|
|
||||||
consumer.vertex(posestack$pose.pose(), (float) (maxX + x), (float) (maxY + y), (float) (maxZ + z))
|
|
||||||
.color(red, green, blue, alpha)
|
|
||||||
.normal(posestack$pose.normal(), f, f1, f2)
|
|
||||||
.endVertex();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,10 @@ import net.neoforged.neoforge.common.util.FakePlayer;
|
||||||
import net.neoforged.neoforge.common.util.FakePlayerFactory;
|
import net.neoforged.neoforge.common.util.FakePlayerFactory;
|
||||||
import net.neoforged.neoforge.energy.IEnergyStorage;
|
import net.neoforged.neoforge.energy.IEnergyStorage;
|
||||||
import net.neoforged.neoforge.event.EventHooks;
|
import net.neoforged.neoforge.event.EventHooks;
|
||||||
|
import net.neoforged.neoforge.event.entity.player.PlayerEvent;
|
||||||
import net.neoforged.neoforge.event.level.BlockEvent.BreakEvent;
|
import net.neoforged.neoforge.event.level.BlockEvent.BreakEvent;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||||
import net.neoforged.neoforge.items.IItemHandler;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -95,7 +95,7 @@ public final class WorldUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StackUtil.isValid(extracted)) {
|
if (!StackUtil.isValid(extracted)) {
|
||||||
IItemHandler handler = extractWrapper.getNormalHandler();
|
/* IItemHandler handler = extractWrapper.getNormalHandler();
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
for (int i = Math.max(0, slotStart); i < Math.min(slotEnd, handler.getSlots()); i++) {
|
for (int i = Math.max(0, slotStart); i < Math.min(slotEnd, handler.getSlots()); i++) {
|
||||||
if (filter == null || !filter.needsCheck() || filter.check(handler.getStackInSlot(i))) {
|
if (filter == null || !filter.needsCheck() || filter.check(handler.getStackInSlot(i))) {
|
||||||
|
@ -106,7 +106,7 @@ public final class WorldUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return extracted;
|
return extracted;
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class SlotlessableItemHandlerWrapper {
|
||||||
//TODO: Check if we need this wrapper at all? The previous implementation used CommonCapabilities ISlotlessItemhandler
|
//TODO: Check if we need this wrapper at all? The previous implementation used CommonCapabilities ISlotlessItemhandler
|
||||||
|
|
||||||
private final IItemHandler normalHandler;
|
private final IItemHandler normalHandler;
|
||||||
@Deprecated
|
|
||||||
private final Object slotlessHandler;
|
private final Object slotlessHandler;
|
||||||
|
|
||||||
public SlotlessableItemHandlerWrapper(IItemHandler normalHandler, Object slotlessHandler) {
|
public SlotlessableItemHandlerWrapper(IItemHandler normalHandler, Object slotlessHandler) {
|
||||||
|
@ -28,7 +27,6 @@ public class SlotlessableItemHandlerWrapper {
|
||||||
return this.normalHandler;
|
return this.normalHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Object getSlotlessHandler() {
|
public Object getSlotlessHandler() {
|
||||||
return this.slotlessHandler;
|
return this.slotlessHandler;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,7 +341,7 @@
|
||||||
"item.actuallyadditions.booklet": "Actually Additions Manual (wip)",
|
"item.actuallyadditions.booklet": "Actually Additions Manual (wip)",
|
||||||
"item.actuallyadditions.rarmor_module_reconstructor": "Reconstruction Module (wip)",
|
"item.actuallyadditions.rarmor_module_reconstructor": "Reconstruction Module (wip)",
|
||||||
"item.actuallyadditions.laser_wrench": "Laser Wrench",
|
"item.actuallyadditions.laser_wrench": "Laser Wrench",
|
||||||
"item.actuallyadditions.drill_core": "Drill Core",
|
"item.actuallyadditions.drill_core": "Drill Core (wip)",
|
||||||
"item.actuallyadditions.restonia_crystal": "Restonia Crystal",
|
"item.actuallyadditions.restonia_crystal": "Restonia Crystal",
|
||||||
"item.actuallyadditions.palis_crystal": "Palis Crystal",
|
"item.actuallyadditions.palis_crystal": "Palis Crystal",
|
||||||
"item.actuallyadditions.diamatine_crystal": "Diamatine Crystal",
|
"item.actuallyadditions.diamatine_crystal": "Diamatine Crystal",
|
||||||
|
@ -980,7 +980,5 @@
|
||||||
"_comment": "JEI",
|
"_comment": "JEI",
|
||||||
"jei.actuallyadditions.coffee.special": "Special Feature",
|
"jei.actuallyadditions.coffee.special": "Special Feature",
|
||||||
"jei.actuallyadditions.coffee.maxAmount": "Max Amount",
|
"jei.actuallyadditions.coffee.maxAmount": "Max Amount",
|
||||||
"jei.actuallyadditions.coffee.extra.milk": "+01:00, -1 Level",
|
"jei.actuallyadditions.coffee.extra.milk": "+01:00, -1 Level"
|
||||||
"jei.actuallyadditions.mining_lens": "Lens of the Miner",
|
|
||||||
"jei.actuallyadditions.mining_lens.weight": "Weight:"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementalcraft"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementalcraft:inert_crystal_ore"
|
|
||||||
},
|
|
||||||
"weight": 500
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementsofpower"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementsofpower:agate_ore"
|
|
||||||
},
|
|
||||||
"weight": 25
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementsofpower"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementsofpower:citrine_ore"
|
|
||||||
},
|
|
||||||
"weight": 25
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementsofpower"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementsofpower:onyx_ore"
|
|
||||||
},
|
|
||||||
"weight": 25
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementsofpower"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementsofpower:rubellite_ore"
|
|
||||||
},
|
|
||||||
"weight": 25
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementsofpower"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementsofpower:ruby_ore"
|
|
||||||
},
|
|
||||||
"weight": 25
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "elementsofpower"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "elementsofpower:sapphire_ore"
|
|
||||||
},
|
|
||||||
"weight": 25
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "immersiveengineering"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "immersiveengineering:ore_silver"
|
|
||||||
},
|
|
||||||
"weight": 1000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "mekanism"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "mekanism:florite_ore"
|
|
||||||
},
|
|
||||||
"weight": 1000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "mekanism"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "mekanism:lead_ore"
|
|
||||||
},
|
|
||||||
"weight": 2000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "mekanism"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "mekanism:osmium_ore"
|
|
||||||
},
|
|
||||||
"weight": 3000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "mekanism"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "mekanism:tin_ore"
|
|
||||||
},
|
|
||||||
"weight": 2000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "mekanism"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "mekanism:uranium_ore"
|
|
||||||
},
|
|
||||||
"weight": 500
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "modern_industrialization"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "modern_industrialization:antimony_ore"
|
|
||||||
},
|
|
||||||
"weight": 1000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "modern_industrialization"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "modern_industrialization:lignite_coal_ore"
|
|
||||||
},
|
|
||||||
"weight": 1500
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "modern_industrialization"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "modern_industrialization:monazite_ore"
|
|
||||||
},
|
|
||||||
"weight": 100
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "modern_industrialization"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "modern_industrialization:nickel_ore"
|
|
||||||
},
|
|
||||||
"weight": 2000
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "modern_industrialization"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "modern_industrialization:salt_ore"
|
|
||||||
},
|
|
||||||
"weight": 500
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "powah"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "actuallyadditions:mining_lens",
|
|
||||||
"ingredient": {
|
|
||||||
"tag": "forge:stone"
|
|
||||||
},
|
|
||||||
"result": {
|
|
||||||
"item": "powah:uraninite_ore"
|
|
||||||
},
|
|
||||||
"weight": 200
|
|
||||||
}
|
|
Loading…
Reference in a new issue