Skip to content

Commit

Permalink
Rename Mod Id to block_renderer + Remove Jenkinsfile
Browse files Browse the repository at this point in the history
---

Signed-off-by: AterAnimAvis <[email protected]>
  • Loading branch information
AterAnimAvis committed May 7, 2020
1 parent 8d8f6de commit b985da1
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 74 deletions.
5 changes: 0 additions & 5 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply plugin: 'net.minecraftforge.gradle'

group = "com.unascribed"
archivesBaseName = "BlockRenderer"
version = "1.15.2-1.1.0"
version = "1.15.2-1.2.0"

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.VERSION_1_8

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/unascribed/blockrenderer/BlockRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ public void onFrameStart(TickEvent.RenderTickEvent e) {
renderStack(player.getHeldItemMainhand());
return;
}
addMessage(new TranslationTextComponent("msg.blockrenderer.notContainer"));
addMessage(new TranslationTextComponent("msg.block_renderer.notContainer"));
return;
}

if (hovered == null) {
addMessage(new TranslationTextComponent("msg.blockrenderer.slot.absent"));
addMessage(new TranslationTextComponent("msg.block_renderer.slot.absent"));
return;
}

ItemStack stack = hovered.getStack();

if (stack.isEmpty()) {
addMessage(new TranslationTextComponent("msg.blockrenderer.slot.empty"));
addMessage(new TranslationTextComponent("msg.block_renderer.slot.empty"));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/unascribed/blockrenderer/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public interface Reference {

String MOD_ID = "blockrenderer";
String MOD_ID = "block_renderer";
String NAME = "BlockRenderer";
String VERSION = "1.0.0";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Mod.EventBusSubscriber(modid = MOD_ID, bus = Bus.MOD)
public interface Keybindings {

KeyBinding render = new KeyBinding("key.blockrenderer.render", GLFW.GLFW_KEY_GRAVE_ACCENT, "key.categories.blockrenderer");
KeyBinding render = new KeyBinding("key.block_renderer.render", GLFW.GLFW_KEY_GRAVE_ACCENT, "key.categories.block_renderer");

@SubscribeEvent
static void register(FMLClientSetupEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class BulkRenderer {

public static <T> void bulkRender(IRenderer<T> renderer, String spec, List<T> renders, int size, boolean useId, boolean addSize) {
if (renders.size() < 1) {
addMessage(new TranslationTextComponent("msg.blockrenderer.bulk.noItems", spec));
addMessage(new TranslationTextComponent("msg.block_renderer.bulk.noItems", spec));
return;
}

Expand All @@ -39,7 +39,7 @@ public static <T> void bulkRender(IRenderer<T> renderer, String spec, List<T> re

String sizeString = addSize ? size + "x" + size + "_" : "";
File folder = new File(DEFAULT_FOLDER, dateTime() + "_" + sizeString + sanitize(spec) + "/");
String title = I18n.format("blockrenderer.gui.rendering", total, spec);
String title = I18n.format("block_renderer.gui.rendering", total, spec);

long start = Util.milliTime();

Expand All @@ -63,7 +63,7 @@ public static <T> void bulkRender(IRenderer<T> renderer, String spec, List<T> re
if (Util.milliTime() - lastUpdate > 33) {
renderer.teardown();

renderLoading(renderer, title, I18n.format("blockrenderer.gui.progress", rendered, total, (total - rendered)), value, (float)rendered/ total);
renderLoading(renderer, title, I18n.format("block_renderer.gui.progress", rendered, total, (total - rendered)), value, (float)rendered/ total);

lastUpdate = Util.milliTime();
renderer.setup(size);
Expand All @@ -73,16 +73,20 @@ public static <T> void bulkRender(IRenderer<T> renderer, String spec, List<T> re
long elapsed = Util.milliTime() - start;

if (rendered >= total) {
renderLoading(renderer, I18n.format("blockrenderer.gui.rendered", total, spec), "", null, 1f);
addMessage(new TranslationTextComponent("msg.blockrenderer.bulk.finished", total, spec, asClickable(folder)));
renderLoading(renderer, I18n.format("block_renderer.gui.rendered", total, spec), "", null, 1f);
addMessage(new TranslationTextComponent("msg.block_renderer.bulk.finished", total, spec, asClickable(folder)));
} else {
renderLoading(renderer, I18n.format("blockrenderer.gui.renderCancelled"), I18n.format("blockrenderer.gui.progress", rendered, total, (total - rendered)), null, (float)rendered/ total);
addMessage(new TranslationTextComponent("msg.blockrenderer.bulk.cancelled", rendered, spec, asClickable(folder), total));
renderLoading(renderer, I18n.format("block_renderer.gui.renderCancelled"), I18n.format("block_renderer.gui.progress", rendered, total, (total - rendered)), null, (float)rendered/ total);
addMessage(new TranslationTextComponent("msg.block_renderer.bulk.cancelled", rendered, spec, asClickable(folder), total));
}

if (errored > 0) addMessage(I18n.format("msg.blockrenderer.bulk.errored", errored));
if (errored > 0) {
addMessage("");
addMessage(new TranslationTextComponent("msg.block_renderer.bulk.errored", errored));
}

addMessage(new TranslationTextComponent("msg.blockrenderer.bulk.time", elapsed / 1000f));
addMessage("");
addMessage(new TranslationTextComponent("msg.block_renderer.bulk.time", elapsed / 1000f));

renderer.teardown();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ default ITextComponent save(T value, File folder, String filename) {
} catch (Exception e) {
System.err.println("Rendering: " + getId(value));
e.printStackTrace();
return new TranslationTextComponent("msg.blockrenderer.render.fail");
return new TranslationTextComponent("msg.block_renderer.render.fail");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ public void init() {

addButton(new Button(width/2-100, height/6+120, 98, 20, I18n.format("gui.cancel"), button -> minecraft.displayGuiScreen(old)));

renderButton = addButton(new Button(width/2+2, height/6+120, 98, 20, I18n.format("blockrenderer.gui.render"), this::onRender), enabled);
renderButton = addButton(new Button(width/2+2, height/6+120, 98, 20, I18n.format("block_renderer.gui.render"), this::onRender), enabled);

size = MathHelper.clamp(size, MIN_SIZE, MAX_SIZE);

SliderPercentageOption option = new SliderPercentageOption("blockrenderer.gui.renderSize", MIN_SIZE, MAX_SIZE, 1, (settings) -> size, (settings, value) -> size = round(value), this::getSliderDisplay);
SliderPercentageOption option = new SliderPercentageOption("block_renderer.gui.renderSize", MIN_SIZE, MAX_SIZE, 1, (settings) -> size, (settings, value) -> size = round(value), this::getSliderDisplay);
slider = addButton(new UpdateableSliderWidget(minecraft.gameSettings, width/2-100, height/6+80, 200, 20, option), enabled);

actualSize = addButton(new HoverableTinyButtonWidget(this, width/2+104, height/6+80, I18n.format("blockrenderer.gui.actualSize"), I18n.format("blockrenderer.gui.actualSize.tooltip"), button -> slider.update((int) minecraft.getMainWindow().getGuiScaleFactor() * 16)), enabled);
useId = addButton(new HoverableCheckboxWidget(this, width/2-100, height / 6 + 144, 98, 20, I18n.format("blockrenderer.gui.useId"), I18n.format("blockrenderer.gui.useId.tooltip"), false), enabled);
addSize = addButton(new HoverableCheckboxWidget(this, width/2+2, height / 6 + 144, 98, 20, I18n.format("blockrenderer.gui.addSize"), I18n.format("blockrenderer.gui.addSize.tooltip"), false), enabled);
actualSize = addButton(new HoverableTinyButtonWidget(this, width/2+104, height/6+80, I18n.format("block_renderer.gui.actualSize"), I18n.format("block_renderer.gui.actualSize.tooltip"), button -> slider.update((int) minecraft.getMainWindow().getGuiScaleFactor() * 16)), enabled);
useId = addButton(new HoverableCheckboxWidget(this, width/2-100, height / 6 + 144, 98, 20, I18n.format("block_renderer.gui.useId"), I18n.format("block_renderer.gui.useId.tooltip"), false), enabled);
addSize = addButton(new HoverableCheckboxWidget(this, width/2+2, height / 6 + 144, 98, 20, I18n.format("block_renderer.gui.addSize"), I18n.format("block_renderer.gui.addSize.tooltip"), false), enabled);
}

protected int round(double value) {
Expand Down Expand Up @@ -87,7 +87,7 @@ public void render(int mouseX, int mouseY, float partialTicks) {

if (minecraft.world != null) return;

drawCenteredString(minecraft.fontRenderer, I18n.format("blockrenderer.gui.noWorld"), width/2, height/6+30, 0xFF5555);
drawCenteredString(minecraft.fontRenderer, I18n.format("block_renderer.gui.noWorld"), width/2, height/6+30, 0xFF5555);
}

abstract void onRender(Button button);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class EnterNamespaceScreen extends BaseScreen {

private static final TranslationTextComponent TITLE = new TranslationTextComponent("blockrenderer.gui.namespace");
private static final TranslationTextComponent TITLE = new TranslationTextComponent("block_renderer.gui.namespace");

private boolean emptySpec = false;

Expand All @@ -34,7 +34,7 @@ public void init() {

String oldText = (text == null ? prefill : text.getText());

text = addButton(new TextFieldWidget(minecraft.fontRenderer, width/2-100, height/6+50, 200, 20, I18n.format("blockrenderer.gui.namespace")), enabled);
text = addButton(new TextFieldWidget(minecraft.fontRenderer, width/2-100, height/6+50, 200, 20, I18n.format("block_renderer.gui.namespace")), enabled);
text.setText(oldText);
text.setFocused2(true);
text.setCanLoseFocus(false);
Expand Down Expand Up @@ -66,7 +66,7 @@ public void render(int mouseX, int mouseY, float partialTicks) {

if (!emptySpec) return;

drawCenteredString(minecraft.fontRenderer, I18n.format("blockrenderer.gui.emptySpec"), width/2, height/6+30, 0xFF5555);
drawCenteredString(minecraft.fontRenderer, I18n.format("block_renderer.gui.emptySpec"), width/2, height/6+30, 0xFF5555);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class EnterSizeScreen extends BaseScreen {

private static final TranslationTextComponent TITLE = new TranslationTextComponent("blockrenderer.gui.renderItem");
private static final TranslationTextComponent TITLE = new TranslationTextComponent("block_renderer.gui.renderItem");

private final ItemStack stack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static List<ItemStack> collectStacks(Set<String> namespaces) {

try {
item.fillItemGroup(ItemGroup.SEARCH, list);
} catch (Throwable t) { LOGGER.warn("Failed to get renderable items for {}", identifier, t); }
} catch (Throwable t) { LOGGER.warn("Failed to get render-able items for {}", identifier, t); }

stacks.addAll(list);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static List<String> getTooltipFromItem(ItemStack stack) {
}

static ITextComponent getRenderSuccess(File folder, File file) {
return new TranslationTextComponent("msg.blockrenderer.render.success", asClickable(folder), asClickable(file));
return new TranslationTextComponent("msg.block_renderer.render.success", asClickable(folder), asClickable(file));
}

static ITextComponent asClickable(File file) {
Expand All @@ -85,7 +85,7 @@ static ITextComponent asClickable(File file) {
}
}

component.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TranslationTextComponent("blockrenderer.file.tooltip")));
component.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TranslationTextComponent("block_renderer.file.tooltip")));
component.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, path));
component.getStyle().setUnderlined(true);

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ modLoader="javafml"
loaderVersion="[31,)"
issueTrackerURL="https://github.com/AterAnimAvis/BlockRenderer/issues"
[[mods]]
modId="blockrenderer"
modId="block_renderer"
version="${file.jarVersion}"
displayName="BlockRenderer"
displayURL="https://unascribed.com"
Expand Down
39 changes: 39 additions & 0 deletions src/main/resources/assets/block_renderer/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"key.block_renderer.render":"Render",
"key.categories.block_renderer":"BlockRenderer",

"msg.block_renderer.render.fail":"Rendering failed, see game output for details",
"msg.block_renderer.render.success":"Successfully rendered to %2$s in %1$s",

"msg.block_renderer.bulk.cancelled":"Operation cancelled, rendered %1$s from a total of %4$s entries from %2$s in %3$s",
"msg.block_renderer.bulk.finished":"Rendered %1$s entries from %2$s in %3$s",
"msg.block_renderer.bulk.errored":"%1$s entries errored, See game output for details",
"msg.block_renderer.bulk.time":"Total time: %1$s seconds",
"msg.block_renderer.bulk.noItems":"No items for Namespace '%1$s'",

"msg.block_renderer.slot.empty":"That slot has no item",
"msg.block_renderer.slot.absent":"There's no slot there",
"msg.block_renderer.notContainer":"Can't find an item to render",

"block_renderer.file.tooltip":"Click to Open",

"block_renderer.gui.renderItem":"Render Item",
"block_renderer.gui.namespace":"Enter Namespace",
"block_renderer.gui.noWorld":"You must be in a world to render items",
"block_renderer.gui.emptySpec":"You need to enter a Namespace",

"block_renderer.gui.render":"Render",
"block_renderer.gui.renderSize":"Size",

"block_renderer.gui.useId":"Identifier",
"block_renderer.gui.addSize":"Size",
"block_renderer.gui.actualSize":"Actual Size",
"block_renderer.gui.useId.tooltip":"Use Identifier for Filename",
"block_renderer.gui.addSize.tooltip":"Add Size to Filename",
"block_renderer.gui.actualSize.tooltip":"Set to actual size (Based on GUI Scale)",

"block_renderer.gui.rendering":"Rendering %1$s entries from %2$s",
"block_renderer.gui.rendered":"Rendered %1$s entries from %2$s",
"block_renderer.gui.renderCancelled":"Operation cancelled",
"block_renderer.gui.progress":"(%1$s/%2$s, %3$s to go)"
}
39 changes: 0 additions & 39 deletions src/main/resources/assets/blockrenderer/lang/en_us.json

This file was deleted.

0 comments on commit b985da1

Please sign in to comment.