Skip to content

Commit

Permalink
Merge branch 'AE2-UEL:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
KasumiNova authored May 31, 2024
2 parents 8954d48 + 68de8fa commit 2a37198
Show file tree
Hide file tree
Showing 67 changed files with 1,601 additions and 488 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up OpenJDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt' # You can choose other OpenJDK distributions.
- name: Build with Gradle
run: ./gradlew build # Ensure your gradlew script is executable
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: AE2-UEL
path: build/libs/*.jar # Make sure this path matches the location of your build artifacts
7 changes: 5 additions & 2 deletions src/api/java/appeng/api/config/ActionItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ public enum ActionItems
DIVIDE_BY_THREE,
DECREASE_BY_ONE,
MAX_COUNT,
FREE_MOLECULAR_SLOT_SHORTCUT,
MOLECULAR_ASSEMBLERS_ON,
MOLECULAR_ASSEMBLERS_OFF,
TOGGLE_SHOW_FULL_INTERFACES_ON,
TOGGLE_SHOW_FULL_INTERFACES_OFF,
TOGGLE_SHOW_ONLY_INVALID_PATTERNS_ON,
TOGGLE_SHOW_ONLY_INVALID_PATTERNS_OFF,
HIGHLIGHT_INTERFACE
}
}
26 changes: 26 additions & 0 deletions src/api/java/appeng/api/config/LockCraftingMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package appeng.api.config;

public enum LockCraftingMode {
/**
* Crafting is never locked.
*/
NONE,
/**
* After pushing a pattern to an adjacent machine, the pattern provider will not accept further crafts until a
* redstone pulse is received.
*/
LOCK_UNTIL_PULSE,
/**
* Crafting is locked while the pattern provider is receiving a redstone signal.
*/
LOCK_WHILE_HIGH,
/**
* Crafting is locked while the pattern provider is not receiving a redstone signal.
*/
LOCK_WHILE_LOW,
/**
* After pushing a pattern to an adjacent machine, the pattern provider will not accept further crafts until the
* primary pattern result is returned to the network through the pattern provider.
*/
LOCK_UNTIL_RESULT
}
2 changes: 2 additions & 0 deletions src/api/java/appeng/api/config/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public enum Settings

IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),

UNLOCK(EnumSet.allOf(LockCraftingMode.class)),

BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),

OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
Expand Down
25 changes: 19 additions & 6 deletions src/api/java/appeng/api/features/IInscriberRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
package appeng.api.features;


import java.util.List;
import java.util.Optional;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;

import net.minecraft.item.ItemStack;
import java.util.List;
import java.util.Optional;


/**
Expand Down Expand Up @@ -57,21 +56,35 @@ public interface IInscriberRecipe
@Nonnull
ItemStack getOutput();


@Nonnull
List<ItemStack> getTopInputs();

/**
* gets the top optional
*
* @return item which is used top
*/
@Deprecated
@Nonnull
default Optional<ItemStack> getTopOptional(){
return getTopInputs().isEmpty() ? Optional.empty() : Optional.of(getTopInputs().get(0));
}


@Nonnull
Optional<ItemStack> getTopOptional();
List<ItemStack> getBottomInputs();

/**
* gets the bottom optional
*
* @return item which is used bottom
*/
@Deprecated
@Nonnull
Optional<ItemStack> getBottomOptional();
default Optional<ItemStack> getBottomOptional() {
return getBottomInputs().isEmpty() ? Optional.empty() : Optional.of(getBottomInputs().get(0));
}

/**
* type of inscriber process
Expand Down
20 changes: 15 additions & 5 deletions src/api/java/appeng/api/features/IInscriberRecipeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
package appeng.api.features;


import java.util.Collection;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;

import net.minecraft.item.ItemStack;
import java.util.Collection;
import java.util.Collections;


/**
Expand Down Expand Up @@ -66,7 +66,7 @@ public interface IInscriberRecipeBuilder
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withTopOptional( @Nonnull ItemStack topOptional );
IInscriberRecipeBuilder withTopOptional(@Nonnull Collection<ItemStack> topOptional );

/**
* Creates an inscriber recipe with bot.
Expand All @@ -77,7 +77,7 @@ public interface IInscriberRecipeBuilder
* @return currently used builder
*/
@Nonnull
IInscriberRecipeBuilder withBottomOptional( @Nonnull ItemStack bottomOptional );
IInscriberRecipeBuilder withBottomOptional( @Nonnull Collection<ItemStack> bottomOptional );

/**
* Creates an inscriber recipe with type.
Expand All @@ -104,4 +104,14 @@ public interface IInscriberRecipeBuilder
*/
@Nonnull
IInscriberRecipe build();

