Skip to content

Commit 9f923ec

Browse files
authored
Adds a Shortcut for removing property keys in kube (#3567)
1 parent 6dc308b commit 9f923ec

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,13 +516,17 @@ public MaterialStack multiply(long amount) {
516516
}
517517

518518
public <T extends IMaterialProperty> boolean hasProperty(PropertyKey<T> key) {
519-
return getProperty(key) != null;
519+
return properties.hasProperty(key);
520520
}
521521

522522
public <T extends IMaterialProperty> T getProperty(PropertyKey<T> key) {
523523
return properties.getProperty(key);
524524
}
525525

526+
public <T extends IMaterialProperty> void removeProperty(PropertyKey<T> key) {
527+
properties.removeProperty(key);
528+
}
529+
526530
public <T extends IMaterialProperty> void setProperty(PropertyKey<T> key, IMaterialProperty property) {
527531
if (!GTCEuAPI.materialManager.canModifyMaterials()) {
528532
throw new IllegalStateException("Cannot add properties to a Material when registry is frozen!");

src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/properties/MaterialProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public <T extends IMaterialProperty> T getProperty(PropertyKey<T> key) {
3737
}
3838

3939
public <T extends IMaterialProperty> boolean hasProperty(PropertyKey<T> key) {
40-
return propertyMap.get(key) != null;
40+
return propertyMap.containsKey(key);
4141
}
4242

4343
public <T extends IMaterialProperty> void setProperty(PropertyKey<T> key, IMaterialProperty value) {

0 commit comments

Comments
 (0)