Skip to content

Commit cccf801

Browse files
Fix multiple bugs and revamp asteroid defaults
- Fixed bug with rendering layers for rocket assembly - Removed LockUI feature because our hook no longer properly exists - Fixed some space elevator weirdness - Added new types of asteroids and generally made asteroids a little more appealing
1 parent 1c6c5f1 commit cccf801

File tree

7 files changed

+46
-113
lines changed

7 files changed

+46
-113
lines changed

src/main/java/zmaster587/advancedRocketry/AdvancedRocketry.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,15 +1139,25 @@ public void serverStarting(FMLServerStartingEvent event) {
11391139
file.createNewFile();
11401140
BufferedWriter stream;
11411141
stream = new BufferedWriter(new FileWriter(file));
1142-
stream.write("<Asteroids>\n\t<asteroid name=\"Small Asteroid\" distance=\"10\" mass=\"100\" massVariability=\"0.5\" minLevel=\"0\" probability=\"10\" richness=\"0.2\" richnessVariability=\"0.5\">"
1142+
stream.write("<Asteroids>"
1143+
+ "\n\t<asteroid name=\"Small Asteroid\" distance=\"10\" mass=\"200\" massVariability=\"0.5\" minLevel=\"0\" probability=\"20\" richness=\"0.3\" richnessVariability=\"0.5\">"
11431144
+ "\n\t\t<ore itemStack=\"minecraft:iron_ore\" chance=\"15\" />"
11441145
+ "\n\t\t<ore itemStack=\"minecraft:gold_ore\" chance=\"10\" />"
11451146
+ "\n\t\t<ore itemStack=\"minecraft:redstone_ore\" chance=\"10\" />"
11461147
+ "\n\t</asteroid>"
1147-
+ "\n\t<asteroid name=\"Iridium Enriched asteroid\" distance=\"100\" mass=\"25\" massVariability=\"0.5\" minLevel=\"0\" probability=\"0.75\" richness=\"0.2\" richnessVariability=\"0.3\">"
1148+
+ "\n\t<asteroid name=\"Light Asteroid\" distance=\"60\" mass=\"200\" massVariability=\"0.5\" minLevel=\"0\" probability=\"15\" richness=\"0.2\" richnessVariability=\"0.5\">"
1149+
+ "\n\t\t<ore itemStack=\"libvulpes:ore0;9\" chance=\"20\" />"
1150+
+ "\n\t\t<ore itemStack=\"libvulpes:ore0;8\" chance=\"10\" />"
1151+
+ "\n\t\t<ore itemStack=\"minecraft:quartz_block\" chance=\"5\" />"
1152+
+ "\n\t</asteroid>"
1153+
+ "\n\t<asteroid name=\"Iridium Enriched asteroid\" distance=\"100\" mass=\"75\" massVariability=\"0.5\" minLevel=\"0\" probability=\"2\" richness=\"0.2\" richnessVariability=\"0.3\">"
11481154
+ "\n\t\t<ore itemStack=\"minecraft:iron_ore\" chance=\"25\" />"
11491155
+ "\n\t\t<ore itemStack=\"libvulpes:ore0 10\" chance=\"5\" />"
11501156
+ "\n\t</asteroid>"
1157+
+ "\n\t<asteroid name=\"Strange Asteroid\" distance=\"120\" mass=\"50\" massVariability=\"0.5\" minLevel=\"0\" probability=\"1\" richness=\"0.2\" richnessVariability=\"0.5\">"
1158+
+ "\n\t\t<ore itemStack=\"libvulpes:ore0;0\" chance=\"20\" />"
1159+
+ "\n\t\t<ore itemStack=\"minecraft:emerald_ore\" chance=\"5\" />"
1160+
+ "\n\t</asteroid>"
11511161
+ "\n</Asteroids>");
11521162
stream.close();
11531163
} catch (IOException e) {
@@ -1226,9 +1236,6 @@ public void serverStopped(FMLServerStoppedEvent event) {
12261236
((BlockSeal)AdvancedRocketryBlocks.blockPipeSealer).clearMap();
12271237
DimensionManager.dimOffset = config.getInt("minDimension", "Planet", 2, -127, 8000, "Dimensions including and after this number are allowed to be made into planets");
12281238
zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().spaceDimId = config.get(Configuration.CATEGORY_GENERAL,"spaceStationId" , -2,"Dimension ID to use for space stations").getInt();
1229-
1230-
if(!zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().lockUI)
1231-
proxy.saveUILayout(config);
12321239
}
12331240

12341241
@SubscribeEvent

src/main/java/zmaster587/advancedRocketry/api/ARConfiguration.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,9 +1052,6 @@ public static void loadPostInit()
10521052
@ConfigProperty
10531053
public boolean laserDrillOresBlackList;
10541054

1055-
@ConfigProperty
1056-
public boolean lockUI;
1057-
10581055
@ConfigProperty(needsSync=true, keyType=String.class, valueType= Asteroid.class)
10591056
public HashMap<String, Asteroid> asteroidTypes = new HashMap<>();
10601057

src/main/java/zmaster587/advancedRocketry/client/ClientProxy.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,7 @@ public long getWorldTimeUniversal(int id) {
422422
@Override
423423
public void loadUILayout(Configuration config) {
424424
final String CLIENT = "Client";
425-
426-
zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().lockUI = config.get(CLIENT, "lockUI", true, "If UI is not locked, the middle mouse can be used to drag certain AR UIs around the screen, positions are saved on hitting quit in the menu").getBoolean();
427-
428-
config.addCustomCategoryComment(CLIENT, "UI locations can by set by clicking and dragging the middle mouse button ingame");
425+
429426
RocketEventHandler.suitPanel.setRawX(config.get(CLIENT, "suitPanelX", 8).getInt());
430427
RocketEventHandler.suitPanel.setRawY(config.get(CLIENT, "suitPanelY", 8).getInt());
431428
RocketEventHandler.suitPanel.setSizeModeX(config.get(CLIENT, "suitPanelModeX", -1).getInt());
@@ -447,31 +444,6 @@ public void loadUILayout(Configuration config) {
447444
RocketEventHandler.atmBar.setSizeModeY(config.get(CLIENT, "atmBarModeY", 1).getInt());
448445
}
449446

450-
@Override
451-
public void saveUILayout(Configuration configuration) {
452-
final String CLIENT = "Client";
453-
configuration.get(CLIENT, "suitPanelX", 1).set(RocketEventHandler.suitPanel.getRawX());
454-
configuration.get(CLIENT, "suitPanelY", 1).set(RocketEventHandler.suitPanel.getRawY());
455-
configuration.get(CLIENT, "suitPanelModeX", 1).set(RocketEventHandler.suitPanel.getSizeModeX());
456-
configuration.get(CLIENT, "suitPanelModeY", 1).set(RocketEventHandler.suitPanel.getSizeModeY());
457-
458-
configuration.get(CLIENT, "oxygenBarX", 1).set(RocketEventHandler.oxygenBar.getRawX());
459-
configuration.get(CLIENT, "oxygenBarY", 1).set(RocketEventHandler.oxygenBar.getRawY());
460-
configuration.get(CLIENT, "oxygenBarModeX", 1).set(RocketEventHandler.oxygenBar.getSizeModeX());
461-
configuration.get(CLIENT, "oxygenBarModeY", 1).set(RocketEventHandler.oxygenBar.getSizeModeY());
462-
463-
configuration.get(CLIENT, "hydrogenBarX", 1).set(RocketEventHandler.hydrogenBar.getRawX());
464-
configuration.get(CLIENT, "hydrogenBarY", 1).set(RocketEventHandler.hydrogenBar.getRawY());
465-
configuration.get(CLIENT, "hydrogenBarModeX", 1).set(RocketEventHandler.hydrogenBar.getSizeModeX());
466-
configuration.get(CLIENT, "hydrogenBarModeY", 1).set(RocketEventHandler.hydrogenBar.getSizeModeY());
467-
468-
configuration.get(CLIENT, "atmBarX", 1).set(RocketEventHandler.atmBar.getRawX());
469-
configuration.get(CLIENT, "atmBarY", 1).set(RocketEventHandler.atmBar.getRawY());
470-
configuration.get(CLIENT, "atmBarModeX", 1).set(RocketEventHandler.atmBar.getSizeModeX());
471-
configuration.get(CLIENT, "atmBarModeY", 1).set(RocketEventHandler.atmBar.getSizeModeY());
472-
configuration.save();
473-
}
474-
475447
@Override
476448
public void displayMessage(String msg, int time) {
477449
RocketEventHandler.setOverlay(Minecraft.getMinecraft().world.getTotalWorldTime() + time, msg);

src/main/java/zmaster587/advancedRocketry/client/render/RendererRocketAssemblingMachine.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,6 @@ public void render(TileEntity tile, double x,
6060
GL11.glTranslated(x,y,z);
6161

6262

63-
//Draw Supports
64-
GlStateManager.color(0.78f, 0.5f, 0.34f, 1f);
65-
bindTexture(girder);
66-
GlStateManager.enableDepth();
67-
GlStateManager.disableBlend();
68-
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
69-
70-
float size = 0.25f;
71-
72-
vMax = yMin/size;
73-
74-
RenderHelper.renderCubeWithUV(buffer, xOffset, 0d, zOffset, xOffset + size, yOffset + yLocation, zOffset + size, uMin, uMax, 0d, vMax);
75-
RenderHelper.renderCubeWithUV(buffer, xOffset + xSize - size, 0d, zOffset, xOffset + xSize , yOffset + yLocation, zOffset + size, uMin, uMax, vMin, vMax);
76-
RenderHelper.renderCubeWithUV(buffer, xOffset + xSize - size, 0d, zOffset + zSize - size, xOffset + xSize, yOffset + yLocation, zOffset + zSize, uMin, uMax, vMin, vMax);
77-
RenderHelper.renderCubeWithUV(buffer, xOffset, 0d, zOffset + zSize - size, xOffset + size, yOffset + yLocation, zOffset + zSize, uMin, uMax, vMin, vMax);
78-
Tessellator.getInstance().draw();
79-
80-
8163
//Draw scanning grid
8264
GlStateManager.disableLighting();
8365
GlStateManager.disableFog();
@@ -162,7 +144,25 @@ public void render(TileEntity tile, double x,
162144
RenderHelper.renderNorthFaceWithUV(buffer, zMin, xMin, yMin, xMax, yMax, uMin, uMax, vMin, vMax);
163145
RenderHelper.renderTopFaceWithUV(buffer, yMax, xMin, zMin, xMax, zMax, uMin, uMax, vMin, vMax);
164146
Tessellator.getInstance().draw();
165-
147+
148+
//Draw Supports
149+
GlStateManager.color(0.78f, 0.5f, 0.34f, 1f);
150+
bindTexture(girder);
151+
GlStateManager.enableDepth();
152+
GlStateManager.disableBlend();
153+
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
154+
155+
float size = 0.25f;
156+
157+
vMax = yMin/size;
158+
159+
RenderHelper.renderCubeWithUV(buffer, xOffset, 0d, zOffset, xOffset + size, yOffset + yLocation, zOffset + size, uMin, uMax, 0d, vMax);
160+
RenderHelper.renderCubeWithUV(buffer, xOffset + xSize - size, 0d, zOffset, xOffset + xSize , yOffset + yLocation, zOffset + size, uMin, uMax, vMin, vMax);
161+
RenderHelper.renderCubeWithUV(buffer, xOffset + xSize - size, 0d, zOffset + zSize - size, xOffset + xSize, yOffset + yLocation, zOffset + zSize, uMin, uMax, vMin, vMax);
162+
RenderHelper.renderCubeWithUV(buffer, xOffset, 0d, zOffset + zSize - size, xOffset + size, yOffset + yLocation, zOffset + zSize, uMin, uMax, vMin, vMax);
163+
Tessellator.getInstance().draw();
164+
165+
166166

167167
GlStateManager.alphaFunc(GL11.GL_GEQUAL, 0.1f);
168168
GlStateManager.enableDepth();

src/main/java/zmaster587/advancedRocketry/entity/EntityRocket.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,10 +2248,8 @@ public List<ModuleBase> getModules(int ID, EntityPlayer player) {
22482248
modules.add(new ModuleImage(173, 168, new IconResource(98, 168, 78, 3, CommonResources.genericBackground)));
22492249
}
22502250

2251-
//Fuel
2252-
modules.add(new ModuleProgress(192, 7, 0, new ProgressBarImage(2, 173, 12, 71, 17, 6, 3, 69, 1, 1, EnumFacing.UP, TextureResources.rocketHud), this));
2253-
22542251
//TODO DEBUG tiles!
2252+
//Render TEs in a pan-able list y-axis only
22552253
List<TileEntity> tiles = storage.getGUITiles();
22562254
List<ModuleBase> panModules = new ArrayList<>();
22572255
for(int i = 0; i < tiles.size(); i++) {
@@ -2265,6 +2263,9 @@ public List<ModuleBase> getModules(int ID, EntityPlayer player) {
22652263
}
22662264
modules.add(new ModuleContainerPanYOnly(8, 17, panModules, new LinkedList<>(), null, 171, 40, 0, 0));
22672265

2266+
//Fuel
2267+
modules.add(new ModuleProgress(192, 7, 0, new ProgressBarImage(2, 173, 12, 71, 17, 6, 3, 69, 1, 1, EnumFacing.UP, TextureResources.rocketHud), this));
2268+
22682269

22692270
//Add buttons
22702271
modules.add(new ModuleButton(180, 140, 0, LibVulpes.proxy.getLocalizedString("msg.entity.rocket.disass"), this, zmaster587.libVulpes.inventory.TextureResources.buttonBuild, 64, 20));

src/main/java/zmaster587/advancedRocketry/event/RocketEventHandler.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -477,48 +477,6 @@ else if(ItemAirUtils.INSTANCE.isStackValidAirContainer(chestPiece))
477477
}
478478
}
479479

480-
@SubscribeEvent
481-
public void mouseInputEvent(MouseInputEvent event) {
482-
if(!ARConfiguration.getCurrentConfig().lockUI && !Mouse.isGrabbed()) {
483-
484-
if(Mouse.isButtonDown(2)) {
485-
ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft());
486-
int i = scaledresolution.getScaledWidth();
487-
int j = scaledresolution.getScaledHeight();
488-
int mouseX = Mouse.getX() * i / Minecraft.getMinecraft().displayWidth;
489-
int mouseY = j - Mouse.getY() * j / Minecraft.getMinecraft().displayHeight - 1;
490-
491-
if(currentlySelectedBox == null && mouseX >= suitPanel.getX(i) && mouseX < suitPanel.getX(i) + suitPanel.sizeX &&
492-
mouseY >= suitPanel.getY(j) && mouseY < suitPanel.getY(j) + suitPanel.sizeY) {
493-
currentlySelectedBox = suitPanel;
494-
}
495-
496-
if(currentlySelectedBox == null && mouseX >= oxygenBar.getX(i) && mouseX < oxygenBar.getX(i) + oxygenBar.sizeX &&
497-
mouseY >= oxygenBar.getY(j) && mouseY < oxygenBar.getY(j) + oxygenBar.sizeY) {
498-
currentlySelectedBox = oxygenBar;
499-
}
500-
501-
if(currentlySelectedBox == null && mouseX >= hydrogenBar.getX(i) && mouseX < hydrogenBar.getX(i) + hydrogenBar.sizeX &&
502-
mouseY >= hydrogenBar.getY(j) && mouseY < hydrogenBar.getY(j) + hydrogenBar.sizeY) {
503-
currentlySelectedBox = hydrogenBar;
504-
}
505-
506-
if(currentlySelectedBox == null && mouseX >= atmBar.getX(i) && mouseX < atmBar.getX(i) + atmBar.sizeX &&
507-
mouseY >= atmBar.getY(j) && mouseY < atmBar.getY(j) + atmBar.sizeY) {
508-
currentlySelectedBox = atmBar;
509-
}
510-
511-
if(currentlySelectedBox != null) {
512-
513-
currentlySelectedBox.setRenderX(mouseX, i);
514-
currentlySelectedBox.setRenderY(mouseY, j);
515-
}
516-
}
517-
else
518-
currentlySelectedBox = null;
519-
}
520-
}
521-
522480
private void renderModuleSlots(@Nonnull ItemStack armorStack, int slot, RenderGameOverlayEvent event) {
523481
int index = 1;
524482
float color = 0.85f + 0.15F*MathHelper.sin( 2f*(float)Math.PI*((Minecraft.getMinecraft().world.getTotalWorldTime()) % 60)/60f );

src/main/java/zmaster587/advancedRocketry/tile/multiblock/TileSpaceElevator.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.minecraft.block.state.IBlockState;
44
import net.minecraft.entity.Entity;
55
import net.minecraft.entity.player.EntityPlayer;
6+
import net.minecraft.init.Blocks;
67
import net.minecraft.item.ItemStack;
78
import net.minecraft.nbt.NBTTagCompound;
89
import net.minecraft.tileentity.TileEntity;
@@ -45,16 +46,16 @@ public class TileSpaceElevator extends TileMultiPowerConsumer implements IModula
4546
Object[][][] structure =
4647
{
4748
{
48-
{null,null,null,'P','c','P',null,null,null},
49-
{"blockSteel",null,null,"slab","slab","slab",null,null,"blockSteel"},
50-
{null,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,null},
51-
{null,"slab",LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,"slab",null},
49+
{Blocks.AIR,Blocks.AIR,Blocks.AIR,'P','c','P',Blocks.AIR,Blocks.AIR,Blocks.AIR},
50+
{"blockSteel",Blocks.AIR,Blocks.AIR,"slab","slab","slab",Blocks.AIR,Blocks.AIR,"blockSteel"},
51+
{Blocks.AIR,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,Blocks.AIR},
52+
{Blocks.AIR,"slab",LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,"slab",Blocks.AIR},
5253
{"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,LibVulpesBlocks.blockAdvStructureBlock,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab"},
5354
{"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,LibVulpesBlocks.motors,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab"},
5455
{"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,LibVulpesBlocks.blockAdvStructureBlock,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab"},
55-
{null,"slab",LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,"slab",null},
56-
{null,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,null},
57-
{"blockSteel",null,null,"slab","slab","slab",null,null,"blockSteel"}
56+
{Blocks.AIR,"slab",LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,"slab",Blocks.AIR},
57+
{Blocks.AIR,LibVulpesBlocks.blockAdvStructureBlock,"slab","slab","slab","slab","slab",LibVulpesBlocks.blockAdvStructureBlock,Blocks.AIR},
58+
{"blockSteel",Blocks.AIR,Blocks.AIR,"slab","slab","slab",Blocks.AIR,Blocks.AIR,"blockSteel"}
5859
}
5960
};
6061

@@ -78,8 +79,7 @@ public TileSpaceElevator() {
7879
}
7980

8081
@Override
81-
public void deconstructMultiBlock(World world, BlockPos destroyedPos,
82-
boolean blockBroken, IBlockState state) {
82+
public void deconstructMultiBlock(World world, BlockPos destroyedPos, boolean blockBroken, IBlockState state) {
8383
super.deconstructMultiBlock(world, destroyedPos, blockBroken, state);
8484

8585
Entity entity = getCapsuleOnLine();
@@ -232,7 +232,7 @@ public EntityElevatorCapsule getCapsuleOnLine() {
232232

233233
double capsulePosX = getLandingLocationX();
234234
double capsulePosZ = getLandingLocationZ();
235-
for (EntityElevatorCapsule e :world.getEntitiesWithinAABB(EntityElevatorCapsule.class, new AxisAlignedBB(capsulePosX - 3, getPos().getY() - 1, capsulePosZ - 3, capsulePosX + 3, EntityElevatorCapsule.MAX_HEIGHT, capsulePosZ + 3))) {
235+
for (EntityElevatorCapsule e :world.getEntitiesWithinAABB(EntityElevatorCapsule.class, new AxisAlignedBB(capsulePosX - 3, 0, capsulePosZ - 3, capsulePosX + 3, EntityElevatorCapsule.MAX_HEIGHT, capsulePosZ + 3))) {
236236
if(!e.isInMotion() && !e.isDead)
237237
capsule = e;
238238
}
@@ -349,8 +349,6 @@ public boolean onLinkComplete(@Nonnull ItemStack item, TileEntity entity,
349349
this.markDirty();
350350
this.world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 3);
351351
this.isTetherConnected = true;
352-
setMachineRunning(true);
353-
setMachineEnabled(true);
354352

355353
return true;
356354
}

0 commit comments

Comments
 (0)