-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20.6: Rearrange more packages and add fun loot capacitor names.
- Loading branch information
Showing
29 changed files
with
169 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/machines/java/com/enderio/machines/common/init/MachineBlocks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ent/renderer/item/GlassIconDecorator.java → .../client/decorator/GlassIconDecorator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...se/client/renderer/item/package-info.java → ...o/base/client/decorator/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@javax.annotation.ParametersAreNonnullByDefault | ||
@net.minecraft.MethodsReturnNonnullByDefault | ||
|
||
package com.enderio.base.client.renderer.item; | ||
package com.enderio.base.client.decorator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../renderer/entity/PaintedSandRenderer.java → ...ase/client/paint/PaintedSandRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...se/client/model/PaintedBlockGeometry.java → ...ent/paint/model/PaintedBlockGeometry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../base/client/model/PaintedBlockModel.java → ...client/paint/model/PaintedBlockModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...client/model/PaintingQuadTransformer.java → .../paint/model/PaintingQuadTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
src/main/java/com/enderio/base/client/renderer/entity/package-info.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/main/java/com/enderio/base/client/renderer/travel/package-info.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...enderer/travel/TravelTargetRendering.java → .../client/travel/TravelTargetRendering.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...derio/base/client/model/package-info.java → ...erio/base/client/travel/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@javax.annotation.ParametersAreNonnullByDefault | ||
@net.minecraft.MethodsReturnNonnullByDefault | ||
|
||
package com.enderio.base.client.model; | ||
package com.enderio.base.client.travel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
src/main/java/com/enderio/base/common/item/capacitors/LootCapacitorItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.enderio.base.common.item.capacitors; | ||
|
||
import com.enderio.api.capacitor.CapacitorData; | ||
import com.enderio.api.capacitor.CapacitorModifier; | ||
import com.enderio.base.common.init.EIOAttachments; | ||
import com.enderio.base.common.init.EIODataComponents; | ||
import com.enderio.base.common.lang.EIOLang; | ||
import com.enderio.core.common.util.TooltipUtil; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.chat.MutableComponent; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
public class LootCapacitorItem extends CapacitorItem { | ||
public LootCapacitorItem(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public Component getName(ItemStack pStack) { | ||
var capacitorData = pStack.getOrDefault(EIODataComponents.CAPACITOR_DATA, CapacitorData.NONE); | ||
|
||
if (capacitorData.modifiers().isEmpty()) { | ||
return getBaseName(capacitorData); | ||
} | ||
|
||
return getModifierQuality(capacitorData) | ||
.copy() | ||
.append(" ") | ||
.append(getModifierType(capacitorData)) | ||
.append(" ") | ||
.append(getBaseName(capacitorData)); | ||
} | ||
|
||
private MutableComponent getBaseName(CapacitorData capacitorData) { | ||
float base = capacitorData.base(); | ||
|
||
if (base < 1f) { | ||
return EIOLang.LOOT_CAPACITOR_BASE_DUD; | ||
} else if (base < 1.5f) { | ||
return EIOLang.LOOT_CAPACITOR_BASE_NORMAL; | ||
} else if (base < 2.5f) { | ||
return EIOLang.LOOT_CAPACITOR_BASE_ENHANCED; | ||
} else if (base < 3.5f) { | ||
return EIOLang.LOOT_CAPACITOR_BASE_WONDER; | ||
} | ||
|
||
return EIOLang.LOOT_CAPACITOR_BASE_IMPOSSIBLE; | ||
} | ||
|
||
private MutableComponent getModifierType(CapacitorData capacitorData) { | ||
var firstType = capacitorData.modifiers().keySet().stream().findFirst(); | ||
|
||
if (firstType.isEmpty()) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
// TODO: Use a map for this instead. | ||
if (firstType.get() == CapacitorModifier.ENERGY_CAPACITY) { | ||
return EIOLang.LOOT_CAPACITOR_TYPE_ENERGY_CAPACITY; | ||
} else if (firstType.get() == CapacitorModifier.ENERGY_USE) { | ||
return EIOLang.LOOT_CAPACITOR_TYPE_ENERGY_USE; | ||
} | ||
|
||
return EIOLang.LOOT_CAPACITOR_TYPE_UNKNOWN; | ||
} | ||
|
||
private MutableComponent getModifierQuality(CapacitorData capacitorData) { | ||
var firstModifier = capacitorData.modifiers().values().stream().findFirst(); | ||
|
||
if (firstModifier.isEmpty()) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
float modifier = firstModifier.get(); | ||
|
||
if (modifier < 1f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_FAILED; | ||
} else if (modifier < 1.5f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_SIMPLE; | ||
} else if (modifier < 2.5f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_NICE; | ||
} else if (modifier < 3f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_GOOD; | ||
} else if (modifier < 3.5f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_ENHANCED; | ||
} else if (modifier < 4f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_PREMIUM; | ||
} else if (modifier < 4.25f) { | ||
return EIOLang.LOOT_CAPACITOR_MODIFIER_INCREDIBLY; | ||
} | ||
|
||
return EIOLang.LOOT_CAPACITOR_MODIFIER_UNSTABLE; | ||
} | ||
} |
Oops, something went wrong.