Added data terminal which serves as an in-game guide.

master
Droog71 2020-10-21 20:53:02 -04:00
parent 03777a3489
commit 0901a295cd
27 changed files with 197 additions and 5 deletions

View File

@ -26,7 +26,7 @@ public class Prospect
{
public static final String MODID = "prospect";
public static final String NAME = "Prospect";
public static final String VERSION = "1.0.4";
public static final String VERSION = "1.0.5";
@Instance
public static Prospect instance;

View File

@ -29,8 +29,9 @@ public enum FMLEventHandler
persistent = data.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
}
if (!persistent.hasKey(NBT_KEY)) //If this is the first time onPlayerJoin is called for this player, equip armor and spore filter.
{
if (!hasArmor(event.player))
{
event.player.inventory.addItemStackToInventory(new ItemStack(ProspectItems.data_terminal));
if (!hasArmor(event.player))
{
event.player.inventory.addItemStackToInventory(new ItemStack(ProspectItems.filter));
event.player.inventory.setInventorySlotContents(36, new ItemStack(ProspectItems.boots));

View File

@ -0,0 +1,98 @@
package com.droog71.prospect.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class DataTerminalGUI extends GuiScreen
{
private int index;
private float zoom = 1;
private static final ResourceLocation[] pages =
{
new ResourceLocation("prospect:textures/gui/data_terminal_intro_1.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_intro_2.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_spores_1.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_spores_2.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_spores_3.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_igc_1.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_igc_2.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_igc_3.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_machines.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_schematics.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_solar.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_zero_point_reactor.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_transformers.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_conduits.png"),
new ResourceLocation("prospect:textures/gui/data_terminal_conveyor_tubes.png")
};
public DataTerminalGUI()
{
}
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
drawImage();
super.drawScreen(mouseX, mouseY, partialTicks);
}
public void initGui()
{
super.initGui();
this.buttonList.add(new GuiButton(0, width - 200, (int)(height * 0.75f), "Zoom"));
this.buttonList.add(new GuiButton(1, width - 200, (int)(height * 0.8f), "Next"));
this.buttonList.add(new GuiButton(2, width - 200, (int)(height * 0.85f), "Previous"));
this.buttonList.add(new GuiButton(3, width - 200, (int)(height * 0.9f), "Close"));
}
public void drawImage()
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(pages[index]);
int size = (int) (height * zoom);
int offset = (int) ((zoom - 1) * height);
int height_offset = zoom == 1 ? 0 : (int) ((offset / 2) * -1);
drawModalRectWithCustomSizedTexture((size / 2) - (size / 2), height_offset, 0, 0, size, size, size, size);
}
protected void actionPerformed(GuiButton button)
{
if (button.id == 0)
{
zoom = zoom < 2 ? zoom + 0.25f : 1;
}
else if (button.id == 1)
{
if (index < pages.length - 1)
{
index++;
}
else
{
index = 0;
}
}
else if (button.id == 2)
{
if (index > 0)
{
index--;
}
else
{
index = pages.length - 1;
}
}
else
{
this.mc.displayGuiScreen((GuiScreen)null);
}
}
}

View File

@ -97,6 +97,10 @@ public class ProspectGuiHandler implements IGuiHandler
{
return new ConveyorTubeGUI(player.inventory, (ConveyorTileEntity)world.getTileEntity(new BlockPos(x,y,z)));
}
if (ID == 9)
{
return new DataTerminalGUI();
}
return null;
}

View File

@ -2,6 +2,7 @@ package com.droog71.prospect.init;
import com.droog71.prospect.Prospect;
import com.droog71.prospect.armor.ProspectArmor;
import com.droog71.prospect.items.DataTerminal;
import com.droog71.prospect.items.ProspectItem;
import com.droog71.prospect.items.Schematic;
import com.droog71.prospect.items.SporeFilter;
@ -16,6 +17,9 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod.EventBusSubscriber(modid=Prospect.MODID)
public class ProspectItems
{
//Book
public static Item data_terminal;
// Armor
public static Item helmet;
public static Item suit;
@ -115,6 +119,9 @@ public class ProspectItems
public static void init()
{
//Book
data_terminal = new DataTerminal("data_terminal").setCreativeTab(Prospect.tabProspect).setMaxStackSize(1);
// Armor
helmet = new ProspectArmor("helmet",Prospect.tabProspect,ProspectArmor.PROSPECTOR_ARMOR, 0, EntityEquipmentSlot.HEAD);
suit = new ProspectArmor("suit",Prospect.tabProspect,ProspectArmor.PROSPECTOR_ARMOR, 0, EntityEquipmentSlot.CHEST);
@ -216,6 +223,9 @@ public class ProspectItems
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event)
{
//Book
event.getRegistry().registerAll(data_terminal);
// Armor
event.getRegistry().registerAll(helmet);
event.getRegistry().registerAll(suit);
@ -317,6 +327,9 @@ public class ProspectItems
@SubscribeEvent
public static void registerRenders(ModelRegistryEvent event)
{
// Book
registerRender(data_terminal);
// Armor
registerRender(filter);
registerRender(helmet);

View File

@ -0,0 +1,32 @@
package com.droog71.prospect.items;
import com.droog71.prospect.Prospect;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
public class DataTerminal extends ProspectItem
{
public DataTerminal(String name)
{
super(name);
}
@Override
public EnumAction getItemUseAction(ItemStack stack)
{
return EnumAction.NONE;
}
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
{
ItemStack itemstack = playerIn.getHeldItem(handIn);
playerIn.openGui(Prospect.instance, 9, worldIn, (int)playerIn.posX, (int)playerIn.posY, (int)playerIn.posZ);
return new ActionResult<ItemStack>(EnumActionResult.PASS, itemstack);
}
}

View File

@ -32,7 +32,7 @@ public class SporeFilter extends ProspectItem
}
@Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
{
if(itemSlot < 9) //Spore filters must be placed in the hotbar when in use.
{

View File

@ -1,3 +1,4 @@
item.data_terminal.name=Data Terminal
item.gem.name=Gem
item.credit.name=IGC
item.circuit.name=Circuit

View File

@ -0,0 +1,19 @@
{
"parent": "item/generated",
"textures": {
"layer0": "prospect:items/data_terminal"
},
"display": {
"thirdperson": {
"rotation": [-90,0,0],
"translation": [0,1,-3],
"scale": [0.55,0.55,0.55]
},
"firstperson": {
"rotation": [0,-135,25],
"translation": [0,4,2],
"scale": [1.7,1.7,1.7]
}
}
}

View File

@ -0,0 +1,24 @@
{
"type": "forge:ore_shaped",
"pattern": [
"AAA",
"CGC",
"ACA" ],
"key": {
"A": {
"item": "prospect:aluminum_plate"
},
"G": {
"item": "minecraft:glass"
},
"C": {
"item": "prospect:circuit"
}
},
"result": {
"item": "prospect:data_terminal",
"data": 0
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -3,7 +3,7 @@
"modid": "prospect",
"name": "Prospect",
"description": "Prospect Mod",
"version": "1.0.4",
"version": "1.0.5",
"mcversion": "1.12.2",
"url": "",
"updateUrl": "",