Skip to content

Commit

Permalink
Merge branch 'release/0.4.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
praecipitator committed Jun 23, 2017
2 parents ffcdaf1 + 07a55a3 commit 2f956bc
Show file tree
Hide file tree
Showing 31 changed files with 748 additions and 224 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ apply plugin: 'forge'



version = "0.4.7"
version = "0.4.8"
group = "de.katzenpapst.amunra" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "AmunRa-GC"
def gc_version = "3.0.12.498"
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
=== 0.4.8 ===
- shuttle saves dock position
- improved shuttle dismounting
- potentially fixed a crash with servers like Thermos or KCauldron
- made the mehen belt slightly brighter
- permissions for mothership landing and control are now separate

=== 0.4.7 ===
- minimal GC version is build 498
- made the Artificial Gravity Generator work using the new events
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/katzenpapst/amunra/AmunRa.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class AmunRa
{
public static final String MODID = "GalacticraftAmunRa";
public static final String MODNAME = "Amun-Ra";
public static final String VERSION = "0.4.7";
public static final String VERSION = "0.4.8";

public static ARChannelHandler packetPipeline;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer
{
if(world.provider instanceof MothershipWorldProvider) {

if( ((MothershipWorldProvider)world.provider).isPlayerOwner(entityPlayer) ) {
if( ((MothershipWorldProvider)world.provider).isPlayerUsagePermitted(entityPlayer) ) {
openGui(world, x, y, z, entityPlayer);

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import cpw.mods.fml.relauncher.SideOnly;
import de.katzenpapst.amunra.AmunRa;
import de.katzenpapst.amunra.GuiIds;
import de.katzenpapst.amunra.block.SubBlockMachine;
import de.katzenpapst.amunra.block.machine.AbstractBlockMothershipRestricted;
import de.katzenpapst.amunra.vec.Vector3int;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;
import de.katzenpapst.amunra.tile.TileEntityMothershipEngineAbstract;
Expand All @@ -17,7 +17,7 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

public class MothershipEngineBoosterBase extends SubBlockMachine {
public class MothershipEngineBoosterBase extends AbstractBlockMothershipRestricted {

protected String activeTextureName;
protected IIcon activeBlockIcon;
Expand All @@ -42,16 +42,28 @@ public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer
TileEntityMothershipEngineBooster tile = (TileEntityMothershipEngineBooster)leTile;

if(tile.hasMaster()) {
return super.onMachineActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ);
}
return false;
}



@Override
protected void openGui(World world, int x, int y, int z, EntityPlayer entityPlayer) {
// try this
if(world.isRemote) {
return;
}
TileEntity leTile = world.getTileEntity(x, y, z);
if(leTile != null) {
TileEntityMothershipEngineBooster tile = (TileEntityMothershipEngineBooster)leTile;
Vector3int pos = tile.getMasterPosition();

entityPlayer.openGui(AmunRa.instance, GuiIds.GUI_MS_ROCKET_ENGINE, world, pos.x, pos.y, pos.z);
return true;
}
return false;
}



@Override
public boolean hasTileEntity(int metadata) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cpw.mods.fml.relauncher.SideOnly;
import de.katzenpapst.amunra.AmunRa;
import de.katzenpapst.amunra.GuiIds;
import de.katzenpapst.amunra.block.SubBlockMachine;
import de.katzenpapst.amunra.block.machine.AbstractBlockMothershipRestricted;
import de.katzenpapst.amunra.item.ItemDamagePair;
import de.katzenpapst.amunra.tile.TileEntityMothershipEngineAbstract;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;
Expand All @@ -18,7 +18,7 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

public abstract class MothershipEngineJetBase extends SubBlockMachine {
public abstract class MothershipEngineJetBase extends AbstractBlockMothershipRestricted {

protected String iconTexture;

Expand Down Expand Up @@ -109,13 +109,10 @@ public boolean renderAsNormalBlock()
return false;
}


@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
// do the isRemote thing here, too?
protected void openGui(World world, int x, int y, int z, EntityPlayer entityPlayer) {
entityPlayer.openGui(AmunRa.instance, GuiIds.GUI_MS_ROCKET_ENGINE, world, x, y, z);
return true;
// return false;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public int addTab(AbstractTab tab)
final int guiY = (this.height - this.ySize) / 2;

// add button
TabButton test = new TabButton(TAB_BTN_OFFSET+newIndex, guiX-27, guiY+6 + newIndex*28, tab.getTooltip(), tab.getIcon());
TabButton test = new TabButton(TAB_BTN_OFFSET+newIndex, guiX-27, guiY+6 + newIndex*28, tab.getTooltip(), tab.getTooltipDescription(), tab.getIcon());
this.buttonList.add(test);
this.tabButtons.add(test);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import de.katzenpapst.amunra.AmunRa;
import de.katzenpapst.amunra.client.gui.tabs.AbstractTab;
import de.katzenpapst.amunra.client.gui.tabs.TabMothershipCustom;
import de.katzenpapst.amunra.client.gui.tabs.TabMothershipPermission;
import de.katzenpapst.amunra.client.gui.tabs.TabMothershipLanding;
import de.katzenpapst.amunra.client.gui.tabs.TabMothershipUsage;
import de.katzenpapst.amunra.inventory.ContainerMothershipSettings;
import de.katzenpapst.amunra.mothership.Mothership;
import de.katzenpapst.amunra.network.packet.PacketSimpleAR;
Expand All @@ -30,8 +31,6 @@ public interface IMothershipSettingsTab {
private final TileEntityMothershipSettings tile;
private Mothership ship;

private int customizeTabIndex;

protected List<ResourceLocation> mothershipTextures;

public GuiMothershipSettings(InventoryPlayer par1InventoryPlayer, TileEntityMothershipSettings tile) {
Expand Down Expand Up @@ -83,8 +82,9 @@ public void initGui()
{
super.initGui();

customizeTabIndex = this.addTab(new TabMothershipCustom(tile, this, mc, width, height, xSize, ySize));
this.addTab(new TabMothershipPermission(tile, this, mc, width, height, xSize, ySize));
this.addTab(new TabMothershipCustom(tile, this, mc, width, height, xSize, ySize));
this.addTab(new TabMothershipLanding(tile, this, mc, width, height, xSize, ySize));
this.addTab(new TabMothershipUsage(tile, this, mc, width, height, xSize, ySize));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,18 +357,6 @@ protected boolean teleportToSelectedBody()
}
else
{
if(this.selectedBody instanceof Mothership) {
// check if user is allowed
Mothership curMS = (Mothership)this.selectedBody;
// even if the player is not permitted, he will be still allowed to return
int playerDim = mc.thePlayer.worldObj.provider.dimensionId;
if(curMS.getDimensionID() != playerDim && !((Mothership)this.selectedBody).isPlayerPermitted(this.mc.thePlayer)) {
this.showMessageBox(
GCCoreUtil.translate("gui.message.mothership.permissionError"),
GCCoreUtil.translateWithFormat("gui.message.mothership.notAllowed", curMS.getOwner().getName()));
return false;
}
}
dimensionID = this.selectedBody.getDimensionID();
}
/*
Expand All @@ -381,8 +369,6 @@ protected boolean teleportToSelectedBody()
}
*/
AmunRa.packetPipeline.sendToServer(new PacketSimpleAR(PacketSimpleAR.EnumSimplePacket.S_TELEPORT_SHUTTLE, new Object[] { dimensionID }));
//TODO Some type of clientside "in Space" holding screen here while waiting for the server to do the teleport
//(Otherwise the client will be returned to the destination he was in until now, which looks weird)
mc.displayGuiScreen(null);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package de.katzenpapst.amunra.client.gui.elements;

import java.util.List;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import cpw.mods.fml.client.FMLClientHandler;
import de.katzenpapst.amunra.AmunRa;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
Expand All @@ -20,6 +23,8 @@ public class TabButton extends GuiButton {

protected final ResourceLocation texture;

protected String extraInfo = null;

public TabButton(int id, int xPos, int yPos, String displayString, ResourceLocation texture) {
super(id, xPos, yPos, displayString);

Expand All @@ -28,6 +33,12 @@ public TabButton(int id, int xPos, int yPos, String displayString, ResourceLocat
this.texture = texture;
}

public TabButton(int id, int xPos, int yPos, String displayString, String infoString, ResourceLocation texture) {
this(id, xPos, yPos, displayString, texture);

extraInfo = infoString;
}

/**
* Draws this button to the screen.
*/
Expand Down Expand Up @@ -106,44 +117,26 @@ public void drawTooltip(int mouseX, int mouseY)
GL11.glDisable(GL11.GL_DEPTH_TEST);

boolean withinRegion = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;

List<String> extraStrings = null;


if (this.displayString != null && !this.displayString.isEmpty() && withinRegion)
{
FontRenderer fontRenderer = FMLClientHandler.instance().getClient().fontRenderer;
int stringWidth = FMLClientHandler.instance().getClient().fontRenderer.getStringWidth(displayString);
/*Iterator<String> iterator = this.tooltipStrings.iterator();

while (iterator.hasNext())
{
String s = iterator.next();
int l = FMLClientHandler.instance().getClient().fontRenderer.getStringWidth(s);

if (l > k)
{
k = l;
}
}*/

int tooltipX = mouseX + 12;
int tooltipY = mouseY - 12;
int stringHeight = 8;
/*
if (this.tooltipStrings.size() > 1)
{
k1 += (this.tooltipStrings.size() - 1) * 10;
}

if (i1 + k > this.parentWidth)
{
i1 -= 28 + k;
if(this.extraInfo != null) {
stringWidth = Math.max(stringWidth, 150);
extraStrings = fontRenderer.listFormattedStringToWidth(extraInfo, stringWidth);
stringHeight += extraStrings.size() * 10;
}

if (this.parentGui.getTooltipOffset(par2, par3) > 0)
{
j1 -= k1 + 9;
}
*/
this.zLevel = 300.0F;
//GuiElementInfoRegion.itemRenderer.zLevel = 300.0F;
int colorSomething = -267386864;
Expand All @@ -159,7 +152,18 @@ public void drawTooltip(int mouseX, int mouseY)
this.drawGradientRect(tooltipX - 3, tooltipY - 3, tooltipX + stringWidth + 3, tooltipY - 3 + 1, otherColorSomething, otherColorSomething);
this.drawGradientRect(tooltipX - 3, tooltipY + stringHeight + 2, tooltipX + stringWidth + 3, tooltipY + stringHeight + 3, j2, j2);

FMLClientHandler.instance().getClient().fontRenderer.drawStringWithShadow(displayString, tooltipX, tooltipY, -1);
fontRenderer.drawStringWithShadow(displayString, tooltipX, tooltipY, -1);

//EnumColor.RED


if(extraStrings != null) {
for(int i=0;i<extraStrings.size();i++) {
fontRenderer.drawStringWithShadow(extraStrings.get(i), tooltipX, tooltipY+(i+1)*10, 0x7777FF);
}
}



this.zLevel = 0.0F;
//GuiElementInfoRegion.itemRenderer.zLevel = 0.0F;
Expand Down
Loading

0 comments on commit 2f956bc

Please sign in to comment.