@Deprecated
default IInscriberRecipeBuilder withTopOptional(@Nonnull ItemStack topOptional){
return withTopOptional(Collections.singleton(topOptional));
}

@Deprecated
default IInscriberRecipeBuilder withBottomOptional(@Nonnull ItemStack bottomOptional){
return withBottomOptional(Collections.singleton(bottomOptional));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ public interface ICraftingPatternDetails
*/
IAEItemStack[] getCondensedOutputs();

/**
* The primary output of this pattern. The pattern will only be used to craft the primary output; the others are
* just byproducts.
*/
default IAEItemStack getPrimaryOutput() {
return getOutputs()[0];
}

/**
* @return a list of the outputs, will include nulls.
*/
Expand Down
87 changes: 87 additions & 0 deletions src/api/java/yalter/mousetweaks/api/IMTModGuiContainer2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package yalter.mousetweaks.api;

import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;

/**
* This is the interface you want to implement in your GuiScreen to make it compatible with Mouse Tweaks.
* If this interface is not enough (for example, you need a custom slot click function, or if you use a custom Container
* which happens to be incompatible), check IMTModGuiContainer2Ex instead.
* If you just need to disable Mouse Tweaks or the wheel tweak, see the MouseTweaksIgnore
* or the MouseTweaksDisableWheelTweak annotations.
*/
public interface IMTModGuiContainer2 {
/**
* If you want to disable Mouse Tweaks in your GuiScreen, return true from this method.
*
* @return True if Mouse Tweaks should be disabled, false otherwise.
*/
boolean MT_isMouseTweaksDisabled();

/**
* If you want to disable the Wheel Tweak in your GuiScreen, return true from this method.
*
* @return True if the Wheel Tweak should be disabled, false otherwise.
*/
boolean MT_isWheelTweakDisabled();

/**
* Returns the Container.
*
* @return Container that is currently in use.
*/
Container MT_getContainer();

/**
* Returns the Slot that is currently selected by the player, or null if no Slot is selected.
*
* @return Slot that is located under the mouse, or null if no Slot it currently under the mouse.
*/
Slot MT_getSlotUnderMouse();

/**
* Return true if the given Slot behaves like the vanilla crafting output slots (inside the crafting table,
* or the furnace output slot, or the anvil output slot, etc.). These slots are handled differently by Mouse Tweaks.
*
* @param slot the slot to check
* @return True if slot is a crafting output slot.
*/
boolean MT_isCraftingOutput(Slot slot);

/**
* Return true if the given Slot should be ignored by Mouse Tweaks. Examples of ignored slots are the item select
* slots and the Destroy Item slot in the vanilla creative inventory.
*
* @param slot the slot to check
* @return Tru if slot should be ignored by Mouse Tweaks.
*/
boolean MT_isIgnored(Slot slot);

/**
* If your container has an RMB dragging functionality (like vanilla containers), disable it inside this method.
* This method is called every frame (render tick), which is after all mouseClicked / mouseClickMove / mouseReleased
* events are handled (although note these events are handled every game tick, which is far less frequent than every
* render tick).<br><br>
* <p>
* If true is returned from this method, Mouse Tweaks (after checking other conditions like isIgnored) will click
* the slot on which the right mouse button was initially pressed (in most cases this is the slot currently under
* mouse). This is needed because the vanilla RMB dragging functionality prevents the initial slot click.<br><br>
* <p>
* For vanilla containers this method looks like this:
* <pre>
* this.ignoreMouseUp = true;
*
* if (this.dragSplitting) {
* if (this.dragSplittingButton == 1) {
* this.dragSplitting = false;
* return true;
* }
* }
*
* return false;
* </pre>
*
* @return True if Mouse Tweaks should click the slot on which the RMB was pressed.
*/
boolean MT_disableRMBDraggingFunctionality();
}
14 changes: 0 additions & 14 deletions src/api/java/yalter/mousetweaks/api/MouseTweaksIgnore.java

This file was deleted.

10 changes: 10 additions & 0 deletions src/main/java/appeng/block/misc/BlockInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileInterface;
import appeng.util.Platform;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -93,4 +95,12 @@ protected void customRotateBlock(final IOrientable rotatable, final EnumFacing a
((TileInterface) rotatable).setSide(axis);
}
}

@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
TileEntity tileEntity = this.getTileEntity(worldIn, pos);
if (tileEntity != null) {
((TileInterface) tileEntity).updateRedstoneState();
}
}
}
Loading

0 comments on commit 2a37198

Please sign in to comment.