Skip to content

Commit

Permalink
TNT provider
Browse files Browse the repository at this point in the history
  • Loading branch information
strubium committed Feb 18, 2024
1 parent b2e9b8b commit 68da8c7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ modname=TheOneProbe
version=1.12-1.4.28
curse_type=release
projectId=245211
github_project=McJtyMods/TheOneProbe
github_project=strubium/TheOneSmeagle


minecraft_version=1.12.2
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mcjty.theoneprobe.apiimpl.providers;

import mcjty.theoneprobe.api.*;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.StringUtils;
import net.minecraft.world.World;
import mcjty.theoneprobe.Utilities;

public class TNTInfoProvider implements IProbeInfoEntityProvider {

@Override
public String getID() {
return Utilities.getProviderId("tnt");
}

@Override
public void addProbeEntityInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, Entity entity, IProbeHitEntityData data) {
if (entity instanceof EntityTNTPrimed) {
probeInfo.text(TextStyleClass.LABEL + "{*theoneprobe.probe.tnt_fuse*} " + TextStyleClass.WARNING + StringUtils.ticksToElapsedTime(((EntityTNTPrimed) entity).getFuse()));
}
}
}
1 change: 1 addition & 0 deletions src/main/java/mcjty/theoneprobe/setup/ModSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void preInit(FMLPreInitializationEvent e) {
TheOneProbe.theOneProbeImp.registerEntityProvider(new EntityProbeInfoEntityProvider());
TheOneProbe.theOneProbeImp.registerEntityProvider(new ChestHorseInfoProvider());
TheOneProbe.theOneProbeImp.registerEntityProvider(new MinecartInfoProvider());
TheOneProbe.theOneProbeImp.registerEntityProvider(new TNTInfoProvider());

modConfigDir = e.getModConfigurationDirectory();
ConfigSetup.init();
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/theoneprobe/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ item.theoneprobe.iron_helmet_probe.name=Iron Helmet with Probe
item.theoneprobe.creativeprobe.name=The Creative Probe
item.theoneprobe.probenote.name=The One Probe Read Me
theoneprobe.probe.enchanting_power=Enchanting Power
theoneprobe.probe.tnt_fuse=TNT Fuse

itemGroup.Probe=The One Probe

0 comments on commit 68da8c7

Please sign in to comment.