mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
tick off some todos
This commit is contained in:
parent
6e0e3d28fd
commit
683d18b994
9 changed files with 47 additions and 24 deletions
|
@ -59,8 +59,8 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
||||||
|
|
||||||
float stressBase = calculateAddedStressCapacity();
|
float stressBase = calculateAddedStressCapacity();
|
||||||
if (stressBase != 0 && IRotate.StressImpact.isEnabled()) {
|
if (stressBase != 0 && IRotate.StressImpact.isEnabled()) {
|
||||||
tooltip.add(new StringTextComponent(spacing).append(Lang.translate("gui.goggles.generator_stats")));
|
tooltip.add(componentSpacing.copy().append(Lang.translate("gui.goggles.generator_stats")));
|
||||||
tooltip.add(new StringTextComponent(spacing).append(Lang.translate("tooltip.capacityProvided").formatted(TextFormatting.GRAY)));
|
tooltip.add(componentSpacing.copy().append(Lang.translate("tooltip.capacityProvided").formatted(TextFormatting.GRAY)));
|
||||||
|
|
||||||
float speed = getTheoreticalSpeed();
|
float speed = getTheoreticalSpeed();
|
||||||
if (speed != getGeneratedSpeed() && speed != 0)
|
if (speed != getGeneratedSpeed() && speed != 0)
|
||||||
|
@ -69,12 +69,13 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
||||||
speed = Math.abs(speed);
|
speed = Math.abs(speed);
|
||||||
float stressTotal = stressBase * speed;
|
float stressTotal = stressBase * speed;
|
||||||
|
|
||||||
// FIXME add colours back
|
tooltip.add(
|
||||||
// String stressString = spacing + "%s" + Lang.translate("generic.unit.stress").getUnformattedComponentText() + " %s";
|
componentSpacing.copy()
|
||||||
// tooltip.add(new StringTextComponent(String.format(stressString, IHaveGoggleInformation.format(stressBase), Lang.translate("gui.goggles.base_value").getUnformattedComponentText())));
|
.append(new StringTextComponent(" " + IHaveGoggleInformation.format(stressTotal))
|
||||||
// tooltip.add(new StringTextComponent(String.format(stressString, IHaveGoggleInformation.format(stressTotal), Lang.translate("gui.goggles.at_current_speed").getUnformattedComponentText())));
|
.append(Lang.translate("generic.unit.stress"))
|
||||||
tooltip.add(componentSpacing.copy().append(new StringTextComponent(" " + IHaveGoggleInformation.format(stressTotal))
|
.formatted(TextFormatting.AQUA))
|
||||||
.append(Lang.translate("generic.unit.stress")).append(" ").formatted(TextFormatting.AQUA)).append(Lang.translate("gui.goggles.at_current_speed").formatted(TextFormatting.DARK_GRAY)));
|
.append(" ")
|
||||||
|
.append(Lang.translate("gui.goggles.at_current_speed").formatted(TextFormatting.DARK_GRAY)));
|
||||||
|
|
||||||
added = true;
|
added = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public interface IHaveGoggleInformation {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
ITextComponent capacity = Lang.translate("gui.goggles.fluid_container.capacity").formatted(TextFormatting.GRAY);
|
ITextComponent capacity = Lang.translate("gui.goggles.fluid_container.capacity").formatted(TextFormatting.GRAY);
|
||||||
ITextComponent amount = new StringTextComponent(format(tank.getTankCapacity(0)) + mb).formatted(TextFormatting.GOLD);
|
ITextComponent amount = new StringTextComponent(format(tank.getTankCapacity(0))).append(mb).formatted(TextFormatting.GOLD);
|
||||||
|
|
||||||
tooltip.add(indent.copy()
|
tooltip.add(indent.copy()
|
||||||
.append(capacity)
|
.append(capacity)
|
||||||
|
|
|
@ -54,7 +54,7 @@ public enum SequencerInstructions {
|
||||||
|
|
||||||
String formatValue(int value) {
|
String formatValue(int value) {
|
||||||
if (this == TURN_ANGLE)
|
if (this == TURN_ANGLE)
|
||||||
return value + Lang.translate("generic.unit.degrees").getUnformattedComponentText(); // FIXME
|
return value + Lang.translate("generic.unit.degrees").getString();
|
||||||
if (this == TURN_DISTANCE)
|
if (this == TURN_DISTANCE)
|
||||||
return value + "m";
|
return value + "m";
|
||||||
if (this == DELAY) {
|
if (this == DELAY) {
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class ZapperScreen extends AbstractSimiScreen {
|
||||||
|
|
||||||
protected void renderZapper(MatrixStack matrixStack) {
|
protected void renderZapper(MatrixStack matrixStack) {
|
||||||
GuiGameElement.of(zapper)
|
GuiGameElement.of(zapper)
|
||||||
.at((this.width - this.sWidth) / 2 + 200, this.height / 2 - this.sHeight / 4 + 25, -150)//TODO
|
.at((this.width - this.sWidth) / 2 + 200, this.height / 2 - this.sHeight / 4 + 25, -150)
|
||||||
.scale(4)
|
.scale(4)
|
||||||
.render(matrixStack);
|
.render(matrixStack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.util.text.TranslationTextComponent;
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
|
|
||||||
public class SchematicannonScreen extends AbstractSimiContainerScreen<SchematicannonContainer> {
|
public class SchematicannonScreen extends AbstractSimiContainerScreen<SchematicannonContainer> {
|
||||||
|
|
||||||
private static final AllGuiTextures BG_BOTTOM = AllGuiTextures.SCHEMATICANNON_BOTTOM;
|
private static final AllGuiTextures BG_BOTTOM = AllGuiTextures.SCHEMATICANNON_BOTTOM;
|
||||||
|
@ -375,12 +376,12 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
||||||
return tooltip;
|
return tooltip;
|
||||||
}
|
}
|
||||||
|
|
||||||
float f = te.fuelLevel * 100;
|
int fillPercent = (int) (te.fuelLevel * 100);
|
||||||
tooltip.add(Lang.translate(_gunpowderLevel, "" + (int) f));
|
tooltip.add(Lang.translate(_gunpowderLevel, fillPercent));
|
||||||
tooltip.add(Lang.translate(_shotsRemaining, "" + TextFormatting.BLUE + shotsLeft).formatted(GRAY)); // fixme
|
tooltip.add(Lang.translate(_shotsRemaining, new StringTextComponent(Integer.toString(shotsLeft)).formatted(BLUE)).formatted(GRAY));
|
||||||
if (shotsLeftWithItems != shotsLeft)
|
if (shotsLeftWithItems != shotsLeft)
|
||||||
tooltip
|
tooltip.add(Lang.translate(_shotsRemainingWithBackup, new StringTextComponent(Integer.toString(shotsLeftWithItems)).formatted(BLUE)).formatted(GRAY));
|
||||||
.add(Lang.translate(_shotsRemainingWithBackup, "" + TextFormatting.BLUE + shotsLeftWithItems).formatted(GRAY)); // fixme
|
|
||||||
return tooltip;
|
return tooltip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.command.arguments.EntityArgument;
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.network.play.server.SPlayerAbilitiesPacket;
|
import net.minecraft.network.play.server.SPlayerAbilitiesPacket;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
|
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||||
|
|
||||||
public class FlySpeedCommand {
|
public class FlySpeedCommand {
|
||||||
|
|
||||||
|
@ -53,7 +54,8 @@ public class FlySpeedCommand {
|
||||||
|
|
||||||
private static int sendFlySpeedUpdate(CommandContext<CommandSource> ctx, ServerPlayerEntity player, float speed) {
|
private static int sendFlySpeedUpdate(CommandContext<CommandSource> ctx, ServerPlayerEntity player, float speed) {
|
||||||
SPlayerAbilitiesPacket packet = new SPlayerAbilitiesPacket(player.abilities);
|
SPlayerAbilitiesPacket packet = new SPlayerAbilitiesPacket(player.abilities);
|
||||||
//packet.setFlySpeed(speed);TODO 1.16
|
//packet.setFlySpeed(speed);
|
||||||
|
ObfuscationReflectionHelper.setPrivateValue(SPlayerAbilitiesPacket.class, packet, speed, "field_149116_e");
|
||||||
player.connection.sendPacket(packet);
|
player.connection.sendPacket(packet);
|
||||||
|
|
||||||
ctx.getSource().sendFeedback(new StringTextComponent("Temporarily set " + player.getName().getString() + "'s Flying Speed to: " + speed), true);
|
ctx.getSource().sendFeedback(new StringTextComponent("Temporarily set " + player.getName().getString() + "'s Flying Speed to: " + speed), true);
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class PonderRegistry {
|
||||||
PonderStoryBoardEntry sb = entries.get(i);
|
PonderStoryBoardEntry sb = entries.get(i);
|
||||||
Template activeTemplate = loadSchematic(sb.getSchematicName());
|
Template activeTemplate = loadSchematic(sb.getSchematicName());
|
||||||
PonderWorld world = new PonderWorld(BlockPos.ZERO, Minecraft.getInstance().world);
|
PonderWorld world = new PonderWorld(BlockPos.ZERO, Minecraft.getInstance().world);
|
||||||
activeTemplate.placeAndNotifyListeners(world, BlockPos.ZERO, new PlacementSettings(), world.rand);//TODO 1.16 crashing
|
activeTemplate.placeAndNotifyListeners(world, BlockPos.ZERO, new PlacementSettings(), world.rand);
|
||||||
world.createBackup();
|
world.createBackup();
|
||||||
PonderScene scene = compileScene(i, sb, world);
|
PonderScene scene = compileScene(i, sb, world);
|
||||||
scene.begin();
|
scene.begin();
|
||||||
|
|
|
@ -461,7 +461,7 @@ public class PonderUI extends NavigatableSimiScreen {
|
||||||
ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90));
|
ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90));
|
||||||
ms.push();
|
ms.push();
|
||||||
ms.translate(0, 0, bounds.getZSize() * 16);
|
ms.translate(0, 0, bounds.getZSize() * 16);
|
||||||
ms.multiply(Vector3f.NEGATIVE_X.getDegreesQuaternion(-90));
|
ms.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(-90));
|
||||||
textRenderer.draw(ms, d.name().substring(0, 1), 0, 0, 0x66FFFFFF);
|
textRenderer.draw(ms, d.name().substring(0, 1), 0, 0, 0x66FFFFFF);
|
||||||
textRenderer.draw(ms, "|", 2, 10, 0x44FFFFFF);
|
textRenderer.draw(ms, "|", 2, 10, 0x44FFFFFF);
|
||||||
textRenderer.draw(ms, ".", 2, 14, 0x22FFFFFF);
|
textRenderer.draw(ms, ".", 2, 14, 0x22FFFFFF);
|
||||||
|
|
|
@ -14,11 +14,13 @@ import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
import net.minecraft.util.math.BlockRayTraceResult;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
import net.minecraft.util.math.vector.Vector3i;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -31,20 +33,29 @@ public interface IPlacementHelper {
|
||||||
BlockState ID = new BlockState(Blocks.AIR, null, null);
|
BlockState ID = new BlockState(Blocks.AIR, null, null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a predicate that gets tested with the items held in the players hands,
|
* @return a predicate that gets tested with the items held in the players hands<br>
|
||||||
* should return true if this placement helper is active with the given item
|
* should return true if this placement helper is active with the given item
|
||||||
*/
|
*/
|
||||||
Predicate<ItemStack> getItemPredicate();
|
Predicate<ItemStack> getItemPredicate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a predicate that gets tested with the blockstate the player is looking at
|
* @return a predicate that gets tested with the blockstate the player is looking at<br>
|
||||||
* should return true if this placement helper is active with the given blockstate
|
* should return true if this placement helper is active with the given blockstate
|
||||||
*/
|
*/
|
||||||
Predicate<BlockState> getStatePredicate();
|
Predicate<BlockState> getStatePredicate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PlacementOffset.fail() if no valid offset could be found.
|
*
|
||||||
* PlacementOffset.success(newPos) with newPos being the new position the block should be placed at
|
* @param player the player that activated the placement helper
|
||||||
|
* @param world the world that the placement helper got activated in
|
||||||
|
* @param state the Blockstate of the Block that the player is looking at or clicked on
|
||||||
|
* @param pos the position of the Block the player is looking at or clicked on
|
||||||
|
* @param ray the exact raytrace result
|
||||||
|
*
|
||||||
|
* @return the PlacementOffset object describing where to place the new block.<br>
|
||||||
|
* Use {@link PlacementOffset#fail} when no new position could be found.<br>
|
||||||
|
* Use {@link PlacementOffset#success(Vector3i)} with the new BlockPos to indicate a success
|
||||||
|
* and call {@link PlacementOffset#withTransform(Function)} if the blocks default state has to be modified before it is placed
|
||||||
*/
|
*/
|
||||||
PlacementOffset getOffset(PlayerEntity player, World world, BlockState state, BlockPos pos, BlockRayTraceResult ray);
|
PlacementOffset getOffset(PlayerEntity player, World world, BlockState state, BlockPos pos, BlockRayTraceResult ray);
|
||||||
|
|
||||||
|
@ -58,7 +69,15 @@ public interface IPlacementHelper {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
//only gets called when placementOffset is successful
|
/**
|
||||||
|
* overwrite this method if your placement helper needs a different rendering than the default ghost state
|
||||||
|
*
|
||||||
|
* @param pos the position of the Block the player is looking at or clicked on
|
||||||
|
* @param state the Blockstate of the Block that the player is looking at or clicked on
|
||||||
|
* @param ray the exact raytrace result
|
||||||
|
* @param offset the PlacementOffset returned by {@link #getOffset(PlayerEntity, World, BlockState, BlockPos, BlockRayTraceResult)}<br>
|
||||||
|
* the offset will always be successful if this method is called
|
||||||
|
*/
|
||||||
default void renderAt(BlockPos pos, BlockState state, BlockRayTraceResult ray, PlacementOffset offset) {
|
default void renderAt(BlockPos pos, BlockState state, BlockRayTraceResult ray, PlacementOffset offset) {
|
||||||
displayGhost(offset);
|
displayGhost(offset);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue