Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/part_creative_energy' into part_…
Browse files Browse the repository at this point in the history
…creative_energy
  • Loading branch information
lordIcocain committed Dec 18, 2024
2 parents 34c653a + 7e6d8d4 commit 846e623
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 47 deletions.
20 changes: 10 additions & 10 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Add your dependencies here

dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.46-GTNH:dev')
implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.51-GTNH:dev')
implementation('curse.maven:cofh-core-69162:2388751')

compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta20:api')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.20:dev") {transitive = false}
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta26:api')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.22:dev") {transitive = false}
compileOnly('com.github.GTNewHorizons:ThaumicTinkerer:2.10.2:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.17:dev') {transitive = false} // required to compile CraftingV2Tests.java now
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.19:dev') {transitive = false} // required to compile CraftingV2Tests.java now
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.5.0:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.70:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.10:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Jabba:1.4.6:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.7.0:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.27-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.8.2:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.14:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.15:api') {transitive = false}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive = false }
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
Expand All @@ -34,14 +34,14 @@ dependencies {
functionalTestImplementation('org.junit.platform:junit-platform-engine')
functionalTestImplementation('org.junit.platform:junit-platform-launcher')
functionalTestImplementation('org.junit.platform:junit-platform-reporting')
functionalTestImplementation('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.70:dev') {
functionalTestImplementation('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.10:dev') {
exclude module: "Applied-Energistics-2-Unofficial"
}

runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
runtimeOnlyNonPublishable('com.github.GTNewHorizons:Baubles:1.0.4:dev')
runtimeOnlyNonPublishable('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
runtimeOnlyNonPublishable('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') { transitive = false }
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.47-gtnh:dev') { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:BloodMagic:1.6.7") { transitive = false }
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.51-gtnh:dev') { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:BloodMagic:1.6.9") { transitive = false }
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,13 @@ private static boolean itemStackMatchesSearchTerm(final ItemStack itemStack, fin

final NBTTagList tags = encodedValue.getTagList(in ? "in" : "out", NBT.TAG_COMPOUND);
final boolean containsInvalidDisplayName = GuiText.UnknownItem.getLocal().toLowerCase().contains(searchTerm);
Predicate<ItemStack> itemFilter = (is) -> Platform
.getItemDisplayName(AEApi.instance().storage().createItemStack(is)).toLowerCase().contains(searchTerm);
Predicate<ItemStack> itemFilter;

if (NEI.searchField.existsSearchField()) {
itemFilter = NEI.searchField.getFilter(searchTerm);
} else {
itemFilter = is -> Platform.getItemDisplayName(AEApi.instance().storage().createItemStack(is)).toLowerCase()
.contains(searchTerm);
}

for (int i = 0; i < tags.tagCount(); i++) {
Expand Down
62 changes: 36 additions & 26 deletions src/main/java/appeng/client/me/ItemRepo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
package appeng.client.me;

import java.util.ArrayList;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.function.BiPredicate;
import java.util.function.Predicate;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -52,6 +54,7 @@ public class ItemRepo implements IDisplayRepo {
private int rowSize = 9;

private String searchString = "";
private Map<IAEItemStack, Boolean> searchCache = new WeakHashMap<>();
private IPartitionList<IAEItemStack> myPartitionList;
private boolean hasPower;

Expand Down Expand Up @@ -107,52 +110,48 @@ public void updateView() {
this.dsp.ensureCapacity(this.list.size());

final Enum viewMode = this.sortSrc.getSortDisplay();
final Enum searchMode = AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE);
final Enum typeFilter = this.sortSrc.getTypeFilter();
Predicate<IAEItemStack> itemFilter = getFilter(this.searchString);

if (NEI.searchField.existsSearchField()) {
if (searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH) {
NEI.searchField.setText(this.searchString);
Predicate<IAEItemStack> itemFilter = null;

if (!this.searchString.trim().isEmpty()) {
if (NEI.searchField.existsSearchField()) {
final Predicate<ItemStack> neiFilter = NEI.searchField.getFilter(this.searchString);
itemFilter = is -> neiFilter.test(is.getItemStack());
} else {
itemFilter = getFilter(this.searchString);
}

final Predicate<ItemStack> neiFilter = NEI.searchField.getFilter(this.searchString);
itemFilter = is -> neiFilter.test(is.getItemStack());
}

if (itemFilter == null) {
return;
}

IItemDisplayRegistry registry = AEApi.instance().registries().itemDisplay();

out: for (IAEItemStack is : this.list) {
if (registry.isBlacklisted(is.getItem()) || registry.isBlacklisted(is.getItem().getClass())) {
if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
continue;
}

for (final BiPredicate<TypeFilter, IAEItemStack> filter : registry.getItemFilters()) {
if (!filter.test((TypeFilter) typeFilter, is)) continue out;
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
continue;
}

if (this.myPartitionList != null && !this.myPartitionList.isListed(is)) {
continue;
}

if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
if (registry.isBlacklisted(is.getItem()) || registry.isBlacklisted(is.getItem().getClass())) {
continue;
}

if (viewMode == ViewItems.CRAFTABLE) {
is = is.copy();
is.setStackSize(0);
for (final BiPredicate<TypeFilter, IAEItemStack> filter : registry.getItemFilters()) {
if (!filter.test((TypeFilter) typeFilter, is)) continue out;
}

if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
continue;
}
if (itemFilter == null || Boolean.TRUE.equals(this.searchCache.computeIfAbsent(is, itemFilter::test))) {

if (viewMode == ViewItems.CRAFTABLE) {
is = is.copy();
is.setStackSize(0);
}

if (itemFilter.test(is)) {
this.view.add(is);
}
}
Expand Down Expand Up @@ -180,7 +179,7 @@ public void updateView() {

private Predicate<IAEItemStack> getFilter(String innerSearch) {

if (innerSearch.length() == 0) {
if (innerSearch.isEmpty()) {
return stack -> true;
}

Expand Down Expand Up @@ -265,6 +264,17 @@ public String getSearchString() {

@Override
public void setSearchString(@Nonnull final String searchString) {
this.searchString = searchString;
if (!searchString.equals(this.searchString)) {
this.searchString = searchString;
this.searchCache.clear();

if (NEI.searchField.existsSearchField()) {
final Enum searchMode = AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE);
if (searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH) {
NEI.searchField.setText(this.searchString);
}
}
}

}
}
7 changes: 3 additions & 4 deletions src/main/java/appeng/client/render/blocks/RenderMEChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ public boolean renderInWorld(final BlockChest imb, final IBlockAccess world, fin

this.selectFace(renderer, west, up, forward, 5, 16 - 5, 9, 12);

int offsetU = 4;
int offsetU = -4;
int offsetV = 9 - type * 4;
if (stat == 0) {
// Right up corner
offsetU = -4;
offsetV = 8;
// Bottom middle right
offsetV = -5;
}

int b = world.getLightBrightnessForSkyBlocks(x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Predicate<ItemStack> getFilter(String filterText) {

if (searchField != null) {
final ItemFilter filter = searchField.getFilter(filterText);
return stack -> filter.matches(stack);
return filter::matches;
}

return null;
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/appeng/items/tools/ToolMemoryCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public void addCheckedInformation(final ItemStack stack, final EntityPlayer play

lines.add(String.format(local, freqTooltip));
}
if (data.hasKey("custom_name")) lines.add(data.getString("custom_name"));

if (data.hasKey("custom_name")) {
lines.add(data.getString("custom_name"));
} else if (data.hasKey("display") && data.getCompoundTag("display").hasKey("Name")) {
lines.add(data.getCompoundTag("display").getString("Name"));
}
}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/appeng/tile/storage/TileChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ public boolean readFromStream_TileChest(final ByteBuf data) {
this.type = data.readByte() & 0b11;
final AEColor oldPaintedColor = this.paintedColor;
this.paintedColor = AEColor.values()[data.readByte()];
this.getProxy().setColor(this.paintedColor);

final int item = data.readInt();

Expand All @@ -433,6 +434,7 @@ public void readFromNBT_TileChest(final NBTTagCompound data) {
this.priority = data.getInteger("priority");
if (data.hasKey("paintedColor")) {
this.paintedColor = AEColor.values()[data.getByte("paintedColor")];
this.getProxy().setColor(this.paintedColor);
}
}

Expand Down Expand Up @@ -715,8 +717,11 @@ public boolean recolourBlock(final ForgeDirection side, final AEColor newPainted
if (this.paintedColor == newPaintedColor) {
return false;
}

this.paintedColor = newPaintedColor;
this.getProxy().setColor(this.paintedColor);
if (getGridNode(side) != null) {
getGridNode(side).updateState();
}
this.markDirty();
this.markForUpdate();
return true;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 846e623

Please sign in to comment.