Frequency Transmitter works now
This commit is contained in:
parent
37dc52d6df
commit
f746df428b
2 changed files with 69 additions and 9 deletions
|
@ -12,6 +12,8 @@ public class ConfigTechReborn
|
|||
public static String CATEGORY_UU = "uu";
|
||||
public static String CATEGORY_EMC = "emc";
|
||||
public static String CATEGORY_INTEGRATION = "Integration";
|
||||
public static String CATEGORY_FEATURES = "Features";
|
||||
|
||||
public static double FortuneSecondaryOreMultiplierPerLevel;
|
||||
public static boolean RubberSaplingLoot;
|
||||
public static boolean TinIngotsLoot;
|
||||
|
@ -77,6 +79,9 @@ public class ConfigTechReborn
|
|||
public static int CloakingDeviceTier;
|
||||
public static int CentrifugeTier;
|
||||
public static int ThermalGeneratorTier;
|
||||
|
||||
public static boolean FreqTransmitterChat;
|
||||
public static boolean FreqTransmitterTooltip;
|
||||
// EU/T
|
||||
public static int CloakingDeviceEUTick;
|
||||
// Crafting
|
||||
|
@ -356,6 +361,15 @@ public class ConfigTechReborn
|
|||
ThermalGeneratorTier = config
|
||||
.get(CATEGORY_POWER, "ThermalGenerator Tier", 1, "Set the Tier of the ThermalGenerator").getInt();
|
||||
|
||||
//Features
|
||||
FreqTransmitterChat = config
|
||||
.get(CATEGORY_FEATURES, "Frequency Transmitter Chat messages", true, "Allow Frequency Transmitter chat messages")
|
||||
.getBoolean(true);
|
||||
|
||||
FreqTransmitterTooltip = config
|
||||
.get(CATEGORY_FEATURES, "Frequency Transmitter tooltips", true, "Allow Frequency Transmitter to display tooltip info")
|
||||
.getBoolean(true);
|
||||
|
||||
// Crafting
|
||||
ExpensiveMacerator = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Macerator", true, "Allow TechReborn to change the Macerator recipe")
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
package techreborn.items;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import reborncore.RebornCore;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemFrequencyTransmitter extends ItemTextureBase implements ITexturedItem
|
||||
{
|
||||
|
@ -20,21 +28,59 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
|
|||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player,
|
||||
EnumHand hand)
|
||||
@Override public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos,
|
||||
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return new ActionResult<>(EnumActionResult.SUCCESS, itemStack);
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
stack.getTagCompound().setInteger("x", pos.getX());
|
||||
stack.getTagCompound().setInteger("y", pos.getY());
|
||||
stack.getTagCompound().setInteger("z", pos.getZ());
|
||||
stack.getTagCompound().setInteger("dim", world.provider.getDimension());
|
||||
|
||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat)
|
||||
{
|
||||
player.addChatMessage(new TextComponentString(
|
||||
ChatFormatting.GRAY + "Set to X: " +
|
||||
ChatFormatting.GOLD + pos.getX() +
|
||||
ChatFormatting.GRAY + " Y: " +
|
||||
ChatFormatting.GOLD + pos.getY() +
|
||||
ChatFormatting.GRAY + " Z: " +
|
||||
ChatFormatting.GOLD + pos.getZ() +
|
||||
ChatFormatting.GRAY + " in " +
|
||||
ChatFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()).getName() + " ("+world.provider.getDimension()+")"));
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta()
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if(ConfigTechReborn.FreqTransmitterTooltip)
|
||||
{
|
||||
if (stack.getTagCompound() != null)
|
||||
{
|
||||
int x = stack.getTagCompound().getInteger("x");
|
||||
int y = stack.getTagCompound().getInteger("y");
|
||||
int z = stack.getTagCompound().getInteger("z");
|
||||
int dim = stack.getTagCompound().getInteger("dim");
|
||||
|
||||
list.add("X: " + x);
|
||||
list.add("Y: " + y);
|
||||
list.add("X: " + z);
|
||||
list.add(ChatFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
|
||||
} else
|
||||
{
|
||||
list.add(ChatFormatting.GRAY + "No Coordinates Set");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public int getMaxMeta()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int arg0)
|
||||
@Override public String getTextureName(int arg0)
|
||||
{
|
||||
return "techreborn:items/misc/frequency_transmitter";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue