-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3c49e4
commit fc72670
Showing
25 changed files
with
403 additions
and
32 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
Binary file not shown.
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
44 changes: 44 additions & 0 deletions
44
src/main/java/anightdazingzoroark/prift/compat/hwyla/RiftHWYLA.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,44 @@ | ||
package anightdazingzoroark.prift.compat.hwyla; | ||
|
||
import anightdazingzoroark.prift.RiftInitialize; | ||
import anightdazingzoroark.prift.compat.hwyla.provider.RiftBlowPoweredTurbineProvider; | ||
import anightdazingzoroark.prift.compat.hwyla.provider.RiftCrankProvider; | ||
import anightdazingzoroark.prift.compat.hwyla.provider.RiftCreaturePartProvider; | ||
import anightdazingzoroark.prift.compat.hwyla.provider.RiftSemiManualMachineProvider; | ||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.*; | ||
import anightdazingzoroark.prift.config.GeneralConfig; | ||
import anightdazingzoroark.prift.server.entity.creature.RiftCreaturePart; | ||
import mcp.mobius.waila.api.IWailaPlugin; | ||
import mcp.mobius.waila.api.IWailaRegistrar; | ||
import mcp.mobius.waila.api.WailaPlugin; | ||
|
||
@WailaPlugin(RiftInitialize.MODID) | ||
public class RiftHWYLA implements IWailaPlugin { | ||
@Override | ||
public void register(IWailaRegistrar registrar) { | ||
RiftCreaturePartProvider creaturePartProvider = new RiftCreaturePartProvider(); | ||
registrar.registerHeadProvider(creaturePartProvider, RiftCreaturePart.class); | ||
registrar.registerBodyProvider(creaturePartProvider, RiftCreaturePart.class); | ||
registrar.registerTailProvider(creaturePartProvider, RiftCreaturePart.class); | ||
|
||
if (GeneralConfig.canUseMM()) { | ||
RiftBlowPoweredTurbineProvider turbineProvider = new RiftBlowPoweredTurbineProvider(); | ||
registrar.registerBodyProvider(turbineProvider, TileEntityBlowPoweredTurbine.class); | ||
registrar.registerBodyProvider(turbineProvider, TileEntityBlowPoweredTurbinePart.class); | ||
|
||
RiftCrankProvider leadPoweredCrankProvider = new RiftCrankProvider(); | ||
registrar.registerBodyProvider(leadPoweredCrankProvider, TileEntityHandCrank.class); | ||
registrar.registerBodyProvider(leadPoweredCrankProvider, TileEntityLeadPoweredCrank.class); | ||
|
||
RiftSemiManualMachineProvider smPresserProvider = new RiftSemiManualMachineProvider(); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualExtractor.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualExtractorTop.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualPresser.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualPresserTop.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualExtruder.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualExtruderTop.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualHammerer.class); | ||
registrar.registerBodyProvider(smPresserProvider, TileEntitySemiManualHammererTop.class); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
.../java/anightdazingzoroark/prift/compat/hwyla/provider/RiftBlowPoweredTurbineProvider.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,32 @@ | ||
package anightdazingzoroark.prift.compat.hwyla.provider; | ||
|
||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityBlowPoweredTurbine; | ||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityBlowPoweredTurbinePart; | ||
import mcp.mobius.waila.api.IWailaConfigHandler; | ||
import mcp.mobius.waila.api.IWailaDataAccessor; | ||
import mcp.mobius.waila.api.IWailaDataProvider; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.List; | ||
|
||
public class RiftBlowPoweredTurbineProvider implements IWailaDataProvider { | ||
@Nonnull | ||
@Override | ||
public List<String> getWailaBody(ItemStack itemStack, List<String> tooltip, IWailaDataAccessor accessor, IWailaConfigHandler config) { | ||
TileEntity tileEntity = accessor.getTileEntity(); | ||
if (tileEntity instanceof TileEntityBlowPoweredTurbine) { | ||
TileEntityBlowPoweredTurbine turbine = (TileEntityBlowPoweredTurbine) tileEntity; | ||
tooltip.add(I18n.format("hwyla.power_created", (int)turbine.getPower()+".0 R")); | ||
} | ||
else if (tileEntity instanceof TileEntityBlowPoweredTurbinePart) { | ||
TileEntityBlowPoweredTurbinePart turbinePart = (TileEntityBlowPoweredTurbinePart)tileEntity; | ||
TileEntityBlowPoweredTurbine turbine = turbinePart.getTurbine(); | ||
int power = (int)turbine.getPower(); | ||
tooltip.add(I18n.format("hwyla.power_created", power+".0 R")); | ||
} | ||
return tooltip; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/anightdazingzoroark/prift/compat/hwyla/provider/RiftCrankProvider.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,30 @@ | ||
package anightdazingzoroark.prift.compat.hwyla.provider; | ||
|
||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityHandCrank; | ||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityLeadPoweredCrank; | ||
import mcp.mobius.waila.api.IWailaConfigHandler; | ||
import mcp.mobius.waila.api.IWailaDataAccessor; | ||
import mcp.mobius.waila.api.IWailaDataProvider; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.List; | ||
|
||
public class RiftCrankProvider implements IWailaDataProvider { | ||
@Nonnull | ||
@Override | ||
public List<String> getWailaBody(ItemStack itemStack, List<String> tooltip, IWailaDataAccessor accessor, IWailaConfigHandler config) { | ||
TileEntity tileEntity = accessor.getTileEntity(); | ||
if (tileEntity instanceof TileEntityHandCrank) { | ||
TileEntityHandCrank handCrank = (TileEntityHandCrank) tileEntity; | ||
tooltip.add(I18n.format("hwyla.power_created", (int)handCrank.getPower()+".0 R")); | ||
} | ||
if (tileEntity instanceof TileEntityLeadPoweredCrank) { | ||
TileEntityLeadPoweredCrank leadPoweredCrank = (TileEntityLeadPoweredCrank) tileEntity; | ||
tooltip.add(I18n.format("hwyla.power_created", leadPoweredCrank.mechPower.getPower(null)+" R")); | ||
} | ||
return tooltip; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/anightdazingzoroark/prift/compat/hwyla/provider/RiftCreaturePartProvider.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,48 @@ | ||
package anightdazingzoroark.prift.compat.hwyla.provider; | ||
|
||
import anightdazingzoroark.prift.RiftInitialize; | ||
import anightdazingzoroark.prift.server.entity.creature.RiftCreaturePart; | ||
import mcp.mobius.waila.api.IWailaConfigHandler; | ||
import mcp.mobius.waila.api.IWailaEntityAccessor; | ||
import mcp.mobius.waila.api.IWailaEntityProvider; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.text.TextFormatting; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.List; | ||
|
||
public class RiftCreaturePartProvider implements IWailaEntityProvider { | ||
@Nonnull | ||
@Override | ||
public List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) { | ||
currenttip.clear(); | ||
RiftCreaturePart part = (RiftCreaturePart) entity; | ||
if (part != null) { | ||
String creatureName = TextFormatting.WHITE + part.getParent().getName(false); | ||
String level = TextFormatting.GRAY + I18n.format("tametrait.level", part.getParent().getLevel()); | ||
currenttip.add(creatureName + " (" + level + ")"); | ||
} | ||
return currenttip; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) { | ||
RiftCreaturePart part = (RiftCreaturePart) entity; | ||
if (part != null && config.getConfig("general.showhp")) { | ||
int currentHealth = (int)part.getParent().getHealth(); | ||
int maxHealth = (int)part.getParent().getMaxHealth(); | ||
currenttip.add(I18n.format("hwyla.health", currentHealth, maxHealth)); | ||
} | ||
return currenttip; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) { | ||
currenttip.clear(); | ||
currenttip.add(TextFormatting.BLUE + "" + TextFormatting.ITALIC + RiftInitialize.MODNAME); | ||
return currenttip; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...n/java/anightdazingzoroark/prift/compat/hwyla/provider/RiftSemiManualMachineProvider.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,30 @@ | ||
package anightdazingzoroark.prift.compat.hwyla.provider; | ||
|
||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntitySemiManualBase; | ||
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntitySemiManualTopBase; | ||
import mcp.mobius.waila.api.IWailaConfigHandler; | ||
import mcp.mobius.waila.api.IWailaDataAccessor; | ||
import mcp.mobius.waila.api.IWailaDataProvider; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.List; | ||
|
||
public class RiftSemiManualMachineProvider implements IWailaDataProvider { | ||
@Nonnull | ||
@Override | ||
public List<String> getWailaBody(ItemStack itemStack, List<String> tooltip, IWailaDataAccessor accessor, IWailaConfigHandler config) { | ||
TileEntity tileEntity = accessor.getTileEntity(); | ||
if (tileEntity instanceof TileEntitySemiManualBase) { | ||
TileEntitySemiManualBase baseTE = (TileEntitySemiManualBase) tileEntity; | ||
tooltip.add(I18n.format("hwyla.power_consumed", (int)baseTE.getTopTEntity().getPower()+".0 R")); | ||
} | ||
else if (tileEntity instanceof TileEntitySemiManualTopBase) { | ||
TileEntitySemiManualTopBase topTe = (TileEntitySemiManualTopBase) tileEntity; | ||
tooltip.add(I18n.format("hwyla.power_consumed", (int)topTe.getPower()+".0 R")); | ||
} | ||
return tooltip; | ||
} | ||
} |
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
4 changes: 0 additions & 4 deletions
4
...azingzoroark/prift/compat/mysticalmechanics/tileentities/TileEntitySemiManualPresser.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
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
Oops, something went wrong.