Skip to content

Commit

Permalink
Mostly reformatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkevilmac committed Sep 23, 2016
1 parent ffc7546 commit 319a29a
Show file tree
Hide file tree
Showing 40 changed files with 117 additions and 160 deletions.
2 changes: 1 addition & 1 deletion MovingWorld
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ListMultimap;
import io.github.elytra.davincisvessels.client.ClientProxy;
import io.github.elytra.davincisvessels.common.DavincisVesselsConfig;
import io.github.elytra.davincisvessels.common.CommonProxy;
import io.github.elytra.davincisvessels.common.DavincisVesselsConfig;
import io.github.elytra.davincisvessels.common.command.*;
import io.github.elytra.davincisvessels.common.entity.EntityParachute;
import io.github.elytra.davincisvessels.common.entity.EntitySeat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.github.elytra.davincisvessels.common.object.DavincisVesselsObjects;
import io.github.elytra.davincisvessels.common.tileentity.TileEntityGauge;
import io.github.elytra.davincisvessels.common.tileentity.TileEntityHelm;
import io.github.elytra.movingworld.client.render.RenderMovingWorld;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemModelMesher;
Expand All @@ -31,8 +32,6 @@

import java.util.ArrayList;

import io.github.elytra.movingworld.client.render.RenderMovingWorld;

public class ClientProxy extends CommonProxy {

public ShipKeyHandler shipKeyHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package io.github.elytra.davincisvessels.client.control;

import net.minecraft.entity.player.EntityPlayer;

import io.github.elytra.davincisvessels.common.control.ShipControllerCommon;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.network.DavincisVesselsNetworking;
import net.minecraft.entity.player.EntityPlayer;

public class ShipControllerClient extends ShipControllerCommon {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.elytra.davincisvessels.client.gui;

import io.github.elytra.davincisvessels.common.tileentity.TileEntityEngine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
Expand All @@ -8,8 +9,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace;

import io.github.elytra.davincisvessels.common.tileentity.TileEntityEngine;

public class ContainerEngine extends Container {
public final TileEntityEngine tileEntity;
public final EntityPlayer player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.github.elytra.davincisvessels.client.gui;

import io.github.elytra.davincisvessels.common.entity.EntitySeat;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

import io.github.elytra.davincisvessels.common.entity.EntityShip;

public class ContainerShip extends Container {
public final EntityShip ship;
public final EntityPlayer player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.elytra.davincisvessels.client.gui;

import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.tileentity.TileEntityAnchorPoint;
import io.github.elytra.davincisvessels.common.tileentity.TileEntityEngine;
import io.github.elytra.davincisvessels.common.tileentity.TileEntityHelm;
Expand All @@ -9,8 +10,6 @@
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

import io.github.elytra.davincisvessels.common.entity.EntityShip;

public class DavincisVesselsGuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
public class GuiAnchorPoint extends GuiContainer {

public static final ResourceLocation GUI_TEXTURES = new ResourceLocation("davincisvessels", "textures/gui/anchorPoint.png");

public TileEntityAnchorPoint anchorPoint;
private int selectedRelation;
private String[] relations;
private GuiButton btnLink, btnSwitch, btnNextRelation, btnPrevRelation;
public TileEntityAnchorPoint anchorPoint;

public GuiAnchorPoint(TileEntityAnchorPoint te, EntityPlayer entityplayer) {
super(new ContainerAnchorPoint(te, entityplayer));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
package io.github.elytra.davincisvessels.client.gui;

import io.github.elytra.davincisvessels.DavincisVesselsMod;
import io.github.elytra.davincisvessels.common.LanguageEntries;
import io.github.elytra.davincisvessels.common.entity.ShipAssemblyInteractor;
import io.github.elytra.davincisvessels.common.network.DavincisVesselsNetworking;
import io.github.elytra.davincisvessels.common.network.HelmClientAction;
import io.github.elytra.davincisvessels.common.tileentity.TileEntityHelm;
import io.github.elytra.movingworld.common.chunk.assembly.AssembleResult;
import io.github.elytra.movingworld.common.chunk.assembly.AssembleResult.ResultType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import java.io.IOException;
import java.util.Locale;

import io.github.elytra.davincisvessels.common.LanguageEntries;
import io.github.elytra.davincisvessels.common.network.DavincisVesselsNetworking;
import io.github.elytra.movingworld.common.chunk.assembly.AssembleResult;
import io.github.elytra.movingworld.common.chunk.assembly.AssembleResult.ResultType;

import static io.github.elytra.movingworld.common.chunk.assembly.AssembleResult.ResultType.RESULT_BUSY_COMPILING;
import static io.github.elytra.movingworld.common.chunk.assembly.AssembleResult.ResultType.RESULT_NONE;
import static io.github.elytra.movingworld.common.chunk.assembly.AssembleResult.ResultType.RESULT_OK;
import static io.github.elytra.movingworld.common.chunk.assembly.AssembleResult.ResultType.*;

public class GuiHelm extends GuiContainer {
public static final ResourceLocation BACKGROUND_TEXTURE = new ResourceLocation("davincisvessels", "textures/gui/shipstatus.png");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package io.github.elytra.davincisvessels.client.gui;

import com.google.common.collect.Lists;

import io.github.elytra.davincisvessels.common.LanguageEntries;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.network.DavincisVesselsNetworking;
import io.github.elytra.movingworld.common.network.MovingWorldClientAction;
import io.github.elytra.movingworld.common.network.MovingWorldNetworking;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
Expand All @@ -11,18 +15,11 @@
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import java.util.Iterator;
import java.util.List;

import io.github.elytra.davincisvessels.common.LanguageEntries;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.network.DavincisVesselsNetworking;
import io.github.elytra.movingworld.common.network.MovingWorldClientAction;
import io.github.elytra.movingworld.common.network.MovingWorldNetworking;

public class GuiShip extends GuiContainer {
public static final ResourceLocation BACKGROUND_TEXTURE = new ResourceLocation("davincisvessels", "textures/gui/shipinv.png");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package io.github.elytra.davincisvessels.client.handler;

import io.github.elytra.davincisvessels.DavincisVesselsMod;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.handler.CommonHookContainer;
import io.github.elytra.movingworld.common.network.MovingWorldNetworking;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import io.github.elytra.davincisvessels.DavincisVesselsMod;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.handler.CommonHookContainer;
import io.github.elytra.movingworld.common.network.MovingWorldNetworking;

@SideOnly(Side.CLIENT)
public class ClientHookContainer extends CommonHookContainer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
public class ModelHelmWheel {

public static ReloadListener reloadListener;
public static IBakedModel helmModel;
Function<ResourceLocation, TextureAtlasSprite> textureGetter = location ->
Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
public static IBakedModel helmModel;

public ModelHelmWheel() {
if (helmModel == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

//TODO: possible rewrite?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;

import org.lwjgl.opengl.GL11;

public class TileEntityGaugeRenderer extends TileEntitySpecialRenderer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.github.elytra.davincisvessels.common;

import io.github.elytra.davincisvessels.DavincisVesselsMod;
import io.github.elytra.davincisvessels.client.gui.DavincisVesselsGuiHandler;
import io.github.elytra.davincisvessels.common.handler.CommonHookContainer;
import io.github.elytra.davincisvessels.common.handler.CommonPlayerTicker;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.LoaderState;
import net.minecraftforge.fml.common.network.NetworkRegistry;

import io.github.elytra.davincisvessels.DavincisVesselsMod;
import io.github.elytra.davincisvessels.client.gui.DavincisVesselsGuiHandler;
import io.github.elytra.davincisvessels.common.handler.CommonHookContainer;

public class CommonProxy {
public CommonPlayerTicker playerTicker;
public CommonHookContainer hookContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public DavincisVesselsConfig(Configuration configuration) {
public void loadAndSave() {
config.load();

shared.shipEntitySyncRate = config.get("settings", "sync_rate", 20, "The amount of ticks between a server-client synchronization. Higher numbers reduce network traffic. Lower numbers increase multiplayer experience. 20 ticks = 1 second").getInt();
shared.shipEntitySyncRate = config.get("settings", "sync_rate", 5, "The amount of ticks between a server-client synchronization. Higher numbers reduce network traffic. Lower numbers increase multiplayer experience. 20 ticks = 1 second").getInt();
shared.enableAirShips = config.get("settings", "enable_air_ships", true, "Enable or disable air ships.").getBoolean(true);
shared.enableSubmersibles = config.get("settings", "enable_submersibles", true, "Enable or disable the ability to submerse ships.").getBoolean(true);
shared.bankingMultiplier = (float) config.get("settings", "banking_multiplier", 3d, "A multiplier for how much ships bank while making turns. Set a positive value for passive banking or a negative value for active banking. 0 disables banking.").getDouble(3d);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.elytra.davincisvessels.common.command;

import com.mojang.realmsclient.gui.ChatFormatting;

import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.elytra.davincisvessels.common.command;

import io.github.elytra.davincisvessels.common.entity.EntityShip;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
Expand All @@ -8,8 +9,6 @@
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.TextComponentString;

import io.github.elytra.davincisvessels.common.entity.EntityShip;


public class CommandASTP extends CommandBase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.elytra.davincisvessels.common.command;

import io.github.elytra.davincisvessels.common.entity.EntityShip;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
Expand All @@ -8,8 +9,6 @@
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;

import io.github.elytra.davincisvessels.common.entity.EntityShip;

public class CommandDisassembleNear extends CommandBase {
@Override
public String getCommandName() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.github.elytra.davincisvessels.common.command;

import io.github.elytra.davincisvessels.common.entity.EntityShip;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;

import io.github.elytra.davincisvessels.common.entity.EntityShip;

public class CommandDisassembleShip extends CommandBase {
@Override
public String getCommandName() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.github.elytra.davincisvessels.common.command;

import com.mojang.realmsclient.gui.ChatFormatting;

import io.github.elytra.davincisvessels.common.entity.EntitySeat;
import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.entity.ShipCapabilities;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
Expand All @@ -12,9 +13,6 @@

import java.util.Locale;

import io.github.elytra.davincisvessels.common.entity.EntityShip;
import io.github.elytra.davincisvessels.common.entity.ShipCapabilities;

public class CommandShipInfo extends CommandBase {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package io.github.elytra.davincisvessels.common.entity;

import io.github.elytra.movingworld.common.util.Vec3dMod;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;

import io.github.elytra.movingworld.common.util.Vec3dMod;
import io.netty.buffer.ByteBuf;

public class EntityParachute extends Entity implements IEntityAdditionalSpawnData {

public EntityParachute(World world) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.elytra.davincisvessels.common.entity;

import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
Expand All @@ -13,8 +14,6 @@
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;

import io.netty.buffer.ByteBuf;

public class EntitySeat extends Entity implements IEntityAdditionalSpawnData {

public static final DataParameter<Integer> SHIPID = EntityDataManager.<Integer>createKey(EntitySeat.class, DataSerializers.VARINT);
Expand All @@ -37,17 +36,13 @@ public EntitySeat(World world) {

/**
* Called from ShipCapabilities.
*
* @ShipCapabilities
*/
@Override
public boolean processInitialInteract(EntityPlayer entityplayer, ItemStack stack, EnumHand hand) {
checkShipOpinion();

if (getControllingPassenger() == null) {
entityplayer.startRiding(null);
entityplayer.setSneaking(false);
entityplayer.startRiding(this);
entityplayer.startRiding(this, true);
return true;
} else {
return false;
Expand Down Expand Up @@ -165,7 +160,6 @@ public void onUpdate() {

if (getControllingPassenger() != null && getControllingPassenger().getRidingEntity() != this) {
Entity rider = getControllingPassenger();
rider.startRiding(null);
rider.startRiding(this);
}
}
Expand All @@ -181,7 +175,10 @@ protected void entityInit() {
@Override
public void updatePassenger(Entity passenger) {
if (ship != null) {
ship.updatePassengerPosition(getControllingPassenger(), new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1), 1);
ship.updatePassengerPosition(passenger, new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1), 1);

if (worldObj.getWorldTime() % 20 == 0)
System.out.println(passenger);
}
}

Expand Down
Loading

0 comments on commit 319a29a

Please sign in to comment.