diff --git a/build.gradle b/build.gradle index 41764da9f..486d4a485 100644 --- a/build.gradle +++ b/build.gradle @@ -13,35 +13,19 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '0.0.4' -group = 'com.simibubi.create' // http://maven.apache.org/guides/mini/guide-naming-conventions.html +version = 'mc1.14.4_v0.0.5' +group = 'com.simibubi.create' archivesBaseName = 'create' -sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { - // The mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD Snapshot are built nightly. - // stable_# Stables are built at the discretion of the MCP team. - // Use non-default mappings at your own risk. they may not always work. - // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'snapshot', version: '20190725-1.14.3' - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. + mappings channel: 'snapshot', version: '20190806-1.14.3' - // accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg') - - // Default run configurations. - // These can be tweaked, removed, or duplicated as needed. - runs { - client { + runs { + client { workingDirectory project.file('run') - - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' - + property 'forge.logging.console.level', 'info' mods { create { source sourceSets.main @@ -51,13 +35,7 @@ minecraft { server { workingDirectory project.file('run') - - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' - + property 'forge.logging.console.level', 'info' mods { create { source sourceSets.main @@ -67,15 +45,9 @@ minecraft { data { workingDirectory project.file('run') - - // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console property 'forge.logging.console.level', 'debug' - args '--mod', 'create', '--all', '--output', file('src/generated/resources/') - mods { create { source sourceSets.main @@ -86,38 +58,15 @@ minecraft { } dependencies { - // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed - // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. - // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.14.4-28.0.14' - - // You may put jars on which you depend on in ./libs or you may define them like so.. - // compile "some.group:artifact:version:classifier" - // compile "some.group:artifact:version" - - // Real examples - // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env - // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env - - // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. - // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // These dependencies get remapped to your current MCP mappings - // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // For more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html - + minecraft 'net.minecraftforge:forge:1.14.4-28.0.45' } -// Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "create", "Specification-Vendor": "simibubi", - "Specification-Version": "1", // We are version 1 of ourselves + "Specification-Version": "1", "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"simibubi", diff --git a/src/main/java/com/simibubi/create/AdvancementListener.java b/src/main/java/com/simibubi/create/AdvancementListener.java index 050449124..d71bcf4ca 100644 --- a/src/main/java/com/simibubi/create/AdvancementListener.java +++ b/src/main/java/com/simibubi/create/AdvancementListener.java @@ -12,7 +12,7 @@ public class AdvancementListener { @SubscribeEvent public static void onAdvancementGet(AdvancementEvent event) { - PlayerEntity player = event.getEntityPlayer(); + PlayerEntity player = event.getPlayer(); if (player == null) return; if (player.getServer() == null) @@ -36,9 +36,9 @@ public class AdvancementListener { } private static void unlockWhen(String advancement, ResourceLocation recipe, AdvancementEvent event) { - AdvancementManager advancements = event.getEntityPlayer().getServer().getAdvancementManager(); + AdvancementManager advancements = event.getPlayer().getServer().getAdvancementManager(); if (event.getAdvancement() == advancements.getAdvancement(new ResourceLocation(advancement))) - event.getEntityPlayer().unlockRecipes(new ResourceLocation[] { recipe }); + event.getPlayer().unlockRecipes(new ResourceLocation[] { recipe }); } private static ResourceLocation recipeOf(AllItems item) { diff --git a/src/main/java/com/simibubi/create/AllContainers.java b/src/main/java/com/simibubi/create/AllContainers.java index ef2d23cd2..6c78fc068 100644 --- a/src/main/java/com/simibubi/create/AllContainers.java +++ b/src/main/java/com/simibubi/create/AllContainers.java @@ -25,7 +25,9 @@ import net.minecraftforge.fml.network.IContainerFactory; public enum AllContainers { SchematicTable(SchematicTableContainer::new), - Schematicannon(SchematicannonContainer::new); + Schematicannon(SchematicannonContainer::new), + + ; public ContainerType type; private IFactory factory; diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 3abc61bb0..5cfc0cbc5 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -39,7 +39,9 @@ public enum AllItems { TREE_FERTILIZER(new TreeFertilizerItem(standardProperties())), EMPTY_BLUEPRINT(new Item(standardProperties().maxStackSize(1))), BLUEPRINT_AND_QUILL(new BlueprintAndQuillItem(standardProperties().maxStackSize(1))), - BLUEPRINT(new BlueprintItem(standardProperties())); + BLUEPRINT(new BlueprintItem(standardProperties())), + + ; public Item item; diff --git a/src/main/java/com/simibubi/create/AllRecipes.java b/src/main/java/com/simibubi/create/AllRecipes.java index 7f025be89..53b26148c 100644 --- a/src/main/java/com/simibubi/create/AllRecipes.java +++ b/src/main/java/com/simibubi/create/AllRecipes.java @@ -10,7 +10,9 @@ import net.minecraftforge.event.RegistryEvent; public enum AllRecipes { - Placement_Handgun_Upgrade(BuilderGunUpgradeRecipe.Serializer::new); + Placement_Handgun_Upgrade(BuilderGunUpgradeRecipe.Serializer::new), + + ; public IRecipeSerializer serializer; public Supplier> supplier; diff --git a/src/main/java/com/simibubi/create/AllSpecialTextures.java b/src/main/java/com/simibubi/create/AllSpecialTextures.java index e843f97bb..07ec79251 100644 --- a/src/main/java/com/simibubi/create/AllSpecialTextures.java +++ b/src/main/java/com/simibubi/create/AllSpecialTextures.java @@ -5,7 +5,9 @@ import net.minecraft.util.ResourceLocation; public enum AllSpecialTextures { - Selection("selection.png"); + Selection("selection.png"), + + ; public static final String ASSET_PATH = "textures/special/"; private ResourceLocation location; diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 1d01d9aea..fc4b52825 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -17,6 +17,9 @@ import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.event.TickEvent.ClientTickEvent; +import net.minecraftforge.event.TickEvent.Phase; +import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.DistExecutor; @@ -24,8 +27,6 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; -import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.server.FMLServerStoppingEvent; @@ -37,7 +38,7 @@ public class Create { public static final String ID = "create"; public static final String NAME = "Create"; - public static final String VERSION = "0.0.4"; + public static final String VERSION = "0.0.5"; public static Logger logger = LogManager.getLogger(); @@ -76,6 +77,8 @@ public class Create { @SubscribeEvent public static void onTick(ServerTickEvent event) { + if (event.phase == Phase.START) + return; sSchematicLoader.tick(); } @@ -87,6 +90,11 @@ public class Create { @OnlyIn(Dist.CLIENT) @SubscribeEvent public static void onClientTick(ClientTickEvent event) { + if (event.phase == Phase.START) + return; + if (cSchematicLoader == null) + return; + cSchematicLoader.tick(); } diff --git a/src/main/java/com/simibubi/create/foundation/gui/ScreenOpener.java b/src/main/java/com/simibubi/create/foundation/gui/ScreenOpener.java index bfb3b8e63..25acabc6b 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/ScreenOpener.java +++ b/src/main/java/com/simibubi/create/foundation/gui/ScreenOpener.java @@ -4,9 +4,9 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.Screen; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.event.TickEvent.ClientTickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; -import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; @OnlyIn(Dist.CLIENT) @EventBusSubscriber(value = Dist.CLIENT) diff --git a/src/main/java/com/simibubi/create/foundation/gui/widgets/SelectionScrollInput.java b/src/main/java/com/simibubi/create/foundation/gui/widgets/SelectionScrollInput.java index 5efc0787d..0c5fded72 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/widgets/SelectionScrollInput.java +++ b/src/main/java/com/simibubi/create/foundation/gui/widgets/SelectionScrollInput.java @@ -42,6 +42,7 @@ public class SelectionScrollInput extends ScrollInput { result.append(TextFormatting.GRAY).append("> ").append(options.get(i)); toolTip.add(result.toString()); } + toolTip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + "Scroll to Select"); } } diff --git a/src/main/java/com/simibubi/create/foundation/utility/FilesHelper.java b/src/main/java/com/simibubi/create/foundation/utility/FilesHelper.java index 61dca9899..7bcd04bbc 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/FilesHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/FilesHelper.java @@ -44,7 +44,7 @@ public class FilesHelper { } public static String slug(String name) { - return name.toLowerCase().replace(' ', '_'); + return name.toLowerCase().replace(' ', '_').replace('!', '_').replace('?', '_'); } public static boolean saveTagCompoundAsJson(CompoundNBT compound, String path) { diff --git a/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunHandler.java b/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunHandler.java index 330768892..7edfdbd06 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunHandler.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunHandler.java @@ -35,11 +35,12 @@ import net.minecraft.util.math.Vec3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RenderSpecificHandEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.TickEvent.ClientTickEvent; +import net.minecraftforge.event.TickEvent.Phase; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; -import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; @SuppressWarnings("deprecation") @EventBusSubscriber(value = Dist.CLIENT) @@ -108,6 +109,8 @@ public class BuilderGunHandler { @SubscribeEvent public static void onClientTick(ClientTickEvent event) { + if (event.phase == Phase.START) + return; if (cachedBeams == null) cachedBeams = new LinkedList<>(); ClientWorld world = Minecraft.getInstance().world; @@ -117,7 +120,7 @@ public class BuilderGunHandler { if (player == null) return; cachedBeams.removeIf(b -> b.itensity < .1f); - cachedBeams.forEach(b -> b.itensity *= .7f); + cachedBeams.forEach(b -> b.itensity *= .4f); lastLeftHandAnimation = leftHandAnimation; lastRightHandAnimation = rightHandAnimation; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunUpgradeRecipe.java b/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunUpgradeRecipe.java index 4e04036bd..d3362030f 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunUpgradeRecipe.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunUpgradeRecipe.java @@ -102,4 +102,9 @@ public class BuilderGunUpgradeRecipe implements ICraftingRecipe { } + @Override + public boolean canFit(int width, int height) { + return recipe.canFit(width, height); + } + } diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java index d68e40301..7cc1578b2 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java @@ -52,8 +52,9 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen availableSchematics = Create.cSchematicLoader.getAvailableSchematics(); + schematicsLabel = new Label(mainLeft + 36, mainTop + 26, "").withShadow(); + schematicsLabel.text = ""; if (!availableSchematics.isEmpty()) { - schematicsLabel = new Label(mainLeft + 36, mainTop + 26, "").withShadow(); schematicsArea = new SelectionScrollInput(mainLeft + 33, mainTop + 23, 134, 14).forOptions(availableSchematics) .titled("Available Schematics").writingTo(schematicsLabel); widgets.add(schematicsArea); @@ -186,9 +187,15 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen availableSchematics = Create.cSchematicLoader.getAvailableSchematics(); widgets.remove(schematicsArea); - schematicsArea = new SelectionScrollInput(guiLeft - 56 + 33, guiTop - 16 + 23, 134, 14).forOptions(availableSchematics) - .titled("Available Schematics").writingTo(schematicsLabel); - widgets.add(schematicsArea); + + if (!availableSchematics.isEmpty()) { + schematicsArea = new SelectionScrollInput(guiLeft - 56 + 33, guiTop - 16 + 23, 134, 14).forOptions(availableSchematics) + .titled("Available Schematics").writingTo(schematicsLabel); + widgets.add(schematicsArea); + } else { + schematicsArea = null; + schematicsLabel.text = ""; + } } return super.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_); diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java index 07d35d60f..0be76418a 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java @@ -102,7 +102,8 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen -#updateJSONURL=""#optional -# A URL for the "homepage" for this mod, displayed in the mod UI -# A file name (in the root of the mod JAR) containing a logo for display -# A text field displayed in the mod UI -authors="simibubi" #optional -# The description text for the mod (multi line!) (#mandatory) +modLoader="javafml" +loaderVersion="[28,)" +#issueTrackerURL="" + +[[mods]] +modId="create" +version="0.0.5" +displayName="Create" +#updateJSONURL="" +authors="simibubi" description=''' A handful of additions to aid the creative survivalist.''' -# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. -[[dependencies.examplemod]] #optional - # the modid of the dependency - modId="forge" #mandatory - # Does this dependency have to exist - if not, ordering below must be specified - mandatory=true #mandatory - # The version range of the dependency - versionRange="[27,)" #mandatory - # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory + +[[dependencies.create]] + modId="forge" + mandatory=true + versionRange="[28.0.45,)" ordering="NONE" - # Side this dependency is applied on - BOTH, CLIENT or SERVER side="BOTH" -# Here's another dependency -[[dependencies.examplemod]] + +[[dependencies.create]] modId="minecraft" mandatory=true - versionRange="[1.14.3]" + versionRange="[1.14.4]" ordering="NONE" side="BOTH" \ No newline at end of